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.101 by elmex, Fri Apr 14 11:43:51 2006 UTC vs.
Revision 1.102 by elmex, Fri Apr 14 12:17:06 2006 UTC

1255 1255
1256package CFClient::UI::CheckBox; 1256package CFClient::UI::CheckBox;
1257 1257
1258our @ISA = CFClient::UI::DrawBG::; 1258our @ISA = CFClient::UI::DrawBG::;
1259 1259
1260my @tex =
1261 map { new_from_file CFClient::Texture CFClient::find_rcfile $_ }
1262 qw(c1_checkbox_bg.png c1_checkbox_active.png);
1263
1260use SDL; 1264use SDL;
1261use SDL::OpenGL; 1265use SDL::OpenGL;
1262 1266
1263sub new { 1267sub new {
1264 my $class = shift; 1268 my $class = shift;
1301 $self->SUPER::_draw; 1305 $self->SUPER::_draw;
1302 1306
1303 glTranslate $self->{padding} + 0.375, $self->{padding} + 0.375, 0; 1307 glTranslate $self->{padding} + 0.375, $self->{padding} + 0.375, 0;
1304 1308
1305 my $s = (List::Util::min @$self{qw(w h)}) - $self->{padding} * 2; 1309 my $s = (List::Util::min @$self{qw(w h)}) - $self->{padding} * 2;
1306 1310
1307 glColor @{ $FOCUS == $self ? $self->{active_fg} : $self->{fg} }; 1311 glColor @{ $FOCUS == $self ? $self->{active_fg} : $self->{fg} };
1308 1312
1309 glBegin GL_LINE_LOOP; 1313 glEnable GL_BLEND;
1310 glVertex 0 , 0; 1314 glEnable GL_TEXTURE_2D;
1311 glVertex 0 , $s; 1315 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
1312 glVertex $s, $s;
1313 glVertex $s, 0;
1314 glEnd;
1315 1316
1316 if ($self->{state}) { 1317 my $tex = $self->{state} ? $tex[1] : $tex[0];
1317 glBegin GL_LINES; 1318
1318 glVertex 0 , 0; 1319 $tex->draw_quad (0, 0, $s, $s);
1319 glVertex $s, $s; 1320
1320 glVertex $s, 0; 1321 glDisable GL_TEXTURE_2D;
1321 glVertex 0 , $s; 1322 glDisable GL_BLEND;
1322 glEnd;
1323 }
1324} 1323}
1325 1324
1326############################################################################# 1325#############################################################################
1327 1326
1328package CFClient::UI::Slider; 1327package CFClient::UI::Slider;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines