EmperorFool
Deity
Things I would try for experimentation:
Prove it's not your graphics
1. Pull out a single button for a known vanilla building outside the loop into a variable and use that inside the loop instead of accessing your building.
1a. If that goes much quicker, check getButton() vs. using the button. With the same code, insert one line:
1b. If that is slow again, check getButton() vs. getBuildingInfo(). Again, modifying the same code:
1c. If that is slow, something is amiss with accessing the building. If it's fast again, getButton() is slow.
Hide control, add buttons, show
If 1a doesn't speed it up, the buttons aren't the problem. Perhaps adding each button causes the screen to call update()? This could be slow if RevDCM adds slow code to CvMainInterface.update() (or updateScreen() or whatever it's called).
Try hiding the control before adding all the buttons and showing it at the end.
I think there's a call to show() inside the loop. Remove it.
Report back everything you find for each step, and hopefully we can figure out what's happening.
Prove it's not your graphics
1. Pull out a single button for a known vanilla building outside the loop into a variable and use that inside the loop instead of accessing your building.
Code:
[B]szButton = gc.getBuildingInfo(0).getButton()[/B]
for ...
screen.appendMultiListButton( "BottomButtonContainer", [B]szButton[/B], ...)
1a. If that goes much quicker, check getButton() vs. using the button. With the same code, insert one line:
Code:
[B]gc.getBuildingInfo(eLoopBuilding).getButton()[/B]
screen.appendMultiListButton(...)
1b. If that is slow again, check getButton() vs. getBuildingInfo(). Again, modifying the same code:
Code:
[B]gc.getBuildingInfo(eLoopBuilding)[/B]
screen.appendMultiListButton(...)
1c. If that is slow, something is amiss with accessing the building. If it's fast again, getButton() is slow.
Hide control, add buttons, show
If 1a doesn't speed it up, the buttons aren't the problem. Perhaps adding each button causes the screen to call update()? This could be slow if RevDCM adds slow code to CvMainInterface.update() (or updateScreen() or whatever it's called).
Try hiding the control before adding all the buttons and showing it at the end.
Code:
screen.hide("BottomButtonContainer")
for ...
...
screen.show("BottomButtonContainer")
I think there's a call to show() inside the loop. Remove it.
Report back everything you find for each step, and hopefully we can figure out what's happening.