Skip to content

Commit 4c53c0b

Browse files
committed
Some fixes
1 parent 8e10d6f commit 4c53c0b

5 files changed

Lines changed: 29 additions & 14 deletions

File tree

EXILED/EXILED.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<PropertyGroup>
1717
<!-- This is the global version and is used for all projects that don't have a version -->
18-
<Version Condition="$(Version) == ''">9.6.0</Version>
18+
<Version Condition="$(Version) == ''">9.6.1</Version>
1919
<!-- Enables public beta warning via the PUBLIC_BETA constant -->
2020
<PublicBeta>false</PublicBeta>
2121

EXILED/Exiled.API/Features/Core/UserSettings/KeybindSetting.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ public class KeybindSetting : SettingBase, IWrapper<SSKeybindSetting>
2525
/// <param name="label"><inheritdoc cref="SettingBase.Label"/></param>
2626
/// <param name="suggested"><inheritdoc cref="KeyCode"/></param>
2727
/// <param name="preventInteractionOnGUI"><inheritdoc cref="PreventInteractionOnGUI"/></param>
28+
/// <param name="allowSpectatorTrigger"><inheritdoc cref="AllowSpectatorTrigger"/></param>
2829
/// <param name="hintDescription"><inheritdoc cref="SettingBase.HintDescription"/></param>
2930
/// <param name="header"><inheritdoc cref="SettingBase.Header"/></param>
3031
/// <param name="onChanged"><inheritdoc cref="SettingBase.OnChanged"/></param>
31-
public KeybindSetting(int id, string label, KeyCode suggested, bool preventInteractionOnGUI = false, string hintDescription = "", HeaderSetting header = null, Action<Player, SettingBase> onChanged = null)
32-
: base(new SSKeybindSetting(id, label, suggested, preventInteractionOnGUI, hintDescription), header, onChanged)
32+
public KeybindSetting(int id, string label, KeyCode suggested, bool preventInteractionOnGUI = false, bool allowSpectatorTrigger = false, string hintDescription = "", HeaderSetting header = null, Action<Player, SettingBase> onChanged = null)
33+
: base(new SSKeybindSetting(id, label, suggested, preventInteractionOnGUI, allowSpectatorTrigger, hintDescription), header, onChanged)
3334
{
3435
Base = (SSKeybindSetting)base.Base;
3536
}
@@ -61,6 +62,15 @@ public bool PreventInteractionOnGUI
6162
set => Base.PreventInteractionOnGUI = value;
6263
}
6364

65+
/// <summary>
66+
/// Gets or sets a value indicating whether the interaction is prevented in spectator roles.
67+
/// </summary>
68+
public bool AllowSpectatorTrigger
69+
{
70+
get => Base.AllowSpectatorTrigger;
71+
set => Base.AllowSpectatorTrigger = value;
72+
}
73+
6474
/// <summary>
6575
/// Gets or sets the assigned key.
6676
/// </summary>

EXILED/Exiled.API/Features/Player.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,11 @@ public bool IsSpawnProtected
11631163
/// </summary>
11641164
protected HealthStat CustomHealthStat { get; set; }
11651165

1166+
/// <summary>
1167+
/// Gets or sets a <see cref="ScaleController"/>.
1168+
/// </summary>
1169+
protected FpcScaleController ScaleController { get; set; }
1170+
11661171
/// <summary>
11671172
/// Converts LabApi player to EXILED player.
11681173
/// </summary>
@@ -2072,7 +2077,7 @@ public void SetScale(Vector3 scale, IEnumerable<Player> viewers)
20722077

20732078
try
20742079
{
2075-
ReferenceHub.transform.localScale = scale;
2080+
ScaleController.Scale = scale;
20762081

20772082
foreach (Player target in viewers)
20782083
Server.SendSpawnMessage?.Invoke(null, new object[] { NetworkIdentity, target.Connection });
@@ -2094,12 +2099,12 @@ public void SetFakeScale(Vector3 fakeScale, IEnumerable<Player> viewers)
20942099

20952100
try
20962101
{
2097-
ReferenceHub.transform.localScale = fakeScale;
2102+
ScaleController.Scale = fakeScale;
20982103

20992104
foreach (Player target in viewers)
21002105
Server.SendSpawnMessage.Invoke(null, new object[] { NetworkIdentity, target.Connection });
21012106

2102-
ReferenceHub.transform.localScale = currentScale;
2107+
ScaleController.Scale = currentScale;
21032108
}
21042109
catch (Exception ex)
21052110
{

EXILED/Exiled.Events/Patches/Events/Player/Interacted.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@ namespace Exiled.Events.Patches.Events.Player
1414
using API.Features.Pools;
1515
using Exiled.Events.Attributes;
1616
using Exiled.Events.EventArgs.Player;
17-
1817
using HarmonyLib;
19-
18+
using Interactables;
2019
using UnityEngine;
2120

2221
using static HarmonyLib.AccessTools;
2322

2423
/// <summary>
25-
/// Patches <see cref="PlayerInteract.OnInteract" />.
24+
/// Patches <see cref="InteractionCoordinator.ClientInteract" />.
2625
/// Adds the <see cref="Handlers.Player.Interacted" /> event.
2726
/// </summary>
2827
[EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.Interacted))]
29-
[HarmonyPatch(typeof(PlayerInteract), nameof(PlayerInteract.OnInteract))]
28+
[HarmonyPatch(typeof(InteractionCoordinator), nameof(InteractionCoordinator.ClientInteract))]
3029
internal static class Interacted
3130
{
3231
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
@@ -39,7 +38,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
3938
{
4039
// Handlers.Player.OnInteracted(new InteractedEventArgs(Player.Get(this.gameObject)));
4140
new(OpCodes.Ldarg_0),
42-
new(OpCodes.Call, PropertyGetter(typeof(PlayerInteract), nameof(PlayerInteract.gameObject))),
41+
new(OpCodes.Call, PropertyGetter(typeof(InteractionCoordinator), nameof(InteractionCoordinator.gameObject))),
4342
new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(GameObject) })),
4443
new(OpCodes.Newobj, GetDeclaredConstructors(typeof(InteractedEventArgs))[0]),
4544
new(OpCodes.Call, Method(typeof(Handlers.Player), nameof(Handlers.Player.OnInteracted))),

EXILED/Exiled.Events/Patches/Events/Warhead/ChangingLeverStatus.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ namespace Exiled.Events.Patches.Events.Warhead
2626
/// Adds the <see cref="Warhead.ChangingLeverStatus" /> event.
2727
/// </summary>
2828
[EventPatch(typeof(Warhead), nameof(Warhead.ChangingLeverStatus))]
29-
[HarmonyPatch(typeof(PlayerInteract), nameof(PlayerInteract.UserCode_CmdUsePanel__AlphaPanelOperations))]
29+
30+
// [HarmonyPatch(typeof(PlayerInteract), nameof(PlayerInteract.UserCode_CmdUsePanel__AlphaPanelOperations))]
3031
internal static class ChangingLeverStatus
3132
{
32-
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
33+
/*private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
3334
{
3435
List<CodeInstruction> newInstructions = ListPool<CodeInstruction>.Pool.Get(instructions);
3536
@@ -72,6 +73,6 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
7273
yield return newInstructions[z];
7374
7475
ListPool<CodeInstruction>.Pool.Return(newInstructions);
75-
}
76+
}*/
7677
}
7778
}

0 commit comments

Comments
 (0)