@@ -66,6 +66,10 @@ InstanceSettingsPage::InstanceSettingsPage(BaseInstance* inst, QWidget* parent)
66
66
connect (APPLICATION, &Application::globalSettingsClosed, this , &InstanceSettingsPage::loadSettings);
67
67
connect (ui->instanceAccountSelector , QOverload<int >::of (&QComboBox::currentIndexChanged), this ,
68
68
&InstanceSettingsPage::changeInstanceAccount);
69
+
70
+ connect (ui->useNativeGLFWCheck , &QAbstractButton::toggled, this , &InstanceSettingsPage::onUseNativeGLFWChanged);
71
+ connect (ui->useNativeOpenALCheck , &QAbstractButton::toggled, this , &InstanceSettingsPage::onUseNativeOpenALChanged);
72
+
69
73
loadSettings ();
70
74
71
75
updateThresholds ();
@@ -198,11 +202,15 @@ void InstanceSettingsPage::applySettings()
198
202
bool workarounds = ui->nativeWorkaroundsGroupBox ->isChecked ();
199
203
m_settings->set (" OverrideNativeWorkarounds" , workarounds);
200
204
if (workarounds) {
201
- m_settings->set (" UseNativeOpenAL" , ui->useNativeOpenALCheck ->isChecked ());
202
205
m_settings->set (" UseNativeGLFW" , ui->useNativeGLFWCheck ->isChecked ());
206
+ m_settings->set (" CustomGLFWPath" , ui->lineEditGLFWPath ->text ());
207
+ m_settings->set (" UseNativeOpenAL" , ui->useNativeOpenALCheck ->isChecked ());
208
+ m_settings->set (" CustomOpenALPath" , ui->lineEditOpenALPath ->text ());
203
209
} else {
204
- m_settings->reset (" UseNativeOpenAL" );
205
210
m_settings->reset (" UseNativeGLFW" );
211
+ m_settings->reset (" CustomGLFWPath" );
212
+ m_settings->reset (" UseNativeOpenAL" );
213
+ m_settings->reset (" CustomOpenALPath" );
206
214
}
207
215
208
216
// Performance
@@ -312,7 +320,19 @@ void InstanceSettingsPage::loadSettings()
312
320
// Workarounds
313
321
ui->nativeWorkaroundsGroupBox ->setChecked (m_settings->get (" OverrideNativeWorkarounds" ).toBool ());
314
322
ui->useNativeGLFWCheck ->setChecked (m_settings->get (" UseNativeGLFW" ).toBool ());
323
+ ui->lineEditGLFWPath ->setText (m_settings->get (" CustomGLFWPath" ).toString ());
324
+ #ifdef Q_OS_LINUX
325
+ ui->lineEditGLFWPath ->setPlaceholderText (APPLICATION->m_detectedGLFWPath );
326
+ #else
327
+ ui->lineEditGLFWPath ->setPlaceholderText (tr (" Path to %1 library file" ).arg (BuildConfig.GLFW_LIBRARY_NAME ));
328
+ #endif
315
329
ui->useNativeOpenALCheck ->setChecked (m_settings->get (" UseNativeOpenAL" ).toBool ());
330
+ ui->lineEditOpenALPath ->setText (m_settings->get (" CustomOpenALPath" ).toString ());
331
+ #ifdef Q_OS_LINUX
332
+ ui->lineEditOpenALPath ->setPlaceholderText (APPLICATION->m_detectedOpenALPath );
333
+ #else
334
+ ui->lineEditGLFWPath ->setPlaceholderText (tr (" Path to %1 library file" ).arg (BuildConfig.OPENAL_LIBRARY_NAME ));
335
+ #endif
316
336
317
337
// Performance
318
338
ui->perfomanceGroupBox ->setChecked (m_settings->get (" OverridePerformance" ).toBool ());
@@ -408,6 +428,16 @@ void InstanceSettingsPage::on_javaTestBtn_clicked()
408
428
checker->run ();
409
429
}
410
430
431
+ void InstanceSettingsPage::onUseNativeGLFWChanged (bool checked)
432
+ {
433
+ ui->lineEditGLFWPath ->setEnabled (checked);
434
+ }
435
+
436
+ void InstanceSettingsPage::onUseNativeOpenALChanged (bool checked)
437
+ {
438
+ ui->lineEditOpenALPath ->setEnabled (checked);
439
+ }
440
+
411
441
void InstanceSettingsPage::updateAccountsMenu ()
412
442
{
413
443
ui->instanceAccountSelector ->clear ();
0 commit comments