Fixed mouse cursor in menus

This commit is contained in:
tibz 2026-08-15 12:55:20 -05:00
parent 4835b187e1
commit 55bc9c11bf

View File

@ -157,28 +157,22 @@ namespace Johnmagotchi.GameContent.Screens.Menu
private void HandleMouseCursor() private void HandleMouseCursor()
{ {
int x = screenManager.inputs.mouseInput.x; int x = screenManager.inputs.mouseInput.x;
int y = screenManager.inputs.mouseInput.y; int y = screenManager.inputs.mouseInput.y - ScreenManager.getScaledIntY(2800); // subtract 2800 since y axis is negative, you want to allign with top bound vs bottom bound
TibzLog.Debug("Mouse y - " + y); TibzLog.Debug("Mouse y - " + y);
TibzLog.Debug("top bounds??? - " + ScreenManager.getScaledIntY( yPos - yDrawOffset));
// screenManager.getScaledIntX(xPos - xDrawOffset + textOffsetX),
//TODO STILL WORKING O{N THIS 7/18/26
//screenManager.GetScaledRectangle(xPos - xDrawOffset, yPos - yOffset, 6400, 2800); //screenManager.GetScaledRectangle(xPos - xDrawOffset, yPos - yOffset, 6400, 2800);
int yOffset = yDrawOffset; int yOffset = yDrawOffset;
for (int i = CurrentOptions.Length; i > 0; i--) for (int i = CurrentOptions.Length; i > 0; i--)
{ {
if (y < ScreenManager.getScaledIntY(yPos - yOffset)) if (y <= ScreenManager.getScaledIntY(yPos - yOffset))
{ {
SelectedIndex = i-1; SelectedIndex = i-1;
TibzLog.Debug("index set! " + i);
} }
yOffset += 2800; yOffset += 2800;
} }
//ToDo = deselect on X out of bounds and Y out of bounds
} }
} }
} }