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.138 by root, Sat Dec 9 21:26:46 2006 UTC vs.
Revision 1.141 by elmex, Sat Dec 16 17:33:26 2006 UTC

68use CFPlus::Macro; 68use CFPlus::Macro;
69 69
70$SIG{QUIT} = sub { Carp::cluck "QUIT" }; 70$SIG{QUIT} = sub { Carp::cluck "QUIT" };
71$SIG{PIPE} = 'IGNORE'; 71$SIG{PIPE} = 'IGNORE';
72 72
73$Event::Eval = 0; 73$Event::Eval = 1;
74$Event::DIED = sub { 74$Event::DIED = sub {
75 CFPlus::fatal Carp::longmess $_[1] 75 CFPlus::fatal Carp::longmess $_[1]
76}; 76};
77 77
78my $MAX_FPS = 60; 78my $MAX_FPS = 60;
176sub destroy_query_dialog { 176sub destroy_query_dialog {
177 (delete $_[0]{query_dialog})->destroy 177 (delete $_[0]{query_dialog})->destroy
178 if $_[0]{query_dialog}; 178 if $_[0]{query_dialog};
179} 179}
180 180
181# FIXME: a very ugly hack to wait for stat update look below! #d#
182our $QUERY_TIMER; #d#
183
181# server query dialog 184# server query dialog
182sub server_query { 185sub server_query {
183 my ($conn, $flags, $prompt) = @_; 186 my ($conn, $flags, $prompt) = @_;
187
188 # FIXME: a very ugly hack to wait for stat update #d#
189 if ($prompt =~ /roll new stats/ and not $conn->{stat_change_with}) {
190 unless ($QUERY_TIMER) {
191 $QUERY_TIMER =
192 Event->timer (
193 after => 1,
194 cb => sub {
195 server_query ($conn, $flags, $prompt, 1);
196 $QUERY_TIMER = undef
197 }
198 );
199 return;
200 }
201 }
184 202
185 $conn->{query_dialog} = my $dialog = new CFPlus::UI::Toplevel 203 $conn->{query_dialog} = my $dialog = new CFPlus::UI::Toplevel
186 x => "center", 204 x => "center",
187 y => "center", 205 y => "center",
188 title => "Server Query", 206 title => "Server Query",
1770} 1788}
1771 1789
1772sub setup_build_button { 1790sub setup_build_button {
1773 my ($enabled) = @_; 1791 my ($enabled) = @_;
1774 if ($enabled) { 1792 if ($enabled) {
1793 $BUILD_BUTTON->hide if $BUILD_BUTTON;
1775 $BUILD_BUTTON ||= new CFPlus::UI::Button 1794 $BUILD_BUTTON ||= new CFPlus::UI::Button
1776 text => "Build", 1795 text => "Build",
1777 tooltip => "Opens the ingame builder", 1796 tooltip => "Opens the ingame builder",
1778 on_activate => sub { 1797 on_activate => sub {
1779 if ($CONN) { 1798 if ($CONN) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines