--- deliantra/Deliantra-Client/DC/UI.pm 2006/05/22 03:59:51 1.222 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/05/23 18:10:51 1.223 @@ -213,6 +213,19 @@ $CFClient::UI::ROOT->add ($self); } +sub show_centered { + my ($self) = @_; + return if $self->{parent}; + + $self->show; + + $CFClient::UI::ROOT->on_post_alloc ( + "centered $self" => sub { + $self->move (($::WIDTH - $self->{w}) * 0.5, ($::HEIGHT - $self->{h}) * 0.5); + }, + ); +} + sub hide { my ($self) = @_;