Reset the cursor when opening new GUI pages. Patch by danger89, refs #539.

Remove duplicate cursor image and duplicate hardcoded default paths.

This was SVN commit r18933.
This commit is contained in:
elexis
2016-11-14 13:23:07 +00:00
parent 29e809f3e9
commit 34ce0f865d
13 changed files with 30 additions and 12 deletions
+6
View File
@@ -113,6 +113,11 @@ void PopGuiPageCB(ScriptInterface::CxPrivate* pCxPrivate, JS::HandleValue args)
g_GUI->PopPageCB(pCxPrivate->pScriptInterface->WriteStructuredClone(args));
}
void ResetCursor(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
{
g_GUI->ResetCursor();
}
JS::Value GuiInterfaceCall(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& name, JS::HandleValue data)
{
if (!g_Game)
@@ -1016,6 +1021,7 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
scriptInterface.RegisterFunction<void, &PopGuiPage>("PopGuiPage");
scriptInterface.RegisterFunction<void, JS::HandleValue, &PopGuiPageCB>("PopGuiPageCB");
scriptInterface.RegisterFunction<JS::Value, CStr, &GetGUIObjectByName>("GetGUIObjectByName");
scriptInterface.RegisterFunction<void, &ResetCursor>("ResetCursor");
// Simulation<->GUI interface functions:
scriptInterface.RegisterFunction<JS::Value, std::wstring, JS::HandleValue, &GuiInterfaceCall>("GuiInterfaceCall");