LuaWindow class
#11
This is getting too exciting, I'm gonna do this Smile

Trouble. There are conceptually two different kinds of windows: private and shared. Private means that each player gets their own contents, for example the crafting table. Shared means that all players share the same contents, for example a chest.
If we allow the same cLuaWindow object to be used by two different players, do they get a Private, or Shared type?

Another point of view on this is where to store the actual window contents. If it's in the cLuaWindow object itself, then the only viable option is the Shared type. If we wanted to do Private type, we'd need to store the contents in the cPlayer object for each player. However, that would mean that whenever a cLuaWindow is created, it would need to be bound to a specific player from the beginning, because it would need to create that contents object for that player. Also, we couldn't have multiple window objects "prepared in the background" for the same player at the same time, because their contents could be incompatible in size. Not to mention that currently the cItemGrid class used for remembering the contents doesn't support resizing once it's created. It's technically possible, but feels bulky.

So I'm inclined to implement the Shared type, and if the plugins want something like the Private type, they'll need to create a new cLuaWindow object for each player.

A new neato idea for a plugin - we could make a plugin that would allow users to "link" to each other's inventory - each would receive a chest-like window where the top part is shared between them, so one can put items there and the other can take them, or vice versa.
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: 1 Guest(s)