Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
JohnCorby 2023-07-26 16:56:46 -07:00
commit 7223935679

View File

@ -23,6 +23,7 @@ internal class MultiplayerHUDManager : MonoBehaviour, IAddComponentOnStart
private Transform _textChat;
private InputField _inputField;
private Material _markerMaterial;
private bool _ready;
public static Sprite UnknownSprite;
public static Sprite DeadSprite;
@ -64,6 +65,11 @@ internal class MultiplayerHUDManager : MonoBehaviour, IAddComponentOnStart
Interloper = QSBCore.HUDAssetBundle.LoadAsset<Sprite>("Assets/MULTIPLAYER_UI/playerbox_interloper.png");
WhiteHole = QSBCore.HUDAssetBundle.LoadAsset<Sprite>("Assets/MULTIPLAYER_UI/playerbox_whitehole.png");
SpaceSprite = QSBCore.HUDAssetBundle.LoadAsset<Sprite>("Assets/MULTIPLAYER_UI/playerbox_space.png");
QSBSceneManager.OnPostSceneLoad += (OWScene old, OWScene newScene) =>
{
_ready = false;
};
}
private const int LINE_COUNT = 11;
@ -79,6 +85,12 @@ internal class MultiplayerHUDManager : MonoBehaviour, IAddComponentOnStart
public void WriteMessage(string message, Color color)
{
// dont write messages when not ready
if (!_ready)
{
return;
}
/* Tricky problem to solve.
* - 11 available lines for text to fit onto
* - Each line can be max 41 characters
@ -307,6 +319,8 @@ internal class MultiplayerHUDManager : MonoBehaviour, IAddComponentOnStart
_lines.Clear();
_messages.Clear();
_textChat.GetComponent<CanvasGroup>().alpha = 0;
_ready = true;
}
public void UpdateMinimapMarkers(Minimap minimap)