--- deliantra/Deliantra-Client/bin/cfplus 2007/04/16 21:06:37 1.150
+++ deliantra/Deliantra-Client/bin/cfplus 2007/07/05 06:49:10 1.159
@@ -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;
}
}
@@ -209,7 +231,7 @@
;
my @dialog = my $label = new CFPlus::UI::Label
- max_w => $::WIDTH * 0.4,
+ max_w => $::WIDTH * 0.8,
ellipsise => 0,
text => $prompt;
@@ -236,13 +258,11 @@
$dialog->grab_focus;
} elsif ($flags & CS_QUERY_SINGLECHAR) {
- $dialog->{tooltip} = "#charcreation_focus";
-
if ($prompt =~ /Now choose a character|Press any key for the next race/i) {
- $MESSAGE_WINDOW->show;
+ $dialog->{tooltip} = "#charcreation_focus";
unshift @dialog, new CFPlus::UI::Label
- max_w => $::WIDTH * 0.4,
+ max_w => $::WIDTH * 0.8,
ellipsise => 0,
markup => "\nOr use your keyboard and the text entry below:\n";
@@ -265,6 +285,29 @@
},
);
+ if ($conn->{chargen_race_description}) {
+ unshift @dialog, new CFPlus::UI::Label
+ max_w => $::WIDTH * 0.8,
+ ellipsise => 0,
+ markup => "$conn->{chargen_race_description}",
+ ;
+ }
+
+ 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
+ allign => 1,
+ ellipsise => 0,
+ markup => "Race: $conn->{chargen_race_title}",
+ ;
+ }
+
unshift @dialog, new CFPlus::UI::Label
max_w => $::WIDTH * 0.4,
ellipsise => 0,
@@ -455,6 +498,7 @@
$SETUP_DIALOG->show;
$PL_WINDOW->hide;
$SPELL_LIST->clear_spells;
+ $CFPlus::UI::ROOT->emit (stop_game => ! ! $CONN);
return unless $CONN;
@@ -705,7 +749,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);
@@ -1413,7 +1457,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,
@@ -1435,6 +1479,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);
@@ -1771,8 +1817,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,
@@ -2081,7 +2125,7 @@
%SDL_CB = (
CFPlus::SDL_QUIT => sub {
- Event::unloop -1;
+ exit;
},
CFPlus::SDL_VIDEORESIZE => sub {
},
@@ -2237,8 +2281,8 @@
#CFPlus::_exit 0;
END {
- CFPlus::DB::Server::stop;
CFPlus::SDL_Quit;
+ CFPlus::DB::Server::stop;
}
=head1 NAME