Skip to content

Commit

Permalink
Chex Quest: Use the correct color for health, etc..., on the statusbar
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Feb 19, 2012
1 parent 687b729 commit ca2e9d5
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 27 deletions.
38 changes: 20 additions & 18 deletions doomsday/plugins/jdoom/src/d_main.c
Expand Up @@ -195,17 +195,17 @@ void D_PreInit(void)
break;

case doom_chex:
defFontRGB[CR] = 1;
defFontRGB[CR] = .46f;
defFontRGB[CG] = 1;
defFontRGB[CB] = 1;
defFontRGB[CB] = .4f;

defFontRGB2[CR] = .3f;
defFontRGB2[CG] = .9f;
defFontRGB2[CB] = .3f;
defFontRGB2[CR] = .46f;
defFontRGB2[CG] = 1;
defFontRGB2[CB] = .4f;

defFontRGB3[CR] = .85f;
defFontRGB3[CG] = .1f;
defFontRGB3[CB] = .1f;
defFontRGB3[CR] = 1;
defFontRGB3[CG] = 1;
defFontRGB3[CB] = .45f;
break;

default:
Expand Down Expand Up @@ -306,19 +306,21 @@ void D_PreInit(void)
cfg.menuTextColors[2][CG] = cfg.menuTextColors[3][CG] = .2f;
cfg.menuTextColors[2][CB] = cfg.menuTextColors[3][CB] = .9f;
}
else if(gameMode == doom_chex)
{
memcpy(cfg.menuTextColors[0], defFontRGB2, sizeof(cfg.menuTextColors[0]));
memcpy(cfg.menuTextColors[1], defFontRGB3, sizeof(cfg.menuTextColors[1]));
memcpy(cfg.menuTextColors[2], defFontRGB, sizeof(cfg.menuTextColors[2]));
memcpy(cfg.menuTextColors[3], defFontRGB2, sizeof(cfg.menuTextColors[3]));
}
else
{
memcpy(cfg.menuTextColors[0], defFontRGB2, sizeof(cfg.menuTextColors[0]));
cfg.menuTextColors[1][CR] = 1.f;
cfg.menuTextColors[1][CG] = .7f;
cfg.menuTextColors[1][CB] = .3f;
if(gameMode == doom_chex)
{
cfg.menuTextColors[1][CR] = .85f;
cfg.menuTextColors[1][CG] = .3f;
cfg.menuTextColors[1][CB] = .3f;
}
else
{
cfg.menuTextColors[1][CR] = 1.f;
cfg.menuTextColors[1][CG] = .7f;
cfg.menuTextColors[1][CB] = .3f;
}
memcpy(cfg.menuTextColors[2], defFontRGB, sizeof(cfg.menuTextColors[2]));
memcpy(cfg.menuTextColors[3], defFontRGB2, sizeof(cfg.menuTextColors[3]));
}
Expand Down
49 changes: 40 additions & 9 deletions doomsday/plugins/jdoom/src/st_stuff.c
Expand Up @@ -882,7 +882,14 @@ void SBarReadyAmmo_Drawer(uiwidget_t* obj, const Point2Raw* offset)
DGL_Enable(DGL_TEXTURE_2D);

FR_SetFont(obj->font);
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], textAlpha);
if(gameMode == doom_chex)
{
FR_SetColorAndAlpha(defFontRGB3[CR], defFontRGB3[CG], defFontRGB3[CB], textAlpha);
}
else
{
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], textAlpha);
}
FR_DrawTextXY3(buf, X, Y, ALIGN_TOPRIGHT, DTF_NO_EFFECTS);

DGL_Disable(DGL_TEXTURE_2D);
Expand Down Expand Up @@ -1093,8 +1100,14 @@ void SBarHealth_Drawer(uiwidget_t* obj, const Point2Raw* offset)
DGL_Enable(DGL_TEXTURE_2D);

FR_SetFont(obj->font);
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], textAlpha);

if(gameMode == doom_chex)
{
FR_SetColorAndAlpha(defFontRGB3[CR], defFontRGB3[CG], defFontRGB3[CB], textAlpha);
}
else
{
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], textAlpha);
}
FR_DrawTextXY3(buf, X, Y, ALIGN_TOPRIGHT, DTF_NO_EFFECTS);
FR_DrawCharXY('%', X, Y);

Expand Down Expand Up @@ -1164,8 +1177,14 @@ void SBarArmor_Drawer(uiwidget_t* obj, const Point2Raw* offset)
DGL_Enable(DGL_TEXTURE_2D);

FR_SetFont(obj->font);
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], textAlpha);

if(gameMode == doom_chex)
{
FR_SetColorAndAlpha(defFontRGB3[CR], defFontRGB3[CG], defFontRGB3[CB], textAlpha);
}
else
{
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], textAlpha);
}
FR_DrawTextXY3(buf, X, Y, ALIGN_TOPRIGHT, DTF_NO_EFFECTS);
FR_DrawCharXY('%', X, Y);

Expand Down Expand Up @@ -1242,8 +1261,14 @@ void SBarFrags_Drawer(uiwidget_t* obj, const Point2Raw* offset)
DGL_Enable(DGL_TEXTURE_2D);

FR_SetFont(obj->font);
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], textAlpha);

if(gameMode == doom_chex)
{
FR_SetColorAndAlpha(defFontRGB3[CR], defFontRGB3[CG], defFontRGB3[CB], textAlpha);
}
else
{
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], textAlpha);
}
FR_DrawTextXY3(buf, X, Y, ALIGN_TOPRIGHT, DTF_NO_EFFECTS);

DGL_Disable(DGL_TEXTURE_2D);
Expand Down Expand Up @@ -1498,8 +1523,14 @@ void WeaponSlot_Drawer(uiwidget_t* obj, const Point2Raw* offset)
DGL_Color4f(1, 1, 1, textAlpha);

FR_SetFont(obj->font);
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], textAlpha);

if(gameMode == doom_chex)
{
FR_SetColorAndAlpha(defFontRGB3[CR], defFontRGB3[CG], defFontRGB3[CB], textAlpha);
}
else
{
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], textAlpha);
}
WI_DrawPatch3(wpns->patchId, Hu_ChoosePatchReplacement(cfg.hudPatchReplaceMode, wpns->patchId),
element, ALIGN_TOPLEFT, 0, DTF_NO_EFFECTS);

Expand Down

0 comments on commit ca2e9d5

Please sign in to comment.