feat(hs): NPC talk plugin opens team panel when registration is open
This commit is contained in:
@@ -304,6 +304,23 @@ public class GameContext : AsyncDisposable, IGameContext
|
||||
return miniGameContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the currently open <see cref="MiniGames.HeykelSavasiContext"/> instance, if any.
|
||||
/// </summary>
|
||||
/// <returns>The open Heykel Savasi context, or <see langword="null" /> if none is currently open.</returns>
|
||||
/// <remarks>
|
||||
/// ADAMU-CUSTOM: used by <see cref="PlugIns.HeykelSavasiNpcPlugin"/> to look up the event context
|
||||
/// when a player talks to NPC 560. Mutations of <see cref="_miniGames"/> (<see cref="GetMiniGameAsync"/>,
|
||||
/// <see cref="RemoveMiniGameAsync"/>) are synchronized via <see cref="_mapInitializerLock"/>, so this
|
||||
/// read takes the same lock and snapshots the values before searching.
|
||||
/// </remarks>
|
||||
public async ValueTask<MiniGames.HeykelSavasiContext?> GetOpenHeykelSavasiAsync()
|
||||
{
|
||||
using var l = await this._mapInitializerLock.LockAsync().ConfigureAwait(false);
|
||||
return this._miniGames.Values.OfType<MiniGames.HeykelSavasiContext>()
|
||||
.FirstOrDefault(g => g.State == MiniGameState.Open);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async ValueTask RemoveMiniGameAsync(MiniGameContext miniGameContext)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user