mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +00:00
guh (fix the uihelper stuff)
This commit is contained in:
parent
fb2f7b51a1
commit
9cb92f2812
@ -15,15 +15,11 @@ internal class ShipRecoveryPoint : MonoBehaviour
|
||||
private int _refillIndex;
|
||||
private int _respawnIndex;
|
||||
private bool _wearingSuit;
|
||||
|
||||
private static UITextType _respawnPlayerText;
|
||||
private UITextType _respawnPlayerText;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (_respawnPlayerText == UITextType.None)
|
||||
{
|
||||
_respawnPlayerText = UIHelper.AddToUITable(QSBLocalization.Current.RespawnPlayer);
|
||||
}
|
||||
_respawnPlayerText = UIHelper.AddToUITable(QSBLocalization.Current.RespawnPlayer);
|
||||
|
||||
_interactVolume = this.GetRequiredComponent<MultipleInteractionVolume>();
|
||||
_interactVolume.OnPressInteract += OnPressInteract;
|
||||
@ -48,7 +44,6 @@ internal class ShipRecoveryPoint : MonoBehaviour
|
||||
_interactVolume.OnGainFocus -= OnGainFocus;
|
||||
GlobalMessenger.RemoveListener(OWEvents.SuitUp, OnSuitUp);
|
||||
GlobalMessenger.RemoveListener(OWEvents.RemoveSuit, OnRemoveSuit);
|
||||
_respawnPlayerText = UITextType.None;
|
||||
}
|
||||
|
||||
private void OnSuitUp()
|
||||
|
@ -15,6 +15,12 @@ internal static class UIHelper
|
||||
|
||||
public static UITextType AddToUITable(string text)
|
||||
{
|
||||
var hasValue = UITableHasValue(text);
|
||||
if (hasValue != UITextType.None)
|
||||
{
|
||||
return hasValue;
|
||||
}
|
||||
|
||||
var table = TextTranslation.Get().m_table;
|
||||
var key = table.theUITable.Keys.Max() + 1;
|
||||
table.theUITable[key] = text;
|
||||
@ -22,6 +28,12 @@ internal static class UIHelper
|
||||
return (UITextType)key;
|
||||
}
|
||||
|
||||
public static UITextType UITableHasValue(string text)
|
||||
{
|
||||
var table = TextTranslation.Get().m_table;
|
||||
return (UITextType)table.theUITable.FirstOrDefault(x => x.Value == text).Key;
|
||||
}
|
||||
|
||||
public static CultureInfo GetCurrentCultureInfo()
|
||||
=> QSBLocalization.Current.Language switch
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user