- scriptified the CVar printers for the gameplay and compatibility menus.

This commit is contained in:
Christoph Oelckers 2017-02-12 23:17:05 +01:00
parent 2b977f70e6
commit 12db190f41
3 changed files with 32 additions and 46 deletions

View file

@ -510,49 +510,3 @@ DMenuItemBase *DOptionMenuDescriptor::GetItem(FName name)
return NULL;
}
class DGameplayMenu : public DOptionMenu
{
DECLARE_CLASS(DGameplayMenu, DOptionMenu)
public:
DGameplayMenu()
{}
void Drawer ()
{
Super::Drawer();
char text[64];
mysnprintf(text, 64, "dmflags = %d dmflags2 = %d", *dmflags, *dmflags2);
screen->DrawText (SmallFont, OptionSettings.mFontColorValue,
(screen->GetWidth() - SmallFont->StringWidth (text) * CleanXfac_1) / 2, 0, text,
DTA_CleanNoMove_1, true, TAG_DONE);
}
};
IMPLEMENT_CLASS(DGameplayMenu, false, false)
class DCompatibilityMenu : public DOptionMenu
{
DECLARE_CLASS(DCompatibilityMenu, DOptionMenu)
public:
DCompatibilityMenu()
{}
void Drawer ()
{
Super::Drawer();
char text[64];
mysnprintf(text, 64, "compatflags = %d compatflags2 = %d", *compatflags, *compatflags2);
screen->DrawText (SmallFont, OptionSettings.mFontColorValue,
(screen->GetWidth() - SmallFont->StringWidth (text) * CleanXfac_1) / 2, 0, text,
DTA_CleanNoMove_1, true, TAG_DONE);
}
};
IMPLEMENT_CLASS(DCompatibilityMenu, false, false)

View file

@ -9,6 +9,7 @@
#include "zscript/menu/menuitembase.txt"
#include "zscript/menu/menu.txt"
#include "zscript/menu/listmenuitems.txt"
#include "zscript/menu/optionmenu.txt"
#include "zscript/menu/optionmenuitems.txt"
#include "zscript/menu/colorpickermenu.txt"
#include "zscript/menu/joystickmenu.txt"

View file

@ -0,0 +1,31 @@
class GameplayMenu : OptionMenu
{
override void Drawer ()
{
Super.Drawer();
String s = String.Format("dmflags = %d dmflags2 = %d", dmflags, dmflags2);
screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue,
(screen.GetWidth() - SmallFont.StringWidth (s) * CleanXfac_1) / 2, 0, s,
DTA_CleanNoMove_1, true);
}
}
class CompatibilityMenu : OptionMenu
{
override void Drawer ()
{
Super.Drawer();
String s = String.Format("compatflags = %d compatflags2 = %d", compatflags, compatflags2);
screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue,
(screen.GetWidth() - SmallFont.StringWidth (s) * CleanXfac_1) / 2, 0, s,
DTA_CleanNoMove_1, true);
}
}