generating advisor popup

Putmalk

Deity
Joined
Sep 26, 2010
Messages
2,652
Location
New York
How do I generate an advisor popup similar to "You can now build a Writer's Guild!" etc.
 
I'm assuming you mean from C++

Code:
CvPopupInfo kPopupInfo(BUTTONPOPUP_GOODY_HUT_REWARD, eGoody, iSpecialValue);
GC.GetEngineUserInterface()->AddPopup(kPopupInfo);

If you want a custom popup, you can use the BUTTONPOPUP_MODDER_x values and then write your own pop-up listener in Lua - take care if doing this as you must dismiss the popup correctly or you get the "bug" where popups randomly don't display
 
I'm assuming you mean from C++

Code:
CvPopupInfo kPopupInfo(BUTTONPOPUP_GOODY_HUT_REWARD, eGoody, iSpecialValue);
GC.GetEngineUserInterface()->AddPopup(kPopupInfo);

If you want a custom popup, you can use the BUTTONPOPUP_MODDER_x values and then write your own pop-up listener in Lua - take care if doing this as you must dismiss the popup correctly or you get the "bug" where popups randomly don't display

Thanks I'll take a look at this. I want to create a popup for the Foreign Advisor: You can now create Vassals!
 
You probably want BUTTONPOPUP_ADVISOR_MODAL then, that's the one used to tell you it's a bad idea to attack a unit/city if you're going to lose badly (but you can use it for any advisor) - see CvUnitMission.cpp
 
Back
Top Bottom