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.154 by root, Wed May 9 11:46:49 2007 UTC vs.
Revision 1.161 by root, Thu Jul 5 06:57:03 2007 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2 2
3my $startup_done = sub { }; 3my $startup_done = sub { };
4our $PANGO = "1.5.0";
4 5
5# do splash-screen thingy on win32 6# do splash-screen thingy on win32
6BEGIN { 7BEGIN {
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 );
1475 $ntb->add ( 1479 $ntb->add (
1476 "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget, 1480 "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget,
1477 "Toggles the inventory window, where you can manage your loot (or treasures :). " 1481 "Toggles the inventory window, where you can manage your loot (or treasures :). "
1478 . "You can also hit the <b>Tab</b>-key to show/hide the Inventory." 1482 . "You can also hit the <b>Tab</b>-key to show/hide the Inventory."
1479 ); 1483 );
1484 $ntb->add (Pickup => autopickup_setup,
1485 "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them.");
1480 1486
1481 $ntb->set_current_page ($INVENTORY_PAGE); 1487 $ntb->set_current_page ($INVENTORY_PAGE);
1482 1488
1483 $plwin->add ($ntb); 1489 $plwin->add ($ntb);
1484 $plwin 1490 $plwin
1811 1817
1812 $SETUP_NOTEBOOK->add (Server => $SETUP_SERVER = server_setup, 1818 $SETUP_NOTEBOOK->add (Server => $SETUP_SERVER = server_setup,
1813 "Configure the server to play on, your username, password and other server-related options."); 1819 "Configure the server to play on, your username, password and other server-related options.");
1814 $SETUP_NOTEBOOK->add (Client => client_setup, 1820 $SETUP_NOTEBOOK->add (Client => client_setup,
1815 "Configure various client-specific settings."); 1821 "Configure various client-specific settings.");
1816 $SETUP_NOTEBOOK->add (Pickup => autopickup_setup,
1817 "Configure autopickup settings, i.e. which items you will pick up automatically when walking (or running) over them.");
1818 $SETUP_NOTEBOOK->add (Graphics => graphics_setup, 1822 $SETUP_NOTEBOOK->add (Graphics => graphics_setup,
1819 "Configure the video mode, performance, fonts and other graphical aspects of the game."); 1823 "Configure the video mode, performance, fonts and other graphical aspects of the game.");
1820 $SETUP_NOTEBOOK->add (Audio => audio_setup, 1824 $SETUP_NOTEBOOK->add (Audio => audio_setup,
1821 "Configure the use of audio, sound effects and background music."); 1825 "Configure the use of audio, sound effects and background music.");
1822 $SETUP_NOTEBOOK->add (Keyboard => $SETUP_KEYBOARD = keyboard_setup, 1826 $SETUP_NOTEBOOK->add (Keyboard => $SETUP_KEYBOARD = keyboard_setup,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines