summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua_options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src/mlua_options.cpp')
-rw-r--r--plugins/MirLua/src/mlua_options.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp
index 3c2dade81b..226a925fd9 100644
--- a/plugins/MirLua/src/mlua_options.cpp
+++ b/plugins/MirLua/src/mlua_options.cpp
@@ -1,12 +1,11 @@
#include "stdafx.h"
-CMLuaOptions::CMLuaOptions()
+CMLuaOptions::CMLuaOptions(CMLua *mLua)
: CPluginDlgBase(g_plugin, IDD_OPTIONS, MODULENAME),
- isScriptListInit(false),
+ m_mLua(mLua), isScriptListInit(false),
m_popupOnError(this, IDC_POPUPONERROR),
m_popupOnObsolete(this, IDC_POPUPONOBSOLETE),
- m_scripts(this, IDC_SCRIPTS),
- m_reload(this, IDC_RELOAD)
+ m_scripts(this, IDC_SCRIPTS), m_reload(this, IDC_RELOAD)
{
CreateLink(m_popupOnError, "PopupOnError", DBVT_BYTE, 1);
CreateLink(m_popupOnObsolete, "PopupOnObsolete", DBVT_BYTE, 1);
@@ -17,7 +16,7 @@ CMLuaOptions::CMLuaOptions()
void CMLuaOptions::LoadScripts()
{
- for (auto &script : g_plugin.Scripts) {
+ for (auto &script : m_mLua->Scripts) {
wchar_t *fileName = NEWWSTR_ALLOCA(script->GetFileName());
int iIcon = script->GetStatus() - 1;
int iItem = m_scripts.AddItem(fileName, iIcon, (LPARAM)script);
@@ -125,7 +124,7 @@ void CMLuaOptions::OnReload(CCtrlBase*)
{
isScriptListInit = false;
m_scripts.DeleteAllItems();
- g_plugin.Reload();
+ m_mLua->Reload();
LoadScripts();
isScriptListInit = true;
}