From 370ae7525a1acbd7418f2b7ee8a51ae1f55480f2 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Fri, 18 Oct 2024 00:01:27 +0300 Subject: [PATCH] Fix formatting and make unused docstrings to comments of the previous commit --- src/UI/Dialogs/WindowOpacityDialog.gd | 6 +++--- src/UI/UI.gd | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/UI/Dialogs/WindowOpacityDialog.gd b/src/UI/Dialogs/WindowOpacityDialog.gd index 8ab8230cf..1aa4f83db 100644 --- a/src/UI/Dialogs/WindowOpacityDialog.gd +++ b/src/UI/Dialogs/WindowOpacityDialog.gd @@ -7,7 +7,7 @@ var main_canvas := Global.control.find_child("Main Canvas", true, false) func _ready() -> void: - if main_canvas is FloatingWindow: ## If it's shifted to a window then get the content + if main_canvas is FloatingWindow: # If it's shifted to a window then get the content. main_canvas = main_canvas.window_content await get_tree().process_frame Global.control.main_ui.sort_children.connect(_recalculate_opacity) @@ -30,13 +30,13 @@ func set_window_opacity(value: float) -> void: value = 100.0 slider.value = value value = value / 100.0 - # Find the TabContainer that has the Main Canvas panel + # Find the TabContainer that has the Main Canvas panel. for container: Control in Global.control.main_ui._panel_container.get_children(): if container is TabContainer: var center := container.get_rect().get_center() if main_canvas.get_rect().has_point(center): if main_canvas.get_window() != get_tree().root: - ## In case we converted to window while trransparency was active + # In case we converted to window while trransparency was active. container.self_modulate.a = 1.0 else: container.self_modulate.a = value diff --git a/src/UI/UI.gd b/src/UI/UI.gd index 105e46511..c95234f6d 100644 --- a/src/UI/UI.gd +++ b/src/UI/UI.gd @@ -37,5 +37,7 @@ func update_transparent_shader() -> void: # Works independently of the transparency feature var canvas_size: Vector2 = (main_canvas_container.size - Vector2.DOWN * 2) * Global.shrink transparency_material.set_shader_parameter("screen_resolution", get_viewport().size) - transparency_material.set_shader_parameter("position", main_canvas_container.global_position * Global.shrink) + transparency_material.set_shader_parameter( + "position", main_canvas_container.global_position * Global.shrink + ) transparency_material.set_shader_parameter("size", canvas_size)