Merge remote-tracking branch 'upstream/master'

This commit is contained in:
dP
2024-02-19 12:16:07 +05:30
183 changed files with 9534 additions and 5696 deletions

View File

@@ -729,6 +729,7 @@ struct GameOptionsWindow : Window {
this->SetWidgetLoweredState(WID_GO_VIDEO_ACCEL_BUTTON, _video_hw_accel);
this->SetWidgetDirty(WID_GO_VIDEO_ACCEL_BUTTON);
#ifndef __APPLE__
this->SetWidgetLoweredState(WID_GO_VIDEO_VSYNC_BUTTON, _video_hw_accel && _video_vsync);
this->SetWidgetDisabledState(WID_GO_VIDEO_VSYNC_BUTTON, !_video_hw_accel);
this->SetWidgetDirty(WID_GO_VIDEO_VSYNC_BUTTON);
#endif
@@ -969,7 +970,7 @@ struct GameOptionsWindow : Window {
this->SetWidgetDisabledState(WID_GO_REFRESH_RATE_DROPDOWN, _video_vsync);
#ifndef __APPLE__
this->SetWidgetLoweredState(WID_GO_VIDEO_VSYNC_BUTTON, _video_vsync);
this->SetWidgetLoweredState(WID_GO_VIDEO_VSYNC_BUTTON, _video_hw_accel && _video_vsync);
this->SetWidgetDisabledState(WID_GO_VIDEO_VSYNC_BUTTON, !_video_hw_accel);
#endif
@@ -3037,7 +3038,6 @@ struct CustomCurrencyWindow : Window {
{
switch (widget) {
case WID_CC_RATE: SetDParam(0, 1); SetDParam(1, 1); break;
case WID_CC_SEPARATOR: SetDParamStr(0, _custom_currency.separator); break;
case WID_CC_PREFIX: SetDParamStr(0, _custom_currency.prefix); break;
case WID_CC_SUFFIX: SetDParamStr(0, _custom_currency.suffix); break;
case WID_CC_YEAR:
@@ -3063,7 +3063,6 @@ struct CustomCurrencyWindow : Window {
break;
/* Set the appropriate width for the edit buttons. */
case WID_CC_SEPARATOR_EDIT:
case WID_CC_PREFIX_EDIT:
case WID_CC_SUFFIX_EDIT:
*size = maxdim(*size, {(uint)SETTING_BUTTON_WIDTH, (uint)SETTING_BUTTON_HEIGHT});
@@ -3106,14 +3105,6 @@ struct CustomCurrencyWindow : Window {
afilter = CS_NUMERAL;
break;
case WID_CC_SEPARATOR_EDIT:
case WID_CC_SEPARATOR:
SetDParamStr(0, _custom_currency.separator);
str = STR_JUST_RAW_STRING;
len = 7;
line = WID_CC_SEPARATOR;
break;
case WID_CC_PREFIX_EDIT:
case WID_CC_PREFIX:
SetDParamStr(0, _custom_currency.prefix);
@@ -3169,10 +3160,6 @@ struct CustomCurrencyWindow : Window {
_custom_currency.rate = Clamp(atoi(str), 1, UINT16_MAX);
break;
case WID_CC_SEPARATOR: // Thousands separator
_custom_currency.separator = str;
break;
case WID_CC_PREFIX:
_custom_currency.prefix = str;
break;
@@ -3213,10 +3200,6 @@ static constexpr NWidgetPart _nested_cust_currency_widgets[] = {
EndContainer(),
NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_RATE), SetDataTip(STR_CURRENCY_EXCHANGE_RATE, STR_CURRENCY_SET_EXCHANGE_RATE_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0),
NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, WID_CC_SEPARATOR_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP), SetFill(0, 1),
NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_SEPARATOR), SetDataTip(STR_CURRENCY_SEPARATOR, STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_wide, 0),
NWidget(WWT_PUSHBTN, COLOUR_DARK_BLUE, WID_CC_PREFIX_EDIT), SetDataTip(0x0, STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP), SetFill(0, 1),
NWidget(WWT_TEXT, COLOUR_BLUE, WID_CC_PREFIX), SetDataTip(STR_CURRENCY_PREFIX, STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP), SetFill(1, 0),