5 #include "launchersetup.h"
6 #include "osregistry.h"
11 wxBEGIN_EVENT_TABLE(LauncherSetup, wxDialog)
12 EVT_BUTTON(wxID_OK, LauncherSetup::onOk)
13 EVT_CHECKBOX(ID_CB_MSAA, LauncherSetup::onToggleMSAA)
17 LauncherSetup::LauncherSetup( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
19 this->SetSizeHints( wxSize(370, -1), wxDefaultSize );
22 wxNotebook *nbook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
26 initTab_Joystick(nbook);
28 initTab_Network(nbook);
31 wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
32 bSizer->Add( nbook, 0, wxALL|wxEXPAND, 5 );
35 wxStdDialogButtonSizer* sdbSizer = new wxStdDialogButtonSizer();
36 sdbSizer->AddButton( new wxButton(this, wxID_OK) );
37 sdbSizer->AddButton( new wxButton(this, wxID_CANCEL) );
40 bSizer->Add( sdbSizer, 0, wxALL|wxEXPAND, 5 );
43 this->SetSizer( bSizer );
48 this->Centre( wxBOTH );
51 LauncherSetup::~LauncherSetup()
55 void LauncherSetup::initTab_Video(wxNotebook *parent)
57 unsigned int checked = 0;
59 wxPanel* panel = new wxPanel( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
61 wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
65 wxStaticBoxSizer* sbSizer = new wxStaticBoxSizer( new wxStaticBox( panel, wxID_ANY, wxT("Renderer") ), wxVERTICAL );
67 m_Video_Renderer = new wxComboBox( panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN|wxCB_READONLY );
68 sbSizer->Add( m_Video_Renderer, 1, wxALL|wxEXPAND, 5 );
70 bSizer->Add( sbSizer, 0, wxALL|wxEXPAND, 5 );
72 m_Video_Renderer->Append( wxT("OpenGL") );
73 m_Video_Renderer->SetSelection( 0 );
76 m_Video_Fullscreen = new wxCheckBox( panel, wxID_ANY, wxT("Fullscreen"), wxDefaultPosition, wxDefaultSize, 0 );
77 bSizer->Add( m_Video_Fullscreen, 0, wxALL, 5 );
79 checked = os_config_read_uint("Video", "Fullscreen", 1);
81 m_Video_Fullscreen->SetValue( (checked == 1) );
84 m_Video_ShowFPS = new wxCheckBox( panel, wxID_ANY, wxT("Show FPS"), wxDefaultPosition, wxDefaultSize, 0 );
85 bSizer->Add( m_Video_ShowFPS, 0, wxALL, 5 );
87 checked = os_config_read_uint("Video", "ShowFPS", 0);
89 m_Video_ShowFPS->SetValue( (checked == 1) );
92 wxBoxSizer* bSizer_aa = new wxBoxSizer( wxHORIZONTAL );
94 m_Video_MSAA = new wxCheckBox( panel, ID_CB_MSAA, wxT("Anti-Alias"), wxDefaultPosition, wxDefaultSize, 0 );
95 bSizer_aa->Add( m_Video_MSAA, 0, wxALIGN_CENTER_VERTICAL, 5 );
97 const wxString msaa_samples[] = { wxT("2x"), wxT("4x"), wxT("8x"), wxT("16x") };
98 const int num_msaa_samples = sizeof( msaa_samples ) / sizeof( wxString );
99 m_Video_MSAASamples = new wxChoice( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, num_msaa_samples, msaa_samples, 0 );
100 bSizer_aa->Add( m_Video_MSAASamples, 0, wxLEFT, 15 );
102 bSizer->Add( bSizer_aa, 0, wxALL, 5 );
104 checked = os_config_read_uint("Video", "AntiAlias", 0);
107 m_Video_MSAA->SetValue(true);
110 m_Video_MSAASamples->SetSelection(0);
111 } else if (checked < 8) {
112 m_Video_MSAASamples->SetSelection(1);
113 } else if (checked < 16) {
114 m_Video_MSAASamples->SetSelection(2);
116 m_Video_MSAASamples->SetSelection(3);
119 m_Video_MSAA->SetValue(false);
120 m_Video_MSAASamples->SetSelection(wxNOT_FOUND);
121 m_Video_MSAASamples->Disable();
125 panel->SetSizer( bSizer );
128 bSizer->Fit( panel );
130 parent->AddPage( panel, wxT("Video"), true );
133 void LauncherSetup::saveTab_Video()
136 unsigned int msaa = 0;
138 value = m_Video_Renderer->GetValue();
140 os_config_write_string("Video", "Renderer", value.c_str());
142 if ( m_Video_MSAA->IsChecked() ) {
143 int sel = m_Video_MSAASamples->GetSelection();
144 wxASSERT( sel != wxNOT_FOUND );
149 os_config_write_uint("Video", "AntiAlias", msaa);
151 os_config_write_uint("Video", "Fullscreen", m_Video_Fullscreen->IsChecked() ? 1 : 0);
152 os_config_write_uint("Video", "ShowFPS", m_Video_ShowFPS->IsChecked() ? 1 : 0);
155 void LauncherSetup::initTab_Audio(wxNotebook *parent)
157 unsigned int checked = 0;
158 ALint ver_major = 0, ver_minor = 0;
159 const ALCchar *ptr = NULL;
160 const char *conf_ptr = NULL;
161 bool audio_enabled = false;
163 alcGetIntegerv(NULL, ALC_MAJOR_VERSION, 1, &ver_major);
164 alcGetIntegerv(NULL, ALC_MINOR_VERSION, 1, &ver_minor);
166 if ( (ver_major >= 1) && (ver_minor >= 1) ) {
167 audio_enabled = true;
170 wxPanel* panel = new wxPanel( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
172 wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
176 wxStaticBoxSizer* sbSizer_playback = new wxStaticBoxSizer( new wxStaticBox( panel, wxID_ANY, wxT("Playback Device") ), wxVERTICAL );
178 m_Audio_PlaybackDevice = new wxComboBox( panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN|wxCB_READONLY );
179 sbSizer_playback->Add( m_Audio_PlaybackDevice, 0, wxALL|wxEXPAND, 5 );
181 bSizer->Add( sbSizer_playback, 0, wxALL|wxEXPAND, 5 );
183 m_Audio_PlaybackDevice->Append("<Default>");
184 m_Audio_PlaybackDevice->SetSelection(0);
186 conf_ptr = os_config_read_string("Audio", "PlaybackDevice", NULL);
189 if ( alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE ) {
190 ptr = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
192 ptr = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
197 m_Audio_PlaybackDevice->Append(ptr);
199 if ( conf_ptr && !SDL_strcasecmp(conf_ptr, ptr) ) {
200 unsigned int sel = m_Audio_PlaybackDevice->GetCount() - 1;
202 m_Audio_PlaybackDevice->SetSelection(sel);
207 ptr += strlen(ptr) + 1;
213 wxStaticBoxSizer* sbSizer_capture = new wxStaticBoxSizer( new wxStaticBox( panel, wxID_ANY, wxT("Capture Device") ), wxVERTICAL );
215 m_Audio_CaptureDevice = new wxComboBox( panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN|wxCB_READONLY );
216 sbSizer_capture->Add( m_Audio_CaptureDevice, 0, wxALL|wxEXPAND, 5 );
218 bSizer->Add( sbSizer_capture, 0, wxALL|wxEXPAND, 5 );
220 m_Audio_CaptureDevice->Append("<Default>");
221 m_Audio_CaptureDevice->SetSelection(0);
223 conf_ptr = os_config_read_string("Audio", "CaptureDevice", NULL);
226 ptr = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
230 m_Audio_CaptureDevice->Append(ptr);
232 if ( conf_ptr && !SDL_strcasecmp(conf_ptr, ptr) ) {
233 unsigned int sel = m_Audio_CaptureDevice->GetCount() - 1;
235 m_Audio_CaptureDevice->SetSelection(sel);
240 ptr += strlen(ptr) + 1;
246 m_Audio_EFX = new wxCheckBox( panel, wxID_ANY, wxT("EFX / EAX Reverb"), wxDefaultPosition, wxDefaultSize, 0 );
247 bSizer->Add( m_Audio_EFX, 0, wxALL, 5 );
249 checked = os_config_read_uint("Audio", "EFX", 0);
251 m_Audio_EFX->SetValue( (checked == 1) );
255 m_Audio_LauncherSounds = new wxCheckBox( panel, wxID_ANY, wxT("Enable Launcher Sounds"), wxDefaultPosition, wxDefaultSize, 0 );
256 bSizer->Add( m_Audio_LauncherSounds, 0, wxALL, 5 );
258 checked = os_config_read_uint("Audio", "LauncherSoundEnabled", 1);
260 m_Audio_LauncherSounds->SetValue( (checked == 1) );
264 panel->SetSizer( bSizer );
267 bSizer->Fit( panel );
269 parent->AddPage( panel, wxT("Audio"), false );
272 void LauncherSetup::saveTab_Audio()
276 value = m_Audio_PlaybackDevice->GetValue();
278 if ( value.IsSameAs( wxT("<Default>") ) ) {
279 os_config_write_string("Audio", "PlaybackDevice", "");
281 os_config_write_string("Audio", "PlaybackDevice", value.c_str());
284 value = m_Audio_CaptureDevice->GetValue();
286 if ( value.IsSameAs( wxT("<Default>") ) ) {
287 os_config_write_string("Audio", "CaptureDevice", "");
289 os_config_write_string("Audio", "CaptureDevice", value.c_str());
292 os_config_write_uint("Audio", "EFX", m_Audio_EFX->IsChecked() ? 1 : 0);
294 os_config_write_uint("Audio", "LauncherSoundEnabled", m_Audio_LauncherSounds->IsChecked() ? 1 : 0);
296 Launcher* parent = (Launcher*)GetParent();
297 parent->SndEnable( m_Audio_LauncherSounds->IsChecked() );
301 void LauncherSetup::initTab_Joystick(wxNotebook *parent)
303 unsigned int checked = 0;
304 const char *conf_ptr = NULL;
305 bool joystick_enabled = false;
307 if ( !SDL_InitSubSystem(SDL_INIT_JOYSTICK) ) {
308 joystick_enabled = true;
311 wxPanel* panel = new wxPanel( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
313 wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
315 wxStaticBoxSizer* sbSizer = new wxStaticBoxSizer( new wxStaticBox( panel, wxID_ANY, wxT("Joystick") ), wxVERTICAL );
318 // 'current joystick'
319 m_Joystick_Device = new wxComboBox( panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
320 sbSizer->Add( m_Joystick_Device, 0, wxALL|wxEXPAND, 5 );
322 m_Joystick_Device->Append( wxT("<Default>") );
323 m_Joystick_Device->SetSelection( 0 );
325 conf_ptr = os_config_read_string("Controls", "CurrentJoystick", NULL);
327 if (joystick_enabled) {
328 int num_sticks = SDL_NumJoysticks();
330 for (int i = 0; i < num_sticks; i++) {
331 const char *jname = SDL_JoystickNameForIndex(i);
334 m_Joystick_Device->Append(jname);
336 if ( conf_ptr && !SDL_strcasecmp(conf_ptr, jname) ) {
337 unsigned int sel = m_Joystick_Device->GetCount() - 1;
339 m_Joystick_Device->SetSelection(sel);
346 SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
349 bSizer->Add( sbSizer, 0, wxALL|wxEXPAND, 5 );
352 m_Joystick_FF = new wxCheckBox( panel, wxID_ANY, wxT("Enable Force Feedback"), wxDefaultPosition, wxDefaultSize, 0 );
353 bSizer->Add( m_Joystick_FF, 0, wxALL|wxEXPAND, 5 );
355 checked = os_config_read_uint("Controls", "EnableJoystickFF", 0);
357 m_Joystick_FF->SetValue( (checked == 1) );
360 m_Joystick_Directional = new wxCheckBox( panel, wxID_ANY, wxT("Enable directional hit effect (Force Feedback)"), wxDefaultPosition, wxDefaultSize, 0 );
361 bSizer->Add( m_Joystick_Directional, 0, wxALL|wxEXPAND, 5 );
363 checked = os_config_read_uint("Controls", "EnableHitEffect", 0);
365 m_Joystick_Directional->SetValue( (checked == 1) );
368 panel->SetSizer( bSizer );
371 bSizer->Fit( panel );
373 parent->AddPage( panel, wxT("Joystick"), false );
376 void LauncherSetup::saveTab_Joystick()
380 value = m_Joystick_Device->GetValue();
382 if ( value.IsSameAs( wxT("<Default>") ) ) {
383 os_config_write_string("Controls", "CurrentJoystick", "");
385 os_config_write_string("Controls", "CurrentJoystick", value.c_str());
388 os_config_write_uint("Controls", "EnableJoystickFF", m_Joystick_FF->IsChecked() ? 1 : 0);
389 os_config_write_uint("Controls", "EnableHitEffect", m_Joystick_Directional->IsChecked() ? 1 : 0);
392 void LauncherSetup::initTab_Speed(wxNotebook *parent)
394 unsigned int detail_lvl = 0;
396 wxPanel* panel = new wxPanel( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
398 wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
401 wxStaticBoxSizer* sbSizer = new wxStaticBoxSizer( new wxStaticBox( panel, wxID_ANY, wxT("Default Detail Level") ), wxVERTICAL );
403 m_Speed_DefaultDetail = new wxComboBox( panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN );
404 sbSizer->Add( m_Speed_DefaultDetail, 0, wxALL|wxEXPAND, 5 );
406 m_Speed_DefaultDetail->Append( wxT("Low") );
407 m_Speed_DefaultDetail->Append( wxT("Medium") );
408 m_Speed_DefaultDetail->Append( wxT("High") );
409 m_Speed_DefaultDetail->Append( wxT("Very High") );
411 detail_lvl = os_config_read_uint(NULL, "ComputerSpeed", 2);
413 if (detail_lvl > 3) {
417 m_Speed_DefaultDetail->SetSelection(detail_lvl);
420 bSizer->Add( sbSizer, 0, wxALL|wxEXPAND, 5 );
422 panel->SetSizer( bSizer );
425 bSizer->Fit( panel );
427 parent->AddPage( panel, wxT("Speed"), false );
430 void LauncherSetup::saveTab_Speed()
434 sel = m_Speed_DefaultDetail->GetSelection();
436 if ( (sel < 0) || (sel > 3) ) {
440 os_config_write_uint(NULL, "ComputerSpeed", sel);
443 void LauncherSetup::initTab_Network(wxNotebook* parent)
445 const char *conf_ptr = NULL;
446 unsigned int val = 0;
448 wxPanel* panel = new wxPanel( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
450 wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
453 const wxString conn_types[] = { wxT("None"), wxT("Dialup Networking"), wxT("LAN/Direct Connection") };
454 const int num_conn_types = sizeof( conn_types ) / sizeof( wxString );
455 m_Network_Connection = new wxRadioBox( panel, wxID_ANY, wxT("Internet Connection"), wxDefaultPosition, wxDefaultSize, num_conn_types, conn_types, 1, wxRA_SPECIFY_COLS|wxSTATIC_BORDER );
456 bSizer->Add( m_Network_Connection, 0, wxALL|wxEXPAND, 5 );
458 conf_ptr = os_config_read_string("Network", "NetworkConnection", NULL);
462 if ( !SDL_strcasecmp(conf_ptr, "dialup") ) {
464 } else if ( !SDL_strcasecmp(conf_ptr, "lan") ) {
469 m_Network_Connection->SetSelection(val);
471 // 'connection speed'
472 const wxString speed_types[] = { wxT("None Specified"), wxT("Slower than 56K Modem"), wxT("56K Modem"), wxT("Single Channel ISDN"), wxT("Dual Channel ISDN, Cable Modems"), wxT("T1, ADSL, T3, etc.") };
473 const int num_speed_types = sizeof( speed_types ) / sizeof( wxString );
474 m_Network_Speed = new wxRadioBox( panel, wxID_ANY, wxT("Connection Speed"), wxDefaultPosition, wxDefaultSize, num_speed_types, speed_types, 1, wxRA_SPECIFY_COLS );
475 bSizer->Add( m_Network_Speed, 0, wxALL|wxEXPAND, 5 );
477 conf_ptr = os_config_read_string("Network", "ConnectionSpeed", NULL);
481 if ( !SDL_strcasecmp(conf_ptr, "Slow") ) {
483 } else if ( !SDL_strcasecmp(conf_ptr, "56K") ) {
485 } else if ( !SDL_strcasecmp(conf_ptr, "ISDN") ) {
487 } else if ( !SDL_strcasecmp(conf_ptr, "Cable") ) {
489 } else if ( !SDL_strcasecmp(conf_ptr, "Fast") ) {
494 m_Network_Speed->SetSelection(val);
497 wxStaticBoxSizer* sbSizer = new wxStaticBoxSizer( new wxStaticBox( panel, wxID_ANY, wxT("Misc") ), wxVERTICAL );
499 wxFlexGridSizer* fgSizer_port = new wxFlexGridSizer( 0, 2, 0, 0 );
500 fgSizer_port->SetFlexibleDirection( wxBOTH );
501 fgSizer_port->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
504 wxStaticText* txt_port = new wxStaticText( panel, wxID_ANY, wxT("Force local port"), wxDefaultPosition, wxDefaultSize, 0 );
505 txt_port->Wrap( -1 );
506 fgSizer_port->Add( txt_port, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
508 m_Network_Port = new wxTextCtrl( panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
509 fgSizer_port->Add( m_Network_Port, 0, wxALL|wxEXPAND, 5 );
511 wxIntegerValidator<unsigned short> vald( &m_port_validate );
513 m_Network_Port->SetValidator(vald);
515 sbSizer->Add( fgSizer_port, 1, wxEXPAND, 5 );
517 val = os_config_read_uint("Network", "ForcePort", 0);
520 wxString sval = wxString::Format( wxT("%u"), val );
522 m_Network_Port->SetValue(sval);
526 bSizer->Add( sbSizer, 0, wxALL|wxEXPAND, 5 );
528 panel->SetSizer( bSizer );
531 bSizer->Fit( panel );
533 parent->AddPage( panel, wxT("Network"), false );
536 void LauncherSetup::saveTab_Network()
538 const char *conn_types[] = { "none", "dialup", "lan" };
539 const char *conn_speed[] = { "none", "Slow", "56K", "ISDN", "Cable", "Fast" };
543 sel = m_Network_Connection->GetSelection();
545 if ( (sel < 0) || (sel > 2) ) {
549 os_config_write_string("Network", "NetworkConnection", conn_types[sel]);
551 sel = m_Network_Speed->GetSelection();
553 if ( (sel < 0) || (sel > 5) ) {
557 os_config_write_string("Network", "ConnectionSpeed", conn_speed[sel]);
559 if ( !m_Network_Port->GetValue().IsEmpty() ) {
560 m_Network_Port->GetValue().ToLong(&port);
561 wxASSERT( port <= USHRT_MAX );
564 os_config_write_uint("Network", "ForcePort", (unsigned int)port);
567 void LauncherSetup::initTab_PXO(wxNotebook* parent)
569 const char *conf_ptr = NULL;
570 unsigned int checked = 0;
572 wxPanel* panel = new wxPanel( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
574 wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
576 wxStaticBoxSizer* sbSizer = new wxStaticBoxSizer( new wxStaticBox( panel, wxID_ANY, wxT("PXO Account") ), wxVERTICAL );
578 wxFlexGridSizer* fgSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
579 fgSizer->SetFlexibleDirection( wxBOTH );
580 fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
583 wxStaticText* pxo_login = new wxStaticText( panel, wxID_ANY, wxT("Login"), wxDefaultPosition, wxDefaultSize, 0 );
584 pxo_login->Wrap( -1 );
585 fgSizer->Add( pxo_login, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
587 m_PXO_Username = new wxTextCtrl( panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
588 fgSizer->Add( m_PXO_Username, 0, wxALL|wxEXPAND, 5 );
590 m_PXO_Username->SetMaxLength(32);
592 conf_ptr = os_config_read_string("PXO", "Login", NULL);
595 m_PXO_Username->SetValue(conf_ptr);
599 wxStaticText* pxo_pass = new wxStaticText( panel, wxID_ANY, wxT("Password"), wxDefaultPosition, wxDefaultSize, 0 );
600 pxo_pass->Wrap( -1 );
601 fgSizer->Add( pxo_pass, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
603 m_PXO_Password = new wxTextCtrl( panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD );
604 fgSizer->Add( m_PXO_Password, 0, wxALL|wxEXPAND, 5 );
606 m_PXO_Password->SetMaxLength(32);
608 conf_ptr = os_config_read_string("PXO", "Password", NULL);
611 m_PXO_Password->SetValue(conf_ptr);
614 sbSizer->Add( fgSizer, 1, wxEXPAND, 5 );
616 bSizer->Add( sbSizer, 0, wxALL|wxEXPAND, 5 );
618 // 'multi version check'
619 m_PXO_SkipVerify = new wxCheckBox( panel, wxID_ANY, wxT("Skip version check in PXO"), wxDefaultPosition, wxDefaultSize, 0 );
620 bSizer->Add( m_PXO_SkipVerify, 0, wxALL, 5 );
622 checked = os_config_read_uint("PXO", "SkipVerify", 0);
624 m_PXO_SkipVerify->SetValue( (checked == 1) );
627 m_PXO_Banners = new wxCheckBox( panel, wxID_ANY, wxT("PXO Banners"), wxDefaultPosition, wxDefaultSize, 0 );
628 bSizer->Add( m_PXO_Banners, 0, wxALL, 5 );
630 checked = os_config_read_uint("PXO", "Banners", 1);
632 m_PXO_Banners->SetValue( (checked == 1) );
635 panel->SetSizer( bSizer );
638 bSizer->Fit( panel );
640 parent->AddPage( panel, wxT("PXO"), false );
643 void LauncherSetup::saveTab_PXO()
648 void LauncherSetup::save_settings()
650 const char *ptr = NULL;
653 ptr = os_config_read_string(NULL, "Language", NULL);
656 os_config_write_string(NULL, "Language", ptr);
658 os_config_write_string(NULL, "Language", "");
661 ptr = os_config_read_string(NULL, "LastPlayer", NULL);
664 os_config_write_string(NULL, "LastPlayer", ptr);
666 os_config_write_string(NULL, "LastPlayer", "");
669 ptr = os_config_read_string(NULL, "ExtrasPath", NULL);
672 os_config_write_string(NULL, "ExtrasPath", ptr);
674 os_config_write_string(NULL, "ExtrasPath", "");
677 os_config_write_uint(NULL, "StraightToSetup", 0);
687 // 'Controls' section
697 void LauncherSetup::onOk(wxCommandEvent& WXUNUSED(event))
699 if ( Validate() && TransferDataFromWindow() ) {
705 SetReturnCode(wxID_OK);
711 void LauncherSetup::onToggleMSAA(wxCommandEvent& event)
713 if ( event.IsChecked() ) {
714 m_Video_MSAASamples->Enable();
716 if (m_Video_MSAASamples->GetSelection() == wxNOT_FOUND) {
717 m_Video_MSAASamples->SetSelection(0);
720 m_Video_MSAASamples->Disable();