diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/base/UMain.pas | 2 | ||||
-rw-r--r-- | src/menu/UDisplay.pas | 3 | ||||
-rw-r--r-- | src/menu/UMenuButton.pas | 68 |
3 files changed, 39 insertions, 34 deletions
diff --git a/src/base/UMain.pas b/src/base/UMain.pas index 39f52c4d..6c2ab813 100644 --- a/src/base/UMain.pas +++ b/src/base/UMain.pas @@ -350,7 +350,7 @@ end; procedure MainLoop; const - MAX_FPS = 100; + MAX_FPS = 60; var Delay: integer; TicksCurrent: cardinal; diff --git a/src/menu/UDisplay.pas b/src/menu/UDisplay.pas index 6191fb68..9a196a74 100644 --- a/src/menu/UDisplay.pas +++ b/src/menu/UDisplay.pas @@ -72,7 +72,6 @@ type Cursor_X: double; Cursor_Y: double; Cursor_Pressed: boolean; - Cursor_HiddenByScreen: boolean; // hides software cursor and deactivate auto fade in // used for cursor fade out when there is no movement Cursor_Visible: boolean; @@ -84,6 +83,8 @@ type { called by MoveCursor and OnMouseButton to update last move and start fade in } procedure UpdateCursorFade; public + Cursor_HiddenByScreen: boolean; // hides software cursor and deactivate auto fade in, must be public for access in UMenuButton + NextScreen: PMenu; CurrentScreen: PMenu; 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; |