Browse Source

Bugfix

- Updated Angelscript bindings
- Updated NinjaSnowWar
thebluefish 11 years ago
parent
commit
51c4060135
2 changed files with 3 additions and 2 deletions
  1. 2 2
      Bin/Data/Scripts/NinjaSnowWar.as
  2. 1 0
      Source/Engine/Script/InputAPI.cpp

+ 2 - 2
Bin/Data/Scripts/NinjaSnowWar.as

@@ -502,7 +502,7 @@ void HandleKeyDown(StringHash eventType, VariantMap& eventData)
             {
                 if (screenJoystickSettingsIndex == M_MAX_UNSIGNED)
                     screenJoystickSettingsIndex = input.AddScreenJoystick(cache.GetResource("XMLFile", "UI/ScreenJoystickSettings_NinjaSnowWar.xml"));
-                input.OpenJoystick(screenJoystickSettingsIndex);
+                input.set_ScreenJoystickVisible(screenJoystickSettingsIndex, true);
             }
         }
         else
@@ -510,7 +510,7 @@ void HandleKeyDown(StringHash eventType, VariantMap& eventData)
             SetMessage("");
             if (screenJoystickSettingsIndex != M_MAX_UNSIGNED)
             {
-                input.CloseJoystick(screenJoystickSettingsIndex);
+                input.set_ScreenJoystickVisible(screenJoystickSettingsIndex, false);
                 input.RemoveScreenJoystick(screenJoystickSettingsIndex);
                 screenJoystickSettingsIndex = M_MAX_UNSIGNED;
             }

+ 1 - 0
Source/Engine/Script/InputAPI.cpp

@@ -481,6 +481,7 @@ static void RegisterInput(asIScriptEngine* engine)
     engine->RegisterObjectMethod("Input", "int GetScancodeFromName(const String&in) const", asMETHOD(Input, GetScancodeFromName), asCALL_THISCALL);
     engine->RegisterObjectMethod("Input", "String GetScancodeName(int) const", asMETHOD(Input, GetScancodeName), asCALL_THISCALL);
     engine->RegisterObjectMethod("Input", "void set_mouseVisible(bool)", asMETHOD(Input, SetMouseVisible), asCALL_THISCALL);
+	engine->RegisterObjectMethod("Input", "void set_ScreenJoystickVisible(int, bool)", asMETHOD(Input, SetScreenJoystickVisible), asCALL_THISCALL);
     engine->RegisterObjectMethod("Input", "bool get_mouseVisible() const", asMETHOD(Input, IsMouseVisible), asCALL_THISCALL);
     engine->RegisterObjectMethod("Input", "void set_screenKeyboardVisible(bool)", asMETHOD(Input, SetScreenKeyboardVisible), asCALL_THISCALL);
     engine->RegisterObjectMethod("Input", "bool get_screenKeyboardVisible() const", asMETHOD(Input, IsScreenKeyboardVisible), asCALL_THISCALL);