From 9f744e567a451914baa87fcaa6cfa2d0364431b0 Mon Sep 17 00:00:00 2001 From: sky Date: Wed, 19 Feb 2025 22:02:26 +0100 Subject: [PATCH 1/7] [AUTOMATIC] push version to 2.0.5 --- Plugin.cs | 2 +- Properties/AssemblyInfo.cs | 2 +- SSMenuSystem-EXILED.nuspec | 2 +- SSMenuSystem-LABAPI.nuspec | 2 +- build.sh | 6 +++++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Plugin.cs b/Plugin.cs index f9127d3..e6386a4 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -44,7 +44,7 @@ public class Plugin /// /// Gets the version of the plugin. /// - public override Version Version => new(2, 0, 4); + public override Version Version => new(2, 0, 5); #if EXILED /// diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 99b5ee4..d583795 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.4")] +[assembly: AssemblyVersion("2.0.5")] [assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/SSMenuSystem-EXILED.nuspec b/SSMenuSystem-EXILED.nuspec index 83d0600..188faec 100644 --- a/SSMenuSystem-EXILED.nuspec +++ b/SSMenuSystem-EXILED.nuspec @@ -3,7 +3,7 @@ SSMenuSystem SS Menu System - 2.0.4-EXILED + 2.0.5-EXILED Sky Sky Copyright © Sky 2025 diff --git a/SSMenuSystem-LABAPI.nuspec b/SSMenuSystem-LABAPI.nuspec index ca6b494..98ddba2 100644 --- a/SSMenuSystem-LABAPI.nuspec +++ b/SSMenuSystem-LABAPI.nuspec @@ -3,7 +3,7 @@ SSMenuSystem SS Menu System - 2.0.4-LABAPI-BETA + 2.0.5-LABAPI-Beta Sky Sky Copyright © Sky 2025 diff --git a/build.sh b/build.sh index 0e43eef..371b048 100755 --- a/build.sh +++ b/build.sh @@ -38,7 +38,7 @@ fi if [ -n "$version" ] && [ -z "$debug" ]; then VERSION="$version" - sed -i "46s/.*/ public override Version Version => new($(echo "$VERSION" | sed 's/\./, /g'));/" Plugin.cs + sed -i "47s/.*/ public override Version Version => new($(echo "$VERSION" | sed 's/\./, /g'));/" Plugin.cs if [ $verbosity == "all" ]; then echo "[VERBOSE/ALL]: changed Plugin.cs line 37 for version $VERSION (EXILED)" fi @@ -47,6 +47,10 @@ if [ -n "$version" ] && [ -z "$debug" ]; then if [ $verbosity == "all" ]; then echo "[VERBOSE/ALL]: changed SSMenuSystem-EXILED.nuspec line 6 for version $VERSION (EXILED)" fi + sed -i "6s/.*/ $VERSION-LABAPI-Beta<\/version>/" SSMenuSystem-LABAPI.nuspec + if [ $verbosity == "all" ]; then + echo "[VERBOSE/ALL]: changed SSMenuSystem-LABAPI.nuspec line 6 for version $VERSION (LABAPI)" + fi sed -i "34s/.*/[assembly: AssemblyVersion(\"$VERSION\")]/" Properties/AssemblyInfo.cs if [ $verbosity == "all" ]; then From 2a9764415a1e62b0c366bbe6dd3e342d67970b56 Mon Sep 17 00:00:00 2001 From: sky Date: Thu, 27 Mar 2025 15:51:27 +0100 Subject: [PATCH 2/7] idk --- EventHandler.cs | 13 +++++++++---- Features/Menu.cs | 35 +++++++++++++++++++++++++---------- Features/Parameters.cs | 4 ++-- SSMenuSystem-EXILED.nuspec | 4 ++-- build.sh | 5 +++-- 5 files changed, 41 insertions(+), 20 deletions(-) diff --git a/EventHandler.cs b/EventHandler.cs index 20045f4..78e51a7 100644 --- a/EventHandler.cs +++ b/EventHandler.cs @@ -111,11 +111,16 @@ public static void OnReceivingInput(ReferenceHub hub, ServerSpecificSettingBase Menu.LoadForPlayer(hub, menu.TryGetSubMenu(ss.SettingId)); else { - ServerSpecificSettingBase s = menu.Settings.FirstOrDefault(s => s.SettingId == ss.SettingId); - if (menu.SettingsSync[hub].Any(x => x.SettingId == ss.SettingId)) - menu.SettingsSync[hub][menu.SettingsSync[hub].FindIndex(x => x.SettingId == ss.SettingId)] = ss; + Log.Debug($"non mais aze => {ss}"); + + if (menu.InternalSettingsSync[hub].Any(x => x.SettingId == ss.SettingId)) + menu.InternalSettingsSync[hub][menu.InternalSettingsSync[hub].FindIndex(x => x.SettingId == ss.SettingId)] = ss; else - menu.SettingsSync[hub].Add(ss); + menu.InternalSettingsSync[hub].Add(ss); + ServerSpecificSettingBase s = + !menu.SentSettings.TryGetValue(hub, out ServerSpecificSettingBase[] customSettings) + ? menu.Settings.FirstOrDefault(b => b.SettingId == ss.SettingId) + : customSettings.FirstOrDefault(b => b.SettingId == ss.SettingId); switch (s) { case Button wBtn: diff --git a/Features/Menu.cs b/Features/Menu.cs index ee7b7ff..c6cebd4 100644 --- a/Features/Menu.cs +++ b/Features/Menu.cs @@ -259,7 +259,13 @@ internal static void UnregisterAll() /// public abstract ServerSpecificSettingBase[] Settings { get; } - /// + /// + /// Gets all settings sent to the refHub. (only in the case of one GetSettings is not null or empty) + /// + /// + internal readonly Dictionary SentSettings = new(); + + /// /// Gets the Hash of menu, based on . Mainly used to seperate menu settings for client. /// public int Hash => Mathf.Abs(Name.GetHashCode() % 100000); @@ -346,16 +352,17 @@ private List GetSettings(ReferenceHub hub) return settings; } - if (Settings == null || Settings.IsEmpty()) + ServerSpecificSettingBase[] oSettings = GetSettingsFor(hub); + + if ((Settings == null || Settings.IsEmpty()) && (oSettings == null || oSettings.IsEmpty())) { settings.RemoveAt(settings.Count - 1); return settings; } - ServerSpecificSettingBase[] oSettings = GetSettingsFor(hub); - if (oSettings != null && !oSettings.IsEmpty()) + if (Settings != null) { - foreach (ServerSpecificSettingBase t in oSettings) + foreach (ServerSpecificSettingBase t in Settings) { if (t is ISetting setting) settings.Add(setting.Base); @@ -364,13 +371,21 @@ private List GetSettings(ReferenceHub hub) } } - foreach (ServerSpecificSettingBase t in Settings) + if (oSettings != null && !oSettings.IsEmpty()) { - if (t is ISetting setting) - settings.Add(setting.Base); - else - settings.Add(t); + foreach (ServerSpecificSettingBase t in oSettings) + { + if (t is ISetting setting) + settings.Add(setting.Base); + else + settings.Add(t); + } + + SentSettings[hub] = settings.ToArray(); } + else + SentSettings.Remove(hub); + return settings; } diff --git a/Features/Parameters.cs b/Features/Parameters.cs index 14573e5..543e6b1 100644 --- a/Features/Parameters.cs +++ b/Features/Parameters.cs @@ -26,7 +26,7 @@ public static TSs GetParameter(this ReferenceHub hub, int settingId) if (typeof(TSs).BaseType == typeof(ISetting)) { Log.Error(nameof(TSs) + " need to be of base type (example: Plaintext became SSPlaintextSetting)."); - return default; + return null; } foreach (Menu menu in Menu.Menus.Where(x => x is TMenu)) @@ -38,7 +38,7 @@ public static TSs GetParameter(this ReferenceHub hub, int settingId) return t as TSs; } - return default; + return null; } diff --git a/SSMenuSystem-EXILED.nuspec b/SSMenuSystem-EXILED.nuspec index 188faec..2444a25 100644 --- a/SSMenuSystem-EXILED.nuspec +++ b/SSMenuSystem-EXILED.nuspec @@ -15,7 +15,7 @@ - + @@ -35,4 +35,4 @@ - \ No newline at end of file + diff --git a/build.sh b/build.sh index 371b048..9052193 100755 --- a/build.sh +++ b/build.sh @@ -143,7 +143,8 @@ if [ -n "$draft" ] && [ -z "$debug" ]; then fi #LATEST_VERSION=$(gh release view --json tagName -q ".tagName" --repo skyfr0676/SSMenuSystem) if [ ! "$LATEST_VERSION" == "v$VERSION" ]; then - gh release create v2.0.4 --draft --title "v$VERSION" --notes """## What's changed + gh release create "v$VERSION" --draft --title "v$VERSION" --notes """## What's changed + **Full Changelog**: https://github.com/skyfr0676/SSMenuSystem/compare/$LATEST_VERSION...V$VERSION""" --repo skyfr0676/SSMenuSystem ./pack/SSMenuSystem-EXILED.dll ./pack/SSMenuSystem-LABAPI.dll ./pack/0Harmony.dll echo -e "\e[36m[INFO]: successfully created a release\e[0m" else @@ -159,7 +160,7 @@ if [ -n "$push_nuget" ] && [ -z "$debug" ]; then # push new version into the nug echo -e "[VERBOSE]: API Key found: $push_nuget" fi nuget push "./pack/SSMenuSystem.$VERSION-EXILED.nupkg" -Source https://api.nuget.org/v3/index.json -ApiKey "$push_nuget" - nuget push "./pack/SSMenuSystem.$VERSION-LABAPI.nupkg" -Source https://api.nuget.org/v3/index.json -ApiKey "$push_nuget" + nuget push "./pack/SSMenuSystem.$VERSION-LABAPI-Beta.nupkg" -Source https://api.nuget.org/v3/index.json -ApiKey "$push_nuget" fi fi From 04f841e36b4805cd29474a517588ec086e937bbf Mon Sep 17 00:00:00 2001 From: skyfr0676 Date: Tue, 29 Apr 2025 18:50:34 +0200 Subject: [PATCH 3/7] clean code --- EventHandler.cs | 6 ++--- Features/Log.cs | 4 +-- Features/Menu.cs | 20 +++++++------- Patchs/CompatibilizerPatchs/Compatibilizer.cs | 2 +- Plugin.cs | 26 +++++-------------- 5 files changed, 21 insertions(+), 37 deletions(-) diff --git a/EventHandler.cs b/EventHandler.cs index 78e51a7..f842d00 100644 --- a/EventHandler.cs +++ b/EventHandler.cs @@ -111,8 +111,6 @@ public static void OnReceivingInput(ReferenceHub hub, ServerSpecificSettingBase Menu.LoadForPlayer(hub, menu.TryGetSubMenu(ss.SettingId)); else { - Log.Debug($"non mais aze => {ss}"); - if (menu.InternalSettingsSync[hub].Any(x => x.SettingId == ss.SettingId)) menu.InternalSettingsSync[hub][menu.InternalSettingsSync[hub].FindIndex(x => x.SettingId == ss.SettingId)] = ss; else @@ -162,11 +160,11 @@ public static void OnReceivingInput(ReferenceHub hub, ServerSpecificSettingBase #else Log.Debug(e.ToString()); #endif - if (Plugin.StaticConfig.ShowErrorToClient) + if (Plugin.Instance.Config.ShowErrorToClient) { Features.Utils.SendToPlayer(hub, null, new ServerSpecificSettingBase[] { - new SSTextArea(-5, $"{Plugin.GetTranslation().ServerError}\n{((hub.serverRoles.RemoteAdmin || Plugin.StaticConfig.ShowFullErrorToClient) && Plugin.StaticConfig.ShowFullErrorToModerators ? e.ToString() : Plugin.GetTranslation().NoPermission)}", SSTextArea.FoldoutMode.CollapsedByDefault, Plugin.GetTranslation().ServerError), + new SSTextArea(-5, $"{Plugin.GetTranslation().ServerError}\n{((hub.serverRoles.RemoteAdmin || Plugin.Instance.Config.ShowFullErrorToClient) && Plugin.Instance.Config.ShowFullErrorToModerators ? e.ToString() : Plugin.GetTranslation().NoPermission)}", SSTextArea.FoldoutMode.CollapsedByDefault, Plugin.GetTranslation().ServerError), new SSButton(-999, Plugin.GetTranslation().ReloadButton.Label, Plugin.GetTranslation().ReloadButton.ButtonText) }); } diff --git a/Features/Log.cs b/Features/Log.cs index 6de9f1b..4cbf9c6 100644 --- a/Features/Log.cs +++ b/Features/Log.cs @@ -30,7 +30,7 @@ internal static void Info(string message) /// The message to be sent. internal static void Debug(object message) { - if (Plugin.StaticConfig?.Debug ?? false) + if (Plugin.Instance.Config?.Debug ?? false) Send($"[SSMenuSystem] {message}", LogLevel.Debug, ConsoleColor.Green); } @@ -41,7 +41,7 @@ internal static void Debug(object message) /// The message to be sent. internal static void Debug(string message) { - if (Plugin.StaticConfig?.Debug ?? false) + if (Plugin.Instance.Config?.Debug ?? false) Send($"[SSMenuSystem] {message}", LogLevel.Debug, ConsoleColor.Green); } diff --git a/Features/Menu.cs b/Features/Menu.cs index c6cebd4..fb3548c 100644 --- a/Features/Menu.cs +++ b/Features/Menu.cs @@ -73,7 +73,7 @@ internal static void RegisterQueuedAssemblies() /// public static void QueueOrRegister() { - if (Plugin.StaticConfig is null) + if (Plugin.Instance.Config is null) { Assembly assembly = Assembly.GetCallingAssembly(); if (!_waitingAssemblies.Contains(assembly)) @@ -94,7 +94,7 @@ public static void QueueOrRegister() /// The target . private static void Register(Assembly assembly) { - if (Plugin.StaticConfig is null) // plugin is not loaded. + if (Plugin.Instance.Config is null) // plugin is not loaded. { if (!_waitingAssemblies.Contains(assembly)) _waitingAssemblies.Enqueue(assembly); @@ -109,7 +109,7 @@ private static void Register(Assembly assembly) if (type == typeof(AssemblyMenu)) // only used for comptability (throw error when loaded) continue; - if (type == typeof(MainExample) && (!Plugin.StaticConfig.EnableExamples)) + if (type == typeof(MainExample) && (!Plugin.Instance.Config.EnableExamples)) continue; if (type.IsAbstract || type.IsInterface) @@ -165,7 +165,7 @@ public static void Register(Menu menu) { if (menu == null) return; - if (menu.MenuRelated == typeof(MainExample) && !Plugin.StaticConfig.EnableExamples) + if (menu.MenuRelated == typeof(MainExample) && !Plugin.Instance.Config.EnableExamples) return; Log.Debug($"loading Server Specific menu {menu.Name}..."); @@ -294,7 +294,7 @@ private static ServerSpecificSettingBase[] GetMainMenu(ReferenceHub hub) { List mainMenu = new(); - if (Plugin.StaticConfig.AllowPinnedContent) + if (Plugin.Instance.Config.AllowPinnedContent) mainMenu.AddRange(Pinned.Values.SelectMany(pin => pin)); if (LoadedMenus.Where(x => x.CheckAccess(hub)).IsEmpty()) @@ -316,10 +316,10 @@ private List GetSettings(ReferenceHub hub) { List settings = new(); - if (Plugin.StaticConfig.AllowPinnedContent) + if (Plugin.Instance.Config.AllowPinnedContent) settings.AddRange(Pinned.Values.SelectMany(pin => pin)); - if (LoadedMenus.First(x => x.CheckAccess(hub) && x.MenuRelated == null) != this || Plugin.StaticConfig.ForceMainMenuEvenIfOnlyOne) + if (LoadedMenus.First(x => x.CheckAccess(hub) && x.MenuRelated == null) != this || Plugin.Instance.Config.ForceMainMenuEvenIfOnlyOne) { if (MenuRelated != null) settings.Add(new SSButton(0, string.Format(Plugin.GetTranslation().ReturnTo.Label, Menu.GetMenu(MenuRelated)?.Name ?? "Unknown"), @@ -329,7 +329,7 @@ private List GetSettings(ReferenceHub hub) Plugin.GetTranslation().ReturnToMenu.ButtonText)); } - if (LoadedMenus.First(x => x.CheckAccess(hub) && x.MenuRelated == null) == this && !Plugin.StaticConfig.ForceMainMenuEvenIfOnlyOne) + if (LoadedMenus.First(x => x.CheckAccess(hub) && x.MenuRelated == null) == this && !Plugin.Instance.Config.ForceMainMenuEvenIfOnlyOne) settings.Add(new SSGroupHeader(Name)); else { @@ -340,7 +340,7 @@ private List GetSettings(ReferenceHub hub) foreach (Menu s in LoadedMenus.Where(x => x.MenuRelated == GetType() && x != this)) settings.Add(new SSButton(s.Id, string.Format(Plugin.GetTranslation().OpenMenu.Label, s.Name), Plugin.GetTranslation().OpenMenu.ButtonText, null, string.IsNullOrEmpty(Description) ? null : Description)); - if (LoadedMenus.First(x => x.CheckAccess(hub) && x.MenuRelated == null) != this || Plugin.StaticConfig.ForceMainMenuEvenIfOnlyOne) + if (LoadedMenus.First(x => x.CheckAccess(hub) && x.MenuRelated == null) != this || Plugin.Instance.Config.ForceMainMenuEvenIfOnlyOne) settings.Add(new SSGroupHeader(Name, false, Description)); if (this is AssemblyMenu assemblyMenu && @@ -450,7 +450,7 @@ internal static void LoadForPlayer(ReferenceHub hub, Menu menu) if (menu != null && !menu.CheckAccess(hub)) menu = null; - if (menu == null && LoadedMenus.Count(x => x.CheckAccess(hub) && x.MenuRelated == null) == 1 && !Plugin.StaticConfig.ForceMainMenuEvenIfOnlyOne) + if (menu == null && LoadedMenus.Count(x => x.CheckAccess(hub) && x.MenuRelated == null) == 1 && !Plugin.Instance.Config.ForceMainMenuEvenIfOnlyOne) { menu = Menus.First(x => x.CheckAccess(hub) && x.MenuRelated == null); Log.Debug($"triggered The only menu registered: {menu.Name}."); diff --git a/Patchs/CompatibilizerPatchs/Compatibilizer.cs b/Patchs/CompatibilizerPatchs/Compatibilizer.cs index b7f5f03..ef93b7b 100644 --- a/Patchs/CompatibilizerPatchs/Compatibilizer.cs +++ b/Patchs/CompatibilizerPatchs/Compatibilizer.cs @@ -38,7 +38,7 @@ private static IEnumerable Transpiler(IEnumerable // ReSharper disable once ClassNeverInstantiated.Global - public class Plugin -#if EXILED || LABAPI - : Plugin -#endif { /// /// Gets the author of the plugin. @@ -54,7 +47,7 @@ public class Plugin /// Gets the prefix used for configs. /// public override string Prefix => "ss_menu_system"; -#elif LABAPI +#else /// public override string Description => "Convert all Server-Specifics Settings created by plugins into menu. Help for multi-plugin comptability and organization."; @@ -63,13 +56,6 @@ public class Plugin public override Version RequiredApiVersion => new(1, 0, 0); #endif - private static Config _staticConfig; - - /// - /// Gets the instance. Can be null if the plugin is not enabled. - /// - public static Config StaticConfig => _staticConfig ??= Instance?.Config; - /// /// Gets the instance. can be null if the plugin is not enabled. /// @@ -107,7 +93,7 @@ public override void OnDisabled() base.OnDisabled(); } -#elif LABAPI +#else /// public override void Enable() @@ -143,7 +129,7 @@ private void GenericEnable() #if DEBUG Log.Warn("EXPERIMENTAL VERSION IS ACTIVATED. BE AWARD OF BUGS CAN BE DONE. NOT STABLE VERSION."); Menu.RegisterPin(new[]{new SSTextArea(null, "this pinned content is related to the called assembly\nwith Menu.UnregisterPin() you just unregister ONLY pinned settings by the called assembly.", SSTextArea.FoldoutMode.CollapsedByDefault, "This is a pinned content.")}); - StaticConfig.Debug = true; + Instance.Config!.Debug = true; #endif ServerSpecificSettingsSync.ServerOnSettingValueReceived += EventHandler.OnReceivingInput; @@ -158,7 +144,7 @@ public static Translation GetTranslation() #if EXILED return Instance?.Translation; #else - return StaticConfig?.Translation; + return Instance.Config?.Translation; #endif } } From 3f6b859df23db782034587761c196bf32247b3e4 Mon Sep 17 00:00:00 2001 From: skyfr0676 Date: Tue, 29 Apr 2025 18:52:00 +0200 Subject: [PATCH 4/7] oupsi --- SSMenuSystem-EXILED.nuspec | 2 +- SSMenuSystem-LABAPI.nuspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SSMenuSystem-EXILED.nuspec b/SSMenuSystem-EXILED.nuspec index 2444a25..4f69022 100644 --- a/SSMenuSystem-EXILED.nuspec +++ b/SSMenuSystem-EXILED.nuspec @@ -25,7 +25,7 @@ - + diff --git a/SSMenuSystem-LABAPI.nuspec b/SSMenuSystem-LABAPI.nuspec index 98ddba2..d81c195 100644 --- a/SSMenuSystem-LABAPI.nuspec +++ b/SSMenuSystem-LABAPI.nuspec @@ -23,7 +23,7 @@ - + From ca658be4126c8c816eb38edd06a31be3723fadca Mon Sep 17 00:00:00 2001 From: skyfr0676 Date: Tue, 29 Apr 2025 19:33:35 +0200 Subject: [PATCH 5/7] [AUTOMATIC] push version to 2.0.6 --- Plugin.cs | 2 +- Properties/AssemblyInfo.cs | 2 +- SSMenuSystem-EXILED.nuspec | 14 +++++++------- SSMenuSystem-LABAPI.nuspec | 14 +++++++------- build.sh | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Plugin.cs b/Plugin.cs index 8379794..c788a1b 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -37,7 +37,7 @@ public class Plugin : Plugin /// Gets the version of the plugin. /// - public override Version Version => new(2, 0, 5); + public override Version Version => new(2, 0, 6); #if EXILED /// diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index d583795..130a590 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.5")] +[assembly: AssemblyVersion("2.0.6")] [assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/SSMenuSystem-EXILED.nuspec b/SSMenuSystem-EXILED.nuspec index 4f69022..c89a61f 100644 --- a/SSMenuSystem-EXILED.nuspec +++ b/SSMenuSystem-EXILED.nuspec @@ -3,7 +3,7 @@ SSMenuSystem SS Menu System - 2.0.5-EXILED + 2.0.6-EXILED Sky Sky Copyright © Sky 2025 @@ -23,14 +23,14 @@ - - - + + + - - - + + + diff --git a/SSMenuSystem-LABAPI.nuspec b/SSMenuSystem-LABAPI.nuspec index d81c195..26baf86 100644 --- a/SSMenuSystem-LABAPI.nuspec +++ b/SSMenuSystem-LABAPI.nuspec @@ -3,7 +3,7 @@ SSMenuSystem SS Menu System - 2.0.5-LABAPI-Beta + 2.0.6-LABAPI-Beta Sky Sky Copyright © Sky 2025 @@ -21,14 +21,14 @@ - - - + + + - - - + + + diff --git a/build.sh b/build.sh index 9052193..e1d88bd 100755 --- a/build.sh +++ b/build.sh @@ -38,9 +38,9 @@ fi if [ -n "$version" ] && [ -z "$debug" ]; then VERSION="$version" - sed -i "47s/.*/ public override Version Version => new($(echo "$VERSION" | sed 's/\./, /g'));/" Plugin.cs + sed -i "40s/.*/ public override Version Version => new($(echo "$VERSION" | sed 's/\./, /g'));/" Plugin.cs if [ $verbosity == "all" ]; then - echo "[VERBOSE/ALL]: changed Plugin.cs line 37 for version $VERSION (EXILED)" + echo "[VERBOSE/ALL]: changed Plugin.cs line 40 for version $VERSION." fi sed -i "6s/.*/ $VERSION-EXILED<\/version>/" SSMenuSystem-EXILED.nuspec @@ -137,7 +137,7 @@ if [ -n "$draft" ] && [ -z "$debug" ]; then if [ -z "$VERSION" ]; then echo -e "\e[31m[ERROR]: Version is not defined. You need to add \"--version\" \nExemple: ./build.sh draft --version 3.0.0 \e[0m" else - LATEST_VERSION=$(gh release list --repo skyfr0676/SSMenuSystem --json tagName,isDraft -q 'sort_by(.createdAt)[0].tagName') + LATEST_VERSION=$(gh api repos/skyfr0676/SSMenuSystem/releases --jq '[.[] | select(.draft == false)][0].tag_name') if [ -n "$VERBOSE" ]; then echo -e "[VERBOSE]: Latest version found: $LATEST_VERSION" fi @@ -145,7 +145,7 @@ if [ -n "$draft" ] && [ -z "$debug" ]; then if [ ! "$LATEST_VERSION" == "v$VERSION" ]; then gh release create "v$VERSION" --draft --title "v$VERSION" --notes """## What's changed -**Full Changelog**: https://github.com/skyfr0676/SSMenuSystem/compare/$LATEST_VERSION...V$VERSION""" --repo skyfr0676/SSMenuSystem ./pack/SSMenuSystem-EXILED.dll ./pack/SSMenuSystem-LABAPI.dll ./pack/0Harmony.dll +**Full Changelog**: https://github.com/skyfr0676/SSMenuSystem/compare/$LATEST_VERSION...v$VERSION""" --repo skyfr0676/SSMenuSystem ./pack/SSMenuSystem-EXILED.dll ./pack/SSMenuSystem-LABAPI.dll ./pack/0Harmony.dll echo -e "\e[36m[INFO]: successfully created a release\e[0m" else echo -e "\e[33m[WARNING]: A release with this version already exist. \e[0m" From 620cfcd02b5796aae0cef7c028e20ee3c8fa688f Mon Sep 17 00:00:00 2001 From: skyfr0676 Date: Tue, 29 Apr 2025 19:43:36 +0200 Subject: [PATCH 6/7] [AUTOMATIC] push version to 2.0.6 --- SSMenuSystem-EXILED.nuspec | 12 ++++++------ SSMenuSystem-LABAPI.nuspec | 12 ++++++------ SSMenuSystem.csproj | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/SSMenuSystem-EXILED.nuspec b/SSMenuSystem-EXILED.nuspec index c89a61f..ca7b86f 100644 --- a/SSMenuSystem-EXILED.nuspec +++ b/SSMenuSystem-EXILED.nuspec @@ -23,14 +23,14 @@ - - - + + + - - - + + + diff --git a/SSMenuSystem-LABAPI.nuspec b/SSMenuSystem-LABAPI.nuspec index 26baf86..3a17c17 100644 --- a/SSMenuSystem-LABAPI.nuspec +++ b/SSMenuSystem-LABAPI.nuspec @@ -21,14 +21,14 @@ - - - + + + - - - + + + diff --git a/SSMenuSystem.csproj b/SSMenuSystem.csproj index 085d100..9e82033 100644 --- a/SSMenuSystem.csproj +++ b/SSMenuSystem.csproj @@ -139,7 +139,7 @@ - +