mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 15:12:23 +01:00
GUIFormSpecMenu: Add basic element highlighing debug feature (#9423)
Activated using F5
This commit is contained in:
parent
d7e706ac9d
commit
6cf15cf872
@ -3380,8 +3380,12 @@ void GUIFormSpecMenu::drawMenu()
|
|||||||
bool hovered_element_found = false;
|
bool hovered_element_found = false;
|
||||||
|
|
||||||
if (hovered != NULL) {
|
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;
|
u64 delta = 0;
|
||||||
if (id == -1) {
|
if (id == -1) {
|
||||||
m_old_tooltip_id = id;
|
m_old_tooltip_id = id;
|
||||||
@ -3903,6 +3907,10 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
|||||||
(kp == getKeySetting("keymap_screenshot"))) {
|
(kp == getKeySetting("keymap_screenshot"))) {
|
||||||
m_client->makeScreenshot();
|
m_client->makeScreenshot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.KeyInput.PressedDown && kp == getKeySetting("keymap_toggle_debug"))
|
||||||
|
m_show_debug = !m_show_debug;
|
||||||
|
|
||||||
if (event.KeyInput.PressedDown &&
|
if (event.KeyInput.PressedDown &&
|
||||||
(event.KeyInput.Key==KEY_RETURN ||
|
(event.KeyInput.Key==KEY_RETURN ||
|
||||||
event.KeyInput.Key==KEY_UP ||
|
event.KeyInput.Key==KEY_UP ||
|
||||||
|
@ -343,6 +343,7 @@ private:
|
|||||||
u16 m_formspec_version = 1;
|
u16 m_formspec_version = 1;
|
||||||
std::string m_focused_element = "";
|
std::string m_focused_element = "";
|
||||||
JoystickController *m_joystick;
|
JoystickController *m_joystick;
|
||||||
|
bool m_show_debug = false;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool explicit_size;
|
bool explicit_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user