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.125 by root, Thu Nov 16 19:42:46 2006 UTC vs.
Revision 1.132 by root, Mon Nov 20 16:41:46 2006 UTC

21 } 21 }
22} 22}
23 23
24use strict; 24use strict;
25use utf8; 25use utf8;
26
27use Carp 'verbose';
26 28
27# do things only needed for single-binary version (par) 29# do things only needed for single-binary version (par)
28BEGIN { 30BEGIN {
29 if (%PAR::LibCache) { 31 if (%PAR::LibCache) {
30 @INC = grep ref, @INC; # weed out all paths except pars loader refs 32 @INC = grep ref, @INC; # weed out all paths except pars loader refs
66$SIG{QUIT} = sub { Carp::cluck "QUIT" }; 68$SIG{QUIT} = sub { Carp::cluck "QUIT" };
67$SIG{PIPE} = 'IGNORE'; 69$SIG{PIPE} = 'IGNORE';
68 70
69$Event::Eval = 0; 71$Event::Eval = 0;
70$Event::DIED = sub { 72$Event::DIED = sub {
71 # TODO: display dialog box or so 73 CFPlus::fatal Carp::longmess $_[1]
72 Carp::cluck $_[1];#d#TODO: remove when stable
73 return;#d#
74 CFPlus::fatal ($_[1]);
75}; 74};
76 75
77my $MAX_FPS = 60; 76my $MAX_FPS = 60;
78my $MIN_FPS = 5; # unused as of yet 77my $MIN_FPS = 5; # unused as of yet
79 78
123 122
124our $INVENTORY_PAGE; 123our $INVENTORY_PAGE;
125our $STATS_PAGE; 124our $STATS_PAGE;
126our $SKILL_PAGE; 125our $SKILL_PAGE;
127our $SPELL_PAGE; 126our $SPELL_PAGE;
127our $SPELL_LIST;
128 128
129our $HELP_WINDOW; 129our $HELP_WINDOW;
130our $MESSAGE_WINDOW; 130our $MESSAGE_WINDOW;
131our $FLOORBOX; 131our $FLOORBOX;
132our $GAUGES; 132our $GAUGES;
429sub stop_game { 429sub stop_game {
430 $LOGIN_BUTTON->set_text ("Login"); 430 $LOGIN_BUTTON->set_text ("Login");
431 $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER); 431 $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER);
432 $SETUP_DIALOG->show; 432 $SETUP_DIALOG->show;
433 $PL_WINDOW->hide; 433 $PL_WINDOW->hide;
434 $SPELL_PAGE->clear_spells; 434 $SPELL_LIST->clear_spells;
435 435
436 return unless $CONN; 436 return unless $CONN;
437 437
438 status "connection closed"; 438 status "connection closed";
439 439
666 $table->add (1, 1, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 2; 0 }); 666 $table->add (1, 1, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 2; 0 });
667 $table->add (0, 2, new CFPlus::UI::Label text => "Show FPS"); 667 $table->add (0, 2, new CFPlus::UI::Label text => "Show FPS");
668 $table->add (1, 2, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4; 0 }); 668 $table->add (1, 2, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4; 0 });
669 $table->add (0, 3, new CFPlus::UI::Label text => "Suppress Tooltips"); 669 $table->add (0, 3, new CFPlus::UI::Label text => "Suppress Tooltips");
670 $table->add (1, 3, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 }); 670 $table->add (1, 3, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 });
671 $table->add (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { die "violator" } );
671 672
672 my @default_smooth = (0.05, 0.13, 0.05, 0.13, 0.30, 0.13, 0.05, 0.13, 0.05); 673 my @default_smooth = (0.05, 0.13, 0.05, 0.13, 0.30, 0.13, 0.05, 0.13, 0.05);
673 674
674 for my $x (0..2) { 675 for my $x (0..2) {
675 for my $y (0 .. 2) { 676 for my $y (0 .. 2) {
1263 $table 1264 $table
1264} 1265}
1265 1266
1266my %SORT_ORDER = ( 1267my %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);
1302 #TODO# update to weigh/maxweight 1309 #TODO# update to weigh/maxweight
1303 $hb1->add ($STATWIDS->{i_weight} = new CFPlus::UI::Label align => -1); 1310 $hb1->add ($STATWIDS->{i_weight} = new CFPlus::UI::Label align => -1);
1304 1311
1305 $vb1->add (my $sw1 = new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1); 1312 $vb1->add (my $sw1 = new CFPlus::UI::ScrolledWindow expand => 1, scroll_y => 1);
1306 $sw1->add ($INV = new CFPlus::UI::Inventory); 1313 $sw1->add ($INV = new CFPlus::UI::Inventory);
1314 $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}});
1307 1315
1308 $hb->add (my $vb2 = new CFPlus::UI::VBox); 1316 $hb->add (my $vb2 = new CFPlus::UI::VBox);
1309 1317
1310 $vb2->add ($INV_RIGHT_HB = new CFPlus::UI::HBox); 1318 $vb2->add ($INV_RIGHT_HB = new CFPlus::UI::HBox);
1311 1319
1351 $ntb->add ( 1359 $ntb->add (
1352 "Skills (F3)" => $SKILL_PAGE = skill_window, 1360 "Skills (F3)" => $SKILL_PAGE = skill_window,
1353 "Shows all your Skills." 1361 "Shows all your Skills."
1354 ); 1362 );
1355 1363
1356 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);
1357 $spellsw->add ($SPELL_PAGE = new CFPlus::UI::SpellList); 1365 $spellsw->add ($SPELL_LIST = new CFPlus::UI::SpellList);
1358 $ntb->add ( 1366 $ntb->add (
1359 "Spellbook (F4)" => $spellsw, 1367 "Spellbook (F4)" => $spellsw,
1360 "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."
1361 ); 1369 );
1362 $ntb->add ( 1370 $ntb->add (
1913 CFPlus::Mix_AllocateChannels 8; 1921 CFPlus::Mix_AllocateChannels 8;
1914 CFPlus::MixMusic::volume $CFG->{bgm_volume} * 128; 1922 CFPlus::MixMusic::volume $CFG->{bgm_volume} * 128;
1915 1923
1916 audio_music_finished; 1924 audio_music_finished;
1917 1925
1926 local $_;
1918 while (<$fh>) { 1927 while (<$fh>) {
1919 next if /^\s*#/; 1928 next if /^\s*#/;
1920 next if /^\s*$/; 1929 next if /^\s*$/;
1921 1930
1922 my ($file, $volume, $event) = split /\s+/, $_, 3; 1931 my ($file, $volume, $event) = split /\s+/, $_, 3;
2056 log_fontsize => 0.7, 2065 log_fontsize => 0.7,
2057 gauge_fontsize => 1, 2066 gauge_fontsize => 1,
2058 gauge_size => 0.35, 2067 gauge_size => 0.35,
2059 stat_fontsize => 0.7, 2068 stat_fontsize => 0.7,
2060 mapsize => 100, 2069 mapsize => 100,
2061 say_command => 'say', 2070 say_command => 'chat',
2062 audio_enable => 1, 2071 audio_enable => 1,
2063 bgm_enable => 1, 2072 bgm_enable => 1,
2064 bgm_volume => 0.25, 2073 bgm_volume => 0.25,
2065 face_prefetch => 0, 2074 face_prefetch => 0,
2066 output_sync => 1, 2075 output_sync => 1,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines