--- deliantra/Deliantra-Client/bin/cfplus 2006/05/30 14:59:26 1.36 +++ deliantra/Deliantra-Client/bin/cfplus 2006/06/02 02:12:04 1.40 @@ -83,6 +83,7 @@ our $METASERVER; our $LOGIN_BUTTON; our $QUIT_DIALOG; +our $HOST_ENTRY; our $SERVER_SETUP; our $FLOORBOX; @@ -108,6 +109,8 @@ our $BIND_WINDOW; our $BIND_EDITOR; +our $SPELL_LIST; + sub status { $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); } @@ -628,21 +631,9 @@ for keys %tbl; } -sub metaserver_dialog { - my $dialog = new CFClient::UI::FancyFrame - title => "Server List", - child => (my $vbox = new CFClient::UI::VBox); - - $vbox->add ($dialog->{table} = new CFClient::UI::Table); - - $dialog -} - my $METASERVER_ATIME; sub update_metaserver { - my ($HOST) = @_; - return if $METASERVER_ATIME > time; $METASERVER_ATIME = time + 60; @@ -704,7 +695,8 @@ $table->add (0, $y, new CFClient::UI::VBox children => [ (new CFClient::UI::Button text => "Use", on_activate => sub { - $HOST->set_text ($CFG->{host} = $host); + $HOST_ENTRY->set_text ($CFG->{host} = $host); + $METASERVER->toggle_visibility; }), (new CFClient::UI::Empty expand => 1), ]); @@ -717,6 +709,22 @@ }); } +sub metaserver_dialog { + my $dialog = new CFClient::UI::FancyFrame + title => "Server List", + x => 'center', + y => 'center', + child => (my $vbox = new CFClient::UI::VBox), + on_visibility_change => sub { + update_metaserver if $_[1]; + }, + ; + + $vbox->add ($dialog->{table} = new CFClient::UI::Table); + + $dialog +} + sub server_setup { my $dialog = $SERVER_SETUP = new CFClient::UI::FancyFrame x => "center", @@ -733,7 +741,7 @@ $table->add (1, 2, my $vbox = new CFClient::UI::VBox); $vbox->add ( - my $HOST = new CFClient::UI::Entry + $HOST_ENTRY = new CFClient::UI::Entry expand => 1, text => $CFG->{host}, tooltip => "The hostname or ip address of the Crossfire(+) server to connect to", @@ -745,14 +753,12 @@ $METASERVER = metaserver_dialog; - $vbox->add (new CFClient::UI::Flopper - expand => 1, - text => "Server List", - other => $METASERVER, + $vbox->add (new CFClient::UI::Button + expand => 1, + text => "Server List", + other => $METASERVER, tooltip => "Show a list of available crossfire servers", - on_open => sub { - update_metaserver $HOST; - } + on_activate => sub { $METASERVER->toggle_visibility }, ); } @@ -932,7 +938,6 @@ force_w => $WIDTH * 9/10, force_h => $HEIGHT * 9/10, title => "Inventory", - name => "inventory_window", ; $invwin->add (my $hb = new CFClient::UI::HBox homogeneous => 1); @@ -953,6 +958,13 @@ $invwin } +sub make_spell_list { + $SPELL_LIST = new CFClient::UI::SpellList + force_w => $WIDTH * (9/10), + force_h => $HEIGHT * (9/10); + $SPELL_LIST +} + sub make_binding_window { my $binding_list = new CFClient::UI::VBox; @@ -1216,8 +1228,12 @@ ."with nothing set and the recording started. After doing the actions you " ."want to record press Insert and you will be asked to press a key-combo." ."After pressing the combo the binding will be saved automatically and the " - ."binding editor closes" - ); + ."binding editor closes"); + + $BUTTONBAR->add (new CFClient::UI::Flopper + text => "Spells", + other => make_spell_list, + tooltip => "The spell list"); $BUTTONBAR->add (new CFClient::UI::Button text => "Quit", @@ -1555,6 +1571,16 @@ cfplus utilises OpenGL for all UI elements and the game. It is supposed to be used fullscreen and interactively. +=head1 DEBUGGING + + +CFPLUS_DEBUG - environment variable + + 1 draw borders around widgets + 2 add low-level widget info to tooltips + 4 show fps + 8 suppress tooltips + =head1 AUTHOR Marc Lehmann , Robin Redeker