-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add type hints across code base to improve consistency, performance, readability and compiler ability to detect errors. - Use PackedVector2Array for consistency and performance. - Convert floating string literals into documentation comments. - See: https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_documentation_comments.html Also: - Remove some missed normal texture code from test functions - Fix normal range property editor not used in inspector - Remove deprecated property "end" in normal_range.gd - Remove __new() workarounds - Mark suspicious code with FIXME
- Loading branch information
Showing
29 changed files
with
1,375 additions
and
1,442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,46 @@ | ||
extends EditorInspectorPlugin | ||
|
||
var properties = [] | ||
var control = null | ||
var control: Control = null | ||
|
||
func can_handle(object): | ||
|
||
func _can_handle(object: Object) -> bool: | ||
#if object is SS2D_NormalRange: | ||
# return true | ||
if object is SS2D_NormalRange: | ||
#Connect | ||
var parms = [object] | ||
if object.is_connected("changed",Callable(self,"_changed"))==false: | ||
object.connect("changed",Callable(self,"_changed").bind(parms)) | ||
if not object.is_connected("changed", self._changed): | ||
object.connect("changed", self._changed.bind(parms)) | ||
return true | ||
else: | ||
#Disconnect | ||
if control != null: | ||
control = null | ||
|
||
if object.has_signal("changed"): | ||
if object.is_connected("changed",Callable(self,"_changed")): | ||
object.disconnect("changed",Callable(self,"_changed")) | ||
if object.is_connected("changed", self._changed): | ||
object.disconnect("changed", self._changed) | ||
pass | ||
|
||
return false | ||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready(): | ||
print("loaded...") | ||
pass # Replace with function body. | ||
|
||
func _changed(object): | ||
|
||
func _changed(_object) -> void: | ||
control._value_changed() | ||
pass | ||
|
||
func parse_property(object, type, path, hint, hint_text, usage): | ||
if path=="edgeRendering": | ||
|
||
func _parse_property( | ||
_object: Object, | ||
_type: Variant.Type, | ||
name: String, | ||
_hint_type: PropertyHint, | ||
_hint_string: String, | ||
_usage_flags: PropertyUsageFlags, | ||
_wide: bool | ||
) -> bool: | ||
if name == "edgeRendering": | ||
control = SS2D_NormalRangeEditorProperty.new() | ||
add_property_editor(" ", control) | ||
return true | ||
return false | ||
|
||
# Called every frame. 'delta' is the elapsed time since the previous frame. | ||
#func _process(delta): | ||
# pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.