fix the truncate of the default controller name

This commit is contained in:
Greenlamp 2024-05-16 12:34:04 +02:00
parent 8491f0b1ad
commit 0066af4bd0

View File

@ -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));
}
}
}