Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a9cb20c8bc | |||
| 32249fde86 | |||
| 27e137bc02 | |||
| 01daddee3b | |||
| ba512508f8 | |||
| 09ef508f49 | |||
| a54003c658 | |||
| fbad33213c | |||
| 35c7e9a25e | |||
| 57896e37df | |||
| 242879159a | |||
| 7ef9fe53b2 | |||
| 600d9cfca1 | |||
| 48796de1ba | |||
| 4a0b2cd550 |
@@ -0,0 +1 @@
|
||||
<svg height="24" viewBox="0 0 16 16" width="24" xmlns="http://www.w3.org/2000/svg"><path d="m8 1a1 1 0 0 0 -1 1v5h-2c-1.108 0-2 .892-2 2v1h10v-1c0-1.108-.892-2-2-2h-2v-5a1 1 0 0 0 -1-1zm-5 10v4l10-1v-3z" fill="#e0e0e0"/></svg>
|
||||
|
After Width: | Height: | Size: 227 B |
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bmnff63evbdhv"
|
||||
path="res://.godot/imported/Clear.svg-d661617e27b91e3580171e3447fde514.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/SignalVisualizer/Clear.svg"
|
||||
dest_files=["res://.godot/imported/Clear.svg-d661617e27b91e3580171e3447fde514.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
@@ -0,0 +1,58 @@
|
||||
class_name SignalConnection extends Object
|
||||
|
||||
# Properties
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
var signal_id: int
|
||||
var source_node_name: String
|
||||
var destination_node_name: String
|
||||
var method_signature: String
|
||||
|
||||
var description: String :
|
||||
get:
|
||||
return "ID: {signal_id} Source: {source_node_name} Destination: {destination_node_name} Method: {method_signature}".format({
|
||||
"signal_id": signal_id,
|
||||
"source_node_name": source_node_name,
|
||||
"destination_node_name": destination_node_name,
|
||||
"method_signature": method_signature,
|
||||
})
|
||||
|
||||
var dictionary_key: String :
|
||||
get:
|
||||
return "{signal_id}__{source_node_name}__{destination_node_name}__{method_signature}".format({ "signal_id": signal_id, "source_node_name": source_node_name, "destination_node_name": destination_node_name, "method_signature": method_signature.replace("::", "_") })
|
||||
|
||||
var dictionary_representation: Dictionary :
|
||||
get:
|
||||
return {
|
||||
"signal_id": signal_id,
|
||||
"source_node_name": source_node_name,
|
||||
"destination_node_name": destination_node_name,
|
||||
"method_signature": method_signature,
|
||||
}
|
||||
|
||||
# Lifecycle
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _init(signal_id: int, source_node_name: String, destination_node_name: String, method_signature: String):
|
||||
self.signal_id = signal_id
|
||||
self.source_node_name = source_node_name
|
||||
self.destination_node_name = destination_node_name
|
||||
self.method_signature = method_signature
|
||||
|
||||
# Signals
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
|
||||
|
||||
# Methods
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
uid://dm613ct57qfwa
|
||||
@@ -0,0 +1,56 @@
|
||||
class_name SignalDescription extends Object
|
||||
|
||||
# Properties
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
var id: int:
|
||||
get:
|
||||
if _source_id != null:
|
||||
return _source_id
|
||||
return get_instance_id()
|
||||
|
||||
var node_name: String
|
||||
var signal_name: String
|
||||
|
||||
var description: String :
|
||||
get:
|
||||
return "ID: {id} Node: {node_name} Signal: {signal_name}".format({
|
||||
"id": id,
|
||||
"node_name": node_name,
|
||||
"signal_name": signal_name,
|
||||
})
|
||||
|
||||
var dictionary_representation: Dictionary :
|
||||
get:
|
||||
return {
|
||||
"id": id,
|
||||
"node_name": node_name,
|
||||
"signal_name": signal_name,
|
||||
}
|
||||
|
||||
var _source_id = null
|
||||
|
||||
# Lifecycle
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _init(node_name: String, signal_name: String):
|
||||
self.node_name = node_name
|
||||
self.signal_name = signal_name
|
||||
|
||||
# Signals
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
|
||||
|
||||
# Methods
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
uid://dvgsocxisw3ae
|
||||
@@ -0,0 +1,53 @@
|
||||
class_name SignalGraph extends Object
|
||||
|
||||
# Properties
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
var name: String
|
||||
var signals: Array[SignalDescription]
|
||||
var edges: Array[SignalConnection]
|
||||
|
||||
var description: String :
|
||||
get:
|
||||
return "Signals: {signals}\nEdges: {edges}".format({
|
||||
"signals": signals.map(func (item): return item.description),
|
||||
"edges": edges.map(func (item): return item.description),
|
||||
})
|
||||
|
||||
var dictionary_representation: Dictionary :
|
||||
get:
|
||||
return {
|
||||
"name": name,
|
||||
"signals": signals.map(func (element): return element.dictionary_representation),
|
||||
"edges": edges.map(func (element): return element.dictionary_representation),
|
||||
}
|
||||
|
||||
# Lifecycle
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _init(name: String, signals: Array[SignalDescription] = [], edges: Array[SignalConnection] = []):
|
||||
self.name = name
|
||||
self.signals = signals
|
||||
self.edges = edges
|
||||
|
||||
# Signals
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
|
||||
|
||||
# Methods
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func get_source_signal_for_edge(edge: SignalConnection) -> SignalDescription:
|
||||
var result = signals.filter(func (item): return item.id == edge.signal_id)
|
||||
if result.size() > 0:
|
||||
return result[0]
|
||||
return null
|
||||
@@ -0,0 +1 @@
|
||||
uid://2qj81iy1le0a
|
||||
@@ -0,0 +1,170 @@
|
||||
@tool
|
||||
class_name SignalGraphUtility
|
||||
|
||||
static var SignalGraphNode = preload("res://addons/SignalVisualizer/Visualizer/signal_graph_node.tscn")
|
||||
static var GraphNodeItem = preload("res://addons/SignalVisualizer/Visualizer/signal_graph_node_item.tscn")
|
||||
|
||||
const SOURCE_COLOR: Color = Color.SKY_BLUE
|
||||
const DESTINATION_COLOR: Color = Color.CORAL
|
||||
const CONNECTION_TYPE: int = 0
|
||||
|
||||
#region Methods
|
||||
|
||||
static func create_signal_graph(name: String, signals: Array, edges: Array) -> SignalGraph:
|
||||
var signal_graph = SignalGraph.new(name)
|
||||
|
||||
for signal_item in signals:
|
||||
var new_signal_description = SignalDescription.new(signal_item.node_name, signal_item.signal_name)
|
||||
new_signal_description._source_id = signal_item.id
|
||||
signal_graph.signals.append(new_signal_description)
|
||||
|
||||
for connection in edges:
|
||||
var new_edge = SignalConnection.new(connection.signal_id, connection.source_node_name, connection.destination_node_name, connection.method_signature)
|
||||
signal_graph.edges.append(new_edge)
|
||||
|
||||
return signal_graph
|
||||
|
||||
static func create_signal_graph_from_node(root_node: Node, is_persistent_only: bool = false):
|
||||
var signal_graph = SignalGraph.new(root_node.scene_file_path)
|
||||
var all_nodes: Array[Node] = _gather_nodes_from_node(root_node)
|
||||
var signals: Array[SignalDescription] = []
|
||||
var edges: Array[SignalConnection] = []
|
||||
|
||||
for node in all_nodes:
|
||||
for signal_item in node.get_signal_list():
|
||||
var existing_signals = []
|
||||
var connection_list = node.get_signal_connection_list(signal_item["name"] as String)
|
||||
if connection_list.size() > 0:
|
||||
for connection in connection_list:
|
||||
var enabled_flags = connection["flags"] == CONNECT_PERSIST if is_persistent_only else true
|
||||
var should_display_connection = "name" in connection["callable"].get_object() and not connection["callable"].get_object().name.begins_with("@") and enabled_flags
|
||||
if should_display_connection:
|
||||
var signal_description: SignalDescription
|
||||
var filtered_signals = existing_signals.filter(func (element): return element.signal_name == signal_item.name and element.node_name == node.name)
|
||||
if filtered_signals.size() == 1:
|
||||
signal_description = filtered_signals[0]
|
||||
else:
|
||||
signal_description = SignalDescription.new(node.name, signal_item.name)
|
||||
existing_signals.append(signal_description)
|
||||
signals.append(signal_description)
|
||||
|
||||
var signal_edge = SignalConnection.new(signal_description.id, signal_description.node_name, connection["callable"].get_object().name, connection["callable"].get_method())
|
||||
if not signal_graph.edges.any(func (element): return element.signal_id == signal_description.id):
|
||||
edges.append(signal_edge)
|
||||
|
||||
var temp_signals = {}
|
||||
for item in signals:
|
||||
temp_signals[item.id] = item
|
||||
|
||||
var temp_edges = {}
|
||||
for item in edges:
|
||||
temp_edges[item.dictionary_key] = item
|
||||
|
||||
signal_graph.signals.assign(temp_signals.keys().map(func (key): return temp_signals[key]))
|
||||
signal_graph.edges.assign(temp_edges.keys().map(func (key): return temp_edges[key]))
|
||||
|
||||
return signal_graph
|
||||
|
||||
static func generate_signal_graph_nodes(signal_graph: SignalGraph, graph_node: GraphEdit, open_script_callable: Callable):
|
||||
var graph_nodes: Dictionary = {}
|
||||
|
||||
for signal_item in signal_graph.signals:
|
||||
var current_graph_node: SignalGraphNode
|
||||
if graph_nodes.has(signal_item.node_name):
|
||||
current_graph_node = graph_nodes[signal_item.node_name]
|
||||
if not current_graph_node:
|
||||
current_graph_node = SignalGraphNode.instantiate()
|
||||
current_graph_node.title = signal_item.node_name
|
||||
current_graph_node.name = _get_graph_node_name(signal_item.node_name)
|
||||
graph_node.add_child(current_graph_node)
|
||||
graph_nodes[signal_item.node_name] = current_graph_node
|
||||
|
||||
for edge in signal_graph.edges:
|
||||
var destination_graph_node: SignalGraphNode
|
||||
if graph_nodes.has(edge.destination_node_name):
|
||||
destination_graph_node = graph_nodes[edge.destination_node_name]
|
||||
else:
|
||||
destination_graph_node = SignalGraphNode.instantiate()
|
||||
destination_graph_node.title = edge.destination_node_name
|
||||
destination_graph_node.name = _get_graph_node_name(edge.destination_node_name)
|
||||
graph_node.add_child(destination_graph_node)
|
||||
graph_nodes[edge.destination_node_name] = destination_graph_node
|
||||
|
||||
var source_signal = signal_graph.get_source_signal_for_edge(edge)
|
||||
if source_signal != null:
|
||||
var source_graph_node: SignalGraphNode = graph_nodes[edge.source_node_name] as SignalGraphNode
|
||||
|
||||
if not source_graph_node.has_source_signal_description(source_signal.signal_name, edge.destination_node_name):
|
||||
var source_signal_label = Label.new()
|
||||
source_signal_label.text = source_signal.signal_name
|
||||
source_signal_label.name = "source_" + source_signal.signal_name + "_" + edge.destination_node_name
|
||||
source_graph_node.add_child(source_signal_label)
|
||||
|
||||
var destination_signal_name = "destination_" + source_signal.signal_name + "_" + edge.method_signature.replace("::", "__")
|
||||
var has_destination = destination_graph_node.has_destination_signal_description(source_signal.signal_name, edge.method_signature)
|
||||
if not has_destination:
|
||||
var destination_signal_item = GraphNodeItem.instantiate()
|
||||
destination_signal_item.signal_data = SignalGraphNodeItem.Metadata.new(source_signal.signal_name, edge.method_signature, edge.destination_node_name)
|
||||
destination_signal_item.text = edge.method_signature
|
||||
destination_signal_item.name = destination_signal_name
|
||||
destination_signal_item.open_script.connect(open_script_callable)
|
||||
destination_graph_node.add_child(destination_signal_item)
|
||||
|
||||
for edge in signal_graph.edges:
|
||||
var source_signal = signal_graph.get_source_signal_for_edge(edge)
|
||||
if source_signal != null:
|
||||
var source_graph_node: SignalGraphNode = graph_nodes[edge.source_node_name] as SignalGraphNode
|
||||
var destination_graph_node: SignalGraphNode = graph_nodes[edge.destination_node_name] as SignalGraphNode
|
||||
|
||||
var from_port = source_graph_node.get_source_slot(source_signal.signal_name, edge.destination_node_name)
|
||||
var to_port = destination_graph_node.get_destination_slot(source_signal.signal_name, edge.method_signature)
|
||||
|
||||
source_graph_node.set_slot(from_port, false, CONNECTION_TYPE, Color.BLACK, true, CONNECTION_TYPE, SOURCE_COLOR)
|
||||
destination_graph_node.set_slot(to_port, true, CONNECTION_TYPE, DESTINATION_COLOR, false, CONNECTION_TYPE, Color.BLACK)
|
||||
|
||||
var from_slot_index = source_graph_node.get_next_source_slot(source_signal.signal_name, edge.destination_node_name)
|
||||
var to_slot_index = destination_graph_node.get_next_destination_slot(source_signal.signal_name, edge.method_signature)
|
||||
|
||||
if from_port >= 0 and to_port >= 0:
|
||||
graph_node.connect_node(source_graph_node.name, from_slot_index, destination_graph_node.name, to_slot_index)
|
||||
else:
|
||||
print(">>> Invalid Connection Request")
|
||||
|
||||
static func generate_signal_graph_tree(signal_graph: SignalGraph, tree_node: Tree):
|
||||
var root = tree_node.create_item()
|
||||
root.set_text(0, signal_graph.name)
|
||||
|
||||
var tree_items: Dictionary = {}
|
||||
|
||||
for signal_item in signal_graph.signals:
|
||||
var node_tree_item: TreeItem
|
||||
if tree_items.has(signal_item.node_name):
|
||||
node_tree_item = tree_items[signal_item.node_name] as TreeItem
|
||||
else:
|
||||
node_tree_item = tree_node.create_item(root)
|
||||
node_tree_item.set_text(0, signal_item.node_name)
|
||||
tree_items[signal_item.node_name] = node_tree_item
|
||||
|
||||
var signal_tree_item = tree_node.create_item(node_tree_item)
|
||||
signal_tree_item.set_text(0, signal_item.signal_name)
|
||||
|
||||
for edge in signal_graph.edges.filter(func (item): return item.signal_id == signal_item.id):
|
||||
var signal_connection_tree_item = tree_node.create_item(signal_tree_item)
|
||||
signal_connection_tree_item.set_text(0, edge.destination_node_name + "::" + edge.method_signature)
|
||||
|
||||
static func _get_graph_node_name(name: String) -> String:
|
||||
return "{node_name}_graph_node".format({ "node_name": name })
|
||||
|
||||
static func _gather_nodes_from_node(root_node: Node) -> Array[Node]:
|
||||
var node_list: Array[Node] = [root_node]
|
||||
return node_list + __gather_nodes_from_node(root_node)
|
||||
|
||||
static func __gather_nodes_from_node(node: Node) -> Array[Node]:
|
||||
var nodes: Array[Node] = []
|
||||
for child in node.get_children(false):
|
||||
nodes.append(child)
|
||||
nodes += __gather_nodes_from_node(child)
|
||||
|
||||
return nodes
|
||||
|
||||
#endregion
|
||||
@@ -0,0 +1 @@
|
||||
uid://csw8uccbs0vuk
|
||||
@@ -0,0 +1,146 @@
|
||||
extends Node
|
||||
|
||||
# Properties
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
var _signal_graph: SignalGraph
|
||||
var _lambda_map: Dictionary = {}
|
||||
|
||||
# Lifecycle
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _ready():
|
||||
if OS.is_debug_build():
|
||||
EngineDebugger.register_message_capture("signal_debugger", _on_signal_debugger_message_capture)
|
||||
|
||||
# Signals
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _on_signal_debugger_message_capture(message: String, data: Array) -> bool:
|
||||
if message == "start":
|
||||
_signal_graph = generate_signal_graph()
|
||||
for signal_item in _signal_graph.signals:
|
||||
_connect_to_signal(signal_item)
|
||||
EngineDebugger.send_message(
|
||||
"signal_debugger:generated_graph",
|
||||
[[_signal_graph.signals.map(func (item): return item.dictionary_representation), _signal_graph.edges.map(func (item): return item.dictionary_representation)]]
|
||||
)
|
||||
if message == "stop" and _signal_graph:
|
||||
for signal_item in _signal_graph.signals:
|
||||
_disconnect_from_signal(signal_item)
|
||||
|
||||
if message == "invoke_signal" and data.size() == 2:
|
||||
var node_name = data[0]
|
||||
var signal_name = data[1]
|
||||
|
||||
var root_node = get_tree().current_scene
|
||||
var node = root_node if root_node.name == node_name else root_node.find_child(node_name)
|
||||
if node:
|
||||
var connection_list = node.get_signal_connection_list(signal_name)
|
||||
for connection in connection_list:
|
||||
var callable = connection["callable"]
|
||||
var bound_args = callable.get_bound_arguments()
|
||||
var bound_args_count = callable.get_bound_arguments_count()
|
||||
var method = callable.get_method()
|
||||
callable.callv([node])
|
||||
|
||||
return true
|
||||
|
||||
func _on_signal_execution(signal_name: String, node_name: String, args):
|
||||
EngineDebugger.send_message(
|
||||
"signal_debugger:signal_executed",
|
||||
[Time.get_datetime_string_from_system(), node_name, signal_name]
|
||||
)
|
||||
|
||||
# Methods
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func generate_signal_graph() -> SignalGraph:
|
||||
var graph = SignalGraphUtility.create_signal_graph_from_node(get_tree().current_scene)
|
||||
return graph
|
||||
#var signal_graph = SignalGraph.new(get_tree().current_scene.name)
|
||||
#var all_nodes: Array[Node] = _gather_nodes_in_scene()
|
||||
#var signals: Array[SignalDescription] = []
|
||||
#var edges: Array[SignalConnection] = []
|
||||
#
|
||||
#for node in all_nodes:
|
||||
#for signal_item in node.get_signal_list():
|
||||
#var existing_signals = []
|
||||
#var connection_list = node.get_signal_connection_list(signal_item["name"] as String)
|
||||
#if connection_list.size() > 0:
|
||||
#for connection in connection_list:
|
||||
#var should_display_connection = "name" in connection["callable"].get_object() and not connection["callable"].get_object().name.begins_with("@")
|
||||
#if should_display_connection:
|
||||
#var signal_description: SignalDescription
|
||||
#var filtered_signals = existing_signals.filter(func (element): return element.signal_name == signal_item.name and element.node_name == node.name)
|
||||
#if filtered_signals.size() == 1:
|
||||
#signal_description = filtered_signals[0]
|
||||
#else:
|
||||
#signal_description = SignalDescription.new(node.name, signal_item.name)
|
||||
#existing_signals.append(signal_description)
|
||||
#signals.append(signal_description)
|
||||
#
|
||||
#var signal_edge = SignalConnection.new(signal_description.id, signal_description.node_name, connection["callable"].get_object().name, connection["callable"].get_method())
|
||||
#if not signal_graph.edges.any(func (element): return element.signal_id == signal_description.id):
|
||||
#edges.append(signal_edge)
|
||||
#
|
||||
#var temp_signals = {}
|
||||
#for item in signals:
|
||||
#temp_signals[item.id] = item
|
||||
#
|
||||
#var temp_edges = {}
|
||||
#for item in edges:
|
||||
#temp_edges[item.dictionary_key] = item
|
||||
#
|
||||
#signal_graph.signals.assign(temp_signals.keys().map(func (key): return temp_signals[key]))
|
||||
#signal_graph.edges.assign(temp_edges.keys().map(func (key): return temp_edges[key]))
|
||||
#
|
||||
#return signal_graph
|
||||
|
||||
#func _gather_nodes_in_scene() -> Array[Node]:
|
||||
#var scene_root = get_tree().current_scene
|
||||
#var node_list: Array[Node] = [scene_root]
|
||||
#return node_list + _gather_nodes_from_node(scene_root)
|
||||
#
|
||||
#func _gather_nodes_from_node(node: Node) -> Array[Node]:
|
||||
#var nodes: Array[Node] = []
|
||||
#for child in node.get_children(false):
|
||||
#nodes.append(child)
|
||||
#nodes += _gather_nodes_from_node(child)
|
||||
#
|
||||
#return nodes
|
||||
|
||||
func _connect_to_signal(signal_item: SignalDescription):
|
||||
var root_node = get_tree().current_scene
|
||||
var _execute: Callable = func (args = []): _on_signal_execution(signal_item.signal_name, signal_item.node_name, args)
|
||||
if root_node.name == signal_item.node_name:
|
||||
root_node.connect(signal_item.signal_name, _execute)
|
||||
_lambda_map[signal_item] = _execute
|
||||
else:
|
||||
var child = root_node.find_child(signal_item.node_name)
|
||||
if child:
|
||||
child.connect(signal_item.signal_name, _execute)
|
||||
_lambda_map[signal_item] = _execute
|
||||
|
||||
func _disconnect_from_signal(signal_item: SignalDescription):
|
||||
var root_node = get_tree().current_scene
|
||||
if root_node.name == signal_item.node_name:
|
||||
var callable = _lambda_map[signal_item]
|
||||
if callable:
|
||||
root_node.disconnect(signal_item.signal_name, callable)
|
||||
_lambda_map.erase(signal_item)
|
||||
else:
|
||||
var child = root_node.find_child(signal_item.node_name)
|
||||
if child:
|
||||
var callable = _lambda_map[signal_item]
|
||||
if callable:
|
||||
child.disconnect(signal_item.signal_name, callable)
|
||||
_lambda_map.erase(signal_item)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bmsqdh2cnmgw8
|
||||
@@ -0,0 +1,97 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cbsmvov8u78q"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SignalVisualizer/Debugger/signal_debugger_panel.gd" id="1_66cpc"]
|
||||
[ext_resource type="Texture2D" uid="uid://be3nwoioa311t" path="res://addons/SignalVisualizer/Play.svg" id="2_2wkuv"]
|
||||
[ext_resource type="Texture2D" uid="uid://oo1oq2colx5b" path="res://addons/SignalVisualizer/Stop.svg" id="3_bg5eu"]
|
||||
[ext_resource type="Texture2D" uid="uid://bmnff63evbdhv" path="res://addons/SignalVisualizer/Clear.svg" id="4_vg63r"]
|
||||
|
||||
[node name="SignalDebugger" type="Control"]
|
||||
clip_contents = true
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_66cpc")
|
||||
start_icon = ExtResource("2_2wkuv")
|
||||
stop_icon = ExtResource("3_bg5eu")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
clip_contents = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
custom_minimum_size = Vector2(2.08165e-12, 50)
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="ActionButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Start"
|
||||
icon = ExtResource("2_2wkuv")
|
||||
|
||||
[node name="ClearAllButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Clear All"
|
||||
icon = ExtResource("4_vg63r")
|
||||
|
||||
[node name="Spacer" type="Control" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="ClearLogsButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Clear Logs"
|
||||
icon = ExtResource("4_vg63r")
|
||||
|
||||
[node name="HSplitContainer" type="HSplitContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="SignalTree" type="Tree" parent="VBoxContainer/HSplitContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(250, 2.08165e-12)
|
||||
layout_mode = 2
|
||||
columns = 2
|
||||
allow_reselect = true
|
||||
allow_rmb_select = true
|
||||
hide_root = true
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HSplitContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TabBar" type="TabBar" parent="VBoxContainer/HSplitContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
tab_count = 2
|
||||
tab_0/title = "Signal Log"
|
||||
tab_1/title = "Signal Graph"
|
||||
|
||||
[node name="LogLabel" type="RichTextLabel" parent="VBoxContainer/HSplitContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_colors/default_color = Color(0.690196, 0.690196, 0.690196, 1)
|
||||
bbcode_enabled = true
|
||||
scroll_following = true
|
||||
|
||||
[node name="Graph" type="GraphEdit" parent="VBoxContainer/HSplitContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/ActionButton" to="." method="_on_action_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/ClearAllButton" to="." method="_on_clear_all_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/ClearLogsButton" to="." method="_on_clear_logs_button_pressed"]
|
||||
[connection signal="item_selected" from="VBoxContainer/HSplitContainer/SignalTree" to="." method="_on_signal_tree_item_selected"]
|
||||
[connection signal="tab_changed" from="VBoxContainer/HSplitContainer/VBoxContainer/TabBar" to="." method="_on_tab_bar_tab_changed"]
|
||||
@@ -0,0 +1,192 @@
|
||||
@tool
|
||||
class_name SignalDebuggerPanel extends Control
|
||||
|
||||
signal open_script(node_name: String, method_signature: String)
|
||||
|
||||
signal start_signal_debugging
|
||||
signal stop_signal_debugging
|
||||
|
||||
var SignalGraphNode = preload("res://addons/SignalVisualizer/Visualizer/signal_graph_node.tscn")
|
||||
var GraphNodeItem = preload("res://addons/SignalVisualizer/Visualizer/signal_graph_node_item.tscn")
|
||||
|
||||
const SOURCE_COLOR: Color = Color.SKY_BLUE
|
||||
const DESTINATION_COLOR: Color = Color.CORAL
|
||||
const CONNECTION_TYPE: int = 0
|
||||
|
||||
enum Tabs {
|
||||
LOG,
|
||||
GRAPH
|
||||
}
|
||||
|
||||
# Properties
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
@export var start_icon: Texture2D
|
||||
@export var stop_icon: Texture2D
|
||||
|
||||
@onready var action_button: Button = %ActionButton
|
||||
@onready var clear_all_button: Button = %ClearAllButton
|
||||
@onready var signal_tree: Tree = %SignalTree
|
||||
@onready var log_label: RichTextLabel = %LogLabel
|
||||
@onready var graph_node: GraphEdit = %Graph
|
||||
|
||||
var is_started: bool = false :
|
||||
get: return is_started
|
||||
set(new_value):
|
||||
is_started = new_value
|
||||
_update_action_button()
|
||||
|
||||
var _signals: Array = []
|
||||
var _signal_filter: Array = []
|
||||
var _is_stack_trace_enabled: bool = false
|
||||
var _debugger_tab_state: Tabs = Tabs.LOG
|
||||
var _graph: SignalGraph
|
||||
|
||||
# Lifecycle
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _ready():
|
||||
disable()
|
||||
_handle_tab_update(0)
|
||||
|
||||
# Signals
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _on_action_button_pressed():
|
||||
if is_started:
|
||||
stop()
|
||||
else:
|
||||
start()
|
||||
|
||||
func _on_clear_all_button_pressed():
|
||||
log_label.clear()
|
||||
signal_tree.clear()
|
||||
graph_node.clear_connections()
|
||||
for child in graph_node.get_children():
|
||||
if child is SignalGraphNode:
|
||||
child.queue_free()
|
||||
|
||||
func _on_clear_logs_button_pressed():
|
||||
log_label.clear()
|
||||
|
||||
func _on_signal_tree_item_selected():
|
||||
# Updates the checkmark button
|
||||
var selected_item = signal_tree.get_selected()
|
||||
var is_checked = selected_item.is_checked(1)
|
||||
selected_item.set_checked(1, (not is_checked))
|
||||
|
||||
# Add / Remove signal from filters
|
||||
var selected_signal = _signals.filter(func (element): return element.signal_name == selected_item.get_text(0))[0]
|
||||
if _signal_filter.has(selected_signal.signal_name):
|
||||
var selected_index = _signal_filter.find(selected_signal.signal_name)
|
||||
_signal_filter.remove_at(selected_index)
|
||||
else:
|
||||
_signal_filter.append(selected_signal.signal_name)
|
||||
|
||||
func _on_tab_bar_tab_changed(tab: int):
|
||||
_handle_tab_update(tab)
|
||||
|
||||
func _on_stack_trace_button_pressed():
|
||||
_is_stack_trace_enabled = not _is_stack_trace_enabled
|
||||
|
||||
func _on_open_signal_in_script(data: SignalGraphNodeItem.Metadata):
|
||||
open_script.emit(data.node_name, data.method_signature)
|
||||
|
||||
# Methods
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func enable():
|
||||
action_button.disabled = false
|
||||
|
||||
func disable():
|
||||
action_button.disabled = true
|
||||
|
||||
func start():
|
||||
if not is_started:
|
||||
is_started = true
|
||||
action_button.icon = stop_icon
|
||||
start_signal_debugging.emit()
|
||||
log_label.append_text("[color=#B0B0B0]Signal Debugging Started...[/color]")
|
||||
log_label.newline()
|
||||
log_label.newline()
|
||||
|
||||
func stop():
|
||||
if is_started:
|
||||
is_started = false
|
||||
action_button.icon = start_icon
|
||||
stop_signal_debugging.emit()
|
||||
log_label.newline()
|
||||
log_label.append_text("[color=#B0B0B0]Signal Debugging Stopped[/color]")
|
||||
log_label.newline()
|
||||
log_label.newline()
|
||||
|
||||
func create_tree_from_signals(signals: Array):
|
||||
_signals = signals
|
||||
var root = signal_tree.create_item()
|
||||
root.set_text(0, "Signals")
|
||||
|
||||
var tree_items: Dictionary = {}
|
||||
|
||||
for signal_item in signals:
|
||||
var node_tree_item: TreeItem
|
||||
if tree_items.has(signal_item.node_name):
|
||||
node_tree_item = tree_items[signal_item.node_name] as TreeItem
|
||||
else:
|
||||
node_tree_item = signal_tree.create_item(root)
|
||||
node_tree_item.set_text(0, signal_item.node_name)
|
||||
node_tree_item.set_selectable(0, false)
|
||||
node_tree_item.set_selectable(1, false)
|
||||
tree_items[signal_item.node_name] = node_tree_item
|
||||
|
||||
var signal_tree_item = signal_tree.create_item(node_tree_item)
|
||||
signal_tree_item.set_text(0, signal_item.signal_name)
|
||||
signal_tree_item.set_cell_mode(1, TreeItem.CELL_MODE_CHECK)
|
||||
signal_tree_item.set_checked(1, true)
|
||||
signal_tree_item.set_selectable(0, false)
|
||||
signal_tree_item.set_selectable(1, true)
|
||||
|
||||
func create_signal_graph(signals: Array, edges: Array):
|
||||
_graph = SignalGraphUtility.create_signal_graph(get_tree().edited_scene_root.scene_file_path, signals, edges)
|
||||
SignalGraphUtility.generate_signal_graph_nodes(_graph, graph_node, _on_open_signal_in_script)
|
||||
|
||||
func log_signal_execution(time: String, node_name: String, signal_name: String):
|
||||
if _signal_filter != null and _signal_filter.has(signal_name):
|
||||
return
|
||||
|
||||
if not log_label.text.is_empty():
|
||||
log_label.newline()
|
||||
log_label.append_text(
|
||||
"[color=#FFCC00]{time}[/color]\t\t{node_name}\t\t{signal_name}".format({ "time": time, "node_name": node_name, "signal_name": signal_name })
|
||||
)
|
||||
log_label.newline()
|
||||
|
||||
func _handle_tab_update(selected_tab_index: int):
|
||||
match selected_tab_index:
|
||||
1:
|
||||
_debugger_tab_state = Tabs.GRAPH
|
||||
_:
|
||||
_debugger_tab_state = Tabs.LOG
|
||||
|
||||
match _debugger_tab_state:
|
||||
Tabs.LOG:
|
||||
log_label.show()
|
||||
graph_node.hide()
|
||||
Tabs.GRAPH:
|
||||
log_label.hide()
|
||||
graph_node.show()
|
||||
|
||||
func _update_action_button():
|
||||
if is_started:
|
||||
action_button.text = "Stop"
|
||||
action_button.modulate = Color("#ff3b30")
|
||||
else:
|
||||
action_button.text = "Start"
|
||||
action_button.modulate = Color.WHITE
|
||||
@@ -0,0 +1 @@
|
||||
uid://yg8cqm6f1prd
|
||||
@@ -0,0 +1 @@
|
||||
<svg height="24" width="24" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M11 1a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM6.732 5A2 2 0 0 1 7 6v1.117L9.268 6A2 2 0 0 1 9 5V3.883zM2 5a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1zm5 3.883V10a2 2 0 0 1-.268 1L9 12.117V11a2 2 0 0 1 .268-1zM11 10a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1z" fill="#8eef97"/></svg>
|
||||
|
After Width: | Height: | Size: 437 B |
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bxj8ep08wbnm6"
|
||||
path="res://.godot/imported/GraphEdit.svg-90dae61e8e0b157ab8eff95fe4b91e53.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/SignalVisualizer/GraphEdit.svg"
|
||||
dest_files=["res://.godot/imported/GraphEdit.svg-90dae61e8e0b157ab8eff95fe4b91e53.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
@@ -0,0 +1 @@
|
||||
<svg height="24" viewBox="0 0 16 16" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M4 12a1 1 0 0 0 1.555.832l6-4a1 1 0 0 0 0-1.664l-6-4A1 1 0 0 0 4 4z" fill="#e0e0e0"/></svg>
|
||||
|
After Width: | Height: | Size: 184 B |
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://be3nwoioa311t"
|
||||
path="res://.godot/imported/Play.svg-a446691ffcef211028bb160b5a2d6ff1.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/SignalVisualizer/Play.svg"
|
||||
dest_files=["res://.godot/imported/Play.svg-a446691ffcef211028bb160b5a2d6ff1.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
@@ -0,0 +1,162 @@
|
||||
@tool
|
||||
extends EditorPlugin
|
||||
|
||||
class SignalDebuggerPlugin extends EditorDebuggerPlugin:
|
||||
var SignalDebuggerPanelScene = preload("res://addons/SignalVisualizer/Debugger/SignalDebugger.tscn")
|
||||
|
||||
signal open_script
|
||||
signal start_signal_debugging
|
||||
signal stop_signal_debugging
|
||||
|
||||
var debugger_panel
|
||||
|
||||
func _has_capture(prefix) -> bool:
|
||||
return prefix == "signal_debugger"
|
||||
|
||||
func _capture(message, data, session_id) -> bool:
|
||||
if message == "signal_debugger:signal_executed":
|
||||
if data.size() == 3:
|
||||
var time = data[0]
|
||||
var node_name = data[1]
|
||||
var signal_name = data[2]
|
||||
debugger_panel.log_signal_execution(time, node_name, signal_name)
|
||||
return true
|
||||
|
||||
if message == "signal_debugger:generated_graph":
|
||||
if data.size() == 1:
|
||||
var signals = data[0][0] as Array
|
||||
var edges = data[0][1] as Array
|
||||
debugger_panel.create_tree_from_signals(signals)
|
||||
debugger_panel.create_signal_graph(signals, edges)
|
||||
return true
|
||||
|
||||
return false
|
||||
|
||||
func _setup_session(session_id):
|
||||
debugger_panel = SignalDebuggerPanelScene.instantiate()
|
||||
var session = get_session(session_id)
|
||||
|
||||
debugger_panel.name = "Signal Debugger"
|
||||
debugger_panel.open_script.connect(func (arg1, arg2): open_script.emit(arg1, arg2))
|
||||
debugger_panel.start_signal_debugging.connect(func (): start_signal_debugging.emit())
|
||||
debugger_panel.stop_signal_debugging.connect(func (): stop_signal_debugging.emit())
|
||||
|
||||
session.started.connect(
|
||||
func ():
|
||||
debugger_panel.enable()
|
||||
)
|
||||
session.stopped.connect(
|
||||
func ():
|
||||
debugger_panel.stop()
|
||||
debugger_panel.disable()
|
||||
stop_signal_debugging.emit()
|
||||
)
|
||||
|
||||
session.add_session_tab(debugger_panel)
|
||||
|
||||
var SignalVisualizerDockScene = preload("res://addons/SignalVisualizer/Visualizer/signal_visualizer_dock.tscn")
|
||||
|
||||
class ScriptMethodReference:
|
||||
var script_reference: Script
|
||||
var line_number: int
|
||||
|
||||
# Properties
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
var dock: Control
|
||||
var debugger: SignalDebuggerPlugin
|
||||
|
||||
# Lifecycle
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _enter_tree():
|
||||
dock = SignalVisualizerDockScene.instantiate()
|
||||
debugger = SignalDebuggerPlugin.new()
|
||||
|
||||
dock.open_script.connect(_on_open_signal_in_script)
|
||||
add_control_to_bottom_panel(dock, "Signal Visualizer")
|
||||
|
||||
debugger.start_signal_debugging.connect(_on_debugger_start_signal_debugging)
|
||||
debugger.stop_signal_debugging.connect(_on_debugger_stop_signal_debugging)
|
||||
debugger.open_script.connect(_on_open_signal_in_script)
|
||||
add_debugger_plugin(debugger)
|
||||
|
||||
if not ProjectSettings.has_setting("autoload/Signal_Debugger"):
|
||||
add_autoload_singleton("Signal_Debugger", "res://addons/SignalVisualizer/Debugger/SignalDebugger.gd")
|
||||
|
||||
func _exit_tree():
|
||||
remove_control_from_bottom_panel(dock)
|
||||
dock.free()
|
||||
|
||||
remove_debugger_plugin(debugger)
|
||||
remove_autoload_singleton("Signal_Debugger")
|
||||
|
||||
# Signals
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _on_open_signal_in_script(node_name: String, method_signature: String):
|
||||
var node: Node
|
||||
if get_tree().edited_scene_root.name == node_name:
|
||||
node = get_tree().edited_scene_root
|
||||
else:
|
||||
node = get_tree().edited_scene_root.find_child(node_name)
|
||||
|
||||
if node != null:
|
||||
var script: Script = node.get_script()
|
||||
if script != null:
|
||||
var editor = get_editor_interface()
|
||||
var method_reference = _find_method_reference_in_script(script, method_signature)
|
||||
|
||||
if method_reference != null:
|
||||
editor.edit_script(method_reference.script_reference, method_reference.line_number, 0)
|
||||
editor.set_main_screen_editor("Script")
|
||||
else:
|
||||
push_warning("Requested method in script ({script}) for node ({name}) is not available.".format({ "name": node_name, "script": script.name }))
|
||||
else:
|
||||
push_warning("Requested script for node ({name}) is not available.".format({ "name": node_name }))
|
||||
else:
|
||||
push_warning("Requested script for node ({name}) is not available.".format({ "name": node_name }))
|
||||
|
||||
func _on_debugger_start_signal_debugging():
|
||||
for session in debugger.get_sessions():
|
||||
session.send_message("signal_debugger:start", [])
|
||||
|
||||
func _on_debugger_stop_signal_debugging():
|
||||
for session in debugger.get_sessions():
|
||||
session.send_message("signal_debugger:stop", [])
|
||||
|
||||
# Methods
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _find_method_reference_in_script(script: Script, method_signature: String) -> ScriptMethodReference:
|
||||
var line_number = __find_method_line_number_in_script(script, method_signature)
|
||||
|
||||
if line_number == -1:
|
||||
var base_script = script.get_base_script()
|
||||
if base_script:
|
||||
return _find_method_reference_in_script(base_script, method_signature)
|
||||
|
||||
var reference = ScriptMethodReference.new()
|
||||
reference.script_reference = script
|
||||
reference.line_number = line_number
|
||||
|
||||
return reference
|
||||
|
||||
func __find_method_line_number_in_script(script: Script, method_signature: String) -> int:
|
||||
var line_number = 0
|
||||
var found = false
|
||||
for line in script.source_code.split("\n", true):
|
||||
line_number += 1
|
||||
if line.contains(method_signature):
|
||||
found = true
|
||||
return line_number
|
||||
|
||||
return -1
|
||||
@@ -0,0 +1 @@
|
||||
uid://43lcsn3nt3ri
|
||||
@@ -0,0 +1 @@
|
||||
<svg height="24" viewBox="0 0 16 16" width="24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" height="10" width="10" rx="1" fill="#e0e0e0"/></svg>
|
||||
|
After Width: | Height: | Size: 154 B |
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://oo1oq2colx5b"
|
||||
path="res://.godot/imported/Stop.svg-e085086fb31c334bc2f02ca2bffba522.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/SignalVisualizer/Stop.svg"
|
||||
dest_files=["res://.godot/imported/Stop.svg-e085086fb31c334bc2f02ca2bffba522.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
@@ -0,0 +1,31 @@
|
||||
@tool
|
||||
extends Label
|
||||
|
||||
# Properties
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
|
||||
|
||||
# Lifecycle
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
|
||||
|
||||
# Signals
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
|
||||
|
||||
# Methods
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func get_text_size() -> Vector2:
|
||||
return get_theme_default_font().get_string_size(text)
|
||||
@@ -0,0 +1 @@
|
||||
uid://d3lyqancfvwup
|
||||
@@ -0,0 +1,94 @@
|
||||
@tool
|
||||
class_name SignalGraphNode extends GraphNode
|
||||
|
||||
# Properties
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
var connections: Array = [] :
|
||||
get: return connections
|
||||
set(new_value):
|
||||
connections = new_value
|
||||
|
||||
# Lifecycle
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _ready():
|
||||
selectable = true
|
||||
resizable = true
|
||||
draggable = true
|
||||
|
||||
# Signals
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _on_resize_request(new_minsize):
|
||||
size = new_minsize
|
||||
|
||||
# Methods
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func has_source_signal_description(signal_name: String, destination_node_name: String) -> bool:
|
||||
for child in get_children():
|
||||
if child.name == "source_" + signal_name + "_" + destination_node_name:
|
||||
return true
|
||||
|
||||
return false
|
||||
|
||||
func get_source_slot(signal_name: String, destination_node_name: String) -> int:
|
||||
var index = 0
|
||||
for child in get_children():
|
||||
if child.name == "source_" + signal_name + "_" + destination_node_name:
|
||||
return index
|
||||
|
||||
index += 1
|
||||
|
||||
return -1
|
||||
|
||||
func get_next_source_slot(signal_name: String, destination_node_name: String) -> int:
|
||||
var index = 0
|
||||
for child in get_children():
|
||||
if child.name.begins_with("source_"):
|
||||
if child.name == "source_" + signal_name + "_" + destination_node_name:
|
||||
return index
|
||||
|
||||
index += 1
|
||||
|
||||
return -1
|
||||
|
||||
func has_destination_signal_description(signal_name: String, method_signature: String) -> bool:
|
||||
for child in get_children():
|
||||
if child.name == "destination_" + signal_name + "_" + _sanitize_method_signature(method_signature):
|
||||
return true
|
||||
|
||||
return false
|
||||
|
||||
func get_destination_slot(signal_name: String, method_signature: String) -> int:
|
||||
var index = 0
|
||||
for child in get_children():
|
||||
if child.name == "destination_" + signal_name + "_" + _sanitize_method_signature(method_signature):
|
||||
return index
|
||||
|
||||
index += 1
|
||||
|
||||
return -1
|
||||
|
||||
func get_next_destination_slot(signal_name: String, method_signature: String) -> int:
|
||||
var index = 0
|
||||
for child in get_children():
|
||||
if child.name.begins_with("destination_"):
|
||||
if child.name == "destination_" + signal_name + "_" + _sanitize_method_signature(method_signature):
|
||||
return index
|
||||
|
||||
index += 1
|
||||
|
||||
return -1
|
||||
|
||||
func _sanitize_method_signature(signature: String) -> String:
|
||||
return signature.replace("::", "__")
|
||||
@@ -0,0 +1 @@
|
||||
uid://bdwkkgkhgfrtk
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cq10iaub18e54"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SignalVisualizer/Visualizer/signal_graph_node.gd" id="1_ovklj"]
|
||||
|
||||
[node name="SignalGraphNode" type="GraphNode"]
|
||||
custom_minimum_size = Vector2(100, 50)
|
||||
offset_right = 232.0
|
||||
offset_bottom = 54.0
|
||||
resizable = true
|
||||
script = ExtResource("1_ovklj")
|
||||
|
||||
[connection signal="resize_request" from="." to="." method="_on_resize_request"]
|
||||
@@ -0,0 +1,57 @@
|
||||
@tool
|
||||
class_name SignalGraphNodeItem extends Control
|
||||
|
||||
signal open_script(metadata: SignalGraphNodeItem.Metadata)
|
||||
|
||||
class Metadata:
|
||||
var signal_name: String
|
||||
var method_signature: String
|
||||
var node_name: String
|
||||
|
||||
func _init(signal_name: String, method_signature: String, node_name: String):
|
||||
self.signal_name = signal_name
|
||||
self.method_signature = method_signature
|
||||
self.node_name = node_name
|
||||
|
||||
# Properties
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
@onready var label: Label = %DescriptionLabel
|
||||
|
||||
var signal_data: Metadata = null
|
||||
|
||||
var text: String = "" :
|
||||
get: return text
|
||||
set(new_value):
|
||||
text = new_value
|
||||
if label:
|
||||
label.text = text
|
||||
|
||||
# Lifecycle
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _ready():
|
||||
_update()
|
||||
|
||||
# Signals
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _on_open_signal_in_script_button_pressed():
|
||||
open_script.emit(signal_data)
|
||||
|
||||
# Methods
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _update():
|
||||
label.text = text
|
||||
|
||||
var text_size = label.get_text_size()
|
||||
custom_minimum_size = Vector2((text_size.x * 2) + 50, text_size.y * 3)
|
||||
@@ -0,0 +1 @@
|
||||
uid://c0n3sifmbiih0
|
||||
@@ -0,0 +1,43 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://b2lwtwp6kpwtb"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SignalVisualizer/Visualizer/signal_graph_node_item.gd" id="1_jrd34"]
|
||||
[ext_resource type="Script" path="res://addons/SignalVisualizer/Visualizer/resizable_label.gd" id="2_4wwd5"]
|
||||
|
||||
[node name="SignalItem" type="Control"]
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(51, 23)
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_jrd34")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
custom_minimum_size = Vector2(100, 50)
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="DescriptionLabel" type="Label" parent="HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(100, 50)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
vertical_alignment = 1
|
||||
clip_text = true
|
||||
script = ExtResource("2_4wwd5")
|
||||
|
||||
[node name="OpenSignalInScriptButton" type="Button" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Open"
|
||||
flat = true
|
||||
|
||||
[connection signal="pressed" from="HBoxContainer/OpenSignalInScriptButton" to="." method="_on_open_signal_in_script_button_pressed"]
|
||||
@@ -0,0 +1,67 @@
|
||||
@tool
|
||||
extends Control
|
||||
|
||||
signal open_script(node_name: String, method_signature: String)
|
||||
|
||||
var SignalGraphNode = preload("res://addons/SignalVisualizer/Visualizer/signal_graph_node.tscn")
|
||||
var GraphNodeItem = preload("res://addons/SignalVisualizer/Visualizer/signal_graph_node_item.tscn")
|
||||
|
||||
# Properties
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
const SOURCE_COLOR: Color = Color.SKY_BLUE
|
||||
const DESTINATION_COLOR: Color = Color.CORAL
|
||||
const CONNECTION_TYPE: int = 0
|
||||
|
||||
@onready var arrange_nodes_checkbox: CheckBox = %ArrangeNodesCheckBox
|
||||
@onready var signal_details_checkbox: CheckBox = %SignalDetailsCheckBox
|
||||
@onready var signal_tree: Tree = %SignalTree
|
||||
@onready var graph: GraphEdit = %Graph
|
||||
|
||||
# Lifecycle
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
|
||||
|
||||
# Signals
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func _on_clear_graph_button_pressed():
|
||||
clear()
|
||||
|
||||
func _on_generate_graph_button_pressed():
|
||||
clear()
|
||||
|
||||
var scene_signal_graph = SignalGraphUtility.create_signal_graph_from_node(get_tree().edited_scene_root, true)
|
||||
SignalGraphUtility.generate_signal_graph_nodes(scene_signal_graph, graph, _on_open_signal_in_script)
|
||||
SignalGraphUtility.generate_signal_graph_tree(scene_signal_graph, signal_tree)
|
||||
|
||||
if arrange_nodes_checkbox.button_pressed:
|
||||
graph.arrange_nodes()
|
||||
|
||||
func _on_open_signal_in_script(data: SignalGraphNodeItem.Metadata):
|
||||
open_script.emit(data.node_name, data.method_signature)
|
||||
|
||||
# Methods
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
# |===================================|
|
||||
|
||||
func clear():
|
||||
_clear_graph_nodes()
|
||||
_clear_tree()
|
||||
|
||||
func _clear_graph_nodes():
|
||||
graph.clear_connections()
|
||||
for child in graph.get_children():
|
||||
if child is SignalGraphNode:
|
||||
child.queue_free()
|
||||
|
||||
func _clear_tree():
|
||||
signal_tree.clear()
|
||||
@@ -0,0 +1 @@
|
||||
uid://bbd48wbihmuos
|
||||
@@ -0,0 +1,78 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dppfamjc0ji40"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SignalVisualizer/Visualizer/signal_visualizer_dock.gd" id="1_akar5"]
|
||||
[ext_resource type="Texture2D" uid="uid://bmnff63evbdhv" path="res://addons/SignalVisualizer/Clear.svg" id="2_m8bsv"]
|
||||
[ext_resource type="Texture2D" uid="uid://bxj8ep08wbnm6" path="res://addons/SignalVisualizer/GraphEdit.svg" id="3_dtmqs"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ae0jg"]
|
||||
|
||||
[node name="SignalVisualizerDock" type="Control"]
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(2.08165e-12, 200)
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_akar5")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
clip_contents = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(2.08165e-12, 50)
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
alignment = 2
|
||||
|
||||
[node name="ArrangeNodesCheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Arrange Nodes"
|
||||
|
||||
[node name="SignalDetailsCheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Signal Details"
|
||||
|
||||
[node name="Panel" type="Panel" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_ae0jg")
|
||||
|
||||
[node name="ClearGraphButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Clear Graph"
|
||||
icon = ExtResource("2_m8bsv")
|
||||
|
||||
[node name="GenerateGraphButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Generate Graph"
|
||||
icon = ExtResource("3_dtmqs")
|
||||
|
||||
[node name="HSplitContainer" type="HSplitContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="SignalTree" type="Tree" parent="VBoxContainer/HSplitContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 2.08165e-12)
|
||||
layout_mode = 2
|
||||
column_titles_visible = true
|
||||
|
||||
[node name="Graph" type="GraphEdit" parent="VBoxContainer/HSplitContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/ClearGraphButton" to="." method="_on_clear_graph_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/GenerateGraphButton" to="." method="_on_generate_graph_button_pressed"]
|
||||
@@ -0,0 +1,7 @@
|
||||
[plugin]
|
||||
|
||||
name="SignalVisualizer"
|
||||
description="Visual the current scene's signal connections as a graph. Debug the current running scene's signals with automatic logging in a new debugger panel."
|
||||
author="MiniGameDev"
|
||||
version="1.7.0"
|
||||
script="SignalVisualizer.gd"
|
||||
@@ -21,5 +21,5 @@ anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
color = Color(1, 1, 1, 0)
|
||||
color = Color(0, 0, 0, 0.658824)
|
||||
script = ExtResource("2_ghan2")
|
||||
|
||||
@@ -10,3 +10,4 @@ corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
shadow_color = Color(0, 0, 0, 0.772549)
|
||||
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cvu5dybw31uxn"
|
||||
path="res://.godot/imported/Circle.png-1776eabbad99f201f3fa20f90655dedf.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/Circle.png"
|
||||
dest_files=["res://.godot/imported/Circle.png-1776eabbad99f201f3fa20f90655dedf.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://l0k3vh3kdprp"
|
||||
path="res://.godot/imported/Tropfen-ui-1.png-ffd2adc2dec240ddecc1432b18c1c0f0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/Watercan-ui/Tropfen-ui-1.png"
|
||||
dest_files=["res://.godot/imported/Tropfen-ui-1.png-ffd2adc2dec240ddecc1432b18c1c0f0.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://t4w7axbof7bq"
|
||||
path="res://.godot/imported/Tropfen-ui-2.png-f4fdc398383d494823a9c23512b5d46c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/Watercan-ui/Tropfen-ui-2.png"
|
||||
dest_files=["res://.godot/imported/Tropfen-ui-2.png-f4fdc398383d494823a9c23512b5d46c.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://di2npqkvvst6x"
|
||||
path="res://.godot/imported/Tropfen-ui-3.png-3b58039a60642d36367527f2d94654fa.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/Watercan-ui/Tropfen-ui-3.png"
|
||||
dest_files=["res://.godot/imported/Tropfen-ui-3.png-3b58039a60642d36367527f2d94654fa.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://clti3basli30"
|
||||
path="res://.godot/imported/Tropfen-ui-4.png-e2c1542b620809f430977af3bdacd86f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/Watercan-ui/Tropfen-ui-4.png"
|
||||
dest_files=["res://.godot/imported/Tropfen-ui-4.png-e2c1542b620809f430977af3bdacd86f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://n1v4hgd467wp"
|
||||
path="res://.godot/imported/Tropfen-ui-5.png-ee46a9fd4d81820f6fec9c30046a3b47.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/Watercan-ui/Tropfen-ui-5.png"
|
||||
dest_files=["res://.godot/imported/Tropfen-ui-5.png-ee46a9fd4d81820f6fec9c30046a3b47.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://l5ym7gi82l1b"
|
||||
path="res://.godot/imported/Tropfen-ui-6.png-2fee37aa3fbbde454a4d1b4f8ee350e6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/Watercan-ui/Tropfen-ui-6.png"
|
||||
dest_files=["res://.godot/imported/Tropfen-ui-6.png-2fee37aa3fbbde454a4d1b4f8ee350e6.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 39 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://70twb0i3e2wo"
|
||||
path="res://.godot/imported/journal_note.png-456d095624ebf40e3c23543b3d0f829a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/journal_note.png"
|
||||
dest_files=["res://.godot/imported/journal_note.png-456d095624ebf40e3c23543b3d0f829a.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 395 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d0anh3hdk0clc"
|
||||
path="res://.godot/imported/journal_standard.png-09a8c39fc0e5420f9430aff7f945ae55.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/journal_standard.png"
|
||||
dest_files=["res://.godot/imported/journal_standard.png-09a8c39fc0e5420f9430aff7f945ae55.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
After Width: | Height: | Size: 33 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b2q3xgw8xj880"
|
||||
path="res://.godot/imported/quest_note.png-857ff56cb8cdd8e4401bb6320261518e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/quest_note.png"
|
||||
dest_files=["res://.godot/imported/quest_note.png-857ff56cb8cdd8e4401bb6320261518e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@@ -0,0 +1,16 @@
|
||||
[gd_resource type="AudioBusLayout" format=3 uid="uid://b6dwkmkyb0axk"]
|
||||
|
||||
[resource]
|
||||
bus/0/volume_db = -5.93075
|
||||
bus/1/name = &"Music"
|
||||
bus/1/solo = false
|
||||
bus/1/mute = false
|
||||
bus/1/bypass_fx = false
|
||||
bus/1/volume_db = -17.6573
|
||||
bus/1/send = &"Master"
|
||||
bus/2/name = &"SFX"
|
||||
bus/2/solo = false
|
||||
bus/2/mute = false
|
||||
bus/2/bypass_fx = false
|
||||
bus/2/volume_db = 0.0
|
||||
bus/2/send = &"Master"
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_resource type="Resource" script_class="DialogicStyle" load_steps=20 format=3 uid="uid://f7q6jac5tsk8"]
|
||||
[gd_resource type="Resource" script_class="DialogicStyle" load_steps=21 format=3 uid="uid://f7q6jac5tsk8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dfx2htp24tuvm" path="res://addons/dialogic/Resources/dialogic_style_layer.gd" id="1_0jwhi"]
|
||||
[ext_resource type="PackedScene" uid="uid://c1k5m0w3r40xf" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_FullBackground/full_background_layer.tscn" id="2_8wrfq"]
|
||||
@@ -40,6 +40,7 @@ scene = ExtResource("5_reo2u")
|
||||
overrides = {
|
||||
"box_animation_in": "1",
|
||||
"box_animation_out": "1",
|
||||
"box_panel": "\"vn_textbox_default_panel.tres\"",
|
||||
"name_label_alignment": "2",
|
||||
"name_label_box_modulate": "Color(1, 1, 1, 1)",
|
||||
"name_label_box_panel": "\"res://dialog/Babushka_NPC_Namebox_background.tres\"",
|
||||
@@ -70,10 +71,15 @@ script = ExtResource("1_0jwhi")
|
||||
scene = ExtResource("9_4c2uo")
|
||||
overrides = {}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_0jwhi"]
|
||||
script = ExtResource("1_0jwhi")
|
||||
scene = ExtResource("6_i6h15")
|
||||
overrides = {}
|
||||
|
||||
[resource]
|
||||
script = ExtResource("10_e3ue2")
|
||||
name = "NPC_narrative"
|
||||
layer_list = Array[String](["10", "11", "12", "13", "14", "15", "16", "17"])
|
||||
layer_list = Array[String](["10", "11", "12", "13", "14", "15", "16", "17", "18"])
|
||||
layer_info = {
|
||||
"": SubResource("Resource_wg0yj"),
|
||||
"10": SubResource("Resource_uxnk3"),
|
||||
@@ -83,8 +89,9 @@ layer_info = {
|
||||
"14": SubResource("Resource_clhbu"),
|
||||
"15": SubResource("Resource_umvdi"),
|
||||
"16": SubResource("Resource_ci2ul"),
|
||||
"17": SubResource("Resource_sadu5")
|
||||
"17": SubResource("Resource_sadu5"),
|
||||
"18": SubResource("Resource_0jwhi")
|
||||
}
|
||||
base_overrides = {}
|
||||
layers = Array[ExtResource("1_0jwhi")]([])
|
||||
metadata/_latest_layer = "13"
|
||||
metadata/_latest_layer = "14"
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cqcs80xsgygeb"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://2q1n6g2kj5er" path="res://prefabs/UI/Quest/QuestLog.tscn" id="1_7u5et"]
|
||||
|
||||
[node name="Book" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="QuestLog" parent="." instance=ExtResource("1_7u5et")]
|
||||
layout_mode = 1
|
||||
offset_left = 247.0
|
||||
offset_top = 72.0
|
||||
offset_right = -205.0
|
||||
offset_bottom = -76.0
|
||||
grow_horizontal = 1
|
||||
grow_vertical = 1
|
||||
@@ -1,24 +1,22 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://cgjc4wurbgimy"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://cgjc4wurbgimy"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hg7jay2kt441" path="res://scripts/CSharp/Common/Inventory/InventoryUi.cs" id="1_6wusm"]
|
||||
[ext_resource type="Texture2D" uid="uid://3ln8aleyxgp1" path="res://art/ui/UI/UI_bag_export_01.png" id="3_vvo7l"]
|
||||
[ext_resource type="Texture2D" uid="uid://c7wqla0mbu3np" path="res://art/ui/babushka_ui_tmp_inventory_select.png" id="4_tiss4"]
|
||||
[ext_resource type="Texture2D" uid="uid://u0dku75l17re" path="res://art/ui/UI/UI_bag_export_highlight_01.png" id="5_df8i8"]
|
||||
[ext_resource type="PackedScene" uid="uid://c0kmdjeqkqrwv" path="res://prefabs/UI/Inventory/Slot.tscn" id="5_u7kje"]
|
||||
[ext_resource type="Script" uid="uid://cvkw4qd2hxksi" path="res://scripts/GdScript/dialogic_toggle.gd" id="6_n5apg"]
|
||||
[ext_resource type="Script" uid="uid://7wwid23tc8as" path="res://scripts/CSharp/Common/Quest/QuestMessagePopup.cs" id="6_n5apg"]
|
||||
[ext_resource type="Texture2D" uid="uid://bag1xalfh731d" path="res://art/ui/UI/UI_bag_export_highlight_02.png" id="6_u7kje"]
|
||||
[ext_resource type="Texture2D" uid="uid://cxptule8n38ph" path="res://art/ui/UI/UI_bag_export_highlight_03.png" id="7_l3npx"]
|
||||
[ext_resource type="PackedScene" uid="uid://2q1n6g2kj5er" path="res://prefabs/UI/Quest/QuestLog.tscn" id="7_vvo7l"]
|
||||
[ext_resource type="Texture2D" uid="uid://qwia360i1ir1" path="res://art/ui/UI/inventory_active.png" id="8_df8i8"]
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer"]
|
||||
layer = 90
|
||||
follow_viewport_enabled = true
|
||||
|
||||
[node name="DialogicToggle" type="Node2D" parent="." node_paths=PackedStringArray("itemToToggle")]
|
||||
[node name="DialogicToggle" type="Node2D" parent="."]
|
||||
scale = Vector2(0.7, 0.7)
|
||||
script = ExtResource("6_n5apg")
|
||||
itemToToggle = NodePath("../Inventory")
|
||||
|
||||
[node name="Inventory" type="Control" parent="."]
|
||||
[node name="Inventory" type="Control" parent="." node_paths=PackedStringArray("_headerSlots")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
@@ -30,10 +28,9 @@ grow_vertical = 2
|
||||
scale = Vector2(0.7, 0.7)
|
||||
size_flags_vertical = 8
|
||||
script = ExtResource("1_6wusm")
|
||||
_inventoryOpenedOffset = -700.0
|
||||
_headerSlots = []
|
||||
|
||||
[node name="SlotsContainer" type="Control" parent="Inventory"]
|
||||
custom_minimum_size = Vector2(500, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
@@ -43,33 +40,8 @@ anchor_bottom = 0.5
|
||||
offset_left = -250.0
|
||||
offset_right = 250.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="SlotSelectContainer" type="Control" parent="Inventory/SlotsContainer"]
|
||||
custom_minimum_size = Vector2(900, 100)
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -450.0
|
||||
offset_top = -115.0
|
||||
offset_right = 450.0
|
||||
offset_bottom = -15.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="Selector" type="TextureRect" parent="Inventory/SlotsContainer/SlotSelectContainer"]
|
||||
z_index = 10
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 0
|
||||
offset_left = -45.7143
|
||||
offset_top = -49.2857
|
||||
offset_right = 54.2857
|
||||
offset_bottom = 50.7143
|
||||
texture = ExtResource("4_tiss4")
|
||||
expand_mode = 1
|
||||
scale = Vector2(0.7, 0.7)
|
||||
|
||||
[node name="SlotsMover" type="Control" parent="Inventory/SlotsContainer"]
|
||||
custom_minimum_size = Vector2(900, 610)
|
||||
@@ -84,6 +56,7 @@ offset_right = 200.0
|
||||
offset_bottom = -1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="BackgroundContainer" type="Control" parent="Inventory/SlotsContainer/SlotsMover"]
|
||||
layout_mode = 1
|
||||
@@ -99,8 +72,8 @@ layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 350.0
|
||||
offset_right = 254.0
|
||||
offset_left = 435.0
|
||||
offset_right = 339.0
|
||||
offset_bottom = 30.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
@@ -113,8 +86,8 @@ layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -350.0
|
||||
offset_right = -446.0
|
||||
offset_left = -356.0
|
||||
offset_right = -452.0
|
||||
offset_bottom = 30.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
@@ -448,3 +421,64 @@ offset_left = 703.0
|
||||
offset_top = 512.0
|
||||
offset_right = 803.0
|
||||
offset_bottom = 612.0
|
||||
|
||||
[node name="SlotSelectContainer" type="Control" parent="Inventory/SlotsContainer/SlotsMover"]
|
||||
custom_minimum_size = Vector2(900, 100)
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -497.0
|
||||
offset_top = -164.0
|
||||
offset_right = 403.0
|
||||
offset_bottom = -64.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="Selector" type="TextureRect" parent="Inventory/SlotsContainer/SlotsMover/SlotSelectContainer"]
|
||||
z_index = 10
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 0
|
||||
offset_right = 100.0
|
||||
offset_bottom = 100.0
|
||||
texture = ExtResource("8_df8i8")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="QuestLogRoot" parent="." instance=ExtResource("7_vvo7l")]
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="Control"]
|
||||
custom_minimum_size = Vector2(200, 200)
|
||||
layout_mode = 0
|
||||
offset_left = 150.0
|
||||
offset_top = -250.0
|
||||
offset_right = 350.0
|
||||
offset_bottom = -50.0
|
||||
color = Color(1, 1, 0.584314, 1)
|
||||
script = ExtResource("6_n5apg")
|
||||
_showPosition = Vector2(150, -250)
|
||||
_hidePosition = Vector2(150, 50)
|
||||
|
||||
[node name="Text" type="Label" parent="Control/ColorRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 20.0
|
||||
offset_top = 20.0
|
||||
offset_right = -20.0
|
||||
offset_bottom = -20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "Switch to Unity"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://1iqqwh7d6xoh"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dwhee40ksubke" path="res://scripts/CSharp/Common/Quest/QuestListItemUi.cs" id="1_svwef"]
|
||||
[ext_resource type="Texture2D" uid="uid://cvu5dybw31uxn" path="res://art/ui/UI/Circle.png" id="2_qlq3v"]
|
||||
|
||||
[node name="QuestListItem" type="Control"]
|
||||
custom_minimum_size = Vector2(0, 40)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 300.0
|
||||
offset_bottom = 30.0
|
||||
script = ExtResource("1_svwef")
|
||||
|
||||
[node name="TitleButton" type="Button" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
flat = true
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="TitleButton"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="TitleButton/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 30
|
||||
theme_override_constants/margin_top = 0
|
||||
theme_override_constants/margin_right = 30
|
||||
theme_override_constants/margin_bottom = 0
|
||||
|
||||
[node name="DotText" type="Label" parent="TitleButton/HBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 1
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 17
|
||||
text = "•"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TitleText" type="Label" parent="TitleButton/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 17
|
||||
text = "Switch to Unity"
|
||||
vertical_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="Circled" type="TextureRect" parent="TitleButton"]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("2_qlq3v")
|
||||
|
||||
[connection signal="pressed" from="TitleButton" to="." method="ClickedTitleButton"]
|
||||
@@ -0,0 +1,162 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://2q1n6g2kj5er"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c7ilqe2fmjyvx" path="res://scripts/CSharp/Common/Quest/QuestListUi.cs" id="1_17sli"]
|
||||
[ext_resource type="Script" uid="uid://o1qpo0wdqlw3" path="res://scripts/CSharp/Common/Quest/QuestLog.cs" id="1_vc33n"]
|
||||
[ext_resource type="PackedScene" uid="uid://1iqqwh7d6xoh" path="res://prefabs/UI/Quest/QuestListItem.tscn" id="2_fswdj"]
|
||||
[ext_resource type="Texture2D" uid="uid://d0anh3hdk0clc" path="res://art/ui/UI/journal_standard.png" id="2_wdbu4"]
|
||||
[ext_resource type="Script" uid="uid://b8mywolvj2yq7" path="res://scripts/CSharp/Common/Quest/QuestDescriptionUi.cs" id="4_1vy15"]
|
||||
|
||||
[node name="QuestLogRoot" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
|
||||
[node name="MovingLog" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 460.0
|
||||
offset_top = -615.0
|
||||
offset_right = 1460.0
|
||||
offset_bottom = -54.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
mouse_filter = 2
|
||||
script = ExtResource("1_vc33n")
|
||||
_closedPos = Vector2(460, -615)
|
||||
_openedPos = Vector2(460, 240)
|
||||
|
||||
[node name="Background" type="Control" parent="MovingLog"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="MovingLog/Background"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("2_wdbu4")
|
||||
expand_mode = 2
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MovingLog"]
|
||||
layout_mode = 2
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 160
|
||||
theme_override_constants/margin_top = 60
|
||||
theme_override_constants/margin_right = 160
|
||||
theme_override_constants/margin_bottom = 60
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="MovingLog/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="QuestLog" type="HBoxContainer" parent="MovingLog/MarginContainer/ReferenceRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="LeftPage" type="Control" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog/LeftPage"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 20
|
||||
theme_override_constants/margin_top = 15
|
||||
theme_override_constants/margin_right = 20
|
||||
theme_override_constants/margin_bottom = 15
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog/LeftPage/MarginContainer"]
|
||||
layout_mode = 2
|
||||
border_color = Color(1.49205e-06, 0.62774, 0.489941, 1)
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog/LeftPage/MarginContainer/ReferenceRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog/LeftPage/MarginContainer/ReferenceRect/VBoxContainer2"]
|
||||
custom_minimum_size = Vector2(0, 60.975)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 31
|
||||
text = "Quests"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog/LeftPage/MarginContainer/ReferenceRect/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_17sli")
|
||||
_questListItemPrefab = ExtResource("2_fswdj")
|
||||
|
||||
[node name="RightPage" type="Control" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog/RightPage"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 20
|
||||
theme_override_constants/margin_top = 15
|
||||
theme_override_constants/margin_right = 20
|
||||
theme_override_constants/margin_bottom = 15
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog/RightPage/MarginContainer"]
|
||||
layout_mode = 2
|
||||
border_color = Color(1.49205e-06, 0.62774, 0.489941, 1)
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog/RightPage/MarginContainer/ReferenceRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog/RightPage/MarginContainer/ReferenceRect/VBoxContainer2"]
|
||||
custom_minimum_size = Vector2(0, 60.975)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 31
|
||||
text = "Details"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Description" type="RichTextLabel" parent="MovingLog/MarginContainer/ReferenceRect/QuestLog/RightPage/MarginContainer/ReferenceRect/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_colors/default_color = Color(0, 0, 0, 1)
|
||||
bbcode_enabled = true
|
||||
text = "[center][font_size=24]Find 10 Mushroms[/font_size][/center]
|
||||
|
||||
Collect 10 mushroms in the forrest by the bushes down the road with the singn that says \"to the mushroms\" and has a small mushrom logo on it. Its realy hard to miss."
|
||||
script = ExtResource("4_1vy15")
|
||||
|
||||
[connection signal="DetailQuestChanged" from="MovingLog" to="MovingLog/MarginContainer/ReferenceRect/QuestLog/RightPage/MarginContainer/ReferenceRect/VBoxContainer2/Description" method="UpdateText"]
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=469 format=3 uid="uid://c25udixd5m6l0"]
|
||||
[gd_scene load_steps=476 format=3 uid="uid://c25udixd5m6l0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b05uyj001ehwi" path="res://scripts/CSharp/Common/Farming/VesnaBehaviour2D.cs" id="1_yd5ep"]
|
||||
[ext_resource type="Script" uid="uid://cjbclkxesh3hc" path="res://scripts/CSharp/Common/CharacterControls/Player2D.cs" id="2_1vqmv"]
|
||||
@@ -268,9 +268,16 @@
|
||||
[ext_resource type="Texture2D" uid="uid://dh3cfbcqm0fs4" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0006.png" id="462_6yyoj"]
|
||||
[ext_resource type="Texture2D" uid="uid://vahac0df0dhj" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0008.png" id="464_pbc3r"]
|
||||
[ext_resource type="Texture2D" uid="uid://b37lpqrsjjuc0" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0010.png" id="466_pw1ip"]
|
||||
[ext_resource type="Script" uid="uid://er03dkj8axlr" path="res://scripts/CSharp/Common/UI/WateringCanUi.cs" id="467_j4m0f"]
|
||||
[ext_resource type="Texture2D" uid="uid://oi11ax6tml6j" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0012.png" id="468_08021"]
|
||||
[ext_resource type="Texture2D" uid="uid://l0k3vh3kdprp" path="res://art/ui/UI/Watercan-ui/Tropfen-ui-1.png" id="468_f6xmn"]
|
||||
[ext_resource type="Texture2D" uid="uid://t4w7axbof7bq" path="res://art/ui/UI/Watercan-ui/Tropfen-ui-2.png" id="469_nxglm"]
|
||||
[ext_resource type="Texture2D" uid="uid://di2npqkvvst6x" path="res://art/ui/UI/Watercan-ui/Tropfen-ui-3.png" id="470_8fyd7"]
|
||||
[ext_resource type="Texture2D" uid="uid://dsjj23763pej5" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0014.png" id="470_bmmei"]
|
||||
[ext_resource type="Texture2D" uid="uid://clti3basli30" path="res://art/ui/UI/Watercan-ui/Tropfen-ui-4.png" id="471_dnm27"]
|
||||
[ext_resource type="Texture2D" uid="uid://n1v4hgd467wp" path="res://art/ui/UI/Watercan-ui/Tropfen-ui-5.png" id="472_e04c3"]
|
||||
[ext_resource type="Texture2D" uid="uid://blh0t2ofqj2uq" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0016.png" id="472_wdxsr"]
|
||||
[ext_resource type="Texture2D" uid="uid://l5ym7gi82l1b" path="res://art/ui/UI/Watercan-ui/Tropfen-ui-6.png" id="473_g32y8"]
|
||||
[ext_resource type="Texture2D" uid="uid://3t1m2xi4ks75" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0018.png" id="474_tu801"]
|
||||
[ext_resource type="Texture2D" uid="uid://drtgi1qyq7fji" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0020.png" id="476_g4jjd"]
|
||||
[ext_resource type="Texture2D" uid="uid://d3rdsclnqbx7" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0001.png" id="477_qko58"]
|
||||
@@ -2064,13 +2071,14 @@ script = ExtResource("1_yd5ep")
|
||||
_farmingControls = NodePath("FarmingControls")
|
||||
_player2d = NodePath("CharacterBody2D")
|
||||
|
||||
[node name="CharacterBody2D" type="CharacterBody2D" parent="." node_paths=PackedStringArray("_sprite") groups=["PlantGrowing"]]
|
||||
[node name="CharacterBody2D" type="CharacterBody2D" parent="." node_paths=PackedStringArray("_sprite", "_wateringParticles") groups=["PlantGrowing"]]
|
||||
position = Vector2(0, 374)
|
||||
collision_layer = 4
|
||||
collision_mask = 3
|
||||
script = ExtResource("2_1vqmv")
|
||||
_speed = 1500.0
|
||||
_sprite = NodePath("visuals/Animated Sprites")
|
||||
_wateringParticles = NodePath("../pouring water vfx")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
|
||||
z_index = 1
|
||||
@@ -2085,7 +2093,7 @@ position = Vector2(0, -374)
|
||||
[node name="Animated Sprites" type="AnimatedSprite2D" parent="CharacterBody2D/visuals"]
|
||||
position = Vector2(0, 450)
|
||||
sprite_frames = SubResource("SpriteFrames_4yiyq")
|
||||
animation = &"side walking wateringcan"
|
||||
animation = &"front walking backpack"
|
||||
offset = Vector2(0, -450)
|
||||
|
||||
[node name="Hoe" type="Sprite2D" parent="CharacterBody2D/visuals"]
|
||||
@@ -2118,17 +2126,83 @@ region_rect = Rect2(-1, 1128, 417, 299)
|
||||
position = Vector2(26, -469)
|
||||
zoom = Vector2(0.3, 0.3)
|
||||
|
||||
[node name="FarmingControls" type="Node2D" parent="." node_paths=PackedStringArray("_movingPlayer", "_camera")]
|
||||
[node name="WateringCanUI" type="Node2D" parent="CharacterBody2D" node_paths=PackedStringArray("_stages")]
|
||||
position = Vector2(0, -929)
|
||||
scale = Vector2(2, 2)
|
||||
script = ExtResource("467_j4m0f")
|
||||
_stages = [NodePath("6"), NodePath("5"), NodePath("4"), NodePath("3"), NodePath("2"), NodePath("1")]
|
||||
|
||||
[node name="1" type="Sprite2D" parent="CharacterBody2D/WateringCanUI"]
|
||||
visible = false
|
||||
position = Vector2(1, 0)
|
||||
scale = Vector2(1.8, 1.8)
|
||||
texture = ExtResource("468_f6xmn")
|
||||
|
||||
[node name="2" type="Sprite2D" parent="CharacterBody2D/WateringCanUI"]
|
||||
visible = false
|
||||
position = Vector2(2, 2)
|
||||
scale = Vector2(1.6, 1.6)
|
||||
texture = ExtResource("469_nxglm")
|
||||
|
||||
[node name="3" type="Sprite2D" parent="CharacterBody2D/WateringCanUI"]
|
||||
visible = false
|
||||
position = Vector2(3, 5)
|
||||
scale = Vector2(1.4, 1.4)
|
||||
texture = ExtResource("470_8fyd7")
|
||||
|
||||
[node name="4" type="Sprite2D" parent="CharacterBody2D/WateringCanUI"]
|
||||
visible = false
|
||||
position = Vector2(3, 7)
|
||||
scale = Vector2(1.2, 1.2)
|
||||
texture = ExtResource("471_dnm27")
|
||||
|
||||
[node name="5" type="Sprite2D" parent="CharacterBody2D/WateringCanUI"]
|
||||
visible = false
|
||||
position = Vector2(2, 7)
|
||||
scale = Vector2(1.1, 1.1)
|
||||
texture = ExtResource("472_e04c3")
|
||||
|
||||
[node name="6" type="Sprite2D" parent="CharacterBody2D/WateringCanUI"]
|
||||
visible = false
|
||||
position = Vector2(3, 12)
|
||||
texture = ExtResource("473_g32y8")
|
||||
|
||||
[node name="FarmingControls" type="Node2D" parent="." node_paths=PackedStringArray("_movingPlayer", "_camera", "_wateringParticles")]
|
||||
script = ExtResource("817_6nrw3")
|
||||
_fieldPrefab = ExtResource("818_16w6h")
|
||||
_movingPlayer = NodePath("../CharacterBody2D")
|
||||
_camera = NodePath("../CharacterBody2D/Camera2D")
|
||||
_wateringParticles = NodePath("../pouring water vfx")
|
||||
_wateringCanParticlesVerticalOffset = -100.0
|
||||
|
||||
[node name="Node2D" type="Node2D" parent="."]
|
||||
[node name="dialogic toggle" type="Node2D" parent="."]
|
||||
position = Vector2(0, 374)
|
||||
script = ExtResource("819_4na52")
|
||||
|
||||
[node name="pouring water vfx" type="CPUParticles2D" parent="."]
|
||||
position = Vector2(-652, -599)
|
||||
rotation = -0.333807
|
||||
emitting = false
|
||||
amount = 20
|
||||
texture = ExtResource("473_g32y8")
|
||||
lifetime = 0.5
|
||||
randomness = 1.0
|
||||
local_coords = true
|
||||
draw_order = 1
|
||||
emission_shape = 2
|
||||
emission_sphere_radius = 128.0
|
||||
linear_accel_min = 44.07
|
||||
linear_accel_max = 78.81
|
||||
scale_amount_min = 0.4
|
||||
scale_amount_max = 0.8
|
||||
color = Color(0.400601, 0.62444, 0.791217, 1)
|
||||
hue_variation_max = 0.4
|
||||
|
||||
[connection signal="FilledWateringCan" from="." to="CharacterBody2D/WateringCanUI" method="Refill"]
|
||||
[connection signal="InventorySelectionChanged" from="." to="CharacterBody2D/WateringCanUI" method="IsWateringCanActive"]
|
||||
[connection signal="PickedUpTool" from="." to="CharacterBody2D" method="ActivateTool"]
|
||||
[connection signal="PickedUpTool" from="." to="CharacterBody2D/WateringCanUI" method="IsWateringCanActive"]
|
||||
[connection signal="WateringField" from="FarmingControls" to="CharacterBody2D" method="PlayWateringAnimation"]
|
||||
[connection signal="timelineEnded" from="Node2D" to="." method="EnableMovement"]
|
||||
[connection signal="timelineStarted" from="Node2D" to="." method="DisableMovement"]
|
||||
[connection signal="WateringField" from="FarmingControls" to="CharacterBody2D/WateringCanUI" method="Water"]
|
||||
[connection signal="timelineEnded" from="dialogic toggle" to="." method="EnableMovement"]
|
||||
[connection signal="timelineStarted" from="dialogic toggle" to="." method="DisableMovement"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=47 format=3 uid="uid://dfvgp1my5rydh"]
|
||||
[gd_scene load_steps=48 format=3 uid="uid://dfvgp1my5rydh"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c34012j5ukiuf" path="res://art/animation/Yeli2D/F01-Yeli_Idle/0001.png" id="1_03m0b"]
|
||||
[ext_resource type="Script" uid="uid://d2486x6upmwqq" path="res://scripts/GdScript/dialogic_starter.gd" id="1_at1n1"]
|
||||
@@ -182,10 +182,13 @@ animations = [{
|
||||
"speed": 15.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_aqu1t"]
|
||||
radius = 202.0
|
||||
height = 404.0
|
||||
|
||||
[node name="Yeli" type="Node2D"]
|
||||
z_index = 1
|
||||
y_sort_enabled = true
|
||||
position = Vector2(0, 322)
|
||||
script = ExtResource("1_at1n1")
|
||||
|
||||
[node name="InteractionArea" parent="." instance=ExtResource("42_ahrat")]
|
||||
@@ -219,6 +222,12 @@ offset = Vector2(0, -450)
|
||||
[node name="DialogicToggle" type="Node2D" parent="."]
|
||||
script = ExtResource("44_aqu1t")
|
||||
|
||||
[node name="AnimatableBody2D" type="AnimatableBody2D" parent="."]
|
||||
position = Vector2(0, -172)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="AnimatableBody2D"]
|
||||
shape = SubResource("CapsuleShape2D_aqu1t")
|
||||
|
||||
[connection signal="Interacted" from="InteractionArea" to="TalkingControl" method="ToggleTalking"]
|
||||
[connection signal="Talking" from="TalkingControl" to="." method="open"]
|
||||
[connection signal="timelineEnded" from="DialogicToggle" to="TalkingControl" method="ToggleTalking"]
|
||||
|
||||
@@ -49,7 +49,6 @@ autowrap_mode = 3
|
||||
shape = SubResource("CircleShape2D_tlhp6")
|
||||
|
||||
[node name="Label" parent="InteractionArea2" index="1"]
|
||||
visible = true
|
||||
z_index = 5
|
||||
offset_left = -68.0
|
||||
offset_top = -111.0
|
||||
|
||||
@@ -18,10 +18,16 @@ boot_splash/fullsize=false
|
||||
boot_splash/image="uid://utam4axkvutc"
|
||||
config/icon="uid://b2smanpdo1y5e"
|
||||
|
||||
[audio]
|
||||
|
||||
buses/default_bus_layout="uid://b6dwkmkyb0axk"
|
||||
|
||||
[autoload]
|
||||
|
||||
Dialogic="*res://addons/dialogic/Core/DialogicGameHandler.gd"
|
||||
InventoryManager="*res://scripts/CSharp/Common/Inventory/InventoryManager.cs"
|
||||
QuestManager="*res://scripts/CSharp/Common/Quest/QuestManager.cs"
|
||||
Signal_Debugger="*res://addons/SignalVisualizer/Debugger/SignalDebugger.gd"
|
||||
|
||||
[dialogic]
|
||||
|
||||
@@ -94,7 +100,7 @@ movie_writer/movie_file="/home/kaddi/Documents/Repos/Godot/Babushka/_clips/clip.
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PackedStringArray("res://addons/anthonyec.camera_preview/plugin.cfg", "res://addons/dialogic/plugin.cfg")
|
||||
enabled=PackedStringArray("res://addons/SignalVisualizer/plugin.cfg", "res://addons/anthonyec.camera_preview/plugin.cfg", "res://addons/dialogic/plugin.cfg")
|
||||
|
||||
[file_customization]
|
||||
|
||||
@@ -158,6 +164,11 @@ interact={
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_inventory_journal_open_close={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":74,"key_label":0,"unicode":106,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_inventory_open_close={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":73,"key_label":0,"unicode":105,"location":0,"echo":false,"script":null)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://0aruj4lm74n6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_kisdg"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_kisdg")
|
||||
id = "test_01"
|
||||
title = "First Testing Quest"
|
||||
description = "Do the first thing you do to complete this quest"
|
||||
metadata/_custom_type_script = "uid://vji5lp4qc8pp"
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://be1dmc6d2mxl5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_t87fj"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_t87fj")
|
||||
id = "test_02"
|
||||
title = "Second Testing Quest"
|
||||
description = "Second my ass. Do what ever. I don't care"
|
||||
metadata/_custom_type_script = "uid://vji5lp4qc8pp"
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://tmmnsg1bge2"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_y0umc"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_y0umc")
|
||||
id = "test_03"
|
||||
title = "Third Testing Quest"
|
||||
description = "I'd like to apologize for the second quest, he has some bad manners"
|
||||
metadata/_custom_type_script = "uid://vji5lp4qc8pp"
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=71 format=3 uid="uid://gigb28qk8t12"]
|
||||
[gd_scene load_steps=79 format=3 uid="uid://gigb28qk8t12"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="1_7wfwe"]
|
||||
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"]
|
||||
@@ -44,6 +44,12 @@
|
||||
[ext_resource type="AudioStream" uid="uid://fsiypqhql67w" path="res://audio/sfx/Farming/SFX_GettingWater_01.wav" id="39_di1ed"]
|
||||
[ext_resource type="AudioStream" uid="uid://foyw26hq1qp5" path="res://audio/sfx/Farming/SFX_GettingWater_02.wav" id="40_ceriq"]
|
||||
[ext_resource type="Script" uid="uid://cfnrd5k1k0gxw" path="res://scripts/CSharp/Common/AudioPlayer.cs" id="40_w3jkj"]
|
||||
[ext_resource type="Script" uid="uid://clxb3n668oud3" path="res://scripts/CSharp/Common/Audio/AudioDebugger.cs" id="42_1nkjm"]
|
||||
[ext_resource type="AudioStream" uid="uid://vcftvrpi6c7k" path="res://audio/sfx/Farming/SFX_Harke_03_Solo.wav" id="42_wtw65"]
|
||||
[ext_resource type="AudioStream" uid="uid://bxh5m04vdo0sr" path="res://audio/sfx/Farming/SFX_Harke_04_Solo.wav" id="43_1nkjm"]
|
||||
[ext_resource type="AudioStream" uid="uid://dapsknn486aee" path="res://audio/sfx/Farming/SFX_WateringPlants_01.wav" id="45_lbk0f"]
|
||||
[ext_resource type="AudioStream" uid="uid://dnyne8wov50so" path="res://audio/sfx/Farming/SFX_WateringPlants_02.wav" id="46_2rjny"]
|
||||
[ext_resource type="AudioStream" uid="uid://c43a6x43jkikl" path="res://audio/sfx/Farming/SFX_GettingWater_Well_01_Reverb.wav" id="49_d77e7"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wtdui"]
|
||||
shader = ExtResource("13_7p0hq")
|
||||
@@ -78,9 +84,13 @@ shader_parameter/noise = SubResource("NoiseTexture2D_d53cn")
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_eryax"]
|
||||
offsets = PackedFloat32Array(0, 0.743902, 1)
|
||||
colors = PackedColorArray(0.315758, 0.221537, 0.271709, 1, 0.443137, 0.4, 0.360784, 1, 0.686275, 0.556863, 0.47451, 1)
|
||||
colors = PackedColorArray(0.22, 0.1078, 0.16764, 1, 0.443137, 0.4, 0.360784, 1, 0.6, 0.4853, 0.414, 1)
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_wgikv"]
|
||||
frequency = 0.0296
|
||||
fractal_octaves = 7
|
||||
fractal_gain = 0.795
|
||||
domain_warp_enabled = true
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_e5alv"]
|
||||
seamless = true
|
||||
@@ -117,11 +127,11 @@ shader_parameter/brightness_add = 0.0
|
||||
shader_parameter/contrast_mult = 1.128
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0sfl7"]
|
||||
size = Vector2(728, 368)
|
||||
size = Vector2(1041, 368)
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_p6n74"]
|
||||
resource_local_to_scene = true
|
||||
radius = 600.0
|
||||
radius = 371.058
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_2nee2"]
|
||||
resource_local_to_scene = true
|
||||
@@ -154,14 +164,24 @@ size = Vector2(7340, 1192)
|
||||
|
||||
[sub_resource type="AudioStreamPlaylist" id="AudioStreamPlaylist_ceriq"]
|
||||
loop = false
|
||||
stream_count = 2
|
||||
stream_count = 1
|
||||
stream_0 = ExtResource("37_di1ed")
|
||||
stream_1 = ExtResource("37_8ey8m")
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_ceriq"]
|
||||
streams_count = 2
|
||||
stream_0/stream = ExtResource("42_wtw65")
|
||||
stream_1/stream = ExtResource("43_1nkjm")
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_p4qqi"]
|
||||
streams_count = 2
|
||||
stream_0/stream = ExtResource("45_lbk0f")
|
||||
stream_1/stream = ExtResource("46_2rjny")
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_618my"]
|
||||
streams_count = 3
|
||||
stream_0/stream = ExtResource("39_di1ed")
|
||||
stream_1/stream = ExtResource("40_ceriq")
|
||||
stream_2/stream = ExtResource("49_d77e7")
|
||||
|
||||
[node name="BabushkaSceneFarmOutside2d" type="Node2D"]
|
||||
script = ExtResource("34_e5b7x")
|
||||
@@ -336,7 +356,7 @@ texture = ExtResource("11_vbdb2")
|
||||
[node name="background layer 4" type="ParallaxLayer" parent="ParallaxBackground"]
|
||||
position = Vector2(0, -82)
|
||||
motion_scale = Vector2(0.5, 0.5)
|
||||
motion_mirroring = Vector2(10500, 0)
|
||||
motion_mirroring = Vector2(10480, 0)
|
||||
|
||||
[node name="Kenney Assets" type="Node2D" parent="ParallaxBackground/background layer 4"]
|
||||
visible = false
|
||||
@@ -459,7 +479,7 @@ texture = ExtResource("13_0qu0h")
|
||||
|
||||
[node name="JelenaMockupBg03" type="Sprite2D" parent="ParallaxBackground/background layer 4"]
|
||||
material = SubResource("ShaderMaterial_wtdui")
|
||||
position = Vector2(7965, 728)
|
||||
position = Vector2(7923, 727)
|
||||
scale = Vector2(2.75, 2.75)
|
||||
texture = ExtResource("13_0qu0h")
|
||||
|
||||
@@ -846,14 +866,14 @@ region_rect = Rect2(0, 0, 1504, 1686)
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSorted/Brünnen/StaticBody2D"]
|
||||
position = Vector2(116, -224)
|
||||
position = Vector2(145.5, -224)
|
||||
shape = SubResource("RectangleShape2D_0sfl7")
|
||||
|
||||
[node name="InteractionArea" parent="YSorted/Brünnen" instance=ExtResource("27_klb81")]
|
||||
_id = 1
|
||||
|
||||
[node name="CollisionShape3D" parent="YSorted/Brünnen/InteractionArea/Area2D" index="0"]
|
||||
position = Vector2(80, -368)
|
||||
position = Vector2(146, -130)
|
||||
shape = SubResource("CircleShape2D_p6n74")
|
||||
|
||||
[node name="HoeGenericPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
|
||||
@@ -872,6 +892,9 @@ position = Vector2(8192, 3507)
|
||||
[node name="SpawnWithItem" parent="YSorted/CanGenericPickup" index="0"]
|
||||
_blueprint = ExtResource("28_ipqaa")
|
||||
|
||||
[node name="InteractionArea2" parent="YSorted/CanGenericPickup" index="3"]
|
||||
position = Vector2(0, -159)
|
||||
|
||||
[node name="CollisionShape3D" parent="YSorted/CanGenericPickup/InteractionArea2/Area2D" index="0"]
|
||||
shape = SubResource("CircleShape2D_ipqaa")
|
||||
|
||||
@@ -991,23 +1014,49 @@ follow_viewport_enabled = false
|
||||
anchors_preset = 7
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -126.0
|
||||
offset_top = -48.0
|
||||
offset_right = 221.82
|
||||
offset_bottom = 146.4
|
||||
offset_left = -116.0
|
||||
offset_top = -53.0
|
||||
offset_right = 231.82
|
||||
offset_bottom = 141.4
|
||||
grow_vertical = 0
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 10
|
||||
|
||||
[node name="SlotsMover" parent="CanvasLayer/Inventory/SlotsContainer" index="0"]
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -450.0
|
||||
offset_top = -610.0
|
||||
offset_right = 450.0
|
||||
offset_bottom = 0.0
|
||||
|
||||
[node name="TextureRect2" parent="CanvasLayer/Inventory/SlotsContainer/SlotsMover/BackgroundContainer" index="1"]
|
||||
offset_left = -360.339
|
||||
offset_top = 0.228533
|
||||
offset_right = -456.339
|
||||
offset_bottom = 30.2285
|
||||
|
||||
[node name="Audio" type="Node" parent="."]
|
||||
|
||||
[node name="Background Music" type="AudioStreamPlayer2D" parent="Audio"]
|
||||
[node name="Background Music Ramp up" type="AudioStreamPlayer2D" parent="Audio"]
|
||||
position = Vector2(4002, 2030)
|
||||
stream = SubResource("AudioStreamPlaylist_ceriq")
|
||||
volume_db = -15.0
|
||||
autoplay = true
|
||||
max_distance = 1e+06
|
||||
bus = &"Music"
|
||||
area_mask = 33
|
||||
playback_type = 1
|
||||
script = ExtResource("42_1nkjm")
|
||||
|
||||
[node name="Background Music loop" type="AudioStreamPlayer2D" parent="Audio"]
|
||||
position = Vector2(4002, 2030)
|
||||
stream = ExtResource("37_8ey8m")
|
||||
max_distance = 1e+06
|
||||
bus = &"Music"
|
||||
area_mask = 33
|
||||
playback_type = 1
|
||||
script = ExtResource("42_1nkjm")
|
||||
|
||||
[node name="SFX" type="Node" parent="Audio"]
|
||||
|
||||
@@ -1018,13 +1067,13 @@ playback_type = 2
|
||||
script = ExtResource("40_w3jkj")
|
||||
|
||||
[node name="Watering SFX" type="AudioStreamPlayer2D" parent="Audio/SFX"]
|
||||
stream = SubResource("AudioStreamRandomizer_ceriq")
|
||||
stream = SubResource("AudioStreamRandomizer_p4qqi")
|
||||
max_distance = 2e+07
|
||||
playback_type = 2
|
||||
script = ExtResource("40_w3jkj")
|
||||
|
||||
[node name="FillWater SFX2" type="AudioStreamPlayer2D" parent="Audio/SFX"]
|
||||
stream = SubResource("AudioStreamRandomizer_ceriq")
|
||||
stream = SubResource("AudioStreamRandomizer_618my")
|
||||
max_distance = 2e+07
|
||||
playback_type = 2
|
||||
script = ExtResource("40_w3jkj")
|
||||
@@ -1032,10 +1081,12 @@ script = ExtResource("40_w3jkj")
|
||||
[connection signal="FilledWateringCan" from="YSorted/Vesna" to="Audio/SFX/FillWater SFX2" method="PlayOneShot"]
|
||||
[connection signal="WateringField" from="YSorted/Vesna/FarmingControls" to="Audio/SFX/Watering SFX" method="PlayOneShot"]
|
||||
[connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
|
||||
[connection signal="SuccessfulPickUp" from="YSorted/CanGenericPickup" to="YSorted/Vesna" method="HandlePickUp"]
|
||||
[connection signal="SuccessfulPickUp" from="YSorted/RakeGenericPickup" to="YSorted/Vesna" method="HandlePickUp"]
|
||||
[connection signal="Interacted" from="YSorted/Farm visuals/Static/EnterHouseInteraction" to="." method="LoadScene"]
|
||||
[connection signal="FieldCreated" from="YSorted/Farm visuals/FieldParent" to="Audio/SFX/Farming SFX" method="PlayOneShot"]
|
||||
[connection signal="mouse_entered" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Farm visuals/FieldParent" method="MouseEnteredAllowedArea"]
|
||||
[connection signal="mouse_exited" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Farm visuals/FieldParent" method="MouseExitedAllowedArea"]
|
||||
[connection signal="input_event" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Vesna/FarmingControls" method="InputEventPressedOn"]
|
||||
[connection signal="finished" from="Audio/Background Music Ramp up" to="Audio/Background Music loop" method="PlayFromOffset"]
|
||||
|
||||
[editable path="YSorted/Vesna"]
|
||||
[editable path="YSorted/Brünnen/InteractionArea"]
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://dbpsqfedlku4f"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cqcs80xsgygeb" path="res://prefabs/UI/Book/Book.tscn" id="1_bd7dq"]
|
||||
[ext_resource type="Script" uid="uid://cg0oqug38c81n" path="res://scripts/CSharp/Common/Quest/QuestTestingScript.cs" id="2_sv6jn"]
|
||||
[ext_resource type="Resource" uid="uid://0aruj4lm74n6" path="res://resources/quests/test_01.tres" id="3_nhtae"]
|
||||
[ext_resource type="Resource" uid="uid://be1dmc6d2mxl5" path="res://resources/quests/test_02.tres" id="4_kr4yw"]
|
||||
[ext_resource type="Resource" uid="uid://tmmnsg1bge2" path="res://resources/quests/test_03.tres" id="5_4cktu"]
|
||||
|
||||
[node name="BabushkaTestsBook" type="Node"]
|
||||
|
||||
[node name="Book" parent="." instance=ExtResource("1_bd7dq")]
|
||||
|
||||
[node name="QuestTesting" type="Node" parent="."]
|
||||
script = ExtResource("2_sv6jn")
|
||||
_questsToActivate = Array[Object]([ExtResource("3_nhtae"), ExtResource("4_kr4yw"), ExtResource("5_4cktu")])
|
||||
@@ -0,0 +1,193 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://c4ns2ixo8k2ih"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="1_opxcj"]
|
||||
[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="3_sx4ix"]
|
||||
[ext_resource type="Resource" uid="uid://0aruj4lm74n6" path="res://resources/quests/test_01.tres" id="4_qyyck"]
|
||||
[ext_resource type="Resource" uid="uid://be1dmc6d2mxl5" path="res://resources/quests/test_02.tres" id="5_sokiv"]
|
||||
[ext_resource type="Resource" uid="uid://tmmnsg1bge2" path="res://resources/quests/test_03.tres" id="6_ajsa7"]
|
||||
|
||||
[node name="BabushkaTestsQuests" type="Node2D"]
|
||||
|
||||
[node name="CanvasLayer" parent="." instance=ExtResource("1_opxcj")]
|
||||
|
||||
[node name="CanvasLayer2" type="CanvasLayer" parent="."]
|
||||
layer = 128
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer2"]
|
||||
offset_left = 71.0
|
||||
offset_top = 53.0
|
||||
offset_right = 571.0
|
||||
offset_bottom = 353.0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="CanvasLayer2/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Quest 1"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Active" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Active"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer/Active"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("4_qyyck")
|
||||
toStatus = 1
|
||||
makeCurrent = true
|
||||
|
||||
[node name="Done" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Done"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer/Done"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("4_qyyck")
|
||||
toStatus = 2
|
||||
|
||||
[node name="Cancle" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Cancle"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer/Cancle"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("4_qyyck")
|
||||
toStatus = 3
|
||||
|
||||
[node name="Hide" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Hide
|
||||
"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer/Hide"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("4_qyyck")
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="CanvasLayer2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="CanvasLayer2/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Quest 2"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Active" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Active"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer2/Active"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("5_sokiv")
|
||||
toStatus = 1
|
||||
|
||||
[node name="Done" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Done"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer2/Done"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("5_sokiv")
|
||||
toStatus = 2
|
||||
|
||||
[node name="Cancle" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Cancle"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer2/Cancle"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("5_sokiv")
|
||||
toStatus = 3
|
||||
|
||||
[node name="Hide" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Hide
|
||||
"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer2/Hide"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("5_sokiv")
|
||||
|
||||
[node name="HBoxContainer3" type="HBoxContainer" parent="CanvasLayer2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="CanvasLayer2/VBoxContainer/HBoxContainer3"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
text = "Quest 3"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Active" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer3"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Active"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer3/Active"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("6_ajsa7")
|
||||
toStatus = 1
|
||||
|
||||
[node name="Done" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer3"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Done"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer3/Done"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("6_ajsa7")
|
||||
toStatus = 2
|
||||
|
||||
[node name="Cancle" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer3"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Cancle"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer3/Cancle"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("6_ajsa7")
|
||||
toStatus = 3
|
||||
|
||||
[node name="Hide" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer3"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Hide
|
||||
"
|
||||
|
||||
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer3/Hide"]
|
||||
script = ExtResource("3_sx4ix")
|
||||
questResource = ExtResource("6_ajsa7")
|
||||
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer/Active" to="CanvasLayer2/VBoxContainer/HBoxContainer/Active/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer/Done" to="CanvasLayer2/VBoxContainer/HBoxContainer/Done/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer/Cancle" to="CanvasLayer2/VBoxContainer/HBoxContainer/Cancle/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer/Hide" to="CanvasLayer2/VBoxContainer/HBoxContainer/Hide/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer2/Active" to="CanvasLayer2/VBoxContainer/HBoxContainer2/Active/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer2/Done" to="CanvasLayer2/VBoxContainer/HBoxContainer2/Done/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer2/Cancle" to="CanvasLayer2/VBoxContainer/HBoxContainer2/Cancle/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer2/Hide" to="CanvasLayer2/VBoxContainer/HBoxContainer2/Hide/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer3/Active" to="CanvasLayer2/VBoxContainer/HBoxContainer3/Active/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer3/Done" to="CanvasLayer2/VBoxContainer/HBoxContainer3/Done/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer3/Cancle" to="CanvasLayer2/VBoxContainer/HBoxContainer3/Cancle/QuestSetter" method="Trigger"]
|
||||
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer3/Hide" to="CanvasLayer2/VBoxContainer/HBoxContainer3/Hide/QuestSetter" method="Trigger"]
|
||||
@@ -0,0 +1,15 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Takes the current contents of a AudioStreamPlayer and offers visualization and control.
|
||||
/// </summary>
|
||||
public partial class AudioDebugger : AudioStreamPlayer2D
|
||||
{
|
||||
[Export] private float _offset_in_seconds_to_play = 0;
|
||||
|
||||
public void PlayFromOffset()
|
||||
{
|
||||
Play(_offset_in_seconds_to_play);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://clxb3n668oud3
|
||||
@@ -10,6 +10,7 @@ public partial class Player2D : CharacterBody2D
|
||||
[Export] private float _speed = 100f;
|
||||
[Export] private AnimatedSprite2D _sprite;
|
||||
[Export] private SceneTree.GroupCallFlags _fieldFlags;
|
||||
[Export] private CpuParticles2D _wateringParticles;
|
||||
|
||||
// -1 means no tool.
|
||||
private int _toolID = -1;
|
||||
@@ -99,12 +100,14 @@ public partial class Player2D : CharacterBody2D
|
||||
_lastDirection = Vector2.Up;
|
||||
}
|
||||
|
||||
/*
|
||||
if (Input.IsActionPressed("item"))
|
||||
{
|
||||
_sprite.Animation = "diagonal item";
|
||||
anyActionPressed = true;
|
||||
_lastDirection = Vector2.Right;
|
||||
}
|
||||
*/
|
||||
|
||||
if (anyActionPressed)
|
||||
{
|
||||
@@ -154,6 +157,7 @@ public partial class Player2D : CharacterBody2D
|
||||
_sprite.Animation = "diagonal wateringcan";
|
||||
_sprite.Play();
|
||||
_canHandleInput = false;
|
||||
_wateringParticles.Emitting = true;
|
||||
Task.Run(DelayedInputHandlerReset);
|
||||
}
|
||||
}
|
||||
@@ -161,6 +165,7 @@ public partial class Player2D : CharacterBody2D
|
||||
private async Task DelayedInputHandlerReset()
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
_wateringParticles.Emitting = false;
|
||||
_canHandleInput = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,14 @@ public partial class FarmingControls2D : Node2D
|
||||
[Export] private PackedScene _fieldPrefab;
|
||||
[Export] private Node2D _movingPlayer;
|
||||
[Export] private Camera2D _camera;
|
||||
[Export] private CpuParticles2D _wateringParticles;
|
||||
[Export] private float _wateringCanParticlesVerticalOffset = 50f;
|
||||
|
||||
public FieldService2D FieldService;
|
||||
|
||||
private int _toolId = -1;
|
||||
private bool _wateringCanFilled = false;
|
||||
private int _currentWateringCanStep = 0;
|
||||
private int _wateringCanCapacity = 3;
|
||||
|
||||
|
||||
[Signal] public delegate void WateringFieldEventHandler();
|
||||
|
||||
@@ -41,6 +42,9 @@ public partial class FarmingControls2D : Node2D
|
||||
}
|
||||
|
||||
_toolId = activate ? toolId : -1;
|
||||
|
||||
WateringCanState.SetActive(_toolId == WateringCanState.WATERING_CAN_ID);
|
||||
|
||||
return activate;
|
||||
}
|
||||
|
||||
@@ -48,26 +52,70 @@ public partial class FarmingControls2D : Node2D
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
Vector2 mousePosition = _camera.GetGlobalMousePosition();
|
||||
Vector2I mousePositionInteger = (Vector2I) mousePosition;
|
||||
Vector2I adjustedPosition = AdjustValue(mousePositionInteger, new Vector2I(735, 651));
|
||||
|
||||
if (@event.IsActionPressed("click") && _toolId == 0)
|
||||
{
|
||||
MakeField(adjustedPosition);
|
||||
}
|
||||
|
||||
if (@event.IsActionPressed("click") && _toolId == 1 && _wateringCanFilled)
|
||||
if (@event.IsActionPressed("click")
|
||||
&& _toolId == WateringCanState.WATERING_CAN_ID
|
||||
&& WateringCanState.GetFillState() > 0)
|
||||
{
|
||||
Vector2I adjustedPosition = GetAdjustedMousePosition();
|
||||
WaterTheField(adjustedPosition);
|
||||
}
|
||||
}
|
||||
|
||||
public void FillWateringCan(bool fillUp)
|
||||
private Vector2I GetAdjustedMousePosition()
|
||||
{
|
||||
if (_toolId == 1 )
|
||||
Vector2 mousePosition = _camera.GetGlobalMousePosition();
|
||||
Vector2I mousePositionInteger = (Vector2I) mousePosition;
|
||||
Vector2I adjustedPosition = AdjustValue(mousePositionInteger, new Vector2I(735, 651));
|
||||
return adjustedPosition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the allowed farming area collision area 2d.
|
||||
/// </summary>
|
||||
/// <param name="node"></param>
|
||||
/// <param name="inputEvent"></param>
|
||||
/// <param name="shapeIndex"></param>
|
||||
public void InputEventPressedOn(Node node, InputEvent inputEvent, int shapeIndex)
|
||||
{
|
||||
if (!inputEvent.IsPressed())
|
||||
{
|
||||
_wateringCanFilled = fillUp;
|
||||
GD.Print("Input Event is not pressed." );
|
||||
return;
|
||||
}
|
||||
|
||||
if (!inputEvent.IsActionPressed("click"))
|
||||
return;
|
||||
|
||||
if (inputEvent is InputEventMouseButton inputEventMouseButton)
|
||||
{
|
||||
GD.Print("Input Event is InputEventMouseButton." );
|
||||
if (!inputEventMouseButton.Pressed)
|
||||
{
|
||||
GD.Print("Input Event Mouse Button is not pressed." );
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GD.Print("Other Input Event registered." );
|
||||
return;
|
||||
}
|
||||
|
||||
GD.Print("Current tool id: " + _toolId );
|
||||
if (_toolId == 0)
|
||||
{
|
||||
GD.Print("Trying to create field." );
|
||||
Vector2I adjustedPosition = GetAdjustedMousePosition();
|
||||
MakeField(adjustedPosition);
|
||||
}
|
||||
}
|
||||
|
||||
#region WATERING
|
||||
public void FillWateringCan()
|
||||
{
|
||||
if (_toolId == WateringCanState.WATERING_CAN_ID)
|
||||
{
|
||||
WateringCanState.Fill();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,29 +126,19 @@ public partial class FarmingControls2D : Node2D
|
||||
return;
|
||||
|
||||
field.Water();
|
||||
_wateringParticles.GlobalPosition = new Vector2(field.GlobalPosition.X, field.GlobalPosition.Y + _wateringCanParticlesVerticalOffset);
|
||||
WateringCanState.Water();
|
||||
EmitSignal(SignalName.WateringField);
|
||||
|
||||
if (_currentWateringCanStep < _wateringCanCapacity)
|
||||
{
|
||||
_currentWateringCanStep++;
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentWateringCanStep = 0;
|
||||
FillWateringCan(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region FIELD CREATION
|
||||
private void MakeField(Vector2I fieldPosition)
|
||||
{
|
||||
if(FieldService == null || _fieldPrefab == null)
|
||||
return;
|
||||
|
||||
// only try to instantiate a field if you're in the allowed area
|
||||
if (!FieldService.FieldAllowed())
|
||||
return;
|
||||
|
||||
// only instantiate a field if there isn't one already.
|
||||
if(FieldService.Get(fieldPosition) == null)
|
||||
{
|
||||
@@ -131,4 +169,6 @@ public partial class FarmingControls2D : Node2D
|
||||
{
|
||||
return input.Snapped(step);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -8,26 +8,23 @@ public partial class FieldService2D : Node2D
|
||||
{
|
||||
[Export] private Dictionary<Vector2I, FieldBehaviour2D> fields = new Dictionary<Vector2I, FieldBehaviour2D>();
|
||||
|
||||
private bool _fieldAllowed = false;
|
||||
[Export] private Area2D _allowedArea;
|
||||
|
||||
[Signal] public delegate void FieldCreatedEventHandler();
|
||||
|
||||
//Validate
|
||||
|
||||
public void MouseEnteredAllowedArea()
|
||||
/*
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
_fieldAllowed = true;
|
||||
var spaceState = GetWorld2D().DirectSpaceState;
|
||||
// use global coordinates, not local to node
|
||||
var query = PhysicsRayQueryParameters2D.Create(GetGlobalMousePosition(), new Vector3(0,0,-1),
|
||||
CollisionMask, [GetRid()]);
|
||||
var result = spaceState.IntersectRay(query);
|
||||
if (result.Count > 0)
|
||||
GD.Print("Hit at point: ", result["position"]);
|
||||
}
|
||||
*/
|
||||
|
||||
public void MouseExitedAllowedArea()
|
||||
{
|
||||
_fieldAllowed = false;
|
||||
}
|
||||
|
||||
public bool FieldAllowed()
|
||||
{
|
||||
return _fieldAllowed;
|
||||
}
|
||||
|
||||
//Create
|
||||
public bool TryAddEntry(Vector2I key, FieldBehaviour2D field)
|
||||
|
||||
@@ -16,6 +16,8 @@ public partial class VesnaBehaviour2D : Node
|
||||
[Signal] public delegate void PickedUpToolEventHandler(bool success, int toolId);
|
||||
[Signal] public delegate void FilledWateringCanEventHandler();
|
||||
|
||||
[Signal] public delegate void InventorySelectionChangedEventHandler(int toolId);
|
||||
|
||||
private InventoryManager _inventoryManager;
|
||||
private InventoryInstance _inventoryInstance;
|
||||
|
||||
@@ -27,7 +29,17 @@ public partial class VesnaBehaviour2D : Node
|
||||
_inventoryManager.SlotIndexChanged += HandleInventorySelectedSlotIndexChanged;
|
||||
}
|
||||
|
||||
private void HandleInventorySelectedSlotIndexChanged(int newIndex)
|
||||
/// <summary>
|
||||
/// Called when picking up an item.
|
||||
/// Makes sure that item animations are also updated when they are occupying a currently empty spot.
|
||||
/// </summary>
|
||||
public void HandlePickUp()
|
||||
{
|
||||
//Calls the same event handler as the inventory to ensure the currently selected item is updated in the animation.
|
||||
HandleInventorySelectedSlotIndexChanged(0);
|
||||
}
|
||||
|
||||
private void HandleInventorySelectedSlotIndexChanged(int newIndex = 0)
|
||||
{
|
||||
InventorySlot currentSlot = InventoryManager.Instance.GetCurrentSelectedSlot();
|
||||
ItemInstance? currentItem = currentSlot.itemInstance;
|
||||
@@ -35,19 +47,20 @@ public partial class VesnaBehaviour2D : Node
|
||||
if (currentItem == null)
|
||||
return;
|
||||
|
||||
int toolId = -1;
|
||||
|
||||
if (currentItem.blueprint == _hoe)
|
||||
{
|
||||
ActivateTool(0);
|
||||
return;
|
||||
toolId = 0;
|
||||
}
|
||||
|
||||
if (currentItem.blueprint == _wateringCan)
|
||||
{
|
||||
ActivateTool(1);
|
||||
return;
|
||||
toolId = 1;
|
||||
}
|
||||
|
||||
ActivateTool(-1);
|
||||
ActivateTool(toolId);
|
||||
EmitSignal(SignalName.InventorySelectionChanged, toolId);
|
||||
|
||||
}
|
||||
|
||||
@@ -63,7 +76,7 @@ public partial class VesnaBehaviour2D : Node
|
||||
{
|
||||
if (toolId == 1)
|
||||
{
|
||||
_farmingControls.FillWateringCan(true);
|
||||
_farmingControls.FillWateringCan();
|
||||
_player2d.PlayWateringCanFillupAnimation();
|
||||
EmitSignal(SignalName.FilledWateringCan);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
namespace Babushka.scripts.CSharp.Common.Farming;
|
||||
|
||||
/// <summary>
|
||||
/// Holds Information about the current state of the watering can.
|
||||
/// Since there is only one watering can, we can track this in one central static class.
|
||||
/// </summary>
|
||||
public static class WateringCanState
|
||||
{
|
||||
private static int _fillstate = 0;
|
||||
|
||||
/// <summary>
|
||||
/// How many fields can be watered with one filling of the watering can.
|
||||
/// </summary>
|
||||
public const int MAX_FILLSTATE = 6;
|
||||
|
||||
/// <summary>
|
||||
/// The Tool ID of the watering can. Used to identify it amongst other pickup items (and things that can be held by Vesna).
|
||||
/// </summary>
|
||||
public const int WATERING_CAN_ID = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not the watering can is currently active, i.e. held in hand by Vesna.
|
||||
/// Triggers animations and ui.
|
||||
/// </summary>
|
||||
public static bool Active = false;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Resets the fillstate to the max amount.
|
||||
/// </summary>
|
||||
public static void Fill()
|
||||
{
|
||||
_fillstate = MAX_FILLSTATE;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when watering a field. Reduces the current fillstate.
|
||||
/// </summary>
|
||||
public static void Water()
|
||||
{
|
||||
if(_fillstate > 0)
|
||||
_fillstate--;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the watering can. Equivalent to "Empty" state.
|
||||
/// </summary>
|
||||
public static void Reset()
|
||||
{
|
||||
_fillstate = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current fill state of the watering can.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetFillState()
|
||||
{
|
||||
return _fillstate;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the Active state of the watering can, i.e. if it is currently in hand and if the ui should be active.
|
||||
/// </summary>
|
||||
/// <param name="active"></param>
|
||||
public static void SetActive(bool active)
|
||||
{
|
||||
Active = active;
|
||||
}
|
||||
}
|
||||
@@ -4,29 +4,22 @@ namespace Babushka.scripts.CSharp.Common.Inventory;
|
||||
|
||||
public partial class InventoryUi : Control
|
||||
{
|
||||
private Control _slots;
|
||||
private Control _slotsMover;
|
||||
[Export] private Control _slotsParent;
|
||||
[Export] private Control _slotsMover;
|
||||
[Export] private Control[] _headerSlots;
|
||||
[Export] private Control _slotSelect;
|
||||
|
||||
private InventoryInstance _playerInventory;
|
||||
private Control _slotSelect;
|
||||
|
||||
private int? _slotOnMouse;
|
||||
|
||||
private bool _inventoryExtended = false;
|
||||
private Tween? _inventoryExtensionTween;
|
||||
|
||||
[Export]
|
||||
private float _inventoryClosedOffset = 0f;
|
||||
|
||||
[Export]
|
||||
private float _inventoryOpenedOffset = 200f;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
GD.Print("Ready inventory ui");
|
||||
_slots = GetNode<Control>("SlotsContainer/SlotsMover/Slots");
|
||||
_slotsMover = GetNode<Control>("SlotsContainer/SlotsMover");
|
||||
_playerInventory = InventoryManager.Instance.playerInventory;
|
||||
_slotSelect = GetNode<Control>("SlotsContainer/SlotSelectContainer/Selector");
|
||||
//PopulateSlots();
|
||||
SubscribeSlots();
|
||||
SetSlotContent();
|
||||
@@ -44,7 +37,7 @@ public partial class InventoryUi : Control
|
||||
for (var i = 0; i < _playerInventory.Slots.Count; i++)
|
||||
{
|
||||
var inventorySlot = _playerInventory.Slots[i];
|
||||
var uiSlot = _slots.GetChild(i) as SlotUi;
|
||||
var uiSlot = _slotsParent.GetChild(i) as SlotUi;
|
||||
|
||||
if (inventorySlot.itemInstance != null)
|
||||
{
|
||||
@@ -82,7 +75,7 @@ public partial class InventoryUi : Control
|
||||
|
||||
private void SetSlotSelectPosition()
|
||||
{
|
||||
_slotSelect.Position = new Vector2(InventoryManager.Instance.CurrentSelectedSlotIndex * 100, 0);
|
||||
_slotSelect.GlobalPosition = _headerSlots[InventoryManager.Instance.CurrentSelectedSlotIndex].GlobalPosition;
|
||||
}
|
||||
|
||||
private void PopulateSlots()
|
||||
@@ -93,7 +86,7 @@ public partial class InventoryUi : Control
|
||||
var slotInstance = slotPackedScene.Instantiate<SlotUi>();
|
||||
slotInstance.index = index;
|
||||
slotInstance.Clicked += SlotClicked;
|
||||
_slots.AddChild(slotInstance);
|
||||
_slotsParent.AddChild(slotInstance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +94,7 @@ public partial class InventoryUi : Control
|
||||
{
|
||||
for (var index = 0; index < _playerInventory.Slots.Count; index++)
|
||||
{
|
||||
var slotInstance = _slots.GetChild<SlotUi>(index);
|
||||
var slotInstance = _slotsParent.GetChild<SlotUi>(index);
|
||||
slotInstance.index = index;
|
||||
slotInstance.Clicked += SlotClicked;
|
||||
}
|
||||
@@ -111,7 +104,7 @@ public partial class InventoryUi : Control
|
||||
{
|
||||
for (var index = 0; index < _playerInventory.Slots.Count; index++)
|
||||
{
|
||||
var slotInstance = _slots.GetChild(index) as SlotUi;
|
||||
var slotInstance = _slotsParent.GetChild(index) as SlotUi;
|
||||
slotInstance!.Clicked -= SlotClicked;
|
||||
}
|
||||
}
|
||||
@@ -141,6 +134,8 @@ public partial class InventoryUi : Control
|
||||
{
|
||||
if (Input.IsActionJustPressed("ui_inventory_open_close"))
|
||||
{
|
||||
// We adjust the offset value in accordance with the screen height to make sure that the inventory is always in the middle of the screen.
|
||||
_inventoryOpenedOffset = (GetViewportRect().Size.Y / 2 + 400) * (-1);
|
||||
InputInventoryOpenClose();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ public partial class ItemOnGround2D : Node
|
||||
|
||||
private int pickUpCounter = 0;
|
||||
|
||||
[Signal] public delegate void SuccessfulPickUpEventHandler();
|
||||
|
||||
private Label _itemLabel => GetNode<Label>("ItemLabel");
|
||||
private Label _pickupErrorLabel => GetNode<Label>("PickupErrorLabel");
|
||||
private Sprite2D _iconSprite => GetNode<Sprite2D>("Icon");
|
||||
@@ -38,6 +40,7 @@ public partial class ItemOnGround2D : Node
|
||||
return;
|
||||
|
||||
var result = InventoryManager.Instance.CollectItem(itemInstance.Clone());
|
||||
EmitSignal(SignalName.SuccessfulPickUp);
|
||||
if (result == InventoryActionResult.Success)
|
||||
{
|
||||
if (!_infiniteSupply)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
public partial class PopUpPostIt : Control
|
||||
{
|
||||
private Label Text => GetNode<Label>("Text");
|
||||
|
||||
private AnimationPlayer Animation => GetNode<AnimationPlayer>("AnimationPlayer");
|
||||
|
||||
QuestManager QM => QuestManager.Instance!;
|
||||
public override void _EnterTree()
|
||||
{
|
||||
QM.QuestBecomesActive += NewQuestPostIt;
|
||||
}
|
||||
|
||||
private void NewQuestPostIt(QuestResource questResource)
|
||||
{
|
||||
Text.Text = questResource.title;
|
||||
Animation.Play("NewPostit");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://byar6yqrlph6k
|
||||
@@ -0,0 +1,11 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Common.Util;
|
||||
|
||||
public partial class QuestDescriptionUi : RichTextLabel
|
||||
{
|
||||
public void UpdateText(QuestLog questLog)
|
||||
{
|
||||
Text = questLog.currentDetailQuest?.description ?? "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://b8mywolvj2yq7
|
||||
@@ -0,0 +1,51 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Common.Util;
|
||||
using Godot;
|
||||
namespace Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
public partial class QuestListItemUi : Control
|
||||
{
|
||||
private Button TitleButton => GetNode<Button>("TitleButton");
|
||||
private Label TitleLabel => GetNode<Label>("TitleButton/HBoxContainer/TitleText");
|
||||
private TextureRect CircleTexture => GetNode<TextureRect>("TitleButton/Circled");
|
||||
private QuestResource? _questResource;
|
||||
|
||||
public void UpdateButton(QuestResource questResource)
|
||||
{
|
||||
_questResource = questResource;
|
||||
var questStatus = QuestManager.Instance!.GetQuestStatus(_questResource);
|
||||
var name = questResource.title;
|
||||
|
||||
name += questStatus.status switch
|
||||
{
|
||||
QuestStatus.Status.Done => " \u2713", // Check
|
||||
QuestStatus.Status.Canceled => " \u2715", // X
|
||||
_ => ""
|
||||
};
|
||||
|
||||
UpdateCircled(questResource == QuestManager.Instance.GetFollowQuest());
|
||||
ShowName(name);
|
||||
TitleButton.Pressed += ClickedTitleButton;
|
||||
|
||||
}
|
||||
private void UpdateCircled(bool value)
|
||||
{
|
||||
CircleTexture.Visible = value;
|
||||
}
|
||||
|
||||
private void ShowName(string questResourceTitle)
|
||||
{
|
||||
TitleLabel.Text = questResourceTitle;
|
||||
}
|
||||
|
||||
public void ClickedTitleButton()
|
||||
{
|
||||
var questLog = this.FindParentByType<QuestLog>();
|
||||
if (_questResource == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(_questResource), "QuestResource is null");
|
||||
}
|
||||
questLog.currentDetailQuest = _questResource;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://dwhee40ksubke
|
||||
@@ -0,0 +1,48 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
public partial class QuestListUi : VBoxContainer
|
||||
{
|
||||
[Export]
|
||||
private PackedScene _questListItemPrefab;
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
UpdateList();
|
||||
QuestManager.Instance!.QuestsChanged += UpdateList;
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
QuestManager.Instance!.QuestsChanged -= UpdateList;
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
UpdateList();
|
||||
}
|
||||
|
||||
public void UpdateList()
|
||||
{
|
||||
// delete children
|
||||
foreach (Node child in GetChildren())
|
||||
{
|
||||
RemoveChild(child);
|
||||
child.QueueFree();
|
||||
}
|
||||
|
||||
// recreate children
|
||||
var activeQuests = QuestManager.Instance.GetVisibleQuests();
|
||||
|
||||
foreach (var questPair in activeQuests)
|
||||
{
|
||||
var questResource = questPair.Key;
|
||||
var questStatus = questPair.Value;
|
||||
|
||||
var questListItem = _questListItemPrefab.Instantiate<QuestListItemUi>();
|
||||
questListItem.UpdateButton(questResource);
|
||||
AddChild(questListItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://c7ilqe2fmjyvx
|
||||
@@ -0,0 +1,53 @@
|
||||
#nullable enable
|
||||
using Godot;
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
public partial class QuestLog : Control
|
||||
{
|
||||
[Signal]
|
||||
public delegate void DetailQuestChangedEventHandler(QuestLog questLog);
|
||||
|
||||
[Export]
|
||||
private Vector2 _closedPos;
|
||||
|
||||
[Export]
|
||||
private Vector2 _openedPos;
|
||||
|
||||
private bool _isClosed = true;
|
||||
private Tween? _closeOpenTween;
|
||||
|
||||
public QuestResource? currentDetailQuest
|
||||
{
|
||||
get => QuestManager.Instance!.GetFollowQuest();
|
||||
set
|
||||
{
|
||||
QuestManager.Instance!.SetFollowQuest(value); // TODO: fix setup
|
||||
EmitSignalDetailQuestChanged(this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
QuestManager.Instance!.QuestsChanged += () => EmitSignalDetailQuestChanged(this);
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent inputEvent)
|
||||
{
|
||||
if (inputEvent.IsActionPressed("ui_inventory_journal_open_close"))
|
||||
{
|
||||
if(_closeOpenTween != null)
|
||||
_closeOpenTween.Kill();
|
||||
|
||||
_isClosed = !_isClosed;
|
||||
|
||||
_closeOpenTween = GetTree().CreateTween();
|
||||
_closeOpenTween
|
||||
.TweenProperty(this, "position", _isClosed ? _closedPos : _openedPos, 0.5)
|
||||
.SetEase(Tween.EaseType.Out)
|
||||
.SetTrans(Tween.TransitionType.Cubic);
|
||||
}
|
||||
}
|
||||
|
||||
//private QuestResource? _currentDetailQuestBacking;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://o1qpo0wdqlw3
|
||||
@@ -0,0 +1,76 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
using QuestPair = KeyValuePair<QuestResource, QuestStatus>;
|
||||
public partial class QuestManager : Node
|
||||
{
|
||||
public static QuestManager? Instance { get; private set; }
|
||||
|
||||
[Signal]
|
||||
public delegate void QuestBecomesActiveEventHandler(QuestResource questResource);
|
||||
|
||||
[Signal]
|
||||
public delegate void QuestsChangedEventHandler();
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
private Godot.Collections.Dictionary<QuestResource, QuestStatus> _questStatus = new();
|
||||
|
||||
private QuestResource? _followQuest;
|
||||
|
||||
|
||||
public void ChangeQuestStatus(QuestResource questResource, QuestStatus.Status newStatus)
|
||||
{
|
||||
if (!_questStatus.TryGetValue(questResource, out var value))
|
||||
{
|
||||
value = new QuestStatus();
|
||||
_questStatus.Add(questResource, value);
|
||||
}
|
||||
|
||||
value.status = newStatus;
|
||||
|
||||
EmitSignalQuestsChanged();
|
||||
|
||||
if (newStatus == QuestStatus.Status.Active)
|
||||
{
|
||||
EmitSignalQuestBecomesActive(questResource);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<QuestPair> GetVisibleQuests()
|
||||
{
|
||||
return _questStatus.Where(qs => qs.Value.status != QuestStatus.Status.Hidden);
|
||||
}
|
||||
|
||||
public IEnumerable<QuestPair> GetActiveQuests()
|
||||
{
|
||||
return _questStatus.Where(qs => qs.Value.status == QuestStatus.Status.Active);
|
||||
}
|
||||
public QuestStatus GetQuestStatus(QuestResource questResource)
|
||||
{
|
||||
if (_questStatus.TryGetValue(questResource, out var status))
|
||||
return status;
|
||||
|
||||
status = new QuestStatus();
|
||||
_questStatus.Add(questResource, status);
|
||||
return status;
|
||||
}
|
||||
|
||||
public QuestResource? GetFollowQuest()
|
||||
{
|
||||
return _followQuest;
|
||||
}
|
||||
|
||||
public void SetFollowQuest(QuestResource? questResource)
|
||||
{
|
||||
_followQuest = questResource;
|
||||
EmitSignalQuestsChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://dl2uhq12p3qks
|
||||
@@ -0,0 +1,86 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Net.Mime;
|
||||
using Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
public partial class QuestMessagePopup : Control
|
||||
{
|
||||
|
||||
private Label Text => GetNode<Label>("Text");
|
||||
|
||||
private QuestResource? _currentlyShown;
|
||||
|
||||
private Tween? _activeTween = null;
|
||||
|
||||
[Export]
|
||||
private Vector2 _showPosition;
|
||||
|
||||
[Export]
|
||||
private Vector2 _hidePosition;
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
QuestManager.Instance!.QuestsChanged += NewActiveQuest;
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
QuestManager.Instance!.QuestsChanged -= NewActiveQuest;
|
||||
}
|
||||
|
||||
private void NewActiveQuest()
|
||||
{
|
||||
var shownQuest = QuestManager.Instance!.GetFollowQuest();
|
||||
if (_currentlyShown == shownQuest)
|
||||
return;
|
||||
|
||||
if (_activeTween != null)
|
||||
{
|
||||
_activeTween.Kill();
|
||||
}
|
||||
|
||||
if (shownQuest == null)
|
||||
{
|
||||
HideAnimate();
|
||||
_currentlyShown = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_currentlyShown == null)
|
||||
{
|
||||
Text.Text = shownQuest.title;
|
||||
ShowAnimate();
|
||||
_currentlyShown = shownQuest;
|
||||
return;
|
||||
}
|
||||
|
||||
// else (_currentlyShown != null)
|
||||
|
||||
_currentlyShown = shownQuest;
|
||||
HideAnimate(() =>
|
||||
{
|
||||
Text.Text = shownQuest.title;
|
||||
ShowAnimate();
|
||||
});
|
||||
}
|
||||
|
||||
private void HideAnimate(Action? then = null)
|
||||
{
|
||||
_activeTween = GetTree().CreateTween();
|
||||
_activeTween.TweenProperty(this, "position", _hidePosition, 0.4)
|
||||
.SetTrans(Tween.TransitionType.Cubic)
|
||||
.SetEase(Tween.EaseType.Out);
|
||||
if (then != null)
|
||||
_activeTween.Finished += then;
|
||||
}
|
||||
|
||||
private void ShowAnimate(Action? then = null)
|
||||
{
|
||||
_activeTween = GetTree().CreateTween();
|
||||
_activeTween.TweenProperty(this, "position", _showPosition, 0.4)
|
||||
.SetTrans(Tween.TransitionType.Cubic)
|
||||
.SetEase(Tween.EaseType.Out);
|
||||
if (then != null)
|
||||
_activeTween.Finished += then;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://7wwid23tc8as
|
||||
@@ -0,0 +1,13 @@
|
||||
using Godot;
|
||||
namespace Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class QuestResource : Resource
|
||||
{
|
||||
[Export]
|
||||
public string id = "";
|
||||
[Export]
|
||||
public string title = "";
|
||||
[Export(PropertyHint.MultilineText)]
|
||||
public string description = "";
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://vji5lp4qc8pp
|
||||
@@ -0,0 +1,16 @@
|
||||
using Godot;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
public partial class QuestStatus : GodotObject
|
||||
{
|
||||
public enum Status
|
||||
{
|
||||
Hidden,
|
||||
Active,
|
||||
Done,
|
||||
Canceled,
|
||||
}
|
||||
|
||||
public Status status = Status.Hidden;
|
||||
}
|
||||