ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/gde/GCE/Util.pm
(Generate patch)

Comparing deliantra/gde/GCE/Util.pm (file contents):
Revision 1.25 by elmex, Sun Aug 19 17:32:39 2007 UTC vs.
Revision 1.26 by elmex, Sat Aug 25 15:21:04 2007 UTC

25use strict; 25use strict;
26 26
27our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb 27our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb
28 fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall 28 fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall
29 stack_find arch_is_wall arch_is_monster add_table_widget quick_msg 29 stack_find arch_is_wall arch_is_monster add_table_widget quick_msg
30 def arch_is_exit map2abs exit_paths pseudohtml2txt arch_is_connector); 30 def arch_is_exit map2abs exit_paths pseudohtml2txt arch_is_connector
31 gtk2_get_color);
31 32
33my %allocated_colors;
34
35sub gtk2_get_color {
36 my ($widget, $name) = @_;
37 my $colormap = $widget->{window}->get_colormap;
38 my $ret;
39
40 if ($ret = $allocated_colors{$name}) {
41 return $ret;
42 }
43
44 my $color = Gtk2::Gdk::Color->parse($name);
45 $colormap->alloc_color($color,1,1);
46
47 $allocated_colors{$name} = $color;
48
49 return $color;
50}
32sub pseudohtml2txt { 51sub pseudohtml2txt {
33 my ($html) = @_; 52 my ($html) = @_;
34 53
35 $html =~ s/<br\s*?\/?>/\n/gsi; 54 $html =~ s/<br\s*?\/?>/\n/gsi;
36 $html =~ s/<b>(.*?)<\/b>/_\1_/gsi; 55 $html =~ s/<b>(.*?)<\/b>/_\1_/gsi;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines