Skip to content

Commit 2650483

Browse files
committed
Add hooks to cycle interaction modes
NextInteractionMode() will cycle forwards and PreviousInteractionMode() will cycle backwards. These hooks are not used by base game and have no keybinding by default. A mod can access these using GameManager.Instance.PlayerActivate and use whatever input the mod wants to trigger these.
1 parent f872f0a commit 2650483

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

Assets/Scripts/Game/PlayerActivate.cs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,62 @@ public void ChangeInteractionMode(PlayerActivateModes newMode, bool showText = t
14071407
DaggerfallUI.SetMidScreenText(TextManager.Instance.GetLocalizedText("interactionIsNowInMode").Replace("%s", modeText));
14081408
}
14091409

1410+
/// <summary>
1411+
/// Cycle to next interaction mode.
1412+
/// Order is Steal > Grab > Info > Talk then wraps back to Steal.
1413+
/// </summary>
1414+
public void NextInteractionMode()
1415+
{
1416+
PlayerActivateModes nextMode;
1417+
switch (currentMode)
1418+
{
1419+
case PlayerActivateModes.Steal:
1420+
nextMode = PlayerActivateModes.Grab;
1421+
break;
1422+
case PlayerActivateModes.Grab:
1423+
nextMode = PlayerActivateModes.Info;
1424+
break;
1425+
case PlayerActivateModes.Info:
1426+
nextMode = PlayerActivateModes.Talk;
1427+
break;
1428+
case PlayerActivateModes.Talk:
1429+
nextMode = PlayerActivateModes.Steal;
1430+
break;
1431+
default:
1432+
nextMode = currentMode;
1433+
break;
1434+
}
1435+
ChangeInteractionMode(nextMode);
1436+
}
1437+
1438+
/// <summary>
1439+
/// Cycle to previous interaction mode.
1440+
/// Order is Talk > Info > Grab > Steal then wraps back to Talk.
1441+
/// </summary>
1442+
public void PreviousInteractionMode()
1443+
{
1444+
PlayerActivateModes nextMode;
1445+
switch (currentMode)
1446+
{
1447+
case PlayerActivateModes.Talk:
1448+
nextMode = PlayerActivateModes.Info;
1449+
break;
1450+
case PlayerActivateModes.Info:
1451+
nextMode = PlayerActivateModes.Grab;
1452+
break;
1453+
case PlayerActivateModes.Grab:
1454+
nextMode = PlayerActivateModes.Steal;
1455+
break;
1456+
case PlayerActivateModes.Steal:
1457+
nextMode = PlayerActivateModes.Talk;
1458+
break;
1459+
default:
1460+
nextMode = currentMode;
1461+
break;
1462+
}
1463+
ChangeInteractionMode(nextMode);
1464+
}
1465+
14101466
// Output NPC info to HUD
14111467
private void PresentNPCInfo(StaticNPC npc)
14121468
{

0 commit comments

Comments
 (0)