mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 00:41:58 +00:00
Add player name opacity settings to UserSettings class
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user