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.97 by root, Tue Jul 4 23:23:31 2006 UTC vs.
Revision 1.100 by root, Sun Jul 16 20:04:07 2006 UTC

238} 238}
239 239
240package CFClient::Layout; 240package CFClient::Layout;
241 241
242$CFClient::OpenGL::SHUTDOWN_HOOK{"CFClient::Layout"} = sub { 242$CFClient::OpenGL::SHUTDOWN_HOOK{"CFClient::Layout"} = sub {
243 clear_font_cache; 243 reset_glyph_cache;
244}; 244};
245 245
246package CFClient::Item; 246package CFClient::Item;
247 247
248use strict; 248use strict;
285} 285}
286 286
287sub do_n_dialog { 287sub do_n_dialog {
288 my ($cb) = @_; 288 my ($cb) = @_;
289 289
290 my $w = new CFClient::UI::FancyFrame; 290 my $w = new CFClient::UI::FancyFrame
291 on_delete => sub { $_[0]->destroy; 1 },
292 has_close_button => 1,
293 ;
294
291 $w->add (my $vb = new CFClient::UI::VBox x => "center", y => "center"); 295 $w->add (my $vb = new CFClient::UI::VBox x => "center", y => "center");
292 $vb->add (new CFClient::UI::Label text => "Enter item count:"); 296 $vb->add (new CFClient::UI::Label text => "Enter item count:");
293 $vb->add (my $entry = new CFClient::UI::Entry 297 $vb->add (my $entry = new CFClient::UI::Entry
294 text => $last_enter_count, 298 text => $last_enter_count,
295 on_activate => sub { 299 on_activate => sub {
296 my ($entry) = @_; 300 my ($entry) = @_;
297 $last_enter_count = $entry->get_text; 301 $last_enter_count = $entry->get_text;
298 $cb->($last_enter_count); 302 $cb->($last_enter_count);
299 $w->hide; 303 $w->hide;
300 $w = undef; 304 $w->destroy;
305
306 0
301 } 307 },
308 on_escape => sub { $w->destroy; 1 },
302 ); 309 );
303 $entry->grab_focus; 310 $entry->grab_focus;
304 $w->show; 311 $w->show;
305
306} 312}
307 313
308sub update_widgets { 314sub update_widgets {
309 my ($self) = @_; 315 my ($self) = @_;
310 316
333 $::CONN->send ("apply $self->{tag}"); 339 $::CONN->send ("apply $self->{tag}");
334 } elsif ($ev->{button} == 3) { 340 } elsif ($ev->{button} == 3) {
335 my @menu_items = ( 341 my @menu_items = (
336 ["examine", sub { $::CONN->send ("examine $self->{tag}") }], 342 ["examine", sub { $::CONN->send ("examine $self->{tag}") }],
337 ["mark", sub { $::CONN->send ("mark ". pack "N", $self->{tag}) }], 343 ["mark", sub { $::CONN->send ("mark ". pack "N", $self->{tag}) }],
344 ["ignite/thaw", # first try of an easier use of flint&steel
345 sub {
346 $::CONN->send ("mark ". pack "N", $self->{tag});
347 $::CONN->send ("command apply flint and steel");
348 }
349 ],
338 ["apply", sub { $::CONN->send ("apply $self->{tag}") }], 350 ["apply", sub { $::CONN->send ("apply $self->{tag}") }],
339 ( 351 (
340 $self->{flags} & F_LOCKED 352 $self->{flags} & F_LOCKED
341 ? ( 353 ? (
342 ["unlock", sub { $::CONN->send ("lock " . pack "CN", 0, $self->{tag}) }], 354 ["unlock", sub { $::CONN->send ("lock " . pack "CN", 0, $self->{tag}) }],

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines