Update to 13.0-RC1
This commit is contained in:
+11
-13
@@ -40,7 +40,7 @@ struct SubsidyListWindow : Window {
|
||||
{
|
||||
if (widget != WID_SUL_PANEL) return;
|
||||
|
||||
int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SUL_PANEL, WD_FRAMERECT_TOP);
|
||||
int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SUL_PANEL, WidgetDimensions::scaled.framerect.top);
|
||||
int num = 0;
|
||||
for (const Subsidy *s : Subsidy::Iterate()) {
|
||||
if (!s->IsAwarded()) {
|
||||
@@ -130,11 +130,11 @@ struct SubsidyListWindow : Window {
|
||||
if (widget != WID_SUL_PANEL) return;
|
||||
Dimension d = maxdim(GetStringBoundingBox(STR_SUBSIDIES_OFFERED_TITLE), GetStringBoundingBox(STR_SUBSIDIES_SUBSIDISED_TITLE));
|
||||
|
||||
resize->height = d.height;
|
||||
resize->height = FONT_HEIGHT_NORMAL;
|
||||
|
||||
d.height *= 5;
|
||||
d.width += padding.width + WD_FRAMERECT_RIGHT + WD_FRAMERECT_LEFT;
|
||||
d.height += padding.height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
|
||||
d.width += WidgetDimensions::scaled.framerect.Horizontal();
|
||||
d.height += WidgetDimensions::scaled.framerect.Vertical();
|
||||
*size = maxdim(*size, d);
|
||||
}
|
||||
|
||||
@@ -145,15 +145,13 @@ struct SubsidyListWindow : Window {
|
||||
YearMonthDay ymd;
|
||||
ConvertDateToYMD(_date, &ymd);
|
||||
|
||||
int right = r.right - WD_FRAMERECT_RIGHT;
|
||||
int y = r.top + WD_FRAMERECT_TOP;
|
||||
int x = r.left + WD_FRAMERECT_LEFT;
|
||||
Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
|
||||
|
||||
int pos = -this->vscroll->GetPosition();
|
||||
const int cap = this->vscroll->GetCapacity();
|
||||
|
||||
/* Section for drawing the offered subsidies */
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_OFFERED_TITLE);
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(tr.left, tr.right, tr.top + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_OFFERED_TITLE);
|
||||
pos++;
|
||||
|
||||
uint num = 0;
|
||||
@@ -163,7 +161,7 @@ struct SubsidyListWindow : Window {
|
||||
/* Displays the two offered towns */
|
||||
SetupSubsidyDecodeParam(s, SubsidyDecodeParamType::Gui);
|
||||
SetDParam(7, _date - ymd.day + s->remaining * 32);
|
||||
DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_OFFERED_FROM_TO);
|
||||
DrawString(tr.left, tr.right, tr.top + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_OFFERED_FROM_TO);
|
||||
}
|
||||
pos++;
|
||||
num++;
|
||||
@@ -171,13 +169,13 @@ struct SubsidyListWindow : Window {
|
||||
}
|
||||
|
||||
if (num == 0) {
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_NONE);
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(tr.left, tr.right, tr.top + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_NONE);
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* Section for drawing the already granted subsidies */
|
||||
pos++;
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_SUBSIDISED_TITLE);
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(tr.left, tr.right, tr.top + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_SUBSIDISED_TITLE);
|
||||
pos++;
|
||||
num = 0;
|
||||
|
||||
@@ -189,7 +187,7 @@ struct SubsidyListWindow : Window {
|
||||
SetDParam(8, _date - ymd.day + s->remaining * 32);
|
||||
|
||||
/* Displays the two connected stations */
|
||||
DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_SUBSIDISED_FROM_TO);
|
||||
DrawString(tr.left, tr.right, tr.top + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_SUBSIDISED_FROM_TO);
|
||||
}
|
||||
pos++;
|
||||
num++;
|
||||
@@ -197,7 +195,7 @@ struct SubsidyListWindow : Window {
|
||||
}
|
||||
|
||||
if (num == 0) {
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_NONE);
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(tr.left, tr.right, tr.top + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_NONE);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user