mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 05:33:00 +00:00 
			
		
		
		
	Added checks to window.setTextColor and window.setBackgroundColor
This commit is contained in:
		| @@ -270,6 +270,11 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible ) | |||||||
|     end |     end | ||||||
|  |  | ||||||
|     local function setTextColor( color ) |     local function setTextColor( color ) | ||||||
|  |         if type(color) ~= "number" then | ||||||
|  |             error( "Expected number", 3 ) | ||||||
|  |         elseif tHex[color] == nil then | ||||||
|  |             error( "Invalid color", 3 ) | ||||||
|  |         end | ||||||
|         nTextColor = color |         nTextColor = color | ||||||
|         if bVisible then |         if bVisible then | ||||||
|             updateCursorColor() |             updateCursorColor() | ||||||
| @@ -312,6 +317,11 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible ) | |||||||
|     window.getPaletteColor = window.getPaletteColour |     window.getPaletteColor = window.getPaletteColour | ||||||
|  |  | ||||||
|     local function setBackgroundColor( color ) |     local function setBackgroundColor( color ) | ||||||
|  |         if type(color) ~= "number" then | ||||||
|  |             error( "Expected number", 3 ) | ||||||
|  |         elseif tHex[color] == nil then | ||||||
|  |             error( "Invalid color", 3 ) | ||||||
|  |         end | ||||||
|         nBackgroundColor = color |         nBackgroundColor = color | ||||||
|     end |     end | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Daniel Ratcliffe
					Daniel Ratcliffe