Changeset - r21809:53dbaeac66ce
[Not reviewed]
master
0 2 0
peter1138 - 10 years ago 2014-10-04 18:19:22
peter1138@openttd.org
(svn r26954) -Codechange: GUI-scale for AI/GS settings and NewGRF settings windows.
2 files changed with 8 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/ai/ai_gui.cpp
Show inline comments
 
@@ -346,7 +346,7 @@ struct AISettingsWindow : public Window 
 
	virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
 
	{
 
		if (widget == WID_AIS_BACKGROUND) {
 
			this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
 
			this->line_height = max(SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL) + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
 

	
 
			resize->width = 1;
 
			resize->height = this->line_height;
 
@@ -371,6 +371,7 @@ struct AISettingsWindow : public Window 
 

	
 
		int y = r.top;
 
		int button_y_offset = (this->line_height - SETTING_BUTTON_HEIGHT) / 2;
 
		int text_y_offset = (this->line_height - FONT_HEIGHT_NORMAL) / 2;
 
		for (; this->vscroll->IsVisible(i) && it != visible_settings.end(); i++, it++) {
 
			const ScriptConfigItem &config_item = **it;
 
			int current_value = config->GetSetting((config_item).name);
 
@@ -412,7 +413,7 @@ struct AISettingsWindow : public Window 
 
				}
 
			}
 

	
 
			DrawString(text_left, text_right, y + WD_MATRIX_TOP, str, colour);
 
			DrawString(text_left, text_right, y + text_y_offset, str, colour);
 
			y += this->line_height;
 
		}
 
	}
src/newgrf_gui.cpp
Show inline comments
 
@@ -199,7 +199,8 @@ struct NewGRFParametersWindow : public W
 
		switch (widget) {
 
			case WID_NP_NUMPAR_DEC:
 
			case WID_NP_NUMPAR_INC: {
 
				size->width = size->height = FONT_HEIGHT_NORMAL;
 
				size->width  = max(SETTING_BUTTON_WIDTH / 2, FONT_HEIGHT_NORMAL);
 
				size->height = max(SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL);
 
				break;
 
			}
 

	
 
@@ -213,7 +214,7 @@ struct NewGRFParametersWindow : public W
 
			}
 

	
 
			case WID_NP_BACKGROUND:
 
				this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
 
				this->line_height = max(SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL) + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
 

	
 
				resize->width = 1;
 
				resize->height = this->line_height;
 
@@ -266,6 +267,7 @@ struct NewGRFParametersWindow : public W
 

	
 
		int y = r.top;
 
		int button_y_offset = (this->line_height - SETTING_BUTTON_HEIGHT) / 2;
 
		int text_y_offset = (this->line_height - FONT_HEIGHT_NORMAL) / 2;
 
		for (uint i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++) {
 
			GRFParameterInfo *par_info = (i < this->grf_config->param_info.Length()) ? this->grf_config->param_info[i] : NULL;
 
			if (par_info == NULL) par_info = GetDummyParameterInfo(i);
 
@@ -301,7 +303,7 @@ struct NewGRFParametersWindow : public W
 
				SetDParam(1, i + 1);
 
			}
 

	
 
			DrawString(text_left, text_right, y + WD_MATRIX_TOP, STR_NEWGRF_PARAMETERS_SETTING, selected ? TC_WHITE : TC_LIGHT_BLUE);
 
			DrawString(text_left, text_right, y + text_y_offset, STR_NEWGRF_PARAMETERS_SETTING, selected ? TC_WHITE : TC_LIGHT_BLUE);
 
			y += this->line_height;
 
		}
 
	}
0 comments (0 inline, 0 general)