aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-03 19:56:12 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-03 19:56:12 +0000
commit62c550f061027807d0f97f0176e9dd38f86c87fa (patch)
treeb467b4d43a37ff49515d26d22b03355c99556cc7 /src/menu
parent21438b7ca8862ef5b9f789e138efdbab15939a40 (diff)
downloadusdx-62c550f061027807d0f97f0176e9dd38f86c87fa.tar.gz
usdx-62c550f061027807d0f97f0176e9dd38f86c87fa.tar.xz
usdx-62c550f061027807d0f97f0176e9dd38f86c87fa.zip
fix indentation
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3178 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/menu')
-rw-r--r--src/menu/UMenuButton.pas77
1 files changed, 74 insertions, 3 deletions
diff --git a/src/menu/UMenuButton.pas b/src/menu/UMenuButton.pas
index 509c140b..6bec713d 100644
--- a/src/menu/UMenuButton.pas
+++ b/src/menu/UMenuButton.pas
@@ -123,7 +123,7 @@ type
implementation
-uses
+uses
SysUtils,
UDisplay,
UDrawTexture;
@@ -213,7 +213,10 @@ begin
Texture2.Int := SelectInt;
for T := 0 to High(Text) do
+ begin
+ Text[T].SetSelect(SelectBool);
Text[T].Int := SelectTInt;
+ end;
//Fade Mod
if Fade then
@@ -240,8 +243,11 @@ begin
Texture2.Int := DeselectInt;
for T := 0 to High(Text) do
+ begin
+ Text[T].SetSelect(SelectBool);
Text[T].Int := DeselectTInt;
-
+ end;
+
//Fade Mod
if Fade then
begin
@@ -263,6 +269,7 @@ var
T: integer;
Tick: cardinal;
Spacing: real;
+ x1, x2, x3, x4, y1, y2, y3, y4: real;
begin
if Visible then
begin
@@ -458,6 +465,7 @@ begin
glBindTexture(GL_TEXTURE_2D, TexNum);
//Draw
+ {
glBegin(GL_QUADS);//Top Left
glColor4f(ColR * Int, ColG * Int, ColB * Int, Alpha-0.3);
glTexCoord2f(TexX1*TexW, TexY2*TexH);
@@ -479,6 +487,46 @@ begin
glTexCoord2f(TexX2*TexW, TexY2*TexH);
glVertex3f(x+w*scaleW, y+h*scaleH + Spacing, z);
glEnd;
+ }
+
+ y1 := y + h*scaleH + Spacing;
+ y2 := y + h*scaleH + h*scaleH/2 + Spacing;
+ y3 := y + h*scaleH + h*scaleH/2 + Spacing;
+ y4 := y + h*scaleH + Spacing;
+
+ glBegin(GL_QUADS);//Top Left
+ glColor4f(ColR * Int, ColG * Int, ColB * Int, Alpha-0.3);
+ glTexCoord2f(TexX1*TexW, TexY2*TexH);
+ glVertex3f(x, y1 - (y1 - (LeftScale * (y1))), z);
+
+ //Bottom Left
+ glColor4f(ColR * Int, ColG * Int, ColB * Int, 0);
+ glTexCoord2f(TexX1*TexW, TexY1+TexH*0.5);
+ glVertex3f(x, y2 - (y2 - (LeftScale * (y2))), z);
+
+ //Bottom Right
+ glColor4f(ColR * Int, ColG * Int, ColB * Int, 0);
+ glTexCoord2f(TexX2*TexW, TexY1+TexH*0.5);
+ glVertex3f(x+w*scaleW, y3 - (y3 - (RightScale * (y3))), z);
+
+ //Top Right
+ glColor4f(ColR * Int, ColG * Int, ColB * Int, Alpha-0.3);
+ glTexCoord2f(TexX2*TexW, TexY2*TexH);
+ glVertex3f(x+w*scaleW, y4 - (y4 - (RightScale * (y4))), z);
+ glEnd;
+
+ {
+ glBegin(GL_QUADS);
+ glTexCoord2f(TexX1*TexW, TexY1*TexH);
+ glVertex3f(x, y + (y - (LeftScale * (y))), z);
+ glTexCoord2f(TexX1*TexW, TexY2*TexH);
+ glVertex3f(x, y - (y - (LeftScale * (y))), z);
+ glTexCoord2f(TexX2*TexW, TexY2*TexH);
+ glVertex3f(x, y - (y - (RightScale * (y))), z);
+ glTexCoord2f(TexX2*TexW, TexY1*TexH);
+ glVertex3f(x, y + (y - (RightScale * (y))), z);
+ glEnd;
+ }
glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
@@ -535,7 +583,7 @@ end;
function TButton.GetMouseOverArea: TMouseOverRect;
begin
- if (Display.Cursor_HiddenByScreen = false) then
+ if not(Display.Cursor_HiddenByScreen) then
begin
if (FadeTex.TexNum = 0) then
begin
@@ -582,6 +630,29 @@ end;
destructor TButton.Destroy;
begin
+ {if (FadeTex.TexNum > 0) then
+ begin
+ glDeleteTextures(1, PGLuint(@FadeTex.TexNum));
+ FadeTex.TexNum := 0;
+ end;
+
+ if (Texture.TexNum > 0) then
+ begin
+ glDeleteTextures(1, PGLuint(@Texture.TexNum));
+ Texture.TexNum := 0;
+ end;
+
+ if (Texture2.TexNum > 0) then
+ begin
+ glDeleteTextures(1, PGLuint(@Texture2.TexNum));
+ Texture2.TexNum := 0;
+ end;
+
+ if (DeSelectTexture.TexNum > 0) then
+ begin
+ glDeleteTextures(1, PGLuint(@DeSelectTexture.TexNum));
+ DeSelectTexture.TexNum := 0;
+ end;}
inherited;
end;