diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-08-08 21:39:14 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-08-08 21:39:14 +0200 |
commit | 32d836cb88db783c807c228fa2932ddecc1a8d07 (patch) | |
tree | 0fa82f23c098b2caf2c7996affb0068d499ee4fa /src/Render.cpp | |
parent | Disabled collisions for double plants and flowers (diff) | |
download | AltCraft-32d836cb88db783c807c228fa2932ddecc1a8d07.tar AltCraft-32d836cb88db783c807c228fa2932ddecc1a8d07.tar.gz AltCraft-32d836cb88db783c807c228fa2932ddecc1a8d07.tar.bz2 AltCraft-32d836cb88db783c807c228fa2932ddecc1a8d07.tar.lz AltCraft-32d836cb88db783c807c228fa2932ddecc1a8d07.tar.xz AltCraft-32d836cb88db783c807c228fa2932ddecc1a8d07.tar.zst AltCraft-32d836cb88db783c807c228fa2932ddecc1a8d07.zip |
Diffstat (limited to 'src/Render.cpp')
-rw-r--r-- | src/Render.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Render.cpp b/src/Render.cpp index ae9814d..ea3252c 100644 --- a/src/Render.cpp +++ b/src/Render.cpp @@ -39,6 +39,7 @@ Render::Render(unsigned int windowWidth, unsigned int windowHeight, fieldSensetivity = Settings::ReadDouble("mouseSensetivity", 0.1); fieldVsync = Settings::ReadBool("vsync", false); fieldWireframe = Settings::ReadBool("wireframe", false); + fieldFlight = Settings::ReadBool("flight", false); //Apply settings if (fieldSensetivity != sensetivity) @@ -64,6 +65,7 @@ Render::~Render() { Settings::WriteDouble("mouseSensetivity", fieldSensetivity); Settings::WriteBool("vsync", fieldVsync); Settings::WriteBool("wireframe", fieldWireframe); + Settings::WriteBool("flight", fieldFlight); Settings::Save(); ImGui_ImplSdlGL3_Shutdown(); @@ -567,6 +569,8 @@ void Render::RenderGui() { ImGui::Checkbox("VSync", &fieldVsync); + ImGui::Checkbox("Creative flight", &fieldFlight); + if (ImGui::Button("Apply settings")) { if (fieldDistance != world->MaxRenderingDistance) { world->MaxRenderingDistance = fieldDistance; @@ -576,6 +580,8 @@ void Render::RenderGui() { if (fieldSensetivity != sensetivity) sensetivity = fieldSensetivity; + world->GameStatePtr()->player->isFlying = fieldFlight; + isWireframe = fieldWireframe; timer.SetDelayLength(std::chrono::duration<double, std::milli>(1.0 / fieldTargetFps * 1000.0)); if (fieldVsync) { @@ -625,6 +631,7 @@ void Render::InitEvents() { renderWorld = true; GlobalState::SetState(State::Playing); glClearColor(0, 0, 0, 1.0f); + world->GameStatePtr()->player->isFlying = this->fieldFlight; }); listener.RegisterHandler("ConnectionFailed", [this](const Event& eventData) { |