Updated due to 1.5 and with refined code after further experimentation and work. (Note, the XML code will now give you a 10 slot, single row inventory and no longer uses a "dummy field".)
XML Layout File
Notes: Initially Batch appeared to hide the container name and button. That doesnt appear to be the vase anymore. CollapseLayout=false forced items to overlap/space to collapse (ex. container slots would overlap labels)
<?xmlversion="1.0"encoding="utf-8"standalone="yes"?><Desc><Frametype="InventoryContainer"name="GameUI/UIContainer/ConsoleUIContainer/InventoryPanel"file="GameUI"><!-- top/left required @ min & 0 for correct icon cursor positioning --><Anchorside="Top"relative="$parent"pos="Min"offset="0"/><Anchorside="Left"relative="$parent"pos="Min"offset="0"/><!-- end --><!-- Use bottom and right for positioning. --><!-- Use Right mid to center, and positive offset = 1/2 width of bar --> <Anchorside="Right"relative="$parent"pos="Mid"offset="425"/><Anchorside="Bottom"relative="$parent"pos="Max"offset="80"/><Frametype="InventoryContainer"name="InventoryButtons"><!-- Hide the open/close button "6 slot main" --> <Frametype="CommandButton"name="Button00"><Heightval="0"/></Frame></Frame><Frametype='InventoryContainer'name='ContainerPanel00'><!-- Hide the container icon --><Frametype="CommandButton"name="Button"><Visibleval="false"/></Frame><!-- hide the close button (in container) --><Frametype="Button"name="Close"><Visibleval="false"/></Frame><!-- hide the label --><Frametype="Label"name="Name"><Visibleval="false"/></Frame><Frametype="Image"name="BackgroundImage"><Visibleval="false"/><Anchorside="Top"relative="$parent"pos="Min"offset="0"/><Anchorside="Left"relative="$parent"pos="Min"offset="0"/><Anchorside="Right"relative="$parent"pos="Max"offset="0"/><Anchorside="Bottom"relative="$parent"pos="Max"offset="0"/></Frame><Frametype="CommandButton"name="Slot00"><Widthval="80"/><Heightval="80"/></Frame><Frametype="CommandButton"name="Slot01"><Widthval="80"/><Heightval="80"/></Frame><Frametype="CommandButton"name="Slot02"><Widthval="80"/><Heightval="80"/></Frame><Frametype="CommandButton"name="Slot03"><Widthval="80"/><Heightval="80"/></Frame><Frametype="CommandButton"name="Slot04"><Widthval="80"/><Heightval="80"/></Frame><Frametype="CommandButton"name="Slot05"><Widthval="60"/><Heightval="60"/><Anchorside="Left"relative="$parent/Slot04"pos="Max"offset="5"/><Frametype="Image"name="InventoryWeaponsImage"><Textureval="##InventoryWeapons"/><TextureTypeval="Normal"/><Tiledval="false"/><Anchorrelative="$parent"/></Frame></Frame><Frametype="CommandButton"name="Slot06"><Widthval="60"/><Heightval="60"/><Frametype="Image"name="InventoryArmorImage"><Textureval="##InventoryArmor"/><TextureTypeval="Normal"/><Tiledval="false"/><Anchorrelative="$parent"/></Frame></Frame><Frametype="CommandButton"name="Slot07"><Anchorside="Left"relative="$parent/Slot06"pos="Max"offset="0"/><Widthval="60"/><Heightval="60"/><Frametype="Image"name="InventoryEnergyImage"><Textureval="##InventoryEnergy"/><TextureTypeval="Normal"/><Tiledval="false"/><Anchorrelative="$parent"/></Frame></Frame><Frametype="CommandButton"name="Slot08"><Anchorside="Top"relative="$parent/Slot00"pos="Min"offset="0"/><Anchorside="Left"relative="$parent/Slot07"pos="Max"offset="0"/><Widthval="60"/><Heightval="60"/></Frame><Frametype="CommandButton"name="Slot09"><Widthval="60"/><Heightval="60"/></Frame></Frame></Frame></Desc>
with inventory bags you mean those buttons which can contain either bags which you can open or items:
<Frame type='InventoryContainer' name='GameUI/UIContainer/ConsoleUIContainer/InventoryPanel/InventoryButtons' file='GameUI'>
That is the frame which contains these buttons. Buttons are named Button00 through Button05.
for exact notation per button you can use this site of mine. just hit ctrl+f on it and type inventorybuttons, and you'll find the notations.
Do the buttons of the hookup work as expected? I've done something like that before but back then the hookup functionality did not exist yet. and you could not use items that were listed in the frame. but you could use them if you opened up the inventory the normal way.
Edit: just saw the post in the general forum. it seems that the functionality is available. nice :)
@Helral: Go
No, I meant actual inventory containers. The ones with 64 slots. The 6 slot InventoryButtons is hidden and only has 1 slot used in this example for the container. BTW Thanks for the epic xml listing. I've been using that the last 3 days trying to figure out xml. Couldn't have done it without it.
The hookup doesn't exactly work as expected.
By hooking up the panel, I gain controls over the hookup and the original UI panel, allowing me to show/hide it via dialog commands.
- Show/Hide dialog item "Container" will show both the dialog item hookup, and the original UI container (woot! opening inventories through commands)
- The Dialog Item wont work like a normal inventory. It'll look like the default, but it wont respond to clicks.
- The Dialog item will not read any UI XML edits.
What I've done is edit the default UI XML, and used the dialog hookup command as a means of repositioning the default UI some and then ordering it to show. What you're seeing is the default UI. All dialogs that its tied into are hidden. I hope that makes sense.
Edit: Oh NOW he posts his code, 5 hours after I figure this out. lol.
@Fullachain: Go
Yes, actually the code I pasted was a updated version which has all inventory slots the same size. We basically fake the hookup, make the first container button HUGE, and then hide it out of the container with negative positioning. The inventory container is the size of the largest button *8 (so in this case, we make the first button 240, then adjust with -238 to hide). That makes the container big enough to accomidate 9 buttons with a size of 80. If you decreased the button size down to 70 you could probably fit 10 or 11. If you increased the first button size to around 300 you could probably fit 14+ on a single row.
If you want the default look, (2 rows of 8) you dont have to do anything but increase the size of the buttons to what you desire (and remove the little XML snippet that repositions Slot07 next to Slot06)
Using this method, I see no problems in designing whatever type/size of inventory you want. The only downside to this method is you lose 1 slot per container (which leaves you with a total of 378 workable inventory slots.
I'm trying to get this to work well with window re-sizing and without weirdness with offscreen buttons. For the inventory panel, why do you need to specify a height and width when you already have anchors? I would like everything to be relative, so is there a way around this?
p.s. For any other noobs trying to figure this out, note that (0,0) is in the UPPER LEFT of the screen. This fooled me for a while. That means that when specifying anchors for Top and Bottom, 'min' and 'max' probably mean the opposite of what you expect.
I'm trying to get this to work well with window re-sizing and without weirdness with offscreen buttons. For the inventory panel, why do you need to specify a height and width when you already have anchors? I would like everything to be relative, so is there a way around this?
p.s. For any other noobs trying to figure this out, note that (0,0) is in the UPPER LEFT of the screen. This fooled me for a while. That means that when specifying anchors for Top and Bottom, 'min' and 'max' probably mean the opposite of what you expect.
Update to keep it center:
Remove the width/height (no its not really needed unless you absolutely want it a specific size regardless of resizing
Set Right and Left pos to "mid"
set the value to -300 for both. This should center it.
As well, if unable to help there, can you publish the map file of this to a download site? Right now every time I even copy the exact code, (I must be doing something differently) I get an error of the following.
' UIFrame [...] in frame [GameUI] is not a type of [CButton]'
Trying other methods (a lot of them) I've just got straight crashes.
Make sure youre adding a new layout file via the GUI and pasting the code there, and not trying to use the override method, which is outdated. The UI module can be access by pressing shirt+F6.
Please do it as soon as you can, i am planning on doing a lot of programming this coming Saturday and i would really appreciate having it by then<sub>,</sub>
Sorry to bring back this old post, but can someone explain to me how to implement this system? For example, where do I put this code, and how do I have to have the inventory set up for this to work?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Updated due to 1.5 and with refined code after further experimentation and work. (Note, the XML code will now give you a 10 slot, single row inventory and no longer uses a "dummy field".)
Container slot images [Fixing empty faces] (courtesy Kueken)
Triggers: Thanks to Renee for the early information (See General Thread about Patch 1.5 UI)
XML Layout File Notes: Initially Batch appeared to hide the container name and button. That doesnt appear to be the vase anymore. CollapseLayout=false forced items to overlap/space to collapse (ex. container slots would overlap labels)
@ckSynergy: Go
with inventory bags you mean those buttons which can contain either bags which you can open or items:
<Frame type='InventoryContainer' name='GameUI/UIContainer/ConsoleUIContainer/InventoryPanel/InventoryButtons' file='GameUI'>
That is the frame which contains these buttons. Buttons are named Button00 through Button05.
for exact notation per button you can use this site of mine. just hit ctrl+f on it and type inventorybuttons, and you'll find the notations.
Do the buttons of the hookup work as expected? I've done something like that before but back then the hookup functionality did not exist yet. and you could not use items that were listed in the frame. but you could use them if you opened up the inventory the normal way.
Edit: just saw the post in the general forum. it seems that the functionality is available. nice :)
Is it possible to get those last 3 the same size as basic inventory?
@Helral: Go No, I meant actual inventory containers. The ones with 64 slots. The 6 slot InventoryButtons is hidden and only has 1 slot used in this example for the container. BTW Thanks for the epic xml listing. I've been using that the last 3 days trying to figure out xml. Couldn't have done it without it.
The hookup doesn't exactly work as expected. By hooking up the panel, I gain controls over the hookup and the original UI panel, allowing me to show/hide it via dialog commands. - Show/Hide dialog item "Container" will show both the dialog item hookup, and the original UI container (woot! opening inventories through commands) - The Dialog Item wont work like a normal inventory. It'll look like the default, but it wont respond to clicks. - The Dialog item will not read any UI XML edits.
What I've done is edit the default UI XML, and used the dialog hookup command as a means of repositioning the default UI some and then ordering it to show. What you're seeing is the default UI. All dialogs that its tied into are hidden. I hope that makes sense.
Edit: Oh NOW he posts his code, 5 hours after I figure this out. lol.
@Fullachain: Go Yes, actually the code I pasted was a updated version which has all inventory slots the same size. We basically fake the hookup, make the first container button HUGE, and then hide it out of the container with negative positioning. The inventory container is the size of the largest button *8 (so in this case, we make the first button 240, then adjust with -238 to hide). That makes the container big enough to accomidate 9 buttons with a size of 80. If you decreased the button size down to 70 you could probably fit 10 or 11. If you increased the first button size to around 300 you could probably fit 14+ on a single row.
If you want the default look, (2 rows of 8) you dont have to do anything but increase the size of the buttons to what you desire (and remove the little XML snippet that repositions Slot07 next to Slot06)
Using this method, I see no problems in designing whatever type/size of inventory you want. The only downside to this method is you lose 1 slot per container (which leaves you with a total of 378 workable inventory slots.
DO you have a map for this? I prefer to sniff all the stuff inside rather than just read the criminal report.
Go play Antioch Chronicles Remastered!
Also, coming soon, Antioch Episode 3: Thoughts in Chaos!
Dont like mapster's ugly white? Try Mapster's Classic Skin!
@Alevice: Go
If you're looking for a map to dig into, Id recommend looking at renee's http://www.sc2mapster.com/forums/general/general-chat/40030-1-5-ui-stuff-demo-1-control-built-in-ui-stuff-with
If you want to recreate the 9 slot inventory, the code above is there for you.
I'm trying to get this to work well with window re-sizing and without weirdness with offscreen buttons. For the inventory panel, why do you need to specify a height and width when you already have anchors? I would like everything to be relative, so is there a way around this?
p.s. For any other noobs trying to figure this out, note that (0,0) is in the UPPER LEFT of the screen. This fooled me for a while. That means that when specifying anchors for Top and Bottom, 'min' and 'max' probably mean the opposite of what you expect.
Update to keep it center: Remove the width/height (no its not really needed unless you absolutely want it a specific size regardless of resizing Set Right and Left pos to "mid" set the value to -300 for both. This should center it.
I've updated the main code with cleaner code, more improvements, and more descriptive comments in the XML.
Hey JPNyt,
I've tried incorporating this method to frequent errors and crashing, I wonder if you could check out this question.
http://www.sc2mapster.com/forums/development/gui/40939-creating-a-new-non-game-ui-panel-and-linking-a-dialog/
As well, if unable to help there, can you publish the map file of this to a download site? Right now every time I even copy the exact code, (I must be doing something differently) I get an error of the following.
' UIFrame [...] in frame [GameUI] is not a type of [CButton]'
Trying other methods (a lot of them) I've just got straight crashes.
@megabuster33:
Make sure youre adding a new layout file via the GUI and pasting the code there, and not trying to use the override method, which is outdated. The UI module can be access by pressing shirt+F6.
Adding the needed code to your example map, doesn't actually produce this result.
Is there not a working example available?
@megabuster33: Go
I havent had time to make a full example map. The one attached is for inventory images. I'll see if I can make one in the next few days.
Thanks, got what I needed.
Can we get the example map that was used in making the 10 slot across inventory shown in the first picture? and not just the second one?
Sure. When I get a chance I'll upload one.
Thanks!
Please do it as soon as you can, i am planning on doing a lot of programming this coming Saturday and i would really appreciate having it by then<sub>,</sub>
Sorry to bring back this old post, but can someone explain to me how to implement this system? For example, where do I put this code, and how do I have to have the inventory set up for this to work?