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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user