- added separate automap color for non-counting monsters.

- fixed: using a nonexistent CVAR in a ColorPicker menu item caused a crash.
This commit is contained in:
Christoph Oelckers 2013-08-14 00:32:05 +02:00
parent c8b4fb0d3d
commit 62830f7927
3 changed files with 14 additions and 2 deletions

View file

@ -115,6 +115,7 @@ CVAR (Color, am_interlevelcolor, 0xff0000, CVAR_ARCHIVE);
CVAR (Color, am_secretsectorcolor, 0xff00ff, CVAR_ARCHIVE); CVAR (Color, am_secretsectorcolor, 0xff00ff, CVAR_ARCHIVE);
CVAR (Color, am_thingcolor_friend, 0xfcfcfc, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_friend, 0xfcfcfc, CVAR_ARCHIVE);
CVAR (Color, am_thingcolor_monster, 0xfcfcfc, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_monster, 0xfcfcfc, CVAR_ARCHIVE);
CVAR (Color, am_thingcolor_ncmonster, 0xfcfcfc, CVAR_ARCHIVE);
CVAR (Color, am_thingcolor_item, 0xfcfcfc, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_item, 0xfcfcfc, CVAR_ARCHIVE);
CVAR (Color, am_thingcolor_citem, 0xfcfcfc, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_citem, 0xfcfcfc, CVAR_ARCHIVE);
@ -134,6 +135,7 @@ CVAR (Color, am_ovsecretsectorcolor,0x00ffff, CVAR_ARCHIVE);
CVAR (Color, am_ovthingcolor, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor, 0xe88800, CVAR_ARCHIVE);
CVAR (Color, am_ovthingcolor_friend, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor_friend, 0xe88800, CVAR_ARCHIVE);
CVAR (Color, am_ovthingcolor_monster, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor_monster, 0xe88800, CVAR_ARCHIVE);
CVAR (Color, am_ovthingcolor_ncmonster, 0xe88800, CVAR_ARCHIVE);
CVAR (Color, am_ovthingcolor_item, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor_item, 0xe88800, CVAR_ARCHIVE);
CVAR (Color, am_ovthingcolor_citem, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor_citem, 0xe88800, CVAR_ARCHIVE);
@ -190,6 +192,7 @@ static const char *ColorNames[] = {
"ThingColor_Item", "ThingColor_Item",
"ThingColor_CountItem", "ThingColor_CountItem",
"ThingColor_Monster", "ThingColor_Monster",
"ThingColor_NocountMonster",
"ThingColor_Friend", "ThingColor_Friend",
"SpecialWallColor", "SpecialWallColor",
"SecretWallColor", "SecretWallColor",
@ -219,6 +222,7 @@ struct AMColorset
ThingColor_Item, ThingColor_Item,
ThingColor_CountItem, ThingColor_CountItem,
ThingColor_Monster, ThingColor_Monster,
ThingColor_NocountMonster,
ThingColor_Friend, ThingColor_Friend,
SpecialWallColor, SpecialWallColor,
SecretWallColor, SecretWallColor,
@ -318,6 +322,7 @@ static FColorCVar *cv_standard[] = {
&am_thingcolor_item, &am_thingcolor_item,
&am_thingcolor_citem, &am_thingcolor_citem,
&am_thingcolor_monster, &am_thingcolor_monster,
&am_thingcolor_ncmonster,
&am_thingcolor_friend, &am_thingcolor_friend,
&am_specialwallcolor, &am_specialwallcolor,
&am_secretwallcolor, &am_secretwallcolor,
@ -342,6 +347,7 @@ static FColorCVar *cv_overlay[] = {
&am_ovthingcolor_item, &am_ovthingcolor_item,
&am_ovthingcolor_citem, &am_ovthingcolor_citem,
&am_ovthingcolor_monster, &am_ovthingcolor_monster,
&am_ovthingcolor_ncmonster,
&am_ovthingcolor_friend, &am_ovthingcolor_friend,
&am_ovspecialwallcolor, &am_ovspecialwallcolor,
&am_ovsecretwallcolor, &am_ovsecretwallcolor,
@ -368,6 +374,7 @@ static unsigned char DoomColors[]= {
0x74,0xfc,0x6c, // thingcolor_item 0x74,0xfc,0x6c, // thingcolor_item
0x74,0xfc,0x6c, // thingcolor_citem 0x74,0xfc,0x6c, // thingcolor_citem
0x74,0xfc,0x6c, // thingcolor_monster 0x74,0xfc,0x6c, // thingcolor_monster
0x74,0xfc,0x6c, // thingcolor_ncmonster
0x74,0xfc,0x6c, // thingcolor_friend 0x74,0xfc,0x6c, // thingcolor_friend
NOT_USED, // specialwallcolor NOT_USED, // specialwallcolor
NOT_USED, // secretwallcolor NOT_USED, // secretwallcolor
@ -393,6 +400,7 @@ static unsigned char StrifeColors[]= {
219, 171, 0, // thingcolor_item 219, 171, 0, // thingcolor_item
219, 171, 0, // thingcolor_citem 219, 171, 0, // thingcolor_citem
0xfc,0x00,0x00, // thingcolor_monster 0xfc,0x00,0x00, // thingcolor_monster
0xfc,0x00,0x00, // thingcolor_ncmonster
0xfc,0x00,0x00, // thingcolor_friend 0xfc,0x00,0x00, // thingcolor_friend
NOT_USED, // specialwallcolor NOT_USED, // specialwallcolor
NOT_USED, // secretwallcolor NOT_USED, // secretwallcolor
@ -418,6 +426,7 @@ static unsigned char RavenColors[]= {
236, 236, 236, // thingcolor_item 236, 236, 236, // thingcolor_item
236, 236, 236, // thingcolor_citem 236, 236, 236, // thingcolor_citem
236, 236, 236, // thingcolor_monster 236, 236, 236, // thingcolor_monster
236, 236, 236, // thingcolor_ncmonster
236, 236, 236, // thingcolor_friend 236, 236, 236, // thingcolor_friend
NOT_USED, // specialwallcolor NOT_USED, // specialwallcolor
NOT_USED, // secretwallcolor NOT_USED, // secretwallcolor
@ -2669,7 +2678,8 @@ void AM_drawThings ()
// use separate colors for special thing types // use separate colors for special thing types
if (t->flags3&MF3_ISMONSTER && !(t->flags&MF_CORPSE)) if (t->flags3&MF3_ISMONSTER && !(t->flags&MF_CORPSE))
{ {
if (t->flags & MF_FRIENDLY || !(t->flags & MF_COUNTKILL)) color = AMColors[AMColors.ThingColor_Friend]; if (t->flags & MF_FRIENDLY) color = AMColors[AMColors.ThingColor_Friend];
else if (!(t->flags & MF_COUNTKILL)) color = AMColors[AMColors.ThingColor_NocountMonster];
else color = AMColors[AMColors.ThingColor_Monster]; else color = AMColors[AMColors.ThingColor_Monster];
} }
else if (t->flags&MF_SPECIAL) else if (t->flags&MF_SPECIAL)

View file

@ -763,7 +763,7 @@ public:
: FOptionMenuItem(label, menu) : FOptionMenuItem(label, menu)
{ {
FBaseCVar *cv = FindCVar(menu, NULL); FBaseCVar *cv = FindCVar(menu, NULL);
if (cv->GetRealType() == CVAR_Color) if (cv != NULL && cv->GetRealType() == CVAR_Color)
{ {
mCVar = (FColorCVar*)cv; mCVar = (FColorCVar*)cv;
} }

View file

@ -1019,6 +1019,7 @@ OptionMenu MapColorMenu
ColorPicker "Secret walls", "am_secretwallcolor" ColorPicker "Secret walls", "am_secretwallcolor"
ColorPicker "Actors", "am_thingcolor" ColorPicker "Actors", "am_thingcolor"
ColorPicker "Monsters", "am_thingcolor_monster" ColorPicker "Monsters", "am_thingcolor_monster"
ColorPicker "non-counting Monsters", "am_thingcolor_ncmonster"
ColorPicker "Friends", "am_thingcolor_friend" ColorPicker "Friends", "am_thingcolor_friend"
ColorPicker "Items", "am_thingcolor_item" ColorPicker "Items", "am_thingcolor_item"
ColorPicker "Count Items", "am_thingcolor_citem" ColorPicker "Count Items", "am_thingcolor_citem"
@ -1041,6 +1042,7 @@ OptionMenu MapColorMenu
ColorPicker "Secret walls", "am_ovsecretwallcolor" ColorPicker "Secret walls", "am_ovsecretwallcolor"
ColorPicker "Actors", "am_ovthingcolor" ColorPicker "Actors", "am_ovthingcolor"
ColorPicker "Monsters", "am_ovthingcolor_monster" ColorPicker "Monsters", "am_ovthingcolor_monster"
ColorPicker "non-counting Monsters", "am_ovthingcolor_ncmonster"
ColorPicker "Friends", "am_ovthingcolor_friend" ColorPicker "Friends", "am_ovthingcolor_friend"
ColorPicker "Items", "am_ovthingcolor_item" ColorPicker "Items", "am_ovthingcolor_item"
ColorPicker "Count Items", "am_ovthingcolor_citem" ColorPicker "Count Items", "am_ovthingcolor_citem"