… | |
… | |
31 | |
31 | |
32 | our $WIDTH; |
32 | our $WIDTH; |
33 | our $HEIGHT; |
33 | our $HEIGHT; |
34 | our $FULLSCREEN; |
34 | our $FULLSCREEN; |
35 | |
35 | |
|
|
36 | our $MAPWIDGET; |
36 | our $FONTSIZE; |
37 | our $FONTSIZE; |
37 | |
38 | |
38 | our $SDL_TIMER; |
39 | our $SDL_TIMER; |
39 | our $SDL_APP; |
40 | our $SDL_APP; |
40 | our $SDL_EV; |
41 | our $SDL_EV; |
… | |
… | |
104 | y => $HEIGHT * 59 / 60, |
105 | y => $HEIGHT * 59 / 60, |
105 | height => $HEIGHT / 60, |
106 | height => $HEIGHT / 60, |
106 | text => "Use <b>Alt-Enter</b> to toggle fullscreen mode"; |
107 | text => "Use <b>Alt-Enter</b> to toggle fullscreen mode"; |
107 | $CFClient::Widget::TOPLEVEL->add ($ALT_ENTER_MESSAGE); |
108 | $CFClient::Widget::TOPLEVEL->add ($ALT_ENTER_MESSAGE); |
108 | |
109 | |
|
|
110 | $MAPWIDGET = new CFClient::Widget::MapWidget; |
|
|
111 | $CFClient::Widget::TOPLEVEL->add ($MAPWIDGET); |
|
|
112 | $MAPWIDGET->focus_in; |
|
|
113 | |
109 | # Test code #d# |
114 | # Test code #d# |
110 | unless ($tw) { # haha... |
115 | unless ($tw) { # haha... |
111 | $te = new CFClient::Widget::FancyFrame x => 300, z => 1; |
116 | $te = new CFClient::Widget::FancyFrame x => 300, z => 1; |
112 | $te->add (new CFClient::Widget::Entry); |
117 | $te->add (new CFClient::Widget::Entry); |
113 | $CFClient::Widget::TOPLEVEL->add ($te); |
118 | $CFClient::Widget::TOPLEVEL->add ($te); |
114 | |
119 | |
115 | $tw = new CFClient::Widget::Animator x => $WIDTH - 200, w => 400, h => 300; |
120 | $tw = new CFClient::Widget::Animator x => $WIDTH - 200, w => 600, h => 300; |
116 | my $lbl1 = new CFClient::Widget::Label text => "<i>This</i> is a\n<u>TEST</u>!\nOf a themed\nFrame!"; |
121 | 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"; |
122 | my $lbl2 = new CFClient::Widget::Label text => "LBL2"; |
118 | my $vb = new CFClient::Widget::VBox; |
123 | my $vb = new CFClient::Widget::VBox; |
119 | my $f = new CFClient::Widget::FancyFrame; |
124 | my $f = new CFClient::Widget::FancyFrame; |
120 | my $f2 = new CFClient::Widget::FancyFrame; |
125 | my $f2 = new CFClient::Widget::FancyFrame; |
… | |
… | |
277 | @conn::ISA = Crossfire::Protocol::; |
282 | @conn::ISA = Crossfire::Protocol::; |
278 | |
283 | |
279 | sub conn::map_update { |
284 | sub conn::map_update { |
280 | my ($self, $dirty) = @_; |
285 | my ($self, $dirty) = @_; |
281 | |
286 | |
282 | refresh; |
287 | $MAPWIDGET->update; |
283 | } |
288 | } |
284 | |
289 | |
285 | sub conn::map_scroll { |
290 | sub conn::map_scroll { |
286 | my ($self, $dx, $dy) = @_; |
291 | my ($self, $dx, $dy) = @_; |
287 | |
292 | |
… | |
… | |
415 | |
420 | |
416 | ############################################################################# |
421 | ############################################################################# |
417 | |
422 | |
418 | SDL::Init SDL_INIT_EVERYTHING; |
423 | SDL::Init SDL_INIT_EVERYTHING; |
419 | |
424 | |
420 | my $mapwidget = CFClient::Widget::MapWidget->new; |
|
|
421 | |
|
|
422 | $CFClient::Widget::TOPLEVEL->add ($mapwidget); |
|
|
423 | $mapwidget->focus_in; |
|
|
424 | |
|
|
425 | CFClient::read_cfg "$Crossfire::VARDIR/pclientrc"; |
425 | CFClient::read_cfg "$Crossfire::VARDIR/pclientrc"; |
426 | |
426 | |
427 | $CFG ||= { |
427 | $CFG ||= { |
428 | width => 640, |
428 | width => 640, |
429 | height => 480, |
429 | height => 480, |