--- deliantra/Deliantra-Client/DC/MapWidget.pm 2006/05/19 23:18:42 1.31 +++ deliantra/Deliantra-Client/DC/MapWidget.pm 2006/05/22 03:40:43 1.32 @@ -150,8 +150,11 @@ glPopMatrix; # TNT2 emulates logops in software (or worse :) - if ($CFClient::UI::FOCUS != $self) { - glColor 0.4, 0.2, 0.2, 0.9; + if ($CFClient::UI::FOCUS == $self) { + (delete $self->{out_of_focus})->destroy + if $self->{out_of_focus}; + } else { + glColor 0.4, 0.2, 0.2, 0.6; glEnable GL_BLEND; glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; glBegin GL_QUADS; @@ -161,6 +164,27 @@ glVertex $::WIDTH, 0; glEnd; glDisable GL_BLEND; + + $self->{out_of_focus} ||= do { + my $label = new CFClient::UI::Label + x => 0, + y => 0, + z => 1, + ellipsise => 0, + text => "Map Out of Focus (click map to play)"; + + $label->show; + $label->update; + + $CFClient::UI::ROOT->on_post_alloc ("$self$label" => sub { + $label->move ( + ($::WIDTH - $label->{w}) * 0.5, + ($::HEIGHT - $label->{h}) * 0.5, + ); + }); + + $label + }; } }