Shortening Width of Advanced Setup Dropdown Boxes

Barathor

Emperor
Joined
May 7, 2011
Messages
1,202
I'm trying to shorten the width of the Advanced Setup dropdown boxes on the right side so my new option titles fit properly to the left of them.



I tried adding the Lua and XML file of AdvancedSetup to a mod, with my small edits to the XML file, and it didn't seem to do anything.

I added the Lua file as an InGameUIAddon.
I set "Import to VS" to true for both.
Also, I've read that as long as the XML file shares the same name as the Lua, it'll automatically by imported as well.

How can I get this small tweak to work? I don't have any experience with UI modding.

- - - - - -

Also, I assume these were the places I needed to edit:

(Also, I'm assuming L and T stand for Left and Top when anchoring... so I can either increase the offset by how much I shrink the box, or I can set the offset to 0 and set the anchor to R,T... correct?)

For all additional dropdown options:
Code:
<Instance Name="DropDownOptionInstance">
	<Container Anchor="[COLOR="red"][B]L,T[/B][/COLOR]" Size="[COLOR="Red"][B]450[/B][/COLOR],32" Offset="[COLOR="red"][B]20[/B][/COLOR],0" ID="DropDownOptionRoot">
		<Label Anchor="L,C" ColorSet="Beige_Black" Style="FontNormal20" FontStyle="Shadow" ID="OptionName"/>
		<PullDown Style="GenericPullDown" ScrollThreshold="400" Offset="[COLOR="red"][B]150[/B][/COLOR],0" Size="[COLOR="Red"][B]300[/B][/COLOR],27" SpaceForScroll="0" ID="OptionDropDown"/>
	</Container>
</Instance>

For the default dropdown options, so they match:
Code:
<Stack ID="DropDownOptionsStack"	Anchor="L,T" Offset="0,3" Padding="0" StackGrowth="Bottom" >
	
	<Container Anchor="L,T" Size="450,32" Offset="20,0">
		<Label Anchor="L,C" ColorSet="Beige_Black" Style="FontNormal20" FontStyle="Shadow" String="TXT_KEY_AD_SETUP_MAP_TYPE" />
		<PullDown Style="GenericPullDown" ScrollThreshold="400" Offset="150,0" Size="300,27" SpaceForScroll="0" ID="MapTypePullDown"/>
	</Container>

	<Container Anchor="L,T" Size="450,32" Offset="20,0">
		<Label Anchor="L,C" ColorSet="Beige_Black" Style="FontNormal20" FontStyle="Shadow" String="TXT_KEY_AD_SETUP_MAP_SIZE" />
		<PullDown Style="GenericPullDown" ScrollThreshold="400" Offset="150,0" Size="300,27" SpaceForScroll="0" ID="MapSizePullDown"/>
	</Container>

	<Container Anchor="L,T" Size="450,32" Offset="20,0">
		<Label Anchor="L,C" ColorSet="Beige_Black" Style="FontNormal20" FontStyle="Shadow" String="TXT_KEY_AD_SETUP_MAP_TERRAIN" />
		<PullDown Style="GenericPullDown" ScrollThreshold="400" Offset="150,0" Size="300,27" SpaceForScroll="0" ID="MapTerrainPullDown"/>
	</Container>

	<Container Anchor="L,T" Size="450,32" Offset="20,0">
		<Label Anchor="L,C" ColorSet="Beige_Black" Style="FontNormal20" FontStyle="Shadow" String="TXT_KEY_AD_SETUP_HANDICAP" />
		<PullDown Style="GenericPullDown" ScrollThreshold="400" Offset="150,0" Size="300,27" SpaceForScroll="0" ID="HandicapPullDown"/>
	</Container>

	<Container Anchor="L,T" Size="450,32" Offset="20,0">
		<Label Anchor="L,C" ColorSet="Beige_Black" Style="FontNormal20" FontStyle="Shadow" String="TXT_KEY_AD_SETUP_GAME_SPEED" />
		<PullDown Style="GenericPullDown" ScrollThreshold="400" Offset="150,0" Size="300,27" SpaceForScroll="0" ID="GameSpeedPullDown"/>
	</Container>

</Stack>

For the seeding options, so they match as well:
Code:
<Container Anchor="L,T" Size="450,32" Offset="20,0">
	<Label Anchor="L,C" ColorSet="Beige_Black" Style="FontNormal20" FontStyle="Shadow" String="TXT_KEY_COLONISTS" />
	<PullDown ID="SelectColonists" Style="GenericPullDown" ScrollThreshold="400" Offset="150,0" Size="300,27" />
</Container>
<Container Anchor="L,T" Size="450,32" Offset="20,0">
	<Label Anchor="L,C" ColorSet="Beige_Black" Style="FontNormal20" FontStyle="Shadow" String="TXT_KEY_SPACECRAFT" />
	<PullDown ID="SelectSpacecraft" Style="GenericPullDown" ScrollThreshold="400" Offset="150,0" Size="300,27" />
</Container>
<Container Anchor="L,T" Size="450,32" Offset="20,0">
	<Label Anchor="L,C" ColorSet="Beige_Black" Style="FontNormal20" FontStyle="Shadow" String="TXT_KEY_CARGO" />
	<PullDown ID="SelectCargo" Style="GenericPullDown" ScrollThreshold="400" Offset="150,0" Size="300,27" />
</Container>
 
I'd have to dive into the original XML to really check your work, but just off hand. Did you check all the parent xml elements the DropDownOptionInstance will be added to?

I'm quickly double-checking my Virtue Menu mod. I don't add the lua file to the ingameui addin. I only import it, and it automatically overrides the existing file. I do import both the lua and xml.
 
lilgamefreek said:
I'd have to dive into the original XML to really check your work, but just off hand. Did you check all the parent xml elements the DropDownOptionInstance will be added to?

I just did a search for it throughout the UI files, and there's only other instances of it in multiplayer files, which I'm not concerned about (that is, if I don't have to be).

Within the file, it looks like it's a child of <Grid> with an ID = "MainGrid".

lilgamefreek said:
I'm quickly double-checking my Virtue Menu mod. I don't add the lua file to the ingameui addin. I only import it, and it automatically overrides the existing file. I do import both the lua and xml.

I'll have to check it out.

I was originally going by some of this.
 
The tutorial you're going off of is likely talking specifically about new UI elements. Modifying existing ones shouldn't require InGameUIAddin (and if experience serves me correctly, can actually really mess things up such as causing the popup to open/trigger twice).

I took a look at the original file. Is the xml you posted in the OP meant to be modified or unmodified? i can't find any differences between the two.
 
The XML I posted above are unmodified versions and where I assume I need to modify values to shorten the bar width.
 
Top Bottom