--- deliantra/Deliantra-Client/bin/cfplus 2007/04/24 01:13:15 1.152 +++ deliantra/Deliantra-Client/bin/cfplus 2007/07/05 06:57:03 1.161 @@ -1,6 +1,7 @@ #!/opt/bin/perl my $startup_done = sub { }; +our $PANGO = "1.5.0"; # do splash-screen thingy on win32 BEGIN { @@ -31,17 +32,38 @@ if (%PAR::LibCache) { @INC = grep ref, @INC; # weed out all paths except pars loader refs + my $tmp = $ENV{PAR_TEMP}; + while (my ($filename, $zip) = each %PAR::LibCache) { for ($zip->memberNames) { next unless /^root\/(.*)/; - $zip->extractMember ($_, "$ENV{PAR_TEMP}/$1") - unless -e "$ENV{PAR_TEMP}/$1"; + $zip->extractMember ($_, "$tmp/$1") + unless -e "$tmp/$1"; } } - # TODO: pango-rc file, anybody? + if ($^O eq "MSWin32") { + # relocatable + } else { + # unix, need to patch pango rc file + open my $fh, "<:perlio", "$tmp/usr/lib/pango/$PANGO/module-files.d/libpango1.0-0.modules" + or die "$tmp/usr/lib/$PANGO/module-files.d/libpango1.0-0.modules: $!"; + local $/; + my $rc = <$fh>; + $rc =~ s/^\//$tmp\//gm; # replace abs paths by relative ones + + mkdir "$tmp/pango-modules"; + open my $fh, ">:perlio", "$tmp/pango-modules/pango.modules" + or die "$tmp/pango-modules/pango.modules: $!"; + print $fh $rc; + + $ENV{PANGO_RC_FILE} = "$tmp/pango.rc"; + open my $fh, ">:perlio", $ENV{PANGO_RC_FILE} + or die "$ENV{PANGO_RC_FILE}: $!"; + print $fh "[Pango]\nModuleFiles = $tmp/pango-modules\n"; + } - unshift @INC, $ENV{PAR_TEMP}; + unshift @INC, $tmp; } } @@ -271,14 +293,12 @@ ; } - if ($conn->{chargen_race_title}) { - unshift @dialog, new CFPlus::UI::Face - face => $conn->{player}{face}, - bg => [.2, .2, .2, 1], - min_w => 64, - min_h => 64, - ; - } + unshift @dialog, new CFPlus::UI::Face + face => $conn->{player}{face}, + bg => [.2, .2, .2, 1], + min_w => 64, + min_h => 64, + ; if ($conn->{chargen_race_title}) { unshift @dialog, new CFPlus::UI::Label @@ -427,6 +447,7 @@ $MAP = new CFPlus::Map; + warn "connecting...\n";#d# $CONN = eval { new CFPlus::Protocol host => $host, @@ -461,6 +482,7 @@ $chunk->play; }, }; + warn "connected<$CONN,$@>\n";#d# if ($CONN) { CFPlus::lowdelay fileno $CONN->{fh}; @@ -478,6 +500,7 @@ $SETUP_DIALOG->show; $PL_WINDOW->hide; $SPELL_LIST->clear_spells; + $CFPlus::UI::ROOT->emit (stop_game => ! ! $CONN); return unless $CONN; @@ -728,7 +751,7 @@ $table->add (1, 2, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4; 0 }); $table->add (0, 3, new CFPlus::UI::Label text => "Suppress Tooltips"); $table->add (1, 3, new CFPlus::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 }); - $table->add (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { die "violator" } ); + $table->add (0, 4, new CFPlus::UI::Button text => "die on click(tm)", on_activate => sub { &CFPlus::debug() } ); my @default_smooth = (0.05, 0.13, 0.05, 0.13, 0.30, 0.13, 0.05, 0.13, 0.05); @@ -1436,7 +1459,7 @@ my $ntb = $PL_NOTEBOOK = - new CFPlus::UI::Notebook expand => 1, debug => 1; + new CFPlus::UI::Notebook expand => 1; $ntb->add ( "Statistics (F2)" => $STATS_PAGE = stats_window, @@ -1458,6 +1481,8 @@ "Toggles the inventory window, where you can manage your loot (or treasures :). " . "You can also hit the Tab-key to show/hide the Inventory." ); + $ntb->add (Pickup => autopickup_setup, + "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them."); $ntb->set_current_page ($INVENTORY_PAGE); @@ -1794,8 +1819,6 @@ "Configure the server to play on, your username, password and other server-related options."); $SETUP_NOTEBOOK->add (Client => client_setup, "Configure various client-specific settings."); - $SETUP_NOTEBOOK->add (Pickup => autopickup_setup, - "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them."); $SETUP_NOTEBOOK->add (Graphics => graphics_setup, "Configure the video mode, performance, fonts and other graphical aspects of the game."); $SETUP_NOTEBOOK->add (Audio => audio_setup,