summaryrefslogtreecommitdiff
path: root/src/gui/guiFormSpecMenu.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2020-04-12 12:02:32 +0200
committerGitHub <noreply@github.com>2020-04-12 12:02:32 +0200
commit6cf15cf872cc9ce76990d83d380ca3c4b7485eb1 (patch)
tree50be61e054c6c7fa0d7859cd7f7ba95bd472c11e /src/gui/guiFormSpecMenu.cpp
parentd7e706ac9df5e7cead3dd16f91b07bc0d417e234 (diff)
downloadminetest-6cf15cf872cc9ce76990d83d380ca3c4b7485eb1.tar.gz
minetest-6cf15cf872cc9ce76990d83d380ca3c4b7485eb1.tar.bz2
minetest-6cf15cf872cc9ce76990d83d380ca3c4b7485eb1.zip
GUIFormSpecMenu: Add basic element highlighing debug feature (#9423)
Activated using F5
Diffstat (limited to 'src/gui/guiFormSpecMenu.cpp')
-rw-r--r--src/gui/guiFormSpecMenu.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 6a383a791..f3bf04275 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -3380,8 +3380,12 @@ void GUIFormSpecMenu::drawMenu()
bool hovered_element_found = false;
if (hovered != NULL) {
- s32 id = hovered->getID();
+ if (m_show_debug) {
+ core::rect<s32> rect = hovered->getAbsoluteClippingRect();
+ driver->draw2DRectangle(0x22FFFF00, rect, &rect);
+ }
+ s32 id = hovered->getID();
u64 delta = 0;
if (id == -1) {
m_old_tooltip_id = id;
@@ -3903,6 +3907,10 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
(kp == getKeySetting("keymap_screenshot"))) {
m_client->makeScreenshot();
}
+
+ if (event.KeyInput.PressedDown && kp == getKeySetting("keymap_toggle_debug"))
+ m_show_debug = !m_show_debug;
+
if (event.KeyInput.PressedDown &&
(event.KeyInput.Key==KEY_RETURN ||
event.KeyInput.Key==KEY_UP ||