Slight improvement when selling goods

Dertuek

Chieftain
Joined
Aug 5, 2008
Messages
55
Location
France
Hello,
When we sell goods with a wagon unit, the goods are still displayed in the unit info panel (bottom left). It's refreshed only when we change the selected unit.

You can force a refresh by adding at the end of doSellBonus in PAE_Trade.py :

Code:
CyInterface().setDirty(InterfaceDirtyBits.InfoPane_DIRTY_BIT, True)
 
I learned by reading civ4 code. But I already knew other (easier) programming languages.
 
oh wow thx again Dertuek! those small upgrades are very useful!!

does this also work with the unit overlay promotion icon, when a unit can be promoted? so can this be included into the eventmanager under onUnitPromoted() ?
 
ok, when a unit can be promoted (BTS unit promotions), the unit button (main interface) has an overlay icon in form of two arrow heads (similar to the symbol of a sergeant).
when I know promote the unit and don't switch to another unit, I still see the overlay icon.

but never mind, you helped me much with the code for PAE_Trade, I can now test it on my own
 
OK
In this case, you can use:
Code:
    def onUnitPromoted(self, argsList):
        'Unit Promoted'
        pUnit, iPromotion = argsList

        if not self.__LOG_UNITPROMOTED:
            player = PyPlayer(pUnit.getOwner())
            CvUtil.pyPrint('Unit Promotion Event: %s - %s' %(player.getCivilizationName(), pUnit.getName(),))

        CyInterface().setDirty(InterfaceDirtyBits.PlotListButtons_DIRTY_BIT, True)
 
Top Bottom