more debug menu love
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14677 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
55018ee089
commit
0383a9ec55
@ -533,6 +533,13 @@ void IrrDriver::showPointer()
|
||||
//-----------------------------------------------------------------------------
|
||||
void IrrDriver::hidePointer()
|
||||
{
|
||||
// always visible in artist debug mode, to be able to use the context menu
|
||||
if (UserConfigParams::m_artist_debug_mode)
|
||||
{
|
||||
this->getDevice()->getCursorControl()->setVisible(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_pointer_shown)
|
||||
{
|
||||
m_pointer_shown = false;
|
||||
|
@ -222,7 +222,6 @@ void InputManager::handleStaticAction(int key, int value)
|
||||
kart->setPowerup(PowerupManager::POWERUP_ZIPPER, 10000);
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case KEY_F8:
|
||||
if (UserConfigParams::m_artist_debug_mode && value && world)
|
||||
{
|
||||
@ -246,7 +245,6 @@ void InputManager::handleStaticAction(int key, int value)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_F9:
|
||||
if (UserConfigParams::m_artist_debug_mode && world)
|
||||
{
|
||||
@ -259,7 +257,7 @@ void InputManager::handleStaticAction(int key, int value)
|
||||
kart->setPowerup(PowerupManager::POWERUP_SWATTER, 10000);
|
||||
}
|
||||
break;
|
||||
|
||||
*/
|
||||
case KEY_F10:
|
||||
if(world && value)
|
||||
{
|
||||
@ -269,7 +267,7 @@ void InputManager::handleStaticAction(int key, int value)
|
||||
history->Save();
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
case KEY_F11:
|
||||
if (UserConfigParams::m_artist_debug_mode && value &&
|
||||
control_is_pressed && world)
|
||||
@ -277,7 +275,7 @@ void InputManager::handleStaticAction(int key, int value)
|
||||
world->getPhysics()->nextDebugMode();
|
||||
}
|
||||
break;
|
||||
|
||||
*/
|
||||
case KEY_F12:
|
||||
if(value)
|
||||
UserConfigParams::m_display_fps =
|
||||
|
@ -17,9 +17,10 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "debug.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "karts/controller/controller.hpp"
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "items/powerup_manager.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "physics/irr_debug_drawer.hpp"
|
||||
@ -68,7 +69,8 @@ enum DebugMenuCommand
|
||||
DEBUG_POWERUP_SWATTER,
|
||||
DEBUG_POWERUP_SWITCH,
|
||||
DEBUG_POWERUP_ZIPPER,
|
||||
DEBUG_POWERUP_NITRO
|
||||
DEBUG_POWERUP_NITRO,
|
||||
DEBUG_TOGGLE_GUI
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -121,7 +123,7 @@ bool onEvent(const SEvent &event)
|
||||
mnu->addItem(L"FPS",DEBUG_FPS);
|
||||
mnu->addItem(L"Save replay", DEBUG_SAVE_REPLAY);
|
||||
mnu->addItem(L"Save history", DEBUG_SAVE_HISTORY);
|
||||
|
||||
mnu->addItem(L"Toggle GUI", DEBUG_TOGGLE_GUI);
|
||||
|
||||
|
||||
g_debug_menu_visible = true;
|
||||
@ -318,6 +320,21 @@ bool onEvent(const SEvent &event)
|
||||
AbstractKart* kart = world->getLocalPlayerKart(0);
|
||||
kart->setEnergy(100.0f);
|
||||
}
|
||||
else if (cmdID == DEBUG_TOGGLE_GUI)
|
||||
{
|
||||
World* world = World::getWorld();
|
||||
if (world == NULL) return false;
|
||||
RaceGUIBase* gui = world->getRaceGUI();
|
||||
if (gui != NULL) gui->m_enabled = !gui->m_enabled;
|
||||
|
||||
const int count = World::getWorld()->getNumKarts();
|
||||
for (int n=0; n<count; n++)
|
||||
{
|
||||
AbstractKart* kart = world->getKart(n);
|
||||
if (kart->getController()->isPlayerController())
|
||||
kart->getNode()->setVisible(gui->m_enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false; // event has been handled
|
||||
|
Loading…
x
Reference in New Issue
Block a user