ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/cfplus
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.39 by root, Thu Jun 1 03:42:58 2006 UTC vs.
Revision 1.40 by root, Fri Jun 2 02:12:04 2006 UTC

81our $LOGVIEW; 81our $LOGVIEW;
82our $CONSOLE; 82our $CONSOLE;
83our $METASERVER; 83our $METASERVER;
84our $LOGIN_BUTTON; 84our $LOGIN_BUTTON;
85our $QUIT_DIALOG; 85our $QUIT_DIALOG;
86our $HOST_ENTRY;
86our $SERVER_SETUP; 87our $SERVER_SETUP;
87 88
88our $FLOORBOX; 89our $FLOORBOX;
89our $GAUGES; 90our $GAUGES;
90our $STATWIDS; 91our $STATWIDS;
628 629
629 $STATWIDS->{"res_$_"}->set_text (sprintf "%d%", $stats->{$tbl{$_}}) 630 $STATWIDS->{"res_$_"}->set_text (sprintf "%d%", $stats->{$tbl{$_}})
630 for keys %tbl; 631 for keys %tbl;
631} 632}
632 633
633sub metaserver_dialog {
634 my $dialog = new CFClient::UI::FancyFrame
635 title => "Server List",
636 child => (my $vbox = new CFClient::UI::VBox);
637
638 $vbox->add ($dialog->{table} = new CFClient::UI::Table);
639
640 $dialog
641}
642
643my $METASERVER_ATIME; 634my $METASERVER_ATIME;
644 635
645sub update_metaserver { 636sub update_metaserver {
646 my ($HOST) = @_;
647
648 return if $METASERVER_ATIME > time; 637 return if $METASERVER_ATIME > time;
649 $METASERVER_ATIME = time + 60; 638 $METASERVER_ATIME = time + 60;
650 639
651 my $table = $METASERVER->{table}; 640 my $table = $METASERVER->{table};
652 $table->clear; 641 $table->clear;
704 693
705 $y++; 694 $y++;
706 695
707 $table->add (0, $y, new CFClient::UI::VBox children => [ 696 $table->add (0, $y, new CFClient::UI::VBox children => [
708 (new CFClient::UI::Button text => "Use", on_activate => sub { 697 (new CFClient::UI::Button text => "Use", on_activate => sub {
709 $HOST->set_text ($CFG->{host} = $host); 698 $HOST_ENTRY->set_text ($CFG->{host} = $host);
699 $METASERVER->toggle_visibility;
710 }), 700 }),
711 (new CFClient::UI::Empty expand => 1), 701 (new CFClient::UI::Empty expand => 1),
712 ]); 702 ]);
713 703
714 $table->add ($_ + 1, $y, new CFClient::UI::Label 704 $table->add ($_ + 1, $y, new CFClient::UI::Label
717 } 707 }
718 } 708 }
719 }); 709 });
720} 710}
721 711
712sub metaserver_dialog {
713 my $dialog = new CFClient::UI::FancyFrame
714 title => "Server List",
715 x => 'center',
716 y => 'center',
717 child => (my $vbox = new CFClient::UI::VBox),
718 on_visibility_change => sub {
719 update_metaserver if $_[1];
720 },
721 ;
722
723 $vbox->add ($dialog->{table} = new CFClient::UI::Table);
724
725 $dialog
726}
727
722sub server_setup { 728sub server_setup {
723 my $dialog = $SERVER_SETUP = new CFClient::UI::FancyFrame 729 my $dialog = $SERVER_SETUP = new CFClient::UI::FancyFrame
724 x => "center", 730 x => "center",
725 y => "center", 731 y => "center",
726 name => "server_setup", 732 name => "server_setup",
733 739
734 { 740 {
735 $table->add (1, 2, my $vbox = new CFClient::UI::VBox); 741 $table->add (1, 2, my $vbox = new CFClient::UI::VBox);
736 742
737 $vbox->add ( 743 $vbox->add (
738 my $HOST = new CFClient::UI::Entry 744 $HOST_ENTRY = new CFClient::UI::Entry
739 expand => 1, 745 expand => 1,
740 text => $CFG->{host}, 746 text => $CFG->{host},
741 tooltip => "The hostname or ip address of the Crossfire(+) server to connect to", 747 tooltip => "The hostname or ip address of the Crossfire(+) server to connect to",
742 on_changed => sub { 748 on_changed => sub {
743 my ($self, $value) = @_; 749 my ($self, $value) = @_;
745 } 751 }
746 ); 752 );
747 753
748 $METASERVER = metaserver_dialog; 754 $METASERVER = metaserver_dialog;
749 755
750 $vbox->add (new CFClient::UI::Flopper 756 $vbox->add (new CFClient::UI::Button
751 expand => 1, 757 expand => 1,
752 text => "Server List", 758 text => "Server List",
753 other => $METASERVER, 759 other => $METASERVER,
754 tooltip => "Show a list of available crossfire servers", 760 tooltip => "Show a list of available crossfire servers",
755 on_open => sub { 761 on_activate => sub { $METASERVER->toggle_visibility },
756 update_metaserver $HOST;
757 }
758 ); 762 );
759 } 763 }
760 764
761 $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "Username"); 765 $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "Username");
762 $table->add (1, 4, new CFClient::UI::Entry 766 $table->add (1, 4, new CFClient::UI::Entry

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines