From a56c3e89ec6778345aa4a7eae1e1614a41faaf0e Mon Sep 17 00:00:00 2001 From: Beu Date: Mon, 28 Aug 2023 01:38:55 +0200 Subject: [PATCH] improve a bit length of the label to prevent lint warning --- TM_DebugMode.Script.txt | 42 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/TM_DebugMode.Script.txt b/TM_DebugMode.Script.txt index 0af5cf7..bc0a6b4 100644 --- a/TM_DebugMode.Script.txt +++ b/TM_DebugMode.Script.txt @@ -159,18 +159,7 @@ foreach (Event in UIManager.PendingEvents) { } case "DebugMode.VarInsp.ForVars.Dump.Player": { declare CSmPlayer Player; - if (TL::Length(Event.CustomEventData[0]) == 36) { - Player <=> ModeUtils::GetPlayerFromAccountId(Event.CustomEventData[0]); - } else if (TL::Length(Event.CustomEventData[0]) == 22) { - Player <=> GetPlayer(Event.CustomEventData[0]); - } else { - foreach (TmpPlayer in AllPlayers) { - if (TL::ToLowerCase(Event.CustomEventData[0]) == TL::ToLowerCase(TmpPlayer.User.Name)) { - Player <=> TmpPlayer; - break; - } - } - } + +++DebugMode_FindPlayer+++ if (Player != Null) { if (Event.CustomEventData[1] == "player") { @@ -191,18 +180,7 @@ foreach (Event in UIManager.PendingEvents) { } case "DebugMode.VarInsp.Struct.Dump.Player": { declare CSmPlayer Player; - if (TL::Length(Event.CustomEventData[0]) == 36) { - Player <=> ModeUtils::GetPlayerFromAccountId(Event.CustomEventData[0]); - } else if (TL::Length(Event.CustomEventData[0]) == 22) { - Player <=> GetPlayer(Event.CustomEventData[0]); - } else { - foreach (TmpPlayer in AllPlayers) { - if (TL::ToLowerCase(Event.CustomEventData[0]) == TL::ToLowerCase(TmpPlayer.User.Name)) { - Player <=> TmpPlayer; - break; - } - } - } + if (Player != Null) { if (Event.CustomEventData[1] == "player") { @@ -230,6 +208,22 @@ foreach (Event in UIManager.PendingEvents) { +++DebugMode_LogEvents+++ *** +***DebugMode_FindPlayer*** +*** +if (TL::Length(Event.CustomEventData[0]) == 36) { + Player <=> ModeUtils::GetPlayerFromAccountId(Event.CustomEventData[0]); +} else if (TL::Length(Event.CustomEventData[0]) == 22) { + Player <=> GetPlayer(Event.CustomEventData[0]); +} else { + foreach (TmpPlayer in AllPlayers) { + if (TL::ToLowerCase(Event.CustomEventData[0]) == TL::ToLowerCase(TmpPlayer.User.Name)) { + Player <=> TmpPlayer; + break; + } + } +} +*** + ***DebugMode_LogEvents*** *** foreach (Event in PendingEvents) {