- all optionmenu items scriptified, but not integrated yet.

This commit is contained in:
Christoph Oelckers 2017-02-11 00:36:53 +01:00
commit f91d91d6e8
19 changed files with 1953 additions and 207 deletions

View file

@ -109,11 +109,11 @@ CUSTOM_CVAR (Bool, vid_tft, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
{
if (self)
{
it->SetString(DOptionMenuItemOptionBase::OP_VALUES, "RatiosTFT");
it->SetString(DOptionMenuItemOptionBase_::OP_VALUES, "RatiosTFT");
}
else
{
it->SetString(DOptionMenuItemOptionBase::OP_VALUES, "Ratios");
it->SetString(DOptionMenuItemOptionBase_::OP_VALUES, "Ratios");
}
}
}
@ -148,9 +148,9 @@ public:
mDesc->mSelectedItem < (int)mDesc->mItems.Size())
{
int sel;
bool selected = mDesc->mItems[mDesc->mSelectedItem]->GetValue(DOptionMenuScreenResolutionLine::SRL_SELECTION, &sel);
bool selected = mDesc->mItems[mDesc->mSelectedItem]->GetValue(DOptionMenuScreenResolutionLine_::SRL_SELECTION, &sel);
bool res = Super::MenuEvent(mkey, fromcontroller);
if (selected) mDesc->mItems[mDesc->mSelectedItem]->SetValue(DOptionMenuScreenResolutionLine::SRL_SELECTION, sel);
if (selected) mDesc->mItems[mDesc->mSelectedItem]->SetValue(DOptionMenuScreenResolutionLine_::SRL_SELECTION, sel);
return res;
}
return Super::MenuEvent(mkey, fromcontroller);
@ -239,7 +239,7 @@ static void BuildModesList (int hiwidth, int hiheight, int hi_bits)
DOptionMenuItem *it = opt->GetItem((ENamedName)i);
if (it != NULL)
{
it->SetValue(DOptionMenuScreenResolutionLine::SRL_HIGHLIGHT, -1);
it->SetValue(DOptionMenuScreenResolutionLine_::SRL_HIGHLIGHT, -1);
for (c = 0; c < 3; c++)
{
bool haveMode = false;
@ -260,16 +260,16 @@ static void BuildModesList (int hiwidth, int hiheight, int hi_bits)
{
if (width == hiwidth && height == hiheight)
{
it->SetValue(DOptionMenuScreenResolutionLine::SRL_SELECTION, c);
it->SetValue(DOptionMenuScreenResolutionLine::SRL_HIGHLIGHT, c);
it->SetValue(DOptionMenuScreenResolutionLine_::SRL_SELECTION, c);
it->SetValue(DOptionMenuScreenResolutionLine_::SRL_HIGHLIGHT, c);
}
mysnprintf (strtemp, countof(strtemp), "%dx%d%s", width, height, letterbox?TEXTCOLOR_BROWN" LB":"");
it->SetString(DOptionMenuScreenResolutionLine::SRL_INDEX+c, strtemp);
it->SetString(DOptionMenuScreenResolutionLine_::SRL_INDEX+c, strtemp);
}
else
{
it->SetString(DOptionMenuScreenResolutionLine::SRL_INDEX+c, "");
it->SetString(DOptionMenuScreenResolutionLine_::SRL_INDEX+c, "");
}
}
}
@ -360,11 +360,11 @@ static bool GetSelectedSize (int *width, int *height)
int line = opt->mSelectedItem;
int hsel;
DOptionMenuItem *it = opt->mItems[line];
if (it->GetValue(DOptionMenuScreenResolutionLine::SRL_SELECTION, &hsel))
if (it->GetValue(DOptionMenuScreenResolutionLine_::SRL_SELECTION, &hsel))
{
char buffer[32];
char *breakpt;
if (it->GetString(DOptionMenuScreenResolutionLine::SRL_INDEX+hsel, buffer, sizeof(buffer)))
if (it->GetString(DOptionMenuScreenResolutionLine_::SRL_INDEX+hsel, buffer, sizeof(buffer)))
{
*width = (int)strtoll (buffer, &breakpt, 10);
*height = (int)strtoll (breakpt+1, NULL, 10);
@ -397,6 +397,11 @@ void M_SetVideoMode()
SetModesMenu (NewWidth, NewHeight, NewBits);
}
DEFINE_ACTION_FUNCTION(DMenu, SetVideoMode)
{
M_SetVideoMode();
return 0;
}
//=============================================================================
//
//