HKI Core
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HKI.Core.Settings.SettingsSystem Class Reference

This system loades, saves and stores settings. In addition to that it sets settings in the engine for all settings that are used and that are Unity-Settings. It can be extended with custom settings but a change function needs to be register for applying changes at runtime. More...

Inheritance diagram for HKI.Core.Settings.SettingsSystem:
HKI.Core.Variables.Container HKI.Core.Init.IInit HKI.Core.Variables.HKIVar HKI.Core.Variables.ISaveAndLoadable

Public Member Functions

void Init ()
 The init function will load and tries to activate all settings. Some settings can't be set in the editor so it will make sure if it's in editor or runtime mode. More...
 
void Save ()
 Saves all settings (custom settings that are given to this system too) into a XML file. More...
 
- Public Member Functions inherited from HKI.Core.Variables.Container
override void Save (XmlNode parentNode)
 
override void Load (XmlNode node)
 
override string ToString ()
 
HKIVar GetHKIVarByName (string varName)
 
HKIVar GetHKIVarByNameWithoutSpace (string varName)
 
HKIVar GetHKIVarByIndex (int index)
 

Private Member Functions

void OnDisable ()
 
void GetReferences ()
 This helper function gets all references to Unity standard settings. For a list look into the class description. More...
 
GetVar< T > (string variableName)
 Search function for a variable, so it can be used to find the references. More...
 
bool Load ()
 This function loads the saved settings from a XML file and tries to activate them. More...
 
void CreateConfigFile ()
 This function will create the config file. This could be the case on the first time the game starts after installation. It fills the file with the default settings that are set in the editor and activate them. More...
 
void ActivateAllSettings ()
 This function activates all settings. More...
 
void LinkStandardSettingsToOnChangeFunctions ()
 This function links the change functions to the standard settings variables. More...
 
void UnLinkStandardSettingsFromOnChangeFunctions ()
 This will unlink the change functions from standard settings variables. More...
 
void LogInfoForNotSetableInEditor (HKIVar variable)
 
void ChangeResolution ()
 This function will set the resolution. More...
 
void ChangeQuality ()
 This function will set the quality. More...
 
void ChangeFrameRateAndVSyncMode ()
 This function will analyse the FrameRateAndVSyncMode value and set the frame rate and vsync accordingly. More...
 
void ChangeFrameRateAndVSyncMode (int fr, int vsync)
 This function will set the frame rate and vsync. More...
 
void ChangeAudio ()
 This function will set all audio volume settings. More...
 

Private Attributes

bool isEditor = false
 
bool changeFunctionCallbacksLinked = false
 
string configFilePath = ""
 
string ConfigFilename = "config.config"
 
string EditorPath = ""
 
string runtimePath = ""
 
bool WarningsEnabled = true
 
bool UseTargetFrameRate = true
 
IntegerWidthHeight Resolution = null
 
Boolean Fullscreen = null
 
Integer RefreshRate = null
 
String Quality = null
 
FrameRateAndVSyncMode FRAVSM = null
 
AntiAliasingMode AAM = null
 
Language TextLanguage = null
 
Language AudioLanguage = null
 
FloatMinMax MasterVolume = null
 
FloatMinMax MusicVolume = null
 
FloatMinMax AmbientVolume = null
 
FloatMinMax FxVolume = null
 
FloatMinMax UiFxVolume = null
 
FloatMinMax VoicesVolume = null
 
AudioMixer AudioMixer = null
 

Additional Inherited Members

- Protected Member Functions inherited from HKI.Core.Variables.HKIVar
void RaiseOnValueChangedCallback ()
 
- Properties inherited from HKI.Core.Variables.Container
int Count [get]
 
- Events inherited from HKI.Core.Variables.HKIVar
System.Action OnValueChanged
 

Detailed Description

This system loades, saves and stores settings. In addition to that it sets settings in the engine for all settings that are used and that are Unity-Settings. It can be extended with custom settings but a change function needs to be register for applying changes at runtime.

Supported standard settings:

Definition at line 33 of file SettingsSystem.cs.

Member Function Documentation

◆ ActivateAllSettings()

void HKI.Core.Settings.SettingsSystem.ActivateAllSettings ( )
inlineprivate

This function activates all settings.

Definition at line 199 of file SettingsSystem.cs.

◆ ChangeAudio()

void HKI.Core.Settings.SettingsSystem.ChangeAudio ( )
inlineprivate

This function will set all audio volume settings.

Definition at line 456 of file SettingsSystem.cs.

◆ ChangeFrameRateAndVSyncMode() [1/2]

void HKI.Core.Settings.SettingsSystem.ChangeFrameRateAndVSyncMode ( )
inlineprivate

This function will analyse the FrameRateAndVSyncMode value and set the frame rate and vsync accordingly.

Definition at line 412 of file SettingsSystem.cs.

◆ ChangeFrameRateAndVSyncMode() [2/2]

void HKI.Core.Settings.SettingsSystem.ChangeFrameRateAndVSyncMode ( int  fr,
int  vsync 
)
inlineprivate

This function will set the frame rate and vsync.

Definition at line 447 of file SettingsSystem.cs.

◆ ChangeQuality()

void HKI.Core.Settings.SettingsSystem.ChangeQuality ( )
inlineprivate

This function will set the quality.

Definition at line 392 of file SettingsSystem.cs.

◆ ChangeResolution()

void HKI.Core.Settings.SettingsSystem.ChangeResolution ( )
inlineprivate

This function will set the resolution.

Definition at line 378 of file SettingsSystem.cs.

◆ CreateConfigFile()

void HKI.Core.Settings.SettingsSystem.CreateConfigFile ( )
inlineprivate

This function will create the config file. This could be the case on the first time the game starts after installation. It fills the file with the default settings that are set in the editor and activate them.

Definition at line 190 of file SettingsSystem.cs.

◆ GetReferences()

void HKI.Core.Settings.SettingsSystem.GetReferences ( )
inlineprivate

This helper function gets all references to Unity standard settings. For a list look into the class description.

Definition at line 120 of file SettingsSystem.cs.

◆ GetVar< T >()

T HKI.Core.Settings.SettingsSystem.GetVar< T > ( string  variableName)
inlineprivate

Search function for a variable, so it can be used to find the references.

Template Parameters
T
Parameters
variableName
Returns
Type Constraints
T :HKIVar 

Definition at line 144 of file SettingsSystem.cs.

◆ Init()

void HKI.Core.Settings.SettingsSystem.Init ( )
inline

The init function will load and tries to activate all settings. Some settings can't be set in the editor so it will make sure if it's in editor or runtime mode.

Implements HKI.Core.Init.IInit.

Definition at line 70 of file SettingsSystem.cs.

◆ LinkStandardSettingsToOnChangeFunctions()

void HKI.Core.Settings.SettingsSystem.LinkStandardSettingsToOnChangeFunctions ( )
inlineprivate

This function links the change functions to the standard settings variables.

Definition at line 210 of file SettingsSystem.cs.

◆ Load()

bool HKI.Core.Settings.SettingsSystem.Load ( )
inlineprivate

This function loads the saved settings from a XML file and tries to activate them.

Returns

Definition at line 161 of file SettingsSystem.cs.

◆ LogInfoForNotSetableInEditor()

void HKI.Core.Settings.SettingsSystem.LogInfoForNotSetableInEditor ( HKIVar  variable)
inlineprivate

Definition at line 369 of file SettingsSystem.cs.

◆ OnDisable()

void HKI.Core.Settings.SettingsSystem.OnDisable ( )
inlineprivate

Definition at line 96 of file SettingsSystem.cs.

◆ Save()

void HKI.Core.Settings.SettingsSystem.Save ( )
inline

Saves all settings (custom settings that are given to this system too) into a XML file.

Definition at line 106 of file SettingsSystem.cs.

◆ UnLinkStandardSettingsFromOnChangeFunctions()

void HKI.Core.Settings.SettingsSystem.UnLinkStandardSettingsFromOnChangeFunctions ( )
inlineprivate

This will unlink the change functions from standard settings variables.

Definition at line 302 of file SettingsSystem.cs.

Member Data Documentation

◆ AAM

AntiAliasingMode HKI.Core.Settings.SettingsSystem.AAM = null
private

Definition at line 54 of file SettingsSystem.cs.

◆ AmbientVolume

FloatMinMax HKI.Core.Settings.SettingsSystem.AmbientVolume = null
private

Definition at line 59 of file SettingsSystem.cs.

◆ AudioLanguage

Language HKI.Core.Settings.SettingsSystem.AudioLanguage = null
private

Definition at line 56 of file SettingsSystem.cs.

◆ AudioMixer

AudioMixer HKI.Core.Settings.SettingsSystem.AudioMixer = null
private

Definition at line 64 of file SettingsSystem.cs.

◆ changeFunctionCallbacksLinked

bool HKI.Core.Settings.SettingsSystem.changeFunctionCallbacksLinked = false
private

Definition at line 37 of file SettingsSystem.cs.

◆ ConfigFilename

string HKI.Core.Settings.SettingsSystem.ConfigFilename = "config.config"
private

Definition at line 41 of file SettingsSystem.cs.

◆ configFilePath

string HKI.Core.Settings.SettingsSystem.configFilePath = ""
private

Definition at line 39 of file SettingsSystem.cs.

◆ EditorPath

string HKI.Core.Settings.SettingsSystem.EditorPath = ""
private

Definition at line 42 of file SettingsSystem.cs.

◆ FRAVSM

FrameRateAndVSyncMode HKI.Core.Settings.SettingsSystem.FRAVSM = null
private

Definition at line 53 of file SettingsSystem.cs.

◆ Fullscreen

Boolean HKI.Core.Settings.SettingsSystem.Fullscreen = null
private

Definition at line 50 of file SettingsSystem.cs.

◆ FxVolume

FloatMinMax HKI.Core.Settings.SettingsSystem.FxVolume = null
private

Definition at line 60 of file SettingsSystem.cs.

◆ isEditor

bool HKI.Core.Settings.SettingsSystem.isEditor = false
private

Definition at line 36 of file SettingsSystem.cs.

◆ MasterVolume

FloatMinMax HKI.Core.Settings.SettingsSystem.MasterVolume = null
private

Definition at line 57 of file SettingsSystem.cs.

◆ MusicVolume

FloatMinMax HKI.Core.Settings.SettingsSystem.MusicVolume = null
private

Definition at line 58 of file SettingsSystem.cs.

◆ Quality

String HKI.Core.Settings.SettingsSystem.Quality = null
private

Definition at line 52 of file SettingsSystem.cs.

◆ RefreshRate

Integer HKI.Core.Settings.SettingsSystem.RefreshRate = null
private

Definition at line 51 of file SettingsSystem.cs.

◆ Resolution

IntegerWidthHeight HKI.Core.Settings.SettingsSystem.Resolution = null
private

Definition at line 49 of file SettingsSystem.cs.

◆ runtimePath

string HKI.Core.Settings.SettingsSystem.runtimePath = ""
private

Definition at line 43 of file SettingsSystem.cs.

◆ TextLanguage

Language HKI.Core.Settings.SettingsSystem.TextLanguage = null
private

Definition at line 55 of file SettingsSystem.cs.

◆ UiFxVolume

FloatMinMax HKI.Core.Settings.SettingsSystem.UiFxVolume = null
private

Definition at line 61 of file SettingsSystem.cs.

◆ UseTargetFrameRate

bool HKI.Core.Settings.SettingsSystem.UseTargetFrameRate = true
private

Definition at line 47 of file SettingsSystem.cs.

◆ VoicesVolume

FloatMinMax HKI.Core.Settings.SettingsSystem.VoicesVolume = null
private

Definition at line 62 of file SettingsSystem.cs.

◆ WarningsEnabled

bool HKI.Core.Settings.SettingsSystem.WarningsEnabled = true
private

Definition at line 45 of file SettingsSystem.cs.


The documentation for this class was generated from the following file: