diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-05-30 22:40:43 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-05-30 22:40:43 +0200 |
commit | 2eb1240e14986e1cccc02a96713133a003347f8b (patch) | |
tree | 28c58a677423d507ab57e421b9fcb8df8b31c5e0 /MCServer | |
parent | Window contents are sent whenever the window is opened by a player. (diff) | |
download | cuberite-2eb1240e14986e1cccc02a96713133a003347f8b.tar cuberite-2eb1240e14986e1cccc02a96713133a003347f8b.tar.gz cuberite-2eb1240e14986e1cccc02a96713133a003347f8b.tar.bz2 cuberite-2eb1240e14986e1cccc02a96713133a003347f8b.tar.lz cuberite-2eb1240e14986e1cccc02a96713133a003347f8b.tar.xz cuberite-2eb1240e14986e1cccc02a96713133a003347f8b.tar.zst cuberite-2eb1240e14986e1cccc02a96713133a003347f8b.zip |
Diffstat (limited to 'MCServer')
-rw-r--r-- | MCServer/Plugins/Debuggers/Debuggers.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index 076cec9ca..484ea88be 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -580,8 +580,17 @@ function HandleTestWndCmd(a_Split, a_Player) return true;
end
+ -- Test out the OnClosing callback's ability to refuse to close the window
+ local attempt = 1;
+ local OnClosing = function(Window, Player)
+ Player:SendMessage("Window closing attempt #" .. attempt);
+ attempt = attempt + 1;
+ return (attempt <= 3); -- refuse twice, then allow
+ end
+
local Window = cLuaWindow(WindowType, WindowSizeX, WindowSizeY, "TestWnd");
Window:SetSlot(a_Player, 0, cItem(E_ITEM_DIAMOND, 64));
+ Window:SetOnClosing(OnClosing);
a_Player:OpenWindow(Window);
|