Skip to content

Commit

Permalink
[plugin|licenses] Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Sep 25, 2023
1 parent 873e477 commit 21f33f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions addons/licenses/internal/components_tree.gd
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func _add_tree_item(component: Component, idx: int, parent: TreeItem) -> TreeIte
var tooltip = component.name
var comp_warnings: PackedStringArray = component.get_warnings()
if comp_warnings.size() != 0:
tooltip += "\n- " + "\n - ".join(comp_warnings)
tooltip += "\n- " + "\n- ".join(comp_warnings)
item.set_icon(0, self.get_theme_icon("NodeWarning", "EditorIcons"))
item.set_tooltip_text(0, tooltip)
return item
Expand All @@ -98,7 +98,6 @@ func reload() -> void:
var readonly_idx: int = 0
# count current added custom components
var idx: int = 0
var component_selected: bool = false

while idx < len(self._components) or readonly_idx < len(self._readonly_components):
var component: Component = null
Expand All @@ -118,7 +117,6 @@ func reload() -> void:

var item: TreeItem = self._add_component(component, category_cache, root, cur_idx)
if component == self._component_detail.get_component():
component_selected = true
self.scroll_to_item(item)
item.select(0)

Expand Down
4 changes: 2 additions & 2 deletions addons/licenses/internal/handler/object.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ func _init(tree_: ComponentDetailTree, item_: TreeItem, value_: Variant, propert
# ignore private variables and ignore non supported types and already added items
if prop["name"].begins_with("_"):
continue
self.tree._add_item(self.item, self.value.get(prop["name"]), prop)
self.tree._add_item(self.item, (self.value as Object).get(prop["name"]), prop)

static func can_handle(property: Dictionary) -> bool:
return property["type"] == TYPE_OBJECT and property.get("class_name", "") != "Script"

func child_edited(item: TreeItem) -> void:
var child = item.get_meta("handler")
self.value.set(child.property["name"], child.value)
(self.value as Object).set(child.property["name"], child.value)
self.tree._on_item_edited(self.item)
2 changes: 1 addition & 1 deletion addons/licenses/internal/licenses.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func reload() -> void:
res.components.sort_custom(Licenses.new().compare_components_ascending)
self._components_tree.set_components(res.components)

func _update_set_license_filepath_button():
func _update_set_license_filepath_button() -> void:
if Licenses.get_license_data_filepath() == self._license_file_edit.text:
self._set_license_filepath_button.icon = self.get_theme_icon("ImportCheck", "EditorIcons")
self._set_license_filepath_button.tooltip_text = "Selected file is set as the project license file."
Expand Down

0 comments on commit 21f33f2

Please sign in to comment.