[Spout] Show Inventory made with InventoryBuilder on Popup screen?

Discussion in 'Plugin Development' started by r3Fuze, Oct 28, 2011.

Thread Status:
Not open for further replies.
  1. I'm not sure if this is even possible but I'll give it a try.
    I've created an Inventory with this code:
    Code:java
    1. Inventory inv = SpoutManager.getInventoryBuilder().construct(player.getInventory().getContents(), "My awesome inventory!");

    player is just a regular Player.
    Now the problem is showing the screen to the player because I dont wan't it to show up like a normal Inventory, I'd rather attach it to a GenericPopup I made. I doubt it's possible to just attach it straight away, my guess is you have to make a for loop like
    Code:java
    1. for(ItemStack itemstack : inv.getContents()) {
    2. // DO stuff
    3. }

    and for each itemstack you'd create a Button and an ItemWidget and do some stuff with those.
    So if anyone has a quick solution for this or have some time leftover to try and create something like it, then I'd be glad :)
     
  2. Offline

    coldandtired

    How complicated it is depends on how many itemstacks you're talking about, and whether you want them to appear in specific positions. Basically , though, you fill a popup with the widgets you want, then attach the popup to the main screen.

    @r3Fuze
     
Thread Status:
Not open for further replies.

Share This Page