ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/pclient
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/pclient (file contents):
Revision 1.244 by root, Wed May 24 21:49:59 2006 UTC vs.
Revision 1.249 by root, Thu May 25 02:23:14 2006 UTC

342 audio_shutdown (); 342 audio_shutdown ();
343 audio_init (); 343 audio_init ();
344 } 344 }
345 ); 345 );
346 346
347 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Communication cmd"); 347 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Chat Command");
348 $table->add (1, $row++, my $saycmd = new CFClient::UI::Entry 348 $table->add (1, $row++, my $saycmd = new CFClient::UI::Entry
349 text => $CFG->{say_command}, 349 text => $CFG->{say_command},
350 tooltip => "This is the command that will be used if you write a line in the message window entry. " 350 tooltip => "This is the command that will be used if you write a line in the message window entry or press <b>\"</b> in the map window. "
351 ."Usually you want to enter something like 'say' or 'shout' or 'gsay' here. " 351 . "Usually you want to enter something like 'say' or 'shout' or 'gsay' here. "
352 ."But you could also set it to 'tell &lt;playername&gt;' to only chat with that user.", 352 . "But you could also set it to <b>tell <i>playername</i></b> to only chat with that user.",
353 connect_changed => sub { 353 connect_changed => sub {
354 my ($self, $value) = @_; 354 my ($self, $value) = @_;
355 $CFG->{say_command} = $value; 355 $CFG->{say_command} = $value;
356 } 356 }
357 ); 357 );
367 367
368sub set_gauge_window_fontsize { 368sub set_gauge_window_fontsize {
369 for (map { $GAUGES->{$_} } grep { $_ ne 'win' } keys %{$GAUGES}) { 369 for (map { $GAUGES->{$_} } grep { $_ ne 'win' } keys %{$GAUGES}) {
370 $_->set_fontsize ($::CFG->{gauge_fontsize}); 370 $_->set_fontsize ($::CFG->{gauge_fontsize});
371 } 371 }
372
373# local $GAUGES->{win}{parent};#d#
374# use PApp::Util; open D, ">:utf8", "d"; print D PApp::Util::dumpval $GAUGES->{win}; close D;
375} 372}
376 373
377sub make_gauge_window { 374sub make_gauge_window {
378 my $gh = int $HEIGHT * $CFG->{gauge_size}; 375 my $gh = int $HEIGHT * $CFG->{gauge_size};
379 376
843 $QUIT_DIALOG = new CFClient::UI::FancyFrame title => "Really Quit?"; 840 $QUIT_DIALOG = new CFClient::UI::FancyFrame title => "Really Quit?";
844 841
845 $QUIT_DIALOG->add (my $vb = new CFClient::UI::VBox expand => 1); 842 $QUIT_DIALOG->add (my $vb = new CFClient::UI::VBox expand => 1);
846 843
847 $vb->add (new CFClient::UI::Label 844 $vb->add (new CFClient::UI::Label
848 text => "You should find a savebed and apply it first!", 845 text => "You should find a savebed and apply it first!",
849 max_w => $WIDTH * 0.25 846 max_w => $WIDTH * 0.25,
847 ellipsize => 0,
850 ); 848 );
851 $vb->add (my $hb = new CFClient::UI::HBox expand => 1); 849 $vb->add (my $hb = new CFClient::UI::HBox expand => 1);
852 $hb->add (new CFClient::UI::Button 850 $hb->add (new CFClient::UI::Button
853 text => "Ok", 851 text => "Ok",
852 expand => 1,
854 connect_activate => sub { $QUIT_DIALOG->hide }, 853 connect_activate => sub { $QUIT_DIALOG->hide },
855 expand => 1
856 ); 854 );
857 $hb->add (new CFClient::UI::Button 855 $hb->add (new CFClient::UI::Button
858 text => "Quit anyway", 856 text => "Quit anyway",
857 expand => 1,
859 connect_activate => sub { exit 1 }, 858 connect_activate => sub { exit },
860 expand => 1
861 ); 859 );
862 $hb->add (new CFClient::UI::Label "You should find a savebed and apply it first!");
863 860
864 $QUIT_DIALOG->show_centered; 861 $QUIT_DIALOG->show_centered;
865 } else { 862 } else {
866 $QUIT_DIALOG->show_centered; 863 $QUIT_DIALOG->show_centered;
867 } 864 }
895 $vbox->add (my $buttons = new CFClient::UI::HBox); 892 $vbox->add (my $buttons = new CFClient::UI::HBox);
896 $vbox->add (my $viewer = new CFClient::UI::TextView expand => 1, fontsize => 0.8); 893 $vbox->add (my $viewer = new CFClient::UI::TextView expand => 1, fontsize => 0.8);
897 894
898 for ( 895 for (
899 [intro => "Introduction"], 896 [intro => "Introduction"],
897 [manual => "Manual"],
900 [command_help => "Commands"], 898 [command_help => "Commands"],
901 [skill_help => "Skills"], 899 [skill_help => "Skills"],
902 ) { 900 ) {
903 my ($pod, $label) = @$_; 901 my ($pod, $label) = @$_;
904 902
931sub video_init { 929sub video_init {
932 sdl_init; 930 sdl_init;
933 931
934 $CFG->{sdl_mode} = 0 if $CFG->{sdl_mode} >= @SDL_MODES; 932 $CFG->{sdl_mode} = 0 if $CFG->{sdl_mode} >= @SDL_MODES;
935 933
934 my ($old_w, $old_h) = ($WIDTH, $HEIGHT);
935
936 ($WIDTH, $HEIGHT) = @{ $SDL_MODES[$CFG->{sdl_mode}] }; 936 ($WIDTH, $HEIGHT) = @{ $SDL_MODES[$CFG->{sdl_mode}] };
937 $FULLSCREEN = $CFG->{fullscreen}; 937 $FULLSCREEN = $CFG->{fullscreen};
938 $FAST = $CFG->{fast}; 938 $FAST = $CFG->{fast};
939 939
940 CFClient::SDL_SetVideoMode $WIDTH, $HEIGHT, $FULLSCREEN 940 CFClient::SDL_SetVideoMode $WIDTH, $HEIGHT, $FULLSCREEN
949 949
950 $CFClient::UI::ROOT->configure (0, 0, $WIDTH, $HEIGHT);#d# 950 $CFClient::UI::ROOT->configure (0, 0, $WIDTH, $HEIGHT);#d#
951 951
952 ############################################################################# 952 #############################################################################
953 953
954 unless ($DEBUG_STATUS) { 954 if ($DEBUG_STATUS) {
955 CFClient::UI::rescale_widgets $WIDTH / $old_w, $HEIGHT / $old_h;
956 } else {
955 # create the widgets 957 # create the widgets
956 958
957 $DEBUG_STATUS = new CFClient::UI::Label padding => 0, z => 100, req_x => -1; 959 $DEBUG_STATUS = new CFClient::UI::Label padding => 0, z => 100, req_x => -1;
958 $DEBUG_STATUS->show; 960 $DEBUG_STATUS->show;
959 961
1009 tooltip => "Toggles the server message log, where the client collects <i>all</i> messages from the server."); 1011 tooltip => "Toggles the server message log, where the client collects <i>all</i> messages from the server.");
1010 1012
1011 make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D 1013 make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D
1012 1014
1013 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Stats Window", other => make_stats_window, 1015 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Stats Window", other => make_stats_window,
1014 tooltip => "Toggles the statistics window, where all your Stats and Resistances are beign displaye at all times."); 1016 tooltip => "Toggles the statistics window, where all your Stats and Resistances are being displayed at all times.");
1015 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Inventory", other => make_inventory_window, 1017 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Inventory", other => make_inventory_window,
1016 tooltip => "Toggles the inventory window, where you can manage your loot (or treaures :)."); 1018 tooltip => "Toggles the inventory window, where you can manage your loot (or treaures :).");
1017 1019
1018 $BUTTONBAR->add (new CFClient::UI::Button 1020 $BUTTONBAR->add (new CFClient::UI::Button
1019 text => "Save Config", 1021 text => "Save Config",
1536 title => "Query", 1538 title => "Query",
1537 child => my $vbox = new CFClient::UI::VBox; 1539 child => my $vbox = new CFClient::UI::VBox;
1538 1540
1539 $vbox->add (new CFClient::UI::Label 1541 $vbox->add (new CFClient::UI::Label
1540 max_w => $::WIDTH * 0.4, 1542 max_w => $::WIDTH * 0.4,
1543 ellipsise => 0,
1541 text => $prompt); 1544 text => $prompt);
1542 1545
1543 if ($flags & Crossfire::Protocol::CS_QUERY_YESNO) { 1546 if ($flags & Crossfire::Protocol::CS_QUERY_YESNO) {
1544 $vbox->add (my $hbox = new CFClient::HBox); 1547 $vbox->add (my $hbox = new CFClient::HBox);
1545 $hbox->add (new CFClient::Button 1548 $hbox->add (new CFClient::Button
1553 $hbox->add (new CFClient::Button 1556 $hbox->add (new CFClient::Button
1554 text => "Yes", 1557 text => "Yes",
1555 connect_activate => sub { 1558 connect_activate => sub {
1556 $self->send ("reply y"); 1559 $self->send ("reply y");
1557 $dialog->destroy; 1560 $dialog->destroy;
1558 $MAPWIDGET->focus_in;
1559 }, 1561 },
1560 ); 1562 );
1561 1563
1562 $dialog->focus_in; 1564 $dialog->focus_in;
1563 1565
1565 $dialog->{tooltip} = "Press a key (click on the entry to make sure it has keyboard focus)"; 1567 $dialog->{tooltip} = "Press a key (click on the entry to make sure it has keyboard focus)";
1566 $vbox->add (my $entry = new CFClient::UI::Entry 1568 $vbox->add (my $entry = new CFClient::UI::Entry
1567 connect_changed => sub { 1569 connect_changed => sub {
1568 $self->send ("reply $_[1]"); 1570 $self->send ("reply $_[1]");
1569 $dialog->destroy; 1571 $dialog->destroy;
1570 $MAPWIDGET->focus_in;
1571 }, 1572 },
1572 ); 1573 );
1573 1574
1574 $entry->focus_in; 1575 $entry->focus_in;
1575 1576
1579 $vbox->add (my $entry = new CFClient::UI::Entry 1580 $vbox->add (my $entry = new CFClient::UI::Entry
1580 $flags & Crossfire::Protocol::CS_QUERY_HIDEINPUT ? (hiddenchar => "*") : (), 1581 $flags & Crossfire::Protocol::CS_QUERY_HIDEINPUT ? (hiddenchar => "*") : (),
1581 connect_activate => sub { 1582 connect_activate => sub {
1582 $self->send ("reply $_[1]"); 1583 $self->send ("reply $_[1]");
1583 $dialog->destroy; 1584 $dialog->destroy;
1584 $MAPWIDGET->focus_in;
1585 }, 1585 },
1586 ); 1586 );
1587 1587
1588 $entry->focus_in; 1588 $entry->focus_in;
1589 } 1589 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines