Preferences

Group
player
Methods
5
Fields
None

Getting one

client:getPreferences()

Methods

MethodReturnsDescription
getRememberedUsername()stringThe username the login screen remembers ("" when none is).
setRememberedUsername(string)()Set the username the login screen remembers: the client's own setting's text, written in place; nothing is saved now (the client saves it w…
getSoundEffectVolume()numberThe sound effect volume, 0 (muted) to 127 (SoundEffectVolume): the client's own 0..100 setting on that scale (its five steps 0, 25, 50, 7…
setSoundEffectVolume(number)()Set the sound effect volume (0..127, as getSoundEffectVolume): the client plays its next sound effects at it; nothing is saved and the se…
equals(any)booleanWhether other equals this Preferences, as == answers it (false for a value of another class).

Returned by

MethodReturnsDescription
Client.getPreferencesPreferencesThe client's preferences: the remembered username and the sound effect volume.

Method details

setRememberedUsername

setRememberedUsername: (Preferences, string) -> ()

Set the username the login screen remembers: the client's own setting's text, written in place; nothing is saved now (the client saves it with its preferences) and the login screen's field is not changed (client:setUsername(name) does that). Game thread only; raises for text longer than 255 bytes or holding a NUL.

getSoundEffectVolume

getSoundEffectVolume: (Preferences) -> number

The sound effect volume, 0 (muted) to 127 (SoundEffectVolume): the client's own 0..100 setting on that scale (its five steps 0, 25, 50, 75 and 100 are 0, 32, 64, 96 and 127).

setSoundEffectVolume

setSoundEffectVolume: (Preferences, number) -> ()

Set the sound effect volume (0..127, as getSoundEffectVolume): the client plays its next sound effects at it; nothing is saved and the settings menu's slider is not moved. Game thread only; raises outside 0..127.

equals

equals: (Preferences, any) -> boolean

Whether other equals this Preferences, as == answers it (false for a value of another class).