Add player name opacity settings to UserSettings class

This commit is contained in:
bijx
2026-03-17 02:00:35 -04:00
parent 3366429f9c
commit c1b68c235d
+13
View File
@@ -237,4 +237,17 @@ export class UserSettings {
setSoundEffectsVolume(volume: number): void {
this.setFloat("settings.soundEffectsVolume", volume);
}
playerNameOpacity(): number {
const opacity = Math.round(
this.getFloat("settings.playerNameOpacity", 100),
);
if (!Number.isFinite(opacity)) return 100;
return Math.max(0, Math.min(100, opacity));
}
setPlayerNameOpacity(opacity: number): void {
const clampedOpacity = Math.max(0, Math.min(100, Math.round(opacity)));
this.setFloat("settings.playerNameOpacity", clampedOpacity);
}
}