Borderless option! + loosen up fullscreen button audio range

This commit is contained in:
Harmony Honey Monroe 2024-09-17 15:09:40 -04:00
parent 6025b86681
commit 96c7f8628f
3 changed files with 85 additions and 17 deletions

View file

@ -0,0 +1,20 @@
extends CanvasItem
onready var fill = $Box/Fill
var is_selected = false
func _ready():
fill.visible = OS.window_borderless
func select():
is_selected = true
func deselect():
is_selected = false
func _input(event):
if is_selected and event.is_action_pressed("ui_yes"):
var is_full = OS.window_borderless
OS.window_borderless = !is_full
Audio.play("menu_delete", 0.5, 1.5)
fill.visible = !is_full

View file

@ -19,7 +19,7 @@ func _input(event):
Shared.set_fullscreen(!is_full)
#OS.window_fullscreen = !is_full
Shared.set_window_scale()
Audio.play("menu_pause", 0.9, 1.1)
Audio.play("menu_pause", 0.7, 1.3)
fill.visible = !is_full
if !is_full:
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=2]
[gd_scene load_steps=14 format=2]
[ext_resource path="res://src/menu/options/OptionsMenu.gd" type="Script" id=1]
[ext_resource path="res://src/menu/options/Volume.tscn" type="PackedScene" id=2]
@ -7,6 +7,7 @@
[ext_resource path="res://media/audio/sfx/btn0.wav" type="AudioStream" id=5]
[ext_resource path="res://media/font/QuinqueFive.ttf" type="DynamicFontData" id=6]
[ext_resource path="res://media/font/ThaleahFat.ttf" type="DynamicFontData" id=7]
[ext_resource path="res://src/menu/options/Borderless.gd" type="Script" id=8]
[ext_resource path="res://src/menu/options/Fullscreen.gd" type="Script" id=20]
[ext_resource path="res://src/menu/options/WindowSize.gd" type="Script" id=21]
[ext_resource path="res://src/menu/options/Touch.gd" type="Script" id=22]
@ -79,9 +80,9 @@ margin_bottom = 128.0
alignment = 1
[node name="Keyboard" type="HBoxContainer" parent="Center/Control/MenuItems"]
margin_top = 15.0
margin_top = 9.0
margin_right = 116.0
margin_bottom = 23.0
margin_bottom = 17.0
rect_min_size = Vector2( 0, 8 )
script = ExtResource( 3 )
@ -105,9 +106,9 @@ margin_bottom = 8.0
rect_min_size = Vector2( 8, 0 )
[node name="Gamepad" type="HBoxContainer" parent="Center/Control/MenuItems"]
margin_top = 27.0
margin_top = 21.0
margin_right = 116.0
margin_bottom = 35.0
margin_bottom = 29.0
rect_min_size = Vector2( 0, 8 )
script = ExtResource( 3 )
is_gamepad = true
@ -132,14 +133,14 @@ margin_bottom = 8.0
rect_min_size = Vector2( 8, 0 )
[node name="Sounds" parent="Center/Control/MenuItems" instance=ExtResource( 2 )]
margin_top = 39.0
margin_top = 33.0
margin_right = 116.0
margin_bottom = 47.0
margin_bottom = 41.0
[node name="Music" parent="Center/Control/MenuItems" instance=ExtResource( 2 )]
margin_top = 51.0
margin_top = 45.0
margin_right = 116.0
margin_bottom = 59.0
margin_bottom = 53.0
bus = 2
[node name="Label" parent="Center/Control/MenuItems/Music" index="0"]
@ -167,9 +168,9 @@ stream = ExtResource( 5 )
bus = "Music"
[node name="Fullscreen" type="HBoxContainer" parent="Center/Control/MenuItems"]
margin_top = 63.0
margin_top = 57.0
margin_right = 116.0
margin_bottom = 71.0
margin_bottom = 65.0
script = ExtResource( 20 )
[node name="Label" type="Label" parent="Center/Control/MenuItems/Fullscreen"]
@ -217,9 +218,9 @@ margin_bottom = 8.0
rect_min_size = Vector2( 8, 0 )
[node name="WindowSize" type="HBoxContainer" parent="Center/Control/MenuItems"]
margin_top = 75.0
margin_top = 69.0
margin_right = 116.0
margin_bottom = 83.0
margin_bottom = 77.0
rect_min_size = Vector2( 0, 8 )
script = ExtResource( 21 )
@ -252,10 +253,57 @@ custom_fonts/font = SubResource( 2 )
text = "228 x 128"
align = 1
[node name="TouchControls" type="HBoxContainer" parent="Center/Control/MenuItems"]
margin_top = 87.0
[node name="Borderless" type="HBoxContainer" parent="Center/Control/MenuItems"]
margin_top = 81.0
margin_right = 116.0
margin_bottom = 95.0
margin_bottom = 89.0
script = ExtResource( 8 )
[node name="Label" type="Label" parent="Center/Control/MenuItems/Borderless"]
margin_top = 1.0
margin_right = 60.0
margin_bottom = 6.0
custom_fonts/font = SubResource( 2 )
text = "Borderless"
[node name="Spacer" type="Control" parent="Center/Control/MenuItems/Borderless"]
margin_left = 64.0
margin_right = 92.0
margin_bottom = 8.0
size_flags_horizontal = 3
[node name="Box" type="ColorRect" parent="Center/Control/MenuItems/Borderless"]
margin_left = 96.0
margin_right = 104.0
margin_bottom = 8.0
rect_min_size = Vector2( 8, 8 )
[node name="Back" type="ColorRect" parent="Center/Control/MenuItems/Borderless/Box"]
margin_left = 1.0
margin_top = 1.0
margin_right = 7.0
margin_bottom = 7.0
color = Color( 0, 0, 0, 1 )
[node name="Fill" type="ColorRect" parent="Center/Control/MenuItems/Borderless/Box"]
margin_left = 2.0
margin_top = 2.0
margin_right = 6.0
margin_bottom = 6.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Spacer2" type="Control" parent="Center/Control/MenuItems/Borderless"]
margin_left = 108.0
margin_right = 116.0
margin_bottom = 8.0
rect_min_size = Vector2( 8, 0 )
[node name="TouchControls" type="HBoxContainer" parent="Center/Control/MenuItems"]
margin_top = 93.0
margin_right = 116.0
margin_bottom = 101.0
script = ExtResource( 22 )
[node name="Label" type="Label" parent="Center/Control/MenuItems/TouchControls"]