LuaWindow class
#3
(05-29-2013, 06:00 AM)xoft Wrote: Ok, some notes:
- Client expects a window type with the "OpenWindow" packet, which specifies the UI to show and the number of slots. The types are listed in the cWindow class: cWindow::Inventory, cWindow::Chest, cWindow::Anvil ...)
- We could pack the Window:Create into the object constructor:
Window = cLuaWindow(cWindow.Chest, 3 * 9);  -- Create a chest window with 27 slots, besides the player inventory

That does look a lot better.

xoft Wrote:- MCServer windows are sectioned into SlotAreas. One SlotArea services a groupd of slots of a similar function, such as the armor slots or the crafting grid. It would be wise to use the same distinction for Lua (so that the player inventory can be handled automatically by the server)

Yes it would be smart to make the normal window and the LuaWindow look like each other. Also grouping the slots would be much more manageable.

xoft Wrote:- Hooks are more suited for global callbacks. The window callbacks are more local, so consider using an approach already used for commands - pass in a function which is to be called when something happens:
Window:SetOnSlotChange(MyOnSlotChangeFunction);
Window:SetOnWindowClose(MyOnWindowCloseFunction);

Yes i was thinking if there maybe was a better way to do it but I didn't know about anything. That idea of yours looks like the best solution to me Wink

xoft Wrote:- Should it be possible to reuse the window object once the player closes it?
- Should it be possible to pass the same window object to more different players?

They can put it in a variable or a table i think?
Reply
Thanks given by:


Messages In This Thread
LuaWindow class - by NiLSPACE - 05-29-2013, 05:20 AM
RE: LuaWindow class - by xoft - 05-29-2013, 06:00 AM
RE: LuaWindow class - by NiLSPACE - 05-29-2013, 07:21 AM
RE: LuaWindow class - by xoft - 05-29-2013, 07:20 PM
RE: LuaWindow class - by NiLSPACE - 05-29-2013, 11:41 PM
RE: LuaWindow class - by xoft - 05-29-2013, 11:53 PM
RE: LuaWindow class - by NiLSPACE - 05-30-2013, 12:04 AM
RE: LuaWindow class - by xoft - 05-30-2013, 12:23 AM
RE: LuaWindow class - by NiLSPACE - 05-30-2013, 12:28 AM
RE: LuaWindow class - by NiLSPACE - 05-30-2013, 03:50 AM
RE: LuaWindow class - by xoft - 05-30-2013, 04:58 PM
RE: LuaWindow class - by xoft - 05-30-2013, 10:25 PM
RE: LuaWindow class - by xoft - 05-31-2013, 02:22 AM
RE: LuaWindow class - by FakeTruth - 05-31-2013, 03:05 AM
RE: LuaWindow class - by xoft - 05-31-2013, 04:37 AM
RE: LuaWindow class - by FakeTruth - 05-31-2013, 05:10 AM
RE: LuaWindow class - by xoft - 05-31-2013, 05:48 AM
RE: LuaWindow class - by NiLSPACE - 05-31-2013, 06:37 AM
RE: LuaWindow class - by xoft - 05-31-2013, 06:43 AM
RE: LuaWindow class - by xoft - 05-31-2013, 05:21 PM
RE: LuaWindow class - by NiLSPACE - 06-01-2013, 01:29 AM
RE: LuaWindow class - by xoft - 06-01-2013, 03:34 AM
RE: LuaWindow class - by NiLSPACE - 06-01-2013, 03:58 AM
RE: LuaWindow class - by xoft - 06-01-2013, 06:20 PM
RE: LuaWindow class - by NiLSPACE - 06-02-2013, 12:28 AM
RE: LuaWindow class - by bearbin - 06-02-2013, 12:43 AM
RE: LuaWindow class - by NiLSPACE - 06-02-2013, 12:46 AM
RE: LuaWindow class - by xoft - 06-02-2013, 02:31 AM
RE: LuaWindow class - by NiLSPACE - 06-02-2013, 02:34 AM
RE: LuaWindow class - by xoft - 06-02-2013, 07:13 AM
RE: LuaWindow class - by xoft - 06-02-2013, 07:29 PM
RE: LuaWindow class - by bearbin - 06-02-2013, 08:40 PM
RE: LuaWindow class - by xoft - 06-02-2013, 08:44 PM
RE: LuaWindow class - by xoft - 06-03-2013, 08:00 AM



Users browsing this thread: 6 Guest(s)