Easiest way to edit the unit/building format?

jsk119

Chieftain
Joined
Sep 28, 2016
Messages
35
I want similar units/buildings to be lined up in vertical rows I can scroll through. Instead of having to enable/disable stuff like this and have it cluttered. Hopefully even make this interface bigger in the city screen... any ideas?
 

Attachments

  • 2017-05-27-102701_2304x1024_scrot.png
    2017-05-27-102701_2304x1024_scrot.png
    173.3 KB · Views: 73
The drawing code is in CvMainInterface.py starting at line 1387
PHP:
# Units to construct
    for i in range ( g_NumUnitClassInfos ):
        eLoopUnit = gc.getCivilizationInfo(pHeadSelectedCity.getCivilizationType()).getCivilizationUnits(i)

        if (pHeadSelectedCity.canTrain(eLoopUnit, False, True)):
            szButton = gc.getPlayer(pHeadSelectedCity.getOwner()).getUnitButton(eLoopUnit)
            screen.appendMultiListButton( "BottomButtonContainer", szButton, iRow, WidgetTypes.WIDGET_TRAIN, i, -1, False )
            screen.show( "BottomButtonContainer" )
                       
            if ( not pHeadSelectedCity.canTrain(eLoopUnit, False, False) ):
                screen.disableMultiListButton( "BottomButtonContainer", iRow, iCount, szButton)
                       
            iCount = iCount + 1
            bFound = True
This is then repeated for buildings and wonders.

Looks like it draws horizontal rows, meaning what you can do is to add more rows, but if you want to draw vertically, then you better have some python coding skills and need to search the python API for proper functions, or handle button placement completely manually, meaning you set x,y for each.
 
I was actually just hoping someone would have made a city screen editor app.

Don't have the luxurious calm required to spend weeks or months in programming to get it the way I want.
 
What I think you want is to assign a category to each unit. Next make a loop outside the code pasted here, which loops the categories. Each iteration will then only display the units in the category in question, meaning you get one horizontal row with category 0, one for 1, one for 2 etc. Repeat for buildings and wonders.

Add a category (int) tag to xml and expose the get function for it to python.

I think that's the best compromise between what you say you want and coding difficulty. The next question is if it already exist or if you can make it yourself or convince somebody else to code it.
 
Back
Top Bottom