mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 09:32:38 +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 _refillIndex;
|
||||||
private int _respawnIndex;
|
private int _respawnIndex;
|
||||||
private bool _wearingSuit;
|
private bool _wearingSuit;
|
||||||
|
private UITextType _respawnPlayerText;
|
||||||
private static UITextType _respawnPlayerText;
|
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
if (_respawnPlayerText == UITextType.None)
|
_respawnPlayerText = UIHelper.AddToUITable(QSBLocalization.Current.RespawnPlayer);
|
||||||
{
|
|
||||||
_respawnPlayerText = UIHelper.AddToUITable(QSBLocalization.Current.RespawnPlayer);
|
|
||||||
}
|
|
||||||
|
|
||||||
_interactVolume = this.GetRequiredComponent<MultipleInteractionVolume>();
|
_interactVolume = this.GetRequiredComponent<MultipleInteractionVolume>();
|
||||||
_interactVolume.OnPressInteract += OnPressInteract;
|
_interactVolume.OnPressInteract += OnPressInteract;
|
||||||
@ -48,7 +44,6 @@ internal class ShipRecoveryPoint : MonoBehaviour
|
|||||||
_interactVolume.OnGainFocus -= OnGainFocus;
|
_interactVolume.OnGainFocus -= OnGainFocus;
|
||||||
GlobalMessenger.RemoveListener(OWEvents.SuitUp, OnSuitUp);
|
GlobalMessenger.RemoveListener(OWEvents.SuitUp, OnSuitUp);
|
||||||
GlobalMessenger.RemoveListener(OWEvents.RemoveSuit, OnRemoveSuit);
|
GlobalMessenger.RemoveListener(OWEvents.RemoveSuit, OnRemoveSuit);
|
||||||
_respawnPlayerText = UITextType.None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSuitUp()
|
private void OnSuitUp()
|
||||||
|
@ -15,6 +15,12 @@ internal static class UIHelper
|
|||||||
|
|
||||||
public static UITextType AddToUITable(string text)
|
public static UITextType AddToUITable(string text)
|
||||||
{
|
{
|
||||||
|
var hasValue = UITableHasValue(text);
|
||||||
|
if (hasValue != UITextType.None)
|
||||||
|
{
|
||||||
|
return hasValue;
|
||||||
|
}
|
||||||
|
|
||||||
var table = TextTranslation.Get().m_table;
|
var table = TextTranslation.Get().m_table;
|
||||||
var key = table.theUITable.Keys.Max() + 1;
|
var key = table.theUITable.Keys.Max() + 1;
|
||||||
table.theUITable[key] = text;
|
table.theUITable[key] = text;
|
||||||
@ -22,6 +28,12 @@ internal static class UIHelper
|
|||||||
return (UITextType)key;
|
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()
|
public static CultureInfo GetCurrentCultureInfo()
|
||||||
=> QSBLocalization.Current.Language switch
|
=> QSBLocalization.Current.Language switch
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user