From 4785d6b8490484acc64eaa22a8dc2670ecfc51c3 Mon Sep 17 00:00:00 2001 From: Greenlamp Date: Sun, 19 May 2024 10:26:59 +0200 Subject: [PATCH] fix the cursor glitch --- src/ui/settings/abstract-settings-ui-handler.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ui/settings/abstract-settings-ui-handler.ts b/src/ui/settings/abstract-settings-ui-handler.ts index e75b6fc95f6..c810a095cc9 100644 --- a/src/ui/settings/abstract-settings-ui-handler.ts +++ b/src/ui/settings/abstract-settings-ui-handler.ts @@ -373,6 +373,7 @@ export default abstract class AbstractSettingsUiUiHandler extends UiHandler { // Make the settings container visible to the user. this.settingsContainer.setVisible(true); // Reset the scroll cursor to the top of the settings container. + this.setCursor(0); this.setScrollCursor(0); // Move the settings container to the end of the UI stack to ensure it is displayed on top. @@ -404,12 +405,6 @@ export default abstract class AbstractSettingsUiUiHandler extends UiHandler { // Extract the type of the gamepad from the active configuration. const configType = activeConfig.padType; - // If a cursor object exists, destroy it to clean up previous UI states. - this.cursorObj?.destroy(); - // Reset the cursor object and scroll cursor to ensure they are re-initialized correctly. - this.cursorObj = null; - this.scrollCursor = null; - // Retrieve the layout settings based on the type of the gamepad. const layout = this.layout[configType]; // Update the main controller with configuration details from the selected layout.