Various color fixes
-
help colorin 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.accessiblein Lua is fixed. - Invalid
invcolors 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
names 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
names 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_GetColorByNameandR_GetSuperColorByNameboth returnSKINCOLOR_NONErather thanSKINCOLOR_GREEN/SKINCOLOR_SUPERGOLD1if no color is found.- Usecase is for scripters to quickly check if a color name is already taken
- The relevant
S_SKINparsing forPREFCOLOR,PREFOPPOSITECOLOR, andSUPERCOLORaccount for this change and fall back on the defaults. -
R_GetSuperColorByNameis also exposed to Lua.
- Other minor changes to Lua custom skincolor setting. The warning for a
namewith 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 havingaccessiblechanged was removed (standard skincolors are already read-only to Lua).
Edited by Kays Ishaq