My long quest to create hidden nationality an option in Ctp2 (cherry picking from civ3) has met one hiccup. I identified the code where color is done and thought I found a way to implement it but for some reason in the hiddenationality code part it assigns random colors (see attached picture).
Basically what I want is for the unit to look like a barbarian (have barb flag color andeventually have thetext say barb in the info bar) if you don't own that unit but if you do, you see your own color. If you don't then no matter what player owns the unit it looks like a barbarian. therefore 'hidden nationality' like the privateers in civ3.
here's the code:
Basically what I want is for the unit to look like a barbarian (have barb flag color andeventually have thetext say barb in the info bar) if you don't own that unit but if you do, you see your own color. If you don't then no matter what player owns the unit it looks like a barbarian. therefore 'hidden nationality' like the privateers in civ3.
here's the code:
Code:
void UnitActor::DrawStackingIndicator(sint32 x, sint32 y, sint32 stack) { #ifndef _TEST STOMPCHECK(); #endif TileSet *tileSet = g_tiledMap->GetTileSet(); Pixel16 color; // = g_colorSet->GetPlayerColor(m_playerNum); MAPICON icon = MAPICON_HERALD; //MAPICON civicon = MAPICON_CIVFLAG_0; [b] //this will make all heralds the same as barbs for HiddenNationality Units if ((m_unitID.IsHiddenNationlity()) && (m_playerNum != g_selected_item->GetVisiblePlayer())) { //needed to add visible player check so you can find your own units color = g_colorSet->GetPlayerColor(0); //PLAYER_INDEX_VANDALS gave strange colors } else if (!m_unitID.IsHiddenNationlity()) { //just an else? or switch it to !hidden&visible color = g_colorSet->GetPlayerColor(m_playerNum); } [/b] if(!g_showHeralds) return; if (stack > 1 && stack <= 9) { icon = (MAPICON) ((sint32) MAPICON_HERALD2 + stack - 2); } else if(stack >= 10 && stack <= 12) { icon = (MAPICON) ((sint32) MAPICON_HERALD10 + stack - 10); } POINT iconDim = tileSet->GetMapIconDimensions(MAPICON_HERALD); if (x < 0) return; if (y < 0) return; if (x >= g_screenManager->GetSurfWidth() - iconDim.x) return; if (y >= g_screenManager->GetSurfHeight() - iconDim.y) return; g_tiledMap->DrawColorizedOverlayIntoMix(tileSet->GetMapIconData(icon), x, y, color); [i]...rest of the code...[/i]
Comment