mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 07:02:23 +01:00
Disallow formspec debug if the player does not have the debug privilege (#14753)
This commit is contained in:
parent
fac9aac821
commit
fe6da3a16b
@ -1914,6 +1914,10 @@ void Game::updateDebugState()
|
|||||||
if (!has_debug) {
|
if (!has_debug) {
|
||||||
draw_control->show_wireframe = false;
|
draw_control->show_wireframe = false;
|
||||||
m_flags.disable_camera_update = false;
|
m_flags.disable_camera_update = false;
|
||||||
|
auto formspec = m_game_ui->getFormspecGUI();
|
||||||
|
if (formspec) {
|
||||||
|
formspec->setDebugView(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// noclip
|
// noclip
|
||||||
|
@ -4184,8 +4184,10 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
|||||||
m_client->makeScreenshot();
|
m_client->makeScreenshot();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.KeyInput.PressedDown && kp == getKeySetting("keymap_toggle_debug"))
|
if (event.KeyInput.PressedDown && kp == getKeySetting("keymap_toggle_debug")) {
|
||||||
m_show_debug = !m_show_debug;
|
if (!m_client || m_client->checkPrivilege("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 ||
|
||||||
|
@ -223,6 +223,11 @@ public:
|
|||||||
m_allowclose = value;
|
m_allowclose = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setDebugView(bool value)
|
||||||
|
{
|
||||||
|
m_show_debug = value;
|
||||||
|
}
|
||||||
|
|
||||||
void lockSize(bool lock,v2u32 basescreensize=v2u32(0,0))
|
void lockSize(bool lock,v2u32 basescreensize=v2u32(0,0))
|
||||||
{
|
{
|
||||||
m_lock = lock;
|
m_lock = lock;
|
||||||
|
Loading…
Reference in New Issue
Block a user