--- deliantra/Deliantra-Client/bin/cfplus 2006/06/20 08:49:40 1.76 +++ deliantra/Deliantra-Client/bin/cfplus 2006/06/26 21:59:04 1.80 @@ -38,6 +38,7 @@ use CFClient::OpenGL (); use CFClient::Protocol; use CFClient::UI; +use CFClient::BindingEditor; use CFClient::MapWidget; $SIG{QUIT} = sub { Carp::cluck "QUIT" }; @@ -117,6 +118,7 @@ our $INV_RIGHT_HB; our $BIND_EDITOR; +our $BIND_UPD_CB; our $PICKUP_CFG; @@ -750,7 +752,7 @@ font => $FONT_FIXED, can_hover => 1, can_events => 1, - image => "ui/resist/resist_$_.png", + path => "ui/resist/resist_$_.png", tooltip => $resist_names{$_}, ); @@ -947,6 +949,7 @@ z => 3, force_h => $::HEIGHT * 0.4, child => (my $vbox = new CFClient::UI::VBox), + has_close_button => 1, on_visibility_change => sub { update_metaserver if $_[1]; 0 @@ -1303,11 +1306,15 @@ new CFClient::UI::SpellList } +sub update_bindings { + $BIND_UPD_CB->() if $BIND_UPD_CB; +} + sub keyboard_setup { my $binding_list = new CFClient::UI::VBox; my $refresh; - $refresh = sub { + $refresh = $BIND_UPD_CB = sub { $binding_list->clear (); for my $mod (keys %{$::CFG->{profile}{default}{bindings}}) { @@ -1335,8 +1342,8 @@ $mod, $sym, $::CFG->{profile}{default}{bindings}{$mod}{$sym}, sub { my ($nmod, $nsym, $ncmds) = @_; - delete $::CFG->{profile}{default}{bindings}{$mod}{$sym}; - $::CFG->{profile}{default}{bindings}{$nmod}{$nsym} = $ncmds; + $::BIND_EDITOR->cfg_unbind ($mod, $sym); + $::BIND_EDITOR->cfg_bind ($nmod, $nsym, $ncmds); $refresh->(); $SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD); $SETUP_DIALOG->show; @@ -1380,7 +1387,7 @@ $::BIND_EDITOR->set_binding (undef, undef, [], sub { my ($mod, $sym, $cmds) = @_; - $::CFG->{profile}{default}{bindings}{$mod}{$sym} = $cmds; + $::BIND_EDITOR->cfg_bind ($mod, $sym, $cmds); $refresh->(); $SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD); $SETUP_DIALOG->show; @@ -1432,9 +1439,9 @@ value => undef, options => [ [intro => "Introduction"], - [manual => "Manual"], - [skill_help => "Skills"], - [command_help => "Commands"], + [manual => "Main Manual"], + [skill_help => "Skill Reference"], + [command_help => "Command Reference"], [dmcommand_help => "DM Commands"], [COPYING => "License Terms"], ], @@ -1445,11 +1452,17 @@ doc_viewer => 1, sub { CFClient::pod_to_pango_list $_[0] }; $viewer->clear; + +# $viewer->add_paragraph ([1, 1, 1, 1], ["Test\n\n \x{fffc} \x{fffc}\n", +# (new CFClient::UI::Image path => "x.png", can_hover => 1, can_events => 1), +# (new CFClient::UI::Label text => "üüüü", can_hover => 1, can_events => 1, tooltip => "??"), +# ]);#d# $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) for @$pom; $viewer->set_offset (0); + 0 }, on_visibility_change => sub { @@ -1506,7 +1519,7 @@ force_y => 0; $DEBUG_STATUS->show; - $BIND_EDITOR = new CFClient::UI::BindEditor (x => "max", y => 0); + $BIND_EDITOR = new CFClient::BindingEditor (x => "max", y => 0); $STATUSBOX = new CFClient::UI::Statusbox; $STATUSBOX->add ("Use Alt-Enter to toggle fullscreen mode", timeout => 864000, pri => -100, color => [1, 1, 1, 0.8]);