Skip to content

Commit

Permalink
Implement am_*keycolor CVARs
Browse files Browse the repository at this point in the history
The colors of keycards and skull keys in the automap displayed when using the `IDDT` cheat can now be changed using the new `am_redkeycolor`, `am_yellowkeycolor` and `am_bluekeycolor` CVARs. These CVARs are `116` by default (such that there is no apparent difference until one of them is changed). Thanks for the suggestion Endless! (https://www.doomworld.com/forum/post/2483595)
  • Loading branch information
bradharding committed Apr 21, 2022
1 parent 6d72f76 commit 523305b
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 8 deletions.
5 changes: 3 additions & 2 deletions releasenotes.md
Expand Up @@ -11,15 +11,16 @@
* The display used to show the external automap can now be specified using the new `am_display` CVAR, which is `2` by default.
* So as to not also occur when adjusting the size of the player’s view, zooming in and out of the external automap is now only possible if the `+zoomin` and `+zoomout` actions are rebound from the <kbd><b>+</b></kbd> and <kbd><b>&ndash;</b></kbd> keys.
* The player’s stats shown in the automap when the `am_playerstats` CVAR is `on` are now positioned correctly if there are no monsters in the map.
* When a pain elemental spawns a lost soul, the number of monsters to kill displayed in the automap when the `am_playerstats` CVAR is `on` now increases.
* The colors of keycards and skull keys in the automap displayed when using the `IDDT` cheat can now be changed using the new `am_redkeycolor`, `am_yellowkeycolor` and `am_bluekeycolor` CVARs. These CVARs are `116` by default (such that there is no apparent difference until one of them is changed).
* When a pain elemental spawns a lost soul, the number of monsters the player has left to kill now increases as intended.
* The `am_followmode` CVAR will no longer be changed when enabling vanilla mode using the `vanilla` CCMD.
* Changing the `r_fov` CVAR from its default of `90`° is now effective again when the `vid_widescreen` CVAR is `off`.
* The following changes have been made when the player enters a cheat:
* More time is now given to the player to enter the `IDBEHOLD` cheat.
* Displaying the cheat in the console is now redacted.
* The cheat is now skipped in the console’s input history when pressing the <kbd><b>&uarr;</b></kbd> or <kbd><b>&darr;</b></kbd> keys.
* A warning is now displayed in the console indicating that the player cheated.
* Fade effects are no longer applied once the cheat is entered in most cases.
* Fade effects are no longer applied when entering most cheats.
* Pausing and then resuming the animation of any liquid sectors in view is now smoother when opening and then closing the console.
* The branding in the console is now positioned correctly again when the `vid_widescreen` CVAR is `on`.
* The swirling animation of liquid sectors when the `r_liquid_swirl` CVAR is `on` has been slowed down slightly to better sync with the bobbing animation when the `r_liquid_bob` CVAR is `on`.
Expand Down
3 changes: 3 additions & 0 deletions res/VANILLA
Expand Up @@ -5,6 +5,7 @@ am_allmapfdwallcolor 99
am_allmapwallcolor 99
am_backcolor 0
am_bluedoorcolor 231
am_bluekeycolor 112
am_cdwallcolor 231
am_crosshaircolor 96
am_external off
Expand All @@ -17,12 +18,14 @@ am_path off
am_playercolor 209
am_playerstats off
am_reddoorcolor 231
am_redkeycolor 112
am_rotatemode off
am_teleportercolor 184
am_thingcolor 112
am_tswallcolor 96
am_wallcolor 176
am_yellowdoorcolor 231
am_yellowkeycolor 112
autoaim on
autoload off
autosave off
Expand Down
28 changes: 25 additions & 3 deletions src/am_map.c
Expand Up @@ -61,6 +61,7 @@ int am_allmapfdwallcolor = am_allmapfdwallcolor_default;
int am_allmapwallcolor = am_allmapwallcolor_default;
int am_backcolor = am_backcolor_default;
int am_bluedoorcolor = am_bluedoorcolor_default;
int am_bluekeycolor = am_bluekeycolor_default;
int am_cdwallcolor = am_cdwallcolor_default;
int am_crosshaircolor = am_crosshaircolor_default;
int am_display = am_display_default;
Expand All @@ -76,12 +77,14 @@ int am_pathcolor = am_pathcolor_default;
int am_playercolor = am_playercolor_default;
boolean am_playerstats = am_playerstats_default;
int am_reddoorcolor = am_reddoorcolor_default;
int am_redkeycolor = am_redkeycolor_default;
boolean am_rotatemode = am_rotatemode_default;
int am_teleportercolor = am_teleportercolor_default;
int am_thingcolor = am_thingcolor_default;
int am_tswallcolor = am_tswallcolor_default;
int am_wallcolor = am_wallcolor_default;
int am_yellowdoorcolor = am_yellowdoorcolor_default;
int am_yellowkeycolor = am_yellowkeycolor_default;

uint64_t stat_automapopened = 0;

Expand All @@ -98,6 +101,9 @@ uint64_t stat_automapopened = 0;

static byte playercolor;
static byte thingcolor;
static byte bluekeycolor;
static byte redkeycolor;
static byte yellowkeycolor;
static byte markcolor;
static byte backcolor;
static byte pathcolor;
Expand Down Expand Up @@ -314,6 +320,9 @@ void AM_SetColors(void)

playercolor = nearestcolors[am_playercolor];
thingcolor = nearestcolors[am_thingcolor];
bluekeycolor = nearestcolors[am_bluekeycolor];
redkeycolor = nearestcolors[am_redkeycolor];
yellowkeycolor = nearestcolors[am_yellowkeycolor];
markcolor = nearestcolors[am_markcolor];
backcolor = nearestcolors[am_backcolor];
pathcolor = nearestcolors[am_pathcolor];
Expand Down Expand Up @@ -1698,7 +1707,7 @@ static void AM_DrawTranslucentPlayerArrow(const mline_t *lineguy, const int line
}

static void AM_DrawThingTriangle(const mline_t *lineguy, const int lineguylines,
const fixed_t scale, angle_t angle, fixed_t x, fixed_t y)
const fixed_t scale, angle_t angle, fixed_t x, fixed_t y, byte color)
{
for (int i = 0; i < lineguylines; i++)
{
Expand All @@ -1724,7 +1733,7 @@ static void AM_DrawThingTriangle(const mline_t *lineguy, const int lineguylines,
AM_Rotate(&x1, &y1, angle);
AM_Rotate(&x2, &y2, angle);

AM_DrawFline(x + x1, y + y1, x + x2, y + y2, &thingcolor, &PUTDOT2);
AM_DrawFline(x + x1, y + y1, x + x2, y + y2, &color, &PUTDOT2);
}
}

Expand Down Expand Up @@ -1856,7 +1865,20 @@ static void AM_DrawThings(void)
fy = CYMTOF(point.y);

if (fx >= -width && fx <= MAPWIDTH + width && fy >= -width && fy <= (int)MAPHEIGHT + width)
AM_DrawThingTriangle(thingtriangle, THINGTRIANGLELINES, width, thing->angle - angleoffset, point.x, point.y);
{
mobjtype_t type = thing->type;
byte color = thingcolor;

if (type == MT_MISC4 || type == MT_MISC9)
color = bluekeycolor;
else if (type == MT_MISC5 || type == MT_MISC8)
color = redkeycolor;
else if (type == MT_MISC6 || type == MT_MISC7)
color = yellowkeycolor;

AM_DrawThingTriangle(thingtriangle, THINGTRIANGLELINES, width,
thing->angle - angleoffset, point.x, point.y, color);
}
}

thing = thing->snext;
Expand Down

0 comments on commit 523305b

Please sign in to comment.