- added ability to change slider color using mapinfo's gameinfo

This commit is contained in:
Rachael Alexanderson 2017-10-14 13:05:15 -04:00
parent 0ccd388d91
commit 30c6cf82ca
11 changed files with 13 additions and 3 deletions

View file

@ -63,6 +63,7 @@ DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, intermissioncounter)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_single) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_single)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_coop) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_coop)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_dm) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_dm)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mSliderColor)
const char *GameNames[17] = const char *GameNames[17] =
@ -382,6 +383,7 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_COLOR(dimcolor, "dimcolor") GAMEINFOKEY_COLOR(dimcolor, "dimcolor")
GAMEINFOKEY_FLOAT(dimamount, "dimamount") GAMEINFOKEY_FLOAT(dimamount, "dimamount")
GAMEINFOKEY_FLOAT(bluramount, "bluramount") GAMEINFOKEY_FLOAT(bluramount, "bluramount")
GAMEINFOKEY_STRING(mSliderColor, "menuslidercolor")
GAMEINFOKEY_INT(definventorymaxamount, "definventorymaxamount") GAMEINFOKEY_INT(definventorymaxamount, "definventorymaxamount")
GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime") GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime")
GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime") GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime")

View file

@ -173,6 +173,7 @@ struct gameinfo_t
FName mFontColorHeader; FName mFontColorHeader;
FName mFontColorHighlight; FName mFontColorHighlight;
FName mFontColorSelection; FName mFontColorSelection;
FName mSliderColor;
FString mBackButton; FString mBackButton;
double gibfactor; double gibfactor;
int TextScreenX; int TextScreenX;

View file

@ -39,6 +39,7 @@ gameinfo
dimcolor = "ff d7 00" dimcolor = "ff d7 00"
dimamount = 0.2 dimamount = 0.2
bluramount = 0.0 bluramount = 0.0
menuslidercolor = "Orange"
definventorymaxamount = 25 definventorymaxamount = 25
defaultrespawntime = 12 defaultrespawntime = 12
defaultdropstyle = 1 defaultdropstyle = 1

View file

@ -39,6 +39,7 @@ gameinfo
dimcolor = "ff d7 00" dimcolor = "ff d7 00"
dimamount = 0.2 dimamount = 0.2
bluramount = 0.0 bluramount = 0.0
menuslidercolor = "Orange"
definventorymaxamount = 25 definventorymaxamount = 25
defaultrespawntime = 12 defaultrespawntime = 12
defaultdropstyle = 1 defaultdropstyle = 1

View file

@ -39,6 +39,7 @@ gameinfo
dimcolor = "00 00 ff" dimcolor = "00 00 ff"
dimamount = 0.2 dimamount = 0.2
bluramount = 0 bluramount = 0
menuslidercolor = "Orange"
definventorymaxamount = 16 definventorymaxamount = 16
defaultrespawntime = 12 defaultrespawntime = 12
defaultdropstyle = 1 defaultdropstyle = 1

View file

@ -38,6 +38,7 @@ gameinfo
dimcolor = "00 00 ff" dimcolor = "00 00 ff"
dimamount = 0.2 dimamount = 0.2
bluramount = 0.0 bluramount = 0.0
menuslidercolor = "Orange"
definventorymaxamount = 25 definventorymaxamount = 25
defaultrespawntime = 12 defaultrespawntime = 12
defaultdropstyle = 1 defaultdropstyle = 1

View file

@ -28,6 +28,7 @@ gameinfo
dimcolor = "6f 00 6b" dimcolor = "6f 00 6b"
dimamount = 0.8 dimamount = 0.8
bluramount = 0.0 bluramount = 0.0
menuslidercolor = "Orange"
definventorymaxamount = 25 definventorymaxamount = 25
defaultrespawntime = 12 defaultrespawntime = 12
defaultdropstyle = 1 defaultdropstyle = 1

View file

@ -39,6 +39,7 @@ gameinfo
dimcolor = "ff d7 00" dimcolor = "ff d7 00"
dimamount = 0.2 dimamount = 0.2
bluramount = 0 bluramount = 0
menuslidercolor = "Orange"
definventorymaxamount = 25 definventorymaxamount = 25
defaultrespawntime = 16 defaultrespawntime = 16
defaultdropstyle = 2 defaultdropstyle = 2

View file

@ -333,6 +333,7 @@ struct GameInfoStruct native
native GIFont mStatscreenFinishedFont; native GIFont mStatscreenFinishedFont;
native double gibfactor; native double gibfactor;
native bool intermissioncounter; native bool intermissioncounter;
native Name mSliderColor;
} }
class Object native class Object native

View file

@ -694,13 +694,13 @@ class OptionMenuSliderBase : OptionMenuItem
if (!mSliderShort) if (!mSliderShort)
{ {
Menu.DrawConText(Font.CR_WHITE, x, cy, "\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12"); Menu.DrawConText(Font.CR_WHITE, x, cy, "\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12");
Menu.DrawConText(Font.CR_ORANGE, x + int((5 + ((ccur * 78) / range)) * CleanXfac_1), cy, "\x13"); Menu.DrawConText(Font.FindFontColor(gameinfo.mSliderColor), x + int((5 + ((ccur * 78) / range)) * CleanXfac_1), cy, "\x13");
} }
else else
{ {
// On 320x200 we need a shorter slider // On 320x200 we need a shorter slider
Menu.DrawConText(Font.CR_WHITE, x, cy, "\x10\x11\x11\x11\x11\x11\x12"); Menu.DrawConText(Font.CR_WHITE, x, cy, "\x10\x11\x11\x11\x11\x11\x12");
Menu.DrawConText(Font.CR_ORANGE, x + int((5 + ((ccur * 38) / range)) * CleanXfac_1), cy, "\x13"); Menu.DrawConText(Font.FindFontColor(gameinfo.mSliderColor), x + int((5 + ((ccur * 38) / range)) * CleanXfac_1), cy, "\x13");
right -= 5*8*CleanXfac_1; right -= 5*8*CleanXfac_1;
} }

View file

@ -506,7 +506,7 @@ class ListMenuItemSlider : ListMenuItemSelectable
y = (y - 100) * CleanYfac + screen.GetHeight() / 2; y = (y - 100) * CleanYfac + screen.GetHeight() / 2;
screen.DrawText (ConFont, Font.CR_WHITE, x, y, "\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12", DTA_CellX, 8 * CleanXfac, DTA_CellY, 8 * CleanYfac); screen.DrawText (ConFont, Font.CR_WHITE, x, y, "\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12", DTA_CellX, 8 * CleanXfac, DTA_CellY, 8 * CleanYfac);
screen.DrawText (ConFont, Font.CR_ORANGE, x + (5 + (int)((cur * 78) / range)) * CleanXfac, y, "\x13", DTA_CellX, 8 * CleanXfac, DTA_CellY, 8 * CleanYfac); screen.DrawText (ConFont, Font.FindFontColor(gameinfo.mSliderColor), x + (5 + (int)((cur * 78) / range)) * CleanXfac, y, "\x13", DTA_CellX, 8 * CleanXfac, DTA_CellY, 8 * CleanYfac);
} }
//============================================================================= //=============================================================================