All the windows MCServer implements are tied tightly with the entities that they represent, so there's no way of separating them reasonably.
What we *could*, theoretically, do, is to make a Lua-only window class that will interact specifically with the plugins, nothing else. This could actually work. The plugin creates a cWindowLua, says that the client window type is cWindow::Anvil, for example, then it adds a few cSlotAreaLua object to handle the actual slot areas and sets their contents, and finally calls a cWindowLua:OpenForPlayer(). The window will then process the clicks and a hook function will be called for each slot manipulation, as well as window closing.
OK, guys, I challenge you. Start a new thread, write a reasonable "documentation" for the API, together with a commented plugin code sample usage. If you manage that, I promise to implement it.
I recommend looking at the source/UI/Window.h and source/UI/SlotArea.h header files, to see how windows are currently implemented in C++, that might give you an idea of how to do this.
What we *could*, theoretically, do, is to make a Lua-only window class that will interact specifically with the plugins, nothing else. This could actually work. The plugin creates a cWindowLua, says that the client window type is cWindow::Anvil, for example, then it adds a few cSlotAreaLua object to handle the actual slot areas and sets their contents, and finally calls a cWindowLua:OpenForPlayer(). The window will then process the clicks and a hook function will be called for each slot manipulation, as well as window closing.
OK, guys, I challenge you. Start a new thread, write a reasonable "documentation" for the API, together with a commented plugin code sample usage. If you manage that, I promise to implement it.
I recommend looking at the source/UI/Window.h and source/UI/SlotArea.h header files, to see how windows are currently implemented in C++, that might give you an idea of how to do this.