ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/cfplus
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.101 by elmex, Sun Jul 23 17:03:44 2006 UTC vs.
Revision 1.102 by root, Mon Jul 24 04:24:43 2006 UTC

252 0 252 0
253 }, 253 },
254 ); 254 );
255 255
256 # center: swap stats 256 # center: swap stats
257 my ($sw1, $sw2) = map +(new CFClient::UI::Combobox 257 my ($sw1, $sw2) = map +(new CFClient::UI::Selector
258 expand => 1, 258 expand => 1,
259 value => $_, 259 value => $_,
260 options => [ 260 options => [
261 [1 => "Str", "Strength ($conn->{stat}{+CS_STAT_STR})"], 261 [1 => "Str", "Strength ($conn->{stat}{+CS_STAT_STR})"],
262 [2 => "Dex", "Dexterity ($conn->{stat}{+CS_STAT_DEX})"], 262 [2 => "Dex", "Dexterity ($conn->{stat}{+CS_STAT_DEX})"],
687 can_hover => 1, can_events => 1, 687 can_hover => 1, can_events => 1,
688 tooltip => "The weight of the player including all inventory items."); 688 tooltip => "The weight of the player including all inventory items.");
689 $hb0->add ($STATWIDS->{m_weight} = new CFClient::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1, 689 $hb0->add ($STATWIDS->{m_weight} = new CFClient::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1,
690 can_hover => 1, can_events => 1, 690 can_hover => 1, can_events => 1,
691 tooltip => "The weight limit: you cannot carry more than this."); 691 tooltip => "The weight limit: you cannot carry more than this.");
692
693 692
694 $vb->add (my $hb = new CFClient::UI::HBox expand => 1); 693 $vb->add (my $hb = new CFClient::UI::HBox expand => 1);
695 $hb->add (my $tbl = new CFClient::UI::Table expand => 1); 694 $hb->add (my $tbl = new CFClient::UI::Table expand => 1);
696 695
697 my $color2 = [1, 1, 0]; 696 my $color2 = [1, 1, 0];
1260 }); 1259 });
1261 1260
1262 $table 1261 $table
1263} 1262}
1264 1263
1264my %SORT_ORDER = (
1265 type => undef,
1266 mtime => sub { sort {
1267 ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED)
1268 or $b->{mtime} <=> $a->{mtime}
1269 or $a->{type} <=> $b->{type}
1270 } @_ },
1271 weight => sub { sort {
1272 $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1)
1273 or $a->{type} <=> $b->{type}
1274 } @_ },
1275);
1276
1265sub inventory_widget { 1277sub inventory_widget {
1266 my $hb = new CFClient::UI::HBox homogeneous => 1; 1278 my $hb = new CFClient::UI::HBox homogeneous => 1;
1267 1279
1268 $hb->add (my $vb1 = new CFClient::UI::VBox); 1280 $hb->add (my $vb1 = new CFClient::UI::VBox);
1269 $vb1->add (new CFClient::UI::Label align => 0, text => "Player"); 1281 $vb1->add (new CFClient::UI::Label align => 0, text => "Player");
1270 1282
1271 $vb1->add (my $hb1 = new CFClient::UI::HBox); 1283 $vb1->add (my $hb1 = new CFClient::UI::HBox);
1272 1284
1273 use sort 'stable'; 1285 use sort 'stable';
1274 1286
1275 $hb1->add (new CFClient::UI::Combobox 1287 $hb1->add (new CFClient::UI::Selector
1276 value => undef, 1288 value => $::CFG->{inv_sort},
1277 options => [ 1289 options => [
1278 [undef, "Type/Name"], 1290 [type => "Type/Name"],
1279 [ 1291 [mtime => "Recent/Normal/Locked"],
1280 sub { sort {
1281 $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1)
1282 or $a->{type} <=> $b->{type}
1283 } @_ },
1284 "Weight/Type", 1292 [weight => "Weight/Type"],
1285 ],
1286 [sub { } => "#TODO#"],
1287 ], 1293 ],
1288 on_changed => sub { 1294 on_changed => sub {
1295 $::CFG->{inv_sort} = $_[1];
1289 $INV->set_sort_order ($_[1]); 1296 $INV->set_sort_order ($SORT_ORDER{$_[1]});
1290 }, 1297 },
1291 ); 1298 );
1292 $hb1->add (new CFClient::UI::Label text => "Weight: ", align => 1, expand => 1); 1299 $hb1->add (new CFClient::UI::Label text => "Weight: ", align => 1, expand => 1);
1293 #TODO# update to weigh/maxweight 1300 #TODO# update to weigh/maxweight
1294 $hb1->add ($STATWIDS->{i_weight} = new CFClient::UI::Label align => -1); 1301 $hb1->add ($STATWIDS->{i_weight} = new CFClient::UI::Label align => -1);
1567 $vbox->add (my $buttons = new CFClient::UI::HBox); 1574 $vbox->add (my $buttons = new CFClient::UI::HBox);
1568 $vbox->add (my $viewer = new CFClient::UI::TextScroller 1575 $vbox->add (my $viewer = new CFClient::UI::TextScroller
1569 expand => 1, fontsize => 0.8, padding_x => 4); 1576 expand => 1, fontsize => 0.8, padding_x => 4);
1570 1577
1571 $buttons->add (new CFClient::UI::Label text => "Choose a document to display: "); 1578 $buttons->add (new CFClient::UI::Label text => "Choose a document to display: ");
1572 $buttons->add (my $combo = new CFClient::UI::Combobox 1579 $buttons->add (my $combo = new CFClient::UI::Selector
1573 value => undef, 1580 value => undef,
1574 options => [ 1581 options => [
1575 [intro => "Introduction"], 1582 [intro => "Introduction"],
1576 [manual => "Main Manual"], 1583 [manual => "Main Manual"],
1577 [skill_help => "Skill Reference"], 1584 [skill_help => "Skill Reference"],
1990 bgm_volume => 0.25, 1997 bgm_volume => 0.25,
1991 face_prefetch => 0, 1998 face_prefetch => 0,
1992 output_sync => 1, 1999 output_sync => 1,
1993 output_count => 1, 2000 output_count => 1,
1994 pickup => 0, 2001 pickup => 0,
2002 inv_sort => "mtime",
1995 default => "profile", # default profile 2003 default => "profile", # default profile
1996 ); 2004 );
1997 2005
1998 while (my ($k, $v) = each %DEF_CFG) { 2006 while (my ($k, $v) = each %DEF_CFG) {
1999 $CFG->{$k} = $v unless exists $CFG->{$k}; 2007 $CFG->{$k} = $v unless exists $CFG->{$k};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines