mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
3 Commits
d7c06dfd32
...
5fb0eda4ad
Author | SHA1 | Date |
---|---|---|
|
5fb0eda4ad | |
|
aaf5d39b15 | |
|
7db135099a |
|
@ -418,7 +418,9 @@ protected:
|
|||
/* Draw the background of the graph itself. */
|
||||
GfxFillRect(r.left, r.top, r.right, r.bottom, GRAPH_BASE_COLOUR);
|
||||
|
||||
/* Draw the vertical grid lines. */
|
||||
/* Draw the grid lines. */
|
||||
int gridline_width = WidgetDimensions::scaled.bevel.top;
|
||||
int grid_colour = GRAPH_GRID_COLOUR;
|
||||
|
||||
/* Don't draw the first line, as that's where the axis will be. */
|
||||
if (rtl) {
|
||||
|
@ -428,13 +430,12 @@ protected:
|
|||
x = r.left + x_sep;
|
||||
}
|
||||
|
||||
int grid_colour = GRAPH_GRID_COLOUR;
|
||||
for (int i = 1; i < this->num_vert_lines + 1; i++) {
|
||||
/* If using wallclock units, we separate periods with a lighter line. */
|
||||
if (TimerGameEconomy::UsingWallclockUnits()) {
|
||||
grid_colour = (i % 4 == 0) ? GRAPH_YEAR_LINE_COLOUR : GRAPH_GRID_COLOUR;
|
||||
}
|
||||
GfxFillRect(x, r.top, x, r.bottom, grid_colour);
|
||||
GfxFillRect(x, r.top, x + gridline_width - 1, r.bottom, grid_colour);
|
||||
x += x_sep;
|
||||
}
|
||||
|
||||
|
@ -443,20 +444,20 @@ protected:
|
|||
|
||||
for (int i = 0; i < (num_hori_lines + 1); i++) {
|
||||
if (rtl) {
|
||||
GfxFillRect(r.right + 1, y, r.right + ScaleGUITrad(3), y, GRAPH_AXIS_LINE_COLOUR);
|
||||
GfxFillRect(r.right + 1, y, r.right + ScaleGUITrad(3), y + gridline_width - 1, GRAPH_AXIS_LINE_COLOUR);
|
||||
} else {
|
||||
GfxFillRect(r.left - ScaleGUITrad(3), y, r.left - 1, y, GRAPH_AXIS_LINE_COLOUR);
|
||||
GfxFillRect(r.left - ScaleGUITrad(3), y, r.left - 1, y + gridline_width - 1, GRAPH_AXIS_LINE_COLOUR);
|
||||
}
|
||||
GfxFillRect(r.left, y, r.right, y, GRAPH_GRID_COLOUR);
|
||||
GfxFillRect(r.left, y, r.right + gridline_width - 1, y + gridline_width - 1, GRAPH_GRID_COLOUR);
|
||||
y -= y_sep;
|
||||
}
|
||||
|
||||
/* Draw the y axis. */
|
||||
GfxFillRect(r.left, r.top, r.left, r.bottom, GRAPH_AXIS_LINE_COLOUR);
|
||||
GfxFillRect(r.left, r.top, r.left + gridline_width - 1, r.bottom + gridline_width - 1, GRAPH_AXIS_LINE_COLOUR);
|
||||
|
||||
/* Draw the x axis. */
|
||||
y = x_axis_offset + r.top;
|
||||
GfxFillRect(r.left, y, r.right, y, GRAPH_ZERO_LINE_COLOUR);
|
||||
GfxFillRect(r.left, y, r.right + gridline_width - 1, y + gridline_width - 1, GRAPH_ZERO_LINE_COLOUR);
|
||||
|
||||
/* Find the largest value that will be drawn. */
|
||||
if (this->num_on_x_axis == 0) return;
|
||||
|
@ -511,7 +512,7 @@ protected:
|
|||
year++;
|
||||
|
||||
/* Draw a lighter grid line between years. Top and bottom adjustments ensure we don't draw over top and bottom horizontal grid lines. */
|
||||
GfxFillRect(x + x_sep, r.top + 1, x + x_sep, r.bottom - 1, GRAPH_YEAR_LINE_COLOUR);
|
||||
GfxFillRect(x + x_sep, r.top + gridline_width, x + x_sep + gridline_width - 1, r.bottom - 1, GRAPH_YEAR_LINE_COLOUR);
|
||||
}
|
||||
x += x_sep;
|
||||
}
|
||||
|
@ -539,10 +540,11 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
/* draw lines and dots */
|
||||
uint linewidth = _settings_client.gui.graph_line_thickness;
|
||||
uint pointoffs1 = (linewidth + 1) / 2;
|
||||
uint pointoffs2 = linewidth + 1 - pointoffs1;
|
||||
/* Draw lines and dots. */
|
||||
uint linewidth = ScaleGUITrad(_settings_client.gui.graph_line_thickness);
|
||||
uint pointwidth = ScaleGUITrad(_settings_client.gui.graph_line_thickness + 1);
|
||||
uint pointoffs1 = pointwidth / 2;
|
||||
uint pointoffs2 = pointwidth - pointoffs1;
|
||||
|
||||
auto draw_dataset = [&](const DataSet &dataset, uint8_t colour) {
|
||||
if (HasBit(this->excluded_data, dataset.exclude_bit)) return;
|
||||
|
|
|
@ -268,6 +268,7 @@ STR_UNITS_YEARS :{NUM}{NBSP}ano{
|
|||
STR_UNITS_PERIODS :{NUM}{NBSP}período{P "" s}
|
||||
|
||||
STR_LIST_SEPARATOR :,{SPACE}
|
||||
STR_TRUNCATION_ELLIPSIS :...
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}Filtro:
|
||||
|
|
|
@ -267,6 +267,7 @@ STR_UNITS_YEARS :{NUM}{NBSP}year
|
|||
STR_UNITS_PERIODS :{NUM}{NBSP}period{P "" s}
|
||||
|
||||
STR_LIST_SEPARATOR :,{SPACE}
|
||||
STR_TRUNCATION_ELLIPSIS :...
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}Filter:
|
||||
|
|
|
@ -267,6 +267,7 @@ STR_UNITS_YEARS :{NUM}{NBSP}vuo{
|
|||
STR_UNITS_PERIODS :{NUM}{NBSP}jakso{P "" a}
|
||||
|
||||
STR_LIST_SEPARATOR :,{SPACE}
|
||||
STR_TRUNCATION_ELLIPSIS :…
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}Suodatin:
|
||||
|
|
|
@ -329,6 +329,7 @@ STR_UNITS_YEARS :{NUM}{NBSP}έτ
|
|||
STR_UNITS_PERIODS :{NUM}{NBSP}περίοδ{P 0 ος οι}
|
||||
|
||||
STR_LIST_SEPARATOR :,{SPACE}
|
||||
STR_TRUNCATION_ELLIPSIS :...
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}Φιλτράρισμα λίστας:
|
||||
|
|
|
@ -268,6 +268,7 @@ STR_UNITS_YEARS :{NUM}년
|
|||
STR_UNITS_PERIODS :{NUM}기간
|
||||
|
||||
STR_LIST_SEPARATOR :,{SPACE}
|
||||
STR_TRUNCATION_ELLIPSIS :…
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}검색:
|
||||
|
|
|
@ -646,6 +646,7 @@ STR_UNITS_YEARS :{NUM}{NBSP}{P r
|
|||
STR_UNITS_PERIODS :{NUM}{NBSP}okres{P "" y ów}
|
||||
|
||||
STR_LIST_SEPARATOR :,{SPACE}
|
||||
STR_TRUNCATION_ELLIPSIS :...
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}Filtr:
|
||||
|
|
|
@ -268,6 +268,7 @@ STR_UNITS_YEARS :{NUM}{NBSP}ano{
|
|||
STR_UNITS_PERIODS :{NUM}{NBSP}período{P "" s}
|
||||
|
||||
STR_LIST_SEPARATOR :,{SPACE}
|
||||
STR_TRUNCATION_ELLIPSIS :...
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}Filtro:
|
||||
|
|
|
@ -393,6 +393,7 @@ STR_UNITS_YEARS :{NUM}{NBSP}{P
|
|||
STR_UNITS_PERIODS :{NUM}{NBSP}цикл{P "" а ов}
|
||||
|
||||
STR_LIST_SEPARATOR :,{SPACE}
|
||||
STR_TRUNCATION_ELLIPSIS :...
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}Фильтр:
|
||||
|
|
|
@ -267,6 +267,7 @@ STR_UNITS_YEARS :{NUM}{NBSP}年
|
|||
STR_UNITS_PERIODS :{NUM}{NBSP}个周期
|
||||
|
||||
STR_LIST_SEPARATOR :、
|
||||
STR_TRUNCATION_ELLIPSIS :…
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}搜索:
|
||||
|
|
|
@ -267,6 +267,7 @@ STR_UNITS_YEARS :{NUM}{NBSP}年
|
|||
STR_UNITS_PERIODS :{NUM}{NBSP}個週期
|
||||
|
||||
STR_LIST_SEPARATOR :、
|
||||
STR_TRUNCATION_ELLIPSIS :……
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}篩選:
|
||||
|
|
Loading…
Reference in New Issue