From 656b22b5be0752ae10dff7576b3d835816b038b0 Mon Sep 17 00:00:00 2001 From: Robocnop Date: Wed, 14 Aug 2024 21:58:50 +0200 Subject: [PATCH] Push my stuff --- AdminServicesNotifier.cs | 43 +++++++++++++++++++++++++ AdminServicesNotifier.csproj | 61 ++++++++++++++++++++++++++++++++++++ Properties/AssemblyInfo.cs | 36 +++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 AdminServicesNotifier.cs create mode 100644 AdminServicesNotifier.csproj create mode 100644 Properties/AssemblyInfo.cs diff --git a/AdminServicesNotifier.cs b/AdminServicesNotifier.cs new file mode 100644 index 0000000..1fddcbf --- /dev/null +++ b/AdminServicesNotifier.cs @@ -0,0 +1,43 @@ +using ModKit.Helper; +using ModKit.Internal; +using ModKit.Interfaces; +using _menu = AAMenu.Menu; +using Life; +using Life.Network; +using UnityEngine; + +public class AdminServicesNotifier : ModKit.ModKit +{ + public AdminServicesNotifier(IGameAPI api) : base(api) + { + PluginInformations = new PluginInformations(AssemblyHelper.GetName(), "1.0.0", "Robocnop"); + } + + public override void OnPluginInit() + { + base.OnPluginInit(); + Debug.Log("AdminServicesNotifier est initialisé"); + InsertMenu(); + } + + public void InsertMenu() + { + _menu.AddAdminTabLine(PluginInformations, 1, "Annoncer votre prise de service admin au serveur", (ui) => + { + Player player = PanelHelper.ReturnPlayerFromPanel(ui); + + Nova.server.SendMessageToAll($"[Serveur] L'Admin {player.account.username} est disponible"); + player.Notify("Succès", "Action effectuée avec succès.", (NotificationManager.Type)1, 5f); + + }); + + _menu.AddAdminTabLine(PluginInformations, 1, "Annoncer votre fin de prise de service admin au serveur", (ui) => + { + Player player = PanelHelper.ReturnPlayerFromPanel(ui); + + Nova.server.SendMessageToAll($"[Serveur] L'Admin {player.account.username} est indisponible"); + player.Notify("Succès", "Action effectuée avec succès.", (NotificationManager.Type)1, 5f); + + }); + } +} \ No newline at end of file diff --git a/AdminServicesNotifier.csproj b/AdminServicesNotifier.csproj new file mode 100644 index 0000000..45bee78 --- /dev/null +++ b/AdminServicesNotifier.csproj @@ -0,0 +1,61 @@ + + + + + Debug + AnyCPU + {5762DFF7-77DE-4C98-9F8A-AF7ABF66C6F5} + Library + Properties + AdminServicesNotifier + AdminServicesNotifier + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + x64 + + + + ..\..\NovaLifeREF\AAMenu.dll + + + ..\..\NovaLifeREF\Assembly-CSharp.dll + + + ..\..\NovaLifeREF\ModKit.dll + + + + + + + + + + + ..\..\NovaLifeREF\UnityEngine.CoreModule.dll + + + + + + + + \ No newline at end of file diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b87a063 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Les informations générales relatives à un assembly dépendent de +// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations +// associées à un assembly. +[assembly: AssemblyTitle("AdminServicesNotifier")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AdminServicesNotifier")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly +// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de +// COM, affectez la valeur true à l'attribut ComVisible sur ce type. +[assembly: ComVisible(false)] + +// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM +[assembly: Guid("5762dff7-77de-4c98-9f8a-af7abf66c6f5")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut +// en utilisant '*', comme indiqué ci-dessous : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")]