forked from Exiled-Official/EXILED
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ExMod-Team:dev' into dev
- Loading branch information
Showing
12 changed files
with
206 additions
and
16 deletions.
There are no files selected for viewing
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
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
46 changes: 46 additions & 0 deletions
46
EXILED/Exiled.Events/EventArgs/Map/ElevatorSequencesUpdatedEventArgs.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,46 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="ElevatorSequencesUpdatedEventArgs.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.Map | ||
{ | ||
using Exiled.API.Features; | ||
using Exiled.Events.EventArgs.Interfaces; | ||
using Interactables.Interobjects; | ||
|
||
/// <summary> | ||
/// Contains all information after an elevator sequence is updated. | ||
/// </summary> | ||
public class ElevatorSequencesUpdatedEventArgs : IExiledEvent | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ElevatorSequencesUpdatedEventArgs"/> class. | ||
/// </summary> | ||
/// <param name="elevatorChamber"><inheritdoc cref="ElevatorChamber"/></param> | ||
/// <param name="sequence"><inheritdoc cref="ElevatorChamber.ElevatorSequence"/></param> | ||
public ElevatorSequencesUpdatedEventArgs(ElevatorChamber elevatorChamber, ElevatorChamber.ElevatorSequence sequence) | ||
{ | ||
Elevator = elevatorChamber; | ||
Lift = Lift.Get(elevatorChamber); | ||
Sequence = sequence; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the elevator chamber that triggered this event. | ||
/// </summary> | ||
public ElevatorChamber Elevator { get; } | ||
|
||
/// <summary> | ||
/// Gets the lift that triggered this event. | ||
/// </summary> | ||
public Lift Lift { get; } | ||
|
||
/// <summary> | ||
/// Gets the new sequence of the elevator. | ||
/// </summary> | ||
public ElevatorChamber.ElevatorSequence Sequence { 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
31 changes: 31 additions & 0 deletions
31
EXILED/Exiled.Events/Patches/Events/Map/ElevatorSequencesUpdated.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,31 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="ElevatorSequencesUpdated.cs" company="ExMod Team"> | ||
// Copyright (c) ExMod Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.Events.Patches.Events.Map | ||
{ | ||
using Exiled.Events.Attributes; | ||
using Exiled.Events.EventArgs.Map; | ||
using HarmonyLib; | ||
using Interactables.Interobjects; | ||
|
||
/// <summary> | ||
/// Patches <see cref="ElevatorChamber.CurSequence" />'s setter. | ||
/// Adds the <see cref="Handlers.Map.ElevatorSequencesUpdated" /> event. | ||
/// </summary> | ||
[EventPatch(typeof(Handlers.Map), nameof(Handlers.Map.ElevatorSequencesUpdated))] | ||
[HarmonyPatch(typeof(ElevatorChamber), nameof(ElevatorChamber.CurSequence), MethodType.Setter)] | ||
internal class ElevatorSequencesUpdated | ||
{ | ||
#pragma warning disable SA1313 | ||
private static void Postfix(ElevatorChamber __instance) | ||
#pragma warning restore SA1313 | ||
{ | ||
ElevatorSequencesUpdatedEventArgs ev = new(__instance, __instance.CurSequence); | ||
Handlers.Map.OnElevatorSequencesUpdated(ev); | ||
} | ||
} | ||
} |
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