Kailric
Jack of All Trades
I am working on a Mod for Colonization and having trouble figureing out Check Boxes. I added an extra check box to the Import/Export pop up from 2 to 3 using :
Then I try to retrieve the input in the code:
But "0x03" never returns the proper varable. It returns true if either 0x01 or 0x02 is true and false if they are both false. I don't understand iterators much so can someone help me out?
Code:
gDLL->getInterfaceIFace()->popupStartHLayout(pPopup, 0);
gDLL->getInterfaceIFace()->popupAddGenericButton(pPopup, L"", kYield.getButton(), -1, WIDGET_HELP_YIELD, iYield);
gDLL->getInterfaceIFace()->[COLOR="Red"]popupCreateCheckBoxes[/COLOR](pPopup, [COLOR="Red"]3[/COLOR], iYield, WIDGET_GENERAL, POPUP_LAYOUT_TOP);
gDLL->getInterfaceIFace()->popupSetCheckBoxText(pPopup, 0, gDLL->getText("TXT_KEY_POPUP_IMPORT"), iYield);
gDLL->getInterfaceIFace()->popupSetCheckBoxState(pPopup, 0, pCity->isImport(eYield), iYield);
gDLL->getInterfaceIFace()->popupSetCheckBoxText(pPopup, 1, gDLL->getText("TXT_KEY_POPUP_EXPORT"), iYield);
gDLL->getInterfaceIFace()->popupSetCheckBoxState(pPopup, 1, pCity->isExport(eYield), iYield);
gDLL->getInterfaceIFace()->popupSetCheckBoxText(pPopup, 2, gDLL->getText(szText), iYield);
gDLL->getInterfaceIFace()->popupSetCheckBoxState(pPopup, 2, pCity->isMarket(eYield), iYield);
Then I try to retrieve the input in the code:
Code:
bool bImport = (pPopupReturn->getCheckboxBitfield(iYield) & 0x01);
if (bImport != pCity->isImport(eYield))
{
gDLL->sendDoTask(info.getData1(), TASK_YIELD_IMPORT, iYield, bImport, false, false, false, false);
}
bool bExport = (pPopupReturn->getCheckboxBitfield(iYield) & 0x02);
if (bExport != pCity->isExport(eYield))
{
gDLL->sendDoTask(info.getData1(), TASK_YIELD_EXPORT, iYield, bExport, false, false, false, false);
}
bool bMarket = (pPopupReturn->getCheckboxBitfield(iYield) & [COLOR="Red"]0x03[/COLOR]);
But "0x03" never returns the proper varable. It returns true if either 0x01 or 0x02 is true and false if they are both false. I don't understand iterators much so can someone help me out?