summaryrefslogtreecommitdiffstats
path: root/src/Render.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-02-17 17:24:52 +0100
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-04-21 12:55:48 +0200
commita2fd708de4ede7427589125e680f3fb339926f4e (patch)
tree75faed7c12a7898e435cf9f40e1ca3af85ca06ec /src/Render.cpp
parentMinor lua-api improvement (diff)
downloadAltCraft-a2fd708de4ede7427589125e680f3fb339926f4e.tar
AltCraft-a2fd708de4ede7427589125e680f3fb339926f4e.tar.gz
AltCraft-a2fd708de4ede7427589125e680f3fb339926f4e.tar.bz2
AltCraft-a2fd708de4ede7427589125e680f3fb339926f4e.tar.lz
AltCraft-a2fd708de4ede7427589125e680f3fb339926f4e.tar.xz
AltCraft-a2fd708de4ede7427589125e680f3fb339926f4e.tar.zst
AltCraft-a2fd708de4ede7427589125e680f3fb339926f4e.zip
Diffstat (limited to '')
-rw-r--r--src/Render.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Render.cpp b/src/Render.cpp
index cf108e4..f86e5ec 100644
--- a/src/Render.cpp
+++ b/src/Render.cpp
@@ -14,6 +14,7 @@
#include "RendererWorld.hpp"
#include "Settings.hpp"
#include "Framebuffer.hpp"
+#include "Plugin.hpp"
Render::Render(unsigned int windowWidth, unsigned int windowHeight,
std::string windowTitle)
@@ -71,7 +72,9 @@ Render::~Render() {
Settings::WriteDouble("brightness", fieldBrightness);
Settings::WriteDouble("resolutionScale", fieldResolutionScale);
Settings::Save();
-
+
+ PluginSystem::Init();
+
framebuffer.reset();
ImGui_ImplSdlGL3_Shutdown();
SDL_GL_DeleteContext(glContext);
@@ -717,13 +720,25 @@ void Render::InitEvents() {
switch (GlobalState::GetState()) {
case State::Playing:
SetMouseCapture(true);
+ PluginSystem::CallOnChangeState("Playing");
break;
case State::InitialLoading:
+ PluginSystem::CallOnChangeState("InitialLoading");
+ break;
case State::MainMenu:
+ PluginSystem::CallOnChangeState("MainMenu");
+ break;
case State::Loading:
+ PluginSystem::CallOnChangeState("Loading");
+ break;
case State::Paused:
+ PluginSystem::CallOnChangeState("Paused");
+ break;
case State::Inventory:
+ PluginSystem::CallOnChangeState("Inventory");
+ break;
case State::Chat:
+ PluginSystem::CallOnChangeState("Chat");
SetMouseCapture(false);
break;
}