diff --git a/Scripts/Game/GTGAutorun/SCR_AutorunComponent.c b/Scripts/Game/GTGAutorun/SCR_AutorunComponent.c index a6d23e9..e951844 100644 --- a/Scripts/Game/GTGAutorun/SCR_AutorunComponent.c +++ b/Scripts/Game/GTGAutorun/SCR_AutorunComponent.c @@ -6,12 +6,24 @@ class SCR_AutorunComponentClass: ScriptComponentClass class SCR_AutorunComponent: ScriptComponent { protected bool m_bIsAutorunEnabled = false; + protected bool m_bWaitForKeyRelease = false; // Neu: Die Sicherung + protected SCR_CharacterControllerComponent m_CharacterController; protected InputManager m_InputManager; protected void OnAutorunPressed() { m_bIsAutorunEnabled = !m_bIsAutorunEnabled; + + // Wenn Autorun AN geht und der Spieler hält W bereits gedrückt... + if (m_bIsAutorunEnabled && m_InputManager.GetActionValue("CharacterForward") > 0.5) + { + m_bWaitForKeyRelease = true; // ...Sicherung aktivieren! + } + else + { + m_bWaitForKeyRelease = false; + } } protected void OnLifeStateChangedCallback() @@ -28,12 +40,22 @@ class SCR_AutorunComponent: ScriptComponent { if (!m_bIsAutorunEnabled) return; + + float forwardInput = m_InputManager.GetActionValue("CharacterForward"); + float rightInput = m_InputManager.GetActionValue("CharacterRight"); - // Autorun abbrechen, wenn: Kontext inaktiv, Karte offen oder Spieler bewegt sich manuell (W/S/A/D) + // Wenn die Sicherung an ist und der Spieler W loslässt (Wert unter 0.5) -> Sicherung raus + if (m_bWaitForKeyRelease && forwardInput < 0.5) + { + m_bWaitForKeyRelease = false; + } + + // Autorun abbrechen, wenn: Kontext inaktiv, Karte offen, A/D gedrückt, + // oder W/S gedrückt (ABER W bricht nur ab, wenn die Sicherung draußen ist!) if (!m_InputManager.IsContextActive("CharacterMovementContext") || am.GetActionTriggered("GadgetMap") || - Math.AbsFloat(m_InputManager.GetActionValue("CharacterForward")) >= 0.75 || - Math.AbsFloat(m_InputManager.GetActionValue("CharacterRight")) >= 0.75) + Math.AbsFloat(rightInput) >= 0.75 || + (!m_bWaitForKeyRelease && Math.AbsFloat(forwardInput) >= 0.75)) { m_bIsAutorunEnabled = false; return; @@ -55,10 +77,7 @@ class SCR_AutorunComponent: ScriptComponent m_InputManager = GetGame().GetInputManager(); - // Events abonnieren m_CharacterController.m_OnPrepareControls.Insert(OnPrepareControlsCallback); - - // Action Listener (Der Name "SCR_Autorun" muss mit der Input-Config übereinstimmen!) m_InputManager.AddActionListener("SCR_Autorun", EActionTrigger.DOWN, OnAutorunPressed); } } \ No newline at end of file diff --git a/addon.gproj b/addon.gproj index ffb1049..b35bf0d 100644 --- a/addon.gproj +++ b/addon.gproj @@ -1,8 +1,22 @@ GameProject { - ID "Autorun" + ID "GTG-Autorun" GUID "68CB13E78DD0129D" TITLE "Autorun" Dependencies { "58D0FB3206B6F859" } + Configurations { + GameProjectConfig PC { + } + GameProjectConfig XBOX_ONE { + } + GameProjectConfig XBOX_SERIES { + } + GameProjectConfig PS4 { + } + GameProjectConfig PS5 { + } + GameProjectConfig HEADLESS { + } + } } \ No newline at end of file diff --git a/resourceDatabase.rdb b/resourceDatabase.rdb index a2144ea..e7a464e 100644 Binary files a/resourceDatabase.rdb and b/resourceDatabase.rdb differ diff --git a/thumbnail.png b/thumbnail.png new file mode 100644 index 0000000..6fb5d20 Binary files /dev/null and b/thumbnail.png differ diff --git a/worlds/GameMaster/GM_Eden.ent b/worlds/GameMaster/GM_Eden.ent deleted file mode 100644 index d41bc8b..0000000 Binary files a/worlds/GameMaster/GM_Eden.ent and /dev/null differ diff --git a/worlds/GameMaster/GM_Eden.ent.meta b/worlds/GameMaster/GM_Eden.ent.meta deleted file mode 100644 index 14b2e8b..0000000 --- a/worlds/GameMaster/GM_Eden.ent.meta +++ /dev/null @@ -1,17 +0,0 @@ -MetaFileClass { - Name "{BEF094A5F7F3211C}worlds/GameMaster/GM_Eden.ent" - Configurations { - ENTResourceClass PC { - } - ENTResourceClass XBOX_ONE : PC { - } - ENTResourceClass XBOX_SERIES : PC { - } - ENTResourceClass PS4 : PC { - } - ENTResourceClass PS5 : PC { - } - ENTResourceClass HEADLESS : PC { - } - } -} \ No newline at end of file