Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .gitmodules
Empty file.
2 changes: 1 addition & 1 deletion components/DataInputs/DataInputFloat/DataInputFloat.gd
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func _settings_module_changed(p_module: SettingsModule) -> void:
_spin_box.min_value = p_module.get_min()
_ignore_next_update = true
_spin_box.max_value = p_module.get_max()
_ignore_next_update = false


## Called when the orignal value is changed
Expand All @@ -69,6 +70,5 @@ func _on_spin_box_value_changed(value: float) -> void:
_ignore_next_update = false
return


_update_outline_feedback(_module.get_setter().call(value))
_ignore_next_update = false
1 change: 1 addition & 0 deletions components/DataInputs/DataInputFloat/DataInputFloat.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ custom_minimum_size = Vector2(150, 0)
layout_mode = 2
size_flags_horizontal = 10
step = 0.001
select_all_on_focus = true

[node name="Outline" type="Panel" parent="HBox/SpinBox"]
modulate = Color(1, 1, 1, 0)
Expand Down
2 changes: 1 addition & 1 deletion export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="Export/Spectrum.x86_64.linux.v1.0.0.beta.3.x86_64"
export_path="Export/SpectrumClient.x86_64.linux.v1.0.0.beta.3.x86_64"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
Expand Down
8 changes: 6 additions & 2 deletions panels/UICore/SideBar/UICorePrimarySideBar.gd
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ signal use_scroll_changed(p_use_scroll: bool)
## The ScrollContainer that contains the _tab_button_container
@export var _tab_button_scroll: ScrollContainer

## The Edit Button
@export var _edit_button: Button

## The UICore
@export var _ui_core: UICore

Expand Down Expand Up @@ -203,9 +206,11 @@ func switch_to_tab(p_tab: TabItem) -> void:

_current_tab = p_tab
_current_empty_tab = -1
_edit_button.set_pressed_no_signal(false)

if is_instance_valid(_current_tab):
Interface.show_and_fade(_current_tab.get_panel())
_edit_button.set_pressed_no_signal(_current_tab.get_panel().get_edit_mode())

if _current_tab.get_panel().get_edit_mode():
Interface.show_and_fade(_current_tab.get_panel().get_menu_bar())
Expand Down Expand Up @@ -584,8 +589,7 @@ class TabItem extends RefCounted:


#
### The Edit Button
#@export var _edit_button: Button

#
### The PanelTypeOption menu
#@export var _panel_type_option: PanelContainer
Expand Down
5 changes: 3 additions & 2 deletions panels/UICore/UICore.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[ext_resource type="Texture2D" uid="uid://cbwmiekm47cot" path="res://assets/icons/Action.svg" id="11_q5s34"]
[ext_resource type="FontFile" uid="uid://cn86ussko5res" path="res://assets/font/IntelOneMono-VariableFont_wght.ttf" id="12_ucqqu"]
[ext_resource type="LabelSettings" uid="uid://ci6veq1d2x5c4" path="res://assets/styles/DimText.tres" id="13_c1is7"]
[ext_resource type="Texture2D" uid="uid://bg5hotmf8svep" path="res://assets/logos/spectrum/dark_scaled/spectrum_dark-256x256.png" id="17_r218t"]
[ext_resource type="Texture2D" uid="uid://bsbmpadvx8wi8" path="res://assets/logos/spectrum/dark_scaled/spectrum_dark-256x256.png" id="17_r218t"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_aoeir"]
content_margin_left = 4.0
Expand Down Expand Up @@ -102,7 +102,7 @@ show_settings = true
layout_mode = 2
size_flags_vertical = 3

[node name="UICorePrimarySideBar" type="PanelContainer" parent="VBoxContainer/HBoxContainer" node_paths=PackedStringArray("_tab_button_container", "_menu_button", "_tab_control_container", "_overlay_container", "_tab_button_scroll", "_ui_core")]
[node name="UICorePrimarySideBar" type="PanelContainer" parent="VBoxContainer/HBoxContainer" node_paths=PackedStringArray("_tab_button_container", "_menu_button", "_tab_control_container", "_overlay_container", "_tab_button_scroll", "_edit_button", "_ui_core")]
custom_minimum_size = Vector2(64, 0)
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_aoeir")
Expand All @@ -112,6 +112,7 @@ _menu_button = NodePath("VBoxContainer/Menu")
_tab_control_container = NodePath("../MainContent/HSplitContainer/VSplitContainer/TabControlContainer")
_overlay_container = NodePath("../MainContent/OverlayContainer")
_tab_button_scroll = NodePath("VBoxContainer/ScrollContainer")
_edit_button = NodePath("VBoxContainer/Edit")
_ui_core = NodePath("../../..")

[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/UICorePrimarySideBar"]
Expand Down
14 changes: 9 additions & 5 deletions panels/UIDesk/DeskItemContainer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ func _ready() -> void:

_set_anchors_to_current_size.call_deferred()

update_label()
set_process(false)

await get_tree().process_frame
update_label()


## Process
Expand Down Expand Up @@ -127,19 +129,21 @@ func get_panel() -> Variant:
## Updates the label to show the correct position and size
func update_label() -> void:
if size > Vector2(180, 180):
_label_node.text = "W:" + str(_target_size.x) + " H:" + str(_target_size.y) + "\nX:" + str(_target_position.x) + " Y:" + str(_target_position.y)
_label_node.text = "W:" + str(int(_target_size.x)) + " H:" + str(int(_target_size.y)) + "\nX:" + str(int(_target_position.x)) + " Y:" + str(int(_target_position.y))
_label_node.label_settings.font_size = 16
else:
_label_node.text = "W:" + str(_target_size.x) + "\nH:" + str(_target_size.y) + "\nX:" + str(_target_position.x) + "\nY:" + str(_target_position.y)
_label_node.text = "W:" + str(int(_target_size.x)) + "\nH:" + str(int(_target_size.y)) + "\nX:" + str(int(_target_position.x)) + "\nY:" + str(int(_target_position.y))
_label_node.label_settings.font_size = 10


## Saves the state of this item for restoration later
func serialize() -> Dictionary:
return super.serialize().merged({
"type": "",
"position": [position.x, position.y],
"size": [size.x, size.y],
"anchor_left": get_anchor(SIDE_LEFT),
"anchor_right": get_anchor(SIDE_RIGHT),
"anchor_top": get_anchor(SIDE_TOP),
"anchor_bottom": get_anchor(SIDE_BOTTOM),
"serialized_panel": _panel.serialize() if _panel else {}
})

Expand Down
29 changes: 16 additions & 13 deletions panels/UIDesk/UIDesk.gd
Original file line number Diff line number Diff line change
Expand Up @@ -208,26 +208,29 @@ func deserialize(p_serialized_data: Dictionary) -> void:
var serialized_panel: Dictionary = type_convert(serialized_container.get("serialized_panel", []), TYPE_DICTIONARY)
var panel_class: String = type_convert(serialized_panel.get("class", []), TYPE_STRING)

var saved_position: Array = type_convert(serialized_container.get("position", []), TYPE_ARRAY)
var panel_position: Vector2 = Vector2.ZERO

var saved_size: Array = type_convert(serialized_container.get("size", []), TYPE_ARRAY)
var panel_size: Vector2 = Vector2.ZERO

if saved_position.size() == 2:
panel_position = Vector2(type_convert(saved_position[0], TYPE_INT), type_convert(saved_position[1], TYPE_INT))

if saved_size.size() == 2:
panel_size = Vector2(type_convert(saved_size[0], TYPE_INT), type_convert(saved_size[1], TYPE_INT))
var panel_anchor_left: float = type_convert(serialized_container.get("anchor_left"), TYPE_FLOAT)
var panel_anchor_right: float = type_convert(serialized_container.get("anchor_right"), TYPE_FLOAT)
var panel_anchor_top: float = type_convert(serialized_container.get("anchor_top"), TYPE_FLOAT)
var panel_anchor_bottom: float = type_convert(serialized_container.get("anchor_bottom"), TYPE_FLOAT)

var panel: UIPanel = UIDB.instance_panel(panel_class)

if not is_instance_valid(panel):
continue

add_panel(panel, panel_position, panel_size)
panel.deserialize(serialized_panel)
var container: UIDeskItemContainer = add_panel(panel, Vector2.ZERO, Vector2.ZERO)

container.set_anchor(SIDE_LEFT, panel_anchor_left, true, true)
container.set_anchor(SIDE_RIGHT, panel_anchor_right, true, true)
container.set_anchor(SIDE_TOP, panel_anchor_top, true, true)
container.set_anchor(SIDE_BOTTOM, panel_anchor_bottom, true, true)

container.set_offset(SIDE_LEFT, 0)
container.set_offset(SIDE_RIGHT, 0)
container.set_offset(SIDE_TOP, 0)
container.set_offset(SIDE_BOTTOM, 0)

panel.deserialize(serialized_panel)

set_grid_size(type_convert(p_serialized_data.get("grid_size", _grid_size), TYPE_INT))

Expand Down
3 changes: 0 additions & 3 deletions panels/UIProgrammer/UIProgrammer.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ popup/item_1/id = 1
layout_mode = 2
icon = ExtResource("6_xrr4a")

[node name="EditControls" parent="VBoxContainer/PanelMenuBar/HBoxContainer" index="2"]
show_settings = true

[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
Expand Down
1 change: 1 addition & 0 deletions panels/UIVirtualFixtures/UIVirtualFixtures.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ icon = ExtResource("8_7f0w5")
[node name="ZoomAll" type="Button" parent="TitleBar/HBoxContainer/ScrollContainer/HBoxContainer/Zoom Controls/HBoxContainer"]
layout_mode = 2
tooltip_text = "Center Zoom"
disabled = true
icon = ExtResource("9_fhyt7")

[node name="ZoomOut" type="Button" parent="TitleBar/HBoxContainer/ScrollContainer/HBoxContainer/Zoom Controls/HBoxContainer"]
Expand Down
4 changes: 4 additions & 0 deletions scripts/global/Interface.gd
Original file line number Diff line number Diff line change
Expand Up @@ -778,3 +778,7 @@ func _load_config(p_config: InterfaceConfig) -> void:

for script: Script in p_config.object_picker_default_items:
_object_picker_index[script] = p_config.object_picker_default_items[script]

await get_tree().process_frame

set_scale_factor(_config.scale_factor)