… | |
… | |
82 | our $BUTTONBAR; |
82 | our $BUTTONBAR; |
83 | our $LOGVIEW; |
83 | our $LOGVIEW; |
84 | our $CONSOLE; |
84 | our $CONSOLE; |
85 | our $METASERVER; |
85 | our $METASERVER; |
86 | our $LOGIN_BUTTON; |
86 | our $LOGIN_BUTTON; |
|
|
87 | our $QUIT_DIALOG; |
87 | |
88 | |
88 | our $FLOORBOX; |
89 | our $FLOORBOX; |
89 | our $GAUGES; |
90 | our $GAUGES; |
90 | our $STATWIDS; |
91 | our $STATWIDS; |
91 | |
92 | |
… | |
… | |
834 | }; |
835 | }; |
835 | |
836 | |
836 | $window |
837 | $window |
837 | } |
838 | } |
838 | |
839 | |
|
|
840 | sub open_quit_dialog { |
|
|
841 | unless ($QUIT_DIALOG) { |
|
|
842 | |
|
|
843 | my $QUIT_DIALOG = new CFClient::UI::FancyFrame title => "Really Quit?"; |
|
|
844 | |
|
|
845 | $QUIT_DIALOG->add (my $vb = new CFClient::UI::VBox expand => 1); |
|
|
846 | |
|
|
847 | $vb->add (new CFClient::UI::Label |
|
|
848 | text => "You should find a savebed and apply it first!", |
|
|
849 | max_w => $WIDTH * 0.25 |
|
|
850 | ); |
|
|
851 | $vb->add (my $hb = new CFClient::UI::HBox expand => 1); |
|
|
852 | $hb->add (new CFClient::UI::Button |
|
|
853 | text => "Ok", |
|
|
854 | connect_activate => sub { $QUIT_DIALOG->hide }, |
|
|
855 | expand => 1 |
|
|
856 | ); |
|
|
857 | $hb->add (new CFClient::UI::Button |
|
|
858 | text => "Quit anyway", |
|
|
859 | connect_activate => sub { exit 1 }, |
|
|
860 | expand => 1 |
|
|
861 | ); |
|
|
862 | $hb->add (new CFClient::UI::Label "You should find a savebed and apply it first!"); |
|
|
863 | |
|
|
864 | $QUIT_DIALOG->show; |
|
|
865 | } else { |
|
|
866 | $QUIT_DIALOG->show; |
|
|
867 | } |
|
|
868 | } |
|
|
869 | |
839 | sub make_inventory_window { |
870 | sub make_inventory_window { |
840 | my $invwin = new CFClient::UI::FancyFrame |
871 | my $invwin = new CFClient::UI::FancyFrame |
841 | user_w => $WIDTH * (4/5), user_h => $HEIGHT * (4/5), title => "Inventory"; |
872 | user_w => $WIDTH * (4/5), user_h => $HEIGHT * (4/5), title => "Inventory"; |
842 | |
873 | |
843 | $invwin->add (my $hb = new CFClient::UI::HBox expand => 1); |
874 | $invwin->add (my $hb = new CFClient::UI::HBox expand => 1); |
… | |
… | |
951 | text => "Save Config", |
982 | text => "Save Config", |
952 | tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", |
983 | tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", |
953 | connect_activate => sub { |
984 | connect_activate => sub { |
954 | CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; |
985 | CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; |
955 | status "Configuration Saved"; |
986 | status "Configuration Saved"; |
|
|
987 | }, |
|
|
988 | ); |
|
|
989 | |
|
|
990 | $BUTTONBAR->add (new CFClient::UI::Button |
|
|
991 | text => "Quit", |
|
|
992 | tooltip => "Terminates the program", |
|
|
993 | connect_activate => sub { |
|
|
994 | if ($CONN) { |
|
|
995 | open_quit_dialog |
|
|
996 | } else { |
|
|
997 | exit 1 |
|
|
998 | } |
956 | }, |
999 | }, |
957 | ); |
1000 | ); |
958 | |
1001 | |
959 | $BUTTONBAR->show; |
1002 | $BUTTONBAR->show; |
960 | |
1003 | |