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.25 by elmex, Sun Jan 6 17:40:45 2008 UTC vs.
Revision 1.29 by root, Mon Mar 24 00:24:47 2008 UTC

190our $SDL_ACTIVE; 190our $SDL_ACTIVE;
191our %SDL_CB; 191our %SDL_CB;
192 192
193our $ALT_ENTER_MESSAGE; 193our $ALT_ENTER_MESSAGE;
194our $STATUSBOX; 194our $STATUSBOX;
195our $MODBOX;
195our $DEBUG_STATUS; 196our $DEBUG_STATUS;
196 197
197our $INV; 198our $INV;
198our $INVR; 199our $INVR;
199our $INVR_HB; 200our $INVR_HB;
208 $DEBUG_STATUS->set_text ($_[0]); 209 $DEBUG_STATUS->set_text ($_[0]);
209} 210}
210 211
211sub message { 212sub message {
212 $MESSAGE_DIST->message (@_); 213 $MESSAGE_DIST->message (@_);
214}
215
216sub update_modbox {
217 my $mod = DC::SDL_GetModState;
218
219 my $markup;
220
221 $markup .= $mod & DC::KMOD_CTRL
222 ? ($MAPWIDGET->{ctrl} ? "[REPEAT]" : "[<span foreground='#888'>REPEAT</span>]")
223 : "[<span foreground='#888'> once </span>]";
224
225 $markup .= $mod & DC::KMOD_SHIFT
226 ? ($MAPWIDGET->{shft} ? "[FIRE]" : "[<span foreground='#888'>FIRE</span>]")
227 : "[<span foreground='#888'>move</span>]";
228
229 $markup .= $mod & (DC::KMOD_ALT | DC::KMOD_META)
230 ? "[ALT]"
231 : "[<span foreground='#888'>alt</span>]";
232
233 $markup .= $mod & DC::KMOD_NUM
234 ? "[NUM]"
235 : "[<span foreground='#888'>num</span>]";
236
237 $MODBOX->set_markup ($markup);
213} 238}
214 239
215############################################################################# 240#############################################################################
216#TODO: maybe move into own audio module... 241#TODO: maybe move into own audio module...
217 242
720 user => $PROFILE->{user}, 745 user => $PROFILE->{user},
721 pass => $PROFILE->{password}, 746 pass => $PROFILE->{password},
722 mapw => $mapsize, 747 mapw => $mapsize,
723 maph => $mapsize, 748 maph => $mapsize,
724 749
725 client => "cfplus $DC::VERSION $] $^O", 750 client => "$DC::VERSION $] $^O",
726 751
727 map_widget => $MAPWIDGET, 752 map_widget => $MAPWIDGET,
728 statusbox => $STATUSBOX, 753 statusbox => $STATUSBOX,
729 map => $MAP, 754 map => $MAP,
730 mapmap => $MAPMAP, 755 mapmap => $MAPMAP,
1528 1553
1529 $vbox->add ( 1554 $vbox->add (
1530 $HOST_ENTRY = new DC::UI::Entry 1555 $HOST_ENTRY = new DC::UI::Entry
1531 expand => 1, 1556 expand => 1,
1532 text => $CFG->{profile}{default}{host}, 1557 text => $CFG->{profile}{default}{host},
1533 tooltip => "The hostname or ip address of the Deliantra server to connect to", 1558 tooltip => "The hostname or ip address of the Deliantra server to connect to (e.g. <b>gameserver.deliantra.net</b>)",
1534 on_changed => sub { 1559 on_changed => sub {
1535 my ($self, $value) = @_; 1560 my ($self, $value) = @_;
1536 $CFG->{profile}{default}{host} = $value; 1561 $CFG->{profile}{default}{host} = $value;
1537 1 1562 1
1538 } 1563 }
1541 if (0) { #d# disabled 1566 if (0) { #d# disabled
1542 $vbox->add (new DC::UI::Button 1567 $vbox->add (new DC::UI::Button
1543 expand => 1, 1568 expand => 1,
1544 text => "Server List", 1569 text => "Server List",
1545 other => $METASERVER, 1570 other => $METASERVER,
1546 tooltip => "Show a list of available crossfire servers", 1571 tooltip => "Show a list of available Deliantra servers",
1547 on_activate => sub { $METASERVER->toggle_visibility; 0 }, 1572 on_activate => sub { $METASERVER->toggle_visibility; 0 },
1548 on_visibility_change => sub { $METASERVER->hide unless $_[1]; 1 }, 1573 on_visibility_change => sub { $METASERVER->hide unless $_[1]; 1 },
1549 ); 1574 );
1550 }#d# 1575 }#d#
1551 } 1576 }
1601 tooltip => "This is maximum number of messages remembered in the <b>Messages</b> window. If the server " 1626 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 " 1627 . "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.", 1628 . "computing time. A value of <b>0</b> disables this feature, but that is not recommended.",
1604 on_changed => sub { 1629 on_changed => sub {
1605 my ($self, $value) = @_; 1630 my ($self, $value) = @_;
1606 $MESSAGE_DIST->set_max_para ($CFG->{logview_max_par} = $value*1); 1631 $MESSAGE_DIST->set_max_par ($CFG->{logview_max_par} = $value*1);
1607 0 1632 0
1608 }, 1633 },
1609 ); 1634 );
1610 1635
1611 $table 1636 $table
2146 force_x => "max", 2171 force_x => "max",
2147 force_y => 0; 2172 force_y => 0;
2148 $DEBUG_STATUS->show; 2173 $DEBUG_STATUS->show;
2149 2174
2150 $STATUSBOX = new DC::UI::Statusbox; 2175 $STATUSBOX = new DC::UI::Statusbox;
2151 $STATUSBOX->add ("Use <b>Alt-Enter</b> to toggle fullscreen mode", timeout => 864000, pri => -100, color => [1, 1, 1, 0.8]); 2176
2177 $MODBOX = new DC::UI::Label
2178 can_events => 1,
2179 can_hover => 1,
2180 markup => "",
2181 align => 0,
2182 font => $FONT_FIXED,
2183 tooltip => "#modifier_box";
2184
2185 update_modbox;
2152 2186
2153 (new DC::UI::Frame 2187 (new DC::UI::Frame
2154 bg => [0, 0, 0, 0.4], 2188 bg => [0, 0, 0, 0.4],
2155 force_x => 0, 2189 force_x => 0,
2156 force_y => "max", 2190 force_y => "max",
2157 child => $STATUSBOX, 2191 child => (my $LR = new DC::UI::VBox),
2158 )->show; 2192 )->show;
2193
2194 $LR->add ($STATUSBOX);
2195 $LR->add ($MODBOX);
2196 $LR->add (new DC::UI::Label
2197 align => 0,
2198 markup => "Use <b>Alt-Enter</b> to toggle fullscreen mode",
2199 fontsize => 0.5,
2200 fg => [1, 1, 0, 0.7],
2201 );
2159 2202
2160 DC::UI::Toplevel->new ( 2203 DC::UI::Toplevel->new (
2161 title => "Minimap", 2204 title => "Minimap",
2162 name => "mapmap", 2205 name => "mapmap",
2163 x => 0, 2206 x => 0,
2345 # alt-enter 2388 # alt-enter
2346 $FULLSCREEN_ENABLE->toggle; 2389 $FULLSCREEN_ENABLE->toggle;
2347 video_shutdown; 2390 video_shutdown;
2348 video_init; 2391 video_init;
2349 } else { 2392 } else {
2350 DC::UI::feed_sdl_key_down_event ($_[0]); 2393 &DC::UI::feed_sdl_key_down_event;
2351 } 2394 }
2395 update_modbox;
2352 }, 2396 },
2353 DC::SDL_KEYUP => \&DC::UI::feed_sdl_key_up_event, 2397 DC::SDL_KEYUP => sub {
2398 &DC::UI::feed_sdl_key_up_event;
2399 update_modbox;
2400 },
2354 DC::SDL_MOUSEMOTION => \&DC::UI::feed_sdl_motion_event, 2401 DC::SDL_MOUSEMOTION => \&DC::UI::feed_sdl_motion_event,
2355 DC::SDL_MOUSEBUTTONDOWN => \&DC::UI::feed_sdl_button_down_event, 2402 DC::SDL_MOUSEBUTTONDOWN => \&DC::UI::feed_sdl_button_down_event,
2356 DC::SDL_MOUSEBUTTONUP => \&DC::UI::feed_sdl_button_up_event, 2403 DC::SDL_MOUSEBUTTONUP => \&DC::UI::feed_sdl_button_up_event,
2357 DC::SDL_USEREVENT => sub { 2404 DC::SDL_USEREVENT => sub {
2358 if ($_[0]{code} == 1) { 2405 if ($_[0]{code} == 1) {
2374 if (-e "$Deliantra::VARDIR/client.cf") { 2421 if (-e "$Deliantra::VARDIR/client.cf") {
2375 DC::read_cfg "$Deliantra::VARDIR/client.cf"; 2422 DC::read_cfg "$Deliantra::VARDIR/client.cf";
2376 } else { 2423 } else {
2377 #TODO: compatibility cruft 2424 #TODO: compatibility cruft
2378 DC::read_cfg "$Deliantra::OLDDIR/cfplusrc"; 2425 DC::read_cfg "$Deliantra::OLDDIR/cfplusrc";
2379 print STDERR "INFO: used old configuratrion file\n"; 2426 print STDERR "INFO: used old configuration file\n";
2380 } 2427 }
2381 2428
2382 DC::DB::Server::run; 2429 DC::DB::Server::run;
2383 2430
2384 DC::UI::set_layout ($::CFG->{layout}); 2431 DC::UI::set_layout ($::CFG->{layout});

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines