From 2eb1240e14986e1cccc02a96713133a003347f8b Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 30 May 2013 20:40:43 +0000 Subject: Added the OnClosing callback to cLuaWindow API git-svn-id: http://mc-server.googlecode.com/svn/trunk@1534 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/LuaWindow.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/LuaWindow.h') diff --git a/source/LuaWindow.h b/source/LuaWindow.h index c474fa1ab..30c07bdbf 100644 --- a/source/LuaWindow.h +++ b/source/LuaWindow.h @@ -58,6 +58,12 @@ public: /// Returns true if SetLuaRef() has been called bool IsLuaReferenced(void) const; + /// Sets the callback function (Lua reference) to call when the window is about to close + void SetOnClosing(cPlugin_NewLua * a_Plugin, int a_FnRef); + + /// Sets the callback function (Lua reference) to call when a slot is changed + void SetOnSlotChanged(cPlugin_NewLua * a_Plugin, int a_FnRef); + protected: /// Contents of the non-inventory part cItemGrid m_Contents; @@ -68,7 +74,14 @@ protected: /// The Lua object reference, used for keeping the object alive as long as any player has the window open int m_LuaRef; + /// The Lua reference for the callback to call when the window is closing for any player + int m_OnClosingFnRef; + + /// The Lua reference for the callback to call when a slot has changed + int m_OnSlotChangedFnRef; + // cWindow overrides: + virtual bool ClosedByPlayer(cPlayer & a_Player) override; virtual void Destroy(void) override; } ; // tolua_export -- cgit v1.2.3