--- deliantra/Deliantra-Client/bin/cfplus 2007/10/08 17:01:03 1.229 +++ deliantra/Deliantra-Client/bin/cfplus 2007/10/14 10:33:50 1.231 @@ -144,6 +144,7 @@ our $SETUP_DIALOG; our $SETUP_NOTEBOOK; our $SETUP_SERVER; +our $SETUP_LOGIN; our $SETUP_KEYBOARD; our $PL_NOTEBOOK; @@ -728,8 +729,8 @@ } sub stop_game { - $LOGIN_BUTTON->set_text ("Login"); - $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER); + $LOGIN_BUTTON->set_text ("Login / Register"); + $SETUP_NOTEBOOK->set_current_page ($SETUP_LOGIN); $SETUP_DIALOG->show; $PL_WINDOW->hide; $SPELL_LIST->clear_spells; @@ -905,17 +906,18 @@ my ($freq, $format, $chans) = CFPlus::Mix_QuerySpec; $AUDIO_HW_CHUNKSIZE->set_options ([ - [0, "default", "system default"], + [0, "default", "Use System Default"], map { - my $ms = sprintf "%dms", 1000 * $_ / $CFG->{audio_hw_frequency}; + my $ms = sprintf "%dms", 1000 * $_ / ($CFG->{audio_hw_frequency} || 22050); [$_, $ms, "$ms ($_ samples)"], } 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 ]); my $text = !$freq ? "audio is off" - : "Frequency (Hz): $freq\n" - . "Channels: $chans"; + : "audio is enabled\n" + . "frequency (Hz): $freq\n" + . "channels: $chans"; $AUDIO_INFO->set_text ($text); } @@ -973,6 +975,7 @@ c_colspan => 2, expand => 1, value => $CFG->{audio_hw_frequency}, options => [ + [ 0, "default" , "Use System Default"], [11025, "11 kHz" , "11kHz (low quality)"], [22050, "22 kHz" , "22kHz (reduced quality)"], [44100, "44.1 kHz", "44.1kHz (cd quality)"], @@ -991,6 +994,7 @@ c_colspan => 2, expand => 1, value => $CFG->{audio_hw_channels}, options => [ + [0, "default" , "Use System Default"], [1, "Mono" , "Mono (single channel, low quality)"], [2, "Stereo" , "Stereo (dual channe, standard quality)"], [4, "4 Ch Surround", "4 Channel Surround Sound (3d sound, high quality)"], @@ -1011,8 +1015,7 @@ tooltip => "The guarenteed latency. Lower is better, but also more cpu-intensive and might cause stuttering. If music playback " . "is stuttering, increase this value. Values of 50-100ms are optimal.", on_changed => sub { - $CFG->{audio_hw_chunksize} = $_[1] - if $_[1]; + $CFG->{audio_hw_chunksize} = $_[1]; audio_tab_update; 1 } @@ -1447,11 +1450,11 @@ $dialog } -sub server_setup { +sub login_setup { my $vbox = new CFPlus::UI::VBox; $vbox->add (new CFPlus::UI::FancyFrame - label => "Connection Settings", + label => "Login Settings", child => (my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 1]), ); $table->add_at (0, 2, new CFPlus::UI::Label valign => 0, align => 1, text => "Host:Port"); @@ -1496,8 +1499,31 @@ on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{password} = $value; 1 } ); - $table->add_at (0, 7, new CFPlus::UI::Label valign => 0, align => 1, text => "Map Size"); - $table->add_at (1, 7, new CFPlus::UI::Slider + $table->add_at (1, 11, $LOGIN_BUTTON = new CFPlus::UI::Button + expand => 1, + align => 0, + text => "Login / Register", + tooltip => "This button will either login to the account configured above or register a new account.", + on_activate => sub { + $CONN ? stop_game + : start_game; + 1 + }, + ); + + $vbox +} + +sub server_setup { + my $vbox = new CFPlus::UI::VBox; + + $vbox->add (new CFPlus::UI::FancyFrame + label => "Connection Settings", + child => (my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 1]), + ); + + $table->add_at (0, 1, new CFPlus::UI::Label valign => 0, align => 1, text => "Map Size"); + $table->add_at (1, 1, new CFPlus::UI::Slider force_w => 100, range => [$CFG->{mapsize}, 10, 100, 0, 1], tooltip => "This is the size of the portion of the map update the server sends you. " @@ -1507,8 +1533,8 @@ on_changed => sub { my ($self, $value) = @_; $CFG->{mapsize} = $self->{range}[0] = $value = int $value; 1 }, ); - $table->add_at (0, 8, new CFPlus::UI::Label valign => 0, align => 1, text => "Output-Rate"); - $table->add_at (1, 8, new CFPlus::UI::Entry + $table->add_at (0, 2, new CFPlus::UI::Label valign => 0, align => 1, text => "Output-Rate"); + $table->add_at (1, 2, new CFPlus::UI::Entry text => $CFG->{output_rate}, tooltip => "The maximum bandwidth in bytes per second that the server should not exceed " . "when sending data. When 0 or unset, the server " @@ -1517,31 +1543,20 @@ on_changed => sub { $CFG->{output_rate} = $_[1]; 1 }, ); - $table->add_at (0, 9, new CFPlus::UI::Label valign => 0, align => 1, text => "Output-Count"); - $table->add_at (1, 9, new CFPlus::UI::Entry + $table->add_at (0, 3, new CFPlus::UI::Label valign => 0, align => 1, text => "Output-Count"); + $table->add_at (1, 3, new CFPlus::UI::Entry text => $CFG->{output_count}, tooltip => "Should be set to 1 unless you know what you are doing. This option is only used once at log-in.", on_changed => sub { $CFG->{output_count} = $_[1]; 1 }, ); - $table->add_at (0, 10, new CFPlus::UI::Label valign => 0, align => 1, text => "Output-Sync"); - $table->add_at (1, 10, new CFPlus::UI::Entry + $table->add_at (0, 4, new CFPlus::UI::Label valign => 0, align => 1, text => "Output-Sync"); + $table->add_at (1, 4, new CFPlus::UI::Entry text => $CFG->{output_sync}, tooltip => "Should be set to 1 unless you know what you are doing. This option is only used once at log-in.", on_changed => sub { $CFG->{output_sync} = $_[1]; 1 }, ); - $table->add_at (1, 11, $LOGIN_BUTTON = new CFPlus::UI::Button - expand => 1, - align => 0, - text => "Login", - on_activate => sub { - $CONN ? stop_game - : start_game; - 1 - }, - ); - $vbox->add (new CFPlus::UI::FancyFrame label => "Server Info", child => ($SERVER_INFO = new CFPlus::UI::Label ellipsise => 0), @@ -2172,8 +2187,10 @@ $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new CFPlus::UI::Notebook expand => 1, debug => 1, filter => new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); + $SETUP_NOTEBOOK->add_tab (Login => $SETUP_LOGIN = login_setup, + "Configure the server to play on, your username and password."); $SETUP_NOTEBOOK->add_tab (Server => $SETUP_SERVER = server_setup, - "Configure the server to play on, your username, password and other server-related options."); + "Configure other server related options."); $SETUP_NOTEBOOK->add_tab (Client => client_setup, "Configure various client-specific settings."); $SETUP_NOTEBOOK->add_tab (Graphics => graphics_setup, @@ -2353,8 +2370,8 @@ stat_fontsize => 0.7, mapsize => 100, audio_enable => 1, - audio_hw_channels => 2, - audio_hw_frequency => 22050, + audio_hw_channels => 0, + audio_hw_frequency => 0, audio_hw_chunksize => 0, audio_mix_channels => 8, effects_enable => 1,