Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 196b607

Browse files
committed
Added 4zK requested control state PIE_MENU_OPENED
1 parent fac95e7 commit 196b607

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,9 @@ This can be accessed via the new Lua (R/W) `SettingsMan` property `AIUpdateInter
632632
- Added alternate version of `Scene` Lua function `CalculatePath(startPos, endPos, movePathToGround, digStrength, team)` that works as the previous one, but lets you specify the team to calculate the path for, allowing you to ignore doors on your team.
633633

634634
- Added `Controller` Lua function `IsKeyboardOnlyControlled` that tells you whether the `Controller` is being controlled by keyboard only. Previously the only way to do this was to check that it's not mouse controlled and not gamepad controlled.
635+
636+
- Added `Controller` control state `PIE_MENU_OPENED` that is true for the first Update in which the `PieMenu` is opened.
637+
635638
</details>
636639

637640
<details><summary><b>Changed</b></summary>

Lua/LuaBindingsSystem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ namespace RTE {
7676
luabind::value("AIM_SHARP", ControlState::AIM_SHARP),
7777
luabind::value("WEAPON_FIRE", ControlState::WEAPON_FIRE),
7878
luabind::value("WEAPON_RELOAD", ControlState::WEAPON_RELOAD),
79+
luabind::value("PIE_MENU_OPENED", ControlState::PIE_MENU_OPENED),
7980
luabind::value("PIE_MENU_ACTIVE", ControlState::PIE_MENU_ACTIVE),
8081
luabind::value("WEAPON_CHANGE_NEXT", ControlState::WEAPON_CHANGE_NEXT),
8182
luabind::value("WEAPON_CHANGE_PREV", ControlState::WEAPON_CHANGE_PREV),

System/Controller.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ namespace RTE {
356356

357357
// PIE MENU ACTIVE
358358
if (g_UInputMan.ElementHeld(m_Player, InputElements::INPUT_PIEMENU)) {
359+
if (m_ControlledActor && m_ControlledActor->GetPieMenu()->IsInNormalAnimationMode() && !m_ControlledActor->GetPieMenu()->IsVisible()) {
360+
m_ControlStates[ControlState::PIE_MENU_OPENED] = true;
361+
}
359362
m_ControlStates[ControlState::PIE_MENU_ACTIVE] = true;
360363
// Make sure that firing and aiming are ignored while the pie menu is open, since it consumes those inputs.
361364
m_ControlStates[ControlState::WEAPON_FIRE] = false;

System/Controller.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ namespace RTE {
2626
AIM_SHARP,
2727
WEAPON_FIRE,
2828
WEAPON_RELOAD,
29+
PIE_MENU_OPENED,
2930
PIE_MENU_ACTIVE,
3031
WEAPON_CHANGE_NEXT,
3132
WEAPON_CHANGE_PREV,

0 commit comments

Comments
 (0)