From 70245c83e2d6e7121d5ac66e0df916ed3a91824c Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Sat, 27 Apr 2024 23:17:54 -0500 Subject: [PATCH] Add a mod menu entry for toggling if offline items show on connection --- Archipelago.HollowKnight/Archipelago.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Archipelago.HollowKnight/Archipelago.cs b/Archipelago.HollowKnight/Archipelago.cs index 015d9af..6d61446 100644 --- a/Archipelago.HollowKnight/Archipelago.cs +++ b/Archipelago.HollowKnight/Archipelago.cs @@ -18,7 +18,7 @@ namespace Archipelago.HollowKnight { - public class Archipelago : Mod, IGlobalSettings, ILocalSettings + public class Archipelago : Mod, IGlobalSettings, ILocalSettings, IMenuMod { // Events support public static event Action OnArchipelagoGameStarted; @@ -301,5 +301,19 @@ public ConnectionDetails OnSaveGlobal() AlwaysShowItems = MenuSettings.AlwaysShowItems, }; } + + public bool ToggleButtonInsideMenu => false; + public List GetMenuData(IMenuMod.MenuEntry? toggleButtonEntry) + { + return [ + new IMenuMod.MenuEntry { + Name = "Show offline items", + Description = "Show items received while you were disconnected.", + Values = ["No", "Yes"], + Saver = opt => { MenuSettings.AlwaysShowItems = opt == 1; }, + Loader = () => MenuSettings.AlwaysShowItems ? 1 : 0, + }, + ]; + } } }