Changeset - r19494:114d84fa2d8f
[Not reviewed]
master
0 2 0
frosch - 12 years ago 2012-07-17 20:18:18
frosch@openttd.org
(svn r24411) -Add [FS#5244-ish]: Display the a setting type in the adv. settings description which explains the scope of changes to a particular setting.
2 files changed with 30 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -1084,48 +1084,54 @@ STR_SUBSIDY_X3                          
 
STR_SUBSIDY_X4                                                  :x4
 

	
 
STR_TERRAIN_TYPE_VERY_FLAT                                      :Very Flat
 
STR_TERRAIN_TYPE_FLAT                                           :Flat
 
STR_TERRAIN_TYPE_HILLY                                          :Hilly
 
STR_TERRAIN_TYPE_MOUNTAINOUS                                    :Mountainous
 

	
 
STR_ECONOMY_STEADY                                              :Steady
 
STR_ECONOMY_FLUCTUATING                                         :Fluctuating
 

	
 
STR_REVERSE_AT_END_OF_LINE_AND_AT_STATIONS                      :At end of line, and at stations
 
STR_REVERSE_AT_END_OF_LINE_ONLY                                 :At end of line only
 

	
 
STR_CITY_APPROVAL_PERMISSIVE                                    :Permissive
 
STR_CITY_APPROVAL_TOLERANT                                      :Tolerant
 
STR_CITY_APPROVAL_HOSTILE                                       :Hostile
 

	
 
STR_WARNING_NO_SUITABLE_AI                                      :{WHITE}No suitable AIs available...{}You can download several AIs via the 'Online Content' system
 
STR_WARNING_DIFFICULTY_TO_CUSTOM                                :{WHITE}This action changed the difficulty level to custom
 

	
 
# Advanced settings window
 
STR_CONFIG_SETTING_CAPTION                                      :{WHITE}Advanced Settings
 
STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT            :(no explanation available)
 
STR_CONFIG_SETTING_DEFAULT_VALUE                                :{LTBLUE}Default value: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_TYPE                                         :{LTBLUE}Setting type: {ORANGE}{STRING}
 
STR_CONFIG_SETTING_TYPE_CLIENT                                  :Client setting (not stored in saves; affects all games)
 
STR_CONFIG_SETTING_TYPE_GAME_MENU                               :Game setting (stored in saves; affects only new games)
 
STR_CONFIG_SETTING_TYPE_GAME_INGAME                             :Game setting (stored in save; affects only current game)
 
STR_CONFIG_SETTING_TYPE_COMPANY_MENU                            :Company setting (stored in saves; affects only new games)
 
STR_CONFIG_SETTING_TYPE_COMPANY_INGAME                          :Company setting (stored in save; affects only current company)
 

	
 
STR_CONFIG_SETTING_OFF                                          :Off
 
STR_CONFIG_SETTING_ON                                           :On
 
STR_CONFIG_SETTING_DISABLED                                     :disabled
 

	
 
STR_CONFIG_SETTING_COMPANIES_OFF                                :Off
 
STR_CONFIG_SETTING_COMPANIES_OWN                                :Own company
 
STR_CONFIG_SETTING_COMPANIES_ALL                                :All companies
 

	
 
STR_CONFIG_SETTING_NONE                                         :None
 
STR_CONFIG_SETTING_ORIGINAL                                     :Original
 
STR_CONFIG_SETTING_REALISTIC                                    :Realistic
 

	
 
STR_CONFIG_SETTING_HORIZONTAL_POS_LEFT                          :Left
 
STR_CONFIG_SETTING_HORIZONTAL_POS_CENTER                        :Centre
 
STR_CONFIG_SETTING_HORIZONTAL_POS_RIGHT                         :Right
 

	
 
STR_CONFIG_SETTING_BUILDONSLOPES                                :Allow building on slopes and coasts: {STRING2}
 
STR_CONFIG_SETTING_BUILDONSLOPES_HELPTEXT                       :If enabled, tracks and stations can be build on most slopes. If disabled, they are only allowed on slopes which match the direction of the track and thus require no foundations
 
STR_CONFIG_SETTING_AUTOSLOPE                                    :Allow landscaping under buildings, tracks, etc. (autoslope): {STRING2}
 
STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT                           :Allow landscaping under buildings and tracks without removing them
 
STR_CONFIG_SETTING_CATCHMENT                                    :Allow more realistically sized catchment areas: {STRING2}
 
STR_CONFIG_SETTING_CATCHMENT_HELPTEXT                           :Have differently sized catchment areas for different types of stations and airports
 
STR_CONFIG_SETTING_EXTRADYNAMITE                                :Allow removal of more town-owned roads, bridges and tunnels: {STRING2}
src/settings_gui.cpp
Show inline comments
 
@@ -1723,84 +1723,104 @@ struct GameSettingsWindow : Window {
 

	
 
		this->valuewindow_entry = NULL; // No setting entry for which a entry window is opened
 
		this->clicked_entry = NULL; // No numeric setting buttons are depressed
 
		this->last_clicked = NULL;
 
		this->valuedropdown_entry = NULL;
 
		this->closing_dropdown = false;
 

	
 
		this->CreateNestedTree(desc);
 
		this->vscroll = this->GetScrollbar(WID_GS_SCROLLBAR);
 
		this->FinishInitNested(desc, WN_GAME_OPTIONS_GAME_SETTINGS);
 

	
 
		this->vscroll->SetCount(_settings_main_page.Length());
 
	}
 

	
 
	virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
 
	{
 
		switch (widget) {
 
			case WID_GS_OPTIONSPANEL:
 
				resize->height = SETTING_HEIGHT = max(11, FONT_HEIGHT_NORMAL + 1);
 
				resize->width  = 1;
 

	
 
				size->height = 5 * resize->height + SETTINGTREE_TOP_OFFSET + SETTINGTREE_BOTTOM_OFFSET;
 
				break;
 

	
 
			case WID_GS_HELP_TEXT:
 
				size->height = FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL +
 
			case WID_GS_HELP_TEXT: {
 
				static const StringID setting_types[] = {
 
					STR_CONFIG_SETTING_TYPE_CLIENT,
 
					STR_CONFIG_SETTING_TYPE_COMPANY_MENU, STR_CONFIG_SETTING_TYPE_COMPANY_INGAME,
 
					STR_CONFIG_SETTING_TYPE_GAME_MENU, STR_CONFIG_SETTING_TYPE_GAME_INGAME,
 
				};
 
				for (uint i = 0; i < lengthof(setting_types); i++) {
 
					SetDParam(0, setting_types[i]);
 
					size->width = max(size->width, GetStringBoundingBox(STR_CONFIG_SETTING_TYPE).width);
 
				}
 
				size->height = 2 * FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL +
 
						max(size->height, _settings_main_page.GetMaxHelpHeight(size->width));
 
				break;
 
			}
 

	
 
			default:
 
				break;
 
		}
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		if (this->closing_dropdown) {
 
			this->closing_dropdown = false;
 
			assert(this->valuedropdown_entry != NULL);
 
			this->valuedropdown_entry->SetButtons(0);
 
			this->valuedropdown_entry = NULL;
 
		}
 
		this->DrawWidgets();
 
	}
 

	
 
	virtual void DrawWidget(const Rect &r, int widget) const
 
	{
 
		switch (widget) {
 
			case WID_GS_OPTIONSPANEL:
 
				_settings_main_page.Draw(settings_ptr, r.left + SETTINGTREE_LEFT_OFFSET, r.right - SETTINGTREE_RIGHT_OFFSET, r.top + SETTINGTREE_TOP_OFFSET,
 
						this->vscroll->GetPosition(), this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->last_clicked);
 
				break;
 

	
 
			case WID_GS_HELP_TEXT:
 
				if (this->last_clicked != NULL) {
 
					const SettingDesc *sd = this->last_clicked->d.entry.setting;
 

	
 
					int y = r.top;
 
					if (sd->desc.flags & SGF_PER_COMPANY) {
 
						SetDParam(0, _game_mode == GM_MENU ? STR_CONFIG_SETTING_TYPE_COMPANY_MENU : STR_CONFIG_SETTING_TYPE_COMPANY_INGAME);
 
					} else if (sd->save.conv & SLF_NOT_IN_SAVE) {
 
						SetDParam(0, STR_CONFIG_SETTING_TYPE_CLIENT);
 
					} else {
 
						SetDParam(0, _game_mode == GM_MENU ? STR_CONFIG_SETTING_TYPE_GAME_MENU : STR_CONFIG_SETTING_TYPE_GAME_INGAME);
 
					}
 
					DrawString(r.left, r.right, y, STR_CONFIG_SETTING_TYPE);
 
					y += FONT_HEIGHT_NORMAL;
 

	
 
					int32 default_value = ReadValue(&sd->desc.def, sd->save.conv);
 
					this->last_clicked->SetValueDParams(0, default_value);
 

	
 
					int y = r.top;
 
					DrawString(r.left, r.right, y, STR_CONFIG_SETTING_DEFAULT_VALUE);
 
					y += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL;
 

	
 
					DrawStringMultiLine(r.left, r.right, y, r.bottom, this->last_clicked->GetHelpText(), TC_WHITE);
 
				}
 
				break;
 

	
 
			default:
 
				break;
 
		}
 
	}
 

	
 
	/**
 
	 * Set the entry that should have its help text displayed, and mark the window dirty so it gets repainted.
 
	 * @param pe Setting to display help text of, use \c NULL to stop displaying help of the currently displayed setting.
 
	 */
 
	void SetDisplayedHelpText(SettingEntry *pe)
 
	{
 
		if (this->last_clicked != pe) this->SetDirty();
 
		this->last_clicked = pe;
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
0 comments (0 inline, 0 general)