move messages to chat, add noise

This commit is contained in:
_nebula 2023-05-07 21:02:29 +01:00
parent 8f317512a4
commit 57dec490be
4 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,6 @@
using Mirror;
using QSB.ClientServerStateSync;
using QSB.HUD;
using QSB.Messaging;
using QSB.Player;
using QSB.RespawnSync;
@ -40,7 +41,7 @@ public class PlayerDeathMessage : QSBMessage<DeathType>
var deathMessage = Necronomicon.GetPhrase(Data, NecronomiconIndex);
if (deathMessage != null)
{
DebugLog.ToAll(string.Format(deathMessage, playerName));
MultiplayerHUDManager.Instance.WriteMessage($"<color=brown>{string.Format(deathMessage, playerName)}</color>");
}
RespawnManager.Instance.OnPlayerDeath(player);

View File

@ -139,6 +139,13 @@ internal class MultiplayerHUDManager : MonoBehaviour, IAddComponentOnStart
}
_textChat.Find("Messages").Find("Message").GetComponent<Text>().text = finalText;
if (Locator.GetPlayerSuit().IsWearingHelmet())
{
var audioController = Locator.GetPlayerAudioController();
audioController.PlayNotificationTextScrolling();
Delay.RunFramesLater(10, () => audioController.StopNotificationTextScrolling());
}
}
private void Update()

View File

@ -1,6 +1,7 @@
using HarmonyLib;
using Mirror;
using OWML.Common;
using QSB.HUD;
using QSB.Localization;
using QSB.Messaging;
using QSB.Utility;
@ -125,7 +126,7 @@ public class PlayerJoinMessage : QSBMessage
var player = QSBPlayerManager.GetPlayer(From);
player.Name = PlayerName;
DebugLog.ToAll(string.Format(QSBLocalization.Current.PlayerJoinedTheGame, player.Name), MessageType.Info);
MultiplayerHUDManager.Instance.WriteMessage($"<color=green>{string.Format(QSBLocalization.Current.PlayerJoinedTheGame, player.Name)}</color>");
DebugLog.DebugWrite($"{player} joined. qsbVersion:{QSBVersion}, gameVersion:{GameVersion}, dlcInstalled:{DlcInstalled}", MessageType.Info);
}

View File

@ -1,4 +1,5 @@
using Mirror;
using QSB.HUD;
using QSB.Localization;
using QSB.Menus;
using QSB.Messaging;
@ -34,15 +35,15 @@ internal class PlayerKickMessage : QSBMessage<string>
{
if (QSBPlayerManager.PlayerExists(PlayerId))
{
DebugLog.ToAll(string.Format(QSBLocalization.Current.PlayerWasKicked, QSBPlayerManager.GetPlayer(PlayerId).Name));
MultiplayerHUDManager.Instance.WriteMessage($"<color=red>{string.Format(QSBLocalization.Current.PlayerWasKicked, QSBPlayerManager.GetPlayer(PlayerId).Name)}</color>");
return;
}
DebugLog.ToAll(string.Format(QSBLocalization.Current.PlayerWasKicked, PlayerId));
MultiplayerHUDManager.Instance.WriteMessage($"<color=red>{string.Format(QSBLocalization.Current.PlayerWasKicked, PlayerId)}</color>");
return;
}
DebugLog.ToAll(string.Format(QSBLocalization.Current.KickedFromServer, Data));
MultiplayerHUDManager.Instance.WriteMessage($"<color=red>{string.Format(QSBLocalization.Current.KickedFromServer, Data)}</color>");
MenuManager.Instance.OnKicked(Data);
NetworkClient.Disconnect();