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.115 by root, Sat Apr 15 19:35:20 2006 UTC vs.
Revision 1.116 by root, Sat Apr 15 21:16:50 2006 UTC

74sub harmonize { 74sub harmonize {
75 my ($vals) = @_; 75 my ($vals) = @_;
76 76
77 my $rem = 0; 77 my $rem = 0;
78 78
79 for ($vals) { 79 for (@$vals) {
80 my $i = int $_ + $rem; 80 my $i = int $_ + $rem;
81 $rem += $_ - $i; 81 $rem += $_ - $i;
82 $_ = $i; 82 $_ = $i;
83 } 83 }
84} 84}
950 my $self = $class->SUPER::new ( 950 my $self = $class->SUPER::new (
951 fg => [1, 1, 1], 951 fg => [1, 1, 1],
952 fontsize => $::FONTSIZE, 952 fontsize => $::FONTSIZE,
953 text => "", 953 text => "",
954 align => -1, 954 align => -1,
955 valign => -1,
955 padding => 2, 956 padding => 2,
956 layout => new CFClient::Layout, 957 layout => new CFClient::Layout,
957 %arg 958 %arg
958 ); 959 );
959 960
1036 my $x = 1037 my $x =
1037 $self->{align} < 0 ? $self->{padding} 1038 $self->{align} < 0 ? $self->{padding}
1038 : $self->{align} > 0 ? $self->{w} - $tex->{w} - $self->{padding} 1039 : $self->{align} > 0 ? $self->{w} - $tex->{w} - $self->{padding}
1039 : ($self->{w} - $tex->{w}) * 0.5; 1040 : ($self->{w} - $tex->{w}) * 0.5;
1040 1041
1041 $tex->draw_quad (int $x, int +($self->{h} - $tex->{h}) * 0.5); 1042 my $y =
1043 $self->{valign} < 0 ? $self->{padding}
1044 : $self->{valign} > 0 ? $self->{h} - $tex->{h} - $self->{padding}
1045 : ($self->{h} - $tex->{h}) * 0.5;
1046
1047 $tex->draw_quad (int $x, int $y);
1042 1048
1043 glDisable GL_TEXTURE_2D; 1049 glDisable GL_TEXTURE_2D;
1044 glDisable GL_BLEND; 1050 glDisable GL_BLEND;
1045} 1051}
1046 1052
1061 bg => [0, 0, 0, 0.2], 1067 bg => [0, 0, 0, 0.2],
1062 active_bg => [1, 1, 1, 0.5], 1068 active_bg => [1, 1, 1, 0.5],
1063 active_fg => [0, 0, 0], 1069 active_fg => [0, 0, 0],
1064 can_hover => 1, 1070 can_hover => 1,
1065 can_focus => 1, 1071 can_focus => 1,
1072 valign => 0,
1066 @_ 1073 @_
1067 ) 1074 )
1068} 1075}
1069 1076
1070sub _set_text { 1077sub _set_text {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines