ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.308 by root, Mon Jun 19 05:18:14 2006 UTC vs.
Revision 1.309 by elmex, Wed Jun 21 12:59:23 2006 UTC

3472 $self->update_binding_widgets; 3472 $self->update_binding_widgets;
3473 3473
3474 $self 3474 $self
3475} 3475}
3476 3476
3477sub cfg_bind {
3478 my ($self, $mod, $sym, $cmds) = @_;
3479 $::CFG->{profile}{default}{bindings}{$mod}{$sym} = $cmds;
3480 ::update_bindings ();
3481}
3482
3483sub cfg_unbind {
3484 my ($self, $mod, $sym, $cmds) = @_;
3485 delete $::CFG->{profile}{default}{bindings}{$mod}{$sym};
3486 ::update_bindings ();
3487}
3488
3477sub commit { 3489sub commit {
3478 my ($self) = @_; 3490 my ($self) = @_;
3479 my ($mod, $sym, $cmds) = $self->get_binding; 3491 my ($mod, $sym, $cmds) = $self->get_binding;
3480 if ($sym != 0 && @$cmds > 0) { 3492 if ($sym != 0 && @$cmds > 0) {
3481 $::STATUSBOX->add ("Bound actions to '".CFClient::Binder::keycombo_to_name ($mod, $sym) 3493 $::STATUSBOX->add ("Bound actions to '".CFClient::Binder::keycombo_to_name ($mod, $sym)
3551 3563
3552# this is a shortcut method that asks for a binding 3564# this is a shortcut method that asks for a binding
3553# and then just binds it. 3565# and then just binds it.
3554sub do_quick_binding { 3566sub do_quick_binding {
3555 my ($self, $cmds, $end_cb) = @_; 3567 my ($self, $cmds, $end_cb) = @_;
3556 $self->set_binding (undef, undef, $cmds, sub { 3568 $self->set_binding (undef, undef, $cmds, sub { $self->cfg_bind (@_) });
3557 $::CFG->{bindings}->{$_[0]}->{$_[1]} = $_[2];
3558 });
3559 $self->ask_for_bind (1, $end_cb); 3569 $self->ask_for_bind (1, $end_cb);
3560} 3570}
3561 3571
3562sub update_binding_widgets { 3572sub update_binding_widgets {
3563 my ($self) = @_; 3573 my ($self) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines