--- deliantra/Deliantra-Client/bin/pclient 2006/04/22 23:11:34 1.160 +++ deliantra/Deliantra-Client/bin/pclient 2006/04/23 01:46:20 1.165 @@ -128,107 +128,146 @@ }); $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); - $table->add (1, $row++, new CFClient::UI::CheckBox state => $CFG->{fast}, connect_changed => sub { - my ($self, $value) = @_; - $CFG->{fast} = $value; - }); + $table->add (1, $row++, new CFClient::UI::CheckBox + state => $CFG->{fast}, + tooltip => "Lower the visual quality considerably to speed up rendering.", + connect_changed => sub { + my ($self, $value) = @_; + $CFG->{fast} = $value; + } + ); $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fog of War"); - $table->add (1, $row++, new CFClient::UI::CheckBox state => $CFG->{fow_enable}, connect_changed => sub { - my ($self, $value) = @_; - $CFG->{fow_enable} = $value; - }); + $table->add (1, $row++, new CFClient::UI::CheckBox + state => $CFG->{fow_enable}, + tooltip => "Fog-of-War marks areas that cannot be seen by the player", + connect_changed => sub { + my ($self, $value) = @_; + $CFG->{fow_enable} = $value; + } + ); $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Intensity"); - $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{fow_intensity}, 0, 1 + 0.001, 0.001], connect_changed => sub { - my ($self, $value) = @_; - $CFG->{fow_intensity} = $value; - }); + $table->add (1, $row++, new CFClient::UI::Slider + range => [$CFG->{fow_intensity}, 0, 1 + 0.001, 0.001], + tooltip => "The higher the intensity, the lighter the Fog-of-War color", + connect_changed => sub { + my ($self, $value) = @_; + $CFG->{fow_intensity} = $value; + } + ); $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Smooth"); - $table->add (1, $row++, new CFClient::UI::CheckBox state => $CFG->{fow_smooth}, connect_changed => sub { - my ($self, $value) = @_; - $CFG->{fow_smooth} = $value; - status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::GL_VERSION < 1.2; - }); + $table->add (1, $row++, new CFClient::UI::CheckBox + state => $CFG->{fow_smooth}, + tooltip => "Smooth the Fog-of-War a bit to make it more realistic", + connect_changed => sub { + my ($self, $value) = @_; + $CFG->{fow_smooth} = $value; + status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::GL_VERSION < 1.2; + } + ); $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); - $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{gui_fontsize}, 0.7, 1.7, 0.1], connect_changed => sub { - $CFG->{gui_fontsize} = 0.1 * int $_[1] * 10; + $table->add (1, $row++, new CFClient::UI::Slider + range => [$CFG->{gui_fontsize}, 0.5, 2, 0.1], + tooltip => "The font size used by most GUI elements", + connect_changed => sub { + $CFG->{gui_fontsize} = 0.1 * int $_[1] * 10; # $FONTSIZE = int $HEIGHT / 40 * $CFG->{gui_fontsize}; - }); + } + ); $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Server Log Fontsize"); - $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{log_fontsize}, 0.7, 1.7, 0.1], connect_changed => sub { - $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = 0.1 * int $_[1] * 10); - }); + $table->add (1, $row++, new CFClient::UI::Slider + range => [$CFG->{log_fontsize}, 0.5, 2, 0.1], + tooltip => "The font size used by the server log window only", + connect_changed => sub { + $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = 0.1 * int $_[1] * 10); + } + ); $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Stats Fontsize"); - $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{stat_fontsize}, 0.7, 1.7, 0.1], connect_changed => sub { - $CFG->{stat_fontsize} = 0.1 * int $_[1] * 10; - &set_stats_window_fontsize; - }); - - $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge width"); - $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{gauge_w_size}, 0.1, 0.5, 0.02], connect_changed => sub { - $CFG->{gauge_w_size} = $_[1]; - my $h = int ($HEIGHT * $CFG->{gauge_size}); - my $w = int ($WIDTH * $CFG->{gauge_w_size}); - $GAUGES->{win}->set_size ($w, $h); - $GAUGES->{win}->{y} = $HEIGHT - $h; - $GAUGES->{win}->{x} = $WIDTH - $w; - $GAUGES->{win}->update; - }); - $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge height"); - $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{gauge_size}, 0.2, 0.8, 0.02], connect_changed => sub { - $CFG->{gauge_size} = $_[1]; - my $h = int ($HEIGHT * $CFG->{gauge_size}); - my $w = int ($WIDTH * $CFG->{gauge_w_size}); - $GAUGES->{win}->set_size ($w, $h); - $GAUGES->{win}->{y} = $HEIGHT - $h; - $GAUGES->{win}->{x} = $WIDTH - $w; - $GAUGES->{win}->update; - }); + $table->add (1, $row++, new CFClient::UI::Slider + range => [$CFG->{stat_fontsize}, 0.5, 2, 0.1], + tooltip => "The font size used by the statistics window only", + connect_changed => sub { + $CFG->{stat_fontsize} = 0.1 * int $_[1] * 10; + &set_stats_window_fontsize; + } + ); + $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge size"); + $table->add (1, $row++, new CFClient::UI::Slider + range => [$CFG->{gauge_size}, 0.2, 0.8, 0.02], + tooltip => "Adjust the size of the stats gauges at the bottom right", + connect_changed => sub { + $CFG->{gauge_size} = $_[1]; + my $h = int $HEIGHT * $CFG->{gauge_size}; + $GAUGES->{win}->set_size ($WIDTH, $h); + $GAUGES->{win}->move (0, $HEIGHT - $h); + } + ); $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); - $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{gauge_fontsize}, 0.7, 1.7, 0.1], connect_changed => sub { - $CFG->{gauge_fontsize} = 0.1 * int $_[1] * 10; - &set_gauge_window_fontsize; - $GAUGES->{win}->check_size; - $GAUGES->{win}->update; - }); - - + $table->add (1, $row++, new CFClient::UI::Slider + range => [$CFG->{gauge_fontsize}, 0.5, 2.0, 0.1], + connect_changed => sub { + $CFG->{gauge_fontsize} = 0.1 * int $_[1] * 10; + &set_gauge_window_fontsize; + #$GAUGES->{win}->check_size; + #$GAUGES->{win}->update; + } + ); - $table->add (1, $row++, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub { - video_shutdown (); - video_init (); - }); + $table->add (1, $row++, new CFClient::UI::Button + expand => 1, align => 0, text => "Apply", + tooltip => "Apply the video settings (unless they are auto-apply)", + connect_activate => sub { + video_shutdown (); + video_init (); + } + ); $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Audio Enable"); - $table->add (1, $row++, new CFClient::UI::CheckBox state => $CFG->{audio_enable}, connect_changed => sub { - $CFG->{audio_enable} = $_[1]; - }); + $table->add (1, $row++, new CFClient::UI::CheckBox + state => $CFG->{audio_enable}, + tooltip => "If enabled, sound effects and music will be played. If disabled, no audio will be used and the soundcard will not be opened.", + connect_changed => sub { + $CFG->{audio_enable} = $_[1]; + } + ); # $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Effects Volume"); # $table->add (1, 8, new CFClient::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], connect_changed => sub { # $CFG->{effects_volume} = $_[1]; # }); $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Background Music"); $table->add (1, $row++, my $hbox = new CFClient::UI::HBox); - $hbox->add (new CFClient::UI::CheckBox expand => 1, state => $CFG->{bgm_enable}, connect_changed => sub { - $CFG->{bgm_enable} = $_[1]; - }); - $hbox->add (new CFClient::UI::Slider expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0.1], connect_changed => sub { - $CFG->{bgm_volume} = $_[1]; - CFClient::MixMusic::volume $_[1] * 128; - }); + $hbox->add (new CFClient::UI::CheckBox + expand => 1, state => $CFG->{bgm_enable}, + tooltip => "Enable background music playing", + connect_changed => sub { + $CFG->{bgm_enable} = $_[1]; + } + ); + $hbox->add (new CFClient::UI::Slider + expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0.1], + tooltip => "The volume of the background music", + connect_changed => sub { + $CFG->{bgm_volume} = $_[1]; + CFClient::MixMusic::volume $_[1] * 128; + } + ); - $table->add (1, $row++, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub { - audio_shutdown (); - audio_init (); - }); + $table->add (1, $row++, new CFClient::UI::Button + expand => 1, align => 0, text => "Apply", + tooltip => "Apply the audio settings that are not auto-apply", + connect_activate => sub { + audio_shutdown (); + audio_init (); + } + ); $dialog } @@ -247,25 +286,31 @@ sub make_gauge_window { my $gh = int ($HEIGHT * $CFG->{gauge_size}); - my $gw = int ($WIDTH * $CFG->{gauge_w_size}); +# my $gw = int ($WIDTH * $CFG->{gauge_w_size}); my $win = new CFClient::UI::Frame ( - y => $HEIGHT - $gh, x => $WIDTH - $gw, req_w => $gw, req_h => $gh + y => $HEIGHT - $gh, x => 0, req_w => $WIDTH, req_h => $gh ); $win->add (my $vb = new CFClient::UI::VBox); - $vb->add (my $hb = new CFClient::UI::HBox expand => 1); - $hb->add (my $hg = new CFClient::UI::Gauge type => 'hp', expand => 1); - $hb->add (my $mg = new CFClient::UI::Gauge type => 'mana', expand => 1); - $hb->add (my $gg = new CFClient::UI::Gauge type => 'grace', expand => 1); - $hb->add (my $fg = new CFClient::UI::Gauge type => 'food', expand => 1); - $vb->add (my $exp = new CFClient::UI::Label valign => 0, align => -1, text => "XP:"); - $vb->add (my $lvl = new CFClient::UI::Label valign => 0, align => -1, text => "Lvl:"); - $vb->add (my $rng = new CFClient::UI::Label valign => 0, align => -1, text => "Rng:"); + $vb->add (my $hbg = new CFClient::UI::HBox expand => 1); + + + $hbg->add (new CFClient::UI::Empty expand => 1); + $hbg->add (my $hb = new CFClient::UI::HBox); + $hb->add (my $hg = new CFClient::UI::Gauge type => 'hp'); + $hb->add (my $mg = new CFClient::UI::Gauge type => 'mana'); + $hb->add (my $gg = new CFClient::UI::Gauge type => 'grace'); + $hb->add (my $fg = new CFClient::UI::Gauge type => 'food'); + + $vb->add (my $exp = new CFClient::UI::Label valign => 0, align => 1, text => "XP:"); +# $vb->add (my $lvl = new CFClient::UI::Label valign => 0, align => 1, text => "Lvl:"); + $vb->add (my $rng = new CFClient::UI::Label valign => 0, align => 1, text => "Rng:"); $GAUGES = { - exp => $exp, lvl => $lvl, win => $win, range => $rng, + exp => $exp,# lvl => $lvl, + win => $win, range => $rng, food => $fg, mana => $mg, hp => $hg, grace => $gg }; $win @@ -322,7 +367,7 @@ drain acid pois para deat phys blind fear tund elec cold ghit/) { - $tbl2->add ($col , $row, + $tbl2->add ($col, $row, $STATWIDS->{"res_$_"} = new CFClient::UI::Label text => "0", align => +1, valign => 0 ); @@ -358,12 +403,15 @@ $GAUGES->{mana} ->set_value ($sp, $sp_m); $GAUGES->{food} ->set_value ($fo, $fo_m); $GAUGES->{grace} ->set_value ($gr, $gr_m); - $GAUGES->{exp} ->set_text ("XP: " . ($stats->{11} || $stats->{28})); + $GAUGES->{exp} ->set_text ("XP: " . ($stats->{11} || $stats->{28}) * 1 + ." LVL: " . $stats->{12} * 1); my $rng = $stats->{20}; $rng =~ s/^Range: //; # thank you so much dear server $GAUGES->{range} ->set_text ("Rng: " . $rng); - $GAUGES->{lvl} ->set_text ("LVL: " . $stats->{12}); - $STATWIDS->{title} ->set_text ("Title: " . $stats->{21}); +# $GAUGES->{lvl} ->set_text ("LVL: " . $stats->{12}); + my $title = $stats->{21}; + $title =~ s/^Player: //; + $STATWIDS->{title} ->set_text ("Title: " . $title); if (0) { # this code can vanish, just wanted to preserver it for a checkin $STATWIDS->{st_str} ->set_text (sprintf "S%d", $stats->{5}); @@ -410,6 +458,7 @@ para => 111, tund => 112, fear => 113, + depl => 113, deat => 115, holyw => 116, blind => 117 @@ -1116,7 +1165,6 @@ log_fontsize => 1, gauge_fontsize => 1, gauge_size => 0.35, - gauge_w_size => 0.14, stat_fontsize => 1, mapsize => 100, host => "crossfire.schmorp.de",