Update to v4 of house placing patch.

This commit is contained in:
patch-import
2016-04-08 19:42:10 +01:00
committed by Jonathan G Rennison
220 changed files with 11448 additions and 3426 deletions

View File

@@ -1695,6 +1695,7 @@ static SettingsContainer &GetSettingsTree()
towns->Add(new SettingEntry("economy.allow_town_roads"));
towns->Add(new SettingEntry("economy.allow_town_level_crossings"));
towns->Add(new SettingEntry("economy.found_town"));
towns->Add(new SettingEntry("economy.allow_placing_houses"));
}
SettingsPage *industries = environment->Add(new SettingsPage(STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES));
@@ -1883,13 +1884,13 @@ struct GameSettingsWindow : Window {
if (this->warn_missing != WHR_NONE) {
const int left = panel->pos_x;
const int right = left + panel->current_x - 1;
const int top = panel->pos_y;
const int top = panel->pos_y + WD_FRAMETEXT_TOP + (SETTING_HEIGHT - FONT_HEIGHT_NORMAL) * this->warn_lines / 2;
SetDParam(0, _game_settings_restrict_dropdown[this->filter.min_cat]);
if (this->warn_lines == 1) {
/* If the warning fits at one line, center it. */
DrawString(left + WD_FRAMETEXT_LEFT, right - WD_FRAMETEXT_RIGHT, top + WD_FRAMETEXT_TOP, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
DrawString(left + WD_FRAMETEXT_LEFT, right - WD_FRAMETEXT_RIGHT, top, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
} else {
DrawStringMultiLine(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top + WD_FRAMERECT_TOP, INT32_MAX, warn_str);
DrawStringMultiLine(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, INT32_MAX, warn_str, TC_FROMSTRING, SA_HOR_CENTER);
}
}
}
@@ -1943,7 +1944,7 @@ struct GameSettingsWindow : Window {
{
switch (widget) {
case WID_GS_OPTIONSPANEL: {
int top_pos = r.top + SETTINGTREE_TOP_OFFSET + 1 + this->warn_lines * FONT_HEIGHT_NORMAL;
int top_pos = r.top + SETTINGTREE_TOP_OFFSET + 1 + this->warn_lines * SETTING_HEIGHT;
uint last_row = this->vscroll->GetPosition() + this->vscroll->GetCapacity() - this->warn_lines;
int next_row = GetSettingsTree().Draw(settings_ptr, r.left + SETTINGTREE_LEFT_OFFSET, r.right - SETTINGTREE_RIGHT_OFFSET, top_pos,
this->vscroll->GetPosition(), last_row, this->last_clicked);