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

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.477 by root, Sun Jan 11 23:50:27 2009 UTC vs.
Revision 1.478 by root, Tue Dec 22 00:35:44 2009 UTC

666} 666}
667 667
668sub _draw { 668sub _draw {
669 my ($self) = @_; 669 my ($self) = @_;
670 670
671 my $color = $FOCUS == $self && $self->{active_bg} 671 my $color = $FOCUS == $self
672 ? $self->{active_bg} 672 ? $self->{active_bg} || $self->{bg}
673 : $self->{bg}; 673 : $self->{bg};
674 674
675 if ($color && (@$color < 4 || $color->[3])) { 675 if ($color && (@$color < 4 || $color->[3])) {
676 my ($w, $h) = @$self{qw(w h)}; 676 my ($w, $h) = @$self{qw(w h)};
677 677
2594 2594
2595############################################################################# 2595#############################################################################
2596 2596
2597package DC::UI::Image; 2597package DC::UI::Image;
2598 2598
2599our @ISA = DC::UI::Base::; 2599our @ISA = DC::UI::DrawBG::;
2600 2600
2601use DC::OpenGL; 2601use DC::OpenGL;
2602 2602
2603our %texture_cache; 2603our %texture_cache;
2604 2604
2637 my ($self, $cloning, $path) = @_; 2637 my ($self, $cloning, $path) = @_;
2638 2638
2639 $self->new (path => $path) 2639 $self->new (path => $path)
2640} 2640}
2641 2641
2642sub set_texture {
2643 my ($self, $tex) = @_;
2644
2645 $self->{tex} = $tex;
2646 $self->update;
2647}
2648
2642sub size_request { 2649sub size_request {
2643 my ($self) = @_; 2650 my ($self) = @_;
2644 2651
2645 (int $self->{tex}{w} * $self->{scale}, int $self->{tex}{h} * $self->{scale}) 2652 (int $self->{tex}{w} * $self->{scale}, int $self->{tex}{h} * $self->{scale})
2646} 2653}
2647 2654
2648sub _draw { 2655sub _draw {
2649 my ($self) = @_; 2656 my ($self) = @_;
2657
2658 $self->SUPER::_draw;
2650 2659
2651 my $tex = $self->{tex}; 2660 my $tex = $self->{tex};
2652 2661
2653 my ($w, $h) = ($self->{w}, $self->{h}); 2662 my ($w, $h) = ($self->{w}, $self->{h});
2654 2663
2672package DC::UI::ImageButton; 2681package DC::UI::ImageButton;
2673 2682
2674our @ISA = DC::UI::Image::; 2683our @ISA = DC::UI::Image::;
2675 2684
2676use DC::OpenGL; 2685use DC::OpenGL;
2677
2678my %textures;
2679 2686
2680sub new { 2687sub new {
2681 my $class = shift; 2688 my $class = shift;
2682 2689
2683 my $self = $class->SUPER::new ( 2690 my $self = $class->SUPER::new (

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines