Forgive me if this is an obvious question; I'm new to Civ4 modding and Python, but I'm an experienced C++ coder. I'm trying to make a "modal" popup in python to get a user response. For instance, a popup saying "Are you SURE you want to declare war on Mao?" (for instance, when you alt-click on a score in the main interface), with a "Yes" and a "No" button. I know how to create the popup using PyPopup and PyPopup.addButton(), .launch(), etc. but I cannot figure out how to determine what the user actually clicked. It seems that the PyPopup.launch() displays the popup as "modal", but where does the response get recorded?
I've tried using CyPopupInfo and making a new callback function. I can then properly process the user's selection, but the addPopup(player) command queues the popup. I need it to be displayed NOW! So, if the user is in e.g. the foreign advisor, the popup immediately shows up and the response is immediately processed.
Any code samples, pointers to mods that implement this, etc. would be great. Thanks!
I've tried using CyPopupInfo and making a new callback function. I can then properly process the user's selection, but the addPopup(player) command queues the popup. I need it to be displayed NOW! So, if the user is in e.g. the foreign advisor, the popup immediately shows up and the response is immediately processed.
Any code samples, pointers to mods that implement this, etc. would be great. Thanks!