From d8bcc2df3f742fb72cc6271cbdced2af86b4c152 Mon Sep 17 00:00:00 2001 From: Flairieve Date: Sun, 4 Aug 2019 19:16:14 -0500 Subject: [PATCH] Removed self on a lot of lines --- addons/graphics_editor/CanvasOutline.gd | 2 +- addons/graphics_editor/MenuButtonExtended.gd | 4 ++-- addons/graphics_editor/PaintCanvas.gd | 2 +- addons/graphics_editor/PaintCanvasChunk.gd | 6 +++--- addons/graphics_editor/PaintCanvasContainer.gd | 2 +- addons/graphics_editor/Settings.gd | 2 +- addons/graphics_editor/TextInfo.gd | 8 ++++---- addons/graphics_editor/ViewportContainer.gd | 4 ++-- addons/graphics_editor/VisualGrid.gd | 8 ++++---- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/addons/graphics_editor/CanvasOutline.gd b/addons/graphics_editor/CanvasOutline.gd index f379b82..c17d7ce 100644 --- a/addons/graphics_editor/CanvasOutline.gd +++ b/addons/graphics_editor/CanvasOutline.gd @@ -7,7 +7,7 @@ func _ready(): pass func _draw(): - draw_outline_box(self.rect_size, color, 3) + draw_outline_box(rect_size, color, 3) func draw_outline_box(size, color, width): #Top line diff --git a/addons/graphics_editor/MenuButtonExtended.gd b/addons/graphics_editor/MenuButtonExtended.gd index 0b6e0a7..06a31c4 100644 --- a/addons/graphics_editor/MenuButtonExtended.gd +++ b/addons/graphics_editor/MenuButtonExtended.gd @@ -1,11 +1,11 @@ tool extends MenuButton -var popup = self.get_popup() +var popup = get_popup() signal item_pressed func _ready(): popup.connect("id_pressed", self, "id_pressed") func id_pressed(id): - emit_signal("item_pressed", self.name, popup.get_item_text(id)) \ No newline at end of file + emit_signal("item_pressed", name, popup.get_item_text(id)) \ No newline at end of file diff --git a/addons/graphics_editor/PaintCanvas.gd b/addons/graphics_editor/PaintCanvas.gd index 0af8da9..a283b4b 100644 --- a/addons/graphics_editor/PaintCanvas.gd +++ b/addons/graphics_editor/PaintCanvas.gd @@ -73,7 +73,7 @@ func _ready(): func _process(delta): var mouse_position = get_local_mouse_position() - var rect = Rect2(Vector2(0, 0), self.rect_size) + var rect = Rect2(Vector2(0, 0), rect_size) mouse_in_region = rect.has_point(mouse_position) update() #if not Engine.editor_hint: diff --git a/addons/graphics_editor/PaintCanvasChunk.gd b/addons/graphics_editor/PaintCanvasChunk.gd index c135a3d..f2ec93b 100644 --- a/addons/graphics_editor/PaintCanvasChunk.gd +++ b/addons/graphics_editor/PaintCanvasChunk.gd @@ -5,7 +5,7 @@ var image = Image.new() var image_texture = ImageTexture.new() func _ready(): - self.mouse_filter = Control.MOUSE_FILTER_IGNORE + mouse_filter = Control.MOUSE_FILTER_IGNORE func setup(region_size): image.create(region_size, region_size, true, Image.FORMAT_RGBA8) @@ -21,7 +21,7 @@ func set_cell(x, y, color): update_chunk() func _on_VisibilityNotifier2D_screen_entered(): - self.visible = true + visible = true func _on_VisibilityNotifier2D_screen_exited(): - self.visible = false \ No newline at end of file + visible = false \ No newline at end of file diff --git a/addons/graphics_editor/PaintCanvasContainer.gd b/addons/graphics_editor/PaintCanvasContainer.gd index 3e857cd..5057907 100644 --- a/addons/graphics_editor/PaintCanvasContainer.gd +++ b/addons/graphics_editor/PaintCanvasContainer.gd @@ -9,7 +9,7 @@ func _ready(): func _process(delta): var mouse_position = get_local_mouse_position() - var rect = Rect2(Vector2(0, 0), self.rect_size) + var rect = Rect2(Vector2(0, 0), rect_size) mouse_in_region = rect.has_point(mouse_position) func _on_PaintCanvasContainer_mouse_entered(): diff --git a/addons/graphics_editor/Settings.gd b/addons/graphics_editor/Settings.gd index c181c52..eb3b11b 100644 --- a/addons/graphics_editor/Settings.gd +++ b/addons/graphics_editor/Settings.gd @@ -26,4 +26,4 @@ func _on_CheckButton_toggled(button_pressed): canvas_outline.visible = button_pressed func _on_Ok_pressed(): - self.hide() + hide() diff --git a/addons/graphics_editor/TextInfo.gd b/addons/graphics_editor/TextInfo.gd index 1713902..bbaba0a 100644 --- a/addons/graphics_editor/TextInfo.gd +++ b/addons/graphics_editor/TextInfo.gd @@ -8,9 +8,9 @@ var size = 240 func add_text_info(text_name, custom_node = null): var last_text_info_child = null - var child_count = self.get_child_count() + var child_count = get_child_count() if not child_count <= 0: - last_text_info_child = self.get_children()[self.get_children().size() - 1] + last_text_info_child = get_children()[get_children().size() - 1] var label = Label.new() label.name = text_name label.rect_size = Vector2(size, 14) @@ -25,14 +25,14 @@ func add_text_info(text_name, custom_node = null): label.rect_position = Vector2(x + temp_size, y) if not custom_node == null: label.add_child(custom_node) - self.add_child(label) + add_child(label) func update_text_info(text_name, text_value = null, node = null, node_target_value = null, node_value = null): var text_label = self.get_node(text_name) if text_label == null: return if not node == null: - self.get_node(text_name).get_node(node).set(node_target_value, node_value) + get_node(text_name).get_node(node).set(node_target_value, node_value) if text_value == null: text_label.text = "%s: %s" % [text_name, null] else: diff --git a/addons/graphics_editor/ViewportContainer.gd b/addons/graphics_editor/ViewportContainer.gd index b13121c..8fa0d7e 100644 --- a/addons/graphics_editor/ViewportContainer.gd +++ b/addons/graphics_editor/ViewportContainer.gd @@ -5,5 +5,5 @@ func _ready(): func _notification(what): if what == Control.NOTIFICATION_RESIZED: - get_node("Viewport").size = self.rect_size - get_node("Viewport/Node2D/Camera2D").position = Vector2(self.rect_size.x / 2, self.rect_size.y / 2) \ No newline at end of file + get_node("Viewport").size = rect_size + get_node("Viewport/Node2D/Camera2D").position = Vector2(rect_size.x / 2, rect_size.y / 2) \ No newline at end of file diff --git a/addons/graphics_editor/VisualGrid.gd b/addons/graphics_editor/VisualGrid.gd index 5ce0b90..f1ccff3 100644 --- a/addons/graphics_editor/VisualGrid.gd +++ b/addons/graphics_editor/VisualGrid.gd @@ -14,17 +14,17 @@ func _draw(): var wrap_offset = Vector2(wrapf(offset.x, 0, temp_size), wrapf(offset.y, 0, temp_size)) - var ceil_x = ceil(self.rect_size.x / temp_size) + 0.01 - var ceil_y = ceil(self.rect_size.y / temp_size) + 0.01 + var ceil_x = ceil(rect_size.x / temp_size) + 0.01 + var ceil_y = ceil(rect_size.y / temp_size) + 0.01 for i in ceil_y: var start_x = Vector2(0, (i * temp_size) + wrap_offset.y) - var end_x = Vector2(self.rect_size.x, (i * temp_size) + wrap_offset.y) + var end_x = Vector2(rect_size.x, (i * temp_size) + wrap_offset.y) draw_line(start_x, end_x, color, 1) for i in ceil_x: var start_y = Vector2((i * temp_size) + wrap_offset.x, 0) - var end_y = Vector2((i * temp_size) + (wrap_offset.x + 0.01), self.rect_size.y) + var end_y = Vector2((i * temp_size) + (wrap_offset.x + 0.01), rect_size.y) draw_line(start_y, end_y, color, 1) func _process(delta):