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.88 by root, Mon Jul 3 22:04:25 2006 UTC vs.
Revision 1.89 by elmex, Sun Jul 9 21:11:48 2006 UTC

475 range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], 475 range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1],
476 tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.", 476 tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant.",
477 on_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 }, 477 on_changed => sub { $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 },
478 ); 478 );
479 479
480 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Stats Fontsize");
481
482 $table->add (1, $row++, new CFClient::UI::Slider
483 range => [$CFG->{stat_fontsize}, 0.5, 2, 0, 0.1],
484 tooltip => "The font size used by the <b>statistics window</b> only. Changes are instant.",
485 on_changed => sub {
486 $CFG->{stat_fontsize} = $_[1];
487 &set_stats_window_fontsize;
488 0
489 }
490 );
491
492 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); 480 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize");
493 $table->add (1, $row++, new CFClient::UI::Slider 481 $table->add (1, $row++, new CFClient::UI::Slider
494 range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], 482 range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1],
495 tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.", 483 tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.",
496 on_changed => sub { 484 on_changed => sub {
565 ); 553 );
566 554
567 $vbox 555 $vbox
568} 556}
569 557
570sub set_stats_window_fontsize {
571 for (values %{$STATWIDS}) {
572 $_->set_fontsize ($::CFG->{stat_fontsize});
573 }
574}
575
576sub set_gauge_window_fontsize { 558sub set_gauge_window_fontsize {
577 for (map { $GAUGES->{$_} } grep { $_ ne 'win' } keys %{$GAUGES}) { 559 for (map { $GAUGES->{$_} } grep { $_ ne 'win' } keys %{$GAUGES}) {
578 $_->set_fontsize ($::CFG->{gauge_fontsize}); 560 $_->set_fontsize ($::CFG->{gauge_fontsize});
579 } 561 }
580} 562}
659 641
660 $table 642 $table
661} 643}
662 644
663sub stats_window { 645sub stats_window {
664 my $tgw =
665 new CFClient::UI::Window
666 child => my $vb = new CFClient::UI::VBox; 646 my $vb = new CFClient::UI::VBox;
667 647
668 $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, 648 $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1,
669 can_hover => 1, can_events => 1, 649 can_hover => 1, can_events => 1,
670 tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); 650 tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server.");
671 $vb->add ($STATWIDS->{map} = new CFClient::UI::Label valign => 0, align => -1, text => "Map:", expand => 1, 651 $vb->add ($STATWIDS->{map} = new CFClient::UI::Label valign => 0, align => -1, text => "Map:", expand => 1,
763 $col += 2; 743 $col += 2;
764 $row = 0; 744 $row = 0;
765 } 745 }
766 } 746 }
767 747
768 &set_stats_window_fontsize; 748 $vb->add (my $tbl3 = new CFClient::UI::Table expand => 1);
749 $STATWIDS->{"_skill_tbl"} = $tbl3;
750
769 update_stats_window ({}); 751 update_stats_window ({});
770 752
771 $tgw 753 $vb
772} 754}
773 755
774sub formsep($) { 756sub formsep($) {
775 scalar reverse join ",", unpack "(A3)*", reverse $_[0] * 1 757 scalar reverse join ",", unpack "(A3)*", reverse $_[0] * 1
776} 758}
836 depl => CS_STAT_RES_DEPLETE, 818 depl => CS_STAT_RES_DEPLETE,
837 deat => CS_STAT_RES_DEATH, 819 deat => CS_STAT_RES_DEATH,
838 holyw => CS_STAT_RES_HOLYWORD, 820 holyw => CS_STAT_RES_HOLYWORD,
839 blind => CS_STAT_RES_BLIND, 821 blind => CS_STAT_RES_BLIND,
840 ); 822 );
823
824 if ($::CONN && !$STATWIDS->{_skill_tbl_init}) {
825 my $sktbl = $STATWIDS->{_skill_tbl};
826 $sktbl->clear;
827
828 $sktbl->add (0, 0, new CFClient::UI::Label text => "Exp.", align => 1);
829 $sktbl->add (1, 0, new CFClient::UI::Label text => "Level", align => 1);
830 $sktbl->add (2, 0, new CFClient::UI::Label text => "Skillname");
831
832 my @skills;
833
834 for (my $i = CS_STAT_SKILLINFO; $i < CS_STAT_SKILLINFO+CS_NUM_SKILLS; $i++) {
835 push @skills, [$i, $::CONN->{skill_info}{$i}];
836 }
837
838 my $y = 1;
839 for (sort { $a->[1] cmp $b->[1] } @skills) {
840 my ($idx, $name) = @$_;
841
842 unless (defined $STATWIDS->{"sk_xp_$idx"} || !$::CONN->{skill_info}{$idx}) {
843 $sktbl->add (0, $y, $STATWIDS->{"sk_xp_$idx"} = new CFClient::UI::Label text => "0", align => 1);
844 $sktbl->add (1, $y, $STATWIDS->{"sk_lvl_$idx"} = new CFClient::UI::Label text => "0", align => 1);
845 $sktbl->add (2, $y++, new CFClient::UI::Label text => $name);
846 }
847 }
848
849 $STATWIDS->{_skill_tbl_init} = 1;
850 }
851
852 for (my $i = CS_STAT_SKILLINFO; $i < CS_STAT_SKILLINFO+CS_NUM_SKILLS; $i++) {
853 if (exists $stats->{$i}) {
854 $STATWIDS->{"sk_xp_$i"}->set_text (formsep $stats->{$i}->[1])
855 if $STATWIDS->{"sk_xp_$i"};
856 $STATWIDS->{"sk_lvl_$i"}->set_text (sprintf "%d", $stats->{$i}->[0])
857 if $STATWIDS->{"sk_lvl_$i"};
858 }
859 }
841 860
842 $STATWIDS->{"res_$_"}->set_text (sprintf "%d%", $stats->{$tbl{$_}}) 861 $STATWIDS->{"res_$_"}->set_text (sprintf "%d%", $stats->{$tbl{$_}})
843 for keys %tbl; 862 for keys %tbl;
844} 863}
845 864

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines