Various color fixes
-
help color
in the console now only shows accessible colors as possible values - previously, it showed inaccessible colors including super colors and about 1000 blank freeslots. - Bugged setting of
skincolor.accessible
in Lua is fixed. - Invalid
invcolor
s are accounted for in SOC and Lua custom skincolor definitions. This fixes a sigsegv that can be caused by haphazard scripting.- SOC will fall back on
SKINCOLOR_GREEN
, while Lua returns an error.
- SOC will fall back on
- Duplicate
name
s bring up a warning in SOC and Lua custom skincolor definitions.- SOC will attempt to rename the new skincolor, while Lua simply prints a warning in the console.
- Empty string
name
s aren't checked for duplicates, as they may be used for situations where the name doesn't matter (e.g., a skincolor not intended for player use)
-
R_GetColorByName
andR_GetSuperColorByName
both returnSKINCOLOR_NONE
rather thanSKINCOLOR_GREEN
/SKINCOLOR_SUPERGOLD1
if no color is found.- Usecase is for scripters to quickly check if a color name is already taken
- The relevant
S_SKIN
parsing forPREFCOLOR
,PREFOPPOSITECOLOR
, andSUPERCOLOR
account for this change and fall back on the defaults. -
R_GetSuperColorByName
is also exposed to Lua.
- Other minor changes to Lua custom skincolor setting. The warning for a
name
with spaces exists for both setting by table and setting by field (previously only existed setting by field). In addition, it isn't checked until after thename
's potential truncation, which may remove the offending spaces anyways. A redundant check to prevent standard skincolors from havingaccessible
changed was removed (standard skincolors are already read-only to Lua).
Edited by Kays Ishaq