aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Autoload/Argument/ArgumentOption.gd
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-12-24 19:23:18 +0100
committer GitHub <noreply@github.com>2023-12-24 19:23:18 +0100
commitd26c990d9a5596a3ef3b32ba1cb0f99950cd6d34 (patch)
tree1b99c935438692bb2ebadeac412b990c82089b65 /game/src/Game/Autoload/Argument/ArgumentOption.gd
parent50b0b935b0bf0724f40b5140aca85d1830a8b1b3 (diff)
parentb6413251a866c76538869b84ed1c9b9852f7c507 (diff)
Merge pull request #178 from Spartan322/add-menu-type-hints
Diffstat (limited to 'game/src/Game/Autoload/Argument/ArgumentOption.gd')
-rw-r--r--game/src/Game/Autoload/Argument/ArgumentOption.gd12
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({