mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- use the proper virtual methods for setting and retrieving the string in OptionMenuItemTextField.
Without this the class cannot be properly subclassed.
This commit is contained in:
parent
a08cc2b477
commit
4b40e266f1
1 changed files with 12 additions and 3 deletions
|
@ -1033,7 +1033,13 @@ class OptionMenuItemTextField : OptionMenuFieldBase
|
||||||
override String Represent()
|
override String Represent()
|
||||||
{
|
{
|
||||||
if (mEnter) return mEnter.GetText() .. Menu.OptionFont().GetCursor();
|
if (mEnter) return mEnter.GetText() .. Menu.OptionFont().GetCursor();
|
||||||
else return GetCVarString();
|
else
|
||||||
|
{
|
||||||
|
bool b;
|
||||||
|
String s;
|
||||||
|
[b, s] = GetString(0);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override int Draw(OptionMenuDescriptor desc, int y, int indent, bool selected)
|
override int Draw(OptionMenuDescriptor desc, int y, int indent, bool selected)
|
||||||
|
@ -1053,14 +1059,17 @@ class OptionMenuItemTextField : OptionMenuFieldBase
|
||||||
{
|
{
|
||||||
if (mkey == Menu.MKEY_Enter)
|
if (mkey == Menu.MKEY_Enter)
|
||||||
{
|
{
|
||||||
|
bool b;
|
||||||
|
String s;
|
||||||
|
[b, s] = GetString(0);
|
||||||
Menu.MenuSound("menu/choose");
|
Menu.MenuSound("menu/choose");
|
||||||
mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), Menu.OptionFont(), GetCVarString(), -1, fromcontroller);
|
mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), Menu.OptionFont(), s, -1, fromcontroller);
|
||||||
mEnter.ActivateMenu();
|
mEnter.ActivateMenu();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (mkey == Menu.MKEY_Input)
|
else if (mkey == Menu.MKEY_Input)
|
||||||
{
|
{
|
||||||
if (mCVar) mCVar.SetString(mEnter.GetText());
|
SetString(0, mEnter.GetText());
|
||||||
mEnter = null;
|
mEnter = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue