- implement slider background color change - https://forum.zdoom.org/viewtopic.php?f=15&t=70616

This commit is contained in:
Rachael Alexanderson 2020-11-17 11:29:39 -05:00
parent 7ff79546e4
commit a2b8ad79ed
11 changed files with 13 additions and 3 deletions

View File

@ -67,6 +67,7 @@ DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_single)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_coop)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, statusscreen_dm)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mSliderColor)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mSliderBackColor)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, defaultbloodcolor)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, telefogheight)
DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, defKickback)
@ -409,6 +410,7 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_FLOAT(dimamount, "dimamount")
GAMEINFOKEY_FLOAT(bluramount, "bluramount")
GAMEINFOKEY_STRING(mSliderColor, "menuslidercolor")
GAMEINFOKEY_STRING(mSliderBackColor, "menusliderbackcolor")
GAMEINFOKEY_INT(definventorymaxamount, "definventorymaxamount")
GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime")
GAMEINFOKEY_INT(defaultdropstyle, "defaultdropstyle")

View File

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

View File

@ -40,6 +40,7 @@ gameinfo
dimamount = 0.5
bluramount = 0.0
menuslidercolor = "Orange"
menusliderbackcolor = "White"
definventorymaxamount = 25
defaultrespawntime = 12
defaultdropstyle = 1

View File

@ -40,6 +40,7 @@ gameinfo
dimamount = 0.5
bluramount = 0.0
menuslidercolor = "Orange"
menusliderbackcolor = "White"
definventorymaxamount = 25
defaultrespawntime = 12
defaultdropstyle = 1

View File

@ -40,6 +40,7 @@ gameinfo
dimamount = 0.5
bluramount = 0
menuslidercolor = "Orange"
menusliderbackcolor = "White"
definventorymaxamount = 16
defaultrespawntime = 12
defaultdropstyle = 1

View File

@ -39,6 +39,7 @@ gameinfo
dimamount = 0.5
bluramount = 0.0
menuslidercolor = "Orange"
menusliderbackcolor = "White"
definventorymaxamount = 25
defaultrespawntime = 12
defaultdropstyle = 1

View File

@ -29,6 +29,7 @@ gameinfo
dimamount = 0.8
bluramount = 0.0
menuslidercolor = "Orange"
menusliderbackcolor = "White"
definventorymaxamount = 25
defaultrespawntime = 12
defaultdropstyle = 1

View File

@ -40,6 +40,7 @@ gameinfo
dimamount = 0.5
bluramount = 0
menuslidercolor = "Orange"
menusliderbackcolor = "White"
definventorymaxamount = 25
defaultrespawntime = 16
defaultdropstyle = 2

View File

@ -531,6 +531,7 @@ struct GameInfoStruct native
native int gametype;
native String mBackButton;
native Name mSliderColor;
native Name mSliderBackColor;
}
struct SystemTime

View File

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

View File

@ -505,7 +505,7 @@ class ListMenuItemSlider : ListMenuItemSelectable
x = (x - 160) * CleanXfac + screen.GetWidth() / 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.FindFontColor(gameinfo.mSliderBackColor), 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.FindFontColor(gameinfo.mSliderColor), x + (5 + (int)((cur * 78) / range)) * CleanXfac, y, "\x13", DTA_CellX, 8 * CleanXfac, DTA_CellY, 8 * CleanYfac);
}