1
0

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
This commit is contained in:
madmaxoft@gmail.com
2013-05-31 07:16:14 +00:00
parent 2eb1240e14
commit bf7c2fe783
6 changed files with 90 additions and 8 deletions

View File

@@ -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);