diff --git a/code/assets/redscript/Ink/ChatController.reds b/code/assets/redscript/Ink/ChatController.reds index 6e49e08..f82bcd9 100644 --- a/code/assets/redscript/Ink/ChatController.reds +++ b/code/assets/redscript/Ink/ChatController.reds @@ -18,10 +18,10 @@ public class ChatController extends inkHUDGameController { private let m_lastMessageData: ref; protected cb func OnInitialize() -> Bool { - LogChannel(n"DEBUG", s"[ChatController] OnInitialize"); + CMPLog(s""); this.m_player = this.GetPlayerControlledObject() as PlayerPuppet; if !IsDefined(this.m_player) { - LogChannel(n"DEBUG", s"[ChatController] NO PLAYER"); + CMPLog(s"NO PLAYER"); } this.m_uiSystem = GameInstance.GetUISystem(this.m_player.GetGame()); this.m_messageController = inkWidgetRef.GetController(this.m_messagesRef) as ListController; @@ -39,7 +39,7 @@ public class ChatController extends inkHUDGameController { } protected cb func OnUninitialize() -> Bool { - LogChannel(n"DEBUG", s"[ChatController] OnUninitialize"); + CMPLog(s""); this.m_player.UnregisterInputListener(this, n"UIEnterChatMessage"); } @@ -57,7 +57,7 @@ public class ChatController extends inkHUDGameController { } protected cb func OnChatMessageUIEvent(evt: ref) -> Bool { - LogChannel(n"DEBUG", s"[ChatController] OnChatMessageUIEvent"); + CMPLog(s""); let messageData = new ChatMessageData(); messageData.m_author = evt.author; messageData.m_message = evt.message; @@ -125,7 +125,7 @@ public class ChatController extends inkHUDGameController { private final func SendChat() -> Void { let textEntered: String = this.m_input.GetText(); if NotEquals(textEntered, "") { - LogChannel(n"DEBUG", s"[ChatController] SendChat \"\(textEntered)\""); + CMPLog(s"\"\(textEntered)\""); GameInstance.GetNetworkWorldSystem().GetChatSystem().Send(textEntered); }; diff --git a/code/assets/redscript/Ink/ChatMessageController.reds b/code/assets/redscript/Ink/ChatMessageController.reds index 888f9e1..bff1f97 100644 --- a/code/assets/redscript/Ink/ChatMessageController.reds +++ b/code/assets/redscript/Ink/ChatMessageController.reds @@ -11,7 +11,7 @@ public class ChatMessageController extends ListItemController { public let m_messageLabel: wref; protected cb func OnInitialize() -> Bool { - LogChannel(n"DEBUG", s"[ChatMessageController] OnInitialize"); + CMPLog(s""); // super.OnInitialize(); this.m_authorLabel = inkTextRef.Get(this.m_authorWidget) as inkText; this.m_messageLabel = inkTextRef.Get(this.m_messageWidget) as inkText; @@ -23,7 +23,7 @@ public class ChatMessageController extends ListItemController { } protected cb func OnDataChanged(value: ref) -> Bool { - LogChannel(n"DEBUG", s"[ChatMessageController] OnDataChanged"); + CMPLog(s""); // super.OnDataChanged(value); this.m_data = value as ChatMessageData; if this.m_data.m_needsAuthorLabel { @@ -42,7 +42,7 @@ public class ChatMessageController extends ListItemController { } public final func Refresh(value: ref) -> Void { - // LogChannel(n"DEBUG", s"[ChatMessageController] Refresh"); + // CMPLog(s""); this.m_data = value as ChatMessageData; if this.m_data.m_needsAuthorLabel { this.m_authorLabel.SetVisible(true); @@ -60,7 +60,7 @@ public class ChatMessageController extends ListItemController { } protected cb func OnAddedToList(target: wref) -> Bool { - // LogChannel(n"DEBUG", s"[ChatMessageController] OnAddedToList"); + // CMPLog(s""); let m_animListText: ref; let m_animTextInterp: ref; let stageOneTime: Float; diff --git a/code/assets/redscript/Ink/DeliveryListController.reds b/code/assets/redscript/Ink/DeliveryListController.reds index ab4173c..4244131 100644 --- a/code/assets/redscript/Ink/DeliveryListController.reds +++ b/code/assets/redscript/Ink/DeliveryListController.reds @@ -112,16 +112,16 @@ public class DeliveryListController extends inkLogicController { this.m_headerText.SetText("Select job"); this.m_scrollArea = this.GetWidget(n"container/scrollarea") as inkScrollArea; if !IsDefined(this.m_scrollArea) { - LogChannel(n"DEBUG", s"[DeliveryListController] COULD NOT FIND SCROLLAREA"); + CMPLog(s"COULD NOT FIND SCROLLAREA"); } this.m_listController = this.GetWidget(n"container/scrollarea/list").GetController() as ListController; if !IsDefined(this.m_listController) { - LogChannel(n"DEBUG", s"[DeliveryListController] COULD NOT FIND LIST CONTROLLER"); + CMPLog(s"COULD NOT FIND LIST CONTROLLER"); } this.m_scrollArea.RegisterToCallback(n"OnScrollChanged", this, n"OnScrollChanged"); this.m_scrollController = this.m_scrollArea.GetControllerByType(n"inkScrollController") as inkScrollController; if !IsDefined(this.m_scrollController) { - LogChannel(n"DEBUG", s"[DeliveryListController] COULD NOT FIND SCROLL CONTROLLER"); + CMPLog(s"COULD NOT FIND SCROLL CONTROLLER"); } // this.m_leftMargin = new inkMargin(35.00, 10.00, 0.00, 0.00); // this.m_rightMargin = new inkMargin(1400.00, 10.00, 0.00, 0.00); @@ -162,7 +162,7 @@ public class DeliveryListController extends inkLogicController { } protected cb func OnItemSelected(previous: ref, next: ref) -> Bool { - LogChannel(n"DEBUG", s"[DeliveryListController] OnItemSelected"); + CMPLog(s""); // let selectionChangeEvent: ref; // let contactData: ref = FromVariant>(next.GetData()) as ContactData; // InkImageUtils.RequestAvatarOrUnknown(this, this.m_avatarImage, contactData.avatarID); diff --git a/code/assets/redscript/Ink/DeliveryListItemController.reds b/code/assets/redscript/Ink/DeliveryListItemController.reds index d9964a4..6d9b462 100644 --- a/code/assets/redscript/Ink/DeliveryListItemController.reds +++ b/code/assets/redscript/Ink/DeliveryListItemController.reds @@ -12,7 +12,7 @@ public class DeliveryListItemController extends ListItemController { public let m_itemIcon: wref; protected cb func OnInitialize() -> Bool { - LogChannel(n"DEBUG", s"[DeliveryListItemController] OnInitialize"); + CMPLog(s""); // super.OnInitialize(); this.RegisterToCallback(n"OnSelected", this, n"OnSelected"); this.RegisterToCallback(n"OnDeselected", this, n"OnDeselected"); @@ -21,7 +21,7 @@ public class DeliveryListItemController extends ListItemController { this.m_itemDescription = this.GetWidget(n"textContainer/NamePreviewContainer/preview") as inkText; this.m_itemIcon = this.GetWidget(n"icon") as inkImage; if !IsDefined(this.m_itemName) { - LogChannel(n"DEBUG", s"[DeliveryListItemController] COULD NOT FIND LABEL"); + CMPLog(s"COULD NOT FIND LABEL"); } // this.RegisterToCallback(n"OnAddedToList", this, n"OnAddedToList"); } @@ -31,7 +31,7 @@ public class DeliveryListItemController extends ListItemController { } protected cb func OnSelected(itemController: wref, discreteNav: Bool) -> Bool { - LogChannel(n"DEBUG", s"[DeliveryListItemController] OnSelected"); + CMPLog(s""); // let animOptions: inkAnimOptions; // if IsDefined(this.m_animProxySelection) { // this.m_animProxySelection.GotoStartAndStop(true); @@ -53,7 +53,7 @@ public class DeliveryListItemController extends ListItemController { } protected cb func OnDataChanged(value: ref) -> Bool { - LogChannel(n"DEBUG", s"[DeliveryListItemController] OnDataChanged"); + CMPLog(s""); // super.OnDataChanged(value); this.m_data = value as JobEntry; // let itemid = ItemID.FromTDBID(this.m_data.item); diff --git a/code/assets/redscript/Ink/EmoteSelector.reds b/code/assets/redscript/Ink/EmoteSelector.reds index e5305fd..df27ad3 100644 --- a/code/assets/redscript/Ink/EmoteSelector.reds +++ b/code/assets/redscript/Ink/EmoteSelector.reds @@ -64,7 +64,7 @@ public class EmoteSelector extends inkLogicController { this.m_listController = this.GetWidget(n"container").GetController() as ListController; this.m_indicator = this.GetWidget(n"indicator"); if !IsDefined(this.m_listController) { - LogChannel(n"DEBUG", s"[EmoteSelector] COULD NOT FIND LIST CONTROLLER"); + CMPLog(s"COULD NOT FIND LIST CONTROLLER"); } // let setMenuModeEvent: ref; @@ -198,7 +198,7 @@ public class EmoteSelector extends inkLogicController { } protected cb func OnItemSelected(previous: ref, next: ref) -> Bool { - LogChannel(n"DEBUG", s"[EmoteSelector] OnItemSelected"); + CMPLog(s""); // let selectionChangeEvent: ref; // let contactData: ref = FromVariant>(next.GetData()) as ContactData; // InkImageUtils.RequestAvatarOrUnknown(this, this.m_avatarImage, contactData.avatarID); diff --git a/code/assets/redscript/Ink/EmoteSelectorItem.reds b/code/assets/redscript/Ink/EmoteSelectorItem.reds index cfef288..1200c72 100644 --- a/code/assets/redscript/Ink/EmoteSelectorItem.reds +++ b/code/assets/redscript/Ink/EmoteSelectorItem.reds @@ -11,7 +11,7 @@ public class EmoteSelectorItem extends ListItemController { public let m_serverDescription: wref; protected cb func OnInitialize() -> Bool { - // LogChannel(n"DEBUG", s"[EmoteSelectorItem] OnInitialize"); + // CMPLog(s""); // super.OnInitialize(); this.RegisterToCallback(n"OnSelected", this, n"OnSelected"); this.RegisterToCallback(n"OnDeselected", this, n"OnDeselected"); @@ -22,7 +22,7 @@ public class EmoteSelectorItem extends ListItemController { this.m_container = this.GetWidget(n"container") as inkWidget; // this.m_serverDescription = this.GetWidget(n"textContainer/NamePreviewContainer/preview") as inkText; if !IsDefined(this.m_name) { - LogChannel(n"DEBUG", s"[EmoteSelectorItem] COULD NOT FIND LABEL"); + CMPLog(s"COULD NOT FIND LABEL"); } this.RegisterToCallback(n"OnAddedToList", this, n"OnAddedToList"); } @@ -47,7 +47,7 @@ public class EmoteSelectorItem extends ListItemController { protected cb func OnSelected(itemController: wref, discreteNav: Bool) -> Bool { this.UnregisterFromCallback(n"OnHoverOver", this, n"OnHoverOver"); this.UnregisterFromCallback(n"OnHoverOut", this, n"OnHoverOut"); - // LogChannel(n"DEBUG", s"[EmoteSelectorItem] OnSelected"); + // CMPLog(s""); // let animOptions: inkAnimOptions; // if IsDefined(this.m_animProxySelection) { // this.m_animProxySelection.GotoStartAndStop(true); @@ -86,7 +86,7 @@ public class EmoteSelectorItem extends ListItemController { } protected cb func OnDataChanged(value: ref) -> Bool { - // LogChannel(n"DEBUG", s"[EmoteSelectorItem] OnDataChanged"); + // CMPLog(s""); // super.OnDataChanged(value); this.m_data = value as EmoteData; this.m_name.SetText(this.m_data.m_name); diff --git a/code/assets/redscript/Ink/JobListController.reds b/code/assets/redscript/Ink/JobListController.reds index 1bf6c60..0e7cea3 100644 --- a/code/assets/redscript/Ink/JobListController.reds +++ b/code/assets/redscript/Ink/JobListController.reds @@ -108,16 +108,16 @@ public class JobListController extends inkLogicController { this.m_headerText.SetText("Select job type"); this.m_scrollArea = this.GetWidget(n"container/scrollarea") as inkScrollArea; if !IsDefined(this.m_scrollArea) { - LogChannel(n"DEBUG", s"[JobListController] COULD NOT FIND SCROLLAREA"); + CMPLog(s"COULD NOT FIND SCROLLAREA"); } this.m_listController = this.GetWidget(n"container/scrollarea/list").GetController() as ListController; if !IsDefined(this.m_listController) { - LogChannel(n"DEBUG", s"[JobListController] COULD NOT FIND LIST CONTROLLER"); + CMPLog(s"COULD NOT FIND LIST CONTROLLER"); } this.m_scrollArea.RegisterToCallback(n"OnScrollChanged", this, n"OnScrollChanged"); this.m_scrollController = this.m_scrollArea.GetControllerByType(n"inkScrollController") as inkScrollController; if !IsDefined(this.m_scrollController) { - LogChannel(n"DEBUG", s"[JobListController] COULD NOT FIND SCROLL CONTROLLER"); + CMPLog(s"COULD NOT FIND SCROLL CONTROLLER"); } // this.m_leftMargin = new inkMargin(35.00, 10.00, 0.00, 0.00); // this.m_rightMargin = new inkMargin(1400.00, 10.00, 0.00, 0.00); @@ -155,7 +155,7 @@ public class JobListController extends inkLogicController { } protected cb func OnItemSelected(previous: ref, next: ref) -> Bool { - LogChannel(n"DEBUG", s"[JobListController] OnItemSelected"); + CMPLog(s""); // let selectionChangeEvent: ref; // let contactData: ref = FromVariant>(next.GetData()) as ContactData; // InkImageUtils.RequestAvatarOrUnknown(this, this.m_avatarImage, contactData.avatarID); diff --git a/code/assets/redscript/Ink/JobListItemController.reds b/code/assets/redscript/Ink/JobListItemController.reds index 5f38a1c..1a5e73b 100644 --- a/code/assets/redscript/Ink/JobListItemController.reds +++ b/code/assets/redscript/Ink/JobListItemController.reds @@ -11,7 +11,7 @@ public class JobListItemController extends ListItemController { public let m_shopDescription: wref; protected cb func OnInitialize() -> Bool { - LogChannel(n"DEBUG", s"[JobListItemController] OnInitialize"); + CMPLog(s""); // super.OnInitialize(); this.RegisterToCallback(n"OnSelected", this, n"OnSelected"); this.RegisterToCallback(n"OnDeselected", this, n"OnDeselected"); @@ -19,7 +19,7 @@ public class JobListItemController extends ListItemController { this.m_shopName = this.GetWidget(n"textContainer/NamePreviewContainer/NameContainer/contactLabel") as inkText; this.m_shopDescription = this.GetWidget(n"textContainer/NamePreviewContainer/preview") as inkText; if !IsDefined(this.m_shopName) { - LogChannel(n"DEBUG", s"[JobListItemController] COULD NOT FIND LABEL"); + CMPLog(s"COULD NOT FIND LABEL"); } // this.RegisterToCallback(n"OnAddedToList", this, n"OnAddedToList"); } @@ -29,7 +29,7 @@ public class JobListItemController extends ListItemController { } protected cb func OnSelected(itemController: wref, discreteNav: Bool) -> Bool { - LogChannel(n"DEBUG", s"[JobListItemController] OnSelected"); + CMPLog(s""); // let animOptions: inkAnimOptions; // if IsDefined(this.m_animProxySelection) { // this.m_animProxySelection.GotoStartAndStop(true); @@ -51,7 +51,7 @@ public class JobListItemController extends ListItemController { } protected cb func OnDataChanged(value: ref) -> Bool { - LogChannel(n"DEBUG", s"[JobListItemController] OnDataChanged"); + CMPLog(s""); // super.OnDataChanged(value); this.m_data = value as JobType; this.m_shopName.SetText(s"\(this.m_data.m_name)"); diff --git a/code/assets/redscript/Ink/MultiplayerGameController.reds b/code/assets/redscript/Ink/MultiplayerGameController.reds index 59e3a90..d8b8604 100644 --- a/code/assets/redscript/Ink/MultiplayerGameController.reds +++ b/code/assets/redscript/Ink/MultiplayerGameController.reds @@ -53,7 +53,7 @@ public class MultiplayerGameController extends inkGameController { protected cb func OnInitialize() -> Bool { GameInstance.GetNetworkWorldSystem().GetAppearanceSystem().m_controller = this; - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnInitialize"); + CMPLog(s""); this.m_comDeviceBBDef = GetAllBlackboardDefs().UI_ComDevice; this.m_comDeviceBB = this.GetBlackboardSystem().Get(this.m_comDeviceBBDef); @@ -134,7 +134,7 @@ public class MultiplayerGameController extends inkGameController { } private cb func OnActivatePhoneElements(element: Uint32) -> Bool { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnActivatePhoneElements: \(element)"); + CMPLog(s"\(element)"); let isInVehicle = 0; if Cast(element & Cast(EnumInt(gameuiActivePhoneElement.InVehicle))) { isInVehicle = 1; @@ -155,7 +155,7 @@ public class MultiplayerGameController extends inkGameController { /* protected cb func OnVehicleMount(value: Bool) -> Bool { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnPlayerEnteredVehicle"); + CMPLog(s""); if value { let targets = new inkWidgetsSet(); targets.Select(this.GetWidget(n"hud")); @@ -179,7 +179,7 @@ public class MultiplayerGameController extends inkGameController { } protected cb func OnPlayerEnteredVehicle(value: Int32) -> Bool { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnPlayerEnteredVehicle"); + CMPLog(s""); if value != 0 { let targets = new inkWidgetsSet(); targets.Select(this.GetWidget(n"hud")); @@ -235,7 +235,7 @@ public class MultiplayerGameController extends inkGameController { } protected func OnConnectedToServer(connected: Bool) -> Void { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnConnectedToServer"); + CMPLog(s""); this.m_connectedToServer = connected; if (connected) { this.ShowServerList(false); @@ -300,10 +300,10 @@ public class MultiplayerGameController extends inkGameController { uiBlackboard.SetBool(GetAllBlackboardDefs().UIGameData.UIMultiplayerContextRequest, true, true); this.EnableServerInput(); } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnServerListSpawned - no logic controller"); + CMPLog(s"no logic controller"); } } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnServerListSpawned - no widget"); + CMPLog(s"no widget"); } } @@ -407,7 +407,7 @@ public class MultiplayerGameController extends inkGameController { if IsDefined(this.m_serverListLogicController) { serverData = this.m_serverListLogicController.GetSelectedServerData(); if IsDefined(serverData) { - LogChannel(n"DEBUG", s"[MultiplayerGameController] Server selected: \(serverData.m_name)"); + CMPLog(s"Server selected: \(serverData.m_name)"); this.m_server = serverData.m_name; if serverData.m_test { this.GetUIBlackboard().SetBool(GetAllBlackboardDefs().UIGameData.UIMultiplayerConnectedToServer, true, true); @@ -415,7 +415,7 @@ public class MultiplayerGameController extends inkGameController { GameInstance.GetNetworkWorldSystem().Connect(serverData.m_name); } } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] No server selected"); + CMPLog(s"No server selected"); } } break; @@ -440,23 +440,23 @@ public class MultiplayerGameController extends inkGameController { // Chat // protected cb func OnChatSpawned(widget: ref, userData: ref) -> Bool { - // LogChannel(n"DEBUG", s"[MultiplayerGameController] OnChatSpawned"); + // CMPLog(s""); // this.m_messageController = this.GetWidget(n"hud/chat/wrapper/chat/scrollarea/messages").GetController() as ListController; // if !IsDefined(this.m_messageController) { - // LogChannel(n"DEBUG", s"[MultiplayerGameController] OnChatSpawned - LIST CONTROLLER NOT FOUND"); + // CMPLog(s"LIST CONTROLLER NOT FOUND"); // } // this.m_scrollArea = this.GetWidget(n"hud/chat/wrapper/chat/scrollarea") as inkScrollArea; // if !IsDefined(this.m_scrollArea) { - // LogChannel(n"DEBUG", s"[MultiplayerGameController] OnChatSpawned - SCROLLAREA NOT FOUND"); + // CMPLog(s"SCROLLAREA NOT FOUND"); // } // // this.m_scrollArea.RegisterToCallback(n"OnScrollChanged", this, n"OnScrollChanged"); // // this.m_scrollController = this.GetWidget(n"hud/chat/wrapper/chat").GetController() as inkScrollController; // // if !IsDefined(this.m_scrollController) { - // // LogChannel(n"DEBUG", s"[MultiplayerGameController] OnChatSpawned - SCROLL CONTROLLER NOT FOUND"); + // // CMPLog(s"SCROLL CONTROLLER NOT FOUND"); // // } // this.m_input = this.GetWidget(n"hud/chat/wrapper/input_box/input") as inkTextInput; // if !IsDefined(this.m_input) { - // LogChannel(n"DEBUG", s"[MultiplayerGameController] OnChatSpawned - INPUT WIDGET NOT FOUND"); + // CMPLog(s"INPUT WIDGET NOT FOUND"); // } // this.m_messageController.Clear(true); @@ -584,10 +584,10 @@ public class MultiplayerGameController extends inkGameController { // this.EnableServerInput(); } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnEmoteSelectorSpawned - no logic controller"); + CMPLog(s"no logic controller"); } } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnEmoteSelectorSpawned - no widget"); + CMPLog(s"no widget"); } } @@ -603,10 +603,10 @@ public class MultiplayerGameController extends inkGameController { this.m_repeatingScrollActionEnabled = false; let emoteData = this.m_emoteSelector.GetSelectedEmoteData(); if IsDefined(emoteData) { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnEmoteSelectorClosed: \(emoteData.m_name)"); + CMPLog(s"\(emoteData.m_name)"); EmoteServer.TriggerEmote(emoteData.m_name); } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnEmoteSelectorClosed - no emote selected"); + CMPLog(s"no emote selected"); } this.PlayRumble(RumbleStrength.SuperLight, RumbleType.Fast, RumblePosition.Left); TimeDilationHelper.SetTimeDilationWithProfile(this.m_player, "radialMenu", false, false); @@ -669,10 +669,10 @@ public class MultiplayerGameController extends inkGameController { uiBlackboard.SetBool(GetAllBlackboardDefs().UIGameData.UIMultiplayerContextRequest, true, true); this.EnableServerInput(); } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnJobListSpawned - no logic controller"); + CMPLog(s"no logic controller"); } } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnJobListSpawned - no widget"); + CMPLog(s"no widget"); } } @@ -742,7 +742,7 @@ public class MultiplayerGameController extends inkGameController { // this.AcceptAction(); if IsDefined(this.m_jobListLogicController) { let jobType = this.m_jobListLogicController.GetSelectedJobData(); - // LogChannel(n"DEBUG", s"[MultiplayerGameController] Job selected: \(jobType.id)"); + // CMPLog(s"Job selected: \(jobType.id)"); // JobsServer.SelectJob(n"Delivery driver"); if (Equals(ToName(jobType.m_name), n"Taxi Rider")) { TaxiServer.CreateJob(new Vector4(-2565.0, -5263.0, 94.25, 1.0)); @@ -823,10 +823,10 @@ public class MultiplayerGameController extends inkGameController { uiBlackboard.SetBool(GetAllBlackboardDefs().UIGameData.UIMultiplayerContextRequest, true, true); this.EnableServerInput(); } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnDeliveryListSpawned - no logic controller"); + CMPLog(s"no logic controller"); } } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] OnDeliveryListSpawned - no widget"); + CMPLog(s"no widget"); } } @@ -901,10 +901,10 @@ public class MultiplayerGameController extends inkGameController { let delivery = jobEntry as DeliveryEntry; let taxi = jobEntry as TaxiJobEntry; if IsDefined(delivery) { - LogChannel(n"DEBUG", s"[MultiplayerGameController] Delivery selected: \(delivery.id)"); + CMPLog(s"Delivery selected: \(delivery.id)"); DeliveryServer.AcceptDelivery(delivery.id); } else if IsDefined(taxi) { - LogChannel(n"DEBUG", s"[MultiplayerGameController] Taxi selected: \(taxi.id)"); + CMPLog(s"Taxi selected: \(taxi.id)"); TaxiServer.AcceptJob(taxi.id); } this.m_activeDelivery = true; @@ -913,7 +913,7 @@ public class MultiplayerGameController extends inkGameController { this.ShowDeliveryList(false); this.UpdateInputHints(); } else { - LogChannel(n"DEBUG", s"[MultiplayerGameController] No jobs available"); + CMPLog(s"No jobs available"); } } break; @@ -1000,7 +1000,7 @@ public class MultiplayerGameController extends inkGameController { } else { // let value = ListenerAction.GetValue(action); // let name = ListenerAction.GetName(action); - // LogChannel(n"DEBUG", s"\(name): \(value)"); + // CMPLog(s"\(name): \(value)"); if Equals(ListenerAction.GetName(action), n"mouse_x") || Equals(ListenerAction.GetName(action), n"mouse_y") { this.m_emoteSelector.UpdateAxisIndicator(ListenerAction.GetValue(action), ListenerAction.GetName(action)); return true; diff --git a/code/assets/redscript/Ink/ServerListController.reds b/code/assets/redscript/Ink/ServerListController.reds index 8a25d4c..333439e 100644 --- a/code/assets/redscript/Ink/ServerListController.reds +++ b/code/assets/redscript/Ink/ServerListController.reds @@ -103,16 +103,16 @@ public class ServerListController extends inkLogicController { this.GetRootWidget().SetVisible(false); this.m_scrollArea = this.GetWidget(n"container/scrollarea") as inkScrollArea; if !IsDefined(this.m_scrollArea) { - LogChannel(n"DEBUG", s"[ServerListController] COULD NOT FIND SCROLLAREA"); + CMPLog(s"COULD NOT FIND SCROLLAREA"); } this.m_listController = this.GetWidget(n"container/scrollarea/list").GetController() as ListController; if !IsDefined(this.m_listController) { - LogChannel(n"DEBUG", s"[ServerListController] COULD NOT FIND LIST CONTROLLER"); + CMPLog(s"COULD NOT FIND LIST CONTROLLER"); } this.m_scrollArea.RegisterToCallback(n"OnScrollChanged", this, n"OnScrollChanged"); this.m_scrollController = this.m_scrollArea.GetControllerByType(n"inkScrollController") as inkScrollController; if !IsDefined(this.m_scrollController) { - LogChannel(n"DEBUG", s"[ServerListController] COULD NOT FIND SCROLL CONTROLLER"); + CMPLog(s"COULD NOT FIND SCROLL CONTROLLER"); } // this.m_leftMargin = new inkMargin(35.00, 10.00, 0.00, 0.00); // this.m_rightMargin = new inkMargin(1400.00, 10.00, 0.00, 0.00); @@ -143,7 +143,7 @@ public class ServerListController extends inkLogicController { } protected cb func OnItemSelected(previous: ref, next: ref) -> Bool { - LogChannel(n"DEBUG", s"[ServerListController] OnItemSelected"); + CMPLog(s""); // let selectionChangeEvent: ref; // let contactData: ref = FromVariant>(next.GetData()) as ContactData; // InkImageUtils.RequestAvatarOrUnknown(this, this.m_avatarImage, contactData.avatarID); diff --git a/code/assets/redscript/Ink/ServerListItemController.reds b/code/assets/redscript/Ink/ServerListItemController.reds index 9ab78e7..5dd5779 100644 --- a/code/assets/redscript/Ink/ServerListItemController.reds +++ b/code/assets/redscript/Ink/ServerListItemController.reds @@ -10,7 +10,7 @@ public class ServerListItemController extends ListItemController { public let m_serverDescription: wref; protected cb func OnInitialize() -> Bool { - LogChannel(n"DEBUG", s"[ServerListItemController] OnInitialize"); + CMPLog(s""); // super.OnInitialize(); this.RegisterToCallback(n"OnSelected", this, n"OnSelected"); this.RegisterToCallback(n"OnDeselected", this, n"OnDeselected"); @@ -18,7 +18,7 @@ public class ServerListItemController extends ListItemController { this.m_serverName = this.GetWidget(n"textContainer/NamePreviewContainer/NameContainer/contactLabel") as inkText; this.m_serverDescription = this.GetWidget(n"textContainer/NamePreviewContainer/preview") as inkText; if !IsDefined(this.m_serverName) { - LogChannel(n"DEBUG", s"[ServerListItemController] COULD NOT FIND LABEL"); + CMPLog(s"COULD NOT FIND LABEL"); } // this.RegisterToCallback(n"OnAddedToList", this, n"OnAddedToList"); } @@ -28,7 +28,7 @@ public class ServerListItemController extends ListItemController { } protected cb func OnSelected(itemController: wref, discreteNav: Bool) -> Bool { - LogChannel(n"DEBUG", s"[ServerListItemController] OnSelected"); + CMPLog(s""); // let animOptions: inkAnimOptions; // if IsDefined(this.m_animProxySelection) { // this.m_animProxySelection.GotoStartAndStop(true); @@ -50,7 +50,7 @@ public class ServerListItemController extends ListItemController { } protected cb func OnDataChanged(value: ref) -> Bool { - LogChannel(n"DEBUG", s"[ServerListItemController] OnDataChanged"); + CMPLog(s""); // super.OnDataChanged(value); this.m_data = value as ServerData; this.m_serverName.SetText(this.m_data.m_name); diff --git a/code/assets/redscript/Logger.reds b/code/assets/redscript/Logger.reds new file mode 100644 index 0000000..d737aac --- /dev/null +++ b/code/assets/redscript/Logger.reds @@ -0,0 +1,37 @@ +module CyberpunkMP + +public static func CMPLog(value: script_ref) -> Void { + FTLog(CMPTraceLog(value)); +} + +public static func CMPWarn(value: script_ref) -> Void { + FTLogWarning(CMPTraceLog(value)); +} + +public static func CMPError(value: script_ref) -> Void { + FTLogError(CMPTraceLog(value)); +} + +private static func CMPTraceLog(value: script_ref) -> String { + let entries = GetStackTrace(1, false); + let entry = entries[0]; + let function = NameToString(entry.function); + let tokens = StrSplit(function, ";"); + + function = tokens[0]; + let trace: String; + + if IsDefined(entry.object) { + let className = NameToString(entry.class); + + if StrFindFirst(className, "CyberpunkMP.") == 0 { + className = StrRight(className, StrLen(className) - StrLen("CyberpunkMP.")); + } else { + className = s"*.\(className)"; + } + trace = s"[\(className)][\(function)]"; + } else { + trace = s"[\(function)]"; + } + return s"[CMP]\(trace) \(value)"; +} \ No newline at end of file diff --git a/code/assets/redscript/Plugins/Delivery.reds b/code/assets/redscript/Plugins/Delivery.reds index 8b9b3da..e427498 100644 --- a/code/assets/redscript/Plugins/Delivery.reds +++ b/code/assets/redscript/Plugins/Delivery.reds @@ -41,7 +41,7 @@ public class DeliveryClient extends ClientRpc { } public func StartDelivery(location: Vector4) -> Void { - LogChannel(n"DEBUG", s"[DeliveryClient] StartDelivery"); + CMPLog(s""); // Set the waypoint, show some UI marker let mappinData: MappinData; @@ -59,7 +59,7 @@ public class DeliveryClient extends ClientRpc { } public func EndDelivery(success: Bool, reward: Uint32) -> Void { - LogChannel(n"DEBUG", s"[DeliveryClient] EndDelivery"); + CMPLog(s""); // Called when the delivery is successful or failed if success { let player = GetPlayer(GetGameInstance()); @@ -78,7 +78,7 @@ public class DeliveryClient extends ClientRpc { } public func LoadDeliveries(deliveries: array) -> Void { - LogChannel(n"DEBUG", s"[DeliveryClient] LoadDeliveries"); + CMPLog(s""); // Set the delivery list ArrayClear(GameInstance.GetNetworkWorldSystem().GetAppearanceSystem().m_deliveryEntries); @@ -103,7 +103,7 @@ public class DeliveryClient extends ClientRpc { GameInstance.GetNetworkWorldSystem().GetAppearanceSystem().m_controller.ShowDeliveryListCallback(); // let i = 0; // while i < ArraySize(deliveries) { - // LogChannel(n"DEBUG", s"[DeliveryClient] deliveryID: \(deliveries[i].id)"); + // CMPLog(s"deliveryID: \(deliveries[i].id)"); // let shop = new ShopData(); // shop.m_name = s"Test Shop \(deliveries[i].id)"; diff --git a/code/assets/redscript/Plugins/Jobs.reds b/code/assets/redscript/Plugins/Jobs.reds index 12d3f34..6271426 100644 --- a/code/assets/redscript/Plugins/Jobs.reds +++ b/code/assets/redscript/Plugins/Jobs.reds @@ -25,7 +25,7 @@ public native class JobsServer extends ServerRpc { public class JobsClient extends ClientRpc { public func SetActiveJob(job: CName) -> Void { - LogChannel(n"DEBUG", s"[JobsClient] SetActiveJob"); + CMPLog(s""); // Set the current active job of the player if (Equals(job, n"Delivery Driver")) { diff --git a/code/assets/redscript/Plugins/Taxi.reds b/code/assets/redscript/Plugins/Taxi.reds index aa30fde..7b19f2d 100644 --- a/code/assets/redscript/Plugins/Taxi.reds +++ b/code/assets/redscript/Plugins/Taxi.reds @@ -34,7 +34,7 @@ public class TaxiDriverClient extends ClientRpc { // Driver has accepted the job public func StartJob(pickupLocation: Vector4) -> Void { - LogChannel(n"DEBUG", s"[TaxiDriverClient] StartJob"); + CMPLog(s""); // create mappin where the job was created let mappinData: MappinData; @@ -48,7 +48,7 @@ public class TaxiDriverClient extends ClientRpc { // Driver is close enough & is stopped, so rider can mount vehicle public func MountPassenger(rider_server_id: Uint64) { - LogChannel(n"DEBUG", s"[TaxiDriverClient] MountPassenger"); + CMPLog(s""); // get rid of mappin @@ -72,7 +72,7 @@ public class TaxiDriverClient extends ClientRpc { // Rider has mounted the vehicle public func StartTrip(dropoffLocation: Vector4) { - LogChannel(n"DEBUG", s"[TaxiDriverClient] StartTrip"); + CMPLog(s""); // create mappin at the destination let mappinData: MappinData; @@ -92,7 +92,7 @@ public class TaxiDriverClient extends ClientRpc { // User is close enough to the waypoint and is stopped, so NPC can get out public func EndTrip(success: Bool, reward: Uint32) -> Void { - LogChannel(n"DEBUG", s"[TaxiDriverClient] EndTrip"); + CMPLog(s""); let mappinSystem: ref = GameInstance.GetMappinSystem(GetGameInstance()); mappinSystem.UnregisterMappin(GameInstance.GetNetworkWorldSystem().GetAppearanceSystem().m_mappin); @@ -108,7 +108,7 @@ public class TaxiDriverClient extends ClientRpc { } public func LoadJobs(jobs: array) -> Void { - LogChannel(n"DEBUG", s"[TaxiDriverClient] LoadJobs"); + CMPLog(s""); // Set the job list ArrayClear(GameInstance.GetNetworkWorldSystem().GetAppearanceSystem().m_deliveryEntries); @@ -132,7 +132,7 @@ public class TaxiRiderClient extends ClientRpc { // vehicle is close & slow enough to mount public func StartTrip(vehicle_server_id: Uint64) -> Void { - LogChannel(n"DEBUG", s"[TaxiRiderClient] StartTrip"); + CMPLog(s""); // mount muppet in vehicle // this.m_vehicle_id = GameInstance.GetNetworkWorldSystem().GetEntityIdByServerId(vehicle_server_id); @@ -151,7 +151,7 @@ public class TaxiRiderClient extends ClientRpc { // trip is ended/cancelled public func EndTrip(success: Bool, cost: Uint32) -> Void { - LogChannel(n"DEBUG", s"[TaxiRiderClient] EndTrip"); + CMPLog(s""); // Called when the Taxi is successful or failed if success { diff --git a/code/assets/redscript/World/AppearanceSystem.reds b/code/assets/redscript/World/AppearanceSystem.reds index c0302e4..bde5261 100644 --- a/code/assets/redscript/World/AppearanceSystem.reds +++ b/code/assets/redscript/World/AppearanceSystem.reds @@ -59,9 +59,9 @@ public native class AppearanceSystem extends IScriptable { // if IsDefined(this.m_callbackSystem) { this.m_callbackSystem.RegisterCallback(n"Entity/Attached", this, n"OnEntityAttached") .AddTarget(DynamicEntityTarget.Tag(n"CyberpunkMP.Puppet")); - // LogChannel(n"DEBUG", s"[AppearanceSystem] Entity/Attached callback registered"); + // CMPLog(s"Entity/Attached callback registered"); // } else { - // LogChannel(n"DEBUG", s"[AppearanceSystem] No CallbackSystem"); + // CMPLog(s"No CallbackSystem"); // } this.m_callbackSystem.RegisterCallback(n"Entity/Attached", this, n"OnAnimationEntityAttached") @@ -88,7 +88,7 @@ public native class AppearanceSystem extends IScriptable { let tdbid = ItemID.GetTDBID(item); if TDBID.IsValid(tdbid) { let str = TDBID.ToStringDEBUG(ItemID.GetTDBID(item)); - LogChannel(n"DEBUG", "Getting: " + str); + CMPLog("Getting: " + str); ArrayPush(items, str); } i += 1; @@ -99,12 +99,12 @@ public native class AppearanceSystem extends IScriptable { public let selected_entity_id: EntityID; public func HandleEmote(id: EntityID, name: String) -> Void { - LogChannel(n"DEBUG", s"Handling Emote: \(name)"); + CMPLog(s"Handling Emote: \(name)"); this.selected_entity_id = id; let entity = GameInstance.FindEntityByID(GetGameInstance(), id) as GameObject; if !IsDefined(entity) { - LogChannel(n"DEBUG", s"Could not find entity."); + CMPLog(s"Could not find entity."); return; } @@ -150,7 +150,7 @@ public native class AppearanceSystem extends IScriptable { } private cb func OnAnimationEntityAttached(event: ref) { - LogChannel(n"DEBUG", s"Emote Entity Attached \(EntityID.GetHash(event.GetEntity().GetEntityID()))"); + CMPLog(s"Emote Entity Attached \(EntityID.GetHash(event.GetEntity().GetEntityID()))"); let workspotSystem: ref = GameInstance.GetWorkspotSystem(GetGameInstance()); let entity = GameInstance.FindEntityByID(GetGameInstance(), this.selected_entity_id) as GameObject; @@ -167,7 +167,7 @@ public native class AppearanceSystem extends IScriptable { let entity = event.GetEntity() as GameObject; if IsDefined(entity) { // && entity.HasTag(n"CyberpunkMP.Puppet") { - // LogChannel(n"DEBUG", s"[AppearanceSystem] OnEntityAssemble our muppet"); + // CMPLog(s"OnEntityAssemble our muppet"); if this.ApplyAppearance(entity) { ArrayPush(this.m_entities, entity); } @@ -188,7 +188,7 @@ public native class AppearanceSystem extends IScriptable { // this.SetMorphWeights(entity); } else { - // LogChannel(n"DEBUG", s"[AppearanceSystem] not our muppet"); + // CMPLog(s"not our muppet"); } } @@ -210,14 +210,14 @@ public native class AppearanceSystem extends IScriptable { // } private func AddItems(entity: ref) { - LogChannel(n"DEBUG", s"[AppearanceSystem] AddItems"); + CMPLog(s""); let i: Int32; let transactionSystem: ref = GameInstance.GetTransactionSystem(entity.GetGame()); let equipment = this.GetEntityItems(entity.GetEntityID()); i = 0; while i < ArraySize(equipment) { - LogChannel(n"DEBUG", "Setting: " + TDBID.ToStringDEBUG(equipment[i])); + CMPLog("Setting: " + TDBID.ToStringDEBUG(equipment[i])); let item = ItemID.FromTDBID(equipment[i]); let placementSlot = EquipmentSystem.GetPlacementSlot(item); diff --git a/code/assets/redscript/World/ChatSystem.reds b/code/assets/redscript/World/ChatSystem.reds index a4d0b41..8d29f3d 100644 --- a/code/assets/redscript/World/ChatSystem.reds +++ b/code/assets/redscript/World/ChatSystem.reds @@ -12,7 +12,7 @@ public native class ChatSystem extends IScriptable { evt.author = author; evt.message = message; - LogChannel(n"DEBUG", s"[ChatSystem] HandleChatMessage: " + message); + CMPLog(s"\(message)"); let uiSystem = GameInstance.GetUISystem(GetGameInstance()); uiSystem.QueueEvent(evt); } diff --git a/code/assets/redscript/World/VehicleSystem.reds b/code/assets/redscript/World/VehicleSystem.reds index 504a772..962459e 100644 --- a/code/assets/redscript/World/VehicleSystem.reds +++ b/code/assets/redscript/World/VehicleSystem.reds @@ -38,12 +38,12 @@ public native class VehicleSystem extends IScriptable { } private cb func OnEntityAttached(event: ref) { - LogChannel(n"DEBUG", "[VehicleSystem] OnEntityAttached"); + CMPLog(s""); this.OnVehicleReady(event.GetEntity().GetEntityID()); } public func EnterVehicle(character_id: EntityID, vehicle_id: EntityID, sit_position: CName) -> Bool { - LogChannel(n"DEBUG", "[VehicleSystem] Entering Vehicle with seat"); + CMPLog(s"with seat"); // works fine @@ -54,7 +54,7 @@ public native class VehicleSystem extends IScriptable { // let component = vehicle.GetVehicleComponent(); // component.MountEntityToSlot(vehicle_id, character_id, sit_position); // } else { - // LogChannel(n"DEBUG", "[VehicleSystem] NOT DEFINED"); + // CMPLog(s"NOT DEFINED"); // } // maybe better? makes them walk to the car - kinda cool @@ -97,7 +97,7 @@ public native class VehicleSystem extends IScriptable { } public func ExitVehicle(character_id: EntityID) -> Bool { - LogChannel(n"DEBUG", "[VehicleSystem] Exiting vehicle"); + CMPLog(s""); let entity_system = GameInstance.GetDynamicEntitySystem(); let character = entity_system.GetEntity(character_id) as GameObject;