mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
add debug option to embed subwindows
This commit is contained in:
parent
ca0fc15103
commit
e405b921d5
2 changed files with 34 additions and 9 deletions
|
@ -43,6 +43,12 @@ enum ConnectionsMenuId {
|
||||||
TWITCH,
|
TWITCH,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DebugMenuId{
|
||||||
|
DECKS,
|
||||||
|
EMBED_SUBWINDOWS,
|
||||||
|
}
|
||||||
|
@onready var debug_popup_menu: PopupMenu = %Debug
|
||||||
|
|
||||||
## Weak Reference to the Deck that is currently going to be saved.
|
## Weak Reference to the Deck that is currently going to be saved.
|
||||||
var _deck_to_save: WeakRef
|
var _deck_to_save: WeakRef
|
||||||
|
|
||||||
|
@ -58,6 +64,13 @@ func _ready() -> void:
|
||||||
tab_container.add_button_pressed.connect(add_empty_deck)
|
tab_container.add_button_pressed.connect(add_empty_deck)
|
||||||
RendererPersistence.init_namespace(PERSISTENCE_NAMESPACE)
|
RendererPersistence.init_namespace(PERSISTENCE_NAMESPACE)
|
||||||
|
|
||||||
|
debug_popup_menu.set_item_checked(
|
||||||
|
DebugMenuId.EMBED_SUBWINDOWS,
|
||||||
|
RendererPersistence.get_or_create(PERSISTENCE_NAMESPACE, "config", "embed_subwindows", true)
|
||||||
|
)
|
||||||
|
|
||||||
|
get_tree().get_root().gui_embed_subwindows = RendererPersistence.get_value(PERSISTENCE_NAMESPACE, "config", "embed_subwindows")
|
||||||
|
|
||||||
recent_files = RendererPersistence.get_or_create(
|
recent_files = RendererPersistence.get_or_create(
|
||||||
PERSISTENCE_NAMESPACE, "config",
|
PERSISTENCE_NAMESPACE, "config",
|
||||||
"recent_files", []
|
"recent_files", []
|
||||||
|
@ -281,14 +294,21 @@ func _process(delta: float) -> void:
|
||||||
|
|
||||||
|
|
||||||
func _on_debug_id_pressed(id: int) -> void:
|
func _on_debug_id_pressed(id: int) -> void:
|
||||||
var d := AcceptDialog.new()
|
match id:
|
||||||
var debug_decks: DebugDecksList = DEBUG_DECKS_LIST.instantiate()
|
DebugMenuId.DECKS:
|
||||||
d.add_child(debug_decks)
|
var d := AcceptDialog.new()
|
||||||
d.canceled.connect(d.queue_free)
|
var debug_decks: DebugDecksList = DEBUG_DECKS_LIST.instantiate()
|
||||||
d.confirmed.connect(d.queue_free)
|
d.add_child(debug_decks)
|
||||||
debug_decks.item_pressed.connect(_on_debug_decks_viewer_item_pressed)
|
d.canceled.connect(d.queue_free)
|
||||||
add_child(d)
|
d.confirmed.connect(d.queue_free)
|
||||||
d.popup_centered()
|
debug_decks.item_pressed.connect(_on_debug_decks_viewer_item_pressed)
|
||||||
|
add_child(d)
|
||||||
|
d.popup_centered()
|
||||||
|
DebugMenuId.EMBED_SUBWINDOWS:
|
||||||
|
var c := debug_popup_menu.is_item_checked(id)
|
||||||
|
debug_popup_menu.set_item_checked(id, !c)
|
||||||
|
get_tree().get_root().gui_embed_subwindows = !c
|
||||||
|
RendererPersistence.set_value(PERSISTENCE_NAMESPACE, "config", "embed_subwindows", !c)
|
||||||
|
|
||||||
|
|
||||||
func _on_debug_decks_viewer_item_pressed(deck_id: String, instance_id: String) -> void:
|
func _on_debug_decks_viewer_item_pressed(deck_id: String, instance_id: String) -> void:
|
||||||
|
|
|
@ -129,9 +129,14 @@ item_1/text = "Twitch.."
|
||||||
item_1/id = 1
|
item_1/id = 1
|
||||||
|
|
||||||
[node name="Debug" type="PopupMenu" parent="MarginContainer/VSplitContainer/VBoxContainer/MenuBar"]
|
[node name="Debug" type="PopupMenu" parent="MarginContainer/VSplitContainer/VBoxContainer/MenuBar"]
|
||||||
item_count = 1
|
unique_name_in_owner = true
|
||||||
|
item_count = 2
|
||||||
item_0/text = "Decks..."
|
item_0/text = "Decks..."
|
||||||
item_0/id = 0
|
item_0/id = 0
|
||||||
|
item_1/text = "Embed subwindows"
|
||||||
|
item_1/checkable = 1
|
||||||
|
item_1/checked = true
|
||||||
|
item_1/id = 1
|
||||||
|
|
||||||
[node name="TabContainerCustom" parent="MarginContainer/VSplitContainer/VBoxContainer" instance=ExtResource("1_s3ug2")]
|
[node name="TabContainerCustom" parent="MarginContainer/VSplitContainer/VBoxContainer" instance=ExtResource("1_s3ug2")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
Loading…
Reference in a new issue