diff --git a/binaries/data/mods/public/gui/session/chat/ChatOverlay.js b/binaries/data/mods/public/gui/session/chat/ChatOverlay.js index 376a48d2e3..06fc509f72 100644 --- a/binaries/data/mods/public/gui/session/chat/ChatOverlay.js +++ b/binaries/data/mods/public/gui/session/chat/ChatOverlay.js @@ -25,7 +25,6 @@ class ChatOverlay */ this.chatMessages = []; - this.chatText = Engine.GetGUIObjectByName("chatText"); this.chatLines = Engine.GetGUIObjectByName("chatLines").children; this.chatLinesNumber = Math.min(this.chatLinesNumber, this.chatLines.length); } diff --git a/binaries/data/mods/public/gui/session/unit_commands.js b/binaries/data/mods/public/gui/session/unit_commands.js index 04281d64f9..bfd1b71aa9 100644 --- a/binaries/data/mods/public/gui/session/unit_commands.js +++ b/binaries/data/mods/public/gui/session/unit_commands.js @@ -79,8 +79,8 @@ function setupUnitPanel(guiName, unitEntStates, playerState) // depending on the XML, some of the GUI objects may be undefined "button": Engine.GetGUIObjectByName("unit" + guiName + "Button[" + i + "]"), "icon": Engine.GetGUIObjectByName("unit" + guiName + "Icon[" + i + "]"), - "guiSelection": Engine.GetGUIObjectByName("unit" + guiName + "Selection[" + i + "]"), - "countDisplay": Engine.GetGUIObjectByName("unit" + guiName + "Count[" + i + "]") + "guiSelection": Engine.TryGetGUIObjectByName("unit" + guiName + "Selection[" + i + "]"), + "countDisplay": Engine.TryGetGUIObjectByName("unit" + guiName + "Count[" + i + "]") }; if (data.button) diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp index 7bdb55ca7b..b76d874486 100644 --- a/source/gui/CGUI.cpp +++ b/source/gui/CGUI.cpp @@ -448,7 +448,7 @@ IGUIObject* CGUI::FindObjectByName(const CStr& Name) const { IGUIObject* obj = TryFindObjectByName(Name); if (obj == nullptr) - LOGERROR("Failed to get GUI object by name: object '%s' not found.\nNote: Use 'Engine.TryGetGUIObjectByName' to query for potentially non-existent objects instead.", Name); + LOGERROR("Failed to get GUI object by name: object '%s' not found. Note: Use 'Engine.TryGetGUIObjectByName' to query for potentially non-existent objects instead.", Name); return obj; }