initial commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
[gd_scene format=3 uid="uid://c1w54bb1nvfgl"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://lcxue7n3hrl4" path="res://settings/widget/widget_settings.gd" id="1_d1q6j"]
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_d1q6j"]
|
||||
|
||||
[node name="WidgetSettings" type="Control" unique_id=380306064]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_d1q6j")
|
||||
|
||||
[node name="ScreenBounds" type="MeshInstance2D" parent="." unique_id=183856023]
|
||||
mesh = SubResource("QuadMesh_d1q6j")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1472509820]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="New" type="Button" parent="VBoxContainer" unique_id=1947771523]
|
||||
layout_mode = 2
|
||||
text = "New"
|
||||
|
||||
[node name="Save" type="Button" parent="VBoxContainer" unique_id=678449908]
|
||||
layout_mode = 2
|
||||
text = "Save"
|
||||
|
||||
[node name="Close" type="Button" parent="VBoxContainer" unique_id=582698789]
|
||||
layout_mode = 2
|
||||
text = "Close"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/New" to="." method="_on_new_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/Save" to="." method="_on_save_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/Close" to="." method="_on_close_pressed"]
|
||||
@@ -0,0 +1,44 @@
|
||||
extends Control
|
||||
|
||||
var sphere_mesh = SphereMesh.new()
|
||||
var quad_mesh = QuadMesh.new()
|
||||
|
||||
var screen_bound_mesh: MeshInstance2D
|
||||
|
||||
var button_pannel: Node
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
DisplayData.WINDOW_SIZE = Vector2(DisplayServer.window_get_size())
|
||||
DisplayData.WINDOW_CENTER = DisplayData.WINDOW_SIZE / 2
|
||||
button_pannel = get_node("VBoxContainer")
|
||||
screen_bound_mesh = get_node("ScreenBounds")
|
||||
|
||||
func update():
|
||||
if DisplayData.DISPLAY_MODE_IDX == 0:
|
||||
screen_bound_mesh.mesh = sphere_mesh
|
||||
screen_bound_mesh.mesh.radius = DisplayData.DISPLAY_PARAMETERS[0]
|
||||
screen_bound_mesh.mesh.height = DisplayData.DISPLAY_PARAMETERS[1]
|
||||
else:
|
||||
screen_bound_mesh.mesh = quad_mesh
|
||||
screen_bound_mesh.mesh.size = Vector2(DisplayData.DISPLAY_PARAMETERS[0], DisplayData.DISPLAY_PARAMETERS[1])
|
||||
screen_bound_mesh.position = DisplayData.WINDOW_CENTER
|
||||
|
||||
var pannel_size = button_pannel.size
|
||||
var panel_position = DisplayData.WINDOW_CENTER + Vector2(0., 0.5) * DisplayData.DISPLAY_PARAMETERS[0]
|
||||
panel_position -= Vector2(pannel_size.x/2, pannel_size.y/2)
|
||||
button_pannel.position = panel_position
|
||||
|
||||
|
||||
func _on_new_pressed() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
func _on_save_pressed() -> void:
|
||||
SettingSignals.widget_settings_saved.emit()
|
||||
SettingSignals.widget_settings_closed.emit()
|
||||
|
||||
|
||||
func _on_close_pressed() -> void:
|
||||
SettingSignals.widget_settings_closed.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://lcxue7n3hrl4
|
||||
Reference in New Issue
Block a user