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

Comparing deliantra/Deliantra-Client/bin/deliantra (file contents):
Revision 1.21 by root, Fri Dec 28 17:28:01 2007 UTC vs.
Revision 1.22 by root, Sat Dec 29 13:44:31 2007 UTC

653 [Cha => CS_STAT_CHA], 653 [Cha => CS_STAT_CHA],
654 ) { 654 ) {
655 my ($name, $id) = @$_; 655 my ($name, $id) = @$_;
656 $hbox->add (new DC::UI::Label 656 $hbox->add (new DC::UI::Label
657 markup => "$conn->{stat}{$id} <span foreground='yellow'>$name</span>", 657 markup => "$conn->{stat}{$id} <span foreground='yellow'>$name</span>",
658 align => 0,
659 expand => 1, 658 expand => 1,
660 can_events => 1, 659 can_events => 1,
661 can_hover => 1, 660 can_hover => 1,
662 tooltip => "#stat_$name", 661 tooltip => "#stat_$name",
663 ); 662 );
769 768
770 $vbox->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]); 769 $vbox->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]);
771 770
772 my $row = 0; 771 my $row = 0;
773 772
774 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "OpenGL Info"); 773 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "OpenGL Info");
775 $table->add_at (1, $row++, new DC::UI::Label valign => 0, fontsize => 0.8, text => DC::OpenGL::gl_vendor . ", " . DC::OpenGL::gl_version, 774 $table->add_at (1, $row++, new DC::UI::Label fontsize => 0.8, text => DC::OpenGL::gl_vendor . ", " . DC::OpenGL::gl_version,
776 can_events => 1, 775 can_events => 1,
777 tooltip => "<tt><span size='8192'>" . (DC::OpenGL::gl_extensions) . "</span></tt>"); 776 tooltip => "<tt><span size='8192'>" . (DC::OpenGL::gl_extensions) . "</span></tt>");
778 777
779 my $vidmode_tooltip = 778 my $vidmode_tooltip =
780 "<b>Video Mode.</b> The video mode to use for fullscreen (and the window size for windowed operation). " 779 "<b>Video Mode.</b> The video mode to use for fullscreen (and the window size for windowed operation). "
781 . "The format is <i>width</i> x <i>height</i> \@ <i>depth-per-channel</i> + <i>alpha-channel</i>."; 780 . "The format is <i>width</i> x <i>height</i> \@ <i>depth-per-channel</i> + <i>alpha-channel</i>.";
782 781
783 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Video Mode"); 782 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Video Mode");
784 $table->add_at (1, $row++, my $hbox = new DC::UI::HBox); 783 $table->add_at (1, $row++, my $hbox = new DC::UI::HBox);
785 784
786 $hbox->add (my $mode_slider = new DC::UI::Slider 785 $hbox->add (my $mode_slider = new DC::UI::Slider
787 force_w => $WIDTH * 0.1, expand => 1, range => [$CFG->{sdl_mode}, 0, $#SDL_MODES, 0, 1], 786 force_w => $WIDTH * 0.1, expand => 1, range => [$CFG->{sdl_mode}, 0, $#SDL_MODES, 0, 1],
788 tooltip => $vidmode_tooltip); 787 tooltip => $vidmode_tooltip);
789 $hbox->add (my $mode_label = new DC::UI::Label 788 $hbox->add (my $mode_label = new DC::UI::Label
790 align => 0, valign => 0, height => 0.8, template => "9999x9999@9+9", 789 height => 0.8, template => "9999x9999@9+9",
791 can_events => 1, tooltip => $vidmode_tooltip); 790 can_events => 1, tooltip => $vidmode_tooltip);
792 791
793 $mode_slider->connect (changed => sub { 792 $mode_slider->connect (changed => sub {
794 my ($self, $value) = @_; 793 my ($self, $value) = @_;
795 794
796 $CFG->{sdl_mode} = $self->{range}[0] = $value = int $value; 795 $CFG->{sdl_mode} = $self->{range}[0] = $value = int $value;
797 $mode_label->set_text (sprintf '%dx%d@%d+%d', @{$SDL_MODES[$value]}); 796 $mode_label->set_text (sprintf '%dx%d@%d+%d', @{$SDL_MODES[$value]});
798 }); 797 });
799 $mode_slider->emit (changed => $mode_slider->{range}[0]); 798 $mode_slider->emit (changed => $mode_slider->{range}[0]);
800 799
801 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Fullscreen"); 800 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Fullscreen");
802 $table->add_at (1, $row++, $FULLSCREEN_ENABLE = new DC::UI::CheckBox 801 $table->add_at (1, $row++, $FULLSCREEN_ENABLE = new DC::UI::CheckBox
803 state => $CFG->{fullscreen}, 802 state => $CFG->{fullscreen},
804 tooltip => "Bring the client into fullscreen mode.", 803 tooltip => "Bring the client into fullscreen mode.",
805 on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 } 804 on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 }
806 ); 805 );
807 806
808 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Force OpenGL 1.1"); 807 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Force OpenGL 1.1");
809 $table->add_at (1, $row++, new DC::UI::CheckBox 808 $table->add_at (1, $row++, new DC::UI::CheckBox
810 state => $CFG->{force_opengl11}, 809 state => $CFG->{force_opengl11},
811 tooltip => "Limit CFPlus to use OpenGL 1.1 features only. This will normally result in " 810 tooltip => "Limit CFPlus to use OpenGL 1.1 features only. This will normally result in "
812 . "higher memory usage and slower performance. It will, however, help tremendously on " 811 . "higher memory usage and slower performance. It will, however, help tremendously on "
813 . "cards that claim to support a feature but fall back to software rendering. " 812 . "cards that claim to support a feature but fall back to software rendering. "
815 . "but cards and drivers from other vendors (ATI) are often just as bad. <b>If you " 814 . "but cards and drivers from other vendors (ATI) are often just as bad. <b>If you "
816 . "experience extremely low framerates and your card should do better, try this option.</b>", 815 . "experience extremely low framerates and your card should do better, try this option.</b>",
817 on_changed => sub { my ($self, $value) = @_; $CFG->{force_opengl11} = $value; 0 } 816 on_changed => sub { my ($self, $value) = @_; $CFG->{force_opengl11} = $value; 0 }
818 ); 817 );
819 818
820 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Compress Textures"); 819 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Compress Textures");
821 $table->add_at (1, $row++, new DC::UI::CheckBox 820 $table->add_at (1, $row++, new DC::UI::CheckBox
822 state => $CFG->{texture_compression}, 821 state => $CFG->{texture_compression},
823 tooltip => "Use texture compression. Normally this will not reduce visual quality noticable but " 822 tooltip => "Use texture compression. Normally this will not reduce visual quality noticable but "
824 . "will save a lot of memory and increase performance. The compression algorithm " 823 . "will save a lot of memory and increase performance. The compression algorithm "
825 . "can differ form card to card, so your mileage may vary. This setting is ignored in " 824 . "can differ form card to card, so your mileage may vary. This setting is ignored in "
826 . "forced OpenGL 1.1 mode.", 825 . "forced OpenGL 1.1 mode.",
827 on_changed => sub { my ($self, $value) = @_; $CFG->{texture_compression} = $value; 0 } 826 on_changed => sub { my ($self, $value) = @_; $CFG->{texture_compression} = $value; 0 }
828 ); 827 );
829 828
830 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); 829 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Fast & Ugly");
831 $table->add_at (1, $row++, new DC::UI::CheckBox 830 $table->add_at (1, $row++, new DC::UI::CheckBox
832 state => $CFG->{fast}, 831 state => $CFG->{fast},
833 tooltip => "Lower the visual quality considerably to speed up rendering.", 832 tooltip => "Lower the visual quality considerably to speed up rendering.",
834 on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 } 833 on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 }
835 ); 834 );
836 835
837 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); 836 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "GUI Fontsize");
838 $table->add_at (1, $row++, new DC::UI::Slider 837 $table->add_at (1, $row++, new DC::UI::Slider
839 range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1], 838 range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1],
840 tooltip => "The base font size used by most GUI elements that do not have their own setting.", 839 tooltip => "The base font size used by most GUI elements that do not have their own setting.",
841 on_changed => sub { $CFG->{gui_fontsize} = $_[1]; 0 }, 840 on_changed => sub { $CFG->{gui_fontsize} = $_[1]; 0 },
842 ); 841 );
843 842
844 $table->add_at (1, $row++, new DC::UI::Button 843 $table->add_at (1, $row++, new DC::UI::Button
845 expand => 1, align => 0, text => "Apply", 844 expand => 1, text => "Apply",
846 tooltip => "Apply the video settings above.", 845 tooltip => "Apply the video settings above.",
847 on_activate => sub { 846 on_activate => sub {
848 video_shutdown (); 847 video_shutdown ();
849 video_init (); 848 video_init ();
850 0 849 0
851 } 850 }
852 ); 851 );
853 852
854 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Map Scale"); 853 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Map Scale");
855 $table->add_at (1, $row++, new DC::UI::Slider 854 $table->add_at (1, $row++, new DC::UI::Slider
856 range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1], 855 range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1],
857 tooltip => "Enlarge or shrink the displayed map. Changes are instant.", 856 tooltip => "Enlarge or shrink the displayed map. Changes are instant.",
858 on_changed => sub { my ($self, $value) = @_; $CFG->{map_scale} = 2 ** $value; 0 } 857 on_changed => sub { my ($self, $value) = @_; $CFG->{map_scale} = 2 ** $value; 0 }
859 ); 858 );
860 859
861 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Map Smoothing"); 860 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Map Smoothing");
862 $table->add_at (1, $row++, new DC::UI::CheckBox 861 $table->add_at (1, $row++, new DC::UI::CheckBox
863 state => $CFG->{map_smoothing}, 862 state => $CFG->{map_smoothing},
864 tooltip => "<b>Map Smoothing</b> tries to make tile borders less square. " 863 tooltip => "<b>Map Smoothing</b> tries to make tile borders less square. "
865 . "This increases load on the graphics subsystem and works only with TRT servers. " 864 . "This increases load on the graphics subsystem and works only with TRT servers. "
866 . "Changes take effect at next login only.", 865 . "Changes take effect at next login only.",
867 on_changed => sub { my ($self, $value) = @_; $CFG->{map_smoothing} = $value; 0 } 866 on_changed => sub { my ($self, $value) = @_; $CFG->{map_smoothing} = $value; 0 }
868 ); 867 );
869 868
870 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Fog of War"); 869 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Fog of War");
871 $table->add_at (1, $row++, new DC::UI::CheckBox 870 $table->add_at (1, $row++, new DC::UI::CheckBox
872 state => $CFG->{fow_enable}, 871 state => $CFG->{fow_enable},
873 tooltip => "<b>Fog-of-War</b> marks areas that cannot be seen by the player. Changes are instant.", 872 tooltip => "<b>Fog-of-War</b> marks areas that cannot be seen by the player. Changes are instant.",
874 on_changed => sub { my ($self, $value) = @_; $CFG->{fow_enable} = $value; 0 } 873 on_changed => sub { my ($self, $value) = @_; $CFG->{fow_enable} = $value; 0 }
875 ); 874 );
876 875
877 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "FoW Intensity"); 876 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "FoW Intensity");
878 $table->add_at (1, $row++, new DC::UI::Slider 877 $table->add_at (1, $row++, new DC::UI::Slider
879 range => [$CFG->{fow_intensity}, 0, 1, 0, 1 / 256], 878 range => [$CFG->{fow_intensity}, 0, 1, 0, 1 / 256],
880 tooltip => "<b>Fog of War Lightness.</b> The higher the intensity, the lighter the Fog-of-War color. Changes are instant.", 879 tooltip => "<b>Fog of War Lightness.</b> The higher the intensity, the lighter the Fog-of-War color. Changes are instant.",
881 on_changed => sub { my ($self, $value) = @_; $CFG->{fow_intensity} = $value; 0 } 880 on_changed => sub { my ($self, $value) = @_; $CFG->{fow_intensity} = $value; 0 }
882 ); 881 );
883 882
884 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Message Fontsize"); 883 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Message Fontsize");
885 $table->add_at (1, $row++, new DC::UI::Slider 884 $table->add_at (1, $row++, new DC::UI::Slider
886 range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], 885 range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1],
887 tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant, " 886 tooltip => "The font size used by the <b>message/server log</b> window only. Changes are instant, "
888 . "but you still need to press apply to correctly re-layout the widget.", 887 . "but you still need to press apply to correctly re-layout the widget.",
889 on_changed => sub { $MESSAGE_WINDOW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 }, 888 on_changed => sub { $MESSAGE_WINDOW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 },
890 ); 889 );
891 890
892 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); 891 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Gauge fontsize");
893 $table->add_at (1, $row++, new DC::UI::Slider 892 $table->add_at (1, $row++, new DC::UI::Slider
894 range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], 893 range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1],
895 tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.", 894 tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.",
896 on_changed => sub { 895 on_changed => sub {
897 $CFG->{gauge_fontsize} = $_[1]; 896 $CFG->{gauge_fontsize} = $_[1];
898 &set_gauge_window_fontsize; 897 &set_gauge_window_fontsize;
899 0 898 0
900 } 899 }
901 ); 900 );
902 901
903 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Gauge size"); 902 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Gauge size");
904 $table->add_at (1, $row++, new DC::UI::Slider 903 $table->add_at (1, $row++, new DC::UI::Slider
905 range => [$CFG->{gauge_size}, 0.2, 0.8], 904 range => [$CFG->{gauge_size}, 0.2, 0.8],
906 tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.", 905 tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.",
907 on_changed => sub { 906 on_changed => sub {
908 $CFG->{gauge_size} = $_[1]; 907 $CFG->{gauge_size} = $_[1];
942 941
943 $vbox->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 0, 1]); 942 $vbox->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 0, 1]);
944 943
945 my $row = 0; 944 my $row = 0;
946 945
947 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Audio Enable"); 946 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Audio Enable");
948 $table->add_at (1, $row++, new DC::UI::CheckBox 947 $table->add_at (1, $row++, new DC::UI::CheckBox
949 state => $CFG->{audio_enable}, 948 state => $CFG->{audio_enable},
950 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.", 949 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.",
951 on_changed => sub { $CFG->{audio_enable} = $_[1]; 1 } 950 on_changed => sub { $CFG->{audio_enable} = $_[1]; 1 }
952 ); 951 );
953 952
954 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Sound Effects"); 953 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Sound Effects");
955 $table->add_at (1, $row, new DC::UI::CheckBox 954 $table->add_at (1, $row, new DC::UI::CheckBox
956 expand => 1, state => $CFG->{effects_enable}, 955 expand => 1, state => $CFG->{effects_enable},
957 tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.", 956 tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.",
958 on_changed => sub { 957 on_changed => sub {
959 $CFG->{effects_enable} = $_[1]; 958 $CFG->{effects_enable} = $_[1];
966 tooltip => "The relative volume of sound effects. Best audio quality is achieved if this " 965 tooltip => "The relative volume of sound effects. Best audio quality is achieved if this "
967 . "is set highest (rightmost) and you use your operating system volume setting. Changes are instant.", 966 . "is set highest (rightmost) and you use your operating system volume setting. Changes are instant.",
968 on_changed => sub { $CFG->{effects_volume} = $_[1]; 1 } 967 on_changed => sub { $CFG->{effects_volume} = $_[1]; 1 }
969 ); 968 );
970 969
971 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Background Music"); 970 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Background Music");
972 $table->add_at (1, $row, new DC::UI::CheckBox 971 $table->add_at (1, $row, new DC::UI::CheckBox
973 expand => 1, state => $CFG->{bgm_enable}, 972 expand => 1, state => $CFG->{bgm_enable},
974 tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", 973 tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.",
975 on_changed => sub { 974 on_changed => sub {
976 $CFG->{bgm_enable} = $_[1]; 975 $CFG->{bgm_enable} = $_[1];
983 expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], 982 expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128],
984 tooltip => "The volume of the background music. Changes are instant.", 983 tooltip => "The volume of the background music. Changes are instant.",
985 on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 } 984 on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 }
986 ); 985 );
987 986
988 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Frequency"); 987 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Frequency");
989 $table->add_at (1, $row++, new DC::UI::Selector 988 $table->add_at (1, $row++, new DC::UI::Selector
990 c_colspan => 2, expand => 1, 989 c_colspan => 2, expand => 1,
991 value => $CFG->{audio_hw_frequency}, 990 value => $CFG->{audio_hw_frequency},
992 options => [ 991 options => [
993 [ 0, "default" , "Use System Default"], 992 [ 0, "default" , "Use System Default"],
1002 audio_tab_update; 1001 audio_tab_update;
1003 1 1002 1
1004 } 1003 }
1005 ); 1004 );
1006 1005
1007 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Channels"); 1006 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Channels");
1008 $table->add_at (1, $row++, new DC::UI::Selector 1007 $table->add_at (1, $row++, new DC::UI::Selector
1009 c_colspan => 2, expand => 1, 1008 c_colspan => 2, expand => 1,
1010 value => $CFG->{audio_hw_channels}, 1009 value => $CFG->{audio_hw_channels},
1011 options => [ 1010 options => [
1012 [0, "default" , "Use System Default"], 1011 [0, "default" , "Use System Default"],
1021 audio_tab_update; 1020 audio_tab_update;
1022 1 1021 1
1023 } 1022 }
1024 ); 1023 );
1025 1024
1026 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Latency"); 1025 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Latency");
1027 $table->add_at (1, $row++, $AUDIO_HW_CHUNKSIZE = new DC::UI::Selector 1026 $table->add_at (1, $row++, $AUDIO_HW_CHUNKSIZE = new DC::UI::Selector
1028 c_colspan => 2, expand => 1, 1027 c_colspan => 2, expand => 1,
1029 value => $CFG->{audio_hw_chunksize}, 1028 value => $CFG->{audio_hw_chunksize},
1030 tooltip => "The guarenteed latency. Lower is better, but also more cpu-intensive and might cause stuttering. If music playback " 1029 tooltip => "The guarenteed latency. Lower is better, but also more cpu-intensive and might cause stuttering. If music playback "
1031 . "is stuttering, increase this value. Values of 50-100ms are optimal.", 1030 . "is stuttering, increase this value. Values of 50-100ms are optimal.",
1035 1 1034 1
1036 } 1035 }
1037 ); 1036 );
1038 1037
1039 # should really be a slider 1038 # should really be a slider
1040 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Mixer Voices"); 1039 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Mixer Voices");
1041 $table->add_at (1, $row++, new DC::UI::ValSlider 1040 $table->add_at (1, $row++, new DC::UI::ValSlider
1042 c_colspan => 2, expand => 1, 1041 c_colspan => 2, expand => 1,
1043 tooltip => "The number of simultaneous sound effects possible. Higher is better, but also more cpu-intensive and might cause stuttering.", 1042 tooltip => "The number of simultaneous sound effects possible. Higher is better, but also more cpu-intensive and might cause stuttering.",
1044 range => [$::CFG->{audio_mix_channels}, 4, 32, 0, 1], 1043 range => [$::CFG->{audio_mix_channels}, 4, 32, 0, 1],
1045 template => ">= 99", 1044 template => ">= 99",
1051 1; 1050 1;
1052 } 1051 }
1053 ); 1052 );
1054 1053
1055 $table->add_at (1, $row++, new DC::UI::Button 1054 $table->add_at (1, $row++, new DC::UI::Button
1056 c_colspan => 2, expand => 1, align => 0, text => "Apply", 1055 c_colspan => 2, expand => 1, text => "Apply",
1057 tooltip => "Apply the audio settings", 1056 tooltip => "Apply the audio settings",
1058 on_activate => sub { 1057 on_activate => sub {
1059 audio_shutdown (); 1058 audio_shutdown ();
1060 audio_init (); 1059 audio_init ();
1061 0 1060 0
1111 $hb->add (my $hg = new DC::UI::Gauge type => 'hp', tooltip => "#stat_health"); 1110 $hb->add (my $hg = new DC::UI::Gauge type => 'hp', tooltip => "#stat_health");
1112 $hb->add (my $mg = new DC::UI::Gauge type => 'mana', tooltip => "#stat_mana"); 1111 $hb->add (my $mg = new DC::UI::Gauge type => 'mana', tooltip => "#stat_mana");
1113 $hb->add (my $gg = new DC::UI::Gauge type => 'grace', tooltip => "#stat_grace"); 1112 $hb->add (my $gg = new DC::UI::Gauge type => 'grace', tooltip => "#stat_grace");
1114 $hb->add (my $fg = new DC::UI::Gauge type => 'food', tooltip => "#stat_food"); 1113 $hb->add (my $fg = new DC::UI::Gauge type => 'food', tooltip => "#stat_food");
1115 1114
1116 $vbox->add (my $exp = new DC::UI::Label valign => 0, align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_exp"); 1115 $vbox->add (my $exp = new DC::UI::Label align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_exp");
1117 $vbox->add (my $prg = new DC::UI::ExperienceProgress); 1116 $vbox->add (my $prg = new DC::UI::ExperienceProgress);
1118 $vbox->add (my $sklprg = new DC::UI::ExperienceProgress); 1117 $vbox->add (my $sklprg = new DC::UI::ExperienceProgress);
1119 $vbox->add (my $rng = new DC::UI::Label valign => 0, align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_ranged"); 1118 $vbox->add (my $rng = new DC::UI::Label align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_ranged");
1120 1119
1121 $GAUGES = { 1120 $GAUGES = {
1122 exp => $exp, prg => $prg, sklprg => $sklprg, 1121 exp => $exp, prg => $prg, sklprg => $sklprg,
1123 win => $win, range => $rng, 1122 win => $win, range => $rng,
1124 hp => $hg, mana => $mg, grace => $gg, food => $fg, 1123 hp => $hg, mana => $mg, grace => $gg, food => $fg,
1190 $vb->add (new DC::UI::FancyFrame 1189 $vb->add (new DC::UI::FancyFrame
1191 label => "Player", 1190 label => "Player",
1192 child => (my $pi = new DC::UI::VBox), 1191 child => (my $pi = new DC::UI::VBox),
1193 ); 1192 );
1194 1193
1195 $pi->add ($STATWIDS->{title} = new DC::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, 1194 $pi->add ($STATWIDS->{title} = new DC::UI::Label text => "Title:", expand => 1, align => 0,
1196 can_hover => 1, can_events => 1, 1195 can_hover => 1, can_events => 1,
1197 tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); 1196 tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server.");
1198 $pi->add ($STATWIDS->{map} = new DC::UI::Label valign => 0, align => -1, text => "Map:", expand => 1, 1197 $pi->add ($STATWIDS->{map} = new DC::UI::Label align => 0, text => "Map:", expand => 1,
1199 can_hover => 1, can_events => 1, 1198 can_hover => 1, can_events => 1,
1200 tooltip => "The map you are currently on (if supported by the server)."); 1199 tooltip => "The map you are currently on (if supported by the server).");
1201 1200
1202 $pi->add (my $hb0 = new DC::UI::HBox); 1201 $pi->add (my $hb0 = new DC::UI::HBox);
1203 $hb0->add ($STATWIDS->{weight} = new DC::UI::Label valign => 0, align => -1, text => "Weight:", expand => 1, 1202 $hb0->add ($STATWIDS->{weight} = new DC::UI::Label text => "Weight:", expand => 1, align => 0,
1204 can_hover => 1, can_events => 1, 1203 can_hover => 1, can_events => 1,
1205 tooltip => "The weight of the player including all inventory items."); 1204 tooltip => "The weight of the player including all inventory items.");
1206 $hb0->add ($STATWIDS->{m_weight} = new DC::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1, 1205 $hb0->add ($STATWIDS->{m_weight} = new DC::UI::Label align => 0, text => "Max weight:", expand => 1,
1207 can_hover => 1, can_events => 1, 1206 can_hover => 1, can_events => 1,
1208 tooltip => "The weight limit: you cannot carry more than this."); 1207 tooltip => "The weight limit: you cannot carry more than this.");
1209 1208
1210 $vb->add (new DC::UI::FancyFrame 1209 $vb->add (new DC::UI::FancyFrame
1211 label => "Primary/Secondary Statistics", 1210 label => "Primary/Secondary Statistics",
1232 [2, 5, st_wspd => "WSp", 10.54], 1231 [2, 5, st_wspd => "WSp", 10.54],
1233 ) { 1232 ) {
1234 my ($col, $row, $id, $label, $template) = @$_; 1233 my ($col, $row, $id, $label, $template) = @$_;
1235 1234
1236 $tbl->add_at ($col , $row, $STATWIDS->{$id} = new DC::UI::Label 1235 $tbl->add_at ($col , $row, $STATWIDS->{$id} = new DC::UI::Label
1237 font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0, 1236 font => $FONT_FIXED, can_hover => 1, can_events => 1,
1238 align => +1, template => $template, tooltip => "#stat_$label"); 1237 align => 1, template => $template, tooltip => "#stat_$label");
1239 $tbl->add_at ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new DC::UI::Label 1238 $tbl->add_at ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new DC::UI::Label
1240 font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0, 1239 font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2,
1241 align => -1, text => $label, tooltip => "#stat_$label"); 1240 align => 0, text => $label, tooltip => "#stat_$label");
1242 } 1241 }
1243 1242
1244 $vb->add (new DC::UI::FancyFrame 1243 $vb->add (new DC::UI::FancyFrame
1245 label => "Resistancies", 1244 label => "Resistancies",
1246 child => (my $tbl2 = new DC::UI::Table expand => 1), 1245 child => (my $tbl2 = new DC::UI::Table expand => 1, col_expand => [1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0]),
1247 ); 1246 );
1248 1247
1249 my $row = 0; 1248 my $row = 0;
1250 my $col = 0; 1249 my $col = 0;
1251 1250
1290 1289
1291 for (qw/slow holyw conf fire depl magic 1290 for (qw/slow holyw conf fire depl magic
1292 drain acid pois para deat phys 1291 drain acid pois para deat phys
1293 blind fear tund elec cold ghit/) 1292 blind fear tund elec cold ghit/)
1294 { 1293 {
1295 $tbl2->add_at ($col, $row, 1294 $tbl2->add_at ($col + 2, $row,
1296 $STATWIDS->{"res_$_"} = 1295 $STATWIDS->{"res_$_"} =
1297 new DC::UI::Label 1296 new DC::UI::Label
1298 font => $FONT_FIXED, 1297 font => $FONT_FIXED,
1299 template => "-100%", 1298 template => "-100%",
1300 align => +1, 1299 align => 1,
1301 valign => 0,
1302 can_events => 1, 1300 can_events => 1,
1303 can_hover => 1, 1301 can_hover => 1,
1304 tooltip => $resist_names{$_}->[1], 1302 tooltip => $resist_names{$_}->[1],
1305 ); 1303 );
1306 $tbl2->add_at ($col + 1, $row, new DC::UI::Image 1304 $tbl2->add_at ($col + 1, $row, new DC::UI::Image
1308 can_hover => 1, 1306 can_hover => 1,
1309 can_events => 1, 1307 can_events => 1,
1310 path => "ui/resist/resist_$_.png", 1308 path => "ui/resist/resist_$_.png",
1311 tooltip => $resist_names{$_}->[1], 1309 tooltip => $resist_names{$_}->[1],
1312 ); 1310 );
1313 $tbl2->add_at ($col + 2, $row, new DC::UI::Label 1311 $tbl2->add_at ($col + 0, $row, new DC::UI::Label
1314 text => $resist_names{$_}->[0], 1312 text => $resist_names{$_}->[0],
1315 font => $FONT_FIXED, 1313 font => $FONT_FIXED,
1314 align => 1,
1316 can_hover => 1, 1315 can_hover => 1,
1317 can_events => 1, 1316 can_events => 1,
1318 tooltip => $resist_names{$_}->[1], 1317 tooltip => $resist_names{$_}->[1],
1319 ); 1318 );
1320 1319
1321 $row++; 1320 $row++;
1322 if ($row % 6 == 0) { 1321 if ($row % 6 == 0) {
1323 $col += 3; 1322 $col += 4;
1324 $row = 0; 1323 $row = 0;
1325 } 1324 }
1326 } 1325 }
1327 1326
1328 #update_stats_window ({}); 1327 #update_stats_window ({});
1374 "The time this server has been running without being restarted.", 1373 "The time this server has been running without being restarted.",
1375 "Short information about this server provided by its admins.", 1374 "Short information about this server provided by its admins.",
1376 ); 1375 );
1377 my @col = qw(#Users Host Uptime Version Description); 1376 my @col = qw(#Users Host Uptime Version Description);
1378 $table->add_at ($_, 0, new DC::UI::Label 1377 $table->add_at ($_, 0, new DC::UI::Label
1379 can_hover => 1, can_events => 1, 1378 can_hover => 1, can_events => 1, fg => [1, 1, 0],
1380 align => 0, fg => [1, 1, 0],
1381 text => $col[$_], tooltip => $tip[$_]) 1379 text => $col[$_], tooltip => $tip[$_])
1382 for 0 .. $#col; 1380 for 0 .. $#col;
1383 1381
1384 my @align = qw(1 0 1 1 -1); 1382 my @align = qw(1 0.5 1 1 0);
1385 1383
1386 my $y = 0; 1384 my $y = 0;
1387 for my $m (@{ $msg->{servers} }) { 1385 for my $m (@{ $msg->{servers} }) {
1388 my ($ip, $last, $host, $users, $version, $desc, $ibytes, $obytes, $uptime, $highlight) = 1386 my ($ip, $last, $host, $users, $version, $desc, $ibytes, $obytes, $uptime, $highlight) =
1389 @$m{qw(ip age hostname users version description ibytes obytes uptime highlight)}; 1387 @$m{qw(ip age hostname users version description ibytes obytes uptime highlight)};
1470 $vbox->add (new DC::UI::FancyFrame 1468 $vbox->add (new DC::UI::FancyFrame
1471 label => "Login Settings", 1469 label => "Login Settings",
1472 child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]), 1470 child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]),
1473 ); 1471 );
1474 1472
1475 $table->add_at (0, 4, new DC::UI::Label valign => 0, align => 1, text => "Username"); 1473 $table->add_at (0, 4, new DC::UI::Label align => 1, text => "Username");
1476 $table->add_at (1, 4, new DC::UI::Entry 1474 $table->add_at (1, 4, new DC::UI::Entry
1477 text => $CFG->{profile}{default}{user}, 1475 text => $CFG->{profile}{default}{user},
1478 tooltip => "The name of your character on the server.", 1476 tooltip => "The name of your character on the server.",
1479 on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{user} = $value; 1 } 1477 on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{user} = $value; 1 }
1480 ); 1478 );
1481 1479
1482 $table->add_at (0, 5, new DC::UI::Label valign => 0, align => 1, text => "Password"); 1480 $table->add_at (0, 5, new DC::UI::Label align => 1, text => "Password");
1483 $table->add_at (1, 5, new DC::UI::Entry 1481 $table->add_at (1, 5, new DC::UI::Entry
1484 text => $CFG->{profile}{default}{password}, 1482 text => $CFG->{profile}{default}{password},
1485 hidden => 1, 1483 hidden => 1,
1486 tooltip => "The password for your character.", 1484 tooltip => "The password for your character.",
1487 on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{password} = $value; 1 } 1485 on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{password} = $value; 1 }
1488 ); 1486 );
1489 1487
1490 $table->add_at (1, 11, $LOGIN_BUTTON = new DC::UI::Button 1488 $table->add_at (1, 11, $LOGIN_BUTTON = new DC::UI::Button
1491 expand => 1, 1489 expand => 1,
1492 align => 0,
1493 text => "Login / Register", 1490 text => "Login / Register",
1494 tooltip => "This button will either login to the account configured above or register a new account.", 1491 tooltip => "This button will either login to the account configured above or register a new account.",
1495 on_activate => sub { 1492 on_activate => sub {
1496 $CONN ? stop_game 1493 $CONN ? stop_game
1497 : start_game; 1494 : start_game;
1500 ); 1497 );
1501 1498
1502 $vbox->add (new DC::UI::FancyFrame 1499 $vbox->add (new DC::UI::FancyFrame
1503 label => "Registering", 1500 label => "Registering",
1504 min_h => 200, 1501 min_h => 200,
1505 child => (new DC::UI::Label valign => -1, ellipsise => 0, 1502 child => (new DC::UI::Label valign => 0, ellipsise => 0,
1506 markup => 1503 markup =>
1507 "To register a new account, choose a username that hasn't been taken yet and " 1504 "To register a new account, choose a username that hasn't been taken yet and "
1508 . "try to log-in. Follow the instructions in the Log tab in the message window.", 1505 . "try to log-in. Follow the instructions in the Log tab in the message window.",
1509 ), 1506 ),
1510 ); 1507 );
1520 child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]), 1517 child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]),
1521 ); 1518 );
1522 1519
1523 my $row = 0; 1520 my $row = 0;
1524 1521
1525 $table->add_at (0, ++$row, new DC::UI::Label valign => 0, align => 1, text => "Host:Port"); 1522 $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Host:Port");
1526 { 1523 {
1527 $table->add_at (1, $row, my $vbox = new DC::UI::VBox); 1524 $table->add_at (1, $row, my $vbox = new DC::UI::VBox);
1528 1525
1529 $vbox->add ( 1526 $vbox->add (
1530 $HOST_ENTRY = new DC::UI::Entry 1527 $HOST_ENTRY = new DC::UI::Entry
1548 on_visibility_change => sub { $METASERVER->hide unless $_[1]; 1 }, 1545 on_visibility_change => sub { $METASERVER->hide unless $_[1]; 1 },
1549 ); 1546 );
1550 }#d# 1547 }#d#
1551 } 1548 }
1552 1549
1553 $table->add_at (0, ++$row, new DC::UI::Label valign => 0, align => 1, text => "Map Size"); 1550 $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Map Size");
1554 $table->add_at (1, $row, new DC::UI::Slider 1551 $table->add_at (1, $row, new DC::UI::Slider
1555 force_w => 100, 1552 force_w => 100,
1556 range => [$CFG->{mapsize}, 10, 100, 0, 1], 1553 range => [$CFG->{mapsize}, 10, 100, 0, 1],
1557 tooltip => "This is the size of the portion of the map update the server sends you. " 1554 tooltip => "This is the size of the portion of the map update the server sends you. "
1558 . "If you set this to a high value you will be able to see further, " 1555 . "If you set this to a high value you will be able to see further, "
1559 . "but you also increase bandwidth requirements and latency. " 1556 . "but you also increase bandwidth requirements and latency. "
1560 . "This option is only used once at log-in.", 1557 . "This option is only used once at log-in.",
1561 on_changed => sub { my ($self, $value) = @_; $CFG->{mapsize} = $self->{range}[0] = $value = int $value; 1 }, 1558 on_changed => sub { my ($self, $value) = @_; $CFG->{mapsize} = $self->{range}[0] = $value = int $value; 1 },
1562 ); 1559 );
1563 1560
1564 $table->add_at (0, ++$row, new DC::UI::Label valign => 0, align => 1, text => "Output-Rate"); 1561 $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Output-Rate");
1565 $table->add_at (1, $row, new DC::UI::Entry 1562 $table->add_at (1, $row, new DC::UI::Entry
1566 text => $CFG->{output_rate}, 1563 text => $CFG->{output_rate},
1567 tooltip => "The maximum bandwidth in bytes per second that the server should not exceed " 1564 tooltip => "The maximum bandwidth in bytes per second that the server should not exceed "
1568 . "when sending data. When 0 or unset, the server " 1565 . "when sending data. When 0 or unset, the server "
1569 . "default will be used, which is usually around 100kb/s. Most servers will " 1566 . "default will be used, which is usually around 100kb/s. Most servers will "
1582sub client_setup { 1579sub client_setup {
1583 my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]; 1580 my $table = new DC::UI::Table expand => 1, col_expand => [0, 1];
1584 1581
1585 my $row = 0; 1582 my $row = 0;
1586 1583
1587 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Tip of the day"); 1584 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Tip of the day");
1588 $table->add_at (1, $row++, new DC::UI::CheckBox 1585 $table->add_at (1, $row++, new DC::UI::CheckBox
1589 state => $CFG->{show_tips}, 1586 state => $CFG->{show_tips},
1590 tooltip => "Show the <b>Tip of the day</b> window at startup?", 1587 tooltip => "Show the <b>Tip of the day</b> window at startup?",
1591 on_changed => sub { 1588 on_changed => sub {
1592 my ($self, $value) = @_; 1589 my ($self, $value) = @_;
1593 $CFG->{show_tips} = $value; 1590 $CFG->{show_tips} = $value;
1594 0 1591 0
1595 } 1592 }
1596 ); 1593 );
1597 1594
1598 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Messages Window Size"); 1595 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Messages Window Size");
1599 $table->add_at (1, $row++, my $saycmd = new DC::UI::Entry 1596 $table->add_at (1, $row++, my $saycmd = new DC::UI::Entry
1600 text => $CFG->{logview_max_par}, 1597 text => $CFG->{logview_max_par},
1601 tooltip => "This is maximum number of messages remembered in the <b>Messages</b> window. If the server " 1598 tooltip => "This is maximum number of messages remembered in the <b>Messages</b> window. If the server "
1602 . "sends more messages than this number, older messages get removed to save memory and " 1599 . "sends more messages than this number, older messages get removed to save memory and "
1603 . "computing time. A value of <b>0</b> disables this feature, but that is not recommended.", 1600 . "computing time. A value of <b>0</b> disables this feature, but that is not recommended.",
1737 1734
1738sub inventory_widget { 1735sub inventory_widget {
1739 my $hb = new DC::UI::HBox homogeneous => 1; 1736 my $hb = new DC::UI::HBox homogeneous => 1;
1740 1737
1741 $hb->add (my $vb1 = new DC::UI::VBox); 1738 $hb->add (my $vb1 = new DC::UI::VBox);
1742 $vb1->add (new DC::UI::Label align => 0, text => "Player"); 1739 $vb1->add (new DC::UI::Label text => "Player");
1743 1740
1744 $vb1->add (my $hb1 = new DC::UI::HBox); 1741 $vb1->add (my $hb1 = new DC::UI::HBox);
1745 1742
1746 use sort 'stable'; 1743 use sort 'stable';
1747 1744
1757 $INV->set_sort_order ($SORT_ORDER{$_[1]}); 1754 $INV->set_sort_order ($SORT_ORDER{$_[1]});
1758 }, 1755 },
1759 ); 1756 );
1760 $hb1->add (new DC::UI::Label text => "Weight: ", align => 1, expand => 1); 1757 $hb1->add (new DC::UI::Label text => "Weight: ", align => 1, expand => 1);
1761 #TODO# update to weigh/maxweight 1758 #TODO# update to weigh/maxweight
1762 $hb1->add ($STATWIDS->{i_weight} = new DC::UI::Label align => -1); 1759 $hb1->add ($STATWIDS->{i_weight} = new DC::UI::Label align => 0);
1763 1760
1764 $vb1->add (my $sw1 = new DC::UI::ScrolledWindow expand => 1, scroll_y => 1); 1761 $vb1->add (my $sw1 = new DC::UI::ScrolledWindow expand => 1, scroll_y => 1);
1765 $sw1->add ($INV = new DC::UI::Inventory); 1762 $sw1->add ($INV = new DC::UI::Inventory);
1766 $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}}); 1763 $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}});
1767 1764

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines