Ticket #539: Update.2.patch

File Update.2.patch, 2.6 KB (added by Jia Henry, 10 years ago)

Modifies the patch and makes it compatible with the current revision

  • binaries/data/mods/public/gui/session/input.js

     
    8080        }
    8181    }
    8282
    83     if (!cursorSet)
     83    if (!cursorSet || Engine.LastGuiPageIsMessageBox())
    8484        Engine.SetCursor("arrow-default");
    8585    if (!tooltipSet)
    8686        informationTooltip.hidden = true;
  • 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        return true;
     73    return false;
     74}
     75
    6976bool CGUIManager::HasPages()
    7077{
    7178    return !m_PageStack.empty();
  • source/gui/GUIManager.h

     
    5858    shared_ptr<ScriptRuntime> GetRuntime() { return m_ScriptRuntime; }
    5959    shared_ptr<CGUI> GetActiveGUI() { return top(); }
    6060
     61    /**
     62    * Determine if the last page is a messagebox
     63    */
     64    bool LastPageIsMessageBox();
     65
    6166    /**
    6267     * Returns whether there are any current pages.
    6368     */
  • source/gui/scripting/ScriptFunctions.cpp

     
    9797    g_GUI->PushPage(name, pCxPrivate->pScriptInterface->WriteStructuredClone(initData));
    9898}
    9999
     100bool LastGuiPageIsMessageBox(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
     101{
     102    return g_GUI->LastPageIsMessageBox();
     103}
     104
    100105void SwitchGuiPage(ScriptInterface::CxPrivate* pCxPrivate, std::wstring name, CScriptVal initData1)
    101106{
    102107    JSContext* cx = pCxPrivate->pScriptInterface->GetContext();
     
    922927    scriptInterface.RegisterFunction<CScriptVal, std::wstring, &JSI_VFS::ReadFile>("ReadFile");
    923928    scriptInterface.RegisterFunction<CScriptVal, std::wstring, &JSI_VFS::ReadFileLines>("ReadFileLines");
    924929    // GUI manager functions:
     930    scriptInterface.RegisterFunction<bool, &LastGuiPageIsMessageBox>("LastGuiPageIsMessageBox");
    925931    scriptInterface.RegisterFunction<void, std::wstring, CScriptVal, &PushGuiPage>("PushGuiPage");
    926932    scriptInterface.RegisterFunction<void, std::wstring, CScriptVal, &SwitchGuiPage>("SwitchGuiPage");
    927933    scriptInterface.RegisterFunction<void, &PopGuiPage>("PopGuiPage");