diff --git a/GameSettings.cpp b/GameSettings.cpp index c85795c1..c4d61c35 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1724,7 +1724,8 @@ void LoadGameExternalOptions() //################# Tactical Fortification Settings ################## gGameExternalOptions.fFortificationAllowInHostileSector = iniReader.ReadBoolean("Tactical Fortification Settings", "FORTIFICATION_ALLOW_IN_HOSTILE_SECTOR", FALSE); - gGameExternalOptions.fRoofCollapse = iniReader.ReadBoolean( "Tactical Fortification Settings", "ROOF_COLLAPSE", TRUE ); + gGameExternalOptions.fRoofCollapse = iniReader.ReadBoolean("Tactical Fortification Settings", "ROOF_COLLAPSE", TRUE ); + gGameExternalOptions.fPrintStructureTileset = iniReader.ReadBoolean("Tactical Fortification Settings", "PRINTOUTTILESET", FALSE ); //################# Tactical Food Settings ################## gGameExternalOptions.usFoodDigestionHourlyBaseFood = iniReader.ReadInteger("Tactical Food Settings", "FOOD_DIGESTION_HOURLY_BASE_FOOD", 20, 0, 250); diff --git a/GameSettings.h b/GameSettings.h index 602517d6..bf878ecc 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -431,6 +431,9 @@ typedef struct // Flugente: can roofs collapse? BOOLEAN fRoofCollapse; + // Flugente: option to print out tilesets of structure if we press 'f' + BOOLEAN fPrintStructureTileset; + // Flugente: food settings UINT16 usFoodDigestionHourlyBaseFood; UINT16 usFoodDigestionHourlyBaseDrink; diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index c5546b67..81be8a6f 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -3369,6 +3369,42 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) CHAR16 zOutputString[512]; swprintf( zOutputString, L"%s: %d", pUpdateMapInfoText[19], usGridNo); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, zOutputString ); + + // Flugente: print out structure tileset + if ( gGameExternalOptions.fPrintStructureTileset ) + { + STRUCTURE * pStruct = FindStructure( usGridNo, (STRUCTURE_GENERIC) ); + if ( pStruct ) + { + // if this is a multi-tile structure, be sure to use the base gridno + if ( !(pStruct->fFlags & STRUCTURE_BASE_TILE) ) + { + pStruct = FindBaseStructure( pStruct ); + } + + if ( pStruct ) + { + LEVELNODE* pNode = FindLevelNodeBasedOnStructure( pStruct->sGridNo, pStruct ); + + if ( pNode ) + { + UINT32 uiTileType = 0; + if ( GetTileType( pNode->usIndex, &uiTileType ) ) + { + std::string tilesestr = GetNameToTileSet( uiTileType ); + + CHAR16 whcarthing[100]; + + int nChars = MultiByteToWideChar( CP_ACP, 0, tilesestr.c_str(), -1, NULL, 0 ); + MultiByteToWideChar( CP_UTF8, 0, tilesestr.c_str( ), -1, whcarthing, nChars ); + + swprintf( zOutputString, L"Tileset %d: Tilesetname: %s tileindex: %d", giCurrentTilesetID, whcarthing, pStruct->pDBStructureRef->pDBStructure->usStructureNumber ); + ScreenMsg( FONT_MCOLOR_LTGREEN, MSG_INTERFACE, zOutputString ); + } + } + } + } + } } } break;