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

Comparing deliantra/Deliantra-Client/DC/Main.pm (file contents):
Revision 1.1 by root, Tue Dec 27 07:23:33 2011 UTC vs.
Revision 1.2 by root, Tue Dec 27 09:17:27 2011 UTC

1773 1773
1774 $vbox 1774 $vbox
1775} 1775}
1776 1776
1777sub client_setup { 1777sub client_setup {
1778 my $vbox = new DC::UI::VBox;
1779
1780 $vbox->add (my $top = new DC::UI::FancyFrame expand => 1, label => "Client Settings");
1781 $vbox->add (my $bot = new DC::UI::FancyFrame expand => 1, label => "Client Info");
1782
1783 {
1778 my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]; 1784 $top->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]);
1779 1785
1780 my $row = 0; 1786 my $row = 0;
1781 1787
1782 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Tip of the day"); 1788 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Tip of the day");
1783 $table->add_at (1, $row++, new DC::UI::CheckBox 1789 $table->add_at (1, $row++, new DC::UI::CheckBox
1784 c_colspan => 2, 1790 c_colspan => 2,
1785 state => $CFG->{show_tips}, 1791 state => $CFG->{show_tips},
1786 tooltip => "Show the <b>Tip of the day</b> window at startup?", 1792 tooltip => "Show the <b>Tip of the day</b> window at startup?",
1787 on_changed => sub { 1793 on_changed => sub {
1788 my ($self, $value) = @_; 1794 my ($self, $value) = @_;
1789 $CFG->{show_tips} = $value; 1795 $CFG->{show_tips} = $value;
1796 0
1790 0 1797 }
1791 } 1798 );
1792 );
1793 1799
1794 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Message Window Size"); 1800 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Message Window Size");
1795 $table->add_at (1, $row++, my $saycmd = new DC::UI::Entry 1801 $table->add_at (1, $row++, my $saycmd = new DC::UI::Entry
1796 c_colspan => 2, 1802 c_colspan => 2,
1797 text => $CFG->{logview_max_par}, 1803 text => $CFG->{logview_max_par},
1798 tooltip => "This is maximum number of messages remembered in the <b>Message</b> window. If the server " 1804 tooltip => "This is maximum number of messages remembered in the <b>Message</b> window. If the server "
1799 . "sends more messages than this number, older messages get removed to save memory and " 1805 . "sends more messages than this number, older messages get removed to save memory and "
1800 . "computing time. A value of <b>0</b> disables this feature, but that is not recommended.", 1806 . "computing time. A value of <b>0</b> disables this feature, but that is not recommended.",
1801 on_changed => sub { 1807 on_changed => sub {
1802 my ($self, $value) = @_; 1808 my ($self, $value) = @_;
1803 $MESSAGE_DIST->set_max_par ($CFG->{logview_max_par} = $value*1); 1809 $MESSAGE_DIST->set_max_par ($CFG->{logview_max_par} = $value*1);
1804 0 1810 0
1805 }, 1811 },
1806 ); 1812 );
1807 1813
1808 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Config Autosave"); 1814 $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Config Autosave");
1809 $table->add_at (1, $row, new DC::UI::CheckBox 1815 $table->add_at (1, $row, new DC::UI::CheckBox
1810 state => $CFG->{config_autosave}, 1816 state => $CFG->{config_autosave},
1811 tooltip => "Normally, configuration settings and the user interface layout " 1817 tooltip => "Normally, configuration settings and the user interface layout "
1812 . "are saved on client exit. You can disable this behaviour by " 1818 . "are saved on client exit. You can disable this behaviour by "
1813 . "unchecking this checkbox.", 1819 . "unchecking this checkbox.",
1814 on_changed => sub { 1820 on_changed => sub {
1815 my ($self, $value) = @_; 1821 my ($self, $value) = @_;
1816 $CFG->{config_autosave} = $value; 1822 $CFG->{config_autosave} = $value;
1823 0
1817 0 1824 }
1818 } 1825 );
1819 );
1820 $table->add_at (2, $row++, new DC::UI::Button 1826 $table->add_at (2, $row++, new DC::UI::Button
1821 text => "Save Now", 1827 text => "Save Now",
1822 tooltip => "Use this to manually save configuration and UI layout when " 1828 tooltip => "Use this to manually save configuration and UI layout when "
1823 . "autosave is disabled.", 1829 . "autosave is disabled.",
1824 on_activate => sub { 1830 on_activate => sub {
1825 DC::write_cfg; 1831 DC::write_cfg;
1832 0
1826 0 1833 }
1827 } 1834 );
1828 ); 1835 }
1829 1836
1830 $table 1837 {
1838 $bot->add (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]);
1839
1840 my $row = 0;
1841
1842 $table->add_at (0, $row , new DC::UI::Label align => 1, text => "Data Directory");
1843 $table->add_at (1, $row++, new DC::UI::Label align => 0, text => $Deliantra::VARDIR, tooltip => "");
1844 $table->add_at (0, $row , new DC::UI::Label align => 1, text => "Database Directory");
1845 $table->add_at (1, $row++, new DC::UI::Label align => 0, text => $DC::DB::DBDIR, tooltip => "");
1846 $table->add_at (0, $row , new DC::UI::Label align => 1, text => "Branch (Prebuilt)");
1847 $table->add_at (1, $row++, new DC::UI::Label align => 0, text => $::EXE_ID, tooltip => "");
1848 $table->add_at (0, $row , new DC::UI::Label align => 1, text => "Version (Prebuilt)");
1849 $table->add_at (1, $row++, new DC::UI::Label align => 0, text => $::EXE_VER, tooltip => "");
1850 $table->add_at (0, $row , new DC::UI::Label align => 1, text => "Update (Prebuilt)");
1851 $table->add_at (1, $row++, new DC::UI::Label align => 0, text => $::UPDPAR, tooltip => "");
1852 }
1853
1854 $vbox
1831} 1855}
1832 1856
1833sub autopickup_setup { 1857sub autopickup_setup {
1834 my $r = new DC::UI::ScrolledWindow ( 1858 my $r = new DC::UI::ScrolledWindow (
1835 expand => 1, 1859 expand => 1,
2632 2656
2633our $INPUT_WATCHER = EV::periodic 0, 1 / $MAX_FPS, undef, sub { 2657our $INPUT_WATCHER = EV::periodic 0, 1 / $MAX_FPS, undef, sub {
2634 $NOW = EV::now; 2658 $NOW = EV::now;
2635 2659
2636 ($SDL_CB[$_->{type}] || sub { warn "unhandled event $_->{type}" })->($_) 2660 ($SDL_CB[$_->{type}] || sub { warn "unhandled event $_->{type}" })->($_)
2637 for DC::poll_events; 2661 for DC::peep_events;
2638 2662
2639 if (%animate_object) { 2663 if (%animate_object) {
2640 $_->animate ($LAST_REFRESH - $NOW) for values %animate_object; 2664 $_->animate ($LAST_REFRESH - $NOW) for values %animate_object;
2641 $WANT_REFRESH = 1; 2665 $WANT_REFRESH = 1;
2642 } 2666 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines