EmperorFool
Deity
That looks like the spot. You need to add the button to the popup itself, too. This code merely handles the click. Also, you might want to put Examine as the first option since that's where it is on other popups, right?
case BUTTONPOPUP_RAZECITY:
// examine city start
if (pPopupReturn->getButtonClicked() == 2)
{
gDLL->sendDoTask(info.getData1(), TASK_RAZE, -1, -1, false, false, false, false);
}
else if (pPopupReturn->getButtonClicked() == 3)
{
CvCity* pCity = GET_PLAYER(GC.getGameINLINE().getActivePlayer()).getCity(info.getData1());
if (NULL != pCity)
{
gDLL->getEventReporterIFace()->cityAcquiredAndKept(GC.getGameINLINE().getActivePlayer(), pCity);
}
gDLL->sendDoTask(info.getData1(), TASK_GIFT, info.getData2(), -1, false, false, false, false);
}
else if (pPopupReturn->getButtonClicked() == 1)
{
CvCity* pCity = GET_PLAYER(GC.getGameINLINE().getActivePlayer()).getCity(info.getData1());
if (NULL != pCity)
{
pCity->chooseProduction();
gDLL->getEventReporterIFace()->cityAcquiredAndKept(GC.getGameINLINE().getActivePlayer(), pCity);
}
}
else if (pPopupReturn->getButtonClicked() == 0)
{
CvCity* pCity = GET_PLAYER(GC.getGameINLINE().getActivePlayer()).getCity(info.getData1());
if (NULL != pCity)
{
gDLL->getInterfaceIFace()->selectCity(pCity);
}
}
// examine city end
break;
bool CvDLLButtonPopup::launchRazeCityPopup(CvPopup* pPopup, CvPopupInfo &info)
{
CvPlayer& player = GET_PLAYER(GC.getGameINLINE().getActivePlayer());
CvCity* pNewCity = player.getCity(info.getData1());
if (NULL == pNewCity)
{
FAssert(false);
return (false);
}
if (0 != GC.getDefineINT("PLAYER_ALWAYS_RAZES_CITIES"))
{
player.raze(pNewCity);
return false;
}
PlayerTypes eHighestCulturePlayer = (PlayerTypes)info.getData2();
int iCaptureGold = info.getData3();
bool bRaze = player.canRaze(pNewCity);
bool bGift = ((eHighestCulturePlayer != NO_PLAYER)
&& (eHighestCulturePlayer != player.getID())
&& ((player.getTeam() == GET_PLAYER(eHighestCulturePlayer).getTeam()) ||
GET_TEAM(player.getTeam()).isOpenBorders(GET_PLAYER(eHighestCulturePlayer).getTeam()) ||
GET_TEAM(GET_PLAYER(eHighestCulturePlayer).getTeam()).isVassal(player.getTeam())));
CvWString szBuffer;
if (iCaptureGold > 0)
{
szBuffer = gDLL->getText("TXT_KEY_POPUP_GOLD_CITY_CAPTURE", iCaptureGold, pNewCity->getNameKey());
}
else
{
szBuffer = gDLL->getText("TXT_KEY_POPUP_CITY_CAPTURE_KEEP", pNewCity->getNameKey());
}
gDLL->getInterfaceIFace()->popupSetBodyString(pPopup, szBuffer);
// examine city start
gDLL->getInterfaceIFace()->popupAddGenericButton(pPopup, gDLL->getText("TXT_KEY_POPUP_EXAMINE_CITY2").c_str(), NULL, 0,
WIDGET_GENERAL);
gDLL->getInterfaceIFace()->popupAddGenericButton(pPopup, gDLL->getText("TXT_KEY_POPUP_KEEP_CAPTURED_CITY").c_str(), NULL, 1,
WIDGET_GENERAL);
if (bRaze)
{
gDLL->getInterfaceIFace()->popupAddGenericButton(pPopup, gDLL->getText("TXT_KEY_POPUP_RAZE_CAPTURED_CITY").c_str(), NULL, 2,
WIDGET_GENERAL);
}
if (bGift)
{
szBuffer = gDLL->getText("TXT_KEY_POPUP_RETURN_ALLIED_CITY",
GET_PLAYER(eHighestCulturePlayer).getCivilizationDescriptionKey());
gDLL->getInterfaceIFace()->popupAddGenericButton(pPopup, szBuffer, NULL, 2, WIDGET_GENERAL, 3, eHighestCulturePlayer);
}
// examine city end
gDLL->getInterfaceIFace()->popupLaunch(pPopup, false, POPUPSTATE_IMMEDIATE);
gDLL->getInterfaceIFace()->playGeneralSound("AS2D_CITYCAPTURE");
return (true);
}
gDLL->getInterfaceIFace()->selectCity(pCity);
}
else if (pPopupReturn->getButtonClicked() == 0)
{
CvCity* pCity = GET_PLAYER(GC.getGameINLINE().getActivePlayer()).getCity(info.getData1());
if (NULL != pCity)
{
gDLL->getInterfaceIFace()->selectCity(pCity);
// modify this to call again
CvPopupInfo* pInfo = new CvPopupInfo(BUTTONPOPUP_RAZECITY);
pInfo->setData1(pCity->getID());
pInfo->setData2(eHighestCulturePlayer);
pInfo->setData3(iCaptureGold);
gDLL->getInterfaceIFace()->addPopup(pInfo, getID());
}
}
// examine city end
break;
{
bool launEx = true;
while (launEx)
{
if (pPopupReturn->getButtonClicked() == 2)
{
launEx = false;
gDLL->sendDoTask(info.getData1(), TASK_RAZE, -1, -1, false, false, false, false);
}
else if (pPopupReturn->getButtonClicked() == 3)
{
launEx = false;
CvCity* pCity = GET_PLAYER(GC.getGameINLINE().getActivePlayer()).getCity(info.getData1());
if (NULL != pCity)
{
gDLL->getEventReporterIFace()->cityAcquiredAndKept(GC.getGameINLINE().getActivePlayer(), pCity);
}
gDLL->sendDoTask(info.getData1(), TASK_GIFT, info.getData2(), -1, false, false, false, false);
}
else if (pPopupReturn->getButtonClicked() == 1)
{
CvCity* pCity = GET_PLAYER(GC.getGameINLINE().getActivePlayer()).getCity(info.getData1());
if (NULL != pCity)
{
launEx = false;
pCity->chooseProduction();
gDLL->getEventReporterIFace()->cityAcquiredAndKept(GC.getGameINLINE().getActivePlayer(), pCity);
}
}
else if (pPopupReturn->getButtonClicked() == 0)
{
CvCity* pCity = GET_PLAYER(GC.getGameINLINE().getActivePlayer()).getCity(info.getData1());
if (NULL != pCity)
{
gDLL->getInterfaceIFace()->selectCity(pCity);
}
}
}
}
pInfo->setData1(info.getData1());
pInfo->setData2(info.getData2());
pInfo->setData3(info.getData3());
EF, could you include this in BULL?