… | |
… | |
39 | my ($self, $command, $tooltip, $widget, $cb) = @_; |
39 | my ($self, $command, $tooltip, $widget, $cb) = @_; |
40 | |
40 | |
41 | (my $data = $command) =~ s/\\//g; |
41 | (my $data = $command) =~ s/\\//g; |
42 | |
42 | |
43 | $tooltip =~ s/^\s+//; |
43 | $tooltip =~ s/^\s+//; |
44 | |
|
|
45 | $tooltip = "<big>$data</big>\n\n$tooltip"; |
44 | $tooltip = "<big>$data</big>\n\n$tooltip"; |
46 | |
|
|
47 | $tooltip =~ s/\s+$//; |
45 | $tooltip =~ s/\s+$//; |
48 | |
46 | |
49 | $self->{completer}{command}{$command} = [$data, $tooltip, $widget, $cb, ++$self->{command_id}]; |
47 | $self->{completer}{command}{$command} = [$data, $tooltip, $widget, $cb, ++$self->{command_id}]; |
50 | } |
48 | } |
51 | |
49 | |
… | |
… | |
136 | $::CONN->user_send ("apply"); |
134 | $::CONN->user_send ("apply"); |
137 | } elsif ($uni == ord ".") { |
135 | } elsif ($uni == ord ".") { |
138 | $::CONN->user_send ($self->{completer}{last_command}) |
136 | $::CONN->user_send ($self->{completer}{last_command}) |
139 | if exists $self->{completer}{last_command}; |
137 | if exists $self->{completer}{last_command}; |
140 | } elsif ($uni == ord "\t") { |
138 | } elsif ($uni == ord "\t") { |
141 | # TODO: toggle inventory |
139 | $::INV_WINDOW->toggle_visibility; |
142 | } elsif ($sym == CFClient::SDLK_KP_PLUS || $uni == ord "+") { |
140 | } elsif ($sym == CFClient::SDLK_KP_PLUS || $uni == ord "+") { |
143 | $::CONN->user_send ("rotateshoottype +"); |
141 | $::CONN->user_send ("rotateshoottype +"); |
144 | } elsif ($sym == CFClient::SDLK_KP_MINUS || $uni == ord "-") { |
142 | } elsif ($sym == CFClient::SDLK_KP_MINUS || $uni == ord "-") { |
145 | $::CONN->user_send ("rotateshoottype -"); |
143 | $::CONN->user_send ("rotateshoottype -"); |
146 | } elsif ($uni == ord '"') { |
144 | } elsif ($uni == ord '"') { |