diff options
Diffstat (limited to 'AnodyneArchipelago')
-rw-r--r-- | AnodyneArchipelago/ArchipelagoManager.cs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/AnodyneArchipelago/ArchipelagoManager.cs b/AnodyneArchipelago/ArchipelagoManager.cs index 9a3ac59..34ca75a 100644 --- a/AnodyneArchipelago/ArchipelagoManager.cs +++ b/AnodyneArchipelago/ArchipelagoManager.cs | |||
@@ -22,6 +22,7 @@ namespace AnodyneArchipelago | |||
22 | private string _seedName; | 22 | private string _seedName; |
23 | 23 | ||
24 | private readonly Queue<NetworkItem> _itemsToCollect = new(); | 24 | private readonly Queue<NetworkItem> _itemsToCollect = new(); |
25 | private readonly Queue<string> _messages = new(); | ||
25 | 26 | ||
26 | public async Task<LoginResult> Connect(string url, string slotName, string password) | 27 | public async Task<LoginResult> Connect(string url, string slotName, string password) |
27 | { | 28 | { |
@@ -111,15 +112,21 @@ namespace AnodyneArchipelago | |||
111 | _itemIndex = _session.Items.AllItemsReceived.Count; | 112 | _itemIndex = _session.Items.AllItemsReceived.Count; |
112 | } | 113 | } |
113 | 114 | ||
114 | if (_itemsToCollect.Count > 0 && | 115 | if ((GlobalState.Dialogue == null || GlobalState.Dialogue == "") && |
115 | (GlobalState.Dialogue == null || GlobalState.Dialogue == "") && | ||
116 | !GlobalState.ScreenTransition && | 116 | !GlobalState.ScreenTransition && |
117 | Plugin.Player != null && | 117 | Plugin.Player != null && |
118 | GlobalState.black_overlay.alpha == 0f && | 118 | GlobalState.black_overlay.alpha == 0f && |
119 | !Plugin.IsGamePaused) | 119 | !Plugin.IsGamePaused) |
120 | { | 120 | { |
121 | NetworkItem item = _itemsToCollect.Dequeue(); | 121 | if (_itemsToCollect.Count > 0) |
122 | HandleItem(item); | 122 | { |
123 | NetworkItem item = _itemsToCollect.Dequeue(); | ||
124 | HandleItem(item); | ||
125 | } | ||
126 | else if (_messages.Count > 0) | ||
127 | { | ||
128 | GlobalState.Dialogue = _messages.Dequeue(); | ||
129 | } | ||
123 | } | 130 | } |
124 | } | 131 | } |
125 | 132 | ||
@@ -272,7 +279,7 @@ namespace AnodyneArchipelago | |||
272 | messageText = $"Sent {itemName} to {otherPlayer}."; | 279 | messageText = $"Sent {itemName} to {otherPlayer}."; |
273 | 280 | ||
274 | SoundManager.PlaySoundEffect("gettreasure"); | 281 | SoundManager.PlaySoundEffect("gettreasure"); |
275 | GlobalState.Dialogue = messageText; | 282 | _messages.Enqueue(messageText); |
276 | } | 283 | } |
277 | break; | 284 | break; |
278 | } | 285 | } |