Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.
Open
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
35 changes: 35 additions & 0 deletions EXILED/Exiled.Events/EventArgs/Item/InspectedItemEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// -----------------------------------------------------------------------
// <copyright file="InspectedItemEventArgs.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.EventArgs.Item
{
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
using InventorySystem.Items;

/// <summary>
/// Contains all information before weapon is inspected.
/// </summary>
public class InspectedItemEventArgs : IItemEvent
{
/// <summary>
/// Initializes a new instance of the <see cref="InspectedItemEventArgs"/> class.
/// </summary>
/// <param name="item"><inheritdoc cref="Item"/></param>
public InspectedItemEventArgs(ItemBase item)
{
Item = Item.Get(item);
}

/// <inheritdoc/>
public Player Player => Item.Owner;

/// <inheritdoc/>
public Item Item { get; }
}
}
41 changes: 41 additions & 0 deletions EXILED/Exiled.Events/EventArgs/Item/InspectingItemEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// -----------------------------------------------------------------------
// <copyright file="InspectingItemEventArgs.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.EventArgs.Item
{
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
using InventorySystem.Items;

/// <summary>
/// Contains all information before weapon is inspected.
/// </summary>
public class InspectingItemEventArgs : IItemEvent, IDeniableEvent
{
/// <summary>
/// Initializes a new instance of the <see cref="InspectingItemEventArgs"/> class.
/// </summary>
/// <param name="item"><inheritdoc cref="Item"/></param>
/// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
public InspectingItemEventArgs(ItemBase item, bool isAllowed = true)
{
Item = Item.Get(item);
IsAllowed = isAllowed;
}

/// <inheritdoc/>
public Player Player => Item.Owner;

/// <inheritdoc/>
public Item Item { get; }

/// <inheritdoc/>
/// <remarks>Setter will not work if inspected <see cref="Item"/> is a <see cref="Firearm"/> or a <see cref="Keycard"/>.</remarks>
public bool IsAllowed { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// -----------------------------------------------------------------------
// <copyright file="PlacingMimicPointEventArgs.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.EventArgs.Scp939
{
using Exiled.API.Features;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Interfaces;
using RelativePositioning;

/// <summary>
/// Contains all information before mimicry point is placed.
/// </summary>
public class PlacingMimicPointEventArgs : IScp939Event, IDeniableEvent
{
/// <summary>
/// Initializes a new instance of the <see cref="PlacingMimicPointEventArgs"/> class.
/// </summary>
/// <param name="player"><inheritdoc cref="Player"/></param>
/// <param name="position"><inheritdoc cref="Position"/></param>
/// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
public PlacingMimicPointEventArgs(Player player, RelativePosition position, bool isAllowed = true)
{
Player = player;
Scp939 = player.Role.As<Scp939Role>();
Position = position;
IsAllowed = isAllowed;
}

/// <inheritdoc/>
public Player Player { get; }

/// <inheritdoc/>
public Scp939Role Scp939 { get; }

/// <inheritdoc/>
public bool IsAllowed { get; set; }

/// <summary>
/// Gets or sets a position of mimicry point.
/// </summary>
public RelativePosition Position { get; set; }
}
}
22 changes: 22 additions & 0 deletions EXILED/Exiled.Events/Handlers/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ public static class Item
/// </summary>
public static Event<ChangingMicroHIDPickupStateEventArgs> ChangingMicroHIDPickupState { get; set; } = new();

/// <summary>
/// Invoked before item inspection is started.
/// </summary>
public static Event<InspectingItemEventArgs> InspectingItem { get; set; } = new();

/// <summary>
/// Invoked after item inspection is started.
/// </summary>
public static Event<InspectedItemEventArgs> InspectedItem { get; set; } = new();

/// <summary>
/// Invoked before a <see cref="ItemType.ParticleDisruptor"/> firing while on the ground.
/// <remarks>The client will still see all effects, like sounds and shoot.</remarks>
Expand Down Expand Up @@ -118,5 +128,17 @@ public static class Item
/// </summary>
/// <param name="ev">The <see cref="ChangingMicroHIDPickupStateEventArgs"/> instance.</param>
public static void OnChangingMicroHIDPickupState(ChangingMicroHIDPickupStateEventArgs ev) => ChangingMicroHIDPickupState.InvokeSafely(ev);

/// <summary>
/// Called before item inspection is started.
/// </summary>
/// <param name="ev">The <see cref="InspectingItemEventArgs"/> instance.</param>
public static void OnInspectingItem(InspectingItemEventArgs ev) => InspectingItem.InvokeSafely(ev);

/// <summary>
/// Called before item inspection is started.
/// </summary>
/// <param name="ev">The <see cref="InspectedItemEventArgs"/> instance.</param>
public static void OnInspectedItem(InspectedItemEventArgs ev) => InspectedItem.InvokeSafely(ev);
}
}
11 changes: 11 additions & 0 deletions EXILED/Exiled.Events/Handlers/Scp939.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ public static class Scp939
/// </summary>
public static Event<ValidatingVisibilityEventArgs> ValidatingVisibility { get; set; } = new();

/// <summary>
/// Invoked before mimicry point is placed.
/// </summary>
public static Event<PlacingMimicPointEventArgs> PlacingMimicPoint { get; set; } = new();

/// <summary>
/// Called before SCP-939 changes its target focus.
/// </summary>
Expand Down Expand Up @@ -139,5 +144,11 @@ public static class Scp939
/// </summary>
/// <param name="ev">The <see cref="ValidatingVisibilityEventArgs"/> instance.</param>
public static void OnValidatingVisibility(ValidatingVisibilityEventArgs ev) => ValidatingVisibility.InvokeSafely(ev);

/// <summary>
/// Called before mimicry point is placed.
/// </summary>
/// <param name="ev">The <see cref="PlacingMimicPointEventArgs"/> instance.</param>
public static void OnPlacingMimicPoint(PlacingMimicPointEventArgs ev) => PlacingMimicPoint.InvokeSafely(ev);
}
}
Loading