mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-29 03:28:26 +00:00
make annoucements call different method
This commit is contained in:
parent
05be99e122
commit
34e5590490
@ -42,7 +42,7 @@ public class PlayerDeathMessage : QSBMessage<DeathType>
|
||||
var deathMessage = Necronomicon.GetPhrase(Data, NecronomiconIndex);
|
||||
if (deathMessage != null)
|
||||
{
|
||||
MultiplayerHUDManager.Instance.WriteMessage(string.Format(deathMessage, playerName), Color.grey);
|
||||
MultiplayerHUDManager.Instance.WriteSystemMessage(string.Format(deathMessage, playerName), Color.grey);
|
||||
}
|
||||
|
||||
RespawnManager.Instance.OnPlayerDeath(player);
|
||||
|
@ -83,6 +83,13 @@ internal class MultiplayerHUDManager : MonoBehaviour, IAddComponentOnStart
|
||||
private readonly ListStack<(string msg, Color color)> _messages = new(false);
|
||||
private float _lastMessageTime;
|
||||
|
||||
// this just exists so i can patch this in my tts addon
|
||||
// perks of being a qsb dev :-)
|
||||
public void WriteSystemMessage(string message, Color color)
|
||||
{
|
||||
WriteMessage(message, color);
|
||||
}
|
||||
|
||||
public void WriteMessage(string message, Color color)
|
||||
{
|
||||
// dont write messages when not ready
|
||||
@ -453,7 +460,7 @@ internal class MultiplayerHUDManager : MonoBehaviour, IAddComponentOnStart
|
||||
Destroy(player.HUDBox?.gameObject);
|
||||
Destroy(player.MinimapPlayerMarker);
|
||||
|
||||
WriteMessage(string.Format(QSBLocalization.Current.PlayerLeftTheGame, player.Name), Color.yellow);
|
||||
WriteSystemMessage(string.Format(QSBLocalization.Current.PlayerLeftTheGame, player.Name), Color.yellow);
|
||||
}
|
||||
|
||||
private PlanetTrigger CreateTrigger(string parentPath, HUDIcon icon)
|
||||
|
@ -127,7 +127,7 @@ public class PlayerJoinMessage : QSBMessage
|
||||
|
||||
var player = QSBPlayerManager.GetPlayer(From);
|
||||
player.Name = PlayerName;
|
||||
MultiplayerHUDManager.Instance.WriteMessage(string.Format(QSBLocalization.Current.PlayerJoinedTheGame, player.Name), Color.green);
|
||||
MultiplayerHUDManager.Instance.WriteSystemMessage(string.Format(QSBLocalization.Current.PlayerJoinedTheGame, player.Name), Color.green);
|
||||
DebugLog.DebugWrite($"{player} joined. qsbVersion:{QSBVersion}, gameVersion:{GameVersion}, dlcInstalled:{DlcInstalled}", MessageType.Info);
|
||||
}
|
||||
|
||||
|
@ -36,15 +36,15 @@ internal class PlayerKickMessage : QSBMessage<string>
|
||||
{
|
||||
if (QSBPlayerManager.PlayerExists(PlayerId))
|
||||
{
|
||||
MultiplayerHUDManager.Instance.WriteMessage(string.Format(QSBLocalization.Current.PlayerWasKicked, QSBPlayerManager.GetPlayer(PlayerId).Name), Color.red);
|
||||
MultiplayerHUDManager.Instance.WriteSystemMessage(string.Format(QSBLocalization.Current.PlayerWasKicked, QSBPlayerManager.GetPlayer(PlayerId).Name), Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
MultiplayerHUDManager.Instance.WriteMessage(string.Format(QSBLocalization.Current.PlayerWasKicked, PlayerId), Color.red);
|
||||
MultiplayerHUDManager.Instance.WriteSystemMessage(string.Format(QSBLocalization.Current.PlayerWasKicked, PlayerId), Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
MultiplayerHUDManager.Instance.WriteMessage(string.Format(QSBLocalization.Current.KickedFromServer, Data), Color.red);
|
||||
MultiplayerHUDManager.Instance.WriteSystemMessage(string.Format(QSBLocalization.Current.KickedFromServer, Data), Color.red);
|
||||
MenuManager.Instance.OnKicked(Data);
|
||||
|
||||
NetworkClient.Disconnect();
|
||||
|
Loading…
Reference in New Issue
Block a user