Jump to content

UI Frustrations, please help!


Buggi

Recommended Posts

I've been messing around with the UI and I've run into a weird issue. I can't seem to get the title bar for this storage crate to shrink down. I've gone through all the windows, controls, and styles and cannot figure out what is causing this. I have a similar issue with the minibike storage.

 

Anyone out there with a few tips. I also did a search around for UI tips/tricks/tutorials and found nothing. I know there are some great UI mods, and I've been working on customizing one (The PZHUD). But this issue is really bugging me.

 

20180517025947_1.jpg.43f7e1b87d34ffdc4e965ccb1b9b0e46.jpg

 

Here's the code for that window:

 

<window name="S420windowLooting" width="328" height="378" controller="LootWindow" panel="Left" anchor_side="bottomright" visible="false" cursor_area="true" >
	<panel name="header" height="43" depth="0" disableautobackground="true">
		<sprite depth="1" name="headerbackground" sprite="ui_game_panel_header"/>
		<button depth="3" name="btnSort" style="icon32px, press, hover" pivot="center" pos="21,-21" sprite="ui_game_symbol_loot_sack" tooltip_key="lblSortContainer" sound="[paging_click]" />
		<label depth="2" name="lootName" pos="39,-6" width="172" height="32" text="LOOT" text_key="xuiLoot" font_size="32" />

		<label depth="2" name="takeAllLabel" width="32" height="30" font_size="30" color="[mediumGrey]" justify="left" pos="260,-8"/>

		<sprite depth="2" name="takeAllIcon" style="icon32px" sprite="ui_game_symbol_hand" color="[mediumGrey]" pos="220, -4"/>
	</panel>
	<sprite depth="0" name="gridBackground" color="255,255,255,1" type="sliced" pos="0, 0" globalopacity="true" on_press="true" />
	<rect name="content" pos="3,-49" >
		<grid depth="12" name="queue" rows="14" cols="12" cell_width="50" cell_height="50" repeat_content="true" controller="LootContainer">
			<Small_Item_Stack name="0"/>
		</grid>
	</rect>
</window>

 

What does the "depth" value represent?!? The game seems to ignore my width and height settings.

Link to comment
Share on other sites

Hi, the depth value decides where your UI element is drawn. Think of it as layers, where a background can have a set value and everything with a higher value is drawn on top of said background whereas everything with a lower value is drawn behind.

 

When it comes to that particular window you will have to do some dll editing to change the grid sizes as there is a hard coded value that multiply the value by 75 which is the standard grid size.

 

So for instance if you want to make a window with a grid size of 60 that is 10 by 10 large you will need to multiply 10 by 60 to make it fit but the hard coded value multiply 10 by 75.

 

That feature is unique to that window and my guess is it is because the window is dynamic and change with the different loot containers and stuff.

Link to comment
Share on other sites

Yeah, you can find the values to change in XUiC_LootWindow under SetTileEntityChest.

 

There you will find this line:

Vector2i one = new Vector2i(this.MMZ.GetContainerSize().x * 75, this.MMZ.GetContainerSize().y * 75);

 

Change the two 75 values to whichever grid size you are using and it should resolve the issue.

Link to comment
Share on other sites

Yeah, I don't want to get into DLL injection or editing at this time.

 

From what I understand, Alpha 17 will have a totally new UI system. So all bets are off on what customization will be available at that time. I am hopeful that they axe any hard-coded values, that's for sure.

 

Thank you for your responses. I would have spent countless hours trying to figure this out had you not come in and told me it's hard-coded. I settled on 12x12 storage space, with a cell size of 62. I still have a little bit of the header poking out, but at least everything fits on the screen now.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...