Don't show menubar by default, use to toggle it

This commit is contained in:
Phillip Stephens 2021-05-30 18:44:02 -07:00
parent 45097955a7
commit 201d5c5423
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
4 changed files with 7 additions and 18 deletions

View File

@ -1113,12 +1113,17 @@ void ImGuiConsole::PreUpdate() {
g_StateManager->SetActiveRandomToDefault();
}
if (ImGui::IsKeyReleased('`')) {
m_isVisible ^= 1;
}
if (m_stepFrame) {
g_Main->SetPaused(true);
m_stepFrame = false;
}
bool canInspect = g_StateManager != nullptr && g_StateManager->GetObjectList();
ShowAppMainMenuBar(canInspect);
if (m_isVisible) {
ShowAppMainMenuBar(canInspect);
}
if (canInspect && (m_showInspectWindow || !inspectingEntities.empty())) {
UpdateEntityEntries();
if (m_showInspectWindow) {

View File

@ -57,6 +57,7 @@ private:
bool m_paused = false;
bool m_stepFrame = false;
bool m_isVisible = false;
bool m_inspectActiveOnly = false;
bool m_inspectCurrentAreaOnly = false;

View File

@ -73,8 +73,6 @@ private:
State m_state = State::Closed;
CVar* m_conSpeed;
CVar* m_conHeight;
float m_cachedConSpeed;
float m_cachedConHeight;
bool m_showCursor = true;
float m_cursorTime = 0.f;

View File

@ -30,13 +30,6 @@ Console::Console(CVarManager* cvarMgr) : m_cvarMgr(cvarMgr), m_overwrite(false),
registerCommand(
"getCVar", "Prints the value stored in the specified Console Variable", "<cvar>",
[this](Console* console, const std::vector<std::string>& args) { m_cvarMgr->getCVar(console, args); });
m_conSpeed = cvarMgr->findOrMakeCVar("con_speed",
"Speed at which the console opens and closes, calculated as pixels per second",
1.f, hecl::CVar::EFlags::System | hecl::CVar::EFlags::Archive);
m_conHeight = cvarMgr->findOrMakeCVar("con_height",
"Maximum absolute height of the console, height is calculated from the top of "
"the window, expects values ranged from [0.f,1.f]",
0.5f, hecl::CVar::EFlags::System | hecl::CVar::EFlags::Archive);
}
void Console::registerCommand(std::string_view name, std::string_view helpText, std::string_view usage,
@ -188,14 +181,6 @@ void Console::init(boo::IWindow* window) {
}
void Console::proc() {
if (m_conHeight->isModified()) {
m_cachedConHeight = float(m_conHeight->toReal());
}
if (m_conSpeed->isModified()) {
m_cachedConSpeed = float(m_conSpeed->toReal());
}
if (m_state == State::Opened) {
fmt::print(FMT_STRING("\r{} "), m_commandString);
fflush(stdout);