… | |
… | |
78 | } |
78 | } |
79 | |
79 | |
80 | # prepend private library directory |
80 | # prepend private library directory |
81 | BEGIN { |
81 | BEGIN { |
82 | for (grep !ref, @INC) { |
82 | for (grep !ref, @INC) { |
83 | my $path = "$_/Deliantra/Client/private/dc"; |
83 | my $path = "$_/Deliantra/Client/private"; |
84 | if (-d $path) { |
84 | if (-d $path) { |
85 | unshift @INC, $path; |
85 | unshift @INC, $path; |
86 | last; |
86 | last; |
87 | } |
87 | } |
88 | } |
88 | } |
… | |
… | |
108 | use DC::UI; |
108 | use DC::UI; |
109 | use DC::UI::Canvas; |
109 | use DC::UI::Canvas; |
110 | use DC::UI::Inventory; |
110 | use DC::UI::Inventory; |
111 | use DC::UI::SpellList; |
111 | use DC::UI::SpellList; |
112 | use DC::UI::Dockable; |
112 | use DC::UI::Dockable; |
|
|
113 | use DC::UI::Dockbar; |
113 | use DC::UI::MessageWindow; |
114 | use DC::UI::MessageWindow; |
114 | use DC::UI::ChatView; |
115 | use DC::UI::ChatView; |
|
|
116 | use DC::MessageDistributor; |
115 | use DC::Pod; |
117 | use DC::Pod; |
116 | use DC::MapWidget; |
118 | use DC::MapWidget; |
117 | use DC::Macro; |
119 | use DC::Macro; |
118 | |
120 | |
119 | $SIG{QUIT} = sub { Carp::cluck "QUIT" }; |
121 | $SIG{QUIT} = sub { Carp::cluck "QUIT" }; |
… | |
… | |
178 | our $SPELL_PAGE; |
180 | our $SPELL_PAGE; |
179 | our $SPELL_LIST; |
181 | our $SPELL_LIST; |
180 | |
182 | |
181 | our $HELP_WINDOW; |
183 | our $HELP_WINDOW; |
182 | our $MESSAGE_WINDOW; |
184 | our $MESSAGE_WINDOW; |
|
|
185 | our $MESSAGE_DIST; |
183 | our $FLOORBOX; |
186 | our $FLOORBOX; |
184 | our $GAUGES; |
187 | our $GAUGES; |
185 | our $STATWIDS; |
188 | our $STATWIDS; |
186 | |
189 | |
187 | our $SDL_ACTIVE; |
190 | our $SDL_ACTIVE; |
… | |
… | |
204 | sub debug { |
207 | sub debug { |
205 | $DEBUG_STATUS->set_text ($_[0]); |
208 | $DEBUG_STATUS->set_text ($_[0]); |
206 | } |
209 | } |
207 | |
210 | |
208 | sub message { |
211 | sub 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 | |
… | |
… | |
717 | user => $PROFILE->{user}, |
720 | user => $PROFILE->{user}, |
718 | pass => $PROFILE->{password}, |
721 | pass => $PROFILE->{password}, |
719 | mapw => $mapsize, |
722 | mapw => $mapsize, |
720 | maph => $mapsize, |
723 | maph => $mapsize, |
721 | |
724 | |
722 | client => "cfplus $DC::VERSION $] $^O", |
725 | client => "$DC::VERSION $] $^O", |
723 | |
726 | |
724 | map_widget => $MAPWIDGET, |
727 | map_widget => $MAPWIDGET, |
725 | statusbox => $STATUSBOX, |
728 | statusbox => $STATUSBOX, |
726 | map => $MAP, |
729 | map => $MAP, |
727 | mapmap => $MAPMAP, |
730 | mapmap => $MAPMAP, |
… | |
… | |
805 | ); |
808 | ); |
806 | |
809 | |
807 | $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Force OpenGL 1.1"); |
810 | $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Force OpenGL 1.1"); |
808 | $table->add_at (1, $row++, new DC::UI::CheckBox |
811 | $table->add_at (1, $row++, new DC::UI::CheckBox |
809 | state => $CFG->{force_opengl11}, |
812 | state => $CFG->{force_opengl11}, |
810 | 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 " |
811 | . "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 " |
812 | . "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. " |
813 | . "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, " |
814 | . "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 " |
815 | . "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>", |
… | |
… | |
883 | $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Message Fontsize"); |
886 | $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Message Fontsize"); |
884 | $table->add_at (1, $row++, new DC::UI::Slider |
887 | $table->add_at (1, $row++, new DC::UI::Slider |
885 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
888 | range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1], |
886 | 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, " |
887 | . "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.", |
888 | 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 }, |
889 | ); |
892 | ); |
890 | |
893 | |
891 | $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Gauge fontsize"); |
894 | $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Gauge fontsize"); |
892 | $table->add_at (1, $row++, new DC::UI::Slider |
895 | $table->add_at (1, $row++, new DC::UI::Slider |
893 | range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], |
896 | range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1], |
… | |
… | |
1525 | |
1528 | |
1526 | $vbox->add ( |
1529 | $vbox->add ( |
1527 | $HOST_ENTRY = new DC::UI::Entry |
1530 | $HOST_ENTRY = new DC::UI::Entry |
1528 | expand => 1, |
1531 | expand => 1, |
1529 | text => $CFG->{profile}{default}{host}, |
1532 | text => $CFG->{profile}{default}{host}, |
1530 | tooltip => "The hostname or ip address of the Deliantra server to connect to", |
1533 | tooltip => "The hostname or ip address of the Deliantra server to connect to (e.g. <b>gameserver.deliantra.net</b>)", |
1531 | on_changed => sub { |
1534 | on_changed => sub { |
1532 | my ($self, $value) = @_; |
1535 | my ($self, $value) = @_; |
1533 | $CFG->{profile}{default}{host} = $value; |
1536 | $CFG->{profile}{default}{host} = $value; |
1534 | 1 |
1537 | 1 |
1535 | } |
1538 | } |
… | |
… | |
1538 | if (0) { #d# disabled |
1541 | if (0) { #d# disabled |
1539 | $vbox->add (new DC::UI::Button |
1542 | $vbox->add (new DC::UI::Button |
1540 | expand => 1, |
1543 | expand => 1, |
1541 | text => "Server List", |
1544 | text => "Server List", |
1542 | other => $METASERVER, |
1545 | other => $METASERVER, |
1543 | tooltip => "Show a list of available crossfire servers", |
1546 | tooltip => "Show a list of available Deliantra servers", |
1544 | on_activate => sub { $METASERVER->toggle_visibility; 0 }, |
1547 | on_activate => sub { $METASERVER->toggle_visibility; 0 }, |
1545 | on_visibility_change => sub { $METASERVER->hide unless $_[1]; 1 }, |
1548 | on_visibility_change => sub { $METASERVER->hide unless $_[1]; 1 }, |
1546 | ); |
1549 | ); |
1547 | }#d# |
1550 | }#d# |
1548 | } |
1551 | } |
… | |
… | |
1598 | 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 " |
1599 | . "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 " |
1600 | . "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.", |
1601 | on_changed => sub { |
1604 | on_changed => sub { |
1602 | my ($self, $value) = @_; |
1605 | my ($self, $value) = @_; |
1603 | $MESSAGE_WINDOW->set_max_para ($CFG->{logview_max_par} = $value*1); |
1606 | $MESSAGE_DIST->set_max_par ($CFG->{logview_max_par} = $value*1); |
1604 | 0 |
1607 | 0 |
1605 | }, |
1608 | }, |
1606 | ); |
1609 | ); |
1607 | |
1610 | |
1608 | $table |
1611 | $table |
… | |
… | |
2168 | |
2171 | |
2169 | $MAPWIDGET = new DC::MapWidget; |
2172 | $MAPWIDGET = new DC::MapWidget; |
2170 | $MAPWIDGET->connect (activate_console => sub { |
2173 | $MAPWIDGET->connect (activate_console => sub { |
2171 | my ($mapwidget, $preset) = @_; |
2174 | my ($mapwidget, $preset) = @_; |
2172 | |
2175 | |
2173 | $MESSAGE_WINDOW->activate_console ($preset) |
2176 | $MESSAGE_DIST->activate_console ($preset) |
2174 | if $MESSAGE_WINDOW; |
2177 | if $MESSAGE_DIST; |
2175 | }); |
2178 | }); |
2176 | $MAPWIDGET->show; |
2179 | $MAPWIDGET->show; |
2177 | $MAPWIDGET->grab_focus; |
2180 | $MAPWIDGET->grab_focus; |
2178 | |
2181 | |
2179 | $COMPLETER = new DC::MapWidget::Command:: |
2182 | $COMPLETER = new DC::MapWidget::Command:: |
… | |
… | |
2191 | force_h => $::HEIGHT * 0.6, |
2194 | force_h => $::HEIGHT * 0.6, |
2192 | has_close_button => 1, |
2195 | has_close_button => 1, |
2193 | ; |
2196 | ; |
2194 | |
2197 | |
2195 | $METASERVER = metaserver_dialog; |
2198 | $METASERVER = metaserver_dialog; |
2196 | $MESSAGE_WINDOW = new DC::UI::MessageWindow; |
2199 | $MESSAGE_WINDOW = new DC::UI::Dockbar (name => 'message_window', title => 'Messages'); |
|
|
2200 | $MESSAGE_DIST = new DC::MessageDistributor dockbar => $MESSAGE_WINDOW; |
2197 | |
2201 | |
2198 | $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, |
2199 | filter => new DC::UI::ScrolledWindow expand => 1, scroll_y => 1); |
2203 | filter => new DC::UI::ScrolledWindow expand => 1, scroll_y => 1); |
2200 | |
2204 | |
2201 | $SETUP_NOTEBOOK->add_tab (Login => $SETUP_LOGIN = login_setup, |
2205 | $SETUP_NOTEBOOK->add_tab (Login => $SETUP_LOGIN = login_setup, |
… | |
… | |
2370 | if (-e "$Deliantra::VARDIR/client.cf") { |
2374 | if (-e "$Deliantra::VARDIR/client.cf") { |
2371 | DC::read_cfg "$Deliantra::VARDIR/client.cf"; |
2375 | DC::read_cfg "$Deliantra::VARDIR/client.cf"; |
2372 | } else { |
2376 | } else { |
2373 | #TODO: compatibility cruft |
2377 | #TODO: compatibility cruft |
2374 | DC::read_cfg "$Deliantra::OLDDIR/cfplusrc"; |
2378 | DC::read_cfg "$Deliantra::OLDDIR/cfplusrc"; |
2375 | print STDERR "INFO: used old configuratrion file\n"; |
2379 | print STDERR "INFO: used old configuration file\n"; |
2376 | } |
2380 | } |
2377 | |
2381 | |
2378 | DC::DB::Server::run; |
2382 | DC::DB::Server::run; |
2379 | |
2383 | |
2380 | DC::UI::set_layout ($::CFG->{layout}); |
2384 | DC::UI::set_layout ($::CFG->{layout}); |