# Conflicts:
#	wadsrc/static/zscript/menu/optionmenuitems.txt
This commit is contained in:
Rachael Alexanderson 2018-01-20 11:52:31 -05:00
commit 88a5c997de
13 changed files with 38 additions and 17 deletions

View file

@ -558,7 +558,7 @@ void C_UnbindAll ()
AutomapBindings.UnbindAll();
}
CCMD (unbindall)
UNSAFE_CCMD (unbindall)
{
C_UnbindAll ();
}

View file

@ -674,7 +674,7 @@ UNSAFE_CCMD (error_fatal)
//==========================================================================
#if !defined(_WIN32) || !defined(_DEBUG)
CCMD (crashout)
UNSAFE_CCMD (crashout)
{
*(volatile int *)0 = 0;
}

View file

@ -1639,9 +1639,7 @@ FBaseCVar *C_CreateCVar(const char *var_name, ECVarType var_type, uint32_t flags
void UnlatchCVars (void)
{
FLatchedValue var;
while (LatchedValues.Pop (var))
for (const FLatchedValue& var : LatchedValues)
{
uint32_t oldflags = var.Variable->Flags;
var.Variable->Flags &= ~(CVAR_LATCH | CVAR_SERVERINFO);
@ -1650,6 +1648,8 @@ void UnlatchCVars (void)
delete[] var.Value.String;
var.Variable->Flags = oldflags;
}
LatchedValues.Clear();
}
void DestroyCVarsFlagged (uint32_t flags)

View file

@ -2618,7 +2618,7 @@ CCMD (playdemo)
}
}
CCMD (timedemo)
UNSAFE_CCMD (timedemo)
{
if (argv.argc() > 1)
{

View file

@ -224,7 +224,7 @@ CCMD (map)
//
//==========================================================================
CCMD(recordmap)
UNSAFE_CCMD(recordmap)
{
if (netgame)
{

View file

@ -903,9 +903,9 @@ DEFINE_ACTION_FUNCTION(DReverbEdit, GetValue)
{
PARAM_PROLOGUE;
PARAM_INT(index);
float v;
float v = 0;
if (index >= 0 && index < countof(ReverbFields))
if (index >= 0 && index < (int)countof(ReverbFields))
{
auto rev = &ReverbFields[index];
if (rev->Int != nullptr)
@ -931,7 +931,7 @@ DEFINE_ACTION_FUNCTION(DReverbEdit, SetValue)
PARAM_INT(index);
PARAM_FLOAT(v);
if (index >= 0 && index < countof(ReverbFields))
if (index >= 0 && index < (int)countof(ReverbFields))
{
auto rev = &ReverbFields[index];
if (rev->Int != nullptr)

View file

@ -708,7 +708,7 @@ ADD_STAT(music)
//
//==========================================================================
CCMD (writeopl)
UNSAFE_CCMD (writeopl)
{
if (argv.argc() == 2)
{
@ -746,7 +746,7 @@ CCMD (writeopl)
//
//==========================================================================
CCMD (writewave)
UNSAFE_CCMD (writewave)
{
if (argv.argc() >= 2 && argv.argc() <= 3)
{
@ -784,7 +784,7 @@ CCMD (writewave)
//
//==========================================================================
CCMD (writemidi)
UNSAFE_CCMD (writemidi)
{
if (argv.argc() != 2)
{

View file

@ -0,0 +1,9 @@
DBIGFONT, SBIGFONT
Taken from sp_usimp.zip (Ultimate Simplicity) by Agent Spork
sp_usimp.txt contains the following permissions:
Authors MAY use the contents of this file as a base for modification or
reuse. Permissions have been obtained from original authors for any of
their resources modified or included in this file.

Binary file not shown.

Binary file not shown.

View file

@ -127,11 +127,13 @@ class OptionMenuItemSubmenu : OptionMenuItem
class OptionMenuItemCommand : OptionMenuItemSubmenu
{
private String ccmd; // do not allow access to this from the outside.
bool mCloseOnSelect;
OptionMenuItemCommand Init(String label, Name command, bool centered = false)
OptionMenuItemCommand Init(String label, Name command, bool centered = false, bool closeonselect = false)
{
Super.Init(label, command, 0, centered);
ccmd = command;
mCloseOnSelect = closeonselect;
return self;
}
@ -150,6 +152,11 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu
}
Menu.MenuSound("menu/choose");
DoCommand(ccmd);
if (mCloseOnSelect)
{
let curmenu = Menu.GetCurrentMenu();
if (curmenu != null) curmenu.Close();
}
return true;
}
@ -245,11 +252,11 @@ class OptionMenuItemOptionBase : OptionMenuItem
virtual void SetSelection(int Selection)
{
}
//=============================================================================
override int Draw(OptionMenuDescriptor desc, int y, int indent, bool selected)
{
bool grayed = mGrayCheck != null && !(mGrayCheck.GetInt());
bool grayed = isGrayed();
if (mCenter)
{
@ -294,10 +301,15 @@ class OptionMenuItemOptionBase : OptionMenuItem
}
return true;
}
virtual bool isGrayed()
{
return mGrayCheck != null && !mGrayCheck.GetInt();
}
override bool Selectable()
{
return mGrayCheck == null || mGrayCheck.GetInt();
return !isGrayed();
}
}

Binary file not shown.

Binary file not shown.