--- deliantra/Deliantra-Client/DC.pm 2006/12/06 00:04:13 1.132
+++ deliantra/Deliantra-Client/DC.pm 2006/12/07 03:54:47 1.134
@@ -51,6 +51,16 @@
${$_[0]}->()
}
+=item shorten $string[, $maxlength]
+
+=cut
+
+sub shorten($;$) {
+ my ($str, $len) = @_;
+ substr $str, $len, (length $str), "..." if $len + 3 <= length $str;
+ $str
+}
+
sub asxml($) {
local $_ = $_[0];
@@ -277,7 +287,7 @@
$DB_ENV = new BerkeleyDB::Env
-Home => $HOME,
-Cachesize => 1_000_000,
- -ErrFile => "$Crossfire::VARDIR/cfplus/errorlog.txt",
+ -ErrFile => "$HOME/errorlog.txt",
# -ErrPrefix => "DATABASE",
-Verbose => 1,
-Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | $recover,
@@ -393,6 +403,8 @@
$move_prefix = "take";
}
+ my $shortname = CFPlus::shorten $self->{name}, 14;
+
my @menu_items = (
["examine", sub { $::CONN->send ("examine $self->{tag}") }],
["mark", sub { $::CONN->send ("mark ". pack "N", $self->{tag}) }],
@@ -437,7 +449,7 @@
]
)
),
- ["bind apply $self->{name} to a key" => sub { $::BIND_EDITOR->do_quick_binding (["apply $self->{name}"]) }],
+ ["bind apply $shortname to a key" => sub { $::BIND_EDITOR->do_quick_binding (["apply $self->{name}"]) }],
);
CFPlus::UI::Menu->new (items => \@menu_items)->popup ($ev);