Loading

Paste #phzmwstgs

  1. Index: src/settings_gui.cpp
  2. ===================================================================
  3. --- src/settings_gui.cpp    (revision 27364)
  4. +++ src/settings_gui.cpp    (working copy)
  5. @@ -1883,13 +1883,13 @@
  6.         if (this->warn_missing != WHR_NONE) {
  7.             const int left = panel->pos_x;
  8.             const int right = left + panel->current_x - 1;
  9. -           const int top = panel->pos_y;
  10. +           const int top = panel->pos_y + WD_FRAMETEXT_TOP + (SETTING_HEIGHT - FONT_HEIGHT_NORMAL) * this->warn_lines / 2;
  11.             SetDParam(0, _game_settings_restrict_dropdown[this->filter.min_cat]);
  12.             if (this->warn_lines == 1) {
  13.                 /* If the warning fits at one line, center it. */
  14. -               DrawString(left + WD_FRAMETEXT_LEFT, right - WD_FRAMETEXT_RIGHT, top + WD_FRAMETEXT_TOP, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
  15. +               DrawString(left + WD_FRAMETEXT_LEFT, right - WD_FRAMETEXT_RIGHT, top, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
  16.             } else {
  17. -               DrawStringMultiLine(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top + WD_FRAMERECT_TOP, INT32_MAX, warn_str);
  18. +               DrawStringMultiLine(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, INT32_MAX, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
  19.             }
  20.         }
  21.     }
  22. @@ -1943,7 +1943,7 @@
  23.     {
  24.         switch (widget) {
  25.             case WID_GS_OPTIONSPANEL: {
  26. -               int top_pos = r.top + SETTINGTREE_TOP_OFFSET + 1 + this->warn_lines * FONT_HEIGHT_NORMAL;
  27. +               int top_pos = r.top + SETTINGTREE_TOP_OFFSET + 1 + this->warn_lines * SETTING_HEIGHT;
  28.                 uint last_row = this->vscroll->GetPosition() + this->vscroll->GetCapacity() - this->warn_lines;
  29.                 int next_row = GetSettingsTree().Draw(settings_ptr, r.left + SETTINGTREE_LEFT_OFFSET, r.right - SETTINGTREE_RIGHT_OFFSET, top_pos,
  30.                         this->vscroll->GetPosition(), last_row, this->last_clicked);
  31.  

Comments