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
 
@@ -1060,96 +1060,102 @@ STR_AI_SPEED_VERY_SLOW                  
 
STR_AI_SPEED_SLOW                                               :Slow
 
STR_AI_SPEED_MEDIUM                                             :Medium
 
STR_AI_SPEED_FAST                                               :Fast
 
STR_AI_SPEED_VERY_FAST                                          :Very Fast
 

	
 
STR_SEA_LEVEL_VERY_LOW                                          :Very Low
 
STR_SEA_LEVEL_LOW                                               :Low
 
STR_SEA_LEVEL_MEDIUM                                            :Medium
 
STR_SEA_LEVEL_HIGH                                              :High
 
STR_SEA_LEVEL_CUSTOM                                            :Custom
 
STR_SEA_LEVEL_CUSTOM_PERCENTAGE                                 :Custom ({NUM}%)
 

	
 
STR_RIVERS_NONE                                                 :None
 
STR_RIVERS_FEW                                                  :Few
 
STR_RIVERS_MODERATE                                             :Medium
 
STR_RIVERS_LOT                                                  :Many
 

	
 
STR_DISASTER_NONE                                               :None
 
STR_DISASTER_REDUCED                                            :Reduced
 
STR_DISASTER_NORMAL                                             :Normal
 

	
 
STR_SUBSIDY_X1_5                                                :x1.5
 
STR_SUBSIDY_X2                                                  :x2
 
STR_SUBSIDY_X3                                                  :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}
 
STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT                       :Make it easier to remove town-owned infrastructure and buildings
 
STR_CONFIG_SETTING_TRAIN_LENGTH                                 :Maximum length of trains: {STRING2}
 
STR_CONFIG_SETTING_TRAIN_LENGTH_HELPTEXT                        :Set the maximum length of trains
 
STR_CONFIG_SETTING_TILE_LENGTH                                  :{COMMA} tile{P 0 "" s}
 
STR_CONFIG_SETTING_SMOKE_AMOUNT                                 :Amount of vehicle smoke/sparks: {STRING2}
 
STR_CONFIG_SETTING_SMOKE_AMOUNT_HELPTEXT                        :Set how much smoke or how many sparks are emitted by vehicles
 
STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL                     :Train acceleration model: {STRING2}
 
STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL_HELPTEXT            :Select the physics model for train acceleration. The "original" model penalises slopes equally for all vehicles. The "realistic" model penalises slopes and curves depending on various properties of the consist, like length and tractive effort
 
STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL              :Road vehicle acceleration model: {STRING2}
 
STR_CONFIG_SETTING_ROAD_VEHICLE_ACCELERATION_MODEL_HELPTEXT     :Select the physics model for road vehicle acceleration. The "original" model penalises slopes equally for all vehicles. The "realistic" model penalises slopes depending on various properties of the engine, for example 'tractive effort'
 
STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS                        :Slope steepness for trains: {STRING2}
 
STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS_HELPTEXT               :Steepness of a sloped tile for a train. Higher values make it more difficult to climb a hill
 
STR_CONFIG_SETTING_PERCENTAGE                                   :{COMMA}%
 
STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS                 :Slope steepness for road vehicles: {STRING2}
 
STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT        :Steepness of a sloped tile for a road vehicle. Higher values make it more difficult to climb a hill
 
STR_CONFIG_SETTING_FORBID_90_DEG                                :Forbid trains and ships from making 90° turns: {STRING2}
 
STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT                       :90 degree turns occur when a horizontal track is directly followed by a vertical track piece on the adjacent tile, thus making the train turn by 90 degree when traversing the tile edge instead of the usual 45 degrees for other track combinations. This also applies to the turning radius of ships
 
STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS                        :Allow to join stations not directly adjacent: {STRING2}
 
STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT               :Allow adding parts to a station without directly touching the existing parts. Needs Ctrl+Click while placing the new parts
 
STR_CONFIG_SETTING_IMPROVEDLOAD                                 :Use improved loading algorithm: {STRING2}
 
STR_CONFIG_SETTING_IMPROVEDLOAD_HELPTEXT                        :If enabled, multiple vehicles waiting at a station are loaded sequentially. Loading of the next vehicle only starts when there is enough cargo waiting to completely fill the first vehicle
 
STR_CONFIG_SETTING_GRADUAL_LOADING                              :Load vehicles gradually: {STRING2}
 
STR_CONFIG_SETTING_GRADUAL_LOADING_HELPTEXT                     :Gradually load vehicles using vehicle specific loading durations, instead of loading everything at once with a fixed time depending only on the amount of cargo loaded
 
STR_CONFIG_SETTING_INFLATION                                    :Inflation: {STRING2}
src/settings_gui.cpp
Show inline comments
 
@@ -1699,132 +1699,152 @@ struct GameSettingsWindow : Window {
 

	
 
	static GameSettings *settings_ptr; ///< Pointer to the game settings being displayed and modified.
 

	
 
	SettingEntry *valuewindow_entry;   ///< If non-NULL, pointer to setting for which a value-entering window has been opened.
 
	SettingEntry *clicked_entry;       ///< If non-NULL, pointer to a clicked numeric setting (with a depressed left or right button).
 
	SettingEntry *last_clicked;        ///< If non-NULL, pointer to the last clicked setting.
 
	SettingEntry *valuedropdown_entry; ///< If non-NULL, pointer to the value for which a dropdown window is currently opened.
 
	bool closing_dropdown;             ///< True, if the dropdown list is currently closing.
 

	
 
	Scrollbar *vscroll;
 

	
 
	GameSettingsWindow(const WindowDesc *desc) : Window()
 
	{
 
		static bool first_time = true;
 

	
 
		settings_ptr = &GetGameSettings();
 

	
 
		/* Build up the dynamic settings-array only once per OpenTTD session */
 
		if (first_time) {
 
			_settings_main_page.Init();
 
			first_time = false;
 
		} else {
 
			_settings_main_page.FoldAll(); // Close all sub-pages
 
		}
 

	
 
		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)
 
	{
 
		if (widget != WID_GS_OPTIONSPANEL) return;
 

	
 
		uint btn = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GS_OPTIONSPANEL, SETTINGTREE_TOP_OFFSET);
 
		if (btn == INT_MAX) return;
 

	
 
		uint cur_row = 0;
 
		SettingEntry *pe = _settings_main_page.FindEntry(btn, &cur_row);
 

	
 
		if (pe == NULL) return;  // Clicked below the last setting of the page
 

	
 
		int x = (_current_text_dir == TD_RTL ? this->width - 1 - pt.x : pt.x) - SETTINGTREE_LEFT_OFFSET - (pe->level + 1) * LEVEL_WIDTH;  // Shift x coordinate
 
		if (x < 0) return;  // Clicked left of the entry
 

	
 
		if ((pe->flags & SEF_KIND_MASK) == SEF_SUBTREE_KIND) {
 
			this->SetDisplayedHelpText(NULL);
 
			pe->d.sub.folded = !pe->d.sub.folded; // Flip 'folded'-ness of the sub-page
 

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

	
 
		assert((pe->flags & SEF_KIND_MASK) == SEF_SETTING_KIND);
 
		const SettingDesc *sd = pe->d.entry.setting;
0 comments (0 inline, 0 general)