--- deliantra/Deliantra-Client/DC/MapWidget.pm 2006/05/25 00:26:19 1.36
+++ deliantra/Deliantra-Client/DC/MapWidget.pm 2006/05/25 02:23:14 1.38
@@ -22,6 +22,14 @@
$self->{completer} = new CFClient::MapWidget::Command::
command => $self->{command},
can_focus => 1,
+ tooltip => "The Command Completer\n\n"
+ . "This is your central interface to send text commands to the server. "
+ . "To enter a verbatim command to send to the server, just type the command, "
+ . "followed by a space, and press return. "
+ . "Typing the initial letters of words (or just any letters) displays guesses "
+ . "for commands you might want to use.\n"
+ . "You can use the cursor-up and cursor-down keys to select between those guesses.\n"
+ . "Right-Click opens a menu where you cna select further options, sich as redefining keybindings.",
;
$self
@@ -126,6 +134,9 @@
$::CONN->user_send ("take");
} elsif ($uni == ord " ") {
$::CONN->user_send ("apply");
+ } elsif ($uni == ord ".") {
+ $::CONN->user_send ($self->{completer}{last_command})
+ if exists $self->{completer}{last_command};
} elsif ($uni == ord "\t") {
# TODO: toggle inventory
} elsif ($sym == CFClient::SDLK_KP_PLUS || $uni == ord "+") {
@@ -258,26 +269,26 @@
glEnd;
glDisable GL_BLEND;
- $self->{out_of_focus} ||= do {
- my $label = new CFClient::UI::Label
- x => 0,
- y => 0,
- z => 1,
- ellipsise => 0,
- text => "map out of focus (click map to play)";
-
- $label->show;
- $label->update;
-
- $CFClient::UI::ROOT->on_post_alloc ("$self$label" => sub {
- $label->move (
- ($::WIDTH - $label->{w}) * 0.5,
- ($::HEIGHT - $label->{h}) * 0.5,
- );
- });
-
- $label
- };
+# $self->{out_of_focus} ||= do {
+# my $label = new CFClient::UI::Label
+# x => 0,
+# y => 0,
+# z => 1,
+# ellipsise => 0,
+# text => "map out of focus (click map to play)";
+#
+# $label->show;
+# $label->update;
+#
+# $CFClient::UI::ROOT->on_post_alloc ("$self$label" => sub {
+# $label->move (
+# ($::WIDTH - $label->{w}) * 0.5,
+# ($::HEIGHT - $label->{h}) * 0.5,
+# );
+# });
+#
+# $label
+# };
}
}
@@ -407,6 +418,7 @@
if ($ev->{sym} == 13) {
if (exists $self->{select}) {
+ $self->{last_command} = $self->{select};
$::CONN->user_send ($self->{select});
$self->hide;
}