Add: alternative setting for right-click close window option to exclude pinned windows (#10204)

This commit is contained in:
MasonGulu
2023-07-19 17:24:22 -04:00
committed by GitHub
parent 092a3db745
commit 0be27778af
6 changed files with 35 additions and 9 deletions

View File

@@ -160,8 +160,8 @@ enum IniFileVersion : uint32_t {
IFV_GAME_TYPE, ///< 2 PR#9515 Convert server_advertise to server_game_type.
IFV_LINKGRAPH_SECONDS, ///< 3 PR#10610 Store linkgraph update intervals in seconds instead of days.
IFV_NETWORK_PRIVATE_SETTINGS, ///< 4 PR#10762 Move no_http_content_downloads / use_relay_service to private settings.
IFV_AUTOSAVE_RENAME, ///< 5 PR#11143 Renamed values of autosave to be in minutes.
IFV_RIGHT_CLICK_CLOSE, ///< 6 PR#10204 Add alternative right click to close windows setting.
IFV_MAX_VERSION, ///< Highest possible ini-file version.
};
@@ -1334,6 +1334,12 @@ void LoadFromConfig(bool startup)
}
}
/* Persist the right click close option from older versions. */
if (generic_version < IFV_RIGHT_CLICK_CLOSE && IsConversionNeeded(generic_ini, "gui", "right_mouse_wnd_close", "right_click_wnd_close", &old_item)) {
auto old_value = BoolSettingDesc::ParseSingleValue(old_item->value->c_str());
_settings_client.gui.right_click_wnd_close = old_value.value_or(false) ? RCC_YES : RCC_NO;
}
_grfconfig_newgame = GRFLoadConfig(generic_ini, "newgrf", false);
_grfconfig_static = GRFLoadConfig(generic_ini, "newgrf-static", true);
AILoadConfig(generic_ini, "ai_players");