05-29-2013, 04:06 AM
Random Chitchat 2012-2016
|
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.
05-29-2013, 04:36 AM
Oh god i have absolutely no idea how to start ;O
Ugh, I'm still fighting the dropspensers / redstone interaction. I thought I had it, but still there's problems.
Let's hope rev 1525 fixed most of them. There's just an issue that a dropspenser powered by a redstone torch directly next to it won't power down when the torch is removed. I don't think I'm capable of tweaking the redstone simulator that much to actually fix that (05-29-2013, 04:36 AM)STR_Warrior Wrote: Oh god i have absolutely no idea how to start ;O Oh come on, I've even made the first step for you - a first thought about how the plugin code should work. Start there - think about how you want to be able to work with such windows from the Lua code. From there, it'll go all by itself.
05-29-2013, 05:01 AM
Something like this? I'm realy bad in creating such posts ;(
LuaWindow MCServer needs a class open for lua that allows them to create custom windows. For example if you use a command that it will open a window with 9 slots or something. This is the idea i have on how to work with it in Lua but i have no idea if it is possible: function HandleCommand( Split, Player ) Window = cLuaWindow() Window:Create( 9 ) -- Create a window with 9 slots. Item = cItem( E_BLOCK_DEAD_BUSH, 1, 0, 0 ) -- Create a item. It's just an example <-- Window:SetSlot( 1, Item ) -- Set the first slot to the Item /\ Player:OpenWindow( Window ) -- Send the window to the player and let him open it || end Then with the use of a hook, the plugin should know what item the player clicked on.
05-29-2013, 05:14 AM
OK, start a thread with that, I'll add my comments, you'll refine the code, I'll add more comments... Just I don't want this to rot in this all-purpose thread so when I actually start implementing it, I can find it easily.
05-30-2013, 01:09 AM
Why is there the most forum activity just as I'm leaving the computer? Then I have to reply from a phone and spend the whole dance training thinking about the new stuff
05-30-2013, 01:10 AM
I sometimes have that just before a test ;P
05-30-2013, 04:49 PM
Wow, I received an email from a person actually wanting to use ProtoProxy! I didn't write the tool just for me, there's other people out there using it! Oh Yeah!
Pity that the email said it didn't work for them
05-30-2013, 10:22 PM
Inventory painting should be all done, can the testers confirm?
|
« Next Oldest | Next Newest »
|
Users browsing this thread: 109 Guest(s)