Ticket #539: Update.patch

File Update.patch, 2.6 KB (added by Stan, 10 years ago)
  • binaries/data/mods/public/gui/session/input.js

     
    7979            }
    8080        }
    8181    }
    82 
    83     if (!cursorSet)
     82    if (!cursorSet || lastGuiPageIsMessageBox())
     83    {
    8484        Engine.SetCursor("arrow-default");
     85    }
    8586    if (!tooltipSet)
    8687        informationTooltip.hidden = true;
    8788   
  • source/gui/GUIManager.cpp

     
    6666    UnregisterFileReloadFunc(ReloadChangedFileCB, this);
    6767}
    6868
     69bool CGUIManager::LastPageIsMessageBox()
     70{
     71    if (m_PageStack.back().name == L"page_msgbox.xml")
     72    {
     73        return true;
     74    }
     75return false;
     76}
    6977bool CGUIManager::HasPages()
    7078{
    7179    return !m_PageStack.empty();
  • source/gui/GUIManager.h

     
    6464    bool HasPages();
    6565
    6666    /**
     67     * Determine if the last page is a messagebox
     68     */
     69    bool LastPageIsMessageBox();
     70
     71    /**
    6772     * Load a new GUI page and make it active. All current pages will be destroyed.
    6873     */
    6974    void SwitchPage(const CStrW& name, ScriptInterface* srcScriptInterface, JS::HandleValue initData);
  • source/gui/scripting/ScriptFunctions.cpp

     
    111111{
    112112    g_GUI->PopPage();
    113113}
    114 
     114bool LastGuiPageIsMessageBox(void* UNUSED(cbdata))
     115{
     116    return g_GUI->LastPageIsMessageBox();
     117}
    115118// Note that the args argument may only contain clonable data.
    116119// Functions aren't supported for example!
    117120// TODO: Use LOGERROR to print a friendly error message when the requirements aren't met instead of failing with debug_warn when cloning.
     
    925928    scriptInterface.RegisterFunction<void, std::wstring, CScriptVal, &PushGuiPage>("PushGuiPage");
    926929    scriptInterface.RegisterFunction<void, std::wstring, CScriptVal, &SwitchGuiPage>("SwitchGuiPage");
    927930    scriptInterface.RegisterFunction<void, &PopGuiPage>("PopGuiPage");
     931    scriptInterface.RegisterFunction<bool, &LastGuiPageIsMessageBox>("LastGuiPageIsMessageBox");
    928932    scriptInterface.RegisterFunction<void, CScriptVal, &PopGuiPageCB>("PopGuiPageCB");
    929933    scriptInterface.RegisterFunction<CScriptVal, CStr, &GetGUIObjectByName>("GetGUIObjectByName");
    930934