mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-20 15:41:01 +00:00
improve UIHelper a bit
This commit is contained in:
parent
806438b324
commit
ea3bc72701
@ -69,12 +69,9 @@ namespace QSB
|
||||
|
||||
private static DebugSettings DebugSettings { get; set; } = new();
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
var instance = TextTranslation.Get().m_table;
|
||||
instance.theUITable[(int)UITextType.PleaseUseController] =
|
||||
"<color=orange>Quantum Space Buddies</color> is best experienced with friends...";
|
||||
}
|
||||
public void Awake() =>
|
||||
UIHelper.ReplaceUI(UITextType.PleaseUseController,
|
||||
"<color=orange>Quantum Space Buddies</color> is best experienced with friends...");
|
||||
|
||||
public void Start()
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ namespace QSB.RespawnSync
|
||||
var respawnPlayerText = UIHelper.AddToUITable("Respawn Player");
|
||||
|
||||
_refillIndex = _interactVolume.AddInteraction(InputLibrary.interact, InputMode.Character, UITextType.None, true, true);
|
||||
_respawnIndex = _interactVolume.AddInteraction(InputLibrary.interactSecondary, InputMode.Character, (UITextType)respawnPlayerText, true, true);
|
||||
_respawnIndex = _interactVolume.AddInteraction(InputLibrary.interactSecondary, InputMode.Character, respawnPlayerText, true, true);
|
||||
|
||||
GlobalMessenger.AddListener("SuitUp", new Callback(OnSuitUp));
|
||||
GlobalMessenger.AddListener("RemoveSuit", new Callback(OnRemoveSuit));
|
||||
|
@ -4,11 +4,18 @@ namespace QSB.Utility
|
||||
{
|
||||
internal static class UIHelper
|
||||
{
|
||||
public static int AddToUITable(string text)
|
||||
public static void ReplaceUI(UITextType key, string text)
|
||||
{
|
||||
var instance = UnityEngine.Object.FindObjectOfType<TextTranslation>().m_table;
|
||||
instance.Insert_UI(instance.theUITable.Keys.Max() + 1, text);
|
||||
return instance.theUITable.Keys.Max();
|
||||
var table = TextTranslation.Get().m_table;
|
||||
table.theUITable[(int)key] = text;
|
||||
}
|
||||
|
||||
public static UITextType AddToUITable(string text)
|
||||
{
|
||||
var table = TextTranslation.Get().m_table;
|
||||
var key = table.theUITable.Keys.Max() + 1;
|
||||
table.theUITable[key] = text;
|
||||
return (UITextType)key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user