--- deliantra/Deliantra-Client/bin/pclient 2006/04/11 13:14:36 1.67
+++ deliantra/Deliantra-Client/bin/pclient 2006/04/11 14:04:27 1.69
@@ -33,6 +33,7 @@
our $HEIGHT;
our $FULLSCREEN;
+our $MAPWIDGET;
our $FONTSIZE;
our $SDL_TIMER;
@@ -93,32 +94,32 @@
#############################################################################
- $DEBUG_STATUS = new CFClient::Widget::Label 0, 0, 1, $FONTSIZE, "";
+ $DEBUG_STATUS = new CFClient::Widget::Label;
$CFClient::Widget::TOPLEVEL->add ($DEBUG_STATUS);
$STATUS_LINE = new CFClient::Widget::Label
- 0, $HEIGHT * 59 / 60 - $FONTSIZE, 1, $FONTSIZE,
- "";
+ y => $HEIGHT * 59 / 60 - $FONTSIZE;
$CFClient::Widget::TOPLEVEL->add ($STATUS_LINE);
$ALT_ENTER_MESSAGE = new CFClient::Widget::Label
- 0, $HEIGHT * 59 / 60, 1, $HEIGHT / 60,
- "Use Alt-Enter to toggle fullscreen mode";
+ y => $HEIGHT * 59 / 60,
+ height => $HEIGHT / 60,
+ text => "Use Alt-Enter to toggle fullscreen mode";
$CFClient::Widget::TOPLEVEL->add ($ALT_ENTER_MESSAGE);
+ $MAPWIDGET = new CFClient::Widget::MapWidget;
+ $CFClient::Widget::TOPLEVEL->add ($MAPWIDGET);
+ $MAPWIDGET->focus_in;
+
# Test code #d#
unless ($tw) { # haha...
- $te = new CFClient::Widget::FancyFrame;
+ $te = new CFClient::Widget::FancyFrame x => 300, z => 1;
$te->add (new CFClient::Widget::Entry);
- $te->move (300, 0, 2);
$CFClient::Widget::TOPLEVEL->add ($te);
- $tw = new CFClient::Widget::Animator;
- my $lbl1 = new CFClient::Widget::Label
- 0, 0, 10, $FONTSIZE, "This is a\nTEST!\nOf a themed\nFrame!";
- my $lbl2 = new CFClient::Widget::Label
- 0, 0, 10, $FONTSIZE, "LBL2";
-
+ $tw = new CFClient::Widget::Animator x => $WIDTH - 200, w => 600, h => 300;
+ my $lbl1 = new CFClient::Widget::Label text => "This is a\nTEST!\nOf a themed\nFrame!";
+ my $lbl2 = new CFClient::Widget::Label text => "LBL2";
my $vb = new CFClient::Widget::VBox;
my $f = new CFClient::Widget::FancyFrame;
my $f2 = new CFClient::Widget::FancyFrame;
@@ -128,9 +129,6 @@
$vb->add ($f2, 1);
$tw->add ($vb);
- $tw->w (400);
- $tw->h (300);
- $tw->move ($WIDTH - 200, 0);
$tw->moveto (0, 0);
$CFClient::Widget::TOPLEVEL->add ($tw);
@@ -286,7 +284,7 @@
sub conn::map_update {
my ($self, $dirty) = @_;
- refresh;
+ $MAPWIDGET->update;
}
sub conn::map_scroll {
@@ -424,11 +422,6 @@
SDL::Init SDL_INIT_EVERYTHING;
-my $mapwidget = CFClient::Widget::MapWidget->new;
-
-$CFClient::Widget::TOPLEVEL->add ($mapwidget);
-$mapwidget->focus_in;
-
CFClient::read_cfg "$Crossfire::VARDIR/pclientrc";
$CFG ||= {
@@ -455,4 +448,4 @@
main Gtk2;
-CFsave_ref $FACECACHE, "$Crossfire::VARDIR/pclient.faces";
+Crossfire::save_ref $FACECACHE, "$Crossfire::VARDIR/pclient.faces";