diff options
author | Spartan322 <Megacake1234@gmail.com> | 2023-12-23 05:01:51 +0100 |
---|---|---|
committer | George L. Albany <Megacake1234@gmail.com> | 2023-12-24 04:52:36 +0100 |
commit | b6413251a866c76538869b84ed1c9b9852f7c507 (patch) | |
tree | 1b99c935438692bb2ebadeac412b990c82089b65 /game/src/Game/Autoload/Argument/ArgumentOption.gd | |
parent | 50b0b935b0bf0724f40b5140aca85d1830a8b1b3 (diff) |
Apply type hints to menu scripts
Diffstat (limited to 'game/src/Game/Autoload/Argument/ArgumentOption.gd')
-rw-r--r-- | game/src/Game/Autoload/Argument/ArgumentOption.gd | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/game/src/Game/Autoload/Argument/ArgumentOption.gd b/game/src/Game/Autoload/Argument/ArgumentOption.gd index f98b19c..a9b7000 100644 --- a/game/src/Game/Autoload/Argument/ArgumentOption.gd +++ b/game/src/Game/Autoload/Argument/ArgumentOption.gd @@ -17,10 +17,10 @@ extends Resource TYPE_COLOR: default_value = Color() _: default_value = null notify_property_list_changed() -var default_value +var default_value : Variant @export var description : String -func _init(_name = "", _type = TYPE_NIL, _description = "", default = null): +func _init(_name := "", _type := TYPE_NIL, _description := "", default : Variant = null) -> void: name = _name type = _type if default != null and typeof(default) == type: @@ -41,15 +41,17 @@ func get_type_string() -> StringName: TYPE_COLOR: return "color" return "<invalid type>" -func _get(property): +func _get(property : StringName) -> Variant: if property == "default_value": return default_value + return null -func _set(property, value): +func _set(property : StringName, value : Variant) -> bool: if property == "default_value": default_value = value return true + return false -func _get_property_list(): +func _get_property_list() -> Array[Dictionary]: var properties := [] properties.append({ |