mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- fixed: The base MouseEvent method must return true, not false.
- fixed: It is a bad idea to start a save within an MKEY_Input event. At this time the window chain is not stable because the text input screen is in the middle of being taken down, so the save should be deferred until the next Ticker call of the SaveMenu.
This commit is contained in:
parent
4ca20e0297
commit
165a980065
3 changed files with 31 additions and 24 deletions
|
@ -426,6 +426,8 @@ class LoadSaveMenu : ListMenu
|
||||||
|
|
||||||
class SaveMenu : LoadSaveMenu
|
class SaveMenu : LoadSaveMenu
|
||||||
{
|
{
|
||||||
|
String mSaveName;
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -464,7 +466,6 @@ class SaveMenu : LoadSaveMenu
|
||||||
|
|
||||||
override bool MenuEvent (int mkey, bool fromcontroller)
|
override bool MenuEvent (int mkey, bool fromcontroller)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Super.MenuEvent(mkey, fromcontroller))
|
if (Super.MenuEvent(mkey, fromcontroller))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -483,8 +484,9 @@ class SaveMenu : LoadSaveMenu
|
||||||
}
|
}
|
||||||
else if (mkey == MKEY_Input)
|
else if (mkey == MKEY_Input)
|
||||||
{
|
{
|
||||||
|
// Do not start the save here, it would cause some serious execution ordering problems.
|
||||||
mEntering = false;
|
mEntering = false;
|
||||||
manager.DoSave(Selected, mInput.GetText());
|
mSaveName = mInput.GetText();
|
||||||
mInput = null;
|
mInput = null;
|
||||||
}
|
}
|
||||||
else if (mkey == MKEY_Abort)
|
else if (mkey == MKEY_Abort)
|
||||||
|
@ -525,6 +527,14 @@ class SaveMenu : LoadSaveMenu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override void Ticker()
|
||||||
|
{
|
||||||
|
if (mSaveName.Length() > 0)
|
||||||
|
{
|
||||||
|
manager.DoSave(Selected, mSaveName);
|
||||||
|
mSaveName = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -266,7 +266,7 @@ class Menu : Object native
|
||||||
virtual bool CheckFocus(MenuItemBase fc) { return false; }
|
virtual bool CheckFocus(MenuItemBase fc) { return false; }
|
||||||
virtual void ReleaseFocus() {}
|
virtual void ReleaseFocus() {}
|
||||||
virtual void ResetColor() {}
|
virtual void ResetColor() {}
|
||||||
virtual bool MouseEvent(int type, int mx, int my) { return false; }
|
virtual bool MouseEvent(int type, int mx, int my) { return true; }
|
||||||
virtual void Ticker() {}
|
virtual void Ticker() {}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
|
@ -170,8 +170,6 @@ class TextEnterMenu : Menu
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
override bool MouseEvent(int type, int x, int y)
|
override bool MouseEvent(int type, int x, int y)
|
||||||
{
|
|
||||||
if (mMouseCapture || m_use_mouse == 1)
|
|
||||||
{
|
{
|
||||||
int cell_width = 18 * CleanXfac;
|
int cell_width = 18 * CleanXfac;
|
||||||
int cell_height = 12 * CleanYfac;
|
int cell_height = 12 * CleanYfac;
|
||||||
|
@ -188,15 +186,14 @@ class TextEnterMenu : Menu
|
||||||
{
|
{
|
||||||
MenuSound("menu/choose");
|
MenuSound("menu/choose");
|
||||||
if (m_use_mouse == 2) InputGridX = InputGridY = -1;
|
if (m_use_mouse == 2) InputGridX = InputGridY = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InputGridX = InputGridY = -1;
|
InputGridX = InputGridY = -1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return Super.MouseEvent(type, x, y);
|
return Super.MouseEvent(type, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,8 +259,8 @@ class TextEnterMenu : Menu
|
||||||
if (mEnterString.Length() > 0)
|
if (mEnterString.Length() > 0)
|
||||||
{
|
{
|
||||||
Menu parent = mParentMenu;
|
Menu parent = mParentMenu;
|
||||||
Close();
|
|
||||||
parent.MenuEvent(MKEY_Input, false);
|
parent.MenuEvent(MKEY_Input, false);
|
||||||
|
Close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue