From a2fd708de4ede7427589125e680f3fb339926f4e Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 17 Feb 2019 21:24:52 +0500 Subject: Refactored lua-api --- src/Render.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/Render.cpp') 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; } -- cgit v1.2.3