Change City Bar Color

Oblivionyx

Warlord
Joined
Sep 10, 2018
Messages
173
When the player plays with a civ, the city bar's color is white...

Spoiler :
Ht1nJqt.jpg


But when the AI plays, it's the same as the civilization's color...

Spoiler :
UWH3eRu.jpg


I want to change the player color from the boring white to the civ's theme color, just like the AI. I know it's possible, I just don't know how. :(

Can anyone help me?
 
When the player plays with a civ, the city bar's color is white...
Or green in this case, right? :think:

In getCityBillboardSizeIconColors in CvCity.cpp, if you comment out this block of code
Spoiler :
Code:
if ((getTeam() == GC.getGameINLINE().getActiveTeam()))
   {
       if (foodDifference() < 0)
       {
           if ((foodDifference() == -1) && (getFood() >= ((75 * growthThreshold()) / 100)))
           {
               kDotColor = kStagnant;
               kTextColor = kBlack;  
           }
           else
           {
               kDotColor = kShrinking;
               kTextColor = kBlack;
           }
       }
       else if (foodDifference() > 0)
       {
           kDotColor = kGrowing;
           kTextColor = kBlack;
       }
       else if (foodDifference() == 0)
       {
           kDotColor = kStagnant;
           kTextColor = kBlack;
       }
   }
the city size icon is shown in the civ's color. But then you lose the color coding for the population trend (growing/stagnating/shrinking). Or perhaps you could use the text color (kTextColor) for this. Since none of the Python scripts call getCityBillboardSizeIconColors, I don't think anything can be done in Python; will have to be (compiled) C++.
 
Or green in this case, right? :think:

In getCityBillboardSizeIconColors in CvCity.cpp, if you comment out this block of code
Spoiler :
Code:
if ((getTeam() == GC.getGameINLINE().getActiveTeam()))
   {
       if (foodDifference() < 0)
       {
           if ((foodDifference() == -1) && (getFood() >= ((75 * growthThreshold()) / 100)))
           {
               kDotColor = kStagnant;
               kTextColor = kBlack; 
           }
           else
           {
               kDotColor = kShrinking;
               kTextColor = kBlack;
           }
       }
       else if (foodDifference() > 0)
       {
           kDotColor = kGrowing;
           kTextColor = kBlack;
       }
       else if (foodDifference() == 0)
       {
           kDotColor = kStagnant;
           kTextColor = kBlack;
       }
   }
the city size icon is shown in the civ's color. But then you lose the color coding for the population trend (growing/stagnating/shrinking). Or perhaps you could use the text color (kTextColor) for this. Since none of the Python scripts call getCityBillboardSizeIconColors, I don't think anything can be done in Python; will have to be (compiled) C++.

I deleted it, but the player's city icon still shows the colors for growing/stagnation/shrinking. I also tried changing the kDotColor = kGrowing/kStagnant/kShrinking to kDotColor = kPlayerColor, but it didn't work either. Is there something I'm doing wrong?

The code looks like this:

Spoiler :
Code:
void CvCity::getCityBillboardSizeIconColors(NiColorA& kDotColor, NiColorA& kTextColor) const
{
    NiColorA kPlayerColor = GC.getColorInfo((ColorTypes) GC.getPlayerColorInfo(GET_PLAYER(getOwnerINLINE()).getPlayerColor()).getColorTypePrimary()).getColor();
    NiColorA kGrowing;
    kGrowing = NiColorA(0.73f,1,0.73f,1);
    NiColorA kShrinking(1,0.73f,0.73f,1);
    NiColorA kStagnant(0.83f,0.83f,0.83f,1);
    NiColorA kUnknown(.5f,.5f,.5f,1);
    NiColorA kWhite(1,1,1,1);
    NiColorA kBlack(0,0,0,1);

    {
        kDotColor = kPlayerColor;
        NiColorA kPlayerSecondaryColor = GC.getColorInfo((ColorTypes) GC.getPlayerColorInfo(GET_PLAYER(getOwnerINLINE()).getPlayerColor()).getColorTypeSecondary()).getColor();
        kTextColor = kPlayerSecondaryColor;
    }
}
 
I deleted it, but the player's city icon still shows the colors for growing/stagnation/shrinking. I also tried changing the kDotColor = kGrowing/kStagnant/kShrinking to kDotColor = kPlayerColor, but it didn't work either. Is there something I'm doing wrong?

The code looks like this: [...]
That looks correct and kDotColor=kPlayerColor should also work, but did you compile the code?
 
Back
Top Bottom