… | |
… | |
25 | # need to do it again because that pile of garbage called PAR nukes it before main |
25 | # need to do it again because that pile of garbage called PAR nukes it before main |
26 | unshift @INC, $ENV{PAR_TEMP} |
26 | unshift @INC, $ENV{PAR_TEMP} |
27 | if %PAR::LibCache; |
27 | if %PAR::LibCache; |
28 | |
28 | |
29 | use Time::HiRes 'time'; |
29 | use Time::HiRes 'time'; |
30 | use Pod::POM; |
|
|
31 | use Event; |
30 | use Event; |
32 | |
31 | |
33 | use Crossfire; |
32 | use Crossfire; |
34 | use Crossfire::Protocol::Constants; |
33 | use Crossfire::Protocol::Constants; |
35 | |
34 | |
… | |
… | |
174 | } |
173 | } |
175 | } |
174 | } |
176 | |
175 | |
177 | sub stop_game { |
176 | sub stop_game { |
178 | $LOGIN_BUTTON->set_text ("Login"); |
177 | $LOGIN_BUTTON->set_text ("Login"); |
|
|
178 | $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER); |
179 | $SETUP_DIALOG->show; |
179 | $SETUP_DIALOG->show; |
180 | $INV_WINDOW->hide; |
180 | $INV_WINDOW->hide; |
181 | $LOGVIEW->hide; |
|
|
182 | |
181 | |
183 | return unless $CONN; |
182 | return unless $CONN; |
184 | |
183 | |
185 | status "connection closed"; |
184 | status "connection closed"; |
186 | |
185 | |
… | |
… | |
903 | sub open_quit_dialog { |
902 | sub open_quit_dialog { |
904 | unless ($QUIT_DIALOG) { |
903 | unless ($QUIT_DIALOG) { |
905 | $QUIT_DIALOG = new CFClient::UI::FancyFrame |
904 | $QUIT_DIALOG = new CFClient::UI::FancyFrame |
906 | x => "center", |
905 | x => "center", |
907 | y => "center", |
906 | y => "center", |
|
|
907 | z => 50, |
908 | title => "Really Quit?", |
908 | title => "Really Quit?", |
909 | ; |
909 | ; |
910 | |
910 | |
911 | $QUIT_DIALOG->add (my $vb = new CFClient::UI::VBox expand => 1); |
911 | $QUIT_DIALOG->add (my $vb = new CFClient::UI::VBox expand => 1); |
912 | |
912 | |
… | |
… | |
1100 | $SETUP_DIALOG->show; |
1100 | $SETUP_DIALOG->show; |
1101 | }, |
1101 | }, |
1102 | sub { |
1102 | sub { |
1103 | $SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD); |
1103 | $SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD); |
1104 | $SETUP_DIALOG->show; |
1104 | $SETUP_DIALOG->show; |
1105 | }); |
1105 | }, |
|
|
1106 | ); |
1106 | $SETUP_DIALOG->hide; |
1107 | $SETUP_DIALOG->hide; |
1107 | $::BIND_EDITOR->show; |
1108 | $::BIND_EDITOR->show; |
1108 | }, |
1109 | }, |
1109 | ); |
1110 | ); |
1110 | |
1111 | |
… | |
… | |
1124 | |
1125 | |
1125 | sub make_help_window { |
1126 | sub make_help_window { |
1126 | my $win = new CFClient::UI::FancyFrame |
1127 | my $win = new CFClient::UI::FancyFrame |
1127 | x => 'center', |
1128 | x => 'center', |
1128 | y => 'center', |
1129 | y => 'center', |
|
|
1130 | z => 2, |
1129 | name => 'doc_browser', |
1131 | name => 'doc_browser', |
1130 | force_w => int $WIDTH * 7/8, |
1132 | force_w => int $WIDTH * 7/8, |
1131 | force_h => int $HEIGHT * 7/8, |
1133 | force_h => int $HEIGHT * 7/8, |
1132 | title => "Documentation"; |
1134 | title => "Documentation"; |
1133 | |
1135 | |
… | |
… | |
1145 | my ($pod, $label) = @$_; |
1147 | my ($pod, $label) = @$_; |
1146 | |
1148 | |
1147 | $buttons->add (new CFClient::UI::Button |
1149 | $buttons->add (new CFClient::UI::Button |
1148 | text => $label, |
1150 | text => $label, |
1149 | on_activate => sub { |
1151 | on_activate => sub { |
1150 | my $parser = new Pod::POM; |
|
|
1151 | my $pom = $parser->parse_file (CFClient::find_rcfile "pod/$pod.pod"); |
1152 | my $pom = CFClient::load_pod CFClient::find_rcfile "pod/$pod.pod"; |
1152 | |
1153 | |
1153 | $viewer->clear; |
1154 | $viewer->clear; |
1154 | |
1155 | |
1155 | $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) |
1156 | $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) |
1156 | for @{ CFClient::pod_to_pango_list $pom }; |
1157 | for @{ CFClient::pod_to_pango_list $pom }; |
… | |
… | |
1208 | $DEBUG_STATUS->show; |
1209 | $DEBUG_STATUS->show; |
1209 | |
1210 | |
1210 | $BIND_EDITOR = new CFClient::UI::BindEditor (x => "max", y => 0); |
1211 | $BIND_EDITOR = new CFClient::UI::BindEditor (x => "max", y => 0); |
1211 | |
1212 | |
1212 | $STATUSBOX = new CFClient::UI::Statusbox; |
1213 | $STATUSBOX = new CFClient::UI::Statusbox; |
1213 | $STATUSBOX->add ("Use <b>Alt-Enter</b> to toggle fullscreen mode", pri => -100, color => [1, 1, 1, 0.8]); |
1214 | $STATUSBOX->add ("Use <b>Alt-Enter</b> to toggle fullscreen mode", timeout => 864000, pri => -100, color => [1, 1, 1, 0.8]); |
1214 | |
1215 | |
1215 | (new CFClient::UI::Frame |
1216 | (new CFClient::UI::Frame |
1216 | bg => [0, 0, 0, 0.4], |
1217 | bg => [0, 0, 0, 0.4], |
1217 | force_x => 0, |
1218 | force_x => 0, |
1218 | force_y => "max", |
1219 | force_y => "max", |
… | |
… | |
1259 | $SETUP_DIALOG = new CFClient::UI::FancyFrame |
1260 | $SETUP_DIALOG = new CFClient::UI::FancyFrame |
1260 | title => "Setup", |
1261 | title => "Setup", |
1261 | name => "setup_dialog", |
1262 | name => "setup_dialog", |
1262 | x => 'center', |
1263 | x => 'center', |
1263 | y => 'center', |
1264 | y => 'center', |
|
|
1265 | z => 2, |
1264 | force_w => $::WIDTH * 0.6, |
1266 | force_w => $::WIDTH * 0.6, |
1265 | force_h => $::HEIGHT * 0.6, |
1267 | force_h => $::HEIGHT * 0.6, |
1266 | ; |
1268 | ; |
1267 | |
1269 | |
1268 | $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new CFClient::UI::Notebook expand => 1, debug => 1, |
1270 | $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new CFClient::UI::Notebook expand => 1, debug => 1, |
… | |
… | |
1276 | "Configure the video mode, performance, fonts and other graphical aspects of the game."); |
1278 | "Configure the video mode, performance, fonts and other graphical aspects of the game."); |
1277 | $SETUP_NOTEBOOK->add (Audio => audio_setup, |
1279 | $SETUP_NOTEBOOK->add (Audio => audio_setup, |
1278 | "Configure the use of audio, sound effects and background music."); |
1280 | "Configure the use of audio, sound effects and background music."); |
1279 | $SETUP_NOTEBOOK->add (Keyboard => $SETUP_KEYBOARD = keyboard_setup, |
1281 | $SETUP_NOTEBOOK->add (Keyboard => $SETUP_KEYBOARD = keyboard_setup, |
1280 | "Lets you define, edit and delete bindings." |
1282 | "Lets you define, edit and delete bindings." |
1281 | . "There is a shortcut for making bindings: Left Control + Insert opens the binding editor " |
1283 | . "There is a shortcut for making bindings: <b>Left Control + Insert</b> opens the binding editor " |
1282 | . "with nothing set and the recording started. After doing the actions you " |
1284 | . "with nothing set and the recording started. After doing the actions you " |
1283 | . "want to record press Insert and you will be asked to press a key-combo. " |
1285 | . "want to record press <b>Insert</b> and you will be asked to press a key-combo. " |
1284 | . "After pressing the combo the binding will be saved automatically and the " |
1286 | . "After pressing the combo the binding will be saved automatically and the " |
1285 | . "binding editor closes"); |
1287 | . "binding editor closes"); |
1286 | $SETUP_NOTEBOOK->add (Spells => $SETUP_SPELLS = spell_setup, |
1288 | $SETUP_NOTEBOOK->add (Spells => $SETUP_SPELLS = spell_setup, |
1287 | "Displays all spells you have and lets you edit keyboard shortcuts for them."); |
1289 | "Displays all spells you have and lets you edit keyboard shortcuts for them."); |
1288 | |
1290 | |