Python Performance and Interface Overhaul (PPIO)

Checked in game, and right-clicking on the buttons in the city screen that add units and buildings to the build queue does open the pedia as it should.
Perhaps you mistyped something or were too unspecific for me to understand what you meant.
I'll clean up python folder - there might be old files lingering.

Those work now.
But it doesn't work on things, that aren't currently buildable.

Spoiler :

Civ4BeyondSword 2018-08-05 16-18-00-55.jpg
Civ4BeyondSword 2018-08-05 16-18-05-69.jpg



That is buildings/units, that can't be built now because of missing prereqs.
 
Last edited:
Okay setImageButtonAt seems to work quite a bit better, but the parent panels don't seem to realize that the child controls are there, and do not allow scrolling/ still auto sizing to fix BottomButtonContainer. My current structure is

BottomButtonContainer -> UnitContainer -> ImageButtons
-> BuildingContainer -> ImageButtons.​

Any suggestions?
 
addPanel(Vertical layout) → attachPanelAt(Horizontal layout) → setImageButtonAt()
attachPanelAt(Horizontal layout) → setImageButtonAt()​
 
Last edited:
I think its Horizontal not Horisontal :p
Depends on what language I meant the word to be in, it is spelled "horisontal" in Norwegian. ^^

PPIO v0.5.9.5.3 ▬ C2C v38.5 edition
  • Technical update mostly, I isolated the tooltip coding into its own python file and made it easier to access it from other scripts than just the CvMainInterface.py python file.
  • Unit Pedia pages now use my tooltip for the "upgrades to" unit buttons.
  • Slight improvement in pedia link coding performance, fixed a pedia bug related to using back and forward in very specific cases involving the usage of links between BtS Concepts and C2C concepts sub-categories.
 
@Toffer90 any changes to MainInterface.py file? Should I update?


Also, tried attachPanelAt, but it never seems to work. The 2 child panels aren't visible. Code looks like


screen.attachPanelAt("BottomButtonContainer", "unit_panel", "", "", False, True, PanelStyles.PANEL_STYLE_STANDARD, 0, 0, w, 60, WidgetTypes.WIDGET_TRAIN, -1, -1)
 
Last edited:
@Toffer90 any changes to MainInterface.py file? Should I update?


Also, tried attachPanelAt, but it never seems to work. The 2 child panels aren't visible. Code looks like


screen.attachPanelAt("BottomButtonContainer", "unit_panel", "", "", False, True, PanelStyles.PANEL_STYLE_STANDARD, 0, 0, w, 60, WidgetTypes.WIDGET_TRAIN, -1, -1)
Yes update your CvMainInterface file, don't worry, I didn't touch anything you are working on.

Try making the top parent a ScrollPanel.
 
Okay I'll give it a try. Unfortunately, my cpu cooler crapped out yesterday. Gonna take about 2-3 days to get parts to fix. So I'll be out for a bit :P
 
Scrollpanel actually works better. I see the icons layed out properly. Unfortunately, seems to only scroll horizontally, not vertically :(
 
Scrollpanel actually works better. I see the icons layed out properly. Unfortunately, seems to only scroll horizontally, not vertically :(
Scrollpanel scroll in both directions when I use it...

PPIO v0.5.9.5.3.1

  • Updated for SVN Rev.10134 support.
  • Added the new tooltip to more elements inside unit pedia pages
@makotech222: No change to CvMainInterface.py. Added a new ScrollPanel style that can be applied with the function:
screen.setStyle(szName, "ScrollPanel_Alt_Style") ▬ szName is the name of the Scroll Panel UI element.​
It has very thin and un-intrusive scroll bars, the scroll bars are the only visible graphic for the ScrollPanel UI element.
 
Last edited:
A question: there are lots of python files with 0 size in your modmod. Are their functions erased, or moved elsewhere?

Possible bug: in version 0.5.9.3, when I opened pedia from buildable options in city screen to see a culture, C2C_Dahomey for example, the link to "Dahomey" (resource that let's you see cultural units unlocked) don't work.
 
A question: there are lots of python files with 0 size in your modmod. Are their functions erased, or moved elsewhere?

Possible bug: in version 0.5.9.3, when I opened pedia from buildable options in city screen to see a culture, C2C_Dahomey for example, the link to "Dahomey" (resource that let's you see cultural units unlocked) don't work.
Links are kinda broken for now - sometimes pedia gets confused if two things have same ingame name.
 
A question: there are lots of python files with 0 size in your modmod. Are their functions erased, or moved elsewhere?
Moved elsewhere.
Possible bug: in version 0.5.9.3, when I opened pedia from buildable options in city screen to see a culture, C2C_Dahomey for example, the link to "Dahomey" (resource that let's you see cultural units unlocked) don't work.
I'll look into it, I might have broken it in my second last update. Did the link work before?

PPIO v0.5.9.5.3.2 ▬ Hotfix
  • Fixed link malfunctions with ambiguous links.
PPIO v0.5.9.5.4
  • Added the new tooltip to stuff within Unit and Building pedia pages.
  • Made it possible to go through the pedia list (not category and sub category) by clicking up/down arrow or the "w"/"s" keyboard buttons.
 
Last edited:
Heres a pretty decent first edition of the build menu. Has some problems though:

1. Redraw causes the scroll bar to reset to top.
2. As more buildings are added to queue, it starts to slow down again. Not sure where its happening.
3. No way to disable 'Unbuildable' buildings.

Let me know what you think.
 

Attachments

Heres a pretty decent first edition of the build menu. Has some problems though:

1. Redraw causes the scroll bar to reset to top.
2. As more buildings are added to queue, it starts to slow down again. Not sure where its happening.
3. No way to disable 'Unbuildable' buildings.

Let me know what you think.
1. Might be fixed by not redrawing, but instead moving the buttons.
2. I see.
3. That should be possible without a multilist, but I guess you meant that it simply isn't implemented yet.

I'll have a look at it when I have time.
 
Well the multilist has the function to disable a multilist button. Don't know how'd we implement that for ImageButton.
 
You could try:
enableSelect(szName, False)
or
enable(szName, False)

Both functions exist, I'm not sure what they are meant for though.

An alternative would be to give the buttons that cannot be selected the WIDGET_GENERAL and place a large red X symbol above the button. We could still give it a tooltip and a "jump to pedia" right click function.
 
Last edited:
Okay version 2.0

Fixes redrawing scroll bar; Position is maintained upon clicking button.
Fixes showing disabled buttons. Thanks for tip, Toffer.

I'd say its a good replacement now for the default civ4 build panel. There's some good improvements that can now be made using this as a base. Those will probably require me to head into the dll/python interface and figure out how to pass data around, so it may take a little while before next changes.
 

Attachments

I'm going to be making some changes to the dll for some new features. I'd like to merge my python changes to master. I think i only touch the updateSelectionButtons method. Do you think it will be safe to do?
 
Back
Top Bottom