void LoadTilesetFromTitle(char* szBuffer) { ifstream fin; char szBuffer2[48]; fin.open("tilesets.idx"); while (!fin.eof()) { fin.getline(szBuffer2, 48); if (strcmp(szBuffer, szBuffer2) == 0) { fin.getline(szBuffer, 48); if (szBuffer[0] != NULL) { fin.close(); sprintf(Main.Settings.szTilesetDir, "%s", szBuffer); ReloadTileset(); } break; } } fin.close(); }
void ProcessPopupMenuSelection() { switch( gPopup.ubPopupMenuID ) { case CHANGETSET_POPUP: //change the tileset here. ReloadTileset( (UINT8)(gPopup.ubSelectedIndex - 1 ) ); InitJA2SelectionWindow( ); break; case CHANGECIVGROUP_POPUP: ChangeCivGroup( (UINT8)(gPopup.ubSelectedIndex - 1) ); break; case SCHEDULEACTION_POPUP: UpdateScheduleAction( (UINT8)(gPopup.ubSelectedIndex - 1) ); break; case ACTIONITEM_POPUP: UpdateActionItem( (UINT8)(gPopup.ubSelectedIndex - 1) ); break; case OWNERSHIPGROUP_POPUP: SetOwnershipGroup( (UINT8)(gPopup.ubSelectedIndex - 1) ); break; } }