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

Comparing deliantra/Deliantra-Client/bin/pclient (file contents):
Revision 1.165 by elmex, Sun Apr 23 01:46:20 2006 UTC vs.
Revision 1.166 by elmex, Sun Apr 23 02:50:44 2006 UTC

120 $mode_slider->emit (changed => $mode_slider->{range}[0]); 120 $mode_slider->emit (changed => $mode_slider->{range}[0]);
121 121
122 my $row = 1; 122 my $row = 1;
123 123
124 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fullscreen"); 124 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fullscreen");
125 $table->add (1, $row++, new CFClient::UI::CheckBox state => $CFG->{fullscreen}, connect_changed => sub { 125 $table->add (1, $row++, new CFClient::UI::CheckBox
126 state => $CFG->{fullscreen},
127 tooltip => "Bring the client into fullscreen mode",
128 connect_changed => sub {
126 my ($self, $value) = @_; 129 my ($self, $value) = @_;
127 $CFG->{fullscreen} = $value; 130 $CFG->{fullscreen} = $value;
131 }
128 }); 132 );
129 133
130 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); 134 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fast & Ugly");
131 $table->add (1, $row++, new CFClient::UI::CheckBox 135 $table->add (1, $row++, new CFClient::UI::CheckBox
132 state => $CFG->{fast}, 136 state => $CFG->{fast},
133 tooltip => "Lower the visual quality considerably to speed up rendering.", 137 tooltip => "Lower the visual quality considerably to speed up rendering.",
211 ); 215 );
212 216
213 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); 217 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize");
214 $table->add (1, $row++, new CFClient::UI::Slider 218 $table->add (1, $row++, new CFClient::UI::Slider
215 range => [$CFG->{gauge_fontsize}, 0.5, 2.0, 0.1], 219 range => [$CFG->{gauge_fontsize}, 0.5, 2.0, 0.1],
220 tooltip => "Adjusts the fontsize of the gauges at the bottom right",
216 connect_changed => sub { 221 connect_changed => sub {
217 $CFG->{gauge_fontsize} = 0.1 * int $_[1] * 10; 222 $CFG->{gauge_fontsize} = 0.1 * int $_[1] * 10;
218 &set_gauge_window_fontsize; 223 &set_gauge_window_fontsize;
219 #$GAUGES->{win}->check_size; 224 #$GAUGES->{win}->check_size;
220 #$GAUGES->{win}->update; 225 #$GAUGES->{win}->update;
296 $vb->add (my $hbg = new CFClient::UI::HBox expand => 1); 301 $vb->add (my $hbg = new CFClient::UI::HBox expand => 1);
297 302
298 303
299 $hbg->add (new CFClient::UI::Empty expand => 1); 304 $hbg->add (new CFClient::UI::Empty expand => 1);
300 $hbg->add (my $hb = new CFClient::UI::HBox); 305 $hbg->add (my $hb = new CFClient::UI::HBox);
301 $hb->add (my $hg = new CFClient::UI::Gauge type => 'hp'); 306 $hb->add (my $hg = new CFClient::UI::Gauge type => 'hp', tooltip => "Health points");
302 $hb->add (my $mg = new CFClient::UI::Gauge type => 'mana'); 307 $hb->add (my $mg = new CFClient::UI::Gauge type => 'mana', tooltip => "Spellpoints");
303 $hb->add (my $gg = new CFClient::UI::Gauge type => 'grace'); 308 $hb->add (my $gg = new CFClient::UI::Gauge type => 'grace', tooltip => "Grace");
304 $hb->add (my $fg = new CFClient::UI::Gauge type => 'food'); 309 $hb->add (my $fg = new CFClient::UI::Gauge type => 'food', tooltip => "Food");
305 310
306 $vb->add (my $exp = new CFClient::UI::Label valign => 0, align => 1, text => "XP:"); 311 $vb->add (my $exp = new CFClient::UI::Label valign => 0, align => 1, text => "XP: 0 LVL: 0");
307# $vb->add (my $lvl = new CFClient::UI::Label valign => 0, align => 1, text => "Lvl:");
308 $vb->add (my $rng = new CFClient::UI::Label valign => 0, align => 1, text => "Rng:"); 312 $vb->add (my $rng = new CFClient::UI::Label valign => 0, align => 1, text => "Rng:");
309 313
310
311 $GAUGES = { 314 $GAUGES = {
312 exp => $exp,# lvl => $lvl,
313 win => $win, range => $rng, 315 exp => $exp, win => $win, range => $rng,
314 food => $fg, mana => $mg, hp => $hg, grace => $gg 316 food => $fg, mana => $mg, hp => $hg, grace => $gg
315 }; 317 };
316 $win 318 $win
317} 319}
318 320
361 $hb->add (my $tbl2 = new CFClient::UI::Table expand => 1); 363 $hb->add (my $tbl2 = new CFClient::UI::Table expand => 1);
362 364
363 my $row = 0; 365 my $row = 0;
364 my $col = 0; 366 my $col = 0;
365 367
368 my %resist_names = (
369 slow => "Slow",
370 holyw => "Holy Word",
371 conf => "Confusion",
372 fire => "Fire",
373 depl => "Depletion",
374 magic => "Magic",
375 drain => "Draining",
376 acid => "Acid",
377 pois => "Poison",
378 para => "Paralysation",
379 deat => "Death",
380 phys => "Physical",
381 blind => "Blind",
382 fear => "Fear",
383 tund => "Turn undead",
384 elec => "Electricity",
385 cold => "Cold",
386 ghit => "Ghost hit",
387 );
366 for (qw/slow holyw conf fire depl magic 388 for (qw/slow holyw conf fire depl magic
367 drain acid pois para deat phys 389 drain acid pois para deat phys
368 blind fear tund elec cold ghit/) 390 blind fear tund elec cold ghit/)
369 { 391 {
370 $tbl2->add ($col, $row, 392 $tbl2->add ($col, $row,
371 $STATWIDS->{"res_$_"} = 393 $STATWIDS->{"res_$_"} =
372 new CFClient::UI::Label text => "0", align => +1, valign => 0 394 new CFClient::UI::Label text => "0", align => +1, valign => 0
373 ); 395 );
374 $tbl2->add ($col + 1, $row, new CFClient::UI::Image image => "ui/resist/resist_$_.png"); 396 $tbl2->add ($col + 1, $row, new CFClient::UI::Image can_hover => 1, can_events => 1, image => "ui/resist/resist_$_.png", tooltip => $resist_names{$_});
375 397
376 $row++; 398 $row++;
377 if ($row % 6 == 0) { 399 if ($row % 6 == 0) {
378 $col += 2; 400 $col += 2;
379 $row = 0; 401 $row = 0;
406 $GAUGES->{exp} ->set_text ("XP: " . ($stats->{11} || $stats->{28}) * 1 428 $GAUGES->{exp} ->set_text ("XP: " . ($stats->{11} || $stats->{28}) * 1
407 ." LVL: " . $stats->{12} * 1); 429 ." LVL: " . $stats->{12} * 1);
408 my $rng = $stats->{20}; 430 my $rng = $stats->{20};
409 $rng =~ s/^Range: //; # thank you so much dear server 431 $rng =~ s/^Range: //; # thank you so much dear server
410 $GAUGES->{range} ->set_text ("Rng: " . $rng); 432 $GAUGES->{range} ->set_text ("Rng: " . $rng);
411# $GAUGES->{lvl} ->set_text ("LVL: " . $stats->{12});
412 my $title = $stats->{21}; 433 my $title = $stats->{21};
413 $title =~ s/^Player: //; 434 $title =~ s/^Player: //;
414 $STATWIDS->{title} ->set_text ("Title: " . $title); 435 $STATWIDS->{title} ->set_text ("Title: " . $title);
415 436
416 if (0) { # this code can vanish, just wanted to preserver it for a checkin
417 $STATWIDS->{st_str} ->set_text (sprintf "S%d", $stats->{5});
418 $STATWIDS->{st_dex} ->set_text (sprintf "D%d", $stats->{8});
419 $STATWIDS->{st_con} ->set_text (sprintf "Co%d", $stats->{9});
420 $STATWIDS->{st_int} ->set_text (sprintf "I%d", $stats->{6});
421 $STATWIDS->{st_wis} ->set_text (sprintf "W%d", $stats->{7});
422 $STATWIDS->{st_pow} ->set_text (sprintf "P%d", $stats->{22});
423 $STATWIDS->{st_cha} ->set_text (sprintf "Ch%d", $stats->{10});
424 $STATWIDS->{st_wc} ->set_text (sprintf "Wc%d", $stats->{13});
425 $STATWIDS->{st_ac} ->set_text (sprintf "Ac%d", $stats->{14});
426 $STATWIDS->{st_dam} ->set_text (sprintf "Dam%d", $stats->{15});
427 $STATWIDS->{st_arm} ->set_text (sprintf "Arm%d", $stats->{16});
428 $STATWIDS->{st_spd} ->set_text (sprintf "Sp%.1f", $stats->{17});
429 $STATWIDS->{st_wspd}->set_text (sprintf "WSp%.1f", $stats->{19});
430 } else {
431 $STATWIDS->{st_str} ->set_text (sprintf "%d", $stats->{5}); 437 $STATWIDS->{st_str} ->set_text (sprintf "%d", $stats->{5});
432 $STATWIDS->{st_dex} ->set_text (sprintf "%d", $stats->{8}); 438 $STATWIDS->{st_dex} ->set_text (sprintf "%d", $stats->{8});
433 $STATWIDS->{st_con} ->set_text (sprintf "%d", $stats->{9}); 439 $STATWIDS->{st_con} ->set_text (sprintf "%d", $stats->{9});
434 $STATWIDS->{st_int} ->set_text (sprintf "%d", $stats->{6}); 440 $STATWIDS->{st_int} ->set_text (sprintf "%d", $stats->{6});
435 $STATWIDS->{st_wis} ->set_text (sprintf "%d", $stats->{7}); 441 $STATWIDS->{st_wis} ->set_text (sprintf "%d", $stats->{7});
436 $STATWIDS->{st_pow} ->set_text (sprintf "%d", $stats->{22}); 442 $STATWIDS->{st_pow} ->set_text (sprintf "%d", $stats->{22});
437 $STATWIDS->{st_cha} ->set_text (sprintf "%d", $stats->{10}); 443 $STATWIDS->{st_cha} ->set_text (sprintf "%d", $stats->{10});
438 $STATWIDS->{st_wc} ->set_text (sprintf "%d", $stats->{13}); 444 $STATWIDS->{st_wc} ->set_text (sprintf "%d", $stats->{13});
439 $STATWIDS->{st_ac} ->set_text (sprintf "%d", $stats->{14}); 445 $STATWIDS->{st_ac} ->set_text (sprintf "%d", $stats->{14});
440 $STATWIDS->{st_dam} ->set_text (sprintf "%d", $stats->{15}); 446 $STATWIDS->{st_dam} ->set_text (sprintf "%d", $stats->{15});
441 $STATWIDS->{st_arm} ->set_text (sprintf "%d", $stats->{16}); 447 $STATWIDS->{st_arm} ->set_text (sprintf "%d", $stats->{16});
442 $STATWIDS->{st_spd} ->set_text (sprintf "%.1f", $stats->{17}); 448 $STATWIDS->{st_spd} ->set_text (sprintf "%.1f", $stats->{17});
443 $STATWIDS->{st_wspd}->set_text (sprintf "%.1f", $stats->{19}); 449 $STATWIDS->{st_wspd}->set_text (sprintf "%.1f", $stats->{19});
444 }
445 450
446 my %tbl = ( 451 my %tbl = (
447 phys => 100, 452 phys => 100,
448 magic => 101, 453 magic => 101,
449 fire => 102, 454 fire => 102,
555 $table->add (0, 2, new CFClient::UI::Label valign => 0, align => 1, text => "Host:Port"); 560 $table->add (0, 2, new CFClient::UI::Label valign => 0, align => 1, text => "Host:Port");
556 561
557 { 562 {
558 $table->add (1, 2, my $vbox = new CFClient::UI::VBox); 563 $table->add (1, 2, my $vbox = new CFClient::UI::VBox);
559 564
560 $vbox->add (my $HOST = new CFClient::UI::Entry expand => 1, text => $CFG->{host}, connect_changed => sub { 565 $vbox->add (
566 my $HOST = new CFClient::UI::Entry
567 expand => 1,
568 text => $CFG->{host},
569 tooltip => "The hostname or ip address of the Crossfire(+) server to connect to",
570 connect_changed => sub {
571 my ($self, $value) = @_;
572 $CFG->{host} = $value;
573 }
574 );
575
576 $METASERVER = metaserver_dialog;
577
578 $vbox->add (new CFClient::UI::Flopper
579 expand => 1,
580 text => "Metaserver",
581 other => $METASERVER,
582 tooltip => "Show a list of aviable crossfire servers",
583 connect_open => sub {
584 update_metaserver $HOST;
585 }
586 );
587 }
588
589 $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "Username");
590 $table->add (1, 4, new CFClient::UI::Entry
591 text => $CFG->{user},
592 tooltip => "The name of your character on the server",
593 connect_changed => sub {
561 my ($self, $value) = @_; 594 my ($self, $value) = @_;
562 $CFG->{host} = $value;
563 });
564
565 $METASERVER = metaserver_dialog;
566
567 $vbox->add (new CFClient::UI::Flopper expand => 1, text => "Metaserver", other => $METASERVER, connect_open => sub {
568 update_metaserver $HOST;
569 });
570 }
571
572 $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "Username");
573 $table->add (1, 4, new CFClient::UI::Entry text => $CFG->{user}, connect_changed => sub {
574 my ($self, $value) = @_;
575 $CFG->{user} = $value; 595 $CFG->{user} = $value;
596 }
576 }); 597 );
577 598
578 $table->add (0, 5, new CFClient::UI::Label valign => 0, align => 1, text => "Password"); 599 $table->add (0, 5, new CFClient::UI::Label valign => 0, align => 1, text => "Password");
579 $table->add (1, 5, new CFClient::UI::Entry text => $CFG->{password}, hidden => 1, connect_changed => sub { 600 $table->add (1, 5, new CFClient::UI::Entry
601 text => $CFG->{password},
602 hidden => 1,
603 tooltip => "The password for your character",
604 connect_changed => sub {
580 my ($self, $value) = @_; 605 my ($self, $value) = @_;
581 $CFG->{password} = $value; 606 $CFG->{password} = $value;
607 }
582 }); 608 );
583 609
584 $table->add (0, 6, new CFClient::UI::Label valign => 0, align => 1, text => "Def. say cmd"); 610 $table->add (0, 6, new CFClient::UI::Label valign => 0, align => 1, text => "Def. say cmd");
585 $table->add (1, 6, my $saycmd = new CFClient::UI::Entry text => $CFG->{say_command}, connect_changed => sub { 611 $table->add (1, 6, my $saycmd = new CFClient::UI::Entry
612 text => $CFG->{say_command},
613 tooltip => "This is the command that will be used if you write a line in the message window entry. "
614 ."Usually you want to enter something like 'say' or 'shout' or 'gsay' here. "
615 ."But you could also set it to 'tell <playername>' to only chat with that user.",
616 connect_changed => sub {
586 my ($self, $value) = @_; 617 my ($self, $value) = @_;
587 $CFG->{say_command} = $value; 618 $CFG->{say_command} = $value;
619 }
588 }); 620 );
589 621
590 $table->add (0, 7, new CFClient::UI::Label valign => 0, align => 1, text => "Map Size"); 622 $table->add (0, 7, new CFClient::UI::Label valign => 0, align => 1, text => "Map Size");
591 $table->add (1, 7, new CFClient::UI::Slider 623 $table->add (1, 7, new CFClient::UI::Slider
592 req_w => 100, 624 req_w => 100,
593 range => [$CFG->{mapsize}, 10, 100 + 1, 1], 625 range => [$CFG->{mapsize}, 10, 100 + 1, 1],
626 tooltip => "This is the size of the portion of the map update the server sends you. "
627 ."If you set this to a high value you will be able to see further for example.",
594 connect_changed => sub { 628 connect_changed => sub {
595 my ($self, $value) = @_; 629 my ($self, $value) = @_;
596 630
597 $CFG->{mapsize} = $self->{range}[0] = $value = int $value; 631 $CFG->{mapsize} = $self->{range}[0] = $value = int $value;
598 }, 632 },

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines