bcp de characters
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
extends PanelContainer
|
||||
|
||||
|
||||
var last_label := ""
|
||||
|
||||
func _ready() -> void:
|
||||
%InspectLabels.button_pressed = owner.settings.get("show_labels", false)
|
||||
%LabelsPanel.visible = %InspectLabels.button_pressed
|
||||
|
||||
Dialogic.Jump.passed_label.connect(func(x):last_label = x.identifier)
|
||||
Dialogic.Jump.passed_label.connect(update_label_list)
|
||||
Dialogic.timeline_started.connect(update_label_list)
|
||||
Dialogic.timeline_ended.connect(update_label_list)
|
||||
Dialogic.Jump.jumped_to_label.connect(update_label_list)
|
||||
Dialogic.Jump.switched_timeline.connect(update_label_list)
|
||||
|
||||
update_label_list()
|
||||
|
||||
|
||||
func _on_inspect_labels_toggled(toggled_on: bool) -> void:
|
||||
%LabelsPanel.visible = toggled_on
|
||||
owner.settings["show_labels"] = toggled_on
|
||||
owner.save()
|
||||
|
||||
|
||||
func update_label_list(_ignore="") -> void:
|
||||
%LabelList.clear()
|
||||
|
||||
if not Dialogic.current_timeline:
|
||||
%LabelInfo.show()
|
||||
%LabelInfo.text = "No timeline active."
|
||||
%LabelList.hide()
|
||||
|
||||
var idx := 0
|
||||
for ev in Dialogic.current_timeline_events:
|
||||
if ev is DialogicLabelEvent:
|
||||
%LabelList.add_item(ev.name + " ("+str(idx)+")")
|
||||
%LabelList.set_item_metadata(%LabelList.item_count-1, ev.name)
|
||||
if ev.name == last_label:
|
||||
%LabelList.set_item_custom_fg_color(%LabelList.item_count-1, Color.SKY_BLUE)
|
||||
idx += 1
|
||||
|
||||
if %LabelList.item_count:
|
||||
%LabelList.show()
|
||||
%LabelInfo.hide()
|
||||
else:
|
||||
%LabelList.hide()
|
||||
%LabelInfo.show()
|
||||
%LabelInfo.text = "No labels in timeline."
|
||||
|
||||
|
||||
func _on_label_list_item_activated(index: int) -> void:
|
||||
Dialogic.Jump.jump_to_label(%LabelList.get_item_metadata(index))
|
||||
Dialogic.handle_next_event()
|
||||
@@ -0,0 +1 @@
|
||||
uid://dsco281inw6cq
|
||||
@@ -0,0 +1,27 @@
|
||||
extends PanelContainer
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
%PortraitContainers.button_pressed = owner.settings.get("portrait_container_debug", false)
|
||||
|
||||
Dialogic.event_handled.connect(_update_timeline_info_label)
|
||||
Dialogic.state_changed.connect(_update_state_label)
|
||||
|
||||
|
||||
|
||||
func _update_timeline_info_label(_ignore="") -> void:
|
||||
if Dialogic.current_timeline == null:
|
||||
%TimelineInfo.text = "Timeline: < No Timeline >"
|
||||
else:
|
||||
%TimelineInfo.text = "Timeline: "+Dialogic.current_timeline.get_identifier()
|
||||
%TimelineInfo.text += "\nEvent "+str(Dialogic.current_event_idx)+": "+Dialogic.current_timeline_events[Dialogic.current_event_idx].event_name
|
||||
|
||||
|
||||
func _update_state_label(new_state:int) -> void:
|
||||
%StateInfo.text = "State: "+["Idle", "RevealingText", "Animating", "AwaitingChoice", "Waiting"][new_state]
|
||||
|
||||
|
||||
func _on_portrait_containers_toggled(toggled_on: bool) -> void:
|
||||
Dialogic.PortraitContainers.debug_draw = toggled_on
|
||||
owner.settings["portrait_container_debug"] = toggled_on
|
||||
owner.save()
|
||||
@@ -0,0 +1 @@
|
||||
uid://dyng2eojryyv5
|
||||
@@ -0,0 +1,52 @@
|
||||
extends PanelContainer
|
||||
|
||||
var last_loaded := ""
|
||||
|
||||
func _ready() -> void:
|
||||
%SaveLoad.button_pressed = owner.settings.get("show_save_load", false)
|
||||
%SaveLoadPanel.visible = %SaveLoad.button_pressed
|
||||
|
||||
Dialogic.Save.saved.connect(update_save_list)
|
||||
Dialogic.Save.loaded.connect(func(x): last_loaded = x.slot_name)
|
||||
Dialogic.Save.loaded.connect(update_save_list)
|
||||
|
||||
update_save_list()
|
||||
|
||||
|
||||
func _on_save_load_toggled(toggled_on: bool) -> void:
|
||||
%SaveLoadPanel.visible = toggled_on
|
||||
owner.settings["show_save_load"] = toggled_on
|
||||
owner.save()
|
||||
|
||||
|
||||
func update_save_list(_ignore="") -> void:
|
||||
%SaveList.clear()
|
||||
|
||||
for i in Dialogic.Save.get_slot_names():
|
||||
%SaveList.add_item(i)
|
||||
if i == last_loaded:
|
||||
%SaveList.set_item_custom_fg_color(%SaveList.item_count-1, Color.SKY_BLUE)
|
||||
|
||||
|
||||
func _on_save_list_item_activated(index: int) -> void:
|
||||
Dialogic.Save.load(%SaveList.get_item_text(index))
|
||||
|
||||
|
||||
func _on_new_save_pressed() -> void:
|
||||
last_loaded = get_new_slot_name()
|
||||
Dialogic.Save.save(last_loaded)
|
||||
|
||||
update_save_list()
|
||||
|
||||
|
||||
func get_new_slot_name() -> String:
|
||||
var i := 1
|
||||
while Dialogic.Save.has_slot("DebugSave"+str(i)):
|
||||
i += 1
|
||||
return "DebugSave"+str(i)
|
||||
|
||||
|
||||
func _on_save_list_item_clicked(index: int, _at_position: Vector2, mouse_button_index: int) -> void:
|
||||
if mouse_button_index == MOUSE_BUTTON_MIDDLE:
|
||||
Dialogic.Save.delete_slot(%SaveList.get_item_text(index))
|
||||
update_save_list()
|
||||
@@ -0,0 +1 @@
|
||||
uid://bi0o77lgxy8xh
|
||||
@@ -0,0 +1,94 @@
|
||||
extends PanelContainer
|
||||
|
||||
|
||||
var recent := []
|
||||
var building = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
%InspectVariables.button_pressed = owner.settings.get("inspect_variables", false)
|
||||
%VariablesPanel.visible = %InspectVariables.button_pressed
|
||||
|
||||
Dialogic.VAR.variable_changed.connect(_on_variable_changed)
|
||||
|
||||
build_variable_list()
|
||||
|
||||
|
||||
func _on_inspect_variables_toggled(toggled_on: bool) -> void:
|
||||
%VariablesPanel.visible = toggled_on
|
||||
owner.settings["inspect_variables"] = toggled_on
|
||||
owner.save()
|
||||
|
||||
|
||||
func _on_variable_changed(info:Dictionary) -> void:
|
||||
if info.variable in recent:
|
||||
recent.erase(info.variable)
|
||||
recent.append(info.variable)
|
||||
update_branch(%VariablesTree.get_root())
|
||||
|
||||
|
||||
func build_variable_list(_ignore="") -> void:
|
||||
building = true
|
||||
var folded_items: Array = owner.settings.get("folded_variable_folders", [])
|
||||
%VariablesTree.clear()
|
||||
%VariablesTree.create_item()
|
||||
|
||||
for i:String in Dialogic.VAR.variables():
|
||||
build_variable_item(%VariablesTree.get_root(), i, i)
|
||||
|
||||
for i:Dialogic.VARSubsystem.VariableFolder in Dialogic.VAR.folders():
|
||||
build_variable_tree_branch(%VariablesTree.get_root(), i, folded_items)
|
||||
building = false
|
||||
|
||||
|
||||
func build_variable_tree_branch(parent_item:TreeItem, variable_folder:Dialogic.VARSubsystem.VariableFolder, folded_items:Array) -> TreeItem:
|
||||
var item: TreeItem = %VariablesTree.create_item(parent_item)
|
||||
item.set_text(0, variable_folder.path)
|
||||
for i:String in variable_folder.variables():
|
||||
build_variable_item(item, i, variable_folder.path+"."+i)
|
||||
for i:Dialogic.VARSubsystem.VariableFolder in variable_folder.folders():
|
||||
build_variable_tree_branch(item, i, folded_items)
|
||||
if variable_folder.path in folded_items:
|
||||
item.collapsed = true
|
||||
item.set_metadata(0, variable_folder)
|
||||
return item
|
||||
|
||||
|
||||
func build_variable_item(parent_item:TreeItem, variable_name:String, path:String) -> TreeItem:
|
||||
var item: TreeItem = %VariablesTree.create_item(parent_item)
|
||||
item.set_text(0, variable_name)
|
||||
item.set_text(1, str(Dialogic.VAR.get_variable(path)))
|
||||
item.set_metadata(1, path)
|
||||
return item
|
||||
|
||||
|
||||
func get_folded_items(item:TreeItem) -> Array:
|
||||
var array := []
|
||||
for child:TreeItem in item.get_children():
|
||||
if child.collapsed:
|
||||
array.append(child.get_metadata(0).path)
|
||||
array.append_array(get_folded_items(child))
|
||||
return array
|
||||
|
||||
|
||||
func update_branch(item:TreeItem) -> void:
|
||||
for i in item.get_children():
|
||||
if typeof(i.get_metadata(1)) == TYPE_STRING:
|
||||
var path: String = i.get_metadata(1)
|
||||
i.set_text(1, str(Dialogic.VAR.get_variable(path)))
|
||||
if path in recent:
|
||||
i.set_custom_bg_color(1, Color.DARK_GREEN.lerp(Color.WEB_PURPLE, (recent.find(path)+1)/float(recent.size())))
|
||||
if recent.find(path) == recent.size()-1:
|
||||
var tw := create_tween()
|
||||
tw.tween_method(func(x): i.set_custom_bg_color(1, x), i.get_custom_bg_color(1), Color.HOT_PINK, 0.1)
|
||||
tw.tween_method(func(x): i.set_custom_bg_color(1, x), Color.HOT_PINK, Color.WEB_PURPLE, 0.2)
|
||||
%VariablesTree.scroll_to_item(i)
|
||||
else:
|
||||
update_branch(i)
|
||||
|
||||
func _on_variables_tree_item_collapsed(_item: TreeItem) -> void:
|
||||
if building:
|
||||
return
|
||||
|
||||
owner.settings["folded_variable_folders"] = get_folded_items(%VariablesTree.get_root())
|
||||
owner.save()
|
||||
@@ -0,0 +1 @@
|
||||
uid://c6xr8clcl4lnj
|
||||
Reference in New Issue
Block a user