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.17 by elmex, Tue Apr 4 11:29:54 2006 UTC vs.
Revision 1.19 by elmex, Mon Aug 14 03:55:50 2006 UTC

18use Crossfire; 18use Crossfire;
19use Crossfire::MapWidget; 19use Crossfire::MapWidget;
20use File::Spec::Functions; 20use File::Spec::Functions;
21use Cwd 'abs_path'; 21use Cwd 'abs_path';
22 22
23our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall stack_find arch_is_wall arch_is_monster add_table_widget quick_msg def arch_is_exit map2abs exit_paths pseudohtml2txt); 23our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb
24 fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall
25 stack_find arch_is_wall arch_is_monster add_table_widget quick_msg
26 def arch_is_exit map2abs exit_paths pseudohtml2txt arch_is_connector);
24 27
25sub pseudohtml2txt { 28sub pseudohtml2txt {
26 my ($html) = @_; 29 my ($html) = @_;
27 30
28 $html =~ s/<br\s*?\/?>/\n/gsi; 31 $html =~ s/<br\s*?\/?>/\n/gsi;
153} 156}
154 157
155sub arch_is_floor { 158sub arch_is_floor {
156 my ($a) = @_; 159 my ($a) = @_;
157 my $ar = Crossfire::arch_attr $a; 160 my $ar = Crossfire::arch_attr $a;
161 warn "NAME: $ar->{name}\n";
162 return (
158 return (substr $ar->{name}, 0, 5) eq 'Floor'; 163 (substr $ar->{name}, 0, 5) eq 'Floor'
159#return $Crossfire::ARCH{$a->{_name}}->{is_floor}; 164 or (substr $ar->{name}, 0, 10) eq 'Shop Floor'
165 )
166}
167
168sub arch_is_connector {
169 my ($a) = @_;
170 my $ar = Crossfire::arch_attr $a;
171 my $has_connect_field = 0;
172
173 TOP: for (@{$ar->{section}}) {
174 my $name = shift @$_;
175 my @r = @$_;
176 if ($name eq 'general') {
177 for (@r) {
178 my ($k, $s) = ($_->[0], $_->[1]);
179 if ($k eq 'connected' && $s->{name} eq 'connection') {
180 $has_connect_field = 1;
181 last TOP;
182 }
183 }
184 last TOP;
185 }
186 }
187
188 return $has_connect_field;
160} 189}
161 190
162sub arch_is_wall { 191sub arch_is_wall {
163 my ($a) = @_; 192 my ($a) = @_;
164 my $ar = Crossfire::arch_attr $a; 193 my $ar = Crossfire::arch_attr $a;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines