Skip to content

Commit 1ff5dd7

Browse files
committed
3.5.3
1 parent 8b24997 commit 1ff5dd7

5 files changed

Lines changed: 19 additions & 49 deletions

File tree

UncomplicatedCustomItems/API/Extensions/PlayerExtensions.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

UncomplicatedCustomItems/API/Wrappers/SSS.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static void AddOrUpdateUserSetting(ReferenceHub user, ServerSpecificSetti
2222

2323
userSettings.Add(setting);
2424
}
25-
25+
2626
public static void AddToolGunSettingsToUser(ReferenceHub user)
2727
{
2828
List<ServerSpecificSettingBase> userSettings = ServerSpecificSettingsSync.ReceivedUserSettings.GetOrAddNew(user);

UncomplicatedCustomItems/Events/PlayerHandler.cs

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
using Exiled.API.Features.Items;
2525
using CustomPlayerEffects;
2626
using Exiled.API.Features;
27-
using Exiled.CustomItems.API.Features;
2827

2928
namespace UncomplicatedCustomItems.Events
3029
{
@@ -808,17 +807,14 @@ public static void OnDoorInteracting(InteractingDoorEventArgs ev)
808807
IKeycardData Data = CustomItem.CustomItem.CustomData as IKeycardData;
809808
Timing.CallDelayed(0.1f, () =>
810809
{
811-
if (ev.Player.HasKeycardPermission((KeycardPermissions)ev.Door.RequiredPermissions))
810+
if (ev.Door.Base.IsMoving && Data.OneTimeUse)
812811
{
813-
if (Data.OneTimeUse)
812+
Timing.CallDelayed(0.5f, () =>
814813
{
815-
Timing.CallDelayed(0.5f, () =>
816-
{
817-
ev.Player.ShowHint($"{Data.OneTimeUseHint.Replace("%name%", CustomItem.CustomItem.Name)}", 8f);
818-
LogManager.Debug($"OneTimeUse is true removing {CustomItem.CustomItem.Name}...");
819-
ev.Player.RemoveItem(CustomItem.Item, true);
820-
});
821-
}
814+
ev.Player.ShowHint($"{Data.OneTimeUseHint.Replace("%name%", CustomItem.CustomItem.Name)}", 8f);
815+
LogManager.Debug($"OneTimeUse is true removing {CustomItem.CustomItem.Name}...");
816+
ev.Player.RemoveItem(CustomItem.Item, true);
817+
});
822818
}
823819
});
824820
}
@@ -859,18 +855,15 @@ public static void OnLockerInteracting(InteractingLockerEventArgs ev)
859855
{
860856
if (CustomItem.CustomItem.CustomItemType == CustomItemType.Keycard)
861857
{
862-
if (ev.Player.HasKeycardPermission(ev.InteractingChamber.RequiredPermissions))
858+
IKeycardData Data = CustomItem.CustomItem.CustomData as IKeycardData;
859+
if (ev.InteractingChamber.IsOpen && Data.OneTimeUse)
863860
{
864-
IKeycardData Data = CustomItem.CustomItem.CustomData as IKeycardData;
865-
if (Data.OneTimeUse)
861+
Timing.CallDelayed(0.5f, () =>
866862
{
867-
Timing.CallDelayed(0.5f, () =>
868-
{
869-
ev.Player.ShowHint($"{Data.OneTimeUseHint.Replace("%name%", CustomItem.CustomItem.Name)}", 8f);
870-
LogManager.Debug($"OneTimeUse is true removing {CustomItem.CustomItem.Name}...");
871-
ev.Player.RemoveItem(CustomItem.Item, true);
872-
});
873-
}
863+
ev.Player.ShowHint($"{Data.OneTimeUseHint.Replace("%name%", CustomItem.CustomItem.Name)}", 8f);
864+
LogManager.Debug($"OneTimeUse is true removing {CustomItem.CustomItem.Name}...");
865+
ev.Player.RemoveItem(CustomItem.Item, true);
866+
});
874867
}
875868
}
876869
}

UncomplicatedCustomItems/Plugin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public override void OnEnabled()
8484
_playerSettings =
8585
[
8686
new SSGroupHeader("CustomItem Settings"),
87-
new SSKeybindSetting(20, "Trigger CustomItem", KeyCode.K, hint: "When pressed this will trigger the CustomItem your holding")
87+
new SSKeybindSetting(20, "Trigger CustomItem", KeyCode.K, hint: "When pressed this will trigger the CustomItem your holding", allowSpectatorTrigger: false)
8888
];
8989
_DebugSettings =
9090
[
@@ -100,7 +100,7 @@ public override void OnEnabled()
100100
new SSTextArea(29, "Default Message"),
101101

102102
new SSGroupHeader("CustomItem Settings"),
103-
new SSKeybindSetting(20, "Trigger CustomItem", KeyCode.K, hint: "When pressed this will trigger the CustomItem your holding")
103+
new SSKeybindSetting(20, "Trigger CustomItem", KeyCode.K, hint: "When pressed this will trigger the CustomItem your holding", allowSpectatorTrigger: false)
104104
];
105105

106106
ServerSpecificSettingsSync.DefinedSettings = _settings.ToArray();

UncomplicatedCustomItems/UncomplicatedCustomItems.csproj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<ErrorReport>prompt</ErrorReport>
5454
<DocumentationFile>bin\x64\Release\UncomplicatedCustomItems.xml</DocumentationFile>
5555
<DebugSymbols>true</DebugSymbols>
56+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5657
</PropertyGroup>
5758
<ItemGroup>
5859
<Reference Include="0Harmony, Version=2.2.2.0, Culture=neutral, processorArchitecture=MSIL">
@@ -100,6 +101,7 @@
100101
<SpecificVersion>False</SpecificVersion>
101102
<HintPath>$(EXILED_REFERENCES)\Pooling.dll</HintPath>
102103
</Reference>
104+
<Reference Include="mscorlib" />
103105
<Reference Include="System" />
104106
<Reference Include="System.Net.Http" />
105107
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
@@ -536,7 +538,6 @@
536538
<Compile Include="API\Extensions\HarmonyExtensions.cs" />
537539
<Compile Include="API\Extensions\ItemExtensions.cs" />
538540
<Compile Include="API\Extensions\PickupExtensions.cs" />
539-
<Compile Include="API\Extensions\PlayerExtensions.cs" />
540541
<Compile Include="API\Extensions\StringExtensions.cs" />
541542
<Compile Include="API\Extensions\Vector3Extensions.cs" />
542543
<Compile Include="HarmonyElements\Patches\ServerNamePatch.cs" />
@@ -586,14 +587,11 @@
586587
<ItemGroup />
587588
<ItemGroup>
588589
<PackageReference Include="ExMod.Exiled">
589-
<Version>9.6.0</Version>
590+
<Version>9.6.1</Version>
590591
</PackageReference>
591592
<PackageReference Include="Newtonsoft.Json">
592593
<Version>13.0.3</Version>
593594
</PackageReference>
594-
<PackageReference Include="Northwood.LabAPI">
595-
<Version>1.0.2</Version>
596-
</PackageReference>
597595
</ItemGroup>
598596
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
599597
</Project>

0 commit comments

Comments
 (0)