Ticket #539: patch_v2.patch
File patch_v2.patch, 3.0 KB (added by , 10 years ago) |
---|
-
binaries/data/mods/public/gui/session/input.js
56 56 var cursorSet = false; 57 57 var tooltipSet = false; 58 58 var informationTooltip = getGUIObjectByName("informationTooltip"); 59 59 60 if (!mouseIsOverObject) 60 61 { 61 62 var action = determineAction(mouseX, mouseY); … … 77 78 } 78 79 } 79 80 } 80 81 if (!cursorSet) 81 var lastGuiPageIsMessageBox = Engine.LastGuiPageIsMessageBox(); 82 if (!cursorSet || lastGuiPageIsMessageBox) 83 { 82 84 Engine.SetCursor("arrow-default"); 85 } 83 86 if (!tooltipSet) 84 87 informationTooltip.hidden = true; 85 88 -
source/gui/GUIManager.cpp
66 66 return !m_PageStack.empty(); 67 67 } 68 68 69 bool CGUIManager::LastPageIsMessageBox() 70 { 71 if (m_PageStack.back().name == L"page_msgbox.xml") 72 { 73 return true; 74 } 75 return false; 76 } 77 69 78 void CGUIManager::SwitchPage(const CStrW& pageName, CScriptVal initData) 70 79 { 71 80 m_PageStack.clear(); … … 75 84 void CGUIManager::PushPage(const CStrW& pageName, CScriptVal initData) 76 85 { 77 86 m_PageStack.push_back(SGUIPage()); 87 78 88 m_PageStack.back().name = pageName; 79 89 m_PageStack.back().initData = CScriptValRooted(m_ScriptInterface.GetContext(), initData); 80 90 LoadPage(m_PageStack.back()); -
source/gui/GUIManager.h
57 57 bool HasPages(); 58 58 59 59 /** 60 * Determine if the last page is a messagebox 61 */ 62 bool LastPageIsMessageBox(); 63 64 /** 60 65 * Load a new GUI page and make it active. All current pages will be destroyed. 61 66 */ 62 67 void SwitchPage(const CStrW& name, CScriptVal initData); -
source/gui/scripting/ScriptFunctions.cpp
93 93 g_GUI->PopPage(); 94 94 } 95 95 96 bool LastGuiPageIsMessageBox(void* UNUSED(cbdata)) 97 { 98 return g_GUI->LastPageIsMessageBox(); 99 } 100 96 101 CScriptVal GuiInterfaceCall(void* cbdata, std::wstring name, CScriptVal data) 97 102 { 98 103 CGUIManager* guiManager = static_cast<CGUIManager*> (cbdata); … … 641 646 scriptInterface.RegisterFunction<void, std::wstring, CScriptVal, &PushGuiPage>("PushGuiPage"); 642 647 scriptInterface.RegisterFunction<void, std::wstring, CScriptVal, &SwitchGuiPage>("SwitchGuiPage"); 643 648 scriptInterface.RegisterFunction<void, &PopGuiPage>("PopGuiPage"); 649 scriptInterface.RegisterFunction<bool, &LastGuiPageIsMessageBox>("LastGuiPageIsMessageBox"); 644 650 645 651 // Simulation<->GUI interface functions: 646 652 scriptInterface.RegisterFunction<CScriptVal, std::wstring, CScriptVal, &GuiInterfaceCall>("GuiInterfaceCall");