Skip to content

IPlayerSettings

namespace Griff.Runtime;
public interface IPlayerSettings

A system that keeps settings a player chooses for themselves, as the game keeps its own (volume, full screen, the offsets): they’re read back from SaveData as the game starts and written as they change, and a Slider or Toggle set to one shows and sets it. The Rhythm module keeps a player’s note speed this way, and the Visual Novels module how they like dialogue skipped and read on.

public abstract bool ApplySetting(GameSetting setting, float value)

Sets a setting this system keeps, from a slider or toggle; false if it keeps no such setting.

public abstract bool InOwnUnits(GameSetting setting)

True for a setting with units of its own (how many times as fast notes come), which is a slider’s value; the rest, from 0 to 1, fill it.

public abstract void LoadSettings(SaveData data)

Reads the settings saved earlier from data; those never saved are left as they are.

public abstract void SaveSettings(SaveData data, bool now)

Writes to data whichever settings changed since they were last written, each step; with now (as the game quits), also what it otherwise writes only now and then.

public abstract float? SettingValue(GameSetting setting)

The setting’s value as a slider or toggle shows it, or null if it isn’t one this system keeps.