… | |
… | |
123 | |
123 | |
124 | our $INVENTORY_PAGE; |
124 | our $INVENTORY_PAGE; |
125 | our $STATS_PAGE; |
125 | our $STATS_PAGE; |
126 | our $SKILL_PAGE; |
126 | our $SKILL_PAGE; |
127 | our $SPELL_PAGE; |
127 | our $SPELL_PAGE; |
|
|
128 | our $SPELL_LIST; |
128 | |
129 | |
129 | our $HELP_WINDOW; |
130 | our $HELP_WINDOW; |
130 | our $MESSAGE_WINDOW; |
131 | our $MESSAGE_WINDOW; |
131 | our $FLOORBOX; |
132 | our $FLOORBOX; |
132 | our $GAUGES; |
133 | our $GAUGES; |
… | |
… | |
1263 | $table |
1264 | $table |
1264 | } |
1265 | } |
1265 | |
1266 | |
1266 | my %SORT_ORDER = ( |
1267 | my %SORT_ORDER = ( |
1267 | type => undef, |
1268 | type => undef, |
1268 | mtime => sub { sort { |
1269 | mtime => sub { |
|
|
1270 | my $NOW = time; |
|
|
1271 | sort { |
|
|
1272 | my $atime = $a->{mtime} - $NOW; $atime = $atime < 5 * 60 ? int $atime / 60 : 6; |
|
|
1273 | my $btime = $b->{mtime} - $NOW; $btime = $btime < 5 * 60 ? int $btime / 60 : 6; |
|
|
1274 | |
1269 | ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED) |
1275 | ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED) |
1270 | or $b->{mtime} <=> $a->{mtime} |
1276 | or $btime <=> $atime |
1271 | or $a->{type} <=> $b->{type} |
1277 | or $a->{type} <=> $b->{type} |
|
|
1278 | } @_ |
1272 | } @_ }, |
1279 | }, |
1273 | weight => sub { sort { |
1280 | weight => sub { sort { |
1274 | $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1) |
1281 | $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1) |
1275 | or $a->{type} <=> $b->{type} |
1282 | or $a->{type} <=> $b->{type} |
1276 | } @_ }, |
1283 | } @_ }, |
1277 | ); |
1284 | ); |
… | |
… | |
1352 | $ntb->add ( |
1359 | $ntb->add ( |
1353 | "Skills (F3)" => $SKILL_PAGE = skill_window, |
1360 | "Skills (F3)" => $SKILL_PAGE = skill_window, |
1354 | "Shows all your Skills." |
1361 | "Shows all your Skills." |
1355 | ); |
1362 | ); |
1356 | |
1363 | |
1357 | my $spellsw = new CFPlus::UI::ScrolledWindow (expand => 1, scroll_y => 1); |
1364 | my $spellsw = $SPELL_PAGE = new CFPlus::UI::ScrolledWindow (expand => 1, scroll_y => 1); |
1358 | $spellsw->add ($SPELL_PAGE = new CFPlus::UI::SpellList); |
1365 | $spellsw->add ($SPELL_LIST = new CFPlus::UI::SpellList); |
1359 | $ntb->add ( |
1366 | $ntb->add ( |
1360 | "Spellbook (F4)" => $spellsw, |
1367 | "Spellbook (F4)" => $spellsw, |
1361 | "Displays all spells you have and lets you edit keyboard shortcuts for them." |
1368 | "Displays all spells you have and lets you edit keyboard shortcuts for them." |
1362 | ); |
1369 | ); |
1363 | $ntb->add ( |
1370 | $ntb->add ( |
… | |
… | |
1916 | |
1923 | |
1917 | audio_music_finished; |
1924 | audio_music_finished; |
1918 | |
1925 | |
1919 | local $_; |
1926 | local $_; |
1920 | while (<$fh>) { |
1927 | while (<$fh>) { |
1921 | last; |
|
|
1922 | next if /^\s*#/; |
1928 | next if /^\s*#/; |
1923 | next if /^\s*$/; |
1929 | next if /^\s*$/; |
1924 | |
1930 | |
1925 | my ($file, $volume, $event) = split /\s+/, $_, 3; |
1931 | my ($file, $volume, $event) = split /\s+/, $_, 3; |
1926 | |
1932 | |