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.70 by root, Fri May 26 18:28:23 2006 UTC vs.
Revision 1.71 by root, Fri May 26 20:36:32 2006 UTC

190 $db->db_put ($key => $data) 190 $db->db_put ($key => $data)
191} 191}
192 192
193package CFClient::Item; 193package CFClient::Item;
194 194
195use strict;
196use Crossfire::Protocol::Constants;
197
195sub desc_string { 198sub desc_string {
196 my ($self) = @_; 199 my ($self) = @_;
197 200
198 my $desc = 201 my $desc =
199 $self->{nrof} < 2 202 $self->{nrof} < 2
200 ? $self->{name} 203 ? $self->{name}
201 : "$self->{nrof} × $self->{name_pl}"; 204 : "$self->{nrof} × $self->{name_pl}";
202 205
203 $self->{flags} & Crossfire::Protocol::F_OPEN 206 $self->{flags} & F_OPEN
204 and $desc .= " (open)"; 207 and $desc .= " (open)";
205 $self->{flags} & Crossfire::Protocol::F_APPLIED 208 $self->{flags} & F_APPLIED
206 and $desc .= " (applied)"; 209 and $desc .= " (applied)";
207 $self->{flags} & Crossfire::Protocol::F_UNPAID 210 $self->{flags} & F_UNPAID
208 and $desc .= " (unpaid)"; 211 and $desc .= " (unpaid)";
209 $self->{flags} & Crossfire::Protocol::F_MAGIC 212 $self->{flags} & F_MAGIC
210 and $desc .= " (magic)"; 213 and $desc .= " (magic)";
211 $self->{flags} & Crossfire::Protocol::F_CURSED 214 $self->{flags} & F_CURSED
212 and $desc .= " (cursed)"; 215 and $desc .= " (cursed)";
213 $self->{flags} & Crossfire::Protocol::F_DAMNED 216 $self->{flags} & F_DAMNED
214 and $desc .= " (damned)"; 217 and $desc .= " (damned)";
215 $self->{flags} & Crossfire::Protocol::F_LOCKED 218 $self->{flags} & F_LOCKED
216 and $desc .= " *"; 219 and $desc .= " *";
217 220
218 $desc 221 $desc
219} 222}
220 223
248 my @menu_items = ( 251 my @menu_items = (
249 ["examine", sub { $::CONN->send ("examine $self->{tag}") }], 252 ["examine", sub { $::CONN->send ("examine $self->{tag}") }],
250 ["mark", sub { $::CONN->send ("mark ". pack "N", $self->{tag}) }], 253 ["mark", sub { $::CONN->send ("mark ". pack "N", $self->{tag}) }],
251 ["apply", sub { $::CONN->send ("apply $self->{tag}") }], 254 ["apply", sub { $::CONN->send ("apply $self->{tag}") }],
252 ( 255 (
253 $self->{flags} & Crossfire::Protocol::F_LOCKED 256 $self->{flags} & F_LOCKED
254 ? ( 257 ? (
255 ["unlock", sub { $::CONN->send ("lock " . pack "CN", 0, $self->{tag}) }], 258 ["unlock", sub { $::CONN->send ("lock " . pack "CN", 0, $self->{tag}) }],
256 ) 259 )
257 : ( 260 : (
258 ["lock", sub { $::CONN->send ("lock " . pack "CN", 1, $self->{tag}) }], 261 ["lock", sub { $::CONN->send ("lock " . pack "CN", 1, $self->{tag}) }],

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines