From c6ded721d14a6b870861c424c8c3f9615bacaf9a Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 21 Dec 2019 04:56:48 +0200 Subject: [PATCH 1/2] Canvas transparent background changes on dark & gold themes It's also in Global.gd instead of Canvas.gd --- Assets/Graphics/Transparent Background Dark.png | Bin 0 -> 84 bytes .../Transparent Background Dark.png.import | 13 +++++++++++++ ...ground.png => Transparent Background Godot.png} | Bin .../Transparent Background Godot.png.import | 13 +++++++++++++ Assets/Graphics/Transparent Background Gold.png | Bin 0 -> 84 bytes .../Transparent Background Gold.png.import | 13 +++++++++++++ Assets/Graphics/Transparent Background.png.import | 13 ------------- Main.tscn | 2 -- Scripts/Canvas.gd | 6 +----- Scripts/Global.gd | 3 +++ Scripts/PreferencesDialog.gd | 6 +++++- 11 files changed, 48 insertions(+), 21 deletions(-) create mode 100644 Assets/Graphics/Transparent Background Dark.png create mode 100644 Assets/Graphics/Transparent Background Dark.png.import rename Assets/Graphics/{Transparent Background.png => Transparent Background Godot.png} (100%) create mode 100644 Assets/Graphics/Transparent Background Godot.png.import create mode 100644 Assets/Graphics/Transparent Background Gold.png create mode 100644 Assets/Graphics/Transparent Background Gold.png.import delete mode 100644 Assets/Graphics/Transparent Background.png.import diff --git a/Assets/Graphics/Transparent Background Dark.png b/Assets/Graphics/Transparent Background Dark.png new file mode 100644 index 0000000000000000000000000000000000000000..3d3d2c84bea85001819dd1184b261d0ce6485629 GIT binary patch literal 84 zcmeAS@N?(olHy`uVBq!ia0vp^Od!m`1|*BN@u~nRX-^l&5RRG2YgTCdum69LnQhr` hemMgTEe!((hVTv!PG|qkKY_{^JYD@<);T3K0RY9Q6cqpf literal 0 HcmV?d00001 diff --git a/Assets/Graphics/Transparent Background Dark.png.import b/Assets/Graphics/Transparent Background Dark.png.import new file mode 100644 index 0000000..fed594b --- /dev/null +++ b/Assets/Graphics/Transparent Background Dark.png.import @@ -0,0 +1,13 @@ +[remap] + +importer="image" +type="Image" +path="res://.import/Transparent Background Dark.png-3390cbd0582c34c8d5e9ea776775a7f5.image" + +[deps] + +source_file="res://Assets/Graphics/Transparent Background Dark.png" +dest_files=[ "res://.import/Transparent Background Dark.png-3390cbd0582c34c8d5e9ea776775a7f5.image" ] + +[params] + diff --git a/Assets/Graphics/Transparent Background.png b/Assets/Graphics/Transparent Background Godot.png similarity index 100% rename from Assets/Graphics/Transparent Background.png rename to Assets/Graphics/Transparent Background Godot.png diff --git a/Assets/Graphics/Transparent Background Godot.png.import b/Assets/Graphics/Transparent Background Godot.png.import new file mode 100644 index 0000000..0ce3089 --- /dev/null +++ b/Assets/Graphics/Transparent Background Godot.png.import @@ -0,0 +1,13 @@ +[remap] + +importer="image" +type="Image" +path="res://.import/Transparent Background Godot.png-d1a39497ccb71eaedecb0ccf98e2bf02.image" + +[deps] + +source_file="res://Assets/Graphics/Transparent Background Godot.png" +dest_files=[ "res://.import/Transparent Background Godot.png-d1a39497ccb71eaedecb0ccf98e2bf02.image" ] + +[params] + diff --git a/Assets/Graphics/Transparent Background Gold.png b/Assets/Graphics/Transparent Background Gold.png new file mode 100644 index 0000000000000000000000000000000000000000..6c75133a08ba5c4896a0eac48e87f7bd7fd4497f GIT binary patch literal 84 zcmeAS@N?(olHy`uVBq!ia0vp^Od!m`1|*BN@u~nRX-^l&5RRG2clMXQ`~O*dy|KaE h{S|W$2E void: Global.can_draw = false - #Background - trans_background = ImageTexture.new() - trans_background.create_from_image(preload("res://Assets/Graphics/Transparent Background.png"), 0) #The sprite itself if layers.empty(): @@ -381,7 +377,7 @@ func get_layer_container(layer_index : int) -> LayerContainer: return null func _draw() -> void: - draw_texture_rect(trans_background, Rect2(location, size), true) #Draw transparent background + draw_texture_rect(Global.transparent_background, Rect2(location, size), true) #Draw transparent background #Onion Skinning #Past if Global.onion_skinning_past_rate > 0: diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 0c407c6..bc6191e 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -17,6 +17,7 @@ var canvases := [] var hidden_canvases := [] var left_cursor_tool_texture : ImageTexture var right_cursor_tool_texture : ImageTexture +var transparent_background : ImageTexture # warning-ignore:unused_class_variable var selected_pixels := [] var image_clipboard : Image @@ -205,6 +206,8 @@ func _ready() -> void: config_cache.load("user://cache.ini") undo_redo = UndoRedo.new() + transparent_background = ImageTexture.new() + transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Godot.png"), 0) image_clipboard = Image.new() var root = get_tree().get_root() diff --git a/Scripts/PreferencesDialog.gd b/Scripts/PreferencesDialog.gd index 13b4483..7b413f6 100644 --- a/Scripts/PreferencesDialog.gd +++ b/Scripts/PreferencesDialog.gd @@ -32,24 +32,28 @@ func change_theme(ID : int) -> void: var ruler_style if ID == 0: #Dark Theme Global.theme_type = "Dark" - VisualServer.set_default_clear_color(Color(0.301961, 0.301961, 0.301961)) + Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Dark.png"), 0) + VisualServer.set_default_clear_color(Color(0.247059, 0.25098, 0.247059)) main_theme = preload("res://Themes & Styles/Dark Theme/Dark Theme.tres") top_menu_style = preload("res://Themes & Styles/Dark Theme/DarkTopMenuStyle.tres") ruler_style = preload("res://Themes & Styles/Dark Theme/DarkRulerStyle.tres") elif ID == 1: #Gray Theme Global.theme_type = "Dark" + Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Godot.png"), 0) VisualServer.set_default_clear_color(Color(0.301961, 0.301961, 0.301961)) main_theme = preload("res://Themes & Styles/Gray Theme/Gray Theme.tres") top_menu_style = preload("res://Themes & Styles/Gray Theme/GrayTopMenuStyle.tres") ruler_style = preload("res://Themes & Styles/Dark Theme/DarkRulerStyle.tres") elif ID == 2: #Godot's Theme Global.theme_type = "Dark" + Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Godot.png"), 0) VisualServer.set_default_clear_color(Color(0.301961, 0.301961, 0.301961)) main_theme = preload("res://Themes & Styles/Godot\'s Theme/Godot\'s Theme.tres") top_menu_style = preload("res://Themes & Styles/Godot\'s Theme/TopMenuStyle.tres") ruler_style = preload("res://Themes & Styles/Godot\'s Theme/RulerStyle.tres") elif ID == 3: #Gold Theme Global.theme_type = "Light" + Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Gold.png"), 0) VisualServer.set_default_clear_color(Color(0.694118, 0.619608, 0.458824)) main_theme = preload("res://Themes & Styles/Gold Theme/Gold Theme.tres") top_menu_style = preload("res://Themes & Styles/Gold Theme/GoldTopMenuStyle.tres") From f4a62f227ffb350f1ba44cb5547e2b04225d3a14 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 21 Dec 2019 05:03:57 +0200 Subject: [PATCH 2/2] Changed transparent background and default clear color for Godot's theme --- Assets/Graphics/Transparent Background Godot.png | Bin 84 -> 84 bytes Assets/Graphics/Transparent Background Gray.png | Bin 0 -> 84 bytes .../Transparent Background Gray.png.import | 13 +++++++++++++ Main.tscn | 3 +++ Scripts/Global.gd | 2 +- Scripts/PreferencesDialog.gd | 4 ++-- 6 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 Assets/Graphics/Transparent Background Gray.png create mode 100644 Assets/Graphics/Transparent Background Gray.png.import diff --git a/Assets/Graphics/Transparent Background Godot.png b/Assets/Graphics/Transparent Background Godot.png index 190dba94e733da6e39b88f80ba8140e5dbd617a2..56d454cd80f4c119dce8588577f6261cf5017386 100644 GIT binary patch delta 45 zcmWFunV_Tb=H<+f{|~ih^Z1DC#UvXTTu5SIh%DpKWa*PlW&i?DS3j3^P6zopr0P5ovq5uE@ literal 0 HcmV?d00001 diff --git a/Assets/Graphics/Transparent Background Gray.png.import b/Assets/Graphics/Transparent Background Gray.png.import new file mode 100644 index 0000000..530cfb8 --- /dev/null +++ b/Assets/Graphics/Transparent Background Gray.png.import @@ -0,0 +1,13 @@ +[remap] + +importer="image" +type="Image" +path="res://.import/Transparent Background Gray.png-0ba67df3c826cdf2e974e693683b6f48.image" + +[deps] + +source_file="res://Assets/Graphics/Transparent Background Gray.png" +dest_files=[ "res://.import/Transparent Background Gray.png-0ba67df3c826cdf2e974e693683b6f48.image" ] + +[params] + diff --git a/Main.tscn b/Main.tscn index 3bf4bbb..494aa90 100644 --- a/Main.tscn +++ b/Main.tscn @@ -226,6 +226,7 @@ text = "[64×64]" align = 2 [node name="UI" type="HBoxContainer" parent="MenuAndUI"] +editor/display_folded = true margin_top = 28.0 margin_right = 1152.0 margin_bottom = 648.0 @@ -801,6 +802,7 @@ mouse_default_cursor_shape = 2 text = "Vertical" [node name="CanvasAndTimeline" type="VBoxContainer" parent="MenuAndUI/UI"] +editor/display_folded = true margin_left = 224.0 margin_right = 928.0 margin_bottom = 620.0 @@ -857,6 +859,7 @@ enabled_focus_mode = 0 script = ExtResource( 15 ) [node name="ViewportContainer" type="ViewportContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/ViewportandVerticalRuler"] +editor/display_folded = true margin_left = 16.0 margin_right = 704.0 margin_bottom = 462.0 diff --git a/Scripts/Global.gd b/Scripts/Global.gd index bc6191e..973c18c 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -207,7 +207,7 @@ func _ready() -> void: undo_redo = UndoRedo.new() transparent_background = ImageTexture.new() - transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Godot.png"), 0) + transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Dark.png"), 0) image_clipboard = Image.new() var root = get_tree().get_root() diff --git a/Scripts/PreferencesDialog.gd b/Scripts/PreferencesDialog.gd index 7b413f6..c59b6f7 100644 --- a/Scripts/PreferencesDialog.gd +++ b/Scripts/PreferencesDialog.gd @@ -39,7 +39,7 @@ func change_theme(ID : int) -> void: ruler_style = preload("res://Themes & Styles/Dark Theme/DarkRulerStyle.tres") elif ID == 1: #Gray Theme Global.theme_type = "Dark" - Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Godot.png"), 0) + Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Gray.png"), 0) VisualServer.set_default_clear_color(Color(0.301961, 0.301961, 0.301961)) main_theme = preload("res://Themes & Styles/Gray Theme/Gray Theme.tres") top_menu_style = preload("res://Themes & Styles/Gray Theme/GrayTopMenuStyle.tres") @@ -47,7 +47,7 @@ func change_theme(ID : int) -> void: elif ID == 2: #Godot's Theme Global.theme_type = "Dark" Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Godot.png"), 0) - VisualServer.set_default_clear_color(Color(0.301961, 0.301961, 0.301961)) + VisualServer.set_default_clear_color(Color(0.27451, 0.278431, 0.305882)) main_theme = preload("res://Themes & Styles/Godot\'s Theme/Godot\'s Theme.tres") top_menu_style = preload("res://Themes & Styles/Godot\'s Theme/TopMenuStyle.tres") ruler_style = preload("res://Themes & Styles/Godot\'s Theme/RulerStyle.tres")