From bf7c2fe783133cd9f15d96981053ef7ab6aaf49a Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 31 May 2013 07:16:14 +0000 Subject: Added cLuaWindow:SetOnSlotChanged(); the callback is called only for non-inventory slots git-svn-id: http://mc-server.googlecode.com/svn/trunk@1535 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Debuggers/Debuggers.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'MCServer') diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index 484ea88be..f35e2d2de 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -588,9 +588,15 @@ function HandleTestWndCmd(a_Split, a_Player) return (attempt <= 3); -- refuse twice, then allow end + -- Log the slot changes + local OnSlotChanged = function(Window, SlotNum) + LOG("Window \"" .. Window:GetWindowTitle() .. "\" slot " .. SlotNum .. " changed."); + end + local Window = cLuaWindow(WindowType, WindowSizeX, WindowSizeY, "TestWnd"); Window:SetSlot(a_Player, 0, cItem(E_ITEM_DIAMOND, 64)); Window:SetOnClosing(OnClosing); + Window:SetOnSlotChanged(OnSlotChanged); a_Player:OpenWindow(Window); -- cgit v1.2.3