Options - Ellpeck/TinyLifeExampleMod Wiki

Tiny Life


Options Class

The game's options, which are displayed in the TinyLife.Uis.OptionsMenu.Initialize(MLEM.Ui.UiSystem,System.Boolean,System.Boolean) menu and saved to disk

public class Options : MLEM.Misc.GenericDataHolder

Inheritance System.Object 🡒 MLEM.Misc.GenericDataHolder 🡒 Options


Options.AutoSaveIntervalSeconds Field

The auto-save interval in seconds.
Note that this value should be set to 30, 60, 180, 300 or 600, as otherwise, the options menu will display it incorrectly.

public int AutoSaveIntervalSeconds;

Field Value


Options.BrightnessIncrease Field

A percentage that the game's world's brightness is increased by, mainly intended for users with darker screens

public float BrightnessIncrease;

Field Value


Options.CameraRotation Field

The game's camera rotation.
To use this value effectively, you can use ToVisualY(Vector2), ApplyCameraRotation(Vector2, bool, Nullable<Direction2>) and ApplyInverseCameraRotation(Vector2, Nullable<Direction2>).
When changing this value, OnCameraRotationChanged(Direction2, Direction2) should be called for the game's Map.

public Direction2 CameraRotation;

Field Value


Options.DisplayedHints Field

The InGameHint objects that have already been displayed

public readonly HashSet<InGameHint> DisplayedHints;

Field Value


Options.Fullscreen Field

Whether the game is currently in fullscreen mode

public bool Fullscreen;

Field Value


Options.GameSpeeds Field

An array of all defined GameSpeed values

public static readonly GameSpeed[] GameSpeeds;

Field Value


Options.HideHangingObjects Field

Whether hanging objects should be hidden in the world if walls are down.
This property is automatically evaluated in Draw(GameTime, SpriteBatch, Vector2, Nullable<Color>).

public bool HideHangingObjects;

Field Value


Options.Keybinds Field

An array that contains all of the fields of type MLEM.Input.Keybind in the Options class

public static readonly FieldInfo[] Keybinds;

Field Value


Options.KeyboardLighting Field

Whether keyboard lighting should be enabled.
This setting defaults to false, but can be enabled regardless of whether keyboard lighting is supported by the user's devices.

public bool KeyboardLighting;

Field Value


Options.Language Field

The currently selected language's language code.
Determines the language used by Localization.

public string Language;

Field Value


Options.SoundVolume Field

The current sound volume as a percentage, ranging from 0 to 1

public float SoundVolume;

Field Value


Options.SpeechVolume Field

The volume of speech sounds, used by Speak(SpeakStyle, float, float).
Note that the speech sound volume is still multiplied with the sound master volume SoundVolume.

public float SpeechVolume;

Field Value


Options.UiScale Field

A modifier that is applied to the game's MLEM.Ui.UiSystem's MLEM.Ui.UiSystem.GlobalScale

public float UiScale;

Field Value


Options.VSync Field

Whether vertical synchronization is currently turned on

public bool VSync;

Field Value


Options.WallDisplays Field

An array of all defined WallDisplay values

public static readonly WallDisplay[] WallDisplays;

Field Value


Options.WorldSoundVolume Field

The volume of in-world sounds, used by PlaySound(SoundEffect, Vector2, float, float, bool, bool) and its overloads.
Note that the world sound volume is still multiplied with the sound master volume SoundVolume.

public float WorldSoundVolume;

Field Value



Options.Instance Property

The static singleton instance of Options

public static TinyLife.Options Instance { get; set; }

Property Value


Options.WallMode Property

The currently selected WallMode.
Note that this value does not always return the wall mode that has been selected by the user:
If Mode is SelectHousehold, Roofs is returned.
If the CurrentTool overrides ForceWallsUp(), that value is returned.

public TinyLife.WallDisplay WallMode { get; set; }

Property Value



Options.Apply() Method

Applies the currently selected options of this instance to the game

public void Apply();

Options.Save() Method

Saves the options to the default options file path

public void Save();