mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 13:42:59 +00:00 
			
		
		
		
	Better Error for "Invalid color"
the "Invalid color" error now contain the wrong color.
This commit is contained in:
		 Wilma456 (Jakob0815)
					Wilma456 (Jakob0815)
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							94d701b1f7
						
					
				
				
					commit
					43a5fc9fe7
				
			| @@ -274,7 +274,7 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible ) | |||||||
|         if type( color ) ~= "number" then  |         if type( color ) ~= "number" then  | ||||||
|             error( "bad argument #1 (expected number, got " .. type( color ) .. ")", 2 ) |             error( "bad argument #1 (expected number, got " .. type( color ) .. ")", 2 ) | ||||||
|         elseif tHex[color] == nil then |         elseif tHex[color] == nil then | ||||||
|             error( "Invalid color", 2 ) |             error( "Invalid color (got " .. color .. ")" , 2 ) | ||||||
|         end |         end | ||||||
|         nTextColor = color |         nTextColor = color | ||||||
|         if bVisible then |         if bVisible then | ||||||
| @@ -321,7 +321,7 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible ) | |||||||
|         if type( color ) ~= "number" then |         if type( color ) ~= "number" then | ||||||
|             error( "bad argument #1 (expected number, got " .. type( color ) .. ")", 2 ) |             error( "bad argument #1 (expected number, got " .. type( color ) .. ")", 2 ) | ||||||
|         elseif tHex[color] == nil then |         elseif tHex[color] == nil then | ||||||
|             error( "Invalid color", 3 ) |             error( "Invalid color (got " .. color .. ")", 2 ) | ||||||
|         end |         end | ||||||
|         nBackgroundColor = color |         nBackgroundColor = color | ||||||
|     end |     end | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user