Commit 1612c01b authored by ElderLich's avatar ElderLich

Bug Fix: Fix player/system message toggle enforcement

Make duel, spectate, and replay player/system message settings apply consistently by routing duel log and hint messages through the same runtime filters instead of bypassing the config toggles.
parent 67444bff
...@@ -509,6 +509,7 @@ namespace MDPro3.Duel ...@@ -509,6 +509,7 @@ namespace MDPro3.Duel
/*var lenth = */reader.ReadInt16(); /*var lenth = */reader.ReadInt16();
var buffer = reader.ReadToEnd(); var buffer = reader.ReadToEnd();
var text = Encoding.UTF8.GetString(buffer, 0, buffer.Length); var text = Encoding.UTF8.GetString(buffer, 0, buffer.Length);
if (OcgCore.ShouldShowSystemMessages())
MessageManager.Cast(text); MessageManager.Cast(text);
return UniTask.CompletedTask; return UniTask.CompletedTask;
......
...@@ -763,9 +763,7 @@ namespace MDPro3.Servant ...@@ -763,9 +763,7 @@ namespace MDPro3.Servant
GetUI<OcgCoreUI>().DuelErrorLog.Show(error); GetUI<OcgCoreUI>().DuelErrorLog.Show(error);
} }
public bool GetMessageConfig(int player) public static bool ShouldShowPlayerMessages()
{
if (player < 4 || player == 7)
{ {
if (condition == Condition.Duel && !Config.GetBool("DuelPlayerMessage", true)) if (condition == Condition.Duel && !Config.GetBool("DuelPlayerMessage", true))
return false; return false;
...@@ -773,8 +771,10 @@ namespace MDPro3.Servant ...@@ -773,8 +771,10 @@ namespace MDPro3.Servant
return false; return false;
if (condition == Condition.Replay && !Config.GetBool("ReplayPlayerMessage", true)) if (condition == Condition.Replay && !Config.GetBool("ReplayPlayerMessage", true))
return false; return false;
return true;
} }
else
public static bool ShouldShowSystemMessages()
{ {
if (condition == Condition.Duel && !Config.GetBool("DuelSystemMessage", true)) if (condition == Condition.Duel && !Config.GetBool("DuelSystemMessage", true))
return false; return false;
...@@ -782,6 +782,20 @@ namespace MDPro3.Servant ...@@ -782,6 +782,20 @@ namespace MDPro3.Servant
return false; return false;
if (condition == Condition.Replay && !Config.GetBool("ReplaySystemMessage", true)) if (condition == Condition.Replay && !Config.GetBool("ReplaySystemMessage", true))
return false; return false;
return true;
}
public bool GetMessageConfig(int player)
{
if (player < 4 || player == 7)
{
if (!ShouldShowPlayerMessages())
return false;
}
else
{
if (!ShouldShowSystemMessages())
return false;
} }
return true; return true;
} }
...@@ -1464,6 +1478,8 @@ namespace MDPro3.Servant ...@@ -1464,6 +1478,8 @@ namespace MDPro3.Servant
public static void PrintDuelLog(string content) public static void PrintDuelLog(string content)
{ {
lastDuelLog = content; lastDuelLog = content;
if (!ShouldShowSystemMessages())
return;
MessageManager.Cast(content); MessageManager.Cast(content);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment