Two ways to do that. If you want a popup like above, simply precede it by a check if the affected player is the active player, that is the player running the script on his pc:
Code:
if gc.getGame().getActivePlayer() == gc.getPlayer(iAffectedPlayer):
Or, perhaps more elegantly and less intrusive, you could display a message in the top-left corner of the screen, like what happens when e.g. a religion spreads:
Code:
button = "[path to some icon you want to use for the arrow pointing to the unit in question]"
CyInterface().addMessage(iAffectedPlayer, False, 0, "Your Unit has been infected", "", 0, button, \
CyGame().getReplayMessageColor(0), affectedUnit.getX(), affectedUnit.getY(), True, True)
If you don't want to bother with arrows and icons and all that:
Code:
CyInterface().addMessage(iAffectedPlayer, False, 0, "Your Unit has been infected", "", 0, "", \
CyGame().getReplayMessageColor(0), 0, 0, False, False)
Bookmarks