- 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
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 (Int, msg0color)
EXTERN_CVAR (Color, dimcolor)
EXTERN_CVAR (Color, color)
EXTERN_CVAR (Float, dimamount)
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 ();
msg0color.ResetToDefault ();
dimcolor.ResetToDefault ();
color.ResetToDefault ();
}
@ -650,8 +657,6 @@ void FGameConfigFile::SetRavenDefaults (bool isHexen)
snd_pitched.SetGenericRepDefault (val, CVAR_Bool);
val.Int = 9;
msg0color.SetGenericRepDefault (val, CVAR_Int);
val.Int = 0x0000ff;
dimcolor.SetGenericRepDefault (val, CVAR_Int);
val.Int = CR_WHITE;
msgmidcolor.SetGenericRepDefault (val, CVAR_Int);
val.Int = CR_YELLOW;

View file

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

View file

@ -94,6 +94,8 @@ struct gameinfo_t
FString backpacktype;
FString statusbar;
FString intermissionMusic;
DWORD dimcolor;
float dimamount;
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)
{
@ -296,14 +296,24 @@ void DCanvas::FlatFill (int left, int top, int right, int bottom, FTexture *src,
void DCanvas::Dim (PalEntry color)
{
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)
{ // On the Hexen title screen, the default dimming is not
// enough to make the menus readable.
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
if (color.a != 0)
{

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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