… | |
… | |
232 | |
232 | |
233 | $markup .= $mod & DC::KMOD_NUM |
233 | $markup .= $mod & DC::KMOD_NUM |
234 | ? "[NUM]" |
234 | ? "[NUM]" |
235 | : "[<span foreground='#888'>num</span>]"; |
235 | : "[<span foreground='#888'>num</span>]"; |
236 | |
236 | |
|
|
237 | # <tt> around next statement works around some bug that keeps the |
|
|
238 | # "font =>" from being used on windows |
237 | $MODBOX->set_markup ($markup); |
239 | $MODBOX->set_markup ("<tt>$markup</tt>"); |
238 | } |
240 | } |
239 | |
241 | |
240 | ############################################################################# |
242 | ############################################################################# |
241 | #TODO: maybe move into own audio module... |
243 | #TODO: maybe move into own audio module... |
242 | |
244 | |
… | |
… | |
763 | if ($CONN) { |
765 | if ($CONN) { |
764 | DC::lowdelay fileno $CONN->{fh}; |
766 | DC::lowdelay fileno $CONN->{fh}; |
765 | |
767 | |
766 | status "login successful"; |
768 | status "login successful"; |
767 | } else { |
769 | } else { |
|
|
770 | warn $@; |
768 | status "unable to connect"; |
771 | status "unable to connect"; |
769 | stop_game(); |
772 | stop_game(); |
770 | } |
773 | } |
771 | } |
774 | } |
772 | |
775 | |
… | |
… | |
1972 | my @path = DC::Pod::full_path_of $node; |
1975 | my @path = DC::Pod::full_path_of $node; |
1973 | pop @path; # drop current node |
1976 | pop @path; # drop current node |
1974 | |
1977 | |
1975 | for my $node (@path) { |
1978 | for my $node (@path) { |
1976 | $buttons->add (new DC::UI::Button |
1979 | $buttons->add (new DC::UI::Button |
1977 | text => $node->{kw}[0], |
1980 | text => $node->[DC::Pod::N_KW][0], |
1978 | tooltip => "go to <i>" . (DC::asxml DC::Pod::full_path $node) . "</i>", |
1981 | tooltip => "go to <i>" . (DC::asxml DC::Pod::full_path $node) . "</i>", |
1979 | on_activate => sub { |
1982 | on_activate => sub { |
1980 | push @history, [$curnode, $viewer->current_paragraph] if $curnode; @future = (); |
1983 | push @history, [$curnode, $viewer->current_paragraph] if $curnode; @future = (); |
1981 | $load_node->($node); |
1984 | $load_node->($node); |
1982 | }, |
1985 | }, |
1983 | ); |
1986 | ); |
1984 | $buttons->add (new DC::UI::Label text => "/"); |
1987 | $buttons->add (new DC::UI::Label text => "/"); |
1985 | } |
1988 | } |
1986 | |
1989 | |
1987 | $buttons->add (new DC::UI::Label text => $node->{kw}[0], padding_x => 4, padding_y => 4); |
1990 | $buttons->add (new DC::UI::Label text => $node->[DC::Pod::N_KW][0], padding_x => 4, padding_y => 4); |
1988 | |
1991 | |
1989 | $curnode = $node; |
1992 | $curnode = $node; |
1990 | |
1993 | |
1991 | $viewer->clear; |
1994 | $viewer->clear; |
1992 | $viewer->add_paragraph (DC::Pod::as_paragraphs DC::Pod::section_of $curnode); |
1995 | $viewer->add_paragraph (DC::Pod::as_paragraphs DC::Pod::section_of $curnode); |
… | |
… | |
2178 | can_events => 1, |
2181 | can_events => 1, |
2179 | can_hover => 1, |
2182 | can_hover => 1, |
2180 | markup => "", |
2183 | markup => "", |
2181 | align => 0, |
2184 | align => 0, |
2182 | font => $FONT_FIXED, |
2185 | font => $FONT_FIXED, |
2183 | tooltip => "#modifier_box"; |
2186 | tooltip => "#modifier_box", |
|
|
2187 | tooltip_width => 0.67, |
|
|
2188 | ; |
2184 | |
2189 | |
2185 | update_modbox; |
2190 | update_modbox; |
2186 | |
2191 | |
2187 | (new DC::UI::Frame |
2192 | (new DC::UI::Frame |
2188 | bg => [0, 0, 0, 0.4], |
2193 | bg => [0, 0, 0, 0.4], |
… | |
… | |
2425 | DC::read_cfg "$Deliantra::OLDDIR/cfplusrc"; |
2430 | DC::read_cfg "$Deliantra::OLDDIR/cfplusrc"; |
2426 | print STDERR "INFO: used old configuration file\n"; |
2431 | print STDERR "INFO: used old configuration file\n"; |
2427 | } |
2432 | } |
2428 | |
2433 | |
2429 | DC::DB::Server::run; |
2434 | DC::DB::Server::run; |
|
|
2435 | DC::DB::open_db; |
2430 | |
2436 | |
2431 | DC::UI::set_layout ($::CFG->{layout}); |
2437 | DC::UI::set_layout ($::CFG->{layout}); |
2432 | |
2438 | |
2433 | my %DEF_CFG = ( |
2439 | my %DEF_CFG = ( |
2434 | sdl_mode => 0, |
2440 | sdl_mode => 0, |
… | |
… | |
2504 | DejaVuSansMono-BoldOblique.ttf |
2510 | DejaVuSansMono-BoldOblique.ttf |
2505 | ); |
2511 | ); |
2506 | |
2512 | |
2507 | DC::add_font $_ for @fonts; |
2513 | DC::add_font $_ for @fonts; |
2508 | |
2514 | |
2509 | DC::pango_init; |
|
|
2510 | |
|
|
2511 | $FONT_PROP = new_from_file DC::Font $fonts[0]; |
2515 | $FONT_PROP = new_from_file DC::Font $fonts[0]; |
2512 | $FONT_FIXED = new_from_file DC::Font $fonts[1]; |
2516 | $FONT_FIXED = new_from_file DC::Font $fonts[1]; |
2513 | |
2517 | |
2514 | $FONT_PROP->make_default; |
2518 | $FONT_PROP->make_default; |
|
|
2519 | |
|
|
2520 | DC::pango_init; |
2515 | } |
2521 | } |
2516 | |
2522 | |
2517 | # compare mono (ft) vs. rgba (cairo) |
2523 | # compare mono (ft) vs. rgba (cairo) |
2518 | # ft - 1.8s, cairo 3s, even in alpha-only mode |
2524 | # ft - 1.8s, cairo 3s, even in alpha-only mode |
2519 | # for my $rgba (0..1) { |
2525 | # for my $rgba (0..1) { |