From db606a5051bd0ce8b06ec5342e73f82df561f4d9 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 29 Jul 2020 03:36:19 +0300 Subject: [PATCH] Added a dark texture for the restore to default button For light & caramel themes --- .../caramel_themes/misc/icon_reload.png | Bin 0 -> 429 bytes .../misc/icon_reload.png.import | 34 ++++++++++++++++++ .../light_themes/misc/icon_reload.png | Bin 0 -> 429 bytes .../light_themes/misc/icon_reload.png.import | 34 ++++++++++++++++++ src/Preferences/HandleThemes.gd | 2 +- src/Preferences/RestoreDefaultButton.gd | 8 +++++ src/Preferences/RestoreDefaultButton.tscn | 4 ++- 7 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 assets/graphics/caramel_themes/misc/icon_reload.png create mode 100644 assets/graphics/caramel_themes/misc/icon_reload.png.import create mode 100644 assets/graphics/light_themes/misc/icon_reload.png create mode 100644 assets/graphics/light_themes/misc/icon_reload.png.import diff --git a/assets/graphics/caramel_themes/misc/icon_reload.png b/assets/graphics/caramel_themes/misc/icon_reload.png new file mode 100644 index 0000000000000000000000000000000000000000..cd4586244581fadcbc70d088cac2d725210a51e1 GIT binary patch literal 429 zcmV;e0aE^nP)Px$XGugsR5*>zk}*qMK@^3*xg$92ifVqXU^6vbYQ zaR*o~?OPE!(prD(^?HA12DDnOmWZ4wrB-G<+V$RVW?7a2$mGivI0d$iF^MrIQA%wA z_rR*w`qVi$4=`5^D2ifl414d_vMl>iX`i&)?Q5k}7g+V)e*nHd`$3Fxw=BO*zyPFa z`cp*q0YV77FGc{C0E{u0Gv-HYeNmS0o&v13ht}EvEC7r~qhHqA!)XB_glCJF68Hq% zRs6fsd!ZQPMp=G;3dr+(7((a(Ltq#}=;V1moP?Xr<{R(*0f2}c0qAjaFc>^G8jS~~ z)OnhwS5?qCx0oc!d*E0p^%m&XYPFC3e&0{M#7UL=8Ef_-{X@Tj8xi?juh-Yd@axcD Xk1L2R!06j400000NkvXXu0mjfH@>_d literal 0 HcmV?d00001 diff --git a/assets/graphics/caramel_themes/misc/icon_reload.png.import b/assets/graphics/caramel_themes/misc/icon_reload.png.import new file mode 100644 index 0000000..50ca2c1 --- /dev/null +++ b/assets/graphics/caramel_themes/misc/icon_reload.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon_reload.png-e8a158cd156ea5e131991fdbb47cfd96.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/caramel_themes/misc/icon_reload.png" +dest_files=[ "res://.import/icon_reload.png-e8a158cd156ea5e131991fdbb47cfd96.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/graphics/light_themes/misc/icon_reload.png b/assets/graphics/light_themes/misc/icon_reload.png new file mode 100644 index 0000000000000000000000000000000000000000..cd4586244581fadcbc70d088cac2d725210a51e1 GIT binary patch literal 429 zcmV;e0aE^nP)Px$XGugsR5*>zk}*qMK@^3*xg$92ifVqXU^6vbYQ zaR*o~?OPE!(prD(^?HA12DDnOmWZ4wrB-G<+V$RVW?7a2$mGivI0d$iF^MrIQA%wA z_rR*w`qVi$4=`5^D2ifl414d_vMl>iX`i&)?Q5k}7g+V)e*nHd`$3Fxw=BO*zyPFa z`cp*q0YV77FGc{C0E{u0Gv-HYeNmS0o&v13ht}EvEC7r~qhHqA!)XB_glCJF68Hq% zRs6fsd!ZQPMp=G;3dr+(7((a(Ltq#}=;V1moP?Xr<{R(*0f2}c0qAjaFc>^G8jS~~ z)OnhwS5?qCx0oc!d*E0p^%m&XYPFC3e&0{M#7UL=8Ef_-{X@Tj8xi?juh-Yd@axcD Xk1L2R!06j400000NkvXXu0mjfH@>_d literal 0 HcmV?d00001 diff --git a/assets/graphics/light_themes/misc/icon_reload.png.import b/assets/graphics/light_themes/misc/icon_reload.png.import new file mode 100644 index 0000000..25f5b73 --- /dev/null +++ b/assets/graphics/light_themes/misc/icon_reload.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon_reload.png-c15ad678b067a1d009ad31f253da051f.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/light_themes/misc/icon_reload.png" +dest_files=[ "res://.import/icon_reload.png-c15ad678b067a1d009ad31f253da051f.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/src/Preferences/HandleThemes.gd b/src/Preferences/HandleThemes.gd index acf62cc..94bbfc6 100644 --- a/src/Preferences/HandleThemes.gd +++ b/src/Preferences/HandleThemes.gd @@ -96,7 +96,7 @@ func change_theme(ID : int) -> void: if button.texture_hover: var hover_file_name = button.texture_hover.resource_path.get_file() button.texture_hover = load("res://assets/graphics/%s_themes/%s/%s" % [theme_type_string, button_category, hover_file_name]) - if button.texture_disabled: + if button.texture_disabled and button.texture_disabled == StreamTexture: var disabled_file_name = button.texture_disabled.resource_path.get_file() button.texture_disabled = load("res://assets/graphics/%s_themes/%s/%s" % [theme_type_string, button_category, disabled_file_name]) elif button is Button: diff --git a/src/Preferences/RestoreDefaultButton.gd b/src/Preferences/RestoreDefaultButton.gd index f9d9e72..b3983cc 100644 --- a/src/Preferences/RestoreDefaultButton.gd +++ b/src/Preferences/RestoreDefaultButton.gd @@ -7,6 +7,14 @@ var default_value var node : Node +func _ready() -> void: + # Handle themes + if Global.theme_type == Global.Theme_Types.LIGHT: + texture_normal = load("res://assets/graphics/light_themes/misc/icon_reload.png") + elif Global.theme_type == Global.Theme_Types.CARAMEL: + texture_normal = load("res://assets/graphics/caramel_themes/misc/icon_reload.png") + + func _on_RestoreDefaultButton_pressed() -> void: Global.set(setting_name, default_value) Global.config_cache.set_value("preferences", setting_name, default_value) diff --git a/src/Preferences/RestoreDefaultButton.tscn b/src/Preferences/RestoreDefaultButton.tscn index a9cbeda..1c7c2cd 100644 --- a/src/Preferences/RestoreDefaultButton.tscn +++ b/src/Preferences/RestoreDefaultButton.tscn @@ -5,7 +5,9 @@ [sub_resource type="ImageTexture" id=1] -[node name="RestoreDefaultButton" type="TextureButton"] +[node name="RestoreDefaultButton" type="TextureButton" groups=[ +"UIButtons", +]] margin_right = 16.0 margin_bottom = 16.0 disabled = true