Contains global variables accessible from everywhere.
    public static class ProjectSettings

Contains global variables accessible from everywhere. Use “ProjectSettings.get_setting(variable)”, “ProjectSettings.set_setting(variable,value)” or “ProjectSettings.has_setting(variable)” to access them. Variables stored in project.godot are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options.

Inheritance Chain

Static Methods

    public static void AddPropertyInfo(Dictionary hint)

Add a custom property info to a property. The dictionary must contain: name:String(the name of the property) and type:[int](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/int](see TYPE_* in [@GlobalScope]), and optionally hint:[int](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/int](see PROPERTY_HINT_* in [@GlobalScope]), hint_string:String.

Example:

[codeblock]

ProjectSettings.set(“category/property_name”, 0)

var property_info = {

“name”: “category/property_name”,

“type”: TYPE_INT,

“hint”: PROPERTY_HINT_ENUM,

“hint_string”: “one,two,three”

}

ProjectSettings.add_property_info(property_info)

[/codeblock]

    public static void Clear(string name)

Clear the whole configuration (not recommended, may break things).

    public static int GetOrder(string name)

Return the order of a configuration value (influences when saved to the config file).

    public static object GetSetting(string name)

    public static string GlobalizePath(string path)

Convert a localized path (res://) to a full native OS path.

    public static bool HasSetting(string name)

Return true if a configuration value is present.

    public static bool LoadResourcePack(string pack)

    public static string LocalizePath(string path)

Convert a path to a localized path (res:// path).

    public static bool PropertyCanRevert(string name)

    public static object PropertyGetRevert(string name)

    public static Error Save()

    public static Error SaveCustom(string file)

    public static void SetInitialValue(string name, object value)

    public static void SetOrder(string name, int position)

Set the order of a configuration value (influences when saved to the config file).

    public static void SetSetting(string name, object value)
Tags: