summaryrefslogtreecommitdiff
path: root/src/gui/debugwindow.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-12 13:24:42 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-04-08 21:02:34 +0200
commitc8aa91aca12d5f6386c20da1526de390ff523ce7 (patch)
treee0b6b4f24573e5b3f8b9e528e411dae6a3d38a5c /src/gui/debugwindow.cpp
parent14dc8218eeebd1583e6bd3c49013b3e501f47228 (diff)
downloadmana-c8aa91aca12d5f6386c20da1526de390ff523ce7.tar.gz
mana-c8aa91aca12d5f6386c20da1526de390ff523ce7.tar.bz2
mana-c8aa91aca12d5f6386c20da1526de390ff523ce7.tar.xz
mana-c8aa91aca12d5f6386c20da1526de390ff523ce7.zip
Added UI debug drawing
Shows outlines of visible widgets as well as highlighting modal focus, modal mouse focus and regular focus. Can currently only be toggled in the Debug window, so needs source code modification to be used during login sequence for now.
Diffstat (limited to 'src/gui/debugwindow.cpp')
-rw-r--r--src/gui/debugwindow.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index 047e4170..3c514191 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -25,6 +25,7 @@
#include "game.h"
#include "particle.h"
#include "map.h"
+#include "gui.h"
#include "gui/setup.h"
#include "gui/viewport.h"
@@ -138,6 +139,7 @@ public:
mBeingPath = new CheckBox(_("Being path"));
mMousePath = new CheckBox(_("Mouse path"));
mBeingIds = new CheckBox(_("Being Ids"));
+ mGuiDebug = new CheckBox(_("GUI debug"));
auto *specialsLabel = new Label(_("Specials:"));
mSpecialNormal = new RadioButton(_("Normal"), "mapdebug");
@@ -156,6 +158,7 @@ public:
place(0, 5, mBeingPath, 1);
place(0, 6, mMousePath, 1);
place(0, 7, mBeingIds, 1);
+ place(0, 8, mGuiDebug, 1);
place(1, 0, specialsLabel, 1);
place(1, 1, mSpecialNormal, 1);
place(1, 2, mSpecial1, 1);
@@ -173,6 +176,7 @@ public:
mBeingPath->addActionListener(this);
mMousePath->addActionListener(this);
mBeingIds->addActionListener(this);
+ mGuiDebug->addActionListener(this);
mSpecialNormal->addActionListener(this);
mSpecial1->addActionListener(this);
mSpecial2->addActionListener(this);
@@ -204,7 +208,9 @@ public:
if (mSpecial3->isSelected())
flags |= Map::DEBUG_SPECIAL3;
- viewport->setShowDebugPath(flags);
+ viewport->setDebugFlags(flags);
+
+ Gui::debugDraw = mGuiDebug->isSelected();
}
private:
@@ -215,6 +221,7 @@ private:
CheckBox *mBeingPath;
CheckBox *mMousePath;
CheckBox *mBeingIds;
+ CheckBox *mGuiDebug;
RadioButton *mSpecialNormal;
RadioButton *mSpecial1;
RadioButton *mSpecial2;