From d14e90bb3cb5f9c125ad0d372a43cbcf121e66dc Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Sat, 5 Jun 2021 00:32:32 +0200 Subject: [PATCH] add slider for setting overlay size --- ovr-utils/icons/handle.svg | 1 + ovr-utils/icons/handle.svg.import | 34 +++++++++++++++++++++++ ovr-utils/styles/menu.theme | Bin 786 -> 920 bytes ovr-utils/styles/sliders/active.stylebox | Bin 0 -> 453 bytes ovr-utils/styles/sliders/normal.stylebox | Bin 0 -> 444 bytes ovr-utils/ui/ListOverlayItem.tscn | 27 +++++++++++++++++- ovr-utils/ui/overlay_list_item.gd | 9 ++++++ 7 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 ovr-utils/icons/handle.svg create mode 100644 ovr-utils/icons/handle.svg.import create mode 100644 ovr-utils/styles/sliders/active.stylebox create mode 100644 ovr-utils/styles/sliders/normal.stylebox diff --git a/ovr-utils/icons/handle.svg b/ovr-utils/icons/handle.svg new file mode 100644 index 0000000..2a112e2 --- /dev/null +++ b/ovr-utils/icons/handle.svg @@ -0,0 +1 @@ + diff --git a/ovr-utils/icons/handle.svg.import b/ovr-utils/icons/handle.svg.import new file mode 100644 index 0000000..df3a9f5 --- /dev/null +++ b/ovr-utils/icons/handle.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/handle.svg-242cd3e4d69885cc43f9fb8909ecd878.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icons/handle.svg" +dest_files=[ "res://.import/handle.svg-242cd3e4d69885cc43f9fb8909ecd878.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=true +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=10.0 diff --git a/ovr-utils/styles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>O832qZoQ$s_30ssIgwJ-f(DhGuZ0Op=$Js__n9f2Y=0D=Gw zC;|uqU;tQoPvrI?a__&p5hBS>x;lp&1vU08Pp$l6SU*s*cMlzF+r&O3_LqmvP6|o@ zPykf`7B{P+YidoVvO)X5!R7XIRDw@Sq2(akdHuh*}s(*fx3bT=^gK|Ktnz&XtztazpSZ zS-(rEouCV~dwPLjp*i_gD!C1OR{E&6oNNVdA$n=*c~2>AomfYv{v-HiT>{ZB^;W8k&O|Ln{9n{2w4UI_=0Q*4wBaK0G=iH2qj)DtCyx45)gYhp3OnrY59NPR5xdO+zEiCsDVK;G$JFCBn5?ZfP#^#u{si9 z)FjU`$|7P6QzKzbL2I<00plI#b;y6VFh~0e8_&(t#p}o4n+1yd-8f6=^&3^iJ$l67 zSca7H@fC=%)*m(wK&44%YNy$yM{!>x zEFMdWr1M7Mo)i{nAuv!;=cF Qc>`4?`iq$;O;S@sLkJ&h#{d8T diff --git a/ovr-utils/styles/sliders/active.stylebox b/ovr-utils/styles/sliders/active.stylebox new file mode 100644 index 0000000000000000000000000000000000000000..56089feafe65d86658d4bce74f64bb1c505f0c56 GIT binary patch literal 453 zcmV;$0XqItQ$s@n000005C8!00{{T60RR9fwJ-f(?*bhS0QQnVG+;%P4j~AFpnwhl z007`Y!M^Cr!kX*@_md{~-lN=`q49kr2LnPu=tuwCfAkf21=3`UDJ=jm05kv+Ufeva zrM6u6pK|py`M64TlWnuu+(xF3K|7WIU;aD1TdWZ6gvL>C{yU~WPinLrlu4x14~7`) zw2;_%65Dpsu zDFX?NA44K#U>ZPxpJ0HRGSq*8{|b}kqO~B@0=8?_WPLEsY6eHBQB6ZqH9=uvNht@Q z0uh|*1`=S>c$zUrHOd5Lwy;|NH(32JlIN+BFPH(@=ceo#l&0rfR_KL#hz{`APTsbAD}*}1!n|NTolt0A>AW%V|+EiHP-QS;Iv${O>`d(=QQd2`i3xUoo literal 0 HcmV?d00001 diff --git a/ovr-utils/styles/sliders/normal.stylebox b/ovr-utils/styles/sliders/normal.stylebox new file mode 100644 index 0000000000000000000000000000000000000000..4cbdfafa7fcbd07e73a264e9dc6df146ac53634a GIT binary patch literal 444 zcmV;t0Ym;$Q$s@n000005C8!00{{S|0RR9fwJ-f(?*i2f0Jc&-Fi?dm9WXO9Gb{O} z8)8M1^{m|UcS)0b%LUi?5Cm0r3Og89IOrL!YuRssX=WHY1uOtA05SlM;;dFfZMf_| z z#m~0n#EPWB?11#SY;6yRhfDOhmb_RYH@v|CGMWr#M8S+E5y%gDC?qugGY~2W{1hTl zf#0BjvA{6?6Z~gbSPt4r;$_7PrO4Xci&E4V3P-3xO@qd2g2IB5QVyU35uEA<5+Kre znqrJ!+lzT3p~-#h~{Sm!1JQNhI8)+}2ZBfnirl}}#% zI^ATL#wu7-F5&6<32RgOgEF!ZaICc>H#j!!;%8hI%A%ys_&6;Cmk{uxGSe0$($9BE mna)NT6MHNx1*Kj9{49u+Ry>v^_xI=5tS(QzURT6YQ$s@noXTDR literal 0 HcmV?d00001 diff --git a/ovr-utils/ui/ListOverlayItem.tscn b/ovr-utils/ui/ListOverlayItem.tscn index 6ea9564..6742bff 100644 --- a/ovr-utils/ui/ListOverlayItem.tscn +++ b/ovr-utils/ui/ListOverlayItem.tscn @@ -104,13 +104,36 @@ margin_right = 176.0 margin_bottom = 191.0 icon = ExtResource( 2 ) -[node name="Size" type="Button" parent="MoreOptions/Container/List"] +[node name="SetSize" type="Button" parent="MoreOptions/Container/List"] margin_left = 180.0 margin_right = 356.0 margin_bottom = 191.0 toggle_mode = true icon = ExtResource( 4 ) +[node name="PanelContainer" type="PanelContainer" parent="MoreOptions/Container/List/SetSize"] +anchor_top = -0.016 +anchor_right = 1.0 +anchor_bottom = -0.016 +margin_top = -464.944 +margin_bottom = 0.0560002 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SizeSlider" type="VSlider" parent="MoreOptions/Container/List/SetSize/PanelContainer"] +margin_left = 8.0 +margin_top = 8.0 +margin_right = 108.0 +margin_bottom = 457.0 +min_value = 0.1 +max_value = 1.0 +step = 0.05 +value = 0.1 +__meta__ = { +"_edit_use_anchors_": false +} + [node name="Target" type="OptionButton" parent="MoreOptions/Container/List"] margin_left = 360.0 margin_right = 540.0 @@ -137,6 +160,8 @@ icon = ExtResource( 11 ) [connection signal="toggled" from="BasicOptions/List/Visibility" to="." method="_on_Visibility_toggled"] [connection signal="pressed" from="BasicOptions/List/Options" to="." method="_on_Options_pressed"] [connection signal="pressed" from="MoreOptions/Container/List/Remove" to="." method="_on_Remove_pressed"] +[connection signal="toggled" from="MoreOptions/Container/List/SetSize" to="." method="_on_SetSize_toggled"] +[connection signal="value_changed" from="MoreOptions/Container/List/SetSize/PanelContainer/SizeSlider" to="." method="_on_SizeSlider_value_changed"] [connection signal="item_selected" from="MoreOptions/Container/List/Target" to="." method="_on_Target_item_selected"] [connection signal="pressed" from="MoreOptions/Container/List/Reset" to="." method="_on_Reset_pressed"] [connection signal="pressed" from="MoreOptions/Container/List/CloseOptions" to="." method="_on_CloseOptions_pressed"] diff --git a/ovr-utils/ui/overlay_list_item.gd b/ovr-utils/ui/overlay_list_item.gd index 1256280..bc61081 100644 --- a/ovr-utils/ui/overlay_list_item.gd +++ b/ovr-utils/ui/overlay_list_item.gd @@ -5,6 +5,7 @@ var overlay func _ready() -> void: overlay = OverlayManager.get_node(overlay_name) + $MoreOptions/Container/List/SetSize/PanelContainer.visible = false $MoreOptions.visible = false $BasicOptions/Label.text = overlay_name name = overlay_name @@ -48,3 +49,11 @@ func _on_Options_pressed() -> void: func _on_CloseOptions_pressed() -> void: $MoreOptions.visible = false + + +func _on_SetSize_toggled(state: bool) -> void: + $MoreOptions/Container/List/SetSize/PanelContainer.visible = state + + +func _on_SizeSlider_value_changed(value: float) -> void: + overlay.width_meters = value