mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Try stopping duplicate system cards
This commit is contained in:
parent
abfb3246d6
commit
dc3f10ba33
@ -34,10 +34,13 @@ namespace NewHorizons.Components.ShipLog
|
||||
|
||||
private int _nextCardIndex;
|
||||
|
||||
private HashSet<string> _systemCards = new();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
// Prompts
|
||||
Locator.GetPromptManager().AddScreenPrompt(_warpPrompt, PromptPosition.UpperLeft, false);
|
||||
_systemCards.Clear();
|
||||
}
|
||||
|
||||
public override void Initialize(ScreenPromptList centerPromptList, ScreenPromptList upperRightPromptList, OWAudioSource oneShotSource)
|
||||
@ -70,8 +73,15 @@ namespace NewHorizons.Components.ShipLog
|
||||
|
||||
public void AddSystemCard(string uniqueID)
|
||||
{
|
||||
var card = CreateCard(uniqueID, root.transform, new Vector2(_nextCardIndex++ * 200, 0));
|
||||
_starSystemCards.Add(card);
|
||||
if (!_systemCards.Contains(uniqueID))
|
||||
{
|
||||
var card = CreateCard(uniqueID, root.transform, new Vector2(_nextCardIndex++ * 200, 0));
|
||||
_starSystemCards.Add(card);
|
||||
}
|
||||
else
|
||||
{
|
||||
NHLogger.LogWarning($"Tried making duplicate system card {uniqueID}");
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDestroy()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user