From b6413251a866c76538869b84ed1c9b9852f7c507 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Fri, 22 Dec 2023 23:01:51 -0500 Subject: Apply type hints to menu scripts --- game/src/Game/Autoload/Argument/ArgumentOption.gd | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'game/src/Game/Autoload/Argument/ArgumentOption.gd') 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 "" -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({ -- cgit v1.2.3-56-ga3b1