… | |
… | |
12 | use SDL::Surface; |
12 | use SDL::Surface; |
13 | use SDL::OpenGL; |
13 | use SDL::OpenGL; |
14 | use SDL::OpenGL::Constants; |
14 | use SDL::OpenGL::Constants; |
15 | |
15 | |
16 | use Crossfire; |
16 | use Crossfire; |
17 | use Crossfire::Client; |
|
|
18 | use Crossfire::Protocol; |
17 | use Crossfire::Protocol; |
19 | |
18 | |
20 | use Crossfire::Client::Util; |
19 | use CFClient; |
21 | use Crossfire::Client::Widget; |
20 | use CFClient::Widget; |
|
|
21 | |
|
|
22 | our $VERSION = '0.1'; |
|
|
23 | |
|
|
24 | my $MAX_FPS = 30; |
|
|
25 | my $TICKS_PER_FRAME = int 1000 / $MAX_FPS - 1; # min ticks per frame |
22 | |
26 | |
23 | our $FACECACHE; |
27 | our $FACECACHE; |
24 | |
|
|
25 | our $VERSION = '0.1'; |
|
|
26 | |
28 | |
27 | our $CFG; |
29 | our $CFG; |
28 | our $CONN; |
30 | our $CONN; |
29 | |
31 | |
|
|
32 | our $WIDTH; |
|
|
33 | our $HEIGHT; |
|
|
34 | our $FULLSCREEN; |
|
|
35 | |
30 | our $UIFONT; |
36 | our $FONTSIZE; |
31 | |
37 | |
32 | our $SDL_TIMER; |
38 | our $SDL_TIMER; |
33 | our $SDL_APP; |
39 | our $SDL_APP; |
34 | our $SDL_EV = new SDL::Event; |
40 | our $SDL_EV; |
35 | our %SDL_CB; |
41 | our %SDL_CB; |
36 | |
42 | |
37 | our @GL_INIT; # hooks called on every gl init |
43 | our $ALT_ENTER_MESSAGE; |
|
|
44 | our $STATUS_LINE; |
|
|
45 | our $DEBUG_STATUS; |
|
|
46 | |
|
|
47 | my $last_refresh; |
|
|
48 | my %ANIMATE; |
|
|
49 | my $refresh_handler; |
|
|
50 | |
|
|
51 | our ($tw, $te); # Test widget #d# |
38 | |
52 | |
39 | sub init_screen { |
53 | sub init_screen { |
40 | $SDL_APP = new SDL::App |
54 | $SDL_APP = new SDL::App |
41 | -flags => SDL_ANYFORMAT | SDL_HWSURFACE, |
55 | -flags => SDL_ANYFORMAT | SDL_HWSURFACE, |
42 | -title => "Crossfire+ Client", |
56 | -title => "Crossfire+ Client", |
43 | -width => $CFG->{width}, |
57 | -width => $WIDTH, |
44 | -height => $CFG->{height}, |
58 | -height => $HEIGHT, |
45 | -opengl => 1, |
59 | -opengl => 1, |
46 | -red_size => 8, |
60 | -red_size => 5, |
47 | -green_size => 8, |
61 | -green_size => 5, |
48 | -blue_size => 8, |
62 | -blue_size => 5, |
|
|
63 | -alpha_size => 0, |
49 | -double_buffer => 1, |
64 | -double_buffer => 1, |
50 | -fullscreen => $CFG->{fullscreen}, |
65 | -fullscreen => $FULLSCREEN, |
51 | -resizeable => 0; |
66 | -resizeable => 0; |
52 | |
67 | |
53 | $UIFONT = SDL::TTFOpenFont Crossfire::Client::find_rcfile "uifont.ttf", $CFG->{height} / 40 |
68 | $SDL_EV = new SDL::Event; |
54 | or die "TTFOpenFont: $!"; |
69 | $SDL_EV->set_unicode (1); |
55 | |
70 | |
|
|
71 | $SDL_TIMER = add Glib::Timeout 1000/50, sub { |
|
|
72 | ($SDL_CB{$SDL_EV->type} || sub { warn "unhandled event ", $SDL_EV->type })->() |
|
|
73 | while $SDL_EV->poll; |
|
|
74 | |
|
|
75 | 1 |
|
|
76 | }; |
|
|
77 | |
|
|
78 | $last_refresh = SDL::GetTicks; |
|
|
79 | |
|
|
80 | CFClient::gl_init; |
|
|
81 | |
|
|
82 | $FONTSIZE = int $HEIGHT / 50; |
|
|
83 | |
|
|
84 | ############################################################################# |
|
|
85 | |
56 | glClearColor 0, 0, 0, 0; |
86 | glClearColor 0.45, 0.45, 0.45, 1; |
57 | |
87 | |
58 | glEnable GL_TEXTURE_2D; |
88 | glEnable GL_TEXTURE_2D; |
|
|
89 | glEnable GL_COLOR_MATERIAL; |
59 | glShadeModel GL_FLAT; |
90 | glShadeModel GL_FLAT; |
60 | glDisable GL_DEPTH_TEST; |
91 | glDisable GL_DEPTH_TEST; |
61 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
92 | glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; |
62 | |
93 | |
|
|
94 | ############################################################################# |
|
|
95 | |
|
|
96 | $DEBUG_STATUS = new CFClient::Widget::Label; |
|
|
97 | $CFClient::Widget::TOPLEVEL->add ($DEBUG_STATUS); |
|
|
98 | |
|
|
99 | $STATUS_LINE = new CFClient::Widget::Label |
|
|
100 | y => $HEIGHT * 59 / 60 - $FONTSIZE; |
|
|
101 | $CFClient::Widget::TOPLEVEL->add ($STATUS_LINE); |
|
|
102 | |
|
|
103 | $ALT_ENTER_MESSAGE = new CFClient::Widget::Label |
|
|
104 | y => $HEIGHT * 59 / 60, |
|
|
105 | height => $HEIGHT / 60, |
|
|
106 | text => "Use <b>Alt-Enter</b> to toggle fullscreen mode"; |
|
|
107 | $CFClient::Widget::TOPLEVEL->add ($ALT_ENTER_MESSAGE); |
|
|
108 | |
|
|
109 | # Test code #d# |
|
|
110 | unless ($tw) { # haha... |
|
|
111 | $te = new CFClient::Widget::FancyFrame x => 300, z => 1; |
|
|
112 | $te->add (new CFClient::Widget::Entry); |
|
|
113 | $CFClient::Widget::TOPLEVEL->add ($te); |
|
|
114 | |
|
|
115 | $tw = new CFClient::Widget::Animator x => $WIDTH - 200, w => 400, h => 300; |
|
|
116 | my $lbl1 = new CFClient::Widget::Label text => "<i>This</i> is a\n<u>TEST</u>!\nOf a themed\nFrame!"; |
|
|
117 | my $lbl2 = new CFClient::Widget::Label text => "LBL2"; |
|
|
118 | my $vb = new CFClient::Widget::VBox; |
|
|
119 | my $f = new CFClient::Widget::FancyFrame; |
|
|
120 | my $f2 = new CFClient::Widget::FancyFrame; |
|
|
121 | $f->add ($lbl1); |
|
|
122 | $f2->add ($lbl2); |
|
|
123 | $vb->add ($f); |
|
|
124 | $vb->add ($f2, 1); |
|
|
125 | |
|
|
126 | $tw->add ($vb); |
|
|
127 | $tw->moveto (0, 0); |
|
|
128 | $CFClient::Widget::TOPLEVEL->add ($tw); |
|
|
129 | |
|
|
130 | # $f->move ($WIDTH - 200, 0); |
|
|
131 | # $CFClient::Widget::TOPLEVEL->add ($f); |
|
|
132 | } |
|
|
133 | } |
|
|
134 | |
|
|
135 | sub destroy_screen { |
|
|
136 | remove Glib::Source $SDL_TIMER; |
|
|
137 | undef $SDL_APP; |
|
|
138 | undef $SDL_EV; |
|
|
139 | SDL::Quit; |
|
|
140 | } |
|
|
141 | |
|
|
142 | sub start_game { |
|
|
143 | $WIDTH = $CFG->{width}; |
|
|
144 | $HEIGHT = $CFG->{height}; |
|
|
145 | $FULLSCREEN = 0; |
|
|
146 | |
|
|
147 | init_screen; |
|
|
148 | |
|
|
149 | my $mapsize = List::Util::min 64, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32; |
|
|
150 | |
|
|
151 | $CONN = new conn |
|
|
152 | host => $CFG->{host}, |
|
|
153 | port => $CFG->{port}, |
|
|
154 | user => $CFG->{user}, |
|
|
155 | pass => $CFG->{password}, |
|
|
156 | mapw => $mapsize, |
|
|
157 | maph => $mapsize, |
|
|
158 | ; |
|
|
159 | |
|
|
160 | CFClient::lowdelay fileno $CONN->{fh}; |
|
|
161 | } |
|
|
162 | |
|
|
163 | sub stop_game { |
|
|
164 | remove Glib::Source $refresh_handler if $refresh_handler; |
|
|
165 | undef $refresh_handler; |
|
|
166 | |
|
|
167 | undef $CONN; |
|
|
168 | destroy_screen; |
|
|
169 | } |
|
|
170 | |
|
|
171 | sub force_refresh { |
|
|
172 | glViewport 0, 0, $WIDTH, $HEIGHT; |
|
|
173 | |
63 | glMatrixMode GL_PROJECTION; |
174 | glMatrixMode GL_PROJECTION; |
64 | glLoadIdentity; |
175 | glLoadIdentity; |
65 | glOrtho 0, $CFG->{width}, $CFG->{height}, 0, -100 , 100; |
176 | glOrtho 0, $WIDTH, $HEIGHT, 0, -10000 , 10000; |
66 | |
|
|
67 | glMatrixMode GL_MODELVIEW; |
177 | glMatrixMode GL_MODELVIEW; |
68 | |
178 | |
69 | $_->() for @GL_INIT; |
179 | glClear GL_COLOR_BUFFER_BIT; |
70 | } |
|
|
71 | |
180 | |
72 | my $label;#d# |
181 | $CFClient::Widget::TOPLEVEL->draw; |
73 | |
182 | |
74 | sub start_game { |
183 | SDL::GLSwapBuffers; |
75 | $SDL_TIMER = add Glib::Timeout 1000/20, sub { |
184 | } |
76 | while ($SDL_EV->poll) { |
185 | |
77 | ($SDL_CB{$SDL_EV->type} || sub { warn "unhandled event ", $SDL_EV->type })->(); |
186 | sub debug { |
|
|
187 | $DEBUG_STATUS->set_text ($_[0]); |
|
|
188 | $DEBUG_STATUS->size_allocate ($DEBUG_STATUS->size_request); |
|
|
189 | $DEBUG_STATUS->move ($WIDTH - $DEBUG_STATUS->{w}, 0); |
|
|
190 | } |
|
|
191 | |
|
|
192 | my $FPS; |
|
|
193 | |
|
|
194 | sub refresh { |
|
|
195 | $refresh_handler ||= add Glib::Idle sub { |
|
|
196 | if ($SDL_APP) { |
|
|
197 | my $next_refresh = SDL::GetTicks; |
|
|
198 | |
|
|
199 | if ($next_refresh - $last_refresh < $TICKS_PER_FRAME) { |
|
|
200 | SDL::Delay $TICKS_PER_FRAME - ($next_refresh - $last_refresh); |
|
|
201 | $next_refresh = SDL::GetTicks; |
|
|
202 | } |
|
|
203 | |
|
|
204 | my $interval = ($next_refresh - $last_refresh) * 0.001; |
|
|
205 | $last_refresh = $next_refresh; |
|
|
206 | |
|
|
207 | if ($interval) { |
|
|
208 | $FPS ||= 1 / $interval; |
|
|
209 | $FPS = $FPS * 0.96 + (1 / $interval) * 0.04; |
|
|
210 | debug sprintf "%5.02f", $FPS; |
|
|
211 | } |
|
|
212 | |
|
|
213 | force_refresh; |
|
|
214 | $_->animate ($interval) for grep $_, values %ANIMATE; |
|
|
215 | |
|
|
216 | if (%ANIMATE) { |
|
|
217 | 1 |
|
|
218 | } else { |
|
|
219 | undef $refresh_handler; |
|
|
220 | 0 |
|
|
221 | } |
|
|
222 | } else { |
|
|
223 | undef $refresh_handler; |
|
|
224 | 0 |
78 | } |
225 | } |
79 | |
|
|
80 | 1 |
|
|
81 | }; |
226 | }; |
82 | |
|
|
83 | init_screen; |
|
|
84 | |
|
|
85 | $label = new Crossfire::Client::Widget::Label 500, 10, 1, $UIFONT, "Testü[]"; |
|
|
86 | $label->activate; |
|
|
87 | |
|
|
88 | $CONN = new conn |
|
|
89 | host => $CFG->{host}, |
|
|
90 | port => $CFG->{port}; |
|
|
91 | } |
227 | } |
92 | |
228 | |
93 | sub stop_game { |
229 | sub animation_start { |
94 | remove Glib::Source $SDL_TIMER; |
230 | my ($widget) = @_; |
|
|
231 | $ANIMATE{$widget} = $widget; |
|
|
232 | Scalar::Util::weaken $ANIMATE{$widget}; |
95 | |
233 | |
96 | undef $SDL_APP; |
234 | refresh; |
97 | SDL::Quit; |
|
|
98 | } |
235 | } |
99 | |
236 | |
100 | sub refresh { |
237 | sub animation_stop { |
101 | glClear GL_COLOR_BUFFER_BIT; |
238 | my ($widget) = @_; |
102 | |
239 | delete $ANIMATE{$widget}; |
103 | $_->draw for @Crossfire::Client::Widget::ACTIVE_WIDGETS; |
|
|
104 | |
|
|
105 | SDL::GLSwapBuffers; |
|
|
106 | } |
240 | } |
107 | |
241 | |
108 | %SDL_CB = ( |
242 | %SDL_CB = ( |
109 | SDL_QUIT() => sub { |
243 | SDL_QUIT() => sub { |
110 | main_quit Gtk2; |
244 | main_quit Gtk2; |
… | |
… | |
115 | refresh; |
249 | refresh; |
116 | }, |
250 | }, |
117 | SDL_KEYDOWN() => sub { |
251 | SDL_KEYDOWN() => sub { |
118 | if ($SDL_EV->key_mod & KMOD_ALT && $SDL_EV->key_sym == SDLK_RETURN) { |
252 | if ($SDL_EV->key_mod & KMOD_ALT && $SDL_EV->key_sym == SDLK_RETURN) { |
119 | # alt-enter |
253 | # alt-enter |
120 | $CFG->{fullscreen} = !$CFG->{fullscreen}; |
254 | $FULLSCREEN = !$FULLSCREEN; |
121 | init_screen; |
255 | init_screen; |
122 | } else { |
256 | } else { |
123 | Crossfire::Client::Widget::feed_sdl_key_down_event ($SDL_EV); |
257 | CFClient::Widget::feed_sdl_key_down_event ($SDL_EV); |
124 | } |
258 | } |
125 | }, |
259 | }, |
126 | SDL_KEYUP() => sub { |
260 | SDL_KEYUP() => sub { |
127 | Crossfire::Client::Widget::feed_sdl_key_up_event ($SDL_EV); |
261 | CFClient::Widget::feed_sdl_key_up_event ($SDL_EV); |
128 | }, |
262 | }, |
129 | SDL_MOUSEMOTION() => sub { |
263 | SDL_MOUSEMOTION() => sub { |
130 | warn "sdl motion\n";#d# |
264 | CFClient::Widget::feed_sdl_motion_event ($SDL_EV); |
131 | }, |
265 | }, |
132 | SDL_MOUSEBUTTONDOWN() => sub { |
266 | SDL_MOUSEBUTTONDOWN() => sub { |
133 | Crossfire::Client::Widget::feed_sdl_button_down_event ($SDL_EV); |
267 | CFClient::Widget::feed_sdl_button_down_event ($SDL_EV); |
134 | }, |
268 | }, |
135 | SDL_MOUSEBUTTONUP() => sub { |
269 | SDL_MOUSEBUTTONUP() => sub { |
136 | Crossfire::Client::Widget::feed_sdl_button_up_event ($SDL_EV); |
270 | CFClient::Widget::feed_sdl_button_up_event ($SDL_EV); |
137 | }, |
271 | }, |
138 | SDL_ACTIVEEVENT() => sub { |
272 | SDL_ACTIVEEVENT() => sub { |
139 | warn "active\n";#d# |
273 | printf "active %x %x\n", $SDL_EV->active_gain, $SDL_EV->active_state;#d# |
140 | }, |
274 | }, |
141 | ); |
275 | ); |
142 | |
276 | |
143 | @conn::ISA = Crossfire::Protocol::; |
277 | @conn::ISA = Crossfire::Protocol::; |
144 | |
278 | |
… | |
… | |
149 | } |
283 | } |
150 | |
284 | |
151 | sub conn::map_scroll { |
285 | sub conn::map_scroll { |
152 | my ($self, $dx, $dy) = @_; |
286 | my ($self, $dx, $dy) = @_; |
153 | |
287 | |
154 | refresh; |
288 | # refresh; |
155 | } |
289 | } |
156 | |
290 | |
157 | sub conn::map_clear { |
291 | sub conn::map_clear { |
158 | my ($self) = @_; |
292 | my ($self) = @_; |
159 | |
293 | |
160 | refresh; |
294 | # refresh; |
161 | } |
295 | } |
162 | |
296 | |
163 | sub conn::face_find { |
297 | sub conn::face_find { |
164 | my ($self, $face) = @_; |
298 | my ($self, $face) = @_; |
165 | |
299 | |
… | |
… | |
169 | sub conn::face_update { |
303 | sub conn::face_update { |
170 | my ($self, $face) = @_; |
304 | my ($self, $face) = @_; |
171 | |
305 | |
172 | $FACECACHE->{"$face->{chksum},$face->{name}"} = $face->{image}; |
306 | $FACECACHE->{"$face->{chksum},$face->{name}"} = $face->{image}; |
173 | |
307 | |
174 | $face->{texture} = new_from_image Crossfire::Client::Texture delete $face->{image}; |
308 | $face->{texture} = new_from_image CFClient::Texture delete $face->{image}; |
|
|
309 | } |
|
|
310 | |
|
|
311 | sub conn::query { |
|
|
312 | my ($self, $flags, $prompt) = @_; |
|
|
313 | |
|
|
314 | warn "<<<<QUERY:$flags:$prompt>>>\n";#d# |
175 | } |
315 | } |
176 | |
316 | |
177 | sub gtk_add_cfg_field { |
317 | sub gtk_add_cfg_field { |
178 | my ($tbl, $cfg, $klbl, $key, $value) = @_; |
318 | my ($tbl, $cfg, $klbl, $key, $value) = @_; |
179 | my $i = $cfg->{_i}++; |
319 | my $i = $cfg->{_i}++; |
… | |
… | |
185 | } |
325 | } |
186 | $ent->set_text ($value); |
326 | $ent->set_text ($value); |
187 | $ent->signal_connect (changed => sub { |
327 | $ent->signal_connect (changed => sub { |
188 | my ($ent) = @_; |
328 | my ($ent) = @_; |
189 | $cfg->{$key} = $ent->get_text; |
329 | $cfg->{$key} = $ent->get_text; |
|
|
330 | # TODO: Mapsize should be a slider in the game gui |
|
|
331 | if ($key eq 'mapsize' and $cfg->{$key} > 100) { |
|
|
332 | $cfg->{$key} = 100; |
|
|
333 | } elsif ($key eq 'mapsize' and $cfg->{$key} < 50) { |
|
|
334 | $cfg->{$key} = 50; |
|
|
335 | } |
190 | }); |
336 | }); |
191 | } |
337 | } |
192 | |
338 | |
193 | sub run_config_dialog { |
339 | sub run_config_dialog { |
194 | my (%events) = @_; |
340 | my (%events) = @_; |
… | |
… | |
196 | my $w = Gtk2::Window->new; |
342 | my $w = Gtk2::Window->new; |
197 | |
343 | |
198 | my @cfg = ( |
344 | my @cfg = ( |
199 | [qw/Host host/], |
345 | [qw/Host host/], |
200 | [qw/Port port/], |
346 | [qw/Port port/], |
|
|
347 | [qw/Mapsize% mapsize/], |
201 | [qw/Username user/], |
348 | [qw/Username user/], |
202 | [qw/Password password/], |
349 | [qw/Password password/], |
203 | ); |
350 | ); |
204 | |
351 | |
205 | my $cfg = {}; |
352 | my $cfg = {}; |
… | |
… | |
239 | $cb->signal_connect (clicked => sub { |
386 | $cb->signal_connect (clicked => sub { |
240 | for (keys %$cfg) { |
387 | for (keys %$cfg) { |
241 | $::CFG->{$_} = $cfg->{$_} |
388 | $::CFG->{$_} = $cfg->{$_} |
242 | if $_ ne '_i'; |
389 | if $_ ne '_i'; |
243 | } |
390 | } |
244 | Crossfire::Client::write_cfg "$Crossfire::VARDIR/pclientrc"; |
391 | CFClient::write_cfg "$CFrossfire::VARDIR/pclientrc"; |
245 | }); |
392 | }); |
246 | $hb->pack_start (my $cb = Gtk2::Button->new ("login"), 1, 1, 5); |
393 | $hb->pack_start (my $cb = Gtk2::Button->new ("login"), 1, 1, 5); |
247 | $cb->signal_connect (clicked => sub { |
394 | $cb->signal_connect (clicked => sub { |
248 | for (keys %$cfg) { |
395 | for (keys %$cfg) { |
249 | $::CFG->{$_} = $cfg->{$_} |
396 | $::CFG->{$_} = $cfg->{$_} |
… | |
… | |
252 | my $cb = $events{login} || sub {}; |
399 | my $cb = $events{login} || sub {}; |
253 | $cb->($::CFG->{user}, $::CFG->{password}); |
400 | $cb->($::CFG->{user}, $::CFG->{password}); |
254 | }); |
401 | }); |
255 | $hb->pack_start (my $cb = Gtk2::Button->new ("logout"), 1, 1, 5); |
402 | $hb->pack_start (my $cb = Gtk2::Button->new ("logout"), 1, 1, 5); |
256 | $cb->signal_connect (clicked => sub { |
403 | $cb->signal_connect (clicked => sub { |
257 | my $cb = $events{login} || sub {}; |
404 | my $cb = $events{logout} || sub {}; |
258 | $cb->(); |
405 | $cb->(); |
259 | }); |
406 | }); |
260 | $hb->pack_start (my $cb = Gtk2::Button->new ("quit"), 1, 1, 5); |
407 | $hb->pack_start (my $cb = Gtk2::Button->new ("quit"), 1, 1, 5); |
261 | $cb->signal_connect (clicked => sub { $w->destroy }); |
408 | $cb->signal_connect (clicked => sub { $w->destroy }); |
262 | |
409 | |
… | |
… | |
267 | |
414 | |
268 | |
415 | |
269 | ############################################################################# |
416 | ############################################################################# |
270 | |
417 | |
271 | SDL::Init SDL_INIT_EVERYTHING; |
418 | SDL::Init SDL_INIT_EVERYTHING; |
272 | SDL::TTFInit; |
|
|
273 | |
419 | |
274 | my $mapwidget = Crossfire::Client::Widget::MapWidget->new; |
420 | my $mapwidget = CFClient::Widget::MapWidget->new; |
275 | |
421 | |
276 | $mapwidget->activate; |
422 | $CFClient::Widget::TOPLEVEL->add ($mapwidget); |
277 | $mapwidget->focus_in; |
423 | $mapwidget->focus_in; |
278 | |
424 | |
279 | Crossfire::Client::read_cfg "$Crossfire::VARDIR/pclientrc"; |
425 | CFClient::read_cfg "$Crossfire::VARDIR/pclientrc"; |
280 | |
426 | |
281 | $CFG ||= { |
427 | $CFG ||= { |
282 | width => 640, |
428 | width => 640, |
283 | height => 480, |
429 | height => 480, |
|
|
430 | mapsize => 100, |
284 | fullscreen => 0, |
431 | fullscreen => 0, |
285 | host => "crossfire.schmorp.de", |
432 | host => "crossfire.schmorp.de", |
286 | port => 13327, |
433 | port => 13327, |
287 | }; |
434 | }; |
288 | |
435 | |
|
|
436 | { |
|
|
437 | my @fonts = map CFClient::find_rcfile $_, qw(uifont.ttf uifontb.ttf uifonti.ttf uifontbi.ttf); |
|
|
438 | |
|
|
439 | CFClient::add_font $_ for @fonts; |
|
|
440 | CFClient::set_font $fonts[0]; |
|
|
441 | } |
|
|
442 | |
289 | $FACECACHE = eval { Crossfire::load_ref "$Crossfire::VARDIR/pclient.faces" } || {}; |
443 | $FACECACHE = eval { Crossfire::load_ref "$Crossfire::VARDIR/pclient.faces" } || {}; |
290 | |
444 | |
291 | run_config_dialog |
445 | run_config_dialog |
292 | login => sub { start_game }, |
446 | login => sub { start_game }, |
293 | logout => sub { stop_game }; |
447 | logout => sub { stop_game }; |