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.198 by root, Fri May 5 19:10:16 2006 UTC vs.
Revision 1.199 by root, Mon May 8 15:12:39 2006 UTC

76our $MAPWIDGET; 76our $MAPWIDGET;
77our $BUTTONBAR; 77our $BUTTONBAR;
78our $LOGVIEW; 78our $LOGVIEW;
79our $CONSOLE; 79our $CONSOLE;
80our $METASERVER; 80our $METASERVER;
81our $LOGIN_BUTTON;
81 82
82our $FLOORBOX; 83our $FLOORBOX;
83our $GAUGES; 84our $GAUGES;
84our $STATWIDS; 85our $STATWIDS;
85 86
106 $DEBUG_STATUS->set_text ($_[0]); 107 $DEBUG_STATUS->set_text ($_[0]);
107 $DEBUG_STATUS->move ($WIDTH - $DEBUG_STATUS->{w}, 0, $DEBUG_STATUS->{w}, $DEBUG_STATUS->{h}); 108 $DEBUG_STATUS->move ($WIDTH - $DEBUG_STATUS->{w}, 0, $DEBUG_STATUS->{w}, $DEBUG_STATUS->{h});
108} 109}
109 110
110sub start_game { 111sub start_game {
112 $LOGIN_BUTTON->set_text ("Logout");
113
111 status "logging in..."; 114 status "logging in...";
112 115
113 my $mapsize = List::Util::min 32, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32; 116 my $mapsize = List::Util::min 32, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32;
114 117
115 $MAPCACHE = CFClient::db_table "mapcache_$CFG->{host}"; 118 $MAPCACHE = CFClient::db_table "mapcache_$CFG->{host}";
133 status "login successful"; 136 status "login successful";
134 137
135 CFClient::lowdelay fileno $CONN->{fh}; 138 CFClient::lowdelay fileno $CONN->{fh};
136 } else { 139 } else {
137 status "unable to connect"; 140 status "unable to connect";
141 stop_game();
138 } 142 }
139} 143}
140 144
141sub stop_game { 145sub stop_game {
146 status "connection closed";
147 $LOGIN_BUTTON->set_text ("Login");
142 undef $CONN; 148 undef $CONN;
143} 149}
144 150
145sub client_setup { 151sub client_setup {
146 my $dialog = new CFClient::UI::FancyFrame 152 my $dialog = new CFClient::UI::FancyFrame
571 577
572} 578}
573 579
574sub metaserver_dialog { 580sub metaserver_dialog {
575 my $dialog = new CFClient::UI::FancyFrame 581 my $dialog = new CFClient::UI::FancyFrame
576 title => "Metaserver", 582 title => "Server List",
577 child => (my $vbox = new CFClient::UI::VBox); 583 child => (my $vbox = new CFClient::UI::VBox);
578 584
579 $vbox->add ($dialog->{table} = new CFClient::UI::Table); 585 $vbox->add ($dialog->{table} = new CFClient::UI::Table);
580 586
581 $dialog 587 $dialog
726 732
727 $CFG->{mapsize} = $self->{range}[0] = $value = int $value; 733 $CFG->{mapsize} = $self->{range}[0] = $value = int $value;
728 }, 734 },
729 ); 735 );
730 736
731 $table->add (1, 8, new CFClient::UI::Button expand => 1, align => 0, text => "Login", connect_activate => sub { 737 $table->add (1, 8, $LOGIN_BUTTON = new CFClient::UI::Button
738 expand => 1,
739 align => 0,
740 text => "Login",
741 connect_activate => sub {
742 $CONN ? stop_game
732 start_game; 743 : start_game;
744 },
733 }); 745 );
734 746
735 $dialog 747 $dialog
736} 748}
737 749
738sub message_window { 750sub message_window {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines