Changeset - r25027:9aa898fd565d
[Not reviewed]
master
0 1 0
sean - 3 years ago 2021-03-10 12:37:35
43609023+spnda@users.noreply.github.com
Codechange: Misleading function name for selecting refresh rate (#8836)

Co-authored-by: pnda <43609023+ThePNDA@users.noreply.github.com>
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/settings_gui.cpp
Show inline comments
 
@@ -135,44 +135,44 @@ template <class TBaseSet>
 
void ShowBaseSetTextfileWindow(TextfileType file_type, const TBaseSet* baseset, StringID content_type)
 
{
 
	DeleteWindowById(WC_TEXTFILE, file_type);
 
	new BaseSetTextfileWindow<TBaseSet>(file_type, baseset, content_type);
 
}
 

	
 
std::set<int> _refresh_rates = { 30, 60, 75, 90, 100, 120, 144, 240 };
 

	
 
/**
 
 * Add the refresh rate from the config and the refresh rates from all the monitors to
 
 * our list of refresh rates shown in the GUI.
 
 */
 
static void AddRefreshRatesAndSelect()
 
static void AddCustomRefreshRates()
 
{
 
	/* Add the refresh rate as selected in the config. */
 
	_refresh_rates.insert(_settings_client.gui.refresh_rate);
 

	
 
	/* Add all the refresh rates of all monitors connected to the machine.  */
 
	std::vector<int> monitorRates = VideoDriver::GetInstance()->GetListOfMonitorRefreshRates();
 
	std::copy(monitorRates.begin(), monitorRates.end(), std::inserter(_refresh_rates, _refresh_rates.end()));
 
}
 

	
 
struct GameOptionsWindow : Window {
 
	GameSettings *opt;
 
	bool reload;
 

	
 
	GameOptionsWindow(WindowDesc *desc) : Window(desc)
 
	{
 
		this->opt = &GetGameSettings();
 
		this->reload = false;
 

	
 
		AddRefreshRatesAndSelect();
 
		AddCustomRefreshRates();
 

	
 
		this->InitNested(WN_GAME_OPTIONS_GAME_OPTIONS);
 
		this->OnInvalidateData(0);
 
	}
 

	
 
	~GameOptionsWindow()
 
	{
 
		DeleteWindowById(WC_CUSTOM_CURRENCY, 0);
 
		DeleteWindowByClass(WC_TEXTFILE);
 
		if (this->reload) _switch_mode = SM_MENU;
 
	}
 

	
0 comments (0 inline, 0 general)