From 651eba8948dae2f25403e23a559f6dc1078ec960 Mon Sep 17 00:00:00 2001 From: mono Date: Sun, 5 Jun 2022 14:22:08 +0200 Subject: [PATCH] Added settings menu. --- ...e.png-3d17fd8754f6244ca24b7915a06a12bb.md5 | 3 + ....png-3d17fd8754f6244ca24b7915a06a12bb.stex | Bin 0 -> 246 bytes ...r.png-50bb62d3aaba3846e79e3db8d1f8a4ad.md5 | 3 + ....png-50bb62d3aaba3846e79e3db8d1f8a4ad.stex | Bin 0 -> 230 bytes ...d.png-81e5d53bea00f1f05292aaa00fc94960.md5 | 3 + ....png-81e5d53bea00f1f05292aaa00fc94960.stex | Bin 0 -> 224 bytes configuration/primary_user.tres | 2 +- project.godot | 9 +- system/call/call_singleton.gd | 1 + system/data/data_singleton.gd | 6 +- system/data/message_data/message.gd | 1 + .../message_data/message_data_singleton.gd | 31 ++++- .../miscellaneous_data_singleton.gd | 40 ++++++ .../data/topic_data/topic_data_singleton.gd | 9 +- ...ing_system.gd => ping_system_singleton.gd} | 0 ...system.tscn => ping_system_singleton.tscn} | 2 +- system/settings/settings_singleton.gd | 4 + system/time/time_singleton.gd | 2 +- user_interface/chat_panel/message_box.gd | 10 ++ user_interface/fonts/separator_font.tres | 10 ++ user_interface/main.gd | 1 + user_interface/main.tscn | 8 +- .../debug_settings/debug_settings.tscn | 123 ++++++++++++++++++ .../settings_menu/debug_settings/restart.gd | 6 + .../debug_settings/time_offset.gd | 33 +++++ user_interface/settings_menu/icons/close.png | Bin 0 -> 4944 bytes .../settings_menu/icons/close.png.import | 35 +++++ .../settings_menu/icons/close_hover.png | Bin 0 -> 5025 bytes .../icons/close_hover.png.import | 35 +++++ .../settings_menu/icons/close_pressed.png | Bin 0 -> 5042 bytes .../icons/close_pressed.png.import | 35 +++++ user_interface/settings_menu/settings_menu.gd | 20 +++ .../settings_menu/settings_menu.theme | Bin 0 -> 1186 bytes .../settings_menu/settings_menu.tscn | 80 ++++++++++++ user_interface/tool_bar/call_button.gd | 28 ++++ user_interface/tool_bar/mute_button.gd | 7 +- user_interface/tool_bar/settings_button.gd | 3 +- user_interface/tool_bar/tool_bar.tscn | 6 +- user_interface/topic_panel/add_button.tscn | 1 + user_interface/topic_panel/topic_draggable.gd | 3 - user_interface/topic_panel/topic_editable.gd | 3 - .../utility_controls/editable_text_block.gd | 4 + .../utility_controls/line_separator.gd | 24 ++++ .../utility_controls/line_separator.tscn | 38 ++++++ .../utility_controls/separation_line.gd | 13 ++ 45 files changed, 616 insertions(+), 26 deletions(-) create mode 100644 .import/close.png-3d17fd8754f6244ca24b7915a06a12bb.md5 create mode 100644 .import/close.png-3d17fd8754f6244ca24b7915a06a12bb.stex create mode 100644 .import/close_hover.png-50bb62d3aaba3846e79e3db8d1f8a4ad.md5 create mode 100644 .import/close_hover.png-50bb62d3aaba3846e79e3db8d1f8a4ad.stex create mode 100644 .import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.md5 create mode 100644 .import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.stex create mode 100644 system/data/miscellaneous_data/miscellaneous_data_singleton.gd rename system/ping_system/{ping_system.gd => ping_system_singleton.gd} (100%) rename system/ping_system/{ping_system.tscn => ping_system_singleton.tscn} (78%) create mode 100644 system/settings/settings_singleton.gd create mode 100644 user_interface/fonts/separator_font.tres create mode 100644 user_interface/settings_menu/debug_settings/debug_settings.tscn create mode 100644 user_interface/settings_menu/debug_settings/restart.gd create mode 100644 user_interface/settings_menu/debug_settings/time_offset.gd create mode 100644 user_interface/settings_menu/icons/close.png create mode 100644 user_interface/settings_menu/icons/close.png.import create mode 100644 user_interface/settings_menu/icons/close_hover.png create mode 100644 user_interface/settings_menu/icons/close_hover.png.import create mode 100644 user_interface/settings_menu/icons/close_pressed.png create mode 100644 user_interface/settings_menu/icons/close_pressed.png.import create mode 100644 user_interface/settings_menu/settings_menu.gd create mode 100644 user_interface/settings_menu/settings_menu.theme create mode 100644 user_interface/settings_menu/settings_menu.tscn create mode 100644 user_interface/utility_controls/line_separator.gd create mode 100644 user_interface/utility_controls/line_separator.tscn create mode 100644 user_interface/utility_controls/separation_line.gd diff --git a/.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.md5 b/.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.md5 new file mode 100644 index 0000000..cf67af3 --- /dev/null +++ b/.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.md5 @@ -0,0 +1,3 @@ +source_md5="1368e2dcff7491a4728920386f666c89" +dest_md5="3337b97d524c96a3da735c3a51de18fe" + diff --git a/.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.stex b/.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.stex new file mode 100644 index 0000000000000000000000000000000000000000..202382b4c6116d50a401b5c7d410b1dbad89a2bc GIT binary patch literal 246 zcmZ>F2@X+UU|;}Y79a+)*cpN3Eg%kebqWabbaOigWrqb=_#6bX_2mz+3zQrD|7`z1 zOUkqHarqw6g^P}HIB`5^I2dSQ!q(k>V1aSx)0Ug|zC@*;=P$cnx7@Z${@ zHqtI(hnYOYUObFf`ak`iSjUU~hqmQPFRczwH>qY}kl<$E>h_Wd4R^kN)$8GIr-Cz2 zBX-Dg{IBA3_!Bc%ZI3ErnF2@X+UU|;}Y79a+)*cpN3DIgAabqWabbaUGWWrqb=_-q8S_2mz+3nbjx*1P22 z>SuSP*>BYU|9yVNwz+N=9erzVK9#Y0E#c&#@_;G-^6!?$+uM3mcJJQ%lZ(ya$kbMa z1cuYDNsLdN9H%tx`0sHg`4}Dt}zw)=&)pxzK3wTXRq^6n3OsSv#XZN%JuE*=Y-mJ0X X6x;cq<7lI%zy?X31O}IrK!O1P4NGD; literal 0 HcmV?d00001 diff --git a/.import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.md5 b/.import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.md5 new file mode 100644 index 0000000..3fdcc2c --- /dev/null +++ b/.import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.md5 @@ -0,0 +1,3 @@ +source_md5="a78e4282af889cba694e00ae094a1529" +dest_md5="c322985f974e51fdb8dd00f8fbd153ac" + diff --git a/.import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.stex b/.import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.stex new file mode 100644 index 0000000000000000000000000000000000000000..fc731fbd97531b814cf0429edcc1b915426b59da GIT binary patch literal 224 zcmZ>F2@X+UU|;}Y79a+)*cpN35g-nCbqWabbaUGQWrqb=_^bx9_2mz+3nbjx*1P22 z>SuSP*>BYU|9xI#lc<^fUa5oZN(Ki+Qx-G?R~ei-kbB#0)7`uGYFHJX1*BR^FsX#7 zG|u2UDx=BwRlf2m_ek_{7}LO)|apl5?x{+9#VeHwqr`>7T*a6Hym-hwpa! zfpgr#S89G(d9Gab^_O;O{K}~P7lW@lI4@81JnZ User: func delete(): associated_message_group.get_ref().delete(self) Data.messages.dirty_flag = true + Data.messages.message_count -= 1 func edit(new_content: String): diff --git a/system/data/message_data/message_data_singleton.gd b/system/data/message_data/message_data_singleton.gd index 3d90eff..05b4ce4 100644 --- a/system/data/message_data/message_data_singleton.gd +++ b/system/data/message_data/message_data_singleton.gd @@ -1,13 +1,15 @@ extends Object class_name MessageData - signal message_added(message) signal message_group_added(message_group) +const FILE_NAME = "message_history.dat" +const MAX_MESSAGES = 200 var dirty_flag = false var loaded_message_groups = [] +var message_count = 0 func add_message(content, time_stamp, user): @@ -30,17 +32,38 @@ func add_message(content, time_stamp, user): message.content = content message.time_stamp = time_stamp message_group.add(message) + + message_count += 1 + if message_count > MAX_MESSAGES: + get_first_message().delete() + emit_signal("message_added", message) dirty_flag = true +func get_first_message() -> Message: + if loaded_message_groups.empty(): + return null + else: + return loaded_message_groups[0].messages[0] + + +func get_last_message_of_user(user: User) -> Message: + if not loaded_message_groups.empty(): + for i in range(loaded_message_groups.size() -1, -1, -1): + var message_group = loaded_message_groups[i] + if message_group.associated_user == user: + return loaded_message_groups[i].messages[-1] + return null + + func load_data(): var file = File.new() - file.open("user://message_history.dat", File.READ) + file.open("user://" + FILE_NAME, File.READ) var json_string = file.get_as_text() if validate_json(json_string): - printerr("\"message_history.dat\" was found, but is corrupted.") + printerr("\"" + FILE_NAME + "\" was found, but is corrupted.") return var message_data_list = parse_json(json_string) for message_data in message_data_list: @@ -66,7 +89,7 @@ func save_data(): message_data_list.append(message_data) var json_string = to_json(message_data_list) var file = File.new() - file.open("user://message_history.dat", File.WRITE) + file.open("user://" + FILE_NAME, File.WRITE) file.store_string(json_string) file.close() # dirty_flag needs to be set to false after successful save! diff --git a/system/data/miscellaneous_data/miscellaneous_data_singleton.gd b/system/data/miscellaneous_data/miscellaneous_data_singleton.gd new file mode 100644 index 0000000..f3b8ff4 --- /dev/null +++ b/system/data/miscellaneous_data/miscellaneous_data_singleton.gd @@ -0,0 +1,40 @@ +extends Object +class_name MiscellaneousData + +const FILE_NAME = "miscellaneous.dat" + +var close_time_stamp + + +func load_data(): + pass +# var file = File.new() +# file.open("user://" + FILE_NAME, File.READ) +# var json_string = file.get_as_text() +# if validate_json(json_string): +# printerr("\"" + FILE_NAME + "\" was found, but is corrupted.") +# return +# var message_data_list = parse_json(json_string) +# for message_data in message_data_list: +# var user = Users.get_primary() if message_data["user"] else Users.get_helper() + + +func save_data(): + # We do not apply a dirty flag here, because close_time_stamp needs to be + # saved anyway. + pass +# var message_data_list = [] +# for message_group in loaded_message_groups: +# var user = message_group.associated_user.is_primary() +# for message in message_group.messages: +# var message_data = { +# "user" : user, +# "time_stamp" : message.time_stamp, +# "content" : message.content +# } +# message_data_list.append(message_data) +# var json_string = to_json(message_data_list) +# var file = File.new() +# file.open("user://" + FILE_NAME, File.WRITE) +# file.store_string(json_string) +# file.close() diff --git a/system/data/topic_data/topic_data_singleton.gd b/system/data/topic_data/topic_data_singleton.gd index c56afdf..63c50cd 100644 --- a/system/data/topic_data/topic_data_singleton.gd +++ b/system/data/topic_data/topic_data_singleton.gd @@ -1,10 +1,11 @@ extends Object class_name TopicData - signal topic_added(topic) signal topic_inserted(topic, position) +const FILE_NAME = "topic_list.dat" + var dirty_flag = false var loaded_topics = [] @@ -36,10 +37,10 @@ func _compare_topic_index(a, b): func load_data(): var file = File.new() - file.open("user://topic_list.dat", File.READ) + file.open("user://" + FILE_NAME, File.READ) var json_string = file.get_as_text() if validate_json(json_string): - printerr("\"topic_list.dat\" was found, but is corrupted.") + printerr("\"" + FILE_NAME + "\" was found, but is corrupted.") return var topic_data_list = parse_json(json_string) for topic_data in topic_data_list: @@ -61,7 +62,7 @@ func save_data(): topic_data_list.append(topic_data) var json_string = to_json(topic_data_list) var file = File.new() - file.open("user://topic_list.dat", File.WRITE) + file.open("user://" + FILE_NAME, File.WRITE) file.store_string(json_string) file.close() # dirty_flag needs to be set to false after successful save! diff --git a/system/ping_system/ping_system.gd b/system/ping_system/ping_system_singleton.gd similarity index 100% rename from system/ping_system/ping_system.gd rename to system/ping_system/ping_system_singleton.gd diff --git a/system/ping_system/ping_system.tscn b/system/ping_system/ping_system_singleton.tscn similarity index 78% rename from system/ping_system/ping_system.tscn rename to system/ping_system/ping_system_singleton.tscn index 5848685..79928b7 100644 --- a/system/ping_system/ping_system.tscn +++ b/system/ping_system/ping_system_singleton.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://system/ping_system/ping_system.gd" type="Script" id=1] +[ext_resource path="res://system/ping_system/ping_system_singleton.gd" type="Script" id=1] [ext_resource path="res://sounds/ping.wav" type="AudioStream" id=2] [node name="PingSystem" type="Node"] diff --git a/system/settings/settings_singleton.gd b/system/settings/settings_singleton.gd new file mode 100644 index 0000000..f70a1a5 --- /dev/null +++ b/system/settings/settings_singleton.gd @@ -0,0 +1,4 @@ +extends Node + +# warning-ignore:unused_signal +signal settings_menu_requested diff --git a/system/time/time_singleton.gd b/system/time/time_singleton.gd index 53dedba..05f28a0 100644 --- a/system/time/time_singleton.gd +++ b/system/time/time_singleton.gd @@ -1,7 +1,7 @@ extends Node -var offset = 0 # This is for debug purposes. (Doing sudden time jumps) +var offset: int = 0 # This is for debug purposes. (Doing sudden time jumps) func get_current_time() -> int: diff --git a/user_interface/chat_panel/message_box.gd b/user_interface/chat_panel/message_box.gd index 5eee2a0..46dbd32 100644 --- a/user_interface/chat_panel/message_box.gd +++ b/user_interface/chat_panel/message_box.gd @@ -10,6 +10,16 @@ func _ready(): Users.connect("switched", self, "_on_user_switched") +func _input(event): + if not text_edit.has_focus() or not text_edit.text.empty(): + return + if event is InputEventKey and event.scancode == KEY_UP: + if event.is_pressed() and not event.is_echo(): + Data.messages.get_last_message_of_user( + Users.get_current() + ).associated_node._enable_edit_mode() + + func _on_message_box_confirmed(content): if PingSystem.unhandled_ping_count == 0 and not content.empty(): text_edit.text = "" diff --git a/user_interface/fonts/separator_font.tres b/user_interface/fonts/separator_font.tres new file mode 100644 index 0000000..c430737 --- /dev/null +++ b/user_interface/fonts/separator_font.tres @@ -0,0 +1,10 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[sub_resource type="DynamicFontData" id=1] +font_path = "res://user_interface/fonts/Helvetica/Helvetica-Bold.ttf" + +[resource] +size = 14 +use_mipmaps = true +use_filter = true +font_data = SubResource( 1 ) diff --git a/user_interface/main.gd b/user_interface/main.gd index e32790d..fc16847 100644 --- a/user_interface/main.gd +++ b/user_interface/main.gd @@ -20,6 +20,7 @@ func _exit_tree(): Data._save_data() Data.messages.free() Data.topics.free() + Data.miscellaneous.free() func _on_user_switched(): diff --git a/user_interface/main.tscn b/user_interface/main.tscn index e8d918a..d50d41c 100644 --- a/user_interface/main.tscn +++ b/user_interface/main.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://user_interface/chat_panel/chat_panel.tscn" type="PackedScene" id=1] [ext_resource path="res://user_interface/tool_bar/tool_bar.tscn" type="PackedScene" id=2] [ext_resource path="res://user_interface/topic_panel/topic_panel.tscn" type="PackedScene" id=3] [ext_resource path="res://user_interface/debug_panel/debug_panel.tscn" type="PackedScene" id=4] [ext_resource path="res://user_interface/call_panel/call_panel.tscn" type="PackedScene" id=5] +[ext_resource path="res://user_interface/settings_menu/settings_menu.tscn" type="PackedScene" id=6] [ext_resource path="res://user_interface/main.theme" type="Theme" id=9] [ext_resource path="res://user_interface/main.gd" type="Script" id=13] @@ -69,4 +70,9 @@ margin_bottom = 560.0 [node name="ChatPanel" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer" instance=ExtResource( 1 )] margin_bottom = 560.0 +[node name="SettingsCanvasLayer" type="CanvasLayer" parent="."] + +[node name="SettingsMenu" parent="SettingsCanvasLayer" instance=ExtResource( 6 )] +visible = false + [connection signal="resized" from="." to="." method="_on_resized"] diff --git a/user_interface/settings_menu/debug_settings/debug_settings.tscn b/user_interface/settings_menu/debug_settings/debug_settings.tscn new file mode 100644 index 0000000..f48feef --- /dev/null +++ b/user_interface/settings_menu/debug_settings/debug_settings.tscn @@ -0,0 +1,123 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://user_interface/utility_controls/line_separator.tscn" type="PackedScene" id=1] +[ext_resource path="res://user_interface/settings_menu/debug_settings/time_offset.gd" type="Script" id=2] +[ext_resource path="res://user_interface/settings_menu/debug_settings/restart.gd" type="Script" id=3] + +[node name="DebugSettings" type="VBoxContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LineSeparator" parent="." instance=ExtResource( 1 )] +anchor_right = 0.0 +margin_right = 1024.0 +margin_bottom = 15.0 +tag = "Debug Settings" + +[node name="TimeOffset" type="Control" parent="."] +margin_top = 19.0 +margin_right = 1024.0 +margin_bottom = 83.0 +rect_min_size = Vector2( 0, 64 ) +script = ExtResource( 2 ) + +[node name="LabelTimeOffset" type="Label" parent="TimeOffset"] +margin_top = 5.0 +margin_right = 79.0 +margin_bottom = 19.0 +text = "Time Offset:" + +[node name="Hours" type="Label" parent="TimeOffset"] +margin_left = 34.0 +margin_top = 32.0 +margin_right = 76.0 +margin_bottom = 46.0 +text = "Hours:" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SpinBoxHours" type="SpinBox" parent="TimeOffset"] +margin_left = 86.0 +margin_top = 28.0 +margin_right = 160.0 +margin_bottom = 52.0 +min_value = -48.0 +max_value = 48.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Minutes" type="Label" parent="TimeOffset"] +margin_left = 186.0 +margin_top = 32.0 +margin_right = 242.0 +margin_bottom = 46.0 +text = "Minutes:" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SpinBoxMinutes" type="SpinBox" parent="TimeOffset"] +margin_left = 253.0 +margin_top = 28.0 +margin_right = 327.0 +margin_bottom = 52.0 +min_value = -59.0 +max_value = 59.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ApplyTimeOffset" type="Button" parent="TimeOffset"] +margin_left = 363.0 +margin_top = 28.0 +margin_right = 490.0 +margin_bottom = 48.0 +text = "Apply Time Offset" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LabelTO" type="Label" parent="TimeOffset"] +margin_left = 509.0 +margin_top = 32.0 +margin_right = 549.0 +margin_bottom = 46.0 +text = "to:" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Restart" type="Control" parent="."] +margin_top = 87.0 +margin_right = 1024.0 +margin_bottom = 151.0 +rect_min_size = Vector2( 0, 64 ) +script = ExtResource( 3 ) + +[node name="LabelRestart" type="Label" parent="Restart"] +margin_right = 40.0 +margin_bottom = 14.0 +text = "Restart:" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="RestartButton" type="Button" parent="Restart"] +margin_left = 34.0 +margin_top = 29.0 +margin_right = 46.0 +margin_bottom = 49.0 +text = "Restart Application" +__meta__ = { +"_edit_use_anchors_": false +} + +[connection signal="value_changed" from="TimeOffset/SpinBoxHours" to="TimeOffset" method="_update_unapplied_time_offset"] +[connection signal="value_changed" from="TimeOffset/SpinBoxMinutes" to="TimeOffset" method="_update_unapplied_time_offset"] +[connection signal="pressed" from="TimeOffset/ApplyTimeOffset" to="TimeOffset" method="_on_ApplyTimeOffset_pressed"] +[connection signal="pressed" from="Restart/RestartButton" to="Restart" method="_on_RestartButton_pressed"] diff --git a/user_interface/settings_menu/debug_settings/restart.gd b/user_interface/settings_menu/debug_settings/restart.gd new file mode 100644 index 0000000..4f430b3 --- /dev/null +++ b/user_interface/settings_menu/debug_settings/restart.gd @@ -0,0 +1,6 @@ +extends Control + + +func _on_RestartButton_pressed(): +# warning-ignore:return_value_discarded + get_tree().reload_current_scene() diff --git a/user_interface/settings_menu/debug_settings/time_offset.gd b/user_interface/settings_menu/debug_settings/time_offset.gd new file mode 100644 index 0000000..f595fed --- /dev/null +++ b/user_interface/settings_menu/debug_settings/time_offset.gd @@ -0,0 +1,33 @@ +extends Control + +onready var label_t_o = get_node("LabelTO") +onready var spin_box_hours = get_node("SpinBoxHours") +onready var spin_box_minutes = get_node("SpinBoxMinutes") + +var unapplied_time_offset: int + + +func _ready(): +# warning-ignore:integer_division + var offset_hours = Time.offset / 3600 +# warning-ignore:integer_division + var offset_minutes = Time.offset % 3600 / 60 + + spin_box_hours.value = offset_hours + spin_box_minutes.value = offset_minutes + _display_applied_time_offset() + + +func _update_unapplied_time_offset(_value): + var offset_hours = spin_box_hours.value * 3600 + var offset_minutes = spin_box_minutes.value * 60 + unapplied_time_offset = offset_hours + offset_minutes + + +func _on_ApplyTimeOffset_pressed(): + Time.offset = unapplied_time_offset + _display_applied_time_offset() + + +func _display_applied_time_offset(): + label_t_o.text = "Applied Time Offset: " + str(Time.offset) + "s" diff --git a/user_interface/settings_menu/icons/close.png b/user_interface/settings_menu/icons/close.png new file mode 100644 index 0000000000000000000000000000000000000000..b2c15af9a76d2a224697cf9ad8964f554fc6c4a0 GIT binary patch literal 4944 zcmeHKc~n#95|2_UL=cLCidZiZD+)<&_S`@~2wSRX5CoJyu9$3NB#Sl%=AgKozUFPzwkuQjkhpLElY4#q;`)=e+)B&dFWAnfcAk@0*$A zOA##fHOJfH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ePt3(20mj;Pq*NGr8!QBn- zs^wq+QbY{{T4|I_#nEyJ23!vItY0P*0E3Ep9hVU5F93LQB?8b%bP`DP)}k>~f*T%i zRf;8?-t{yAc~2o-Y-k0OL3gxEru2tyJvk&aN9L?N9eCW3T`#h@`*LMD?r4vH^RsbQH2 z(L-V2BoxD;(^(M2lrV`PM4=JsAj~ETB{T+6!h$3$Dku?(S&VTI%akZqm2lMfsPs@` z3<{zMg)oCgBhnaZmNntYRbPB|vgAfa3u-NaE zf)S+(t3^F31td}F28n)SI9NIuwXnWYF#y9lmJNreL}0aC86=lSaS8gM0KKK5zya6M zZSg}@n8pTu&5u=mAhLe+ZL|rZP=g2n428>qMWaqsa11ia0%kWV5=FwY2n6f!v66bT zj{ePd2`Lbj0wN%h!lJN=bcoF)!XS%AWJ)Nom@PqsEG*9V9INCKwFXuq9uZikST~R!S+c&T-(>4b{vSSE4GQCi0A@G3 zh7A{NR*~Nht1-Ux6#j#sF*^Q14;b`ECm+P`N4h@J^+61Lkn+ds`bgIYG4MgkAFJ#C zMi>6waR-rM|9~{uVP>yuj}|)!J?49P1clc0W>%PA1T7P*cy#B~O!#MD7KocI#B;oI z%zxel&%ikn5(V6SJkM~yKXzC*EK|ZS?^Qg1kYjIepKFmy&&a5_aNWVYO;M0o@)>AU zU)_3@X+CV1g>wlgv^rif5>jrTEUWF?a?I%A@ADsStwd_I zzLvjR`NSm!ObwWxSDGiVD?gr7kub4K66~6>qQujx+G<8w=PsaK(A_?G_yVQqlc literal 0 HcmV?d00001 diff --git a/user_interface/settings_menu/icons/close.png.import b/user_interface/settings_menu/icons/close.png.import new file mode 100644 index 0000000..3be8729 --- /dev/null +++ b/user_interface/settings_menu/icons/close.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://user_interface/settings_menu/icons/close.png" +dest_files=[ "res://.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/user_interface/settings_menu/icons/close_hover.png b/user_interface/settings_menu/icons/close_hover.png new file mode 100644 index 0000000000000000000000000000000000000000..c2a002f1cccb26794edf346dc0b006202378f27a GIT binary patch literal 5025 zcmeHKc~leU77yW}kg`~*3KBF1p$begSxHjD7FI1w*)5ACGZP4q#Ux0?76BCn)Cwq~ zh!q8?%kwF?0amaTu>y*q@B|bD6;KhdD!8DX1XMh)|9H;pf6h5GnfdO$zkBcRyZ4@a z8Gb$<2DrI63~5={u0!;?lknNNJ@H&!D#Cz1%@j9`H2LXTq+dBBLw9t8A3o* zA|VE&Y9GuC+wydg{`#(EwYCdRQJD32tQ!r5FBF7>--awNZtWTejb?qd7cU3j=pO{% zyjY!HE&J}d$-Z5syPH#O?&nwR?X6q2J)-5y#9zth=G__1<#rmGSUKDD`TDkvZ77ta zmM`ufFk2vPTl?}gp>AncmtF*|{z=TUSC-qz3-0`>6@k4M-kM$3(P4Rg#i{Y*GaZMH z9qPX-Su-Zy7#Y%F(ZKUGyly+9bZTvM#&JY#nW^i_Ue+BQpUHD_$Z8q6czAfvF&=KBZ5gSEf3eSctIfBVu`O4fjImI|U@k~sae{cNc8Jz9|!*VF~-Y=!DL6!2jd)e_#X{njdJLCS4mHQO85xijokPtUa*xdp3-A6Y79 zxzew3i$VFS&S#5p+0G0T>Ll2wL)XF^quI%@s@Q*w+G1Kjw~7 zV+h;b@to#kcPxIQX2%8ycXL`!4A8F11NO@V<9_FSH_yAS%Kct@@IZP<Jp*7pVZL|M zWuShfb$UpC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D7&f)QU~MjBVUL zD8%a8S2R}^4t+niDa9@d`-7I*hPU{9t*~xm)*fRgLido9?pdsnQ*-xx?Jx8=J5Cyz zIuv46+X^WCZk$78cf_>sh?ok5JgQTD&?~ghIp*dU zz^!X>81ID*=0N)wdcEnvVaqm}7McVXV)N@&oAL4gnSLCT98q2qly+RV{*qQ?LS2!S zfVLyEl6uTIsDATErNmQwQkZ!y_)0(CX+h4CrEH&tg9q?)e%#bkQxcokJQ&{X5aFjv z>Fs^>HsDal^?{rr*TH2S=YSR`YoppCu~G4Z_N#w7n($@!SGm4zQy*Bp+V!Z literal 0 HcmV?d00001 diff --git a/user_interface/settings_menu/icons/close_hover.png.import b/user_interface/settings_menu/icons/close_hover.png.import new file mode 100644 index 0000000..9b57e2f --- /dev/null +++ b/user_interface/settings_menu/icons/close_hover.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/close_hover.png-50bb62d3aaba3846e79e3db8d1f8a4ad.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://user_interface/settings_menu/icons/close_hover.png" +dest_files=[ "res://.import/close_hover.png-50bb62d3aaba3846e79e3db8d1f8a4ad.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/user_interface/settings_menu/icons/close_pressed.png b/user_interface/settings_menu/icons/close_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..688b945f251d6749ebaf46fea9b838991f77541e GIT binary patch literal 5042 zcmeHKdpMN&7ay!8Ss`kY+A#=eX5P79GP#U^ZEgNFnsok=6i$d+bGbBB~{io;o?SIYl%zOEsb3W&s&pF@oyx(*`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^pIg7Y9W{ zLReJ>d&R%!(!-1GH)o-uAVMINsI6eK-_w)}`0vPiFE*7#ozDC~VDmZL_q5;Uu2zP% z*ldQYm>Z)C&&!pGR{3Y}#9RT7p?;(h=tKe)4`8?;oq{3Z;hKOn0ucj%d?KGuq!aNF zG!M#4B$I<8E~J8j!Lb4uhe{yxX?T!};c)>KL^y;A#{&?CL?DBBE*}Ib1nN8pU#S4@ zN-%nUR4OPQ48`XI0F4?>!0ML5IR&x?sBV1aile$k+u4;#RHKp^6Y6|#4tAb}7Hl!Gch@f0$Ngr`%; zcsdon(cUR-grqXK7geZu081dLC91+O;B;VWK~<;10P1x(8wN`XfpW1lNGy(KqE$hm zRF>)nM>))t#Zw@IHR4n~KilWC~b>lKX?u-)|xE-2d0k)eFaU(%d z1O)H!*_L{{F8GIX@cnZnt?Eu_u{WjjlzojUC~eMKasVhVtJ32q309E8U+0DwWpqj9sz;#7P3ZMF`$ z|KYe@=&GH5N{x^TKb@(@3pim#3d=S4M>H0|52QlzL${)My zBV8ZFzy~RR?5_VCU3%}1JCF$e0#d+-8MEB15ctq~(#zF3h|~P^aD(UyV3OKc;A*?t zcrkZNQF&i}mBkBFMrWG6Rzfi4dxL1*7uv|R7Q0GpudRr8K2Xp?^Fv#8nUT+(40dR)MU|cXPAkxKXWx{zZh>Ck zlj}00>&dr}#5+k|3tqXp20X1$-otc89noUOOx@Y*4ftOPkh*#Fj(4>0vN%g@HDBOr zg^ATH=tnNrI%6}kFkBdv7Pr8^G)0=ZBQ(e6!O9|}?B?RQJ57h{y)3bsk)e;_M(F^S1Q523mIW z`s#-bQRRoes`wQ>QI^uV+x+wUQ^!f2H6fckwRYNGNQH_Hcf>3li3(dKbiAE}Apg*? U*n)ZsE*k>j<>upB;S!eeH_i5_kpKVy literal 0 HcmV?d00001 diff --git a/user_interface/settings_menu/icons/close_pressed.png.import b/user_interface/settings_menu/icons/close_pressed.png.import new file mode 100644 index 0000000..3d7c68c --- /dev/null +++ b/user_interface/settings_menu/icons/close_pressed.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://user_interface/settings_menu/icons/close_pressed.png" +dest_files=[ "res://.import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/user_interface/settings_menu/settings_menu.gd b/user_interface/settings_menu/settings_menu.gd new file mode 100644 index 0000000..6e0d859 --- /dev/null +++ b/user_interface/settings_menu/settings_menu.gd @@ -0,0 +1,20 @@ +extends Control + + +func _ready(): +# warning-ignore:return_value_discarded + Settings.connect("settings_menu_requested", self, "_on_requested") + + +func _on_requested(): + visible = true + + +func _on_ColorRect_gui_input(event): + if event is InputEventMouseButton: + if event.button_index == BUTTON_LEFT and event.is_pressed(): + visible = false + + +func _on_CloseButton_pressed(): + visible = false diff --git a/user_interface/settings_menu/settings_menu.theme b/user_interface/settings_menu/settings_menu.theme new file mode 100644 index 0000000000000000000000000000000000000000..2d2a6755f8e9615f0ae178837827d9c0354940cb GIT binary patch literal 1186 zcmV;T1YP@5Q$s@n000005C8y;4FCX&1ONaiwJ-f(jSK}O00wTGMc~*b9V7zA7|jU- zdccJuBOSw_2WMas@)Qrj`w!XgK=yVGODvH@%9o=US_Tw%W;8;yijTI*Ga}fv$1i2r zn|ZE$OaXHMe*lI6@Xo%IX4i`~EAZ1rBV(16yzylX-buIrp?B$(xop8ZdM{PM+@lw+ zX3W^Lkn3gje+937W!yx!9(P{sVB7Ei=#@&Ekzmg#???Z?ylq7LAN1~clHRj33+aWD zGb&+c^`o}y{|5iDch_8u{{#m77w`w(=TVpl_b%Jg=h{p5WEdGXXn66T!zYcGD|>A( zdnaEzX?E3~k?*7_SX8IQ{|kp#e!R5?S2J3Ul3~1)+in}}p&D~mfi~G=wTygQBRzo7 zzOl*VTSX3Hcx{!6>xy-xq&4G_A;U*b3N`L3xvO;AFQZ#bORuBZ zjoOOKYLjdgySS{5!DVr$b`8qe>zn-|DRy{v{=4Mhn7AoH!e+$(0U~N>W>BX~CIpBN z9y)NyX|-^qTtJBuQ%aeF2uYoa7)crU(SgmNQl&=^AK1^24$#YeuGg&~o%oM2VbY{z zp@Ip;e+nb4)xwdoL6QUnk`MvH0}MlmV51#8a=B7sCvlophv4dZ+unS*xSv06j<=b`2O>k!2W<7NSM zjMlQp{FUojLu{-ulk?c48+WU7ey6i%A8-scvG&mXzjt3SW~0K;wl|JfdGl-po*fO@ z9Dul{7dZO00P$v}!l>=-H73yiNrApDXrGl6RZHA&cnq0&3^~oCNUG!1EIgDRim(xy za+CsRqp>iy+^RMcG9}Z0{M8-qQ;t3Hfc$EnWq5*-gb zH@IqT$r~9^E9c0>=KAQnqOsgR5_~{~Mm8ogmWd8p5*ZUy=cL-SZ89$JpM;pJ?S%*H>X