--- deliantra/Deliantra-Client/bin/deliantra 2009/01/11 03:19:47 1.85 +++ deliantra/Deliantra-Client/bin/deliantra 2009/01/12 03:11:05 1.89 @@ -1638,7 +1638,7 @@ $table->add_at (0, 4, new DC::UI::Label align => 1, text => "Username"); $table->add_at (1, 4, new DC::UI::Entry text => $CFG->{profile}{default}{user}, - tooltip => "The name of your character on the server.", + tooltip => "The name of your character on the server. The name is case-sensitive!", on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{user} = $value; 1 } ); @@ -1811,8 +1811,7 @@ for ( ["General", 0, 0, - ["Enable autopickup" => PICKUP_NEWMODE, \$PICKUP_ENABLE], - ["Inhibit autopickup" => PICKUP_INHIBIT], +# ["Inhibit autopickup" => PICKUP_INHIBIT], ["Stop before pickup" => PICKUP_STOP], ["Debug autopickup" => PICKUP_DEBUG], ], @@ -1870,7 +1869,7 @@ $::CFG->{pickup} &= ~$mask; } - $::CONN->send_command ("pickup $::CFG->{pickup}") + $::CONN->send_pickup ($::CFG->{pickup}) if defined $::CONN; 0 @@ -1897,7 +1896,7 @@ $table->add_at (3, 18, new DC::UI::Button text => "set", on_activate => sub { - $::CONN->send_command ("pickup $::CFG->{pickup}") + $::CONN->send_pickup ($::CFG->{pickup}) if defined $::CONN; 0 }); @@ -2070,7 +2069,7 @@ DC::Macro::keyboard_setup } -sub help_window { +sub make_help_window { my $win = new DC::UI::Toplevel x => 'center', y => 'center', @@ -2169,7 +2168,7 @@ $win->show; }; - $win + $HELP_WINDOW = $win; } sub open_quit_dialog { @@ -2212,7 +2211,7 @@ $QUIT_DIALOG->grab_focus; } -sub make_menuframe { +sub make_menubar { $MENUFRAME = new DC::UI::Toplevel border => 0, force_x => 0, @@ -2232,10 +2231,14 @@ make_playerbook; $MENUPOPUP = DC::UI::Menu->new (items => [ - ["Setup…" , sub { $SETUP_DIALOG->toggle_visibility}], - ["Playerbook…\tTab", sub { $PL_WINDOW ->toggle_visibility}], - ["Help Browser…" , sub { $HELP_WINDOW ->toggle_visibility}], - ["Quit…" , sub { + ["Setup…\tF9" , sub { $SETUP_DIALOG->toggle_visibility }], + ["Playerbook…\tTab" , sub { $PL_WINDOW ->toggle_visibility }], + ["…Statistics\tF2" , sub { toggle_player_page ($::STATS_PAGE) }], + ["…Skills\tF3" , sub { toggle_player_page ($::SKILL_PAGE) }], + ["…Spells\tF4" , sub { toggle_player_page ($::SPELL_PAGE) }], + ["…Inventory\tF5" , sub { toggle_player_page ($::INVENTORY_PAGE) }], + ["Help Browser…\tF1" , sub { $HELP_WINDOW ->toggle_visibility }], + ["Quit…" , sub { if ($CONN) { open_quit_dialog; } else { @@ -2246,29 +2249,45 @@ $BUTTONBAR->add (new DC::UI::Button text => "Menu…", tooltip => "Shows the main menu", - on_button_down => sub { $MENUPOPUP->popup ($_[1]) }, + on_button_down => sub { + my ($self, $ev) = @_; + local $ev->{x} = 0; + local $ev->{y} = 0; + $MENUPOPUP->popup ($ev); + }, ); - $MENUBAR->add ($GAUGES->{prg} = new DC::UI::ExperienceProgress - c_rescale => 1, + $MENUBAR->add ($GAUGES->{exp} = new DC::UI::ExperienceProgress padding_x => 6, padding_y => 3, - force_w => $::WIDTH * 0.1, tooltip => "This progress bar shows your progress towards the next character level.", + template => " Exp: 888,888,888,888 (lvl 188) ", ); - $MENUBAR->add ($GAUGES->{exp} = new DC::UI::Label - align => 1, can_hover => 1, can_events => 1, - text => "Total Experience", - tooltip => "#stat_exp", - fontsize => 0.8, + + $MENUBAR->add ($PICKUP_ENABLE = new DC::UI::CheckBox # checkbox bad, button better? + tooltip => "Automatic Pickup Enable - when this checkbox is enabled, then your character " + . "will automatically pick up items as defined by your item pickup settings " + . "in the playerbook. Often (e.g. in apartments) you want to temporarily " + . "disable autopickup by disabling this checkbox.", + state => $CFG->{pickup} & PICKUP_INHIBIT ? 0 : 1, + on_changed => sub { + my ($self, $value) = @_; + $CFG->{pickup} &= ~PICKUP_INHIBIT; + $CFG->{pickup} |= PICKUP_INHIBIT unless $_[1]; + $CONN->send_pickup ($CFG->{pickup}) + if $CONN; + }, ); - $MENUBAR->add ($GAUGES->{sklprg} = new DC::UI::ExperienceProgress + + $MENUBAR->add ($GAUGES->{skillexp} = new DC::UI::ExperienceProgress c_rescale => 1, padding_x => 6, padding_y => 3, force_w => $::WIDTH * 0.2, tooltip => "This progress bar shows the currently used skill and your progress towards the next skill level of that skill.", + template => "two handed weapons 99%", ); + $MENUBAR->add ($GAUGES->{range} = new DC::UI::Label expand => 1, align => 1, can_hover => 1, can_events => 1, @@ -2532,7 +2551,8 @@ $SETUP_NOTEBOOK->add_tab (Debug => debug_setup, "Some debuggin' options. Do not ask."); - make_menuframe; + make_help_window; + make_menubar; $SETUP_DIALOG->show; $MESSAGE_WINDOW->show; @@ -2708,7 +2728,7 @@ bgm_enable => 1, bgm_volume => 0.5, output_rate => "", - pickup => 0, + pickup => PICKUP_SPELLBOOK | PICKUP_SKILLSCROLL | PICKUP_VALUABLES, inv_sort => "mtime", default => "profile", # default profile show_tips => 1,