… | |
… | |
202 | |
202 | |
203 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fullscreen"); |
203 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fullscreen"); |
204 | $table->add (1, $row++, new CFClient::UI::CheckBox |
204 | $table->add (1, $row++, new CFClient::UI::CheckBox |
205 | state => $CFG->{fullscreen}, |
205 | state => $CFG->{fullscreen}, |
206 | tooltip => "Bring the client into fullscreen mode.", |
206 | tooltip => "Bring the client into fullscreen mode.", |
207 | connect_changed => sub { |
207 | on_changed => sub { |
208 | my ($self, $value) = @_; |
208 | my ($self, $value) = @_; |
209 | $CFG->{fullscreen} = $value; |
209 | $CFG->{fullscreen} = $value; |
210 | } |
210 | } |
211 | ); |
211 | ); |
212 | |
212 | |
213 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); |
213 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); |
214 | $table->add (1, $row++, new CFClient::UI::CheckBox |
214 | $table->add (1, $row++, new CFClient::UI::CheckBox |
215 | state => $CFG->{fast}, |
215 | state => $CFG->{fast}, |
216 | tooltip => "Lower the visual quality considerably to speed up rendering.", |
216 | tooltip => "Lower the visual quality considerably to speed up rendering.", |
217 | connect_changed => sub { |
217 | on_changed => sub { |
218 | my ($self, $value) = @_; |
218 | my ($self, $value) = @_; |
219 | $CFG->{fast} = $value; |
219 | $CFG->{fast} = $value; |
220 | } |
220 | } |
221 | ); |
221 | ); |
222 | |
222 | |
223 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Map Scale"); |
223 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Map Scale"); |
224 | $table->add (1, $row++, new CFClient::UI::Slider |
224 | $table->add (1, $row++, new CFClient::UI::Slider |
225 | range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1], |
225 | range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1], |
226 | tooltip => "Enlarge or shrink the displayed map. Changes are instant.", |
226 | tooltip => "Enlarge or shrink the displayed map. Changes are instant.", |
227 | connect_changed => sub { |
227 | on_changed => sub { |
228 | my ($self, $value) = @_; |
228 | my ($self, $value) = @_; |
229 | $CFG->{map_scale} = 2 ** $value; |
229 | $CFG->{map_scale} = 2 ** $value; |
230 | } |
230 | } |
231 | ); |
231 | ); |
232 | |
232 | |
233 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fog of War"); |
233 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fog of War"); |
234 | $table->add (1, $row++, new CFClient::UI::CheckBox |
234 | $table->add (1, $row++, new CFClient::UI::CheckBox |
235 | state => $CFG->{fow_enable}, |
235 | state => $CFG->{fow_enable}, |
236 | tooltip => "<b>Fog-of-War</b> marks areas that cannot be seen by the player. Changes are instant.", |
236 | tooltip => "<b>Fog-of-War</b> marks areas that cannot be seen by the player. Changes are instant.", |
237 | connect_changed => sub { |
237 | on_changed => sub { |
238 | my ($self, $value) = @_; |
238 | my ($self, $value) = @_; |
239 | $CFG->{fow_enable} = $value; |
239 | $CFG->{fow_enable} = $value; |
240 | } |
240 | } |
241 | ); |
241 | ); |
242 | |
242 | |
243 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Intensity"); |
243 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Intensity"); |
244 | $table->add (1, $row++, new CFClient::UI::Slider |
244 | $table->add (1, $row++, new CFClient::UI::Slider |
245 | range => [$CFG->{fow_intensity}, 0, 1, 0, 1 / 256], |
245 | range => [$CFG->{fow_intensity}, 0, 1, 0, 1 / 256], |
246 | tooltip => "<b>Fog of War Lightness.</b> The higher the intensity, the lighter the Fog-of-War color. Changes are instant.", |
246 | tooltip => "<b>Fog of War Lightness.</b> The higher the intensity, the lighter the Fog-of-War color. Changes are instant.", |
247 | connect_changed => sub { |
247 | on_changed => sub { |
248 | my ($self, $value) = @_; |
248 | my ($self, $value) = @_; |
249 | $CFG->{fow_intensity} = $value; |
249 | $CFG->{fow_intensity} = $value; |
250 | } |
250 | } |
251 | ); |
251 | ); |
252 | |
252 | |
253 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Smooth"); |
253 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Smooth"); |
254 | $table->add (1, $row++, new CFClient::UI::CheckBox |
254 | $table->add (1, $row++, new CFClient::UI::CheckBox |
255 | state => $CFG->{fow_smooth}, |
255 | state => $CFG->{fow_smooth}, |
256 | tooltip => "Smooth the Fog-of-War a bit to make it more realistic. Changes are instant.", |
256 | tooltip => "Smooth the Fog-of-War a bit to make it more realistic. Changes are instant.", |
257 | connect_changed => sub { |
257 | on_changed => sub { |
258 | my ($self, $value) = @_; |
258 | my ($self, $value) = @_; |
259 | $CFG->{fow_smooth} = $value; |
259 | $CFG->{fow_smooth} = $value; |
260 | status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::OpenGL::GL_VERSION < 1.2; |
260 | status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::OpenGL::GL_VERSION < 1.2; |
261 | } |
261 | } |
262 | ); |
262 | ); |
263 | |
263 | |
264 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); |
264 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); |
265 | $table->add (1, $row++, new CFClient::UI::Slider |
265 | $table->add (1, $row++, new CFClient::UI::Slider |
266 | range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1], |
266 | range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1], |
267 | tooltip => "The base font size used by most GUI elements that do not have their own setting.", |
267 | tooltip => "The base font size used by most GUI elements that do not have their own setting.", |
268 | connect_changed => sub { $CFG->{gui_fontsize} = $_[1] }, |
268 | on_changed => sub { $CFG->{gui_fontsize} = $_[1] }, |
269 | ); |
269 | ); |
270 | |
270 | |
271 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
271 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Message Fontsize"); |
272 | $table->add (1, $row++, new CFClient::UI::Slider |
272 | $table->add (1, $row++, new CFClient::UI::Slider |
273 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
273 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
274 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", |
274 | tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", |
275 | connect_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]) }, |
275 | on_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]) }, |
276 | ); |
276 | ); |
277 | |
277 | |
278 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Stats Fontsize"); |
278 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Stats Fontsize"); |
279 | |
279 | |
280 | $table->add (1, $row++, new CFClient::UI::Slider |
280 | $table->add (1, $row++, new CFClient::UI::Slider |
281 | range => [$CFG->{stat_fontsize}, 0.5, 2, 0, 0.1], |
281 | range => [$CFG->{stat_fontsize}, 0.5, 2, 0, 0.1], |
282 | tooltip => "The font size used by the <b>statistics window</b> only. Changes are instant.", |
282 | tooltip => "The font size used by the <b>statistics window</b> only. Changes are instant.", |
283 | connect_changed => sub { |
283 | on_changed => sub { |
284 | $CFG->{stat_fontsize} = $_[1]; |
284 | $CFG->{stat_fontsize} = $_[1]; |
285 | &set_stats_window_fontsize; |
285 | &set_stats_window_fontsize; |
286 | } |
286 | } |
287 | ); |
287 | ); |
288 | |
288 | |
289 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); |
289 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); |
290 | $table->add (1, $row++, new CFClient::UI::Slider |
290 | $table->add (1, $row++, new CFClient::UI::Slider |
291 | range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], |
291 | range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], |
292 | tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.", |
292 | tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.", |
293 | connect_changed => sub { |
293 | on_changed => sub { |
294 | $CFG->{gauge_fontsize} = $_[1]; |
294 | $CFG->{gauge_fontsize} = $_[1]; |
295 | &set_gauge_window_fontsize; |
295 | &set_gauge_window_fontsize; |
296 | } |
296 | } |
297 | ); |
297 | ); |
298 | |
298 | |
299 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge size"); |
299 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge size"); |
300 | $table->add (1, $row++, new CFClient::UI::Slider |
300 | $table->add (1, $row++, new CFClient::UI::Slider |
301 | range => [$CFG->{gauge_size}, 0.2, 0.8], |
301 | range => [$CFG->{gauge_size}, 0.2, 0.8], |
302 | tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.", |
302 | tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.", |
303 | connect_changed => sub { |
303 | on_changed => sub { |
304 | $CFG->{gauge_size} = $_[1]; |
304 | $CFG->{gauge_size} = $_[1]; |
305 | $GAUGES->{win}->set_size ($WIDTH, int $HEIGHT * $CFG->{gauge_size}); |
305 | $GAUGES->{win}->set_size ($WIDTH, int $HEIGHT * $CFG->{gauge_size}); |
306 | } |
306 | } |
307 | ); |
307 | ); |
308 | |
308 | |
309 | $table->add (1, $row++, new CFClient::UI::Button |
309 | $table->add (1, $row++, new CFClient::UI::Button |
310 | expand => 1, align => 0, text => "Apply", |
310 | expand => 1, align => 0, text => "Apply", |
311 | tooltip => "Apply the video settings", |
311 | tooltip => "Apply the video settings", |
312 | connect_activate => sub { |
312 | on_activate => sub { |
313 | video_shutdown (); |
313 | video_shutdown (); |
314 | video_init (); |
314 | video_init (); |
315 | } |
315 | } |
316 | ); |
316 | ); |
317 | |
317 | |
318 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Audio Enable"); |
318 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Audio Enable"); |
319 | $table->add (1, $row++, new CFClient::UI::CheckBox |
319 | $table->add (1, $row++, new CFClient::UI::CheckBox |
320 | state => $CFG->{audio_enable}, |
320 | state => $CFG->{audio_enable}, |
321 | tooltip => "<b>Master Audio Enable.</b> If enabled, sound effects and music will be played. If disabled, no audio will be used and the soundcard will not be opened.", |
321 | tooltip => "<b>Master Audio Enable.</b> If enabled, sound effects and music will be played. If disabled, no audio will be used and the soundcard will not be opened.", |
322 | connect_changed => sub { |
322 | on_changed => sub { |
323 | $CFG->{audio_enable} = $_[1]; |
323 | $CFG->{audio_enable} = $_[1]; |
324 | } |
324 | } |
325 | ); |
325 | ); |
326 | # $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
326 | # $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Effects Volume"); |
327 | # $table->add (1, 8, new CFClient::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], connect_changed => sub { |
327 | # $table->add (1, 8, new CFClient::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], on_changed => sub { |
328 | # $CFG->{effects_volume} = $_[1]; |
328 | # $CFG->{effects_volume} = $_[1]; |
329 | # }); |
329 | # }); |
330 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Background Music"); |
330 | $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Background Music"); |
331 | $table->add (1, $row++, my $hbox = new CFClient::UI::HBox); |
331 | $table->add (1, $row++, my $hbox = new CFClient::UI::HBox); |
332 | $hbox->add (new CFClient::UI::CheckBox |
332 | $hbox->add (new CFClient::UI::CheckBox |
333 | expand => 1, state => $CFG->{bgm_enable}, |
333 | expand => 1, state => $CFG->{bgm_enable}, |
334 | tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", |
334 | tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", |
335 | connect_changed => sub { |
335 | on_changed => sub { |
336 | $CFG->{bgm_enable} = $_[1]; |
336 | $CFG->{bgm_enable} = $_[1]; |
337 | } |
337 | } |
338 | ); |
338 | ); |
339 | $hbox->add (new CFClient::UI::Slider |
339 | $hbox->add (new CFClient::UI::Slider |
340 | expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], |
340 | expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], |
341 | tooltip => "The volume of the background music. Changes are instant.", |
341 | tooltip => "The volume of the background music. Changes are instant.", |
342 | connect_changed => sub { |
342 | on_changed => sub { |
343 | $CFG->{bgm_volume} = $_[1]; |
343 | $CFG->{bgm_volume} = $_[1]; |
344 | CFClient::MixMusic::volume $_[1] * 128; |
344 | CFClient::MixMusic::volume $_[1] * 128; |
345 | } |
345 | } |
346 | ); |
346 | ); |
347 | |
347 | |
348 | $table->add (1, $row++, new CFClient::UI::Button |
348 | $table->add (1, $row++, new CFClient::UI::Button |
349 | expand => 1, align => 0, text => "Apply", |
349 | expand => 1, align => 0, text => "Apply", |
350 | tooltip => "Apply the audio settings", |
350 | tooltip => "Apply the audio settings", |
351 | connect_activate => sub { |
351 | on_activate => sub { |
352 | audio_shutdown (); |
352 | audio_shutdown (); |
353 | audio_init (); |
353 | audio_init (); |
354 | } |
354 | } |
355 | ); |
355 | ); |
356 | |
356 | |
… | |
… | |
358 | $table->add (1, $row++, my $saycmd = new CFClient::UI::Entry |
358 | $table->add (1, $row++, my $saycmd = new CFClient::UI::Entry |
359 | text => $CFG->{say_command}, |
359 | text => $CFG->{say_command}, |
360 | tooltip => "This is the command that will be used if you write a line in the message window entry or press <b>\"</b> in the map window. " |
360 | tooltip => "This is the command that will be used if you write a line in the message window entry or press <b>\"</b> in the map window. " |
361 | . "Usually you want to enter something like 'say' or 'shout' or 'gsay' here. " |
361 | . "Usually you want to enter something like 'say' or 'shout' or 'gsay' here. " |
362 | . "But you could also set it to <b>tell <i>playername</i></b> to only chat with that user.", |
362 | . "But you could also set it to <b>tell <i>playername</i></b> to only chat with that user.", |
363 | connect_changed => sub { |
363 | on_changed => sub { |
364 | my ($self, $value) = @_; |
364 | my ($self, $value) = @_; |
365 | $CFG->{say_command} = $value; |
365 | $CFG->{say_command} = $value; |
366 | } |
366 | } |
367 | ); |
367 | ); |
368 | |
368 | |
… | |
… | |
689 | $m = [$users, $host, $uptime, $version, $desc]; |
689 | $m = [$users, $host, $uptime, $version, $desc]; |
690 | |
690 | |
691 | $y++; |
691 | $y++; |
692 | |
692 | |
693 | $table->add (0, $y, new CFClient::UI::VBox children => [ |
693 | $table->add (0, $y, new CFClient::UI::VBox children => [ |
694 | (new CFClient::UI::Button text => "Use", connect_activate => sub { |
694 | (new CFClient::UI::Button text => "Use", on_activate => sub { |
695 | $HOST->set_text ($CFG->{host} = $host); |
695 | $HOST->set_text ($CFG->{host} = $host); |
696 | }), |
696 | }), |
697 | (new CFClient::UI::Empty expand => 1), |
697 | (new CFClient::UI::Empty expand => 1), |
698 | ]); |
698 | ]); |
699 | |
699 | |
… | |
… | |
720 | $vbox->add ( |
720 | $vbox->add ( |
721 | my $HOST = new CFClient::UI::Entry |
721 | my $HOST = new CFClient::UI::Entry |
722 | expand => 1, |
722 | expand => 1, |
723 | text => $CFG->{host}, |
723 | text => $CFG->{host}, |
724 | tooltip => "The hostname or ip address of the Crossfire(+) server to connect to", |
724 | tooltip => "The hostname or ip address of the Crossfire(+) server to connect to", |
725 | connect_changed => sub { |
725 | on_changed => sub { |
726 | my ($self, $value) = @_; |
726 | my ($self, $value) = @_; |
727 | $CFG->{host} = $value; |
727 | $CFG->{host} = $value; |
728 | } |
728 | } |
729 | ); |
729 | ); |
730 | |
730 | |
… | |
… | |
733 | $vbox->add (new CFClient::UI::Flopper |
733 | $vbox->add (new CFClient::UI::Flopper |
734 | expand => 1, |
734 | expand => 1, |
735 | text => "Server List", |
735 | text => "Server List", |
736 | other => $METASERVER, |
736 | other => $METASERVER, |
737 | tooltip => "Show a list of available crossfire servers", |
737 | tooltip => "Show a list of available crossfire servers", |
738 | connect_open => sub { |
738 | on_open => sub { |
739 | update_metaserver $HOST; |
739 | update_metaserver $HOST; |
740 | } |
740 | } |
741 | ); |
741 | ); |
742 | } |
742 | } |
743 | |
743 | |
744 | $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "Username"); |
744 | $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "Username"); |
745 | $table->add (1, 4, new CFClient::UI::Entry |
745 | $table->add (1, 4, new CFClient::UI::Entry |
746 | text => $CFG->{user}, |
746 | text => $CFG->{user}, |
747 | tooltip => "The name of your character on the server", |
747 | tooltip => "The name of your character on the server", |
748 | connect_changed => sub { |
748 | on_changed => sub { |
749 | my ($self, $value) = @_; |
749 | my ($self, $value) = @_; |
750 | $CFG->{user} = $value; |
750 | $CFG->{user} = $value; |
751 | } |
751 | } |
752 | ); |
752 | ); |
753 | |
753 | |
754 | $table->add (0, 5, new CFClient::UI::Label valign => 0, align => 1, text => "Password"); |
754 | $table->add (0, 5, new CFClient::UI::Label valign => 0, align => 1, text => "Password"); |
755 | $table->add (1, 5, new CFClient::UI::Entry |
755 | $table->add (1, 5, new CFClient::UI::Entry |
756 | text => $CFG->{password}, |
756 | text => $CFG->{password}, |
757 | hidden => 1, |
757 | hidden => 1, |
758 | tooltip => "The password for your character", |
758 | tooltip => "The password for your character", |
759 | connect_changed => sub { |
759 | on_changed => sub { |
760 | my ($self, $value) = @_; |
760 | my ($self, $value) = @_; |
761 | $CFG->{password} = $value; |
761 | $CFG->{password} = $value; |
762 | } |
762 | } |
763 | ); |
763 | ); |
764 | |
764 | |
… | |
… | |
768 | range => [$CFG->{mapsize}, 10, 100, 0, 1], |
768 | range => [$CFG->{mapsize}, 10, 100, 0, 1], |
769 | tooltip => "This is the size of the portion of the map update the server sends you. " |
769 | tooltip => "This is the size of the portion of the map update the server sends you. " |
770 | . "If you set this to a high value you will be able to see further, " |
770 | . "If you set this to a high value you will be able to see further, " |
771 | . "but you also increase bandwidth requirements and latency. " |
771 | . "but you also increase bandwidth requirements and latency. " |
772 | . "This option is only used once at log-in.", |
772 | . "This option is only used once at log-in.", |
773 | connect_changed => sub { |
773 | on_changed => sub { |
774 | my ($self, $value) = @_; |
774 | my ($self, $value) = @_; |
775 | |
775 | |
776 | $CFG->{mapsize} = $self->{range}[0] = $value = int $value; |
776 | $CFG->{mapsize} = $self->{range}[0] = $value = int $value; |
777 | }, |
777 | }, |
778 | ); |
778 | ); |
… | |
… | |
785 | . "This might increase or create lag, but increases the chances " |
785 | . "This might increase or create lag, but increases the chances " |
786 | . "of faces being ready for display when you encounter them. " |
786 | . "of faces being ready for display when you encounter them. " |
787 | . "It also uses up server bandwidth on every connect, " |
787 | . "It also uses up server bandwidth on every connect, " |
788 | . "so only set it if you really need to prefetch images. " |
788 | . "so only set it if you really need to prefetch images. " |
789 | . "This option can be set and unset any time.", |
789 | . "This option can be set and unset any time.", |
790 | connect_changed => sub { $CFG->{face_prefetch} = $_[1] }, |
790 | on_changed => sub { $CFG->{face_prefetch} = $_[1] }, |
791 | ); |
791 | ); |
792 | |
792 | |
793 | $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Output-Count"); |
793 | $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Output-Count"); |
794 | $table->add (1, 9, new CFClient::UI::Entry |
794 | $table->add (1, 9, new CFClient::UI::Entry |
795 | text => $CFG->{output_count}, |
795 | text => $CFG->{output_count}, |
796 | tooltip => "Should be set to 1 unless you know what you are doing. This option is only used once at log-in.", |
796 | tooltip => "Should be set to 1 unless you know what you are doing. This option is only used once at log-in.", |
797 | connect_changed => sub { $CFG->{output_count} = $_[1] }, |
797 | on_changed => sub { $CFG->{output_count} = $_[1] }, |
798 | ); |
798 | ); |
799 | |
799 | |
800 | $table->add (0, 10, new CFClient::UI::Label valign => 0, align => 1, text => "Output-Sync"); |
800 | $table->add (0, 10, new CFClient::UI::Label valign => 0, align => 1, text => "Output-Sync"); |
801 | $table->add (1, 10, new CFClient::UI::Entry |
801 | $table->add (1, 10, new CFClient::UI::Entry |
802 | text => $CFG->{output_sync}, |
802 | text => $CFG->{output_sync}, |
803 | tooltip => "Should be set to 1 unless you know what you are doing. This option is only used once at log-in.", |
803 | tooltip => "Should be set to 1 unless you know what you are doing. This option is only used once at log-in.", |
804 | connect_changed => sub { $CFG->{output_sync} = $_[1] }, |
804 | on_changed => sub { $CFG->{output_sync} = $_[1] }, |
805 | ); |
805 | ); |
806 | |
806 | |
807 | $table->add (1, 11, $LOGIN_BUTTON = new CFClient::UI::Button |
807 | $table->add (1, 11, $LOGIN_BUTTON = new CFClient::UI::Button |
808 | expand => 1, |
808 | expand => 1, |
809 | align => 0, |
809 | align => 0, |
810 | text => "Login", |
810 | text => "Login", |
811 | connect_activate => sub { |
811 | on_activate => sub { |
812 | $CONN ? stop_game |
812 | $CONN ? stop_game |
813 | : start_game; |
813 | : start_game; |
814 | }, |
814 | }, |
815 | ); |
815 | ); |
816 | |
816 | |
… | |
… | |
832 | $vbox->add (my $input = new CFClient::UI::Entry |
832 | $vbox->add (my $input = new CFClient::UI::Entry |
833 | tooltip => "<b>Chat Box</b>. If you enter a text and press return/enter here, the current <i>communication command</i> " |
833 | tooltip => "<b>Chat Box</b>. If you enter a text and press return/enter here, the current <i>communication command</i> " |
834 | . "from the client setup will be prepended (e.g. <b>shout</b>, <b>chat</b>...). " |
834 | . "from the client setup will be prepended (e.g. <b>shout</b>, <b>chat</b>...). " |
835 | . "If you prepend a slash (/), you will submit a command instead (similar to IRC). " |
835 | . "If you prepend a slash (/), you will submit a command instead (similar to IRC). " |
836 | . "A better way to submit commands (and the occasional chat command) is often the map command completer.", |
836 | . "A better way to submit commands (and the occasional chat command) is often the map command completer.", |
837 | connect_focus_in => sub { |
837 | on_focus_in => sub { |
838 | my ($input, $prev_focus) = @_; |
838 | my ($input, $prev_focus) = @_; |
839 | |
839 | |
840 | delete $input->{refocus_map}; |
840 | delete $input->{refocus_map}; |
841 | |
841 | |
842 | if ($prev_focus == $MAPWIDGET && $input->{auto_activated}) { |
842 | if ($prev_focus == $MAPWIDGET && $input->{auto_activated}) { |
843 | $input->{refocus_map} = 1; |
843 | $input->{refocus_map} = 1; |
844 | } |
844 | } |
845 | delete $input->{auto_activated}; |
845 | delete $input->{auto_activated}; |
846 | }, |
846 | }, |
847 | connect_activate => sub { |
847 | on_activate => sub { |
848 | my ($input, $text) = @_; |
848 | my ($input, $text) = @_; |
849 | $input->set_text (''); |
849 | $input->set_text (''); |
850 | |
850 | |
851 | if ($text =~ /^\/(.*)/) { |
851 | if ($text =~ /^\/(.*)/) { |
852 | $::CONN->user_send ($1); |
852 | $::CONN->user_send ($1); |
… | |
… | |
857 | if ($input->{refocus_map}) { |
857 | if ($input->{refocus_map}) { |
858 | delete $input->{refocus_map}; |
858 | delete $input->{refocus_map}; |
859 | $MAPWIDGET->focus_in |
859 | $MAPWIDGET->focus_in |
860 | } |
860 | } |
861 | }, |
861 | }, |
862 | connect_escape => sub { |
862 | on_escape => sub { |
863 | $MAPWIDGET->focus_in |
863 | $MAPWIDGET->focus_in |
864 | }, |
864 | }, |
865 | ); |
865 | ); |
866 | |
866 | |
867 | $CONSOLE = { |
867 | $CONSOLE = { |
… | |
… | |
886 | ); |
886 | ); |
887 | $vb->add (my $hb = new CFClient::UI::HBox expand => 1); |
887 | $vb->add (my $hb = new CFClient::UI::HBox expand => 1); |
888 | $hb->add (new CFClient::UI::Button |
888 | $hb->add (new CFClient::UI::Button |
889 | text => "Ok", |
889 | text => "Ok", |
890 | expand => 1, |
890 | expand => 1, |
891 | connect_activate => sub { $QUIT_DIALOG->hide }, |
891 | on_activate => sub { $QUIT_DIALOG->hide }, |
892 | ); |
892 | ); |
893 | $hb->add (new CFClient::UI::Button |
893 | $hb->add (new CFClient::UI::Button |
894 | text => "Quit anyway", |
894 | text => "Quit anyway", |
895 | expand => 1, |
895 | expand => 1, |
896 | connect_activate => sub { exit }, |
896 | on_activate => sub { exit }, |
897 | ); |
897 | ); |
898 | |
898 | |
899 | $QUIT_DIALOG->show_centered; |
899 | $QUIT_DIALOG->show_centered; |
900 | } else { |
900 | } else { |
901 | $QUIT_DIALOG->show_centered; |
901 | $QUIT_DIALOG->show_centered; |
… | |
… | |
918 | $vb2->add (my $hb2 = new CFClient::UI::HBox); |
918 | $vb2->add (my $hb2 = new CFClient::UI::HBox); |
919 | $hb2->add ($INVR_LBL = new CFClient::UI::Label align => 0, expand => 1); |
919 | $hb2->add ($INVR_LBL = new CFClient::UI::Label align => 0, expand => 1); |
920 | $hb2->add (new CFClient::UI::Button |
920 | $hb2->add (new CFClient::UI::Button |
921 | text => "Close", |
921 | text => "Close", |
922 | tooltip => "Close the currently open container (if one is open)", |
922 | tooltip => "Close the currently open container (if one is open)", |
923 | connect_activate => sub { |
923 | on_activate => sub { |
924 | $CONN->send ("apply $CONN->{open_container}") |
924 | $CONN->send ("apply $CONN->{open_container}") |
925 | if $CONN->{open_container} != 0; |
925 | if $CONN->{open_container} != 0; |
926 | }, |
926 | }, |
927 | ); |
927 | ); |
928 | |
928 | |
… | |
… | |
949 | ) { |
949 | ) { |
950 | my ($pod, $label) = @$_; |
950 | my ($pod, $label) = @$_; |
951 | |
951 | |
952 | $buttons->add (new CFClient::UI::Button |
952 | $buttons->add (new CFClient::UI::Button |
953 | text => $label, |
953 | text => $label, |
954 | connect_activate => sub { |
954 | on_activate => sub { |
955 | my $parser = new Pod::POM; |
955 | my $parser = new Pod::POM; |
956 | my $pom = $parser->parse_file (CFClient::find_rcfile "pod/$pod.pod"); |
956 | my $pom = $parser->parse_file (CFClient::find_rcfile "pod/$pod.pod"); |
957 | |
957 | |
958 | $viewer->clear; |
958 | $viewer->clear; |
959 | |
959 | |
… | |
… | |
1067 | tooltip => "Toggles the inventory window, where you can manage your loot (or treaures :)."); |
1067 | tooltip => "Toggles the inventory window, where you can manage your loot (or treaures :)."); |
1068 | |
1068 | |
1069 | $BUTTONBAR->add (new CFClient::UI::Button |
1069 | $BUTTONBAR->add (new CFClient::UI::Button |
1070 | text => "Save Config", |
1070 | text => "Save Config", |
1071 | tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", |
1071 | tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", |
1072 | connect_activate => sub { |
1072 | on_activate => sub { |
1073 | $::CFG->{layout} = CFClient::UI::get_layout; |
1073 | $::CFG->{layout} = CFClient::UI::get_layout; |
1074 | CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; |
1074 | CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; |
1075 | status "Configuration Saved"; |
1075 | status "Configuration Saved"; |
1076 | }, |
1076 | }, |
1077 | ); |
1077 | ); |
1078 | |
1078 | |
1079 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Help!", other => make_help_window, |
1079 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Help!", other => make_help_window, |
1080 | tooltip => "View Documentation"); |
1080 | tooltip => "View Documentation"); |
1081 | |
1081 | |
1082 | $BUTTONBAR->add (new CFClient::UI::Button |
1082 | $BUTTONBAR->add (new CFClient::UI::Button |
1083 | text => "Quit", |
1083 | text => "Quit", |
1084 | tooltip => "Terminates the program", |
1084 | tooltip => "Terminates the program", |
1085 | connect_activate => sub { |
1085 | on_activate => sub { |
1086 | if ($CONN) { |
1086 | if ($CONN) { |
1087 | open_quit_dialog; |
1087 | open_quit_dialog; |
1088 | } else { |
1088 | } else { |
1089 | exit; |
1089 | exit; |
1090 | } |
1090 | } |