From 0066af4bd0eb49a3b6e4a9f5f60484cdd89f81a0 Mon Sep 17 00:00:00 2001 From: Greenlamp Date: Thu, 16 May 2024 12:34:04 +0200 Subject: [PATCH] fix the truncate of the default controller name --- src/ui/settings/settings-gamepad-ui-handler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/settings/settings-gamepad-ui-handler.ts b/src/ui/settings/settings-gamepad-ui-handler.ts index 674cdda1cfe..fed424a2da3 100644 --- a/src/ui/settings/settings-gamepad-ui-handler.ts +++ b/src/ui/settings/settings-gamepad-ui-handler.ts @@ -8,6 +8,7 @@ import pad_unlicensedSNES from "#app/configs/pad_unlicensedSNES"; import {InterfaceConfig} from "#app/inputs-controller"; import AbstractSettingsUiUiHandler from "#app/ui/settings/abstract-settings-ui-handler"; import {Device} from "#app/enums/devices"; +import {truncateString} from "#app/utils"; /** * Class representing the settings UI handler for gamepads. @@ -133,7 +134,7 @@ export default class SettingsGamepadUiHandler extends AbstractSettingsUiUiHandle // Update the text of the first option label under the current setting to the name of the chosen gamepad, // truncating the name to 30 characters if necessary. - this.layout[_key].optionValueLabels[index][0].setText(this.scene.inputController.selectedDevice[Device.GAMEPAD], 30); + this.layout[_key].optionValueLabels[index][0].setText(truncateString(this.scene.inputController.selectedDevice[Device.GAMEPAD], 30)); } } }