void OneTweakConfig::SaveConfig(CSimpleIniA* ini)
{
	_MESSAGE(__FUNCTION__);

	ini->Reset();
	version = CONFIG_VERSION;
	ini->SetLongValue("Version", "Config", version, "#Configuration file version, DO NOT CHANGE");

	ini->SetBoolValue("Global", "BorderlessWindow", true, "#Enable Borderless Window");
	ini->SetBoolValue("Global", "DoubleCursorFix", true, "#Enable Double Cursor Fix");
	ini->SetBoolValue("Global", "Priority", false, "#Enable dynamic priority change");

	ini->SetLongValue("Priority", "Foreground", 3, "#0 - idle, 1 - below normal, 2 - normal, 3 - above normal, 4 - high, 5 - realtime");
	ini->SetLongValue("Priority", "Background", 1, "#0 - idle, 1 - below normal, 2 - normal, 3 - above normal, 4 - high, 5 - realtime");

	ini->SetBoolValue("BorderlessWindow", "Active", true, "#Active in background");

	ini->SetLongValue("BorderlessWindow", "StyleFlags", 0, "#Window style flags");
	ini->SetLongValue("BorderlessWindow", "StyleFlagsEx", 0, "#Window style flags ex");

	ini->SetLongValue("BorderlessWindow", "WindowPosX", 0, "#Window X position");
	ini->SetLongValue("BorderlessWindow", "WindowPosY", 0, "#Window Y position");

	ini->SetLongValue("BorderlessWindow", "WindowWidth", 0, "#Window width, 0 = autodetect");
	ini->SetLongValue("BorderlessWindow", "WindowHeight", 0, "#Window height, 0 = autodetect");

	ini->SetLongValue("BorderlessWindow", "RenderWidth", 0, "#Rendering width, 0 = autodetect");
	ini->SetLongValue("BorderlessWindow", "RenderHeight", 0, "#Rendering height, 0 = autodetect");

	ini->SetBoolValue("DirectInput", "NonExclusive", true, "#Allows Alt+F4 and multimedia keys");

	OnSaveConfig(ini);
	ini->SaveFile(inifilename.c_str());
}
Beispiel #2
0
void GeneralPane::ConnectLayout()
{
  connect(m_checkbox_dualcore, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
  connect(m_checkbox_cheats, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
#ifdef USE_DISCORD_PRESENCE
  connect(m_checkbox_discord_presence, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
#endif

  if (AutoUpdateChecker::SystemSupportsAutoUpdates())
  {
    connect(m_combobox_update_track,
            static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
            &GeneralPane::OnSaveConfig);
    connect(&Settings::Instance(), &Settings::AutoUpdateTrackChanged, this,
            &GeneralPane::LoadConfig);
  }

  // Advanced
  connect(m_combobox_speedlimit,
          static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
          [this]() { OnSaveConfig(); });
  for (QRadioButton* radio_button : m_cpu_cores)
    connect(radio_button, &QRadioButton::toggled, this, &GeneralPane::OnSaveConfig);

#if defined(USE_ANALYTICS) && USE_ANALYTICS
  connect(&Settings::Instance(), &Settings::AnalyticsToggled, this, &GeneralPane::LoadConfig);
  connect(m_checkbox_enable_analytics, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
  connect(m_button_generate_new_identity, &QPushButton::pressed, this,
          &GeneralPane::GenerateNewIdentity);
#endif
}
Beispiel #3
0
void GeneralPane::ConnectLayout()
{
  connect(m_checkbox_dualcore, &QCheckBox::clicked, this, &GeneralPane::OnSaveConfig);
  connect(m_checkbox_cheats, &QCheckBox::clicked, this, &GeneralPane::OnSaveConfig);
  // Advanced
  connect(m_checkbox_force_ntsc, &QCheckBox::clicked, this, &GeneralPane::OnSaveConfig);
  connect(m_combobox_speedlimit,
          static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::activated),
          [this](const QString& text) { OnSaveConfig(); });
  connect(m_radio_interpreter, &QRadioButton::clicked, this, &GeneralPane::OnSaveConfig);
  connect(m_radio_cached_interpreter, &QRadioButton::clicked, this, &GeneralPane::OnSaveConfig);
  connect(m_radio_jit, &QRadioButton::clicked, this, &GeneralPane::OnSaveConfig);

#if defined(USE_ANALYTICS) && USE_ANALYTICS
  connect(m_checkbox_enable_analytics, &QCheckBox::clicked, this, &GeneralPane::OnSaveConfig);
  connect(m_button_generate_new_identity, &QPushButton::clicked, this,
          &GeneralPane::GenerateNewIdentity);
#endif
}