From 52b40aaa4fe7d03b498cd70a23a238d55b52b189 Mon Sep 17 00:00:00 2001 From: Vantha Date: Sun, 29 Mar 2026 20:55:58 +0200 Subject: [PATCH] Add a tutorial panel for explaining the GUI This patch adds a new type of tutorial steps called "GUI explanation", with a corresponding GUI panel. The purpose of it is to explain what a certain GUI element does. To make use of it the trigger script has to specify the target GUI object's name as well as the side on which to place the explanation panel relative to the target itself. The panel then highlights the target object by fading everything else out with black and also uses an arrow to point to it. Whilever the target GUI object is hidden, the panel hides the background fade too and shows a warning message. Unlike for the other steps, the TutorialManager does not hide the previously active panel when showing a GUI explanation, but instead only disables it, since it could contain relevant information and the GUI explanation panel is visibly placed "above" all other panels (in the Z axis). --- .../textures/ui/session/golden-arrow_down.png | 3 + .../textures/ui/session/golden-arrow_left.png | 3 + .../data/mods/public/gui/common/global.xml | 6 +- .../gui/session/NetworkDelayOverlay.xml | 2 +- .../single_details_area.xml | 2 +- .../data/mods/public/gui/session/sprites.xml | 43 +++ .../data/mods/public/gui/session/styles.xml | 19 ++ .../gui/session/tutorial/TutorialManager.js | 18 +- .../gui/session/tutorial/TutorialPanel.js | 5 + .../tutorial/panels/GuiExplanationPanel.js | 249 ++++++++++++++++++ .../tutorial/panels/GuiExplanationPanel.xml | 8 + .../data/mods/public/maps/scripts/Tutorial.js | 3 +- .../tutorials/starting_economy_walkthrough.js | 29 +- 13 files changed, 374 insertions(+), 16 deletions(-) create mode 100644 binaries/data/mods/public/art/textures/ui/session/golden-arrow_down.png create mode 100644 binaries/data/mods/public/art/textures/ui/session/golden-arrow_left.png create mode 100644 binaries/data/mods/public/gui/session/tutorial/panels/GuiExplanationPanel.js create mode 100644 binaries/data/mods/public/gui/session/tutorial/panels/GuiExplanationPanel.xml diff --git a/binaries/data/mods/public/art/textures/ui/session/golden-arrow_down.png b/binaries/data/mods/public/art/textures/ui/session/golden-arrow_down.png new file mode 100644 index 0000000000..4b8744247c --- /dev/null +++ b/binaries/data/mods/public/art/textures/ui/session/golden-arrow_down.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d1a87bfd33e5c55c8bc28eac1985f17fe5d4c51d853b4984f85051ce96a62d8 +size 2598 diff --git a/binaries/data/mods/public/art/textures/ui/session/golden-arrow_left.png b/binaries/data/mods/public/art/textures/ui/session/golden-arrow_left.png new file mode 100644 index 0000000000..a14f2b29b8 --- /dev/null +++ b/binaries/data/mods/public/art/textures/ui/session/golden-arrow_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ca1fbd89c75157abb88e88d047273c93a61ff085c1eb5311a36ce07b4133590 +size 2611 diff --git a/binaries/data/mods/public/gui/common/global.xml b/binaries/data/mods/public/gui/common/global.xml index 7113cbef71..042c396c87 100644 --- a/binaries/data/mods/public/gui/common/global.xml +++ b/binaries/data/mods/public/gui/common/global.xml @@ -18,7 +18,7 @@