Skip to content

Commit

Permalink
Changed: Added default Patch Replacement definitions for the DOOM int…
Browse files Browse the repository at this point in the history
…ermission

screens to values.ded and added a SkipIf -nodefaultfx check so that they can
be excluded from the command line.
  • Loading branch information
danij-deng committed Jun 22, 2011
1 parent 4887958 commit 95bb598
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 29 deletions.
22 changes: 22 additions & 0 deletions doomsday/plugins/jdoom/defs/values.ded
Expand Up @@ -203,7 +203,11 @@ Values {
Static = "0";
};
};
}

SkipIf -nodefaultfx;

Values {
Patch Replacement {
M_NGAME = "{case,tracking=-1,scalex=1.1}N{scalex=1}ew {x=5}G{scalex=1}ame";
M_OPTION = "{case,tracking=-1,scalex=1.1}O{scalex=1}ptions";
Expand All @@ -226,5 +230,23 @@ Values {
M_EPI2 = "{case,tracking=-1,scalex=1.3}T{scalex=1}he {x=5,scalex=1.1}S{scalex=1}hores {x=10}of {x=15,scalex=1.1}H{scalex=1}ell";
M_EPI3 = "{case,tracking=-1,scalex=1.1}I{scalex=1}nferno";
M_EPI4 = "{case,tracking=-1,scalex=1.3}T{scalex=1}hy {x=5,scalex=1.3}F{scalex=1}lesh {x=10,scalex=1.1}C{scalex=1}onsumed";

WIF = "{tracking=-1}Finished";
WIENTER = "{tracking=-1}Entering";
WIOSTK = "{tracking=-1}Kills";
WIOSTS = "{tracking=-1}Secret";
WISCRT2 = "{tracking=-1}Secret";
WIOSTI = "{tracking=-1}Items";
WIFRGS = "{tracking=-1}Frags";
WITIME = "{tracking=-1}Time";
WISUCKS = "{tracking=-1}Sucks";
WIPAR = "{tracking=-1}PAR";
WIKILRS = "{tracking=-1,scalex=.78, scaley=.6,angle=270,x=-63}Killers";
WIVCTMS = "{tracking=-1,scalex=.7, scaley=.6}Victims";
WIMSTT = "{tracking=-1}Total";
WIBP1 = "{tracking=2}P1";
WIBP2 = "{tracking=2}P2";
WIBP3 = "{tracking=2}P3";
WIBP4 = "{tracking=2}P4";
};
}
71 changes: 42 additions & 29 deletions doomsday/plugins/jdoom/src/wi_stuff.c
Expand Up @@ -289,6 +289,7 @@ static void drawFinishedTitle(void)

FR_SetFont(FID(GF_FONTB));
FR_LoadDefaultAttrib();
FR_SetColorAndAlpha(defFontRGB[CR], defFontRGB[CG], defFontRGB[CB], 1);

// Draw <MapName>
patchId = pMapNames[mapNum];
Expand All @@ -297,7 +298,9 @@ static void drawFinishedTitle(void)
// Draw "Finished!"
if(R_GetPatchInfo(patchId, &info))
y += (5 * info.height) / 4;
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1);
WI_DrawPatch3(pFinished, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFinished), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN);

DGL_Disable(DGL_TEXTURE_2D);
}

Expand Down Expand Up @@ -338,6 +341,7 @@ static void drawEnteringTitle(void)

FR_SetFont(FID(GF_FONTB));
FR_LoadDefaultAttrib();
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1);

// Draw "Entering"
WI_DrawPatch3(pEntering, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pEntering), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN);
Expand All @@ -346,7 +350,10 @@ static void drawEnteringTitle(void)
if(R_GetPatchInfo(pMapNames[wbs->nextMap], &info))
y += (5 * info.height) / 4;
patchId = pMapNames[(wbs->episode * 8) + wbs->nextMap];

FR_SetColorAndAlpha(defFontRGB[CR], defFontRGB[CG], defFontRGB[CB], 1);
WI_DrawPatch3(patchId, Hu_ChoosePatchReplacement2(cfg.inludePatchReplaceMode, patchId, mapName), x, y, ALIGN_TOP, 0, DTF_NO_TYPEIN);

DGL_Disable(DGL_TEXTURE_2D);
}

Expand Down Expand Up @@ -681,8 +688,10 @@ static void drawDeathmatchStats(void)

DGL_Enable(DGL_TEXTURE_2D);
DGL_Color4f(1, 1, 1, 1);

FR_SetFont(FID(GF_FONTB));
FR_LoadDefaultAttrib();
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1);

// Draw stat titles (top line).
{ patchinfo_t info;
Expand All @@ -703,6 +712,8 @@ static void drawDeathmatchStats(void)
const char* replacement;
patchinfo_t info;

FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1);

R_GetPatchInfo(patchId, &info);
replacement = Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, patchId);
WI_DrawPatch3(patchId, replacement, x - info.width / 2, DM_MATRIXY - WI_SPACINGY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
Expand All @@ -715,7 +726,7 @@ static void drawDeathmatchStats(void)
}

// If more than 1 member, show the member count.
if(1 != teamInfo[i].playerCount)
if(1 > teamInfo[i].playerCount)
{
char tmp[20];
sprintf(tmp, "%i", teamInfo[i].playerCount);
Expand All @@ -730,9 +741,12 @@ static void drawDeathmatchStats(void)
patchid_t patchId = pTeamIcons[i];
const char* replacement = Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, patchId);
patchinfo_t info;

FR_SetColorAndAlpha(defFontRGB[CR], defFontRGB[CG], defFontRGB[CB], 1);

R_GetPatchInfo(patchId, &info);
WI_DrawPatch3(patchId, replacement, x - info.width / 2, DM_MATRIXY - WI_SPACINGY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
WI_DrawPatch3(patchId, replacement, DM_MATRIXX - info.width / 2, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
WI_DrawPatch3(patchId, replacement, x - info.width / 2, DM_MATRIXY - WI_SPACINGY + 10, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
WI_DrawPatch3(patchId, replacement, DM_MATRIXX - info.width / 2, y + 10, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
}

x += DM_SPACINGX;
Expand All @@ -742,6 +756,7 @@ static void drawDeathmatchStats(void)
// Draw stats.
y = DM_MATRIXY + 10;
FR_SetFont(FID(GF_SMALL));
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1);
w = FR_CharWidth('0');

for(i = 0; i < NUMTEAMS; ++i)
Expand Down Expand Up @@ -933,7 +948,8 @@ static void drawNetgameStats(void)

DGL_Enable(DGL_TEXTURE_2D);
DGL_Color4f(1, 1, 1, 1);
FR_SetFont(FID(GF_SMALL));

FR_SetFont(FID(GF_FONTB));
FR_LoadDefaultAttrib();
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1);

Expand All @@ -943,19 +959,14 @@ static void drawNetgameStats(void)

// Draw stat titles (top line).
R_GetPatchInfo(pKills, &info);
WI_DrawPatch3(pKills, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pKills), ORIGINX + NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
WI_DrawPatch3(pKills, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pKills), ORIGINX + NG_SPACINGX, NG_STATSY, ALIGN_TOPRIGHT, 0, DTF_NO_TYPEIN);
y = NG_STATSY + info.height;

R_GetPatchInfo(pItems, &info);
WI_DrawPatch3(pItems, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pItems), ORIGINX + 2 * NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);

R_GetPatchInfo(pSecret, &info);
WI_DrawPatch3(pSecret, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pSecret), ORIGINX + 3 * NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);

WI_DrawPatch3(pItems, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pItems), ORIGINX + 2 * NG_SPACINGX, NG_STATSY, ALIGN_TOPRIGHT, 0, DTF_NO_TYPEIN);
WI_DrawPatch3(pSecret, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pSecret), ORIGINX + 3 * NG_SPACINGX, NG_STATSY, ALIGN_TOPRIGHT, 0, DTF_NO_TYPEIN);
if(doFrags)
{
R_GetPatchInfo(pFrags, &info);
WI_DrawPatch3(pFrags, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFrags), ORIGINX + 4 * NG_SPACINGX - info.width, NG_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
WI_DrawPatch3(pFrags, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFrags), ORIGINX + 4 * NG_SPACINGX, NG_STATSY, ALIGN_TOPRIGHT, 0, DTF_NO_TYPEIN);
}

// Draw stats.
Expand All @@ -966,6 +977,9 @@ static void drawNetgameStats(void)
if(0 == teamInfo[i].playerCount)
continue;

FR_SetFont(FID(GF_FONTA));
FR_SetColorAndAlpha(1, 1, 1, 1);

x = ORIGINX;
R_GetPatchInfo(pTeamBackgrounds[i], &info);
WI_DrawPatch3(pTeamBackgrounds[i], Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pTeamBackgrounds[i]), x - info.width, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
Expand All @@ -976,12 +990,11 @@ static void drawNetgameStats(void)
char tmp[40];

sprintf(tmp, "%i", teamInfo[i].playerCount);
FR_SetFont(FID(GF_FONTA));
FR_SetColorAndAlpha(1, 1, 1, 1);
FR_DrawText3(tmp, x - info.width + 1, y + info.height - 8, ALIGN_TOPLEFT, DTF_NO_TYPEIN);
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1);
}

FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1);

if(i == inPlayerTeam)
WI_DrawPatch3(pFaceAlive, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pFaceAlive), x - info.width, y, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
x += NG_SPACINGX;
Expand Down Expand Up @@ -1018,33 +1031,33 @@ static void drawSinglePlayerStats(void)

DGL_Enable(DGL_TEXTURE_2D);
DGL_Color4f(1, 1, 1, 1);
FR_SetFont(FID(GF_SMALL));

FR_SetFont(FID(GF_FONTB));
FR_LoadDefaultAttrib();
FR_SetColorAndAlpha(defFontRGB2[CR], defFontRGB2[CG], defFontRGB2[CB], 1);

WI_DrawPatch3(pKills, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pKills), SP_STATSX, SP_STATSY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY, cntKills[0]);

WI_DrawPatch3(pItems, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pItems), SP_STATSX, SP_STATSY + lh, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY + lh, cntItems[0]);

WI_DrawPatch3(pSecretSP, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pSecretSP), SP_STATSX, SP_STATSY + 2 * lh, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY + 2 * lh, cntSecret[0]);

WI_DrawPatch3(pTime, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pTime), SP_TIMEX, SP_TIMEY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
if(wbs->parTime != -1)
{
WI_DrawPatch3(pPar, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pPar), SCREENWIDTH / 2 + SP_TIMEX, SP_TIMEY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
}

FR_SetFont(FID(GF_SMALL));
drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY, cntKills[0]);
drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY + lh, cntItems[0]);
drawPercent(SCREENWIDTH - SP_STATSX, SP_STATSY + 2 * lh, cntSecret[0]);

if(cntTime >= 0)
{
drawTime(SCREENWIDTH / 2 - SP_TIMEX, SP_TIMEY, cntTime / TICRATE);
}

if(wbs->parTime != -1)
if(wbs->parTime != -1 && cntPar >= 0)
{
WI_DrawPatch3(pPar, Hu_ChoosePatchReplacement(cfg.inludePatchReplaceMode, pPar), SCREENWIDTH / 2 + SP_TIMEX, SP_TIMEY, ALIGN_TOPLEFT, 0, DTF_NO_TYPEIN);
if(cntPar >= 0)
{
drawTime(SCREENWIDTH - SP_TIMEX, SP_TIMEY, cntPar / TICRATE);
}
drawTime(SCREENWIDTH - SP_TIMEX, SP_TIMEY, cntPar / TICRATE);
}

DGL_Disable(DGL_TEXTURE_2D);
Expand Down

0 comments on commit 95bb598

Please sign in to comment.