client/app: KEY_F9: Toggle Urho3D's debug HUD
This commit is contained in:
parent
ba42488bf8
commit
23a0df2d19
@ -21,6 +21,8 @@
|
|||||||
#include <GraphicsEvents.h> // E_SCREENMODE
|
#include <GraphicsEvents.h> // E_SCREENMODE
|
||||||
#include <IOEvents.h> // E_LOGMESSAGE
|
#include <IOEvents.h> // E_LOGMESSAGE
|
||||||
#include <Log.h>
|
#include <Log.h>
|
||||||
|
#include <DebugHud.h>
|
||||||
|
#include <XMLFile.h>
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <lua.h>
|
#include <lua.h>
|
||||||
@ -288,6 +290,12 @@ struct CApp: public App, public magic::Application
|
|||||||
throw AppStartupError(ss_()+"Failed to load and run extension "+extname);
|
throw AppStartupError(ss_()+"Failed to load and run extension "+extname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create debug HUD
|
||||||
|
magic::ResourceCache *magic_cache = GetSubsystem<magic::ResourceCache>();
|
||||||
|
magic::DebugHud *dhud = GetSubsystem<magic::Engine>()->CreateDebugHud();
|
||||||
|
dhud->SetDefaultStyle(magic_cache->GetResource<magic::XMLFile>(
|
||||||
|
"UI/DefaultStyle.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_update(magic::StringHash event_type, magic::VariantMap &event_data)
|
void on_update(magic::StringHash event_type, magic::VariantMap &event_data)
|
||||||
@ -331,6 +339,10 @@ struct CApp: public App, public magic::Application
|
|||||||
log_e(MODULE, "Failed to load and run extension %s", cs(extname));
|
log_e(MODULE, "Failed to load and run extension %s", cs(extname));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(key == Urho3D::KEY_F9){
|
||||||
|
magic::DebugHud *dhud = GetSubsystem<magic::Engine>()->CreateDebugHud();
|
||||||
|
dhud->ToggleAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_screenmode(magic::StringHash event_type, magic::VariantMap &event_data)
|
void on_screenmode(magic::StringHash event_type, magic::VariantMap &event_data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user