- blacklist old FMod related sound CVARs because they tend to be in the UnknownCVARs section but aren't useful any longer.

This commit is contained in:
Christoph Oelckers 2017-06-12 00:00:55 +02:00
parent f1ad42c4e5
commit 842e8b68b4
3 changed files with 21 additions and 6 deletions

View file

@ -537,6 +537,7 @@ static bool FindMatchingItem(DMenuItemBase *desc)
if (grp == 5) return true; // static texts always match
FName name = desc->mAction;
if (grp == 1)
{
// Check for presence of menu
@ -545,9 +546,17 @@ static bool FindMatchingItem(DMenuItemBase *desc)
}
else if (grp == 4)
{
static const FName CVarBlacklist[] = {
NAME_snd_waterlp, NAME_snd_output, NAME_snd_output_format, NAME_snd_speakermode, NAME_snd_resampler, NAME_AlwaysRun };
// Check for presence of CVAR and blacklist
auto cv = GetCVar(nullptr, name.GetChars());
auto cv = FindCVar(name.GetChars(), nullptr);
if (cv == nullptr) return true;
for (auto bname : CVarBlacklist)
{
if (name == bname) return true;
}
}
MenuDescriptorList::Iterator it(MenuDescriptors);
@ -585,15 +594,16 @@ static bool ReplaceMenu(FScanner &sc, DMenuDescriptor *desc)
}
if (desc->mItems.Size() > 0)
{
auto sep = CreateOptionMenuItemStaticText("---------------", CR_YELLOW);
auto sep = CreateOptionMenuItemStaticText(" ");
(*pOld)->mItems.Push(sep);
auto sep = CreateOptionMenuItemStaticText("---------------", 1);
(*pOld)->mItems.Push(sep);
for (auto it : desc->mItems)
{
(*pOld)->mItems.Push(it);
}
desc->mItems.Clear();
sc.ScriptMessage("Merged %d items into %s", desc->mItems.Size(), desc->mMenuName.GetChars());
//sc.ScriptMessage("Merged %d items into %s", desc->mItems.Size(), desc->mMenuName.GetChars());
}
return true;
}

View file

@ -937,4 +937,10 @@ xx(OptionMenuFieldBase)
xx(OptionMenuItemColorPicker)
xx(OptionMenuItemStaticText)
xx(OptionMenuItemStaticTextSwitchable)
xx(mAction)
// blacklisted former CVARs
xx(snd_waterlp)
xx(snd_output)
xx(snd_output_format)
xx(snd_speakermode)
xx(snd_resampler)

View file

@ -65,7 +65,6 @@
EXTERN_CVAR (Float, snd_sfxvolume)
CVAR (Int, snd_samplerate, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Int, snd_buffersize, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (String, snd_output, "default", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Int, snd_hrtf, -1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
#if !defined(NO_OPENAL)