UnitSelected Pane ( Reformat? )

Balderstrom

Emperor
Joined
Oct 25, 2007
Messages
1,141
Location
Halifax, NS, Canada
I've gotten the unittype removed from renamed units.
Posted into Request for new features thread.

What I'm trying to do is reformat the text area, but I'm running into a standstill with trying to move the location of the promotions.
The textual changes are easy enough.
Here is a mocked up screenshot.
UnitSelectedPane_idea.jpg


( Sorry for the new thread Alerum :-)

Could post into the modding forum, just this is a BUG change...so...

I've tried about 3 or 4 different methods, they either screw up unit selection, dump the whole MainInterface or just don't display promotions at all. Obviously not what I intended hehe.
 
Don't mind new threads like this as much as ones that are "I can't get this to work!" ones.:p

Are you running into a problem trying to get them to go horizontally from vertical?
 
Well it uses a function to place them. that function appears to be hardcoded. So thats of no use. So then I perused the Sevopaedia - since that uses the small versions of promotions as well as large - but I can't really tell what is being used there to print out the promotions.

The other thing I tried was to place another panel in the same area, only make it tall enough for 1 icon, and the in-built function would have to place them side by side - but I can't get that panel to show up... which makes me think perhaps only one panel can have the same coordinates.

Honestly I'm stumped.

The only other idea I looked into, beyond those varied attempts. Was to see how the tool (info) screens for Units work, but I can't seem to locate those.
... Since they list unit promotions horizontally as well.

Basically I really hate the promotions over on the side, they almost always block the unit graphic, and with the fully promoted units - covers it completely.

As well having "Strength" and all the word labels there, is mostly redundant :-)
 
I'm having a hard time understanding exactly that the problems you're having are (just a common language issue). Can you post some code snippets of what's not working. What is the hard-coded function of which you speak?

If by "tool (info) screens for units" you mean the hover pane for a unit, that text is generated by the DLL, not in Python. However, PLE generates its own hover pane in Python, so you could use that for some sample code. The promotions are displayed as buttons -- not as text.

It looks like it creates a button for every promotion type and keeps them hidden. When a unit is hovered over, it shows the buttons for the promotions the unit has and moves them into the correct position.

PHP:
# handles the display of the unit's info pane
def showUnitInfoPane(self, id):
	... end of this function ...
	# show promotion buttons
	iTemp = 0
	for i in range(gc.getNumPromotionInfos()):
		if pUnit.isHasPromotion(i):
			szName = self.PLE_PROMO_BUTTONS_UNITINFO + str(i)
			self.displayUnitInfoPromoButtonPos( szName, iTemp, dy-1*self.CFG_INFOPANE_PIX_PER_LINE_1 )
			screen.show( szName )
			iTemp += 1

# displays the unit's promotion buttons in the info pane. They are not part of the info pane.
def displayUnitInfoPromoButtonPos( self, szName, iPromotionCount, yOffset ):
	self.bUnitPromoButtonsActive = true
	screen = CyGInterfaceScreen( "MainInterface", CvScreenEnums.MAIN_INTERFACE )
	if ( CyInterface().getShowInterface() == InterfaceVisibility.INTERFACE_SHOW ):
		y = self.CFG_INFOPANE_Y
	else:
		y = self.CFG_INFOPANE_Y2
	screen.moveItem( szName, BugPle.getInfoPaneX() + 4 + (self.CFG_INFOPANE_BUTTON_SIZE * (iPromotionCount % self.CFG_INFOPANE_BUTTON_PER_LINE)), \
							 y + 4 - yOffset + (self.CFG_INFOPANE_BUTTON_SIZE * (iPromotionCount / self.CFG_INFOPANE_BUTTON_PER_LINE)), -0.3 )
	screen.moveToFront( szName )
 
Actually you could free up some space by only showing the most recent promotion of a promotion line. For example: If a unit has Combat IV and CR III, only those promotions are shown and not the whole line from Combat I - III and CR I + II. This is how FfH2 does it. I like it !
 
Wouldn't it be that much more difficult to differentiate units at a glance, if similiar promotions were not displayed?
A CR:1,2, and 3 unit, will all look the same, until your mind registers level differences et al. Whereas with all 3 promotions showing, the units are Visually different.
 
@Balderstrom:

As regular FfH2 player I can tell you: No, it's not confusing or difficult. But alerum's suggestion has its charm too :) !
 
Back
Top Bottom