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
/*var lenth = */reader.ReadInt16();
var buffer = reader.ReadToEnd();
var text = Encoding.UTF8.GetString(buffer, 0, buffer.Length);
if (OcgCore.ShouldShowSystemMessages())
MessageManager.Cast(text);
return UniTask.CompletedTask;
......
......@@ -763,9 +763,7 @@ namespace MDPro3.Servant
GetUI<OcgCoreUI>().DuelErrorLog.Show(error);
}
public bool GetMessageConfig(int player)
{
if (player < 4 || player == 7)
public static bool ShouldShowPlayerMessages()
{
if (condition == Condition.Duel && !Config.GetBool("DuelPlayerMessage", true))
return false;
......@@ -773,8 +771,10 @@ namespace MDPro3.Servant
return false;
if (condition == Condition.Replay && !Config.GetBool("ReplayPlayerMessage", true))
return false;
return true;
}
else
public static bool ShouldShowSystemMessages()
{
if (condition == Condition.Duel && !Config.GetBool("DuelSystemMessage", true))
return false;
......@@ -782,6 +782,20 @@ namespace MDPro3.Servant
return false;
if (condition == Condition.Replay && !Config.GetBool("ReplaySystemMessage", true))
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;
}
......@@ -1464,6 +1478,8 @@ namespace MDPro3.Servant
public static void PrintDuelLog(string content)
{
lastDuelLog = content;
if (!ShouldShowSystemMessages())
return;
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