Loading

Paste #pp4ix9vrb

  1. diff --git a/src/gfx_layout.h b/src/gfx_layout.h
  2. index c8f563591..6a1c62a67 100644
  3. --- a/src/gfx_layout.h
  4. +++ b/src/gfx_layout.h
  5. @@ -36,8 +36,8 @@ struct FontState {
  6.  
  7.     std::stack<TextColour, std::vector<TextColour>> colour_stack; ///< Stack of colours to assist with colour switching.
  8.  
  9. -   FontState() : fontsize(FS_END), cur_colour(TC_INVALID) {}
  10. -   FontState(TextColour colour, FontSize fontsize) : fontsize(fontsize), cur_colour(colour) {}
  11. +   FontState() : fontsize(FS_END), cur_colour(TC_INVALID), fixed_colour(false) {}
  12. +   FontState(TextColour colour, FontSize fontsize) : fontsize(fontsize), cur_colour(colour), fixed_colour(colour != TC_FROMSTRING) {}
  13.  
  14.     /**
  15.      * Switch to new colour \a c.
  16. @@ -46,6 +46,7 @@ struct FontState {
  17.     inline void SetColour(TextColour c)
  18.     {
  19.         assert(c >= TC_BLUE && c <= TC_BLACK);
  20. +       if (fixed_colour) return;
  21.         this->cur_colour = c;
  22.     }
  23.  
  24. @@ -75,6 +76,9 @@ struct FontState {
  25.     {
  26.         this->fontsize = f;
  27.     }
  28. +
  29. +protected:
  30. +   bool fixed_colour;
  31.  };
  32.  
  33.  /**
  34. diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
  35. index 536f6da58..ea96ad8a5 100644
  36. --- a/src/industry_gui.cpp
  37. +++ b/src/industry_gui.cpp
  38. @@ -1392,7 +1392,7 @@ public:
  39.                     break;
  40.                 }
  41.                 for (uint i = this->vscroll->GetPosition(); i < this->industries.size(); i++) {
  42. -                   DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, this->GetIndustryString(this->industries[i]));
  43. +                   DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, this->GetIndustryString(this->industries[i]), TC_GREEN);
  44.  
  45.                     y += this->resize.step_height;
  46.                     if (++n == this->vscroll->GetCapacity()) break; // max number of industries in 1 window

Comments