Static Methodmigueldeicaza.swiftgodot 0.45.0SwiftGodot
setRestartIfChanged(name:restart:)
Sets whether a setting requires restarting the editor to properly take effect.
ProjectSettings.swift:454static func setRestartIfChanged(name: String, restart: Bool)
Other members in extension
Type members
static func addPropertyInfo(hint: GDictionary
) Adds a custom property info to a property. The dictionary must contain:
static func clear(name: String
) Clears the whole configuration (not recommended, may break things).
static func createFrom(nativeHandle: UnsafeMutableRawPointer
) -> ProjectSettings Public because we want to allow the embed API to call this, but dont want to make it obvious in the constructors
static func getGlobalClassList(
) -> VariantCollection<GDictionary> Returns an
GArray
of registered global classes. Each global class is represented as aGDictionary
that contains the following entries:static func getOrder(name: String
) -> Int32 Returns the order of a configuration value (influences when saved to the config file).
static func getSetting(name: String, defaultValue: Variant
) -> Variant Returns the value of the setting identified by
name
. If the setting doesn’t exist anddefaultValue
is specified, the value ofdefaultValue
is returned. Otherwise,null
is returned.static func getSettingWithOverride(name: StringName
) -> Variant Similar to
getSetting(name:defaultValue:)
, but applies feature tag overrides if any exists and is valid.static func globalizePath(String
) -> String Returns the absolute, native OS path corresponding to the localized
path
(starting withres://
oruser://
). The returned path will vary depending on the operating system and user preferences. See File paths in Godot projects to see what those paths convert to. See alsolocalizePath(_:)
.static func hasSetting(name: String
) -> Bool Returns
true
if a configuration value is present.static func loadResourcePack(String, replaceFiles: Bool, offset: Int32
) -> Bool Loads the contents of the .pck or .zip file specified by
pack
into the resource filesystem (res://
). Returnstrue
on success.static func localizePath(String
) -> String Returns the localized path (starting with
res://
) corresponding to the absolute, native OSpath
. See alsoglobalizePath(_:)
.static func save(
) -> GodotError Saves the configuration to the
project.godot
file.static func saveCustom(file: String
) -> GodotError Saves the configuration to a custom file. The file extension must be
.godot
(to save in text-basedConfigFile
format) or.binary
(to save in binary format). You can also saveoverride.cfg
file, which is also text, but can be used in exported projects unlike other formats.static func setAsBasic(name: String, basic: Bool
) Defines if the specified setting is considered basic or advanced. Basic settings will always be shown in the project settings. Advanced settings will only be shown if the user enables the “Advanced Settings” option.
static func setAsInternal(name: String, internal: Bool
) Defines if the specified setting is considered internal. An internal setting won’t show up in the Project Settings dialog. This is mostly useful for addons that need to store their own internal settings without exposing them directly to the user.
static func setInitialValue(name: String, value: Variant
) Sets the specified setting’s initial value. This is the value the setting reverts to.
static func setOrder(name: String, position: Int32
) Sets the order of a configuration value (influences when saved to the config file).
static func setSetting(name: String, value: Variant
) Sets the value of a setting.
class var godotClassName: StringName
Instance members
var settingsChanged: SimpleSignal
Emitted when any setting is changed, up to once per process frame.