This is getting too exciting, I'm gonna do this
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.
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.