When adding a specialist to a building, how to make the new specialist appear in the clicked slot?

cvm00der

Chieftain
Joined
Jun 30, 2018
Messages
5
And not in the rightmost slot regardless of the slot clicked on? I'm creating a mod and having trouble finding how to do this or even where in the code to find where the game decides to magically produce the specialist in the first slot to the right.
 
If anyone happens to be interested, I found the solution. For the longest time I was thinking that there's something in the lua where if you click to add a specialist, it moves them over all the way to the right in the building and highlights them. Really, it's just a matter of the ordering of the buttons in CityView.xml (and CityView_small.xml), where the BuildingFilledSpecialistSlots are all listed before all the BuildingEmptySpecialistSlots. When clicking on a specialist, the lua enables the FilledSpecialist button and hides the EmptySpecialist button, which by virtue of the ordering in the xml means the filled button will be before all the other empty buttons.

To change this, I simply intertwined the two types of buttons, so I have BuildingEmpty...1, then BuildingFilled..1, then BuildingEmpty...2, etc. So if you click on a specialist to enable him, he stays put and doesn't shift over. super helpful for what i've been working on, so I'm glad I figured this out.
 
just be aware that overriding the two CityView xml files will make your mod incompatible with other "major" mods that change the UI
 
just be aware that overriding the two CityView xml files will make your mod incompatible with other "major" mods that change the UI

Yeah, I figure. I've been messing around all over so I figure my mod will probably work no more than about 0 mods right now unfortunately. I'll see about compatibility later on, though I'm more concerned with the dll because I don't want to have to play against the vanilla ai.
 
Back
Top Bottom