Python Performance and Interface Overhaul (PPIO)

The complex UI element called "Table" that is created and handled within the exe does not support a horizontal scroll-bar, there is not much that can be customized about it within python really.

I am playing with the idea of creating a python class to be used to easily create tables that are made up of many small and simple UI elements without having to write lot's of code every time such a table is needed.
It would allow much of the table functionality to be held within python, but it's a big project so it will take time to make.
The build queue is a simple example of a table handled mostly within python.
Would https://www.swharden.com/wp/2010-03-03-viewing-large-images-with-scrollbars-using-python-tk-and-pil/ help?
 
I like new full screen domestic advisor. But one little problem I see: gold production is missing (not rate, but gold produced by city)
 
I found another bug in domestic advisor. When clicking on the icon just left to name of city (an icon that takes you to that city screen) I always get this Python error:

Traceback (most recent call last):

File "CvScreensInterface", line 1086, in handleInput

File "CvDomesticAdvisor", line 1800, in handleInput

AttributeError: CvDomesticAdvisor instance has no attribute 'CyPlayer'
ERR: Python function handleInput failed, module CvScreensInterface
 
PPIO v0.5.9.6.5.4 ▬ Hotfix
SVN rev.10213
  • Fixed error with the jump to city functionality within the domestic advisor screen.
PPIO v0.5.9.6.5.5
SVN rev.10213
  • Cities can now be renamed within the domestic advisor screen.
  • A technical change makes it necessary to delete the customDomestic folder within usersettings yet again. I'm sorry.
PPIO v0.5.9.6.5.6
SVN rev.10213
  • Fixed building icons misalignment in the table headers of domestic advisor screen.
  • Tweaked the rename popup window layout.
 
Last edited:
Foreign Advisor is broken.
Spoiler :

Civ4BeyondSword 2018-10-20 09-29-21-51.jpg


This foreign screen could list resources you have and resources you don't have but are Revealed by techs you have.
Code:
Traceback (most recent call last):

  File "CvScreensInterface", line 1086, in handleInput

  File "CvMainInterface", line 5440, in handleInput

  File "CvScreensInterface", line 129, in showForeignAdvisorScreen

  File "CvExoticForeignAdvisor", line 330, in interfaceScreen

  File "CvExoticForeignAdvisor", line 352, in drawContents

  File "CvExoticForeignAdvisor", line 1208, in drawResourceDeals

IndexError: list index out of range
ERR: Python function handleInput failed, module CvScreensInterface
 
I haven't changed much code for the foreign advisor screen yet, I think this error might exist without my modmod too.

The code for this screen is a total mess, I will have to rewrite it completely, a lot of work...

PPIO v0.5.9.6.6.alpha
SVN rev.10213
  • Overhauled the relation and glance tabs within the foreign advisor screen.
  • Glance and Glance Change have been merged into one tab.
  • Glance tab can scroll in both directions.
  • Performance for the two tabs have been optimized quite a bit, they should be instantaneous even on an 20 year old CPU now, and a lot less caching is happening within the screen and outside as well.
  • I call it an alpha because there are some bad graphical glitches when switching from Tech and Resource tabs to other tabs.
    • It's not game breaking so I decided to release a new version for broader testing and feedback of the two tabs I overhauled.
 
@Toffer90 there is such thing as artstyles.

Can you add ability to change artstyles in pedia?
It could be somewhere at unit/building preview.
It's not possible to change artstyles from python, perhaps in the dll, but for now the artstyles are pretty much set in stone by the XML.

I can make the pedia display what artstyle a civilization uses within the civilization pages.
 
SVN 10223 - PPIO alpha - Started GEM map with Mongolia.

I got this error upon entering domestic advisor:

Traceback (most recent call last):

File "CvScreensInterface", line 133, in showDomesticAdvisor

File "CvDomesticAdvisor", line 532, in interfaceScreen

File "CvDomesticAdvisor", line 572, in drawScreen

File "CvDomesticAdvisor", line 1398, in drawContents

KeyError: 'cityName'
ERR: Python function showDomesticAdvisor failed, module CvScreensInterface
 
I got this error upon entering domestic advisor:
File "CvDomesticAdvisor", line 1398, in drawContents
KeyError: 'cityName'
A question before I start debugging:
Did you delete your custom domestic folder within UserSettings when updating from v0.5.9.6.5.4 to a newer version like I said was nessesarry in the changelog for v0.5.9.6.5.5?​
 
Last edited:
Ok I deleted it and now I don't get python errors in domestic advisor. I think I updated from 0.5.9.6.5.4 and I missed the intermediate updates.

There's a glitch anyway. Icons of techs being researched by other civs are still in screen when you open city screen.

Inverse shift on queue still broken. known issue or forgotten?
 
There's a glitch anyway. Icons of techs being researched by other civs are still in screen when you open city screen.

Inverse shift on queue still broken. known issue or forgotten?
Inverse shift issue is known, not forgotten.

PPIO v0.5.9.6.6.1.alpha
SVN rev.10213
  • Overhauled the "Active" tab within foreign advisor screen.
  • Fixed a tech icon issue in the scoreboard.
  • Fixed an interface issue when changing resolution.
PPIO v0.5.9.6.6.2
SVN rev.10213
  • Some tweaks to foreign advisor, mostly in the resource tab.
  • Known glitches in foreign advisor are now fixed, hence the removal of the alpha denotation.
 
Last edited:
Reproduceable Bug: When I add some unitis with shift to my build list I then can't close the unit building window with ESC any more. (changing to a other build window or alt tab out of the game fix this)
I use Steam CIV-IV under Win 10 home and using your Beta Build with C2C 10224 SVN version
 
PPIO v0.5.9.6.7
SVN rev.10213
  • Overhauled the resource tab within the foreign advisor screen.
  • Fix - flag widget on the left of the minimap disappearing once in a while
  • Fix - City naming trouble.
 
Last edited:
Ok, I'll see if it's fixable.

PPIO v0.5.9.6.7
SVN rev.10213
  • Overhauled the resource tab within the foreign advisor screen.
  • Fix - flag widget on the left of the minimap disappearing once in a while
  • Fix - City naming trouble.
This also fix the bug I reported? If not here some more things I found out about this bug:
When you hit return after adding some units with shift one of this unit also added at the 1st slot of your production list.
if you not clear this unit in the "cache" the mousewheel don't work in the main map.
 
Back
Top Bottom