1 | #!/opt/bin/perl |
1 | #!/opt/bin/perl |
2 | |
2 | |
3 | my $startup_done = sub { }; |
3 | my $startup_done = sub { }; |
|
|
4 | our $PANGO = "1.5.0"; |
4 | |
5 | |
5 | # do splash-screen thingy on win32 |
6 | # do splash-screen thingy on win32 |
6 | BEGIN { |
7 | BEGIN { |
7 | if (%PAR::LibCache && $^O eq "MSWin32") { |
8 | if (%PAR::LibCache && $^O eq "MSWin32") { |
8 | while (my ($filename, $zip) = each %PAR::LibCache) { |
9 | while (my ($filename, $zip) = each %PAR::LibCache) { |
… | |
… | |
43 | |
44 | |
44 | if ($^O eq "MSWin32") { |
45 | if ($^O eq "MSWin32") { |
45 | # relocatable |
46 | # relocatable |
46 | } else { |
47 | } else { |
47 | # unix, need to patch pango rc file |
48 | # unix, need to patch pango rc file |
48 | open my $fh, "<:perlio", "$tmp/usr/lib/pango/1.5.0/module-files.d/libpango1.0-0.modules" |
49 | open my $fh, "<:perlio", "$tmp/usr/lib/pango/$PANGO/module-files.d/libpango1.0-0.modules" |
49 | or die "$tmp/usr/lib/1.5.0/module-files.d/libpango1.0-0.modules: $!"; |
50 | or die "$tmp/usr/lib/$PANGO/module-files.d/libpango1.0-0.modules: $!"; |
50 | local $/; |
51 | local $/; |
51 | my $rc = <$fh>; |
52 | my $rc = <$fh>; |
52 | $rc =~ s/^\//$tmp\//gm; # replace abs paths by relative ones |
53 | $rc =~ s/^\//$tmp\//gm; # replace abs paths by relative ones |
53 | |
54 | |
54 | mkdir "$tmp/pango-modules"; |
55 | mkdir "$tmp/pango-modules"; |
… | |
… | |
444 | |
445 | |
445 | my ($host, $port) = split /:/, $PROFILE->{host}; |
446 | my ($host, $port) = split /:/, $PROFILE->{host}; |
446 | |
447 | |
447 | $MAP = new CFPlus::Map; |
448 | $MAP = new CFPlus::Map; |
448 | |
449 | |
|
|
450 | warn "connecting...\n";#d# |
449 | $CONN = eval { |
451 | $CONN = eval { |
450 | new CFPlus::Protocol |
452 | new CFPlus::Protocol |
451 | host => $host, |
453 | host => $host, |
452 | port => $port || 13327, |
454 | port => $port || 13327, |
453 | user => $PROFILE->{user}, |
455 | user => $PROFILE->{user}, |
… | |
… | |
478 | or return; |
480 | or return; |
479 | |
481 | |
480 | $chunk->play; |
482 | $chunk->play; |
481 | }, |
483 | }, |
482 | }; |
484 | }; |
|
|
485 | warn "connected<$CONN,$@>\n";#d# |
483 | |
486 | |
484 | if ($CONN) { |
487 | if ($CONN) { |
485 | CFPlus::lowdelay fileno $CONN->{fh}; |
488 | CFPlus::lowdelay fileno $CONN->{fh}; |
486 | |
489 | |
487 | status "login successful"; |
490 | status "login successful"; |
… | |
… | |
495 | $LOGIN_BUTTON->set_text ("Login"); |
498 | $LOGIN_BUTTON->set_text ("Login"); |
496 | $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER); |
499 | $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER); |
497 | $SETUP_DIALOG->show; |
500 | $SETUP_DIALOG->show; |
498 | $PL_WINDOW->hide; |
501 | $PL_WINDOW->hide; |
499 | $SPELL_LIST->clear_spells; |
502 | $SPELL_LIST->clear_spells; |
|
|
503 | $CFPlus::UI::ROOT->emit (stop_game => ! ! $CONN); |
500 | |
504 | |
501 | return unless $CONN; |
505 | return unless $CONN; |
502 | |
506 | |
503 | status "connection closed"; |
507 | status "connection closed"; |
504 | |
508 | |
… | |
… | |
745 | $table->add (1, 1, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 2; 0 }); |
749 | $table->add (1, 1, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 2; 0 }); |
746 | $table->add (0, 2, new CFPlus::UI::Label text => "Show FPS"); |
750 | $table->add (0, 2, new CFPlus::UI::Label text => "Show FPS"); |
747 | $table->add (1, 2, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4; 0 }); |
751 | $table->add (1, 2, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4; 0 }); |
748 | $table->add (0, 3, new CFPlus::UI::Label text => "Suppress Tooltips"); |
752 | $table->add (0, 3, new CFPlus::UI::Label text => "Suppress Tooltips"); |
749 | $table->add (1, 3, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 }); |
753 | $table->add (1, 3, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 }); |
750 | $table->add (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { die "violator" } ); |
754 | $table->add (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { &CFPlus::debug() } ); |
751 | |
755 | |
752 | my @default_smooth = (0.05, 0.13, 0.05, 0.13, 0.30, 0.13, 0.05, 0.13, 0.05); |
756 | my @default_smooth = (0.05, 0.13, 0.05, 0.13, 0.30, 0.13, 0.05, 0.13, 0.05); |
753 | |
757 | |
754 | for my $x (0..2) { |
758 | for my $x (0..2) { |
755 | for my $y (0 .. 2) { |
759 | for my $y (0 .. 2) { |
… | |
… | |
1453 | has_close_button => 1 |
1457 | has_close_button => 1 |
1454 | ; |
1458 | ; |
1455 | |
1459 | |
1456 | my $ntb = |
1460 | my $ntb = |
1457 | $PL_NOTEBOOK = |
1461 | $PL_NOTEBOOK = |
1458 | new CFPlus::UI::Notebook expand => 1, debug => 1; |
1462 | new CFPlus::UI::Notebook expand => 1; |
1459 | |
1463 | |
1460 | $ntb->add ( |
1464 | $ntb->add ( |
1461 | "Statistics (F2)" => $STATS_PAGE = stats_window, |
1465 | "Statistics (F2)" => $STATS_PAGE = stats_window, |
1462 | "Shows statistics, where all your Stats and Resistances are shown." |
1466 | "Shows statistics, where all your Stats and Resistances are shown." |
1463 | ); |
1467 | ); |