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.119 by root, Fri Sep 29 00:56:06 2006 UTC vs.
Revision 1.120 by root, Sun Oct 1 14:48:51 2006 UTC

63our $LAST_REFRESH; 63our $LAST_REFRESH;
64our $NOW; 64our $NOW;
65 65
66our $CFG; 66our $CFG;
67our $CONN; 67our $CONN;
68our $PROFILE; # current profile
68our $FAST; # fast, low-quality mode, possibly useful for software-rendering 69our $FAST; # fast, low-quality mode, possibly useful for software-rendering
69 70
70our $WANT_REFRESH; 71our $WANT_REFRESH;
71our $CAN_REFRESH; 72our $CAN_REFRESH;
72 73
344 status "logging in..."; 345 status "logging in...";
345 346
346 $LOGIN_BUTTON->set_text ("Logout"); 347 $LOGIN_BUTTON->set_text ("Logout");
347 $SETUP_DIALOG->hide; 348 $SETUP_DIALOG->hide;
348 349
350 $PROFILE = $CFG->{profile}{default};
351
349 my $mapsize = List::Util::min 32, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32; 352 my $mapsize = List::Util::min 32, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32;
350 353
351 my ($host, $port) = split /:/, $CFG->{profile}{default}{host}; 354 my ($host, $port) = split /:/, $PROFILE->{host};
352 355
353 $MAP = new CFPlus::Map $mapsize, $mapsize; 356 $MAP = new CFPlus::Map $mapsize, $mapsize;
354 357
355 $CONN = eval { 358 $CONN = eval {
356 new CFPlus::Protocol 359 new CFPlus::Protocol
357 host => $host, 360 host => $host,
358 port => $port || 13327, 361 port => $port || 13327,
359 user => $CFG->{profile}{default}{user}, 362 user => $PROFILE->{user},
360 pass => $CFG->{profile}{default}{password}, 363 pass => $PROFILE->{password},
361 mapw => $mapsize, 364 mapw => $mapsize,
362 maph => $mapsize, 365 maph => $mapsize,
363 366
364 client => "cfplus $VERSION $] $^O", 367 client => "cfplus $VERSION $] $^O",
365 368
407 destroy_query_dialog $CONN; 410 destroy_query_dialog $CONN;
408 $CONN->destroy; 411 $CONN->destroy;
409 $CONN = 0; # false, does not autovivify 412 $CONN = 0; # false, does not autovivify
410 413
411 undef $MAP; 414 undef $MAP;
415 undef $PROFILE;
412} 416}
413 417
414sub graphics_setup { 418sub graphics_setup {
415 my $vbox = new CFPlus::UI::VBox; 419 my $vbox = new CFPlus::UI::VBox;
416 420
1346 1350
1347 my $refresh; 1351 my $refresh;
1348 $refresh = $BIND_UPD_CB = sub { 1352 $refresh = $BIND_UPD_CB = sub {
1349 $binding_list->clear (); 1353 $binding_list->clear ();
1350 1354
1355 return unless $PROFILE;
1356
1351 for my $mod (keys %{$::CFG->{profile}{default}{bindings}}) { 1357 for my $mod (keys %{$PROFILE->{bindings}}) {
1352 for my $sym (keys %{$::CFG->{profile}{default}{bindings}{$mod}}) { 1358 for my $sym (keys %{$PROFILE->{bindings}{$mod}}) {
1353 my $cmds = $::CFG->{profile}{default}{bindings}{$mod}{$sym}; 1359 my $cmds = $PROFILE->{bindings}{$mod}{$sym};
1354 next unless ref $cmds eq 'ARRAY' and @$cmds > 0; 1360 next unless ref $cmds eq 'ARRAY' and @$cmds > 0;
1355 1361
1356 my $lbl = join "; ", @$cmds; 1362 my $lbl = join "; ", @$cmds;
1357 my $nam = CFPlus::BindingEditor::keycombo_to_name ($mod, $sym); 1363 my $nam = CFPlus::BindingEditor::keycombo_to_name ($mod, $sym);
1358 $binding_list->add (my $hb = new CFPlus::UI::HBox); 1364 $binding_list->add (my $hb = new CFPlus::UI::HBox);
1359 $hb->add (new CFPlus::UI::Button 1365 $hb->add (new CFPlus::UI::Button
1360 text => "delete", 1366 text => "delete",
1361 tooltip => "Deletes the binding", 1367 tooltip => "Deletes the binding",
1362 on_activate => sub { 1368 on_activate => sub {
1363 $binding_list->remove ($hb); 1369 $binding_list->remove ($hb);
1364 delete $::CFG->{profile}{default}{bindings}{$mod}{$sym}; 1370 delete $PROFILE->{bindings}{$mod}{$sym};
1365 0 1371 0
1366 }); 1372 });
1367 1373
1368 $hb->add (new CFPlus::UI::Button 1374 $hb->add (new CFPlus::UI::Button
1369 text => "edit", 1375 text => "edit",
1370 tooltip => "Edits the binding", 1376 tooltip => "Edits the binding",
1371 on_activate => sub { 1377 on_activate => sub {
1372 $::BIND_EDITOR->set_binding ( 1378 $::BIND_EDITOR->set_binding (
1373 $mod, $sym, $::CFG->{profile}{default}{bindings}{$mod}{$sym}, 1379 $mod, $sym, $PROFILE->{bindings}{$mod}{$sym},
1374 sub { 1380 sub {
1375 my ($nmod, $nsym, $ncmds) = @_; 1381 my ($nmod, $nsym, $ncmds) = @_;
1376 $::BIND_EDITOR->cfg_unbind ($mod, $sym); 1382 $::BIND_EDITOR->cfg_unbind ($mod, $sym);
1377 $::BIND_EDITOR->cfg_bind ($nmod, $nsym, $ncmds); 1383 $::BIND_EDITOR->cfg_bind ($nmod, $nsym, $ncmds);
1378 $refresh->(); 1384 $refresh->();
2090 audio_init; 2096 audio_init;
2091} 2097}
2092 2098
2093show_tip_of_the_day if $CFG->{show_tips}; 2099show_tip_of_the_day if $CFG->{show_tips};
2094 2100
2101use Data::Dumper; warn Dumper [CFPlus::win32_proxy_info()];#d#
2102
2095Event::loop; 2103Event::loop;
2096#CFPlus::SDL_Quit; 2104#CFPlus::SDL_Quit;
2097#CFPlus::_exit 0; 2105#CFPlus::_exit 0;
2098 2106
2099END { CFPlus::SDL_Quit } 2107END { CFPlus::SDL_Quit }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines