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.20 by root, Fri Dec 28 11:44:02 2007 UTC vs.
Revision 1.23 by elmex, Sun Jan 6 16:28:50 2008 UTC

108use DC::UI; 108use DC::UI;
109use DC::UI::Canvas; 109use DC::UI::Canvas;
110use DC::UI::Inventory; 110use DC::UI::Inventory;
111use DC::UI::SpellList; 111use DC::UI::SpellList;
112use DC::UI::Dockable; 112use DC::UI::Dockable;
113use DC::UI::Dockbar;
113use DC::UI::MessageWindow; 114use DC::UI::MessageWindow;
114use DC::UI::ChatView; 115use DC::UI::ChatView;
116use DC::MessageDistributor;
115use DC::Pod; 117use DC::Pod;
116use DC::MapWidget; 118use DC::MapWidget;
117use DC::Macro; 119use DC::Macro;
118 120
119$SIG{QUIT} = sub { Carp::cluck "QUIT" }; 121$SIG{QUIT} = sub { Carp::cluck "QUIT" };
178our $SPELL_PAGE; 180our $SPELL_PAGE;
179our $SPELL_LIST; 181our $SPELL_LIST;
180 182
181our $HELP_WINDOW; 183our $HELP_WINDOW;
182our $MESSAGE_WINDOW; 184our $MESSAGE_WINDOW;
185our $MESSAGE_DIST;
183our $FLOORBOX; 186our $FLOORBOX;
184our $GAUGES; 187our $GAUGES;
185our $STATWIDS; 188our $STATWIDS;
186 189
187our $SDL_ACTIVE; 190our $SDL_ACTIVE;
204sub debug { 207sub debug {
205 $DEBUG_STATUS->set_text ($_[0]); 208 $DEBUG_STATUS->set_text ($_[0]);
206} 209}
207 210
208sub message { 211sub message {
209 $MESSAGE_WINDOW->message (@_); 212 $MESSAGE_DIST->message (@_);
210} 213}
211 214
212############################################################################# 215#############################################################################
213#TODO: maybe move into own audio module... 216#TODO: maybe move into own audio module...
214 217
653 [Cha => CS_STAT_CHA], 656 [Cha => CS_STAT_CHA],
654 ) { 657 ) {
655 my ($name, $id) = @$_; 658 my ($name, $id) = @$_;
656 $hbox->add (new DC::UI::Label 659 $hbox->add (new DC::UI::Label
657 markup => "$conn->{stat}{$id} <span foreground='yellow'>$name</span>", 660 markup => "$conn->{stat}{$id} <span foreground='yellow'>$name</span>",
658 align => 0,
659 expand => 1, 661 expand => 1,
660 can_events => 1, 662 can_events => 1,
661 can_hover => 1, 663 can_hover => 1,
662 tooltip => "#stat_$name", 664 tooltip => "#stat_$name",
663 ); 665 );
769 771
770 $vbox->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]); 772 $vbox->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]);
771 773
772 my $row = 0; 774 my $row = 0;
773 775
774 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "OpenGL Info"); 776 $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, 777 $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, 778 can_events => 1,
777 tooltip => "<tt><span size='8192'>" . (DC::OpenGL::gl_extensions) . "</span></tt>"); 779 tooltip => "<tt><span size='8192'>" . (DC::OpenGL::gl_extensions) . "</span></tt>");
778 780
779 my $vidmode_tooltip = 781 my $vidmode_tooltip =
780 "<b>Video Mode.</b> The video mode to use for fullscreen (and the window size for windowed operation). " 782 "<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>."; 783 . "The format is <i>width</i> x <i>height</i> \@ <i>depth-per-channel</i> + <i>alpha-channel</i>.";
782 784
783 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Video Mode"); 785 $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); 786 $table->add_at (1, $row++, my $hbox = new DC::UI::HBox);
785 787
786 $hbox->add (my $mode_slider = new DC::UI::Slider 788 $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], 789 force_w => $WIDTH * 0.1, expand => 1, range => [$CFG->{sdl_mode}, 0, $#SDL_MODES, 0, 1],
788 tooltip => $vidmode_tooltip); 790 tooltip => $vidmode_tooltip);
789 $hbox->add (my $mode_label = new DC::UI::Label 791 $hbox->add (my $mode_label = new DC::UI::Label
790 align => 0, valign => 0, height => 0.8, template => "9999x9999@9+9", 792 height => 0.8, template => "9999x9999@9+9",
791 can_events => 1, tooltip => $vidmode_tooltip); 793 can_events => 1, tooltip => $vidmode_tooltip);
792 794
793 $mode_slider->connect (changed => sub { 795 $mode_slider->connect (changed => sub {
794 my ($self, $value) = @_; 796 my ($self, $value) = @_;
795 797
796 $CFG->{sdl_mode} = $self->{range}[0] = $value = int $value; 798 $CFG->{sdl_mode} = $self->{range}[0] = $value = int $value;
797 $mode_label->set_text (sprintf '%dx%d@%d+%d', @{$SDL_MODES[$value]}); 799 $mode_label->set_text (sprintf '%dx%d@%d+%d', @{$SDL_MODES[$value]});
798 }); 800 });
799 $mode_slider->emit (changed => $mode_slider->{range}[0]); 801 $mode_slider->emit (changed => $mode_slider->{range}[0]);
800 802
801 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Fullscreen"); 803 $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 804 $table->add_at (1, $row++, $FULLSCREEN_ENABLE = new DC::UI::CheckBox
803 state => $CFG->{fullscreen}, 805 state => $CFG->{fullscreen},
804 tooltip => "Bring the client into fullscreen mode.", 806 tooltip => "Bring the client into fullscreen mode.",
805 on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 } 807 on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 }
806 ); 808 );
807 809
808 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Force OpenGL 1.1"); 810 $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 811 $table->add_at (1, $row++, new DC::UI::CheckBox
810 state => $CFG->{force_opengl11}, 812 state => $CFG->{force_opengl11},
811 tooltip => "Limit CFPlus to use OpenGL 1.1 features only. This will normally result in " 813 tooltip => "Limit Deliantra 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 " 814 . "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. " 815 . "cards that claim to support a feature but fall back to software rendering. "
814 . "Nvidia Geforce FX cards are known to claim features the hardware doesn't support, " 816 . "Nvidia Geforce FX cards are known to claim features the hardware doesn't support, "
815 . "but cards and drivers from other vendors (ATI) are often just as bad. <b>If you " 817 . "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>", 818 . "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 } 819 on_changed => sub { my ($self, $value) = @_; $CFG->{force_opengl11} = $value; 0 }
818 ); 820 );
819 821
820 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Compress Textures"); 822 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Compress Textures");
821 $table->add_at (1, $row++, new DC::UI::CheckBox 823 $table->add_at (1, $row++, new DC::UI::CheckBox
822 state => $CFG->{texture_compression}, 824 state => $CFG->{texture_compression},
823 tooltip => "Use texture compression. Normally this will not reduce visual quality noticable but " 825 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 " 826 . "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 " 827 . "can differ form card to card, so your mileage may vary. This setting is ignored in "
826 . "forced OpenGL 1.1 mode.", 828 . "forced OpenGL 1.1 mode.",
827 on_changed => sub { my ($self, $value) = @_; $CFG->{texture_compression} = $value; 0 } 829 on_changed => sub { my ($self, $value) = @_; $CFG->{texture_compression} = $value; 0 }
828 ); 830 );
829 831
830 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); 832 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Fast & Ugly");
831 $table->add_at (1, $row++, new DC::UI::CheckBox 833 $table->add_at (1, $row++, new DC::UI::CheckBox
832 state => $CFG->{fast}, 834 state => $CFG->{fast},
833 tooltip => "Lower the visual quality considerably to speed up rendering.", 835 tooltip => "Lower the visual quality considerably to speed up rendering.",
834 on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 } 836 on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 }
835 ); 837 );
836 838
837 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); 839 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "GUI Fontsize");
838 $table->add_at (1, $row++, new DC::UI::Slider 840 $table->add_at (1, $row++, new DC::UI::Slider
839 range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1], 841 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.", 842 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 }, 843 on_changed => sub { $CFG->{gui_fontsize} = $_[1]; 0 },
842 ); 844 );
843 845
844 $table->add_at (1, $row++, new DC::UI::Button 846 $table->add_at (1, $row++, new DC::UI::Button
845 expand => 1, align => 0, text => "Apply", 847 expand => 1, text => "Apply",
846 tooltip => "Apply the video settings above.", 848 tooltip => "Apply the video settings above.",
847 on_activate => sub { 849 on_activate => sub {
848 video_shutdown (); 850 video_shutdown ();
849 video_init (); 851 video_init ();
850 0 852 0
851 } 853 }
852 ); 854 );
853 855
854 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Map Scale"); 856 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Map Scale");
855 $table->add_at (1, $row++, new DC::UI::Slider 857 $table->add_at (1, $row++, new DC::UI::Slider
856 range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1], 858 range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1],
857 tooltip => "Enlarge or shrink the displayed map. Changes are instant.", 859 tooltip => "Enlarge or shrink the displayed map. Changes are instant.",
858 on_changed => sub { my ($self, $value) = @_; $CFG->{map_scale} = 2 ** $value; 0 } 860 on_changed => sub { my ($self, $value) = @_; $CFG->{map_scale} = 2 ** $value; 0 }
859 ); 861 );
860 862
861 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Map Smoothing"); 863 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Map Smoothing");
862 $table->add_at (1, $row++, new DC::UI::CheckBox 864 $table->add_at (1, $row++, new DC::UI::CheckBox
863 state => $CFG->{map_smoothing}, 865 state => $CFG->{map_smoothing},
864 tooltip => "<b>Map Smoothing</b> tries to make tile borders less square. " 866 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. " 867 . "This increases load on the graphics subsystem and works only with TRT servers. "
866 . "Changes take effect at next login only.", 868 . "Changes take effect at next login only.",
867 on_changed => sub { my ($self, $value) = @_; $CFG->{map_smoothing} = $value; 0 } 869 on_changed => sub { my ($self, $value) = @_; $CFG->{map_smoothing} = $value; 0 }
868 ); 870 );
869 871
870 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Fog of War"); 872 $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 873 $table->add_at (1, $row++, new DC::UI::CheckBox
872 state => $CFG->{fow_enable}, 874 state => $CFG->{fow_enable},
873 tooltip => "<b>Fog-of-War</b> marks areas that cannot be seen by the player. Changes are instant.", 875 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 } 876 on_changed => sub { my ($self, $value) = @_; $CFG->{fow_enable} = $value; 0 }
875 ); 877 );
876 878
877 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "FoW Intensity"); 879 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "FoW Intensity");
878 $table->add_at (1, $row++, new DC::UI::Slider 880 $table->add_at (1, $row++, new DC::UI::Slider
879 range => [$CFG->{fow_intensity}, 0, 1, 0, 1 / 256], 881 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.", 882 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 } 883 on_changed => sub { my ($self, $value) = @_; $CFG->{fow_intensity} = $value; 0 }
882 ); 884 );
883 885
884 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Message Fontsize"); 886 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Message Fontsize");
885 $table->add_at (1, $row++, new DC::UI::Slider 887 $table->add_at (1, $row++, new DC::UI::Slider
886 range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], 888 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, " 889 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.", 890 . "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 }, 891 on_changed => sub { $MESSAGE_DIST->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 },
890 ); 892 );
891 893
892 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); 894 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Gauge fontsize");
893 $table->add_at (1, $row++, new DC::UI::Slider 895 $table->add_at (1, $row++, new DC::UI::Slider
894 range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], 896 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.", 897 tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.",
896 on_changed => sub { 898 on_changed => sub {
897 $CFG->{gauge_fontsize} = $_[1]; 899 $CFG->{gauge_fontsize} = $_[1];
898 &set_gauge_window_fontsize; 900 &set_gauge_window_fontsize;
899 0 901 0
900 } 902 }
901 ); 903 );
902 904
903 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Gauge size"); 905 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Gauge size");
904 $table->add_at (1, $row++, new DC::UI::Slider 906 $table->add_at (1, $row++, new DC::UI::Slider
905 range => [$CFG->{gauge_size}, 0.2, 0.8], 907 range => [$CFG->{gauge_size}, 0.2, 0.8],
906 tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.", 908 tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.",
907 on_changed => sub { 909 on_changed => sub {
908 $CFG->{gauge_size} = $_[1]; 910 $CFG->{gauge_size} = $_[1];
942 944
943 $vbox->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 0, 1]); 945 $vbox->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 0, 1]);
944 946
945 my $row = 0; 947 my $row = 0;
946 948
947 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Audio Enable"); 949 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Audio Enable");
948 $table->add_at (1, $row++, new DC::UI::CheckBox 950 $table->add_at (1, $row++, new DC::UI::CheckBox
949 state => $CFG->{audio_enable}, 951 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.", 952 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 } 953 on_changed => sub { $CFG->{audio_enable} = $_[1]; 1 }
952 ); 954 );
953 955
954 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Sound Effects"); 956 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Sound Effects");
955 $table->add_at (1, $row, new DC::UI::CheckBox 957 $table->add_at (1, $row, new DC::UI::CheckBox
956 expand => 1, state => $CFG->{effects_enable}, 958 expand => 1, state => $CFG->{effects_enable},
957 tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.", 959 tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.",
958 on_changed => sub { 960 on_changed => sub {
959 $CFG->{effects_enable} = $_[1]; 961 $CFG->{effects_enable} = $_[1];
966 tooltip => "The relative volume of sound effects. Best audio quality is achieved if this " 968 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.", 969 . "is set highest (rightmost) and you use your operating system volume setting. Changes are instant.",
968 on_changed => sub { $CFG->{effects_volume} = $_[1]; 1 } 970 on_changed => sub { $CFG->{effects_volume} = $_[1]; 1 }
969 ); 971 );
970 972
971 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Background Music"); 973 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Background Music");
972 $table->add_at (1, $row, new DC::UI::CheckBox 974 $table->add_at (1, $row, new DC::UI::CheckBox
973 expand => 1, state => $CFG->{bgm_enable}, 975 expand => 1, state => $CFG->{bgm_enable},
974 tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.", 976 tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.",
975 on_changed => sub { 977 on_changed => sub {
976 $CFG->{bgm_enable} = $_[1]; 978 $CFG->{bgm_enable} = $_[1];
983 expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128], 985 expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0, 1/128],
984 tooltip => "The volume of the background music. Changes are instant.", 986 tooltip => "The volume of the background music. Changes are instant.",
985 on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 } 987 on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 }
986 ); 988 );
987 989
988 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Frequency"); 990 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Frequency");
989 $table->add_at (1, $row++, new DC::UI::Selector 991 $table->add_at (1, $row++, new DC::UI::Selector
990 c_colspan => 2, expand => 1, 992 c_colspan => 2, expand => 1,
991 value => $CFG->{audio_hw_frequency}, 993 value => $CFG->{audio_hw_frequency},
992 options => [ 994 options => [
993 [ 0, "default" , "Use System Default"], 995 [ 0, "default" , "Use System Default"],
1002 audio_tab_update; 1004 audio_tab_update;
1003 1 1005 1
1004 } 1006 }
1005 ); 1007 );
1006 1008
1007 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Channels"); 1009 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Channels");
1008 $table->add_at (1, $row++, new DC::UI::Selector 1010 $table->add_at (1, $row++, new DC::UI::Selector
1009 c_colspan => 2, expand => 1, 1011 c_colspan => 2, expand => 1,
1010 value => $CFG->{audio_hw_channels}, 1012 value => $CFG->{audio_hw_channels},
1011 options => [ 1013 options => [
1012 [0, "default" , "Use System Default"], 1014 [0, "default" , "Use System Default"],
1021 audio_tab_update; 1023 audio_tab_update;
1022 1 1024 1
1023 } 1025 }
1024 ); 1026 );
1025 1027
1026 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Latency"); 1028 $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 1029 $table->add_at (1, $row++, $AUDIO_HW_CHUNKSIZE = new DC::UI::Selector
1028 c_colspan => 2, expand => 1, 1030 c_colspan => 2, expand => 1,
1029 value => $CFG->{audio_hw_chunksize}, 1031 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 " 1032 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.", 1033 . "is stuttering, increase this value. Values of 50-100ms are optimal.",
1035 1 1037 1
1036 } 1038 }
1037 ); 1039 );
1038 1040
1039 # should really be a slider 1041 # should really be a slider
1040 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Mixer Voices"); 1042 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Mixer Voices");
1041 $table->add_at (1, $row++, new DC::UI::ValSlider 1043 $table->add_at (1, $row++, new DC::UI::ValSlider
1042 c_colspan => 2, expand => 1, 1044 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.", 1045 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], 1046 range => [$::CFG->{audio_mix_channels}, 4, 32, 0, 1],
1045 template => ">= 99", 1047 template => ">= 99",
1051 1; 1053 1;
1052 } 1054 }
1053 ); 1055 );
1054 1056
1055 $table->add_at (1, $row++, new DC::UI::Button 1057 $table->add_at (1, $row++, new DC::UI::Button
1056 c_colspan => 2, expand => 1, align => 0, text => "Apply", 1058 c_colspan => 2, expand => 1, text => "Apply",
1057 tooltip => "Apply the audio settings", 1059 tooltip => "Apply the audio settings",
1058 on_activate => sub { 1060 on_activate => sub {
1059 audio_shutdown (); 1061 audio_shutdown ();
1060 audio_init (); 1062 audio_init ();
1061 0 1063 0
1111 $hb->add (my $hg = new DC::UI::Gauge type => 'hp', tooltip => "#stat_health"); 1113 $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"); 1114 $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"); 1115 $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"); 1116 $hb->add (my $fg = new DC::UI::Gauge type => 'food', tooltip => "#stat_food");
1115 1117
1116 $vbox->add (my $exp = new DC::UI::Label valign => 0, align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_exp"); 1118 $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); 1119 $vbox->add (my $prg = new DC::UI::ExperienceProgress);
1118 $vbox->add (my $sklprg = new DC::UI::ExperienceProgress); 1120 $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"); 1121 $vbox->add (my $rng = new DC::UI::Label align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_ranged");
1120 1122
1121 $GAUGES = { 1123 $GAUGES = {
1122 exp => $exp, prg => $prg, sklprg => $sklprg, 1124 exp => $exp, prg => $prg, sklprg => $sklprg,
1123 win => $win, range => $rng, 1125 win => $win, range => $rng,
1124 hp => $hg, mana => $mg, grace => $gg, food => $fg, 1126 hp => $hg, mana => $mg, grace => $gg, food => $fg,
1140 $table->add_at (1, 2, new DC::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4; 0 }); 1142 $table->add_at (1, 2, new DC::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4; 0 });
1141 $table->add_at (0, 3, new DC::UI::Label text => "Suppress Tooltips"); 1143 $table->add_at (0, 3, new DC::UI::Label text => "Suppress Tooltips");
1142 $table->add_at (1, 3, new DC::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 }); 1144 $table->add_at (1, 3, new DC::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 });
1143 $table->add_at (0, 4, new DC::UI::Button text => "die on click(tm)", on_activate => sub { &DC::debug() } ); 1145 $table->add_at (0, 4, new DC::UI::Button text => "die on click(tm)", on_activate => sub { &DC::debug() } );
1144 1146
1145 $table->add_at (0, 5, new DC::UI::TextEdit text => "line1\0152\0153");#d# 1147 $table->add_at (0, 5, new DC::UI::TextEdit text => "line1\0152\0153\nµikachu\nづx゙つ゛");#d#
1146 1148
1147 $table->add_at (7,7, my $t = new DC::UI::Table expand => 0); 1149 $table->add_at (7,7, my $t = new DC::UI::Table expand => 0);
1148 $t->add_at (0,0, new DC::UI::Label text => "a a", c_rowspan => 1, c_colspan => 2); 1150 $t->add_at (0,0, new DC::UI::Label text => "a a", c_rowspan => 1, c_colspan => 2);
1149 $t->add_at (2,0, new DC::UI::Label text => "b\nb", c_rowspan => 2, c_colspan => 1, ellipsise => 0 ); 1151 $t->add_at (2,0, new DC::UI::Label text => "b\nb", c_rowspan => 2, c_colspan => 1, ellipsise => 0 );
1150 $t->add_at (1,2, new DC::UI::Label text => "c c", c_rowspan => 1, c_colspan => 2); 1152 $t->add_at (1,2, new DC::UI::Label text => "c c", c_rowspan => 1, c_colspan => 2);
1190 $vb->add (new DC::UI::FancyFrame 1192 $vb->add (new DC::UI::FancyFrame
1191 label => "Player", 1193 label => "Player",
1192 child => (my $pi = new DC::UI::VBox), 1194 child => (my $pi = new DC::UI::VBox),
1193 ); 1195 );
1194 1196
1195 $pi->add ($STATWIDS->{title} = new DC::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, 1197 $pi->add ($STATWIDS->{title} = new DC::UI::Label text => "Title:", expand => 1, align => 0,
1196 can_hover => 1, can_events => 1, 1198 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."); 1199 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, 1200 $pi->add ($STATWIDS->{map} = new DC::UI::Label align => 0, text => "Map:", expand => 1,
1199 can_hover => 1, can_events => 1, 1201 can_hover => 1, can_events => 1,
1200 tooltip => "The map you are currently on (if supported by the server)."); 1202 tooltip => "The map you are currently on (if supported by the server).");
1201 1203
1202 $pi->add (my $hb0 = new DC::UI::HBox); 1204 $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, 1205 $hb0->add ($STATWIDS->{weight} = new DC::UI::Label text => "Weight:", expand => 1, align => 0,
1204 can_hover => 1, can_events => 1, 1206 can_hover => 1, can_events => 1,
1205 tooltip => "The weight of the player including all inventory items."); 1207 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, 1208 $hb0->add ($STATWIDS->{m_weight} = new DC::UI::Label align => 0, text => "Max weight:", expand => 1,
1207 can_hover => 1, can_events => 1, 1209 can_hover => 1, can_events => 1,
1208 tooltip => "The weight limit: you cannot carry more than this."); 1210 tooltip => "The weight limit: you cannot carry more than this.");
1209 1211
1210 $vb->add (new DC::UI::FancyFrame 1212 $vb->add (new DC::UI::FancyFrame
1211 label => "Primary/Secondary Statistics", 1213 label => "Primary/Secondary Statistics",
1232 [2, 5, st_wspd => "WSp", 10.54], 1234 [2, 5, st_wspd => "WSp", 10.54],
1233 ) { 1235 ) {
1234 my ($col, $row, $id, $label, $template) = @$_; 1236 my ($col, $row, $id, $label, $template) = @$_;
1235 1237
1236 $tbl->add_at ($col , $row, $STATWIDS->{$id} = new DC::UI::Label 1238 $tbl->add_at ($col , $row, $STATWIDS->{$id} = new DC::UI::Label
1237 font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0, 1239 font => $FONT_FIXED, can_hover => 1, can_events => 1,
1238 align => +1, template => $template, tooltip => "#stat_$label"); 1240 align => 1, template => $template, tooltip => "#stat_$label");
1239 $tbl->add_at ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new DC::UI::Label 1241 $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, 1242 font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2,
1241 align => -1, text => $label, tooltip => "#stat_$label"); 1243 align => 0, text => $label, tooltip => "#stat_$label");
1242 } 1244 }
1243 1245
1244 $vb->add (new DC::UI::FancyFrame 1246 $vb->add (new DC::UI::FancyFrame
1245 label => "Resistancies", 1247 label => "Resistancies",
1246 child => (my $tbl2 = new DC::UI::Table expand => 1), 1248 child => (my $tbl2 = new DC::UI::Table expand => 1, col_expand => [1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0]),
1247 ); 1249 );
1248 1250
1249 my $row = 0; 1251 my $row = 0;
1250 my $col = 0; 1252 my $col = 0;
1251 1253
1290 1292
1291 for (qw/slow holyw conf fire depl magic 1293 for (qw/slow holyw conf fire depl magic
1292 drain acid pois para deat phys 1294 drain acid pois para deat phys
1293 blind fear tund elec cold ghit/) 1295 blind fear tund elec cold ghit/)
1294 { 1296 {
1295 $tbl2->add_at ($col, $row, 1297 $tbl2->add_at ($col + 2, $row,
1296 $STATWIDS->{"res_$_"} = 1298 $STATWIDS->{"res_$_"} =
1297 new DC::UI::Label 1299 new DC::UI::Label
1298 font => $FONT_FIXED, 1300 font => $FONT_FIXED,
1299 template => "-100%", 1301 template => "-100%",
1300 align => +1, 1302 align => 1,
1301 valign => 0,
1302 can_events => 1, 1303 can_events => 1,
1303 can_hover => 1, 1304 can_hover => 1,
1304 tooltip => $resist_names{$_}->[1], 1305 tooltip => $resist_names{$_}->[1],
1305 ); 1306 );
1306 $tbl2->add_at ($col + 1, $row, new DC::UI::Image 1307 $tbl2->add_at ($col + 1, $row, new DC::UI::Image
1308 can_hover => 1, 1309 can_hover => 1,
1309 can_events => 1, 1310 can_events => 1,
1310 path => "ui/resist/resist_$_.png", 1311 path => "ui/resist/resist_$_.png",
1311 tooltip => $resist_names{$_}->[1], 1312 tooltip => $resist_names{$_}->[1],
1312 ); 1313 );
1313 $tbl2->add_at ($col + 2, $row, new DC::UI::Label 1314 $tbl2->add_at ($col + 0, $row, new DC::UI::Label
1314 text => $resist_names{$_}->[0], 1315 text => $resist_names{$_}->[0],
1315 font => $FONT_FIXED, 1316 font => $FONT_FIXED,
1317 align => 1,
1316 can_hover => 1, 1318 can_hover => 1,
1317 can_events => 1, 1319 can_events => 1,
1318 tooltip => $resist_names{$_}->[1], 1320 tooltip => $resist_names{$_}->[1],
1319 ); 1321 );
1320 1322
1321 $row++; 1323 $row++;
1322 if ($row % 6 == 0) { 1324 if ($row % 6 == 0) {
1323 $col += 3; 1325 $col += 4;
1324 $row = 0; 1326 $row = 0;
1325 } 1327 }
1326 } 1328 }
1327 1329
1328 #update_stats_window ({}); 1330 #update_stats_window ({});
1374 "The time this server has been running without being restarted.", 1376 "The time this server has been running without being restarted.",
1375 "Short information about this server provided by its admins.", 1377 "Short information about this server provided by its admins.",
1376 ); 1378 );
1377 my @col = qw(#Users Host Uptime Version Description); 1379 my @col = qw(#Users Host Uptime Version Description);
1378 $table->add_at ($_, 0, new DC::UI::Label 1380 $table->add_at ($_, 0, new DC::UI::Label
1379 can_hover => 1, can_events => 1, 1381 can_hover => 1, can_events => 1, fg => [1, 1, 0],
1380 align => 0, fg => [1, 1, 0],
1381 text => $col[$_], tooltip => $tip[$_]) 1382 text => $col[$_], tooltip => $tip[$_])
1382 for 0 .. $#col; 1383 for 0 .. $#col;
1383 1384
1384 my @align = qw(1 0 1 1 -1); 1385 my @align = qw(1 0.5 1 1 0);
1385 1386
1386 my $y = 0; 1387 my $y = 0;
1387 for my $m (@{ $msg->{servers} }) { 1388 for my $m (@{ $msg->{servers} }) {
1388 my ($ip, $last, $host, $users, $version, $desc, $ibytes, $obytes, $uptime, $highlight) = 1389 my ($ip, $last, $host, $users, $version, $desc, $ibytes, $obytes, $uptime, $highlight) =
1389 @$m{qw(ip age hostname users version description ibytes obytes uptime highlight)}; 1390 @$m{qw(ip age hostname users version description ibytes obytes uptime highlight)};
1470 $vbox->add (new DC::UI::FancyFrame 1471 $vbox->add (new DC::UI::FancyFrame
1471 label => "Login Settings", 1472 label => "Login Settings",
1472 child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]), 1473 child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]),
1473 ); 1474 );
1474 1475
1475 $table->add_at (0, 4, new DC::UI::Label valign => 0, align => 1, text => "Username"); 1476 $table->add_at (0, 4, new DC::UI::Label align => 1, text => "Username");
1476 $table->add_at (1, 4, new DC::UI::Entry 1477 $table->add_at (1, 4, new DC::UI::Entry
1477 text => $CFG->{profile}{default}{user}, 1478 text => $CFG->{profile}{default}{user},
1478 tooltip => "The name of your character on the server.", 1479 tooltip => "The name of your character on the server.",
1479 on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{user} = $value; 1 } 1480 on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{user} = $value; 1 }
1480 ); 1481 );
1481 1482
1482 $table->add_at (0, 5, new DC::UI::Label valign => 0, align => 1, text => "Password"); 1483 $table->add_at (0, 5, new DC::UI::Label align => 1, text => "Password");
1483 $table->add_at (1, 5, new DC::UI::Entry 1484 $table->add_at (1, 5, new DC::UI::Entry
1484 text => $CFG->{profile}{default}{password}, 1485 text => $CFG->{profile}{default}{password},
1485 hidden => 1, 1486 hidden => 1,
1486 tooltip => "The password for your character.", 1487 tooltip => "The password for your character.",
1487 on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{password} = $value; 1 } 1488 on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{password} = $value; 1 }
1488 ); 1489 );
1489 1490
1490 $table->add_at (1, 11, $LOGIN_BUTTON = new DC::UI::Button 1491 $table->add_at (1, 11, $LOGIN_BUTTON = new DC::UI::Button
1491 expand => 1, 1492 expand => 1,
1492 align => 0,
1493 text => "Login / Register", 1493 text => "Login / Register",
1494 tooltip => "This button will either login to the account configured above or register a new account.", 1494 tooltip => "This button will either login to the account configured above or register a new account.",
1495 on_activate => sub { 1495 on_activate => sub {
1496 $CONN ? stop_game 1496 $CONN ? stop_game
1497 : start_game; 1497 : start_game;
1500 ); 1500 );
1501 1501
1502 $vbox->add (new DC::UI::FancyFrame 1502 $vbox->add (new DC::UI::FancyFrame
1503 label => "Registering", 1503 label => "Registering",
1504 min_h => 200, 1504 min_h => 200,
1505 child => (new DC::UI::Label valign => -1, ellipsise => 0, 1505 child => (new DC::UI::Label valign => 0, ellipsise => 0,
1506 markup => 1506 markup =>
1507 "To register a new account, choose a username that hasn't been taken yet and " 1507 "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.", 1508 . "try to log-in. Follow the instructions in the Log tab in the message window.",
1509 ), 1509 ),
1510 ); 1510 );
1520 child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]), 1520 child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]),
1521 ); 1521 );
1522 1522
1523 my $row = 0; 1523 my $row = 0;
1524 1524
1525 $table->add_at (0, ++$row, new DC::UI::Label valign => 0, align => 1, text => "Host:Port"); 1525 $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Host:Port");
1526 { 1526 {
1527 $table->add_at (1, $row, my $vbox = new DC::UI::VBox); 1527 $table->add_at (1, $row, my $vbox = new DC::UI::VBox);
1528 1528
1529 $vbox->add ( 1529 $vbox->add (
1530 $HOST_ENTRY = new DC::UI::Entry 1530 $HOST_ENTRY = new DC::UI::Entry
1548 on_visibility_change => sub { $METASERVER->hide unless $_[1]; 1 }, 1548 on_visibility_change => sub { $METASERVER->hide unless $_[1]; 1 },
1549 ); 1549 );
1550 }#d# 1550 }#d#
1551 } 1551 }
1552 1552
1553 $table->add_at (0, ++$row, new DC::UI::Label valign => 0, align => 1, text => "Map Size"); 1553 $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Map Size");
1554 $table->add_at (1, $row, new DC::UI::Slider 1554 $table->add_at (1, $row, new DC::UI::Slider
1555 force_w => 100, 1555 force_w => 100,
1556 range => [$CFG->{mapsize}, 10, 100, 0, 1], 1556 range => [$CFG->{mapsize}, 10, 100, 0, 1],
1557 tooltip => "This is the size of the portion of the map update the server sends you. " 1557 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, " 1558 . "If you set this to a high value you will be able to see further, "
1559 . "but you also increase bandwidth requirements and latency. " 1559 . "but you also increase bandwidth requirements and latency. "
1560 . "This option is only used once at log-in.", 1560 . "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 }, 1561 on_changed => sub { my ($self, $value) = @_; $CFG->{mapsize} = $self->{range}[0] = $value = int $value; 1 },
1562 ); 1562 );
1563 1563
1564 $table->add_at (0, ++$row, new DC::UI::Label valign => 0, align => 1, text => "Output-Rate"); 1564 $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Output-Rate");
1565 $table->add_at (1, $row, new DC::UI::Entry 1565 $table->add_at (1, $row, new DC::UI::Entry
1566 text => $CFG->{output_rate}, 1566 text => $CFG->{output_rate},
1567 tooltip => "The maximum bandwidth in bytes per second that the server should not exceed " 1567 tooltip => "The maximum bandwidth in bytes per second that the server should not exceed "
1568 . "when sending data. When 0 or unset, the server " 1568 . "when sending data. When 0 or unset, the server "
1569 . "default will be used, which is usually around 100kb/s. Most servers will " 1569 . "default will be used, which is usually around 100kb/s. Most servers will "
1582sub client_setup { 1582sub client_setup {
1583 my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]; 1583 my $table = new DC::UI::Table expand => 1, col_expand => [0, 1];
1584 1584
1585 my $row = 0; 1585 my $row = 0;
1586 1586
1587 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Tip of the day"); 1587 $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 1588 $table->add_at (1, $row++, new DC::UI::CheckBox
1589 state => $CFG->{show_tips}, 1589 state => $CFG->{show_tips},
1590 tooltip => "Show the <b>Tip of the day</b> window at startup?", 1590 tooltip => "Show the <b>Tip of the day</b> window at startup?",
1591 on_changed => sub { 1591 on_changed => sub {
1592 my ($self, $value) = @_; 1592 my ($self, $value) = @_;
1593 $CFG->{show_tips} = $value; 1593 $CFG->{show_tips} = $value;
1594 0 1594 0
1595 } 1595 }
1596 ); 1596 );
1597 1597
1598 $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Messages Window Size"); 1598 $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 1599 $table->add_at (1, $row++, my $saycmd = new DC::UI::Entry
1600 text => $CFG->{logview_max_par}, 1600 text => $CFG->{logview_max_par},
1601 tooltip => "This is maximum number of messages remembered in the <b>Messages</b> window. If the server " 1601 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 " 1602 . "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.", 1603 . "computing time. A value of <b>0</b> disables this feature, but that is not recommended.",
1604 on_changed => sub { 1604 on_changed => sub {
1605 my ($self, $value) = @_; 1605 my ($self, $value) = @_;
1606 $MESSAGE_WINDOW->set_max_para ($CFG->{logview_max_par} = $value*1); 1606 $MESSAGE_DIST->set_max_para ($CFG->{logview_max_par} = $value*1);
1607 0 1607 0
1608 }, 1608 },
1609 ); 1609 );
1610 1610
1611 $table 1611 $table
1737 1737
1738sub inventory_widget { 1738sub inventory_widget {
1739 my $hb = new DC::UI::HBox homogeneous => 1; 1739 my $hb = new DC::UI::HBox homogeneous => 1;
1740 1740
1741 $hb->add (my $vb1 = new DC::UI::VBox); 1741 $hb->add (my $vb1 = new DC::UI::VBox);
1742 $vb1->add (new DC::UI::Label align => 0, text => "Player"); 1742 $vb1->add (new DC::UI::Label text => "Player");
1743 1743
1744 $vb1->add (my $hb1 = new DC::UI::HBox); 1744 $vb1->add (my $hb1 = new DC::UI::HBox);
1745 1745
1746 use sort 'stable'; 1746 use sort 'stable';
1747 1747
1757 $INV->set_sort_order ($SORT_ORDER{$_[1]}); 1757 $INV->set_sort_order ($SORT_ORDER{$_[1]});
1758 }, 1758 },
1759 ); 1759 );
1760 $hb1->add (new DC::UI::Label text => "Weight: ", align => 1, expand => 1); 1760 $hb1->add (new DC::UI::Label text => "Weight: ", align => 1, expand => 1);
1761 #TODO# update to weigh/maxweight 1761 #TODO# update to weigh/maxweight
1762 $hb1->add ($STATWIDS->{i_weight} = new DC::UI::Label align => -1); 1762 $hb1->add ($STATWIDS->{i_weight} = new DC::UI::Label align => 0);
1763 1763
1764 $vb1->add (my $sw1 = new DC::UI::ScrolledWindow expand => 1, scroll_y => 1); 1764 $vb1->add (my $sw1 = new DC::UI::ScrolledWindow expand => 1, scroll_y => 1);
1765 $sw1->add ($INV = new DC::UI::Inventory); 1765 $sw1->add ($INV = new DC::UI::Inventory);
1766 $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}}); 1766 $INV->set_sort_order ($SORT_ORDER{$::CFG->{inv_sort}});
1767 1767
2171 2171
2172 $MAPWIDGET = new DC::MapWidget; 2172 $MAPWIDGET = new DC::MapWidget;
2173 $MAPWIDGET->connect (activate_console => sub { 2173 $MAPWIDGET->connect (activate_console => sub {
2174 my ($mapwidget, $preset) = @_; 2174 my ($mapwidget, $preset) = @_;
2175 2175
2176 $MESSAGE_WINDOW->activate_console ($preset) 2176 $MESSAGE_DIST->activate_console ($preset)
2177 if $MESSAGE_WINDOW; 2177 if $MESSAGE_DIST;
2178 }); 2178 });
2179 $MAPWIDGET->show; 2179 $MAPWIDGET->show;
2180 $MAPWIDGET->grab_focus; 2180 $MAPWIDGET->grab_focus;
2181 2181
2182 $COMPLETER = new DC::MapWidget::Command:: 2182 $COMPLETER = new DC::MapWidget::Command::
2194 force_h => $::HEIGHT * 0.6, 2194 force_h => $::HEIGHT * 0.6,
2195 has_close_button => 1, 2195 has_close_button => 1,
2196 ; 2196 ;
2197 2197
2198 $METASERVER = metaserver_dialog; 2198 $METASERVER = metaserver_dialog;
2199 $MESSAGE_WINDOW = new DC::UI::MessageWindow; 2199 $MESSAGE_WINDOW = new DC::UI::Dockbar;
2200 $MESSAGE_DIST = new DC::MessageDistributor dockbar => $MESSAGE_WINDOW;
2200 2201
2201 $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new DC::UI::Notebook expand => 1, debug => 1, 2202 $SETUP_DIALOG->add ($SETUP_NOTEBOOK = new DC::UI::Notebook expand => 1, debug => 1,
2202 filter => new DC::UI::ScrolledWindow expand => 1, scroll_y => 1); 2203 filter => new DC::UI::ScrolledWindow expand => 1, scroll_y => 1);
2203 2204
2204 $SETUP_NOTEBOOK->add_tab (Login => $SETUP_LOGIN = login_setup, 2205 $SETUP_NOTEBOOK->add_tab (Login => $SETUP_LOGIN = login_setup,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines