--- deliantra/Deliantra-Client/bin/pclient 2006/04/11 13:05:12 1.66
+++ deliantra/Deliantra-Client/bin/pclient 2006/04/11 13:14:36 1.67
@@ -16,8 +16,8 @@
use Crossfire;
use Crossfire::Protocol;
-use Crossfire::Client;
-use Crossfire::Client::Widget;
+use CFClient;
+use CFClient::Widget;
our $VERSION = '0.1';
@@ -77,7 +77,7 @@
$last_refresh = SDL::GetTicks;
- Crossfire::Client::gl_init;
+ CFClient::gl_init;
$FONTSIZE = int $HEIGHT / 50;
@@ -93,35 +93,35 @@
#############################################################################
- $DEBUG_STATUS = new Crossfire::Client::Widget::Label 0, 0, 1, $FONTSIZE, "";
- $Crossfire::Client::Widget::TOPLEVEL->add ($DEBUG_STATUS);
+ $DEBUG_STATUS = new CFClient::Widget::Label 0, 0, 1, $FONTSIZE, "";
+ $CFClient::Widget::TOPLEVEL->add ($DEBUG_STATUS);
- $STATUS_LINE = new Crossfire::Client::Widget::Label
+ $STATUS_LINE = new CFClient::Widget::Label
0, $HEIGHT * 59 / 60 - $FONTSIZE, 1, $FONTSIZE,
"";
- $Crossfire::Client::Widget::TOPLEVEL->add ($STATUS_LINE);
+ $CFClient::Widget::TOPLEVEL->add ($STATUS_LINE);
- $ALT_ENTER_MESSAGE = new Crossfire::Client::Widget::Label
+ $ALT_ENTER_MESSAGE = new CFClient::Widget::Label
0, $HEIGHT * 59 / 60, 1, $HEIGHT / 60,
"Use Alt-Enter to toggle fullscreen mode";
- $Crossfire::Client::Widget::TOPLEVEL->add ($ALT_ENTER_MESSAGE);
+ $CFClient::Widget::TOPLEVEL->add ($ALT_ENTER_MESSAGE);
# Test code #d#
unless ($tw) { # haha...
- $te = new Crossfire::Client::Widget::FancyFrame;
- $te->add (new Crossfire::Client::Widget::Entry);
+ $te = new CFClient::Widget::FancyFrame;
+ $te->add (new CFClient::Widget::Entry);
$te->move (300, 0, 2);
- $Crossfire::Client::Widget::TOPLEVEL->add ($te);
+ $CFClient::Widget::TOPLEVEL->add ($te);
- $tw = new Crossfire::Client::Widget::Animator;
- my $lbl1 = new Crossfire::Client::Widget::Label
+ $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 Crossfire::Client::Widget::Label
+ my $lbl2 = new CFClient::Widget::Label
0, 0, 10, $FONTSIZE, "LBL2";
- my $vb = new Crossfire::Client::Widget::VBox;
- my $f = new Crossfire::Client::Widget::FancyFrame;
- my $f2 = new Crossfire::Client::Widget::FancyFrame;
+ my $vb = new CFClient::Widget::VBox;
+ my $f = new CFClient::Widget::FancyFrame;
+ my $f2 = new CFClient::Widget::FancyFrame;
$f->add ($lbl1);
$f2->add ($lbl2);
$vb->add ($f);
@@ -132,10 +132,10 @@
$tw->h (300);
$tw->move ($WIDTH - 200, 0);
$tw->moveto (0, 0);
- $Crossfire::Client::Widget::TOPLEVEL->add ($tw);
+ $CFClient::Widget::TOPLEVEL->add ($tw);
# $f->move ($WIDTH - 200, 0);
-# $Crossfire::Client::Widget::TOPLEVEL->add ($f);
+# $CFClient::Widget::TOPLEVEL->add ($f);
}
}
@@ -164,7 +164,7 @@
maph => $mapsize,
;
- Crossfire::Client::lowdelay fileno $CONN->{fh};
+ CFClient::lowdelay fileno $CONN->{fh};
}
sub stop_game {
@@ -185,7 +185,7 @@
glClear GL_COLOR_BUFFER_BIT;
- $Crossfire::Client::Widget::TOPLEVEL->draw;
+ $CFClient::Widget::TOPLEVEL->draw;
SDL::GLSwapBuffers;
}
@@ -261,20 +261,20 @@
$FULLSCREEN = !$FULLSCREEN;
init_screen;
} else {
- Crossfire::Client::Widget::feed_sdl_key_down_event ($SDL_EV);
+ CFClient::Widget::feed_sdl_key_down_event ($SDL_EV);
}
},
SDL_KEYUP() => sub {
- Crossfire::Client::Widget::feed_sdl_key_up_event ($SDL_EV);
+ CFClient::Widget::feed_sdl_key_up_event ($SDL_EV);
},
SDL_MOUSEMOTION() => sub {
- Crossfire::Client::Widget::feed_sdl_motion_event ($SDL_EV);
+ CFClient::Widget::feed_sdl_motion_event ($SDL_EV);
},
SDL_MOUSEBUTTONDOWN() => sub {
- Crossfire::Client::Widget::feed_sdl_button_down_event ($SDL_EV);
+ CFClient::Widget::feed_sdl_button_down_event ($SDL_EV);
},
SDL_MOUSEBUTTONUP() => sub {
- Crossfire::Client::Widget::feed_sdl_button_up_event ($SDL_EV);
+ CFClient::Widget::feed_sdl_button_up_event ($SDL_EV);
},
SDL_ACTIVEEVENT() => sub {
printf "active %x %x\n", $SDL_EV->active_gain, $SDL_EV->active_state;#d#
@@ -312,7 +312,7 @@
$FACECACHE->{"$face->{chksum},$face->{name}"} = $face->{image};
- $face->{texture} = new_from_image Crossfire::Client::Texture delete $face->{image};
+ $face->{texture} = new_from_image CFClient::Texture delete $face->{image};
}
sub conn::query {
@@ -395,7 +395,7 @@
$::CFG->{$_} = $cfg->{$_}
if $_ ne '_i';
}
- Crossfire::Client::write_cfg "$Crossfire::VARDIR/pclientrc";
+ CFClient::write_cfg "$CFrossfire::VARDIR/pclientrc";
});
$hb->pack_start (my $cb = Gtk2::Button->new ("login"), 1, 1, 5);
$cb->signal_connect (clicked => sub {
@@ -424,12 +424,12 @@
SDL::Init SDL_INIT_EVERYTHING;
-my $mapwidget = Crossfire::Client::Widget::MapWidget->new;
+my $mapwidget = CFClient::Widget::MapWidget->new;
-$Crossfire::Client::Widget::TOPLEVEL->add ($mapwidget);
+$CFClient::Widget::TOPLEVEL->add ($mapwidget);
$mapwidget->focus_in;
-Crossfire::Client::read_cfg "$Crossfire::VARDIR/pclientrc";
+CFClient::read_cfg "$Crossfire::VARDIR/pclientrc";
$CFG ||= {
width => 640,
@@ -441,10 +441,10 @@
};
{
- my @fonts = map Crossfire::Client::find_rcfile $_, qw(uifont.ttf uifontb.ttf uifonti.ttf uifontbi.ttf);
+ my @fonts = map CFClient::find_rcfile $_, qw(uifont.ttf uifontb.ttf uifonti.ttf uifontbi.ttf);
- Crossfire::Client::add_font $_ for @fonts;
- Crossfire::Client::set_font $fonts[0];
+ CFClient::add_font $_ for @fonts;
+ CFClient::set_font $fonts[0];
}
$FACECACHE = eval { Crossfire::load_ref "$Crossfire::VARDIR/pclient.faces" } || {};
@@ -455,4 +455,4 @@
main Gtk2;
-Crossfire::save_ref $FACECACHE, "$Crossfire::VARDIR/pclient.faces";
+CFsave_ref $FACECACHE, "$Crossfire::VARDIR/pclient.faces";