-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* NewFix * Squash a lot of useless commit This reverts commit 50e6123. Squashed commit of the following: commit d6f910c Merge: 71e1870 981476e Author: louis1706 <[email protected]> Date: Thu Nov 30 11:15:32 2023 +0100 Merge branch 'Fix-ChangingAmmoEvent' of https://github.com/louis1706/EXILED into Fix-ChangingAmmoEvent commit 981476e Merge: 263eaaa f010ec9 Author: Yamato <[email protected]> Date: Thu Nov 30 01:19:00 2023 +0100 Merge branch 'dev' into Fix-ChangingAmmoEvent commit 263eaaa Author: Yamato <[email protected]> Date: Thu Nov 30 01:18:12 2023 +0100 Update ChangingAmmo.cs commit 71e1870 Author: louis1706 <[email protected]> Date: Thu Nov 30 00:00:25 2023 +0100 Fix commit df2b58a Merge: 782c481 96eb33b Author: Yamato <[email protected]> Date: Wed Nov 29 23:55:51 2023 +0100 Merge branch 'dev' into Fix-ChangingAmmoEvent commit 782c481 Merge: 670c692 0953d7c Author: Misaka-ZeroTwo <[email protected]> Date: Wed Nov 29 17:44:59 2023 -0500 Merge branch 'dev' into Fix-ChangingAmmoEvent commit 670c692 Author: Yamato <[email protected]> Date: Wed Nov 29 23:36:40 2023 +0100 Update ChangingAmmo.cs commit 9ced0ee Author: louis1706 <[email protected]> Date: Wed Nov 29 00:36:17 2023 +0100 Event Should not be fired when Ammo it's not changed commit 3f97d68 Author: louis1706 <[email protected]> Date: Wed Nov 29 00:10:13 2023 +0100 FixChangingAmmoEventAndUpgradeIt Add ChangedAttachments Event Reorder Using . Fix Dup Revert "Fix Dup" This reverts commit bee995b. Revert "Reorder Using" This reverts commit f85fe5e. Revert This reverts partially commit 581a878. New place * Fix * Delete Exiled.CustomItems/API/Features/CustomWeapon.cs * Fix `ChangingAttachments` `ChangedAttachments` * useless .ToList() --------- Co-authored-by: Nao <[email protected]> Co-authored-by: VALERA771 <[email protected]> Co-authored-by: Ika <[email protected]> Co-authored-by: Nameless <[email protected]>
- Loading branch information
1 parent
3324292
commit 5ff18df
Showing
6 changed files
with
196 additions
and
114 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
Exiled.Events/EventArgs/Item/ChangedAttachmentsEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="ChangedAttachmentsEventArgs.cs" company="Exiled Team"> | ||
// Copyright (c) Exiled Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.Events.EventArgs.Item | ||
{ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
using API.Features; | ||
using API.Features.Items; | ||
using API.Structs; | ||
|
||
using Exiled.API.Extensions; | ||
|
||
using Interfaces; | ||
using InventorySystem.Items.Firearms.Attachments; | ||
|
||
using Firearm = API.Features.Items.Firearm; | ||
|
||
/// <summary> | ||
/// Contains all information after changing item attachments. | ||
/// </summary> | ||
public class ChangedAttachmentsEventArgs : IPlayerEvent, IFirearmEvent | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ChangedAttachmentsEventArgs" /> class. | ||
/// </summary> | ||
/// <param name="firearm"><inheritdoc cref="Firearm"/></param> | ||
/// <param name="code"><inheritdoc cref="OldAttachmentsCode"/></param> | ||
public ChangedAttachmentsEventArgs(Firearm firearm, uint code) | ||
{ | ||
Firearm = firearm; | ||
Player = Firearm.Owner; | ||
OldAttachmentIdentifiers = Firearm.AttachmentIdentifiers; | ||
NewAttachmentIdentifiers = Firearm.FirearmType.GetAttachmentIdentifiers(code); | ||
OldAttachmentsCode = code; | ||
NewAttachmentsCode = firearm.Base.GetCurrentAttachmentsCode(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the old <see cref="AttachmentIdentifier" /> list. | ||
/// </summary> | ||
public IEnumerable<AttachmentIdentifier> OldAttachmentIdentifiers { get; } | ||
|
||
/// <summary> | ||
/// Gets or sets the new <see cref="AttachmentIdentifier" /> list. | ||
/// </summary> | ||
public IEnumerable<AttachmentIdentifier> NewAttachmentIdentifiers { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the <see cref="OldAttachmentIdentifiers" /> code. | ||
/// </summary> | ||
public uint OldAttachmentsCode { get; } | ||
|
||
/// <summary> | ||
/// Gets the <see cref="NewAttachmentIdentifiers" /> code. | ||
/// </summary> | ||
public uint NewAttachmentsCode { get; } | ||
|
||
/// <summary> | ||
/// Gets the <see cref="API.Features.Items.Firearm" /> which has been modified. | ||
/// </summary> | ||
public Firearm Firearm { get; } | ||
|
||
/// <inheritdoc/> | ||
public Item Item => Firearm; | ||
|
||
/// <summary> | ||
/// Gets the <see cref="API.Features.Player" /> who's changed attachments. | ||
/// </summary> | ||
public Player Player { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.