- made menu dimming a mapping option but kept the CVARS as user override.

SVN r1790 (trunk)
This commit is contained in:
Christoph Oelckers 2009-09-04 22:25:46 +00:00
parent f55d1718f2
commit 44974ff28f
11 changed files with 43 additions and 11 deletions

View File

@ -1,4 +1,7 @@
September 3, 2009 (Changes by Graf Zahl) September 5, 2009 (Changes by Graf Zahl)
- made menu dimming a mapping option but kept the CVARS as user override.
September 3, 2009 (Changes by Graf Zahl)
- fixed: Weapons must first check if they can be switched and afterwards - fixed: Weapons must first check if they can be switched and afterwards
if they can be fired. These checks were reversed. if they can be fired. These checks were reversed.

View File

@ -65,7 +65,6 @@ extern HWND Window;
EXTERN_CVAR (Bool, con_centernotify) EXTERN_CVAR (Bool, con_centernotify)
EXTERN_CVAR (Int, msg0color) EXTERN_CVAR (Int, msg0color)
EXTERN_CVAR (Color, dimcolor)
EXTERN_CVAR (Color, color) EXTERN_CVAR (Color, color)
EXTERN_CVAR (Float, dimamount) EXTERN_CVAR (Float, dimamount)
EXTERN_CVAR (Int, msgmidcolor) EXTERN_CVAR (Int, msgmidcolor)
@ -285,6 +284,15 @@ void FGameConfigFile::DoGlobalSetup ()
} }
} }
} }
if (last < 209)
{
// menu dimming is now a gameinfo option so switch user override off
FBaseCVar *dim = FindCVar ("dimamount", NULL);
if (dim != NULL)
{
dim->ResetToDefault ();
}
}
} }
} }
} }
@ -639,7 +647,6 @@ void FGameConfigFile::SetRavenDefaults (bool isHexen)
{ {
con_centernotify.ResetToDefault (); con_centernotify.ResetToDefault ();
msg0color.ResetToDefault (); msg0color.ResetToDefault ();
dimcolor.ResetToDefault ();
color.ResetToDefault (); color.ResetToDefault ();
} }
@ -650,8 +657,6 @@ void FGameConfigFile::SetRavenDefaults (bool isHexen)
snd_pitched.SetGenericRepDefault (val, CVAR_Bool); snd_pitched.SetGenericRepDefault (val, CVAR_Bool);
val.Int = 9; val.Int = 9;
msg0color.SetGenericRepDefault (val, CVAR_Int); msg0color.SetGenericRepDefault (val, CVAR_Int);
val.Int = 0x0000ff;
dimcolor.SetGenericRepDefault (val, CVAR_Int);
val.Int = CR_WHITE; val.Int = CR_WHITE;
msgmidcolor.SetGenericRepDefault (val, CVAR_Int); msgmidcolor.SetGenericRepDefault (val, CVAR_Int);
val.Int = CR_YELLOW; val.Int = CR_YELLOW;

View File

@ -259,6 +259,8 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_BOOL(noloopfinalemusic, "noloopfinalemusic") GAMEINFOKEY_BOOL(noloopfinalemusic, "noloopfinalemusic")
GAMEINFOKEY_BOOL(drawreadthis, "drawreadthis") GAMEINFOKEY_BOOL(drawreadthis, "drawreadthis")
GAMEINFOKEY_BOOL(intermissioncounter, "intermissioncounter") GAMEINFOKEY_BOOL(intermissioncounter, "intermissioncounter")
GAMEINFOKEY_COLOR(dimcolor, "dimcolor")
GAMEINFOKEY_FLOAT(dimamount, "dimamount")
else else
{ {
// ignore unkown keys. // ignore unkown keys.

View File

@ -94,6 +94,8 @@ struct gameinfo_t
FString backpacktype; FString backpacktype;
FString statusbar; FString statusbar;
FString intermissionMusic; FString intermissionMusic;
DWORD dimcolor;
float dimamount;
const char *GetFinalePage(unsigned int num) const; const char *GetFinalePage(unsigned int num) const;
}; };

View File

@ -168,11 +168,11 @@ CUSTOM_CVAR (Int, vid_refreshrate, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
} }
} }
CUSTOM_CVAR (Float, dimamount, 0.2f, CVAR_ARCHIVE) CUSTOM_CVAR (Float, dimamount, -1.f, CVAR_ARCHIVE)
{ {
if (self < 0.f) if (self < 0.f && self != -1.f)
{ {
self = 0.f; self = -1.f;
} }
else if (self > 1.f) else if (self > 1.f)
{ {
@ -296,14 +296,24 @@ void DCanvas::FlatFill (int left, int top, int right, int bottom, FTexture *src,
void DCanvas::Dim (PalEntry color) void DCanvas::Dim (PalEntry color)
{ {
PalEntry dimmer; PalEntry dimmer;
float amount = dimamount; float amount;
if (dimamount >= 0)
{
dimmer = PalEntry(dimcolor);
amount = dimamount;
}
else
{
dimmer = gameinfo.dimcolor;
amount = gameinfo.dimamount;
}
if (gameinfo.gametype == GAME_Hexen && gamestate == GS_DEMOSCREEN) if (gameinfo.gametype == GAME_Hexen && gamestate == GS_DEMOSCREEN)
{ // On the Hexen title screen, the default dimming is not { // On the Hexen title screen, the default dimming is not
// enough to make the menus readable. // enough to make the menus readable.
amount = MIN<float> (1.f, amount*2.f); amount = MIN<float> (1.f, amount*2.f);
} }
dimmer = PalEntry(dimcolor);
// Add the cvar's dimming on top of the color passed to the function // Add the cvar's dimming on top of the color passed to the function
if (color.a != 0) if (color.a != 0)
{ {

View File

@ -59,7 +59,7 @@
// Version stored in the ini's [LastRun] section. // Version stored in the ini's [LastRun] section.
// Bump it if you made some configuration change that you want to // Bump it if you made some configuration change that you want to
// be able to migrate in FGameConfigFile::DoGlobalSetup(). // be able to migrate in FGameConfigFile::DoGlobalSetup().
#define LASTRUNVERSION "208" #define LASTRUNVERSION "209"
// Protocol version used in demos. // Protocol version used in demos.
// Bump it if you change existing DEM_ commands or add new ones. // Bump it if you change existing DEM_ commands or add new ones.

View File

@ -33,6 +33,8 @@ gameinfo
weaponslot = 5, "ZorchPropulsor" weaponslot = 5, "ZorchPropulsor"
weaponslot = 6, "PhasingZorcher" weaponslot = 6, "PhasingZorcher"
weaponslot = 7, "LAZDevice" weaponslot = 7, "LAZDevice"
dimcolor = "ff d7 00"
dimamount = 0.2
} }
skill baby skill baby

View File

@ -32,6 +32,8 @@ gameinfo
weaponslot = 5, "RocketLauncher" weaponslot = 5, "RocketLauncher"
weaponslot = 6, "PlasmaRifle" weaponslot = 6, "PlasmaRifle"
weaponslot = 7, "BFG9000" weaponslot = 7, "BFG9000"
dimcolor = "ff d7 00"
dimamount = 0.2
} }
skill baby skill baby

View File

@ -33,6 +33,8 @@ gameinfo
weaponslot = 5, "SkullRod" weaponslot = 5, "SkullRod"
weaponslot = 6, "PhoenixRod" weaponslot = 6, "PhoenixRod"
weaponslot = 7, "Mace" weaponslot = 7, "Mace"
dimcolor = "00 ff 00"
dimamount = 0.2
} }
skill baby skill baby

View File

@ -33,6 +33,8 @@ gameinfo
weaponslot = 2, "FWeapAxe", "CWeapStaff", "MWeapFrost" weaponslot = 2, "FWeapAxe", "CWeapStaff", "MWeapFrost"
weaponslot = 3, "FWeapHammer", "CWeapFlame", "MWeapLightning" weaponslot = 3, "FWeapHammer", "CWeapFlame", "MWeapLightning"
weaponslot = 4, "FWeapQuietus", "CWeapWraithverge", "MWeapBloodscourge" weaponslot = 4, "FWeapQuietus", "CWeapWraithverge", "MWeapBloodscourge"
dimcolor = "00 ff 00"
dimamount = 0.2
} }
skill baby skill baby

View File

@ -34,6 +34,8 @@ gameinfo
weaponslot = 6, "FlameThrower" weaponslot = 6, "FlameThrower"
weaponslot = 7, "Mauler2", "Mauler" weaponslot = 7, "Mauler2", "Mauler"
weaponslot = 8, "Sigil" weaponslot = 8, "Sigil"
dimcolor = "ff d7 00"
dimamount = 0.2
} }
skill baby skill baby