Changeset - r18640:cd857e155af2
[Not reviewed]
master
0 5 0
frosch - 12 years ago 2011-12-11 15:55:31
frosch@openttd.org
(svn r23497) -Add: Advanced display setting to control the linewidth in graphs. (ChillCore)
5 files changed with 18 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/graph_gui.cpp
Show inline comments
 
@@ -410,24 +410,27 @@ protected:
 
			uint16 label = this->x_values_start;
 

	
 
			for (int i = 0; i < this->num_on_x_axis; i++) {
 
				SetDParam(0, label);
 
				DrawString(x + 1, x + x_sep - 1, y, STR_GRAPH_Y_LABEL_NUMBER, graph_axis_label_colour, SA_HOR_CENTER);
 

	
 
				label += this->x_values_increment;
 
				x += x_sep;
 
			}
 
		}
 

	
 
		/* draw lines and dots */
 
		uint linewidth = _settings_client.gui.graph_line_thickness;
 
		uint pointoffs1 = (linewidth + 1) / 2;
 
		uint pointoffs2 = linewidth + 1 - pointoffs1;
 
		for (int i = 0; i < this->num_dataset; i++) {
 
			if (!HasBit(this->excluded_data, i)) {
 
				/* Centre the dot between the grid lines. */
 
				x = r.left + (x_sep / 2);
 

	
 
				byte colour  = this->colours[i];
 
				uint prev_x = INVALID_DATAPOINT_POS;
 
				uint prev_y = INVALID_DATAPOINT_POS;
 

	
 
				for (int j = 0; j < this->num_on_x_axis; j++) {
 
					OverflowSafeInt64 datapoint = this->cost[i][j];
 

	
 
@@ -446,28 +449,28 @@ protected:
 
						int mult_range = FindLastBit(x_axis_offset) + FindLastBit(abs(datapoint));
 
						int reduce_range = max(mult_range - 31, 0);
 

	
 
						/* Handle negative values differently (don't shift sign) */
 
						if (datapoint < 0) {
 
							datapoint = -(abs(datapoint) >> reduce_range);
 
						} else {
 
							datapoint >>= reduce_range;
 
						}
 
						y = r.top + x_axis_offset - ((r.bottom - r.top) * datapoint) / (interval_size >> reduce_range);
 

	
 
						/* Draw the point. */
 
						GfxFillRect(x - 2, y - 2, x + 2, y + 2, colour);
 
						GfxFillRect(x - pointoffs1, y - pointoffs1, x + pointoffs2, y + pointoffs2, colour);
 

	
 
						/* Draw the line connected to the previous point. */
 
						if (prev_x != INVALID_DATAPOINT_POS) GfxDrawLine(prev_x, prev_y, x, y, colour, 3);
 
						if (prev_x != INVALID_DATAPOINT_POS) GfxDrawLine(prev_x, prev_y, x, y, colour, linewidth);
 

	
 
						prev_x = x;
 
						prev_y = y;
 
					} else {
 
						prev_x = INVALID_DATAPOINT_POS;
 
						prev_y = INVALID_DATAPOINT_POS;
 
					}
 

	
 
					x += x_sep;
 
				}
 
			}
 
		}
src/lang/english.txt
Show inline comments
 
@@ -1165,24 +1165,25 @@ STR_CONFIG_SETTING_ORDER_REVIEW         
 
STR_CONFIG_SETTING_ORDER_REVIEW_OFF                             :no
 
STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT                         :yes, but exclude stopped vehicles
 
STR_CONFIG_SETTING_ORDER_REVIEW_ON                              :of all vehicles
 
STR_CONFIG_SETTING_WARN_INCOME_LESS                             :{LTBLUE}Warn if a vehicle's income is negative: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES                        :{LTBLUE}Vehicles never expire: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_AUTORENEW_VEHICLE                            :{LTBLUE}Autorenew vehicle when it gets old: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_AUTORENEW_MONTHS                             :{LTBLUE}Autorenew when vehicle is {ORANGE}{STRING1}{LTBLUE} month{P 0:1 "" s} before/after max age
 
STR_CONFIG_SETTING_AUTORENEW_MONEY                              :{LTBLUE}Autorenew minimum needed money for renew: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_ERRMSG_DURATION                              :{LTBLUE}Duration of error message: {ORANGE}{STRING1} second{P 0:1 "" s}
 
STR_CONFIG_SETTING_HOVER_DELAY                                  :{LTBLUE}Show tooltips: {ORANGE}Hover for {STRING1} second{P 0:1 "" s}
 
STR_CONFIG_SETTING_HOVER_DELAY_DISABLED                         :{LTBLUE}Show tooltips: {ORANGE}Right click
 
STR_CONFIG_SETTING_POPULATION_IN_LABEL                          :{LTBLUE}Show town population in the town name label: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS                         :{LTBLUE}Thickness of lines in graphs: {ORANGE}{STRING1}
 

	
 
STR_CONFIG_SETTING_LAND_GENERATOR                               :{LTBLUE}Land generator: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_LAND_GENERATOR_ORIGINAL                      :Original
 
STR_CONFIG_SETTING_LAND_GENERATOR_TERRA_GENESIS                 :TerraGenesis
 
STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE                        :{LTBLUE}Max distance from edge for Oil Refineries: {ORANGE}{STRING1} tile{P 0:1 "" s}
 
STR_CONFIG_SETTING_SNOWLINE_HEIGHT                              :{LTBLUE}Snow line height: {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN                         :{LTBLUE}Roughness of terrain (TerraGenesis only) : {ORANGE}{STRING1}
 
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH             :Very Smooth
 
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH                  :Smooth
 
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH                   :Rough
 
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH              :Very Rough
 
STR_CONFIG_SETTING_TREE_PLACER                                  :{LTBLUE}Tree placer algorithm: {ORANGE}{STRING1}
src/settings_gui.cpp
Show inline comments
 
@@ -1350,24 +1350,25 @@ uint SettingsPage::Draw(GameSettings *se
 

	
 
static SettingEntry _settings_ui_display[] = {
 
	SettingEntry("gui.date_format_in_default_names"),
 
	SettingEntry("gui.population_in_label"),
 
	SettingEntry("gui.measure_tooltip"),
 
	SettingEntry("gui.loading_indicators"),
 
	SettingEntry("gui.liveries"),
 
	SettingEntry("gui.show_track_reservation"),
 
	SettingEntry("gui.expenses_layout"),
 
	SettingEntry("gui.smallmap_land_colour"),
 
	SettingEntry("gui.zoom_min"),
 
	SettingEntry("gui.zoom_max"),
 
	SettingEntry("gui.graph_line_thickness"),
 
};
 
/** Display options sub-page */
 
static SettingsPage _settings_ui_display_page = {_settings_ui_display, lengthof(_settings_ui_display)};
 

	
 
static SettingEntry _settings_ui_interaction[] = {
 
	SettingEntry("gui.window_snap_radius"),
 
	SettingEntry("gui.window_soft_limit"),
 
	SettingEntry("gui.link_terraform_toolbar"),
 
	SettingEntry("gui.prefer_teamchat"),
 
	SettingEntry("gui.autoscroll"),
 
	SettingEntry("gui.reverse_scroll"),
 
	SettingEntry("gui.smooth_scroll"),
src/settings_type.h
Show inline comments
 
@@ -106,24 +106,25 @@ struct GUISettings {
 
	byte   news_message_timeout;             ///< how much longer than the news message "age" should we keep the message in the history
 
	bool   show_track_reservation;           ///< highlight reserved tracks.
 
	uint8  default_signal_type;              ///< the signal type to build by default.
 
	uint8  cycle_signal_types;               ///< what signal types to cycle with the build signal tool.
 
	byte   station_numtracks;                ///< the number of platforms to default on for rail stations
 
	byte   station_platlength;               ///< the platform length, in tiles, for rail stations
 
	bool   station_dragdrop;                 ///< whether drag and drop is enabled for stations
 
	bool   station_show_coverage;            ///< whether to highlight coverage area
 
	bool   persistent_buildingtools;         ///< keep the building tools active after usage
 
	bool   expenses_layout;                  ///< layout of expenses window
 
	uint32 last_newgrf_count;                ///< the numbers of NewGRFs we found during the last scan
 
	byte   missing_strings_threshold;        ///< the number of missing strings before showing the warning
 
	uint8  graph_line_thickness;             ///< the thickness of the lines in the various graph guis
 

	
 
	uint16 console_backlog_timeout;          ///< the minimum amount of time items should be in the console backlog before they will be removed in ~3 seconds granularity.
 
	uint16 console_backlog_length;           ///< the minimum amount of items in the console backlog before items will be removed.
 
#ifdef ENABLE_NETWORK
 
	uint16 network_chat_box_width;           ///< width of the chat box in pixels
 
	uint8  network_chat_box_height;          ///< height of the chat box in lines
 
	uint16 network_chat_timeout;             ///< timeout of chat messages in seconds
 
#endif
 

	
 
	uint8  developer;                        ///< print non-fatal warnings in console (>= 1), copy debug output to console (== 2)
 
	bool   show_date_in_logs;                ///< whether to show dates in console logs
 
	bool   newgrf_developer_tools;           ///< activate NewGRF developer tools and allow modifying NewGRFs in an existing game
src/table/settings.ini
Show inline comments
 
@@ -2416,24 +2416,34 @@ flags    = SLF_NOT_IN_SAVE | SLF_NO_NETW
 
def      = false
 
str      = STR_CONFIG_SETTING_EXPENSES_LAYOUT
 
proc     = RedrawScreen
 

	
 
[SDTC_VAR]
 
var      = gui.missing_strings_threshold
 
type     = SLE_UINT8
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
def      = 25
 
min      = 1
 
max      = UINT8_MAX
 

	
 
[SDTC_VAR]
 
var      = gui.graph_line_thickness
 
type     = SLE_UINT8
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
def      = 3
 
min      = 1
 
max      = 5
 
str      = STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS
 
proc     = RedrawScreen
 

	
 
; For the dedicated build we'll enable dates in logs by default.
 
[SDTC_BOOL]
 
ifdef    = DEDICATED
 
var      = gui.show_date_in_logs
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
def      = true
 

	
 
[SDTC_BOOL]
 
ifndef   = DEDICATED
 
var      = gui.show_date_in_logs
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
def      = false
0 comments (0 inline, 0 general)