ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.102 by root, Sat Jul 22 13:20:33 2006 UTC vs.
Revision 1.105 by root, Sun Jul 23 16:11:12 2006 UTC

45 Arm => "<b>Armour</b>, how much damage (from physical attacks) will be subtracted from successful hits made upon you. This value ranges between 0 to 99%. Current armour worn primarily determines Arm value. This is the same as the physical resistance.", 45 Arm => "<b>Armour</b>, how much damage (from physical attacks) will be subtracted from successful hits made upon you. This value ranges between 0 to 99%. Current armour worn primarily determines Arm value. This is the same as the physical resistance.",
46 Spd => "<b>Speed</b>, how fast you can move. The value of speed may range between nearly 0 (\"very slow\") to higher than 5 (\"lightning fast\"). Base speed is determined from the Dex and modified downward proportionally by the amount of weight carried which exceeds the Max Carry limit. The armour worn also sets the upper limit on speed.", 46 Spd => "<b>Speed</b>, how fast you can move. The value of speed may range between nearly 0 (\"very slow\") to higher than 5 (\"lightning fast\"). Base speed is determined from the Dex and modified downward proportionally by the amount of weight carried which exceeds the Max Carry limit. The armour worn also sets the upper limit on speed.",
47 WSp => "<b>Weapon Speed</b>, how many attacks you may make per unit of time (0.120s). Higher values indicate faster attack speed. Current weapon and Dex effect the value of weapon speed.", 47 WSp => "<b>Weapon Speed</b>, how many attacks you may make per unit of time (0.120s). Higher values indicate faster attack speed. Current weapon and Dex effect the value of weapon speed.",
48); 48);
49 49
50package CFClient::PodToPango; 50=item guard { BLOCK }
51 51
52use base Pod::POM::View::Text; 52Returns an object that executes the given block as soon as it is destroyed.
53 53
54our $VERSION = 1; # bump if resultant formatting changes 54=cut
55 55
56our $indent = 0; 56sub guard(&) {
57 57 bless \(my $cb = $_[0]), "CFClient::Guard"
58*view_seq_code =
59*view_seq_bold = sub { "<b>$_[1]</b>" };
60*view_seq_italic = sub { "<i>$_[1]</i>" };
61*view_seq_space =
62*view_seq_link =
63*view_seq_index = sub { CFClient::UI::Label::escape ($_[1]) };
64
65sub view_seq_text {
66 my $text = $_[1];
67 $text =~ s/\s+/ /g;
68 CFClient::UI::Label::escape ($text)
69} 58}
70 59
71sub view_item { 60sub CFClient::Guard::DESTROY {
72 ("\t" x ($indent / 4)) 61 ${$_[0]}->()
73 . $_[1]->title->present ($_[0])
74 . "\n\n"
75 . $_[1]->content->present ($_[0])
76} 62}
77 63
78sub view_verbatim { 64sub asxml($) {
79 (join "", 65 local $_ = $_[0];
80 map +("\t" x ($indent / 2)) . "<tt>$_</tt>\n",
81 split /\n/, CFClient::UI::Label::escape ($_[1]))
82 . "\n"
83}
84 66
85sub view_textblock { 67 s/&/&amp;/g;
86 ("\t" x ($indent / 2)) . "$_[1]\n\n" 68 s/>/&gt;/g;
87} 69 s/</&lt;/g;
88 70
89sub view_head1 { 71 $_
90 "\n\n<span foreground='#ffff00' size='x-large'>" . $_[1]->title->present ($_[0]) . "</span>\n\n"
91 . $_[1]->content->present ($_[0])
92};
93
94sub view_head2 {
95 "\n<span foreground='#ccccff' size='large'>" . $_[1]->title->present ($_[0]) . "</span>\n\n"
96 . $_[1]->content->present ($_[0])
97};
98
99sub view_head3 {
100 "\n<span size='large'>" . $_[1]->title->present ($_[0]) . "</span>\n\n"
101 . $_[1]->content->present ($_[0])
102};
103
104sub view_over {
105 local $indent = $indent + $_[1]->indent;
106 $_[1]->content->present ($_[0])
107} 72}
108 73
109package CFClient::Database; 74package CFClient::Database;
110 75
111our @ISA = BerkeleyDB::Btree::; 76our @ISA = BerkeleyDB::Btree::;
205# -Filename => "database", 170# -Filename => "database",
206# -Subname => $table, 171# -Subname => $table,
207 -Property => DB_CHKSUM, 172 -Property => DB_CHKSUM,
208 -Flags => DB_CREATE | DB_UPGRADE, 173 -Flags => DB_CREATE | DB_UPGRADE,
209 or die "unable to create/open database table $_[0]: $BerkeleyDB::Error" 174 or die "unable to create/open database table $_[0]: $BerkeleyDB::Error"
210}
211
212my $pod_cache = db_table "pod_cache";
213
214sub load_pod($$$$) {
215 my ($path, $filtertype, $filterversion, $filtercb) = @_;
216
217 stat $path
218 or die "$path: $!";
219
220 my $phash = join ",", $filterversion, $CFClient::PodToPango::VERSION, (stat _)[7,9];
221
222 my ($chash, $pom) = eval { @{ Storable::thaw $pod_cache->get ("$path/$filtertype") } };
223
224 return $pom if $chash eq $phash;
225
226 my $pod = do {
227 local $/;
228 open my $pod, "<:utf8", $_[0]
229 or die "$_[0]: $!";
230 <$pod>
231 };
232
233 #utf8::downgrade $pod;
234
235 $pom = $filtercb-> (Pod::POM->new->parse_text ($pod));
236
237 $pod_cache->put ("$path/$filtertype" => Storable::nfreeze [$phash, $pom]);
238
239 $pom
240}
241
242sub pod_to_pango($) {
243 my ($pom) = @_;
244
245 $pom->present ("CFClient::PodToPango")
246}
247
248sub pod_to_pango_list($) {
249 my ($pom) = @_;
250
251 [
252 map s/^(\s*)// && [40 * length $1, length $_ ? $_ : " "],
253 split /\n/, $pom->present ("CFClient::PodToPango")
254 ]
255} 175}
256 176
257package CFClient::Layout; 177package CFClient::Layout;
258 178
259$CFClient::OpenGL::SHUTDOWN_HOOK{"CFClient::Layout"} = sub { 179$CFClient::OpenGL::SHUTDOWN_HOOK{"CFClient::Layout"} = sub {
376 ["unlock", sub { $::CONN->send ("lock " . pack "CN", 0, $self->{tag}) }], 296 ["unlock", sub { $::CONN->send ("lock " . pack "CN", 0, $self->{tag}) }],
377 ) 297 )
378 : ( 298 : (
379 ["lock", sub { $::CONN->send ("lock " . pack "CN", 1, $self->{tag}) }], 299 ["lock", sub { $::CONN->send ("lock " . pack "CN", 1, $self->{tag}) }],
380 ["$move_prefix all", sub { $::CONN->send ("move $targ $self->{tag} 0") }], 300 ["$move_prefix all", sub { $::CONN->send ("move $targ $self->{tag} 0") }],
381 ["$move_prefix n", 301 ["$move_prefix &lt;n&gt;",
382 sub { 302 sub {
383 do_n_dialog (sub { $::CONN->send ("move $targ $self->{tag} $_[0]") }) 303 do_n_dialog (sub { $::CONN->send ("move $targ $self->{tag} $_[0]") })
384 } 304 }
385 ] 305 ]
386 ) 306 )

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines