Added settings menu.
This commit is contained in:
parent
7123b47938
commit
651eba8948
3
.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.md5
Normal file
3
.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.md5
Normal file
@ -0,0 +1,3 @@
|
||||
source_md5="1368e2dcff7491a4728920386f666c89"
|
||||
dest_md5="3337b97d524c96a3da735c3a51de18fe"
|
||||
|
BIN
.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.stex
Normal file
BIN
.import/close.png-3d17fd8754f6244ca24b7915a06a12bb.stex
Normal file
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
source_md5="fd3b3922cdfeffe86b40fa26f10764b0"
|
||||
dest_md5="eb0c3c92866383db51b8d78696d2ed2b"
|
||||
|
BIN
.import/close_hover.png-50bb62d3aaba3846e79e3db8d1f8a4ad.stex
Normal file
BIN
.import/close_hover.png-50bb62d3aaba3846e79e3db8d1f8a4ad.stex
Normal file
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
source_md5="a78e4282af889cba694e00ae094a1529"
|
||||
dest_md5="c322985f974e51fdb8dd00f8fbd153ac"
|
||||
|
BIN
.import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.stex
Normal file
BIN
.import/close_pressed.png-81e5d53bea00f1f05292aaa00fc94960.stex
Normal file
Binary file not shown.
@ -18,4 +18,4 @@ scroll_bar_pressed_color = Color( 0.396078, 0.435294, 0.447059, 1 )
|
||||
casual_topic_color = Color( 0.14902, 0.172549, 0.203922, 1 )
|
||||
daily_topic_color = Color( 0.0980392, 0.180392, 0.305882, 1 )
|
||||
urgent_topic_color = Color( 0.290196, 0.152941, 0.203922, 1 )
|
||||
add_topic_button_color = Color( 0.258824, 0.290196, 0.345098, 1 )
|
||||
add_topic_button_color = Color( 0.231373, 0.266667, 0.321569, 1 )
|
||||
|
@ -49,6 +49,11 @@ _global_script_classes=[ {
|
||||
"language": "GDScript",
|
||||
"path": "res://user_interface/chat_panel/message_group_container.gd"
|
||||
}, {
|
||||
"base": "Object",
|
||||
"class": "MiscellaneousData",
|
||||
"language": "GDScript",
|
||||
"path": "res://system/data/miscellaneous_data/miscellaneous_data_singleton.gd"
|
||||
}, {
|
||||
"base": "Reference",
|
||||
"class": "Topic",
|
||||
"language": "GDScript",
|
||||
@ -83,6 +88,7 @@ _global_script_class_icons={
|
||||
"MessageEditable": "",
|
||||
"MessageGroup": "",
|
||||
"MessageGroupContainer": "",
|
||||
"MiscellaneousData": "",
|
||||
"Topic": "",
|
||||
"TopicData": "",
|
||||
"TopicDraggable": "",
|
||||
@ -101,8 +107,9 @@ config/icon="res://icon.png"
|
||||
Data="*res://system/data/data_singleton.gd"
|
||||
Users="*res://system/users/users_singleton.gd"
|
||||
Time="*res://system/time/time_singleton.gd"
|
||||
PingSystem="*res://system/ping_system/ping_system.tscn"
|
||||
PingSystem="*res://system/ping_system/ping_system_singleton.tscn"
|
||||
Call="*res://system/call/call_singleton.gd"
|
||||
Settings="*res://system/settings/settings_singleton.gd"
|
||||
|
||||
[display]
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
extends Node
|
||||
|
||||
# warning-ignore:unused_signal
|
||||
signal requested
|
||||
|
||||
var is_call_active: bool = false
|
||||
|
@ -4,11 +4,10 @@ signal loaded()
|
||||
|
||||
var messages: MessageData
|
||||
var topics: TopicData
|
||||
var miscellaneous: MiscellaneousData
|
||||
|
||||
|
||||
func _ready():
|
||||
|
||||
|
||||
var autosave_timer = Timer.new()
|
||||
autosave_timer.wait_time = 600.0 # Every ten minutes.
|
||||
autosave_timer.autostart = true
|
||||
@ -24,6 +23,7 @@ func _notification(what):
|
||||
func setup():
|
||||
messages = MessageData.new()
|
||||
topics = TopicData.new()
|
||||
miscellaneous = MiscellaneousData.new()
|
||||
yield(get_tree(), "idle_frame")
|
||||
_load_data()
|
||||
|
||||
@ -31,9 +31,11 @@ func setup():
|
||||
func _load_data():
|
||||
messages.load_data()
|
||||
topics.load_data()
|
||||
miscellaneous.load_data()
|
||||
emit_signal("loaded")
|
||||
|
||||
|
||||
func _save_data():
|
||||
messages.save_data()
|
||||
topics.save_data()
|
||||
miscellaneous.save_data()
|
||||
|
@ -17,6 +17,7 @@ func get_user() -> 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):
|
||||
|
@ -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!
|
||||
|
@ -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()
|
@ -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!
|
||||
|
@ -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"]
|
4
system/settings/settings_singleton.gd
Normal file
4
system/settings/settings_singleton.gd
Normal file
@ -0,0 +1,4 @@
|
||||
extends Node
|
||||
|
||||
# warning-ignore:unused_signal
|
||||
signal settings_menu_requested
|
@ -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:
|
||||
|
@ -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 = ""
|
||||
|
10
user_interface/fonts/separator_font.tres
Normal file
10
user_interface/fonts/separator_font.tres
Normal file
@ -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 )
|
@ -20,6 +20,7 @@ func _exit_tree():
|
||||
Data._save_data()
|
||||
Data.messages.free()
|
||||
Data.topics.free()
|
||||
Data.miscellaneous.free()
|
||||
|
||||
|
||||
func _on_user_switched():
|
||||
|
@ -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"]
|
||||
|
123
user_interface/settings_menu/debug_settings/debug_settings.tscn
Normal file
123
user_interface/settings_menu/debug_settings/debug_settings.tscn
Normal file
@ -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"]
|
6
user_interface/settings_menu/debug_settings/restart.gd
Normal file
6
user_interface/settings_menu/debug_settings/restart.gd
Normal file
@ -0,0 +1,6 @@
|
||||
extends Control
|
||||
|
||||
|
||||
func _on_RestartButton_pressed():
|
||||
# warning-ignore:return_value_discarded
|
||||
get_tree().reload_current_scene()
|
33
user_interface/settings_menu/debug_settings/time_offset.gd
Normal file
33
user_interface/settings_menu/debug_settings/time_offset.gd
Normal file
@ -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"
|
BIN
user_interface/settings_menu/icons/close.png
Normal file
BIN
user_interface/settings_menu/icons/close.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
35
user_interface/settings_menu/icons/close.png.import
Normal file
35
user_interface/settings_menu/icons/close.png.import
Normal file
@ -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
|
BIN
user_interface/settings_menu/icons/close_hover.png
Normal file
BIN
user_interface/settings_menu/icons/close_hover.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
35
user_interface/settings_menu/icons/close_hover.png.import
Normal file
35
user_interface/settings_menu/icons/close_hover.png.import
Normal file
@ -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
|
BIN
user_interface/settings_menu/icons/close_pressed.png
Normal file
BIN
user_interface/settings_menu/icons/close_pressed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
35
user_interface/settings_menu/icons/close_pressed.png.import
Normal file
35
user_interface/settings_menu/icons/close_pressed.png.import
Normal file
@ -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
|
20
user_interface/settings_menu/settings_menu.gd
Normal file
20
user_interface/settings_menu/settings_menu.gd
Normal file
@ -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
|
BIN
user_interface/settings_menu/settings_menu.theme
Normal file
BIN
user_interface/settings_menu/settings_menu.theme
Normal file
Binary file not shown.
80
user_interface/settings_menu/settings_menu.tscn
Normal file
80
user_interface/settings_menu/settings_menu.tscn
Normal file
@ -0,0 +1,80 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://user_interface/settings_menu/settings_menu.theme" type="Theme" id=1]
|
||||
[ext_resource path="res://user_interface/settings_menu/settings_menu.gd" type="Script" id=2]
|
||||
[ext_resource path="res://user_interface/settings_menu/icons/close_hover.png" type="Texture" id=3]
|
||||
[ext_resource path="res://user_interface/settings_menu/icons/close_pressed.png" type="Texture" id=4]
|
||||
[ext_resource path="res://user_interface/settings_menu/icons/close.png" type="Texture" id=5]
|
||||
[ext_resource path="res://user_interface/settings_menu/debug_settings/debug_settings.tscn" type="PackedScene" id=6]
|
||||
|
||||
[node name="SettingsMenu" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme = ExtResource( 1 )
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
self_modulate = Color( 0, 0, 0, 0.501961 )
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
custom_constants/margin_right = 32
|
||||
custom_constants/margin_top = 32
|
||||
custom_constants/margin_left = 32
|
||||
custom_constants/margin_bottom = 32
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="MarginContainer"]
|
||||
margin_left = 32.0
|
||||
margin_top = 32.0
|
||||
margin_right = 992.0
|
||||
margin_bottom = 544.0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/PanelContainer"]
|
||||
margin_right = 960.0
|
||||
margin_bottom = 512.0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/PanelContainer/MarginContainer"]
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = 952.0
|
||||
margin_bottom = 504.0
|
||||
|
||||
[node name="CloseButton" type="TextureButton" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
self_modulate = Color( 1, 1, 1, 0.658824 )
|
||||
margin_left = 912.0
|
||||
margin_right = 944.0
|
||||
margin_bottom = 32.0
|
||||
size_flags_horizontal = 8
|
||||
texture_normal = ExtResource( 5 )
|
||||
texture_pressed = ExtResource( 4 )
|
||||
texture_hover = ExtResource( 3 )
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
margin_top = 40.0
|
||||
margin_right = 944.0
|
||||
margin_bottom = 496.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer/ScrollContainer"]
|
||||
margin_right = 944.0
|
||||
margin_bottom = 151.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="DebugSettings" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 6 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 944.0
|
||||
margin_bottom = 151.0
|
||||
|
||||
[connection signal="gui_input" from="ColorRect" to="." method="_on_ColorRect_gui_input"]
|
||||
[connection signal="pressed" from="MarginContainer/PanelContainer/MarginContainer/VBoxContainer/CloseButton" to="." method="_on_CloseButton_pressed"]
|
@ -1,5 +1,33 @@
|
||||
extends TextureButton
|
||||
|
||||
|
||||
const START_CALL_NORMAL = preload("res://user_interface/tool_bar/icons/start_call.png")
|
||||
const START_CALL_HOVER = preload("res://user_interface/tool_bar/icons/start_call_hover.png")
|
||||
const START_CALL_PRESSED = preload("res://user_interface/tool_bar/icons/start_call_pressed.png")
|
||||
|
||||
const END_CALL_NORMAL = preload("res://user_interface/tool_bar/icons/end_call.png")
|
||||
const END_CALL_HOVER = preload("res://user_interface/tool_bar/icons/end_call_hover.png")
|
||||
const END_CALL_PRESSED = preload("res://user_interface/tool_bar/icons/end_call_pressed.png")
|
||||
|
||||
|
||||
func _on_toggled(_button_pressed):
|
||||
Call.request_call()
|
||||
|
||||
|
||||
func _on_pressed():
|
||||
if Call.is_call_active:
|
||||
Call.is_call_active = false
|
||||
texture_normal = START_CALL_NORMAL
|
||||
texture_hover = START_CALL_HOVER
|
||||
texture_pressed = START_CALL_PRESSED
|
||||
else:
|
||||
Call.is_call_active = true
|
||||
texture_normal = END_CALL_NORMAL
|
||||
texture_hover = END_CALL_HOVER
|
||||
texture_pressed = END_CALL_PRESSED
|
||||
|
||||
|
||||
func _on_mouse_exited():
|
||||
if Call.is_call_active:
|
||||
#texture_hover = END_CALL_HOVER
|
||||
pass
|
||||
|
@ -22,5 +22,10 @@ func _on_pressed():
|
||||
Call.muted = true
|
||||
mute_dash.visible = true
|
||||
texture_normal = UNMUTE_NORMAL
|
||||
texture_hover = UNMUTE_HOVER
|
||||
texture_hover = UNMUTE_NORMAL
|
||||
texture_pressed = UNMUTE_PRESSED
|
||||
|
||||
|
||||
func _on_mouse_exited():
|
||||
if Call.muted:
|
||||
texture_hover = UNMUTE_HOVER
|
||||
|
@ -2,5 +2,4 @@ extends TextureButton
|
||||
# settings_button.gd
|
||||
|
||||
func _on_pressed():
|
||||
# warning-ignore:return_value_discarded
|
||||
get_tree().reload_current_scene()
|
||||
Settings.emit_signal("settings_menu_requested")
|
||||
|
@ -107,7 +107,6 @@ margin_top = 7.0
|
||||
margin_right = 214.0
|
||||
margin_bottom = 39.0
|
||||
size_flags_vertical = 4
|
||||
toggle_mode = true
|
||||
texture_normal = ExtResource( 7 )
|
||||
texture_pressed = ExtResource( 16 )
|
||||
texture_hover = ExtResource( 4 )
|
||||
@ -132,6 +131,7 @@ script = ExtResource( 11 )
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource( 12 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
@ -149,7 +149,9 @@ texture_pressed = ExtResource( 15 )
|
||||
texture_hover = ExtResource( 14 )
|
||||
script = ExtResource( 18 )
|
||||
|
||||
[connection signal="mouse_exited" from="Margin/Structure/CallButton" to="Margin/Structure/CallButton" method="_on_mouse_exited"]
|
||||
[connection signal="pressed" from="Margin/Structure/CallButton" to="Margin/Structure/CallButton" method="_on_pressed"]
|
||||
[connection signal="toggled" from="Margin/Structure/CallButton" to="Margin/Structure/CallButton" method="_on_toggled"]
|
||||
[connection signal="mouse_exited" from="Margin/Structure/MuteButton" to="Margin/Structure/MuteButton" method="_on_mouse_exited"]
|
||||
[connection signal="pressed" from="Margin/Structure/MuteButton" to="Margin/Structure/MuteButton" method="_on_pressed"]
|
||||
[connection signal="toggled" from="Margin/Structure/MuteButton" to="Margin/Structure/MuteButton" method="_on_toggled"]
|
||||
[connection signal="pressed" from="Margin/Structure/SettingsButton" to="Margin/Structure/SettingsButton" method="_on_pressed"]
|
||||
|
@ -6,6 +6,7 @@
|
||||
[ext_resource path="res://user_interface/topic_panel/add_button.gd" type="Script" id=4]
|
||||
|
||||
[node name="AddButton" type="TextureButton"]
|
||||
self_modulate = Color( 0.231373, 0.266667, 0.321569, 1 )
|
||||
rect_min_size = Vector2( 0, 56 )
|
||||
size_flags_horizontal = 3
|
||||
texture_normal = ExtResource( 1 )
|
||||
|
@ -33,9 +33,6 @@ func _gui_input(event):
|
||||
if not editable.edit_mode:
|
||||
if event.doubleclick:
|
||||
editable._enable_edit_mode()
|
||||
editable.text_edit.grab_focus()
|
||||
yield(get_tree(), "idle_frame")
|
||||
editable.text_edit.select_all()
|
||||
elif !_in_fit_in_animation:
|
||||
_set_as_grabbed()
|
||||
|
||||
|
@ -94,9 +94,6 @@ func _on_popup_menu_id_pressed(id):
|
||||
Data.topics.insert_topic(parent.get_index())
|
||||
1: # Edit.
|
||||
_enable_edit_mode()
|
||||
text_edit.grab_focus()
|
||||
yield(get_tree(), "idle_frame")
|
||||
text_edit.select_all()
|
||||
2: # Change type to CASUAL.
|
||||
if _is_part_of_multi_selection():
|
||||
parent.topic_feed._change_type_of_selected_topics(TYPE_CASUAL)
|
||||
|
@ -132,6 +132,10 @@ func _enable_edit_mode():
|
||||
|
||||
text_edit.adjust_size()
|
||||
|
||||
text_edit.grab_focus()
|
||||
yield(get_tree(), "idle_frame")
|
||||
text_edit.select_all()
|
||||
|
||||
|
||||
func _post_enable_edit_mode(): # Virtual.
|
||||
pass
|
||||
|
24
user_interface/utility_controls/line_separator.gd
Normal file
24
user_interface/utility_controls/line_separator.gd
Normal file
@ -0,0 +1,24 @@
|
||||
tool
|
||||
extends HBoxContainer
|
||||
|
||||
export(String) var tag setget _set_tag
|
||||
|
||||
onready var separation_tag = get_node("SeparationTag")
|
||||
|
||||
|
||||
func _ready():
|
||||
_set_separation_tag_text(tag)
|
||||
|
||||
|
||||
func _set_tag(value):
|
||||
tag = value
|
||||
if not separation_tag:
|
||||
return
|
||||
_set_separation_tag_text(value)
|
||||
|
||||
|
||||
func _set_separation_tag_text(text):
|
||||
if text != "":
|
||||
separation_tag.text = text
|
||||
else:
|
||||
separation_tag.text = "Separation Tag"
|
38
user_interface/utility_controls/line_separator.tscn
Normal file
38
user_interface/utility_controls/line_separator.tscn
Normal file
@ -0,0 +1,38 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://user_interface/utility_controls/line_separator.gd" type="Script" id=1]
|
||||
[ext_resource path="res://user_interface/utility_controls/separation_line.gd" type="Script" id=2]
|
||||
[ext_resource path="res://user_interface/fonts/separator_font.tres" type="DynamicFont" id=3]
|
||||
|
||||
[node name="LineSeparator" type="HBoxContainer"]
|
||||
modulate = Color( 1, 1, 1, 0.501961 )
|
||||
anchor_right = 1.0
|
||||
margin_bottom = 14.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="LeftLine" type="Control" parent="."]
|
||||
margin_right = 64.0
|
||||
margin_bottom = 15.0
|
||||
rect_min_size = Vector2( 64, 0 )
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="SeparationTag" type="Label" parent="."]
|
||||
margin_left = 68.0
|
||||
margin_right = 182.0
|
||||
margin_bottom = 15.0
|
||||
size_flags_horizontal = 4
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "[Separation Tag]"
|
||||
|
||||
[node name="RightLine" type="Control" parent="."]
|
||||
margin_left = 186.0
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 15.0
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[connection signal="resized" from="LeftLine" to="LeftLine" method="_on_resized"]
|
||||
[connection signal="resized" from="RightLine" to="RightLine" method="_on_resized"]
|
13
user_interface/utility_controls/separation_line.gd
Normal file
13
user_interface/utility_controls/separation_line.gd
Normal file
@ -0,0 +1,13 @@
|
||||
tool
|
||||
extends Control
|
||||
|
||||
|
||||
func _draw():
|
||||
draw_line(
|
||||
Vector2(0.0, get_rect().size.y * 0.5),
|
||||
Vector2(get_rect().size.x, get_rect().size.y * 0.5),
|
||||
Color.white
|
||||
)
|
||||
|
||||
func _on_resized():
|
||||
update()
|
Loading…
Reference in New Issue
Block a user