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.126 by root, Sat Nov 18 18:19:05 2006 UTC vs.
Revision 1.130 by root, Sun Nov 19 19:43:53 2006 UTC

1263 $table 1263 $table
1264} 1264}
1265 1265
1266my %SORT_ORDER = ( 1266my %SORT_ORDER = (
1267 type => undef, 1267 type => undef,
1268 mtime => sub { sort { 1268 mtime => sub {
1269 my $NOW = time;
1270 sort {
1271 my $atime = $a->{mtime} - $NOW; $atime = $atime < 5 * 60 ? int $atime / 60 : 6;
1272 my $btime = $b->{mtime} - $NOW; $btime = $btime < 5 * 60 ? int $btime / 60 : 6;
1273
1269 ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED) 1274 ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED)
1270 or $b->{mtime} <=> $a->{mtime} 1275 or $btime <=> $atime
1271 or $a->{type} <=> $b->{type} 1276 or $a->{type} <=> $b->{type}
1277 } @_
1272 } @_ }, 1278 },
1273 weight => sub { sort { 1279 weight => sub { sort {
1274 $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1) 1280 $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1)
1275 or $a->{type} <=> $b->{type} 1281 or $a->{type} <=> $b->{type}
1276 } @_ }, 1282 } @_ },
1277); 1283);
1302 #TODO# update to weigh/maxweight 1308 #TODO# update to weigh/maxweight
1303 $hb1->add ($STATWIDS->{i_weight} = new CFPlus::UI::Label align => -1); 1309 $hb1->add ($STATWIDS->{i_weight} = new CFPlus::UI::Label align => -1);
1304 1310
1305 $vb1->add (my $sw1 = new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); 1311 $vb1->add (my $sw1 = new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1);
1306 $sw1->add ($INV = new CFPlus::UI::Inventory); 1312 $sw1->add ($INV = new CFPlus::UI::Inventory);
1313 $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}});
1307 1314
1308 $hb->add (my $vb2 = new CFPlus::UI::VBox); 1315 $hb->add (my $vb2 = new CFPlus::UI::VBox);
1309 1316
1310 $vb2->add ($INV_RIGHT_HB = new CFPlus::UI::HBox); 1317 $vb2->add ($INV_RIGHT_HB = new CFPlus::UI::HBox);
1311 1318
1913 CFPlus::Mix_AllocateChannels 8; 1920 CFPlus::Mix_AllocateChannels 8;
1914 CFPlus::MixMusic::volume $CFG->{bgm_volume} * 128; 1921 CFPlus::MixMusic::volume $CFG->{bgm_volume} * 128;
1915 1922
1916 audio_music_finished; 1923 audio_music_finished;
1917 1924
1925 local $_;
1918 while (<$fh>) { 1926 while (<$fh>) {
1919 next if /^\s*#/; 1927 next if /^\s*#/;
1920 next if /^\s*$/; 1928 next if /^\s*$/;
1921 1929
1922 my ($file, $volume, $event) = split /\s+/, $_, 3; 1930 my ($file, $volume, $event) = split /\s+/, $_, 3;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines