Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions EXILED/Exiled.API/Features/Core/UserSettings/KeybindSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ namespace Exiled.API.Features.Core.UserSettings
/// </summary>
public class KeybindSetting : SettingBase, IWrapper<SSKeybindSetting>
{
/// <summary>
/// Initializes a new instance of the <see cref="KeybindSetting"/> class.
/// </summary>
/// <param name="id"><inheritdoc cref="SettingBase.Id"/></param>
/// <param name="label"><inheritdoc cref="SettingBase.Label"/></param>
/// <param name="suggested"><inheritdoc cref="KeyCode"/></param>
/// <param name="preventInteractionOnGUI"><inheritdoc cref="PreventInteractionOnGUI"/></param>
/// <param name="hintDescription"><inheritdoc cref="SettingBase.HintDescription"/></param>
/// <param name="header"><inheritdoc cref="SettingBase.Header"/></param>
/// <param name="onChanged"><inheritdoc cref="SettingBase.OnChanged"/></param>
[Obsolete("This method will be removed next major version because of a new feature. Use the constructor with \"allowSpectator\" instead.")]
public KeybindSetting(int id, string label, KeyCode suggested, bool preventInteractionOnGUI, string hintDescription, HeaderSetting header, Action<Player, SettingBase> onChanged)
: base(new SSKeybindSetting(id, label, suggested, preventInteractionOnGUI, false, hintDescription), header, onChanged)
{
Base = (SSKeybindSetting)base.Base;
}

/// <summary>
/// Initializes a new instance of the <see cref="KeybindSetting"/> class.
/// </summary>
Expand Down
11 changes: 3 additions & 8 deletions EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1163,11 +1163,6 @@ public bool IsSpawnProtected
/// </summary>
protected HealthStat CustomHealthStat { get; set; }

/// <summary>
/// Gets or sets a <see cref="ScaleController"/>.
/// </summary>
protected FpcScaleController ScaleController { get; set; }

/// <summary>
/// Converts LabApi player to EXILED player.
/// </summary>
Expand Down Expand Up @@ -2077,7 +2072,7 @@ public void SetScale(Vector3 scale, IEnumerable<Player> viewers)

try
{
ScaleController.Scale = scale;
ReferenceHub.transform.localScale = scale;

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

try
{
ScaleController.Scale = fakeScale;
ReferenceHub.transform.localScale = fakeScale;

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

ScaleController.Scale = currentScale;
ReferenceHub.transform.localScale = currentScale;
}
catch (Exception ex)
{
Expand Down
4 changes: 2 additions & 2 deletions EXILED/Exiled.Events/Patches/Events/Server/RoundEnd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
new CodeInstruction[]
{
new(OpCodes.Call, PropertyGetter(typeof(Round), nameof(Round.IgnoredPlayers))),
new(OpCodes.Ldloc_S, 19),
new(OpCodes.Call, Method(typeof(HashSet<ReferenceHub>), nameof(HashSet<ReferenceHub>.Contains))),
new(OpCodes.Ldloc_S, 20),
new(OpCodes.Callvirt, Method(typeof(HashSet<ReferenceHub>), nameof(HashSet<ReferenceHub>.Contains))),
new(OpCodes.Brtrue_S, jmp),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,32 @@ namespace Exiled.Events.Patches.Events.Warhead
using Warhead = Handlers.Warhead;

/// <summary>
/// Patches <see cref="PlayerInteract.UserCode_CmdUsePanel__AlphaPanelOperations" />.
/// Patches <see cref="AlphaWarheadNukesitePanel.ServerInteract" />.
/// Adds the <see cref="Warhead.ChangingLeverStatus" /> event.
/// </summary>
[EventPatch(typeof(Warhead), nameof(Warhead.ChangingLeverStatus))]

// [HarmonyPatch(typeof(PlayerInteract), nameof(PlayerInteract.UserCode_CmdUsePanel__AlphaPanelOperations))]
[HarmonyPatch(typeof(AlphaWarheadNukesitePanel), nameof(AlphaWarheadNukesitePanel.ServerInteract))]
internal static class ChangingLeverStatus
{
/*private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{
List<CodeInstruction> newInstructions = ListPool<CodeInstruction>.Pool.Get(instructions);

Label returnLabel = generator.DefineLabel();

int offset = 2;
int index = newInstructions.FindLastIndex(instruction => instruction.opcode == OpCodes.Brtrue_S) + offset;
int index = newInstructions.FindIndex(instruction => instruction.opcode == OpCodes.Call);

newInstructions.InsertRange(
index,
new[]
{
// Player.Get(component)
new CodeInstruction(OpCodes.Ldloc_0).MoveLabelsFrom(newInstructions[index]),
new CodeInstruction(OpCodes.Ldarg_1).MoveLabelsFrom(newInstructions[index]),
new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })),

// nukeside.Networkenabled
new(OpCodes.Ldloc_1),
new(OpCodes.Ldarg_0),
new(OpCodes.Call, PropertyGetter(typeof(AlphaWarheadNukesitePanel), nameof(AlphaWarheadNukesitePanel.Networkenabled))),

// true
Expand All @@ -73,6 +72,6 @@ internal static class ChangingLeverStatus
yield return newInstructions[z];

ListPool<CodeInstruction>.Pool.Return(newInstructions);
}*/
}
}
}