about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--AnodyneArchipelago/ArchipelagoManager.cs9
-rw-r--r--AnodyneArchipelago/Menu/ConnectionState.cs10
-rw-r--r--AnodyneArchipelago/Menu/MenuState.cs6
-rw-r--r--AnodyneArchipelago/Patches/GameplayPatches.cs9
4 files changed, 33 insertions, 1 deletions
diff --git a/AnodyneArchipelago/ArchipelagoManager.cs b/AnodyneArchipelago/ArchipelagoManager.cs index 34ca75a..e4ccf36 100644 --- a/AnodyneArchipelago/ArchipelagoManager.cs +++ b/AnodyneArchipelago/ArchipelagoManager.cs
@@ -20,10 +20,13 @@ namespace AnodyneArchipelago
20 private ArchipelagoSession _session; 20 private ArchipelagoSession _session;
21 private int _itemIndex = 0; 21 private int _itemIndex = 0;
22 private string _seedName; 22 private string _seedName;
23 private long _endgameCardRequirement = 36;
23 24
24 private readonly Queue<NetworkItem> _itemsToCollect = new(); 25 private readonly Queue<NetworkItem> _itemsToCollect = new();
25 private readonly Queue<string> _messages = new(); 26 private readonly Queue<string> _messages = new();
26 27
28 public long EndgameCardRequirement => _endgameCardRequirement;
29
27 public async Task<LoginResult> Connect(string url, string slotName, string password) 30 public async Task<LoginResult> Connect(string url, string slotName, string password)
28 { 31 {
29 LoginResult result; 32 LoginResult result;
@@ -45,6 +48,12 @@ namespace AnodyneArchipelago
45 _itemIndex = 0; 48 _itemIndex = 0;
46 _itemsToCollect.Clear(); 49 _itemsToCollect.Clear();
47 50
51 LoginSuccessful login = result as LoginSuccessful;
52 if (login.SlotData.ContainsKey("endgame_card_requirement"))
53 {
54 _endgameCardRequirement = (long)login.SlotData["endgame_card_requirement"];
55 }
56
48 return result; 57 return result;
49 } 58 }
50 59
diff --git a/AnodyneArchipelago/Menu/ConnectionState.cs b/AnodyneArchipelago/Menu/ConnectionState.cs index 877213f..3eac618 100644 --- a/AnodyneArchipelago/Menu/ConnectionState.cs +++ b/AnodyneArchipelago/Menu/ConnectionState.cs
@@ -50,6 +50,16 @@ namespace AnodyneArchipelago.Menu
50 { 50 {
51 if (_connectionTask != null && _connectionTask.IsCompleted) 51 if (_connectionTask != null && _connectionTask.IsCompleted)
52 { 52 {
53 if (_connectionTask.IsFaulted)
54 {
55 _text = _connectionTask.Exception.ToString();
56 _connectionTask = null;
57
58 UpdateDisplay();
59
60 return;
61 }
62
53 LoginResult result = _connectionTask.Result; 63 LoginResult result = _connectionTask.Result;
54 64
55 if (result.Successful) 65 if (result.Successful)
diff --git a/AnodyneArchipelago/Menu/MenuState.cs b/AnodyneArchipelago/Menu/MenuState.cs index c7be02a..7e8020e 100644 --- a/AnodyneArchipelago/Menu/MenuState.cs +++ b/AnodyneArchipelago/Menu/MenuState.cs
@@ -135,7 +135,11 @@ namespace AnodyneArchipelago.Menu
135 { 135 {
136 if (!_hide) 136 if (!_hide)
137 { 137 {
138 _selector.Draw(); 138 if (_substate == null)
139 {
140 _selector.Draw();
141 }
142
139 _versionLabel1.Draw(); 143 _versionLabel1.Draw();
140 _versionLabel2.Draw(); 144 _versionLabel2.Draw();
141 _serverLabel.Draw(); 145 _serverLabel.Draw();
diff --git a/AnodyneArchipelago/Patches/GameplayPatches.cs b/AnodyneArchipelago/Patches/GameplayPatches.cs index ec04451..056a855 100644 --- a/AnodyneArchipelago/Patches/GameplayPatches.cs +++ b/AnodyneArchipelago/Patches/GameplayPatches.cs
@@ -148,6 +148,15 @@ namespace AnodyneArchipelago.Patches
148 [HarmonyPatch(typeof(EntityPreset), nameof(EntityPreset.Create))] 148 [HarmonyPatch(typeof(EntityPreset), nameof(EntityPreset.Create))]
149 class EntityPresetCreatePatch 149 class EntityPresetCreatePatch
150 { 150 {
151 static void Prefix(EntityPreset __instance)
152 {
153 if (__instance.EntityID == new Guid("C8CE6E18-CF07-180B-A550-9DC808A2F7E3"))
154 {
155 PropertyInfo frameProperty = typeof(EntityPreset).GetProperty("Frame");
156 frameProperty.SetValue(__instance, (int)Plugin.ArchipelagoManager.EndgameCardRequirement);
157 }
158 }
159
151 static void Postfix(EntityPreset __instance, Entity __result) 160 static void Postfix(EntityPreset __instance, Entity __result)
152 { 161 {
153 if (__instance.Type.FullName == "AnodyneSharp.Entities.Interactive.DungeonStatue") 162 if (__instance.Type.FullName == "AnodyneSharp.Entities.Interactive.DungeonStatue")