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
4 changes: 4 additions & 0 deletions .idea/.idea.MegaAPI/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.MegaAPI/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.MegaAPI/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions MegaAPI.sln.DotSettings.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AgameDebug_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F28fd596fa01147c5ac2fa6b92cff5209352a00_003Fc6_003Fa7afb9b6_003FgameDebug_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIConsoleCommand_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F28fd596fa01147c5ac2fa6b92cff5209352a00_003F6d_003Fefadd0cc_003FIConsoleCommand_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMelonMod_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F6111a3fd3a7766d590da5a83875564ed5292844da3cfc646e9b30c879e853f8_003FMelonMod_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APlayerMenu_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F28fd596fa01147c5ac2fa6b92cff5209352a00_003Fd7_003F06597227_003FPlayerMenu_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APlayerMenu_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4b46f5cabbd9426e8522582d89d9580d358400_003F0c_003F101d3200_003FPlayerMenu_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASoundManager_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F28fd596fa01147c5ac2fa6b92cff5209352a00_003F1f_003Fd37b7dec_003FSoundManager_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
</wpf:ResourceDictionary>
49 changes: 49 additions & 0 deletions MegaAPI/API/Console.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
namespace MegaAPI.API;

using Il2Cpp;
using MegaAPI.API.Interfaces;

/// <summary>
/// Wrapper for <see cref="gameDebug"/>.
/// </summary>
public class Console : IWrapper<gameDebug>
{
/// <summary>
/// Initializes a new instance of the <see cref="Console"/> class.
/// </summary>
/// <param name="consoleBase">Base component of the console.</param>
internal Console(gameDebug consoleBase)
{
Base = consoleBase;
}

/// <summary>
/// Gets the current instance of the Console.
/// </summary>
/// <remarks>It can be null.</remarks>
public static Console Instance { get; internal set; }

/// <inheritdoc />
public gameDebug Base { get; }

/// <summary>
/// Gets or sets a value indicating whether the player is cheating.
/// </summary>
public bool Cheats
{
get => Base.CheatsEnabled;
set => Base.SetCheatsEnabled(value);
}

/// <summary>
/// Sends commands as the player.
/// </summary>
/// <param name="command">Command to send.</param>
public void SendCommand(string command) => Base.HandleConsoleCommand(command);

/// <summary>
/// Sends a message to the player.
/// </summary>
/// <param name="message">Adds a message to the console.</param>
public void AddMessage(string message) => Base.AddConsoleMessage(message);
}
17 changes: 17 additions & 0 deletions MegaAPI/API/Enums/MenuType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace MegaAPI.API.Enums;

/// <summary>
/// All menus types in the game.
/// </summary>
public enum MenuType
{
/// <summary>
/// Pause Screen.
/// </summary>
Pause,

/// <summary>
/// Settings Menu.
/// </summary>
Settings,
}
12 changes: 12 additions & 0 deletions MegaAPI/API/Events/Arguments/Interfaces/IPlayerEvents.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace MegaAPI.API.Events.Arguments.Interfaces;

/// <summary>
/// Represents an event that is related to a player.
/// </summary>
public interface IPlayerEvents
{
/// <summary>
/// Gets the player that invoked the event.
/// </summary>
public API.Player Player { get; }
}
28 changes: 28 additions & 0 deletions MegaAPI/API/Events/Arguments/Player/PlayerChangingFOVEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using MegaAPI.API.Events.Arguments.Interfaces;

namespace MegaAPI.API.Events.Arguments.Player;

using System;

/// <summary>
/// Represents the arguments for the <see cref="Handlers.ConsoleEventsHandler.AddingLine"/> event.
/// </summary>
public class PlayerChangingFOVEventArgs : EventArgs, IPlayerEvents
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayerChangingFOVEventArgs"/> class.
/// </summary>
/// <param name="fov">The new fov value.</param>
public PlayerChangingFOVEventArgs(float fov)
{
NewFOV = fov;
}

/// <summary>
/// Gets or sets the new FOV.
/// </summary>
public float NewFOV { get; set; }

/// <inheritdoc />
public API.Player Player => API.Player.Instance;
}
25 changes: 25 additions & 0 deletions MegaAPI/API/Events/Arguments/Player/PlayerCrouchingEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace MegaAPI.API.Events.Arguments.Player;

using System;
using MegaAPI.API.Events.Arguments.Interfaces;
using UnityEngine;

/// <summary>
/// Represents the arguments for the <see cref="Handlers.ConsoleEventsHandler.AddingLine"/> event.
/// </summary>
public class PlayerCrouchingEventArgs : EventArgs, IDeniableEvent, IPlayerEvents
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayerCrouchingEventArgs"/> class.
/// </summary>
public PlayerCrouchingEventArgs()
{
IsAllowed = true;
}

/// <inheritdoc />
public API.Player Player => API.Player.Instance;

/// <inheritdoc />
public bool IsAllowed { get; set; }
}
25 changes: 25 additions & 0 deletions MegaAPI/API/Events/Arguments/Player/PlayerDashingEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace MegaAPI.API.Events.Arguments.Player;

using System;
using MegaAPI.API.Events.Arguments.Interfaces;
using UnityEngine;

/// <summary>
/// Represents the arguments for the <see cref="Handlers.ConsoleEventsHandler.AddingLine"/> event.
/// </summary>
public class PlayerDashingEventArgs : EventArgs, IDeniableEvent, IPlayerEvents
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayerDashingEventArgs"/> class.
/// </summary>
public PlayerDashingEventArgs()
{
IsAllowed = true;
}

/// <inheritdoc />
public API.Player Player => API.Player.Instance;

/// <inheritdoc />
public bool IsAllowed { get; set; }
}
21 changes: 21 additions & 0 deletions MegaAPI/API/Events/Arguments/Player/PlayerDyingEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace MegaAPI.API.Events.Arguments.Player;

using System;
using MegaAPI.API.Events.Arguments.Interfaces;
using UnityEngine;

/// <summary>
/// Represents the arguments for the <see cref="Handlers.ConsoleEventsHandler.AddingLine"/> event.
/// </summary>
public class PlayerDyingEventArgs : EventArgs, IPlayerEvents
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayerDyingEventArgs"/> class.
/// </summary>
public PlayerDyingEventArgs()
{
}

/// <inheritdoc />
public API.Player Player => API.Player.Instance;
}
32 changes: 32 additions & 0 deletions MegaAPI/API/Events/Arguments/Player/PlayerEndingLevelEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace MegaAPI.API.Events.Arguments.Player;

using System;
using MegaAPI.API.Events.Arguments.Interfaces;
using UnityEngine;

/// <summary>
/// Represents the arguments for the <see cref="Handlers.ConsoleEventsHandler.AddingLine"/> event.
/// </summary>
public class PlayerEndingLevelEventArgs : EventArgs, IDeniableEvent, IPlayerEvents
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayerEndingLevelEventArgs"/> class.
/// </summary>
/// <param name="collider">The ending collider.</param>
public PlayerEndingLevelEventArgs(Collider collider)
{
Collider = collider;
IsAllowed = true;
}

/// <summary>
/// Gets the ending collider.
/// </summary>
public Collider Collider { get; private set; }

/// <inheritdoc />
public API.Player Player => API.Player.Instance;

/// <inheritdoc />
public bool IsAllowed { get; set; }
}
25 changes: 25 additions & 0 deletions MegaAPI/API/Events/Arguments/Player/PlayerJumpingEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace MegaAPI.API.Events.Arguments.Player;

using System;
using MegaAPI.API.Events.Arguments.Interfaces;
using UnityEngine;

/// <summary>
/// Represents the arguments for the <see cref="Handlers.ConsoleEventsHandler.AddingLine"/> event.
/// </summary>
public class PlayerJumpingEventArgs : EventArgs, IDeniableEvent, IPlayerEvents
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayerJumpingEventArgs"/> class.
/// </summary>
public PlayerJumpingEventArgs()
{
IsAllowed = true;
}

/// <inheritdoc />
public API.Player Player => API.Player.Instance;

/// <inheritdoc />
public bool IsAllowed { get; set; }
}
25 changes: 25 additions & 0 deletions MegaAPI/API/Events/Arguments/Player/PlayerNoClippingEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace MegaAPI.API.Events.Arguments.Player;

using System;
using MegaAPI.API.Events.Arguments.Interfaces;
using UnityEngine;

/// <summary>
/// Represents the arguments for the <see cref="Handlers.ConsoleEventsHandler.AddingLine"/> event.
/// </summary>
public class PlayerNoClippingEventArgs : EventArgs, IDeniableEvent, IPlayerEvents
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayerNoClippingEventArgs"/> class.
/// </summary>
public PlayerNoClippingEventArgs()
{
IsAllowed = true;
}

/// <inheritdoc />
public API.Player Player => API.Player.Instance;

/// <inheritdoc />
public bool IsAllowed { get; set; }
}
33 changes: 33 additions & 0 deletions MegaAPI/API/Events/Arguments/Player/PlayerOpeningMenuEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace MegaAPI.API.Events.Arguments.Player;

using System;
using MegaAPI.API.Enums;
using MegaAPI.API.Events.Arguments.Interfaces;
using UnityEngine;

/// <summary>
/// Represents the arguments for the <see cref="Handlers.ConsoleEventsHandler.AddingLine"/> event.
/// </summary>
public class PlayerOpeningMenuEventArgs : EventArgs, IDeniableEvent, IPlayerEvents
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayerOpeningMenuEventArgs"/> class.
/// </summary>
/// <param name="type">The ending collider.</param>
public PlayerOpeningMenuEventArgs(MenuType type)
{
Type = type;
IsAllowed = true;
}

/// <inheritdoc />
public API.Player Player => API.Player.Instance;

/// <summary>
/// Gets the type of the menu the player is trying to open.
/// </summary>
public MenuType Type { get; private set; }

/// <inheritdoc />
public bool IsAllowed { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace MegaAPI.API.Events.Arguments.Player;

using System;
using MegaAPI.API.Events.Arguments.Interfaces;
using UnityEngine;

/// <summary>
/// Represents the arguments for the <see cref="Handlers.ConsoleEventsHandler.AddingLine"/> event.
/// </summary>
public class PlayerReachingCheckpointEventArgs : EventArgs, IDeniableEvent, IPlayerEvents
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayerReachingCheckpointEventArgs"/> class.
/// </summary>
/// <param name="collider">The ending collider.</param>
public PlayerReachingCheckpointEventArgs(Collider collider)
{
Collider = collider;
IsAllowed = true;
}

/// <summary>
/// Gets the ending collider.
/// </summary>
public Collider Collider { get; private set; }

/// <inheritdoc />
public API.Player Player => API.Player.Instance;

/// <inheritdoc />
public bool IsAllowed { get; set; }
}
21 changes: 21 additions & 0 deletions MegaAPI/API/Events/Arguments/Player/PlayerSpawningEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace MegaAPI.API.Events.Arguments.Player;

using System;
using MegaAPI.API.Events.Arguments.Interfaces;
using UnityEngine;

/// <summary>
/// Represents the arguments for the <see cref="Handlers.ConsoleEventsHandler.AddingLine"/> event.
/// </summary>
public class PlayerSpawningEventArgs : EventArgs, IPlayerEvents
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayerSpawningEventArgs"/> class.
/// </summary>
public PlayerSpawningEventArgs()
{
}

/// <inheritdoc />
public API.Player Player => API.Player.Instance;
}
Loading