aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/UMenuButton.pas
diff options
context:
space:
mode:
authorbasisbit <basisbit@b956fd51-792f-4845-bead-9b4dfca2ff2c>2015-08-23 03:15:31 +0000
committerbasisbit <basisbit@b956fd51-792f-4845-bead-9b4dfca2ff2c>2015-08-23 03:15:31 +0000
commitcb50c854d301fffedc760a24ff363c69c41e3ad8 (patch)
tree96fb650ba4d161ecdce253f8be8545c06342fad7 /src/menu/UMenuButton.pas
parentbd6edd76cbe2cdee409c050eee28292f0f1cbdb2 (diff)
downloadusdx-cb50c854d301fffedc760a24ff363c69c41e3ad8.tar.gz
usdx-cb50c854d301fffedc760a24ff363c69c41e3ad8.tar.xz
usdx-cb50c854d301fffedc760a24ff363c69c41e3ad8.zip
* limit to 60 FPS - be more energy friendly and laptop-friendly ;-)
* do not return any button-mouse-over-area when the mouse cursor is hidden - fixes certain access violations on windows git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3123 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--src/menu/UMenuButton.pas68
1 files changed, 36 insertions, 32 deletions
diff --git a/src/menu/UMenuButton.pas b/src/menu/UMenuButton.pas
index 868a86f3..509c140b 100644
--- a/src/menu/UMenuButton.pas
+++ b/src/menu/UMenuButton.pas
@@ -125,6 +125,7 @@ implementation
uses
SysUtils,
+ UDisplay,
UDrawTexture;
procedure TButton.SetX(Value: real);
@@ -534,42 +535,45 @@ end;
function TButton.GetMouseOverArea: TMouseOverRect;
begin
- if (FadeTex.TexNum = 0) then
- begin
- Result.X := Texture.X;
- Result.Y := Texture.Y;
- Result.W := Texture.W;
- Result.H := Texture.H;
- end
- else
+ if (Display.Cursor_HiddenByScreen = false) then
begin
- case FadeTexPos of
- 0: begin // fade tex on top
- Result.X := Texture.X;
- Result.Y := FadeTex.Y;
- Result.W := Texture.W;
- Result.H := FadeTex.H + Texture.H;
- end;
+ if (FadeTex.TexNum = 0) then
+ begin
+ Result.X := Texture.X;
+ Result.Y := Texture.Y;
+ Result.W := Texture.W;
+ Result.H := Texture.H;
+ end
+ else
+ begin
+ case FadeTexPos of
+ 0: begin // fade tex on top
+ Result.X := Texture.X;
+ Result.Y := FadeTex.Y;
+ Result.W := Texture.W;
+ Result.H := FadeTex.H + Texture.H;
+ end;
- 1: begin // fade tex on left side
- Result.X := FadeTex.X;
- Result.Y := Texture.Y;
- Result.W := FadeTex.W + Texture.W;
- Result.H := Texture.H;
- end;
+ 1: begin // fade tex on left side
+ Result.X := FadeTex.X;
+ Result.Y := Texture.Y;
+ Result.W := FadeTex.W + Texture.W;
+ Result.H := Texture.H;
+ end;
- 2: begin // fade tex on bottom
- Result.X := Texture.X;
- Result.Y := Texture.Y;
- Result.W := Texture.W;
- Result.H := FadeTex.H + Texture.H;
- end;
+ 2: begin // fade tex on bottom
+ Result.X := Texture.X;
+ Result.Y := Texture.Y;
+ Result.W := Texture.W;
+ Result.H := FadeTex.H + Texture.H;
+ end;
- 3: begin // fade tex on right side
- Result.X := Texture.X;
- Result.Y := Texture.Y;
- Result.W := FadeTex.W + Texture.W;
- Result.H := Texture.H;
+ 3: begin // fade tex on right side
+ Result.X := Texture.X;
+ Result.Y := Texture.Y;
+ Result.W := FadeTex.W + Texture.W;
+ Result.H := Texture.H;
+ end;
end;
end;
end;