feature/farm_scene_rework #10
@@ -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: 266 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://65e44yde224q"
|
||||
path="res://.godot/imported/Babushka_house_01.png-2abdaa4b7145961a1de62ba9271ec19d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/farm/Babushka_house_01.png"
|
||||
dest_files=["res://.godot/imported/Babushka_house_01.png-2abdaa4b7145961a1de62ba9271ec19d.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.1 MiB |
|
Before Width: | Height: | Size: 852 KiB After Width: | Height: | Size: 299 KiB |
|
After Width: | Height: | Size: 852 KiB |
|
Before Width: | Height: | Size: 258 KiB After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 258 KiB |
|
Before Width: | Height: | Size: 696 KiB After Width: | Height: | Size: 208 KiB |
|
After Width: | Height: | Size: 696 KiB |
|
Before Width: | Height: | Size: 895 KiB After Width: | Height: | Size: 395 KiB |
|
After Width: | Height: | Size: 895 KiB |
|
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 538 KiB |
|
After Width: | Height: | Size: 2.0 MiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://u0dku75l17re"
|
||||
path="res://.godot/imported/UI_bag_export_highlight_01.png-75e9e14d3080a5afb41b921dc593da52.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/UI_bag_export_highlight_01.png"
|
||||
dest_files=["res://.godot/imported/UI_bag_export_highlight_01.png-75e9e14d3080a5afb41b921dc593da52.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.6 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bag1xalfh731d"
|
||||
path="res://.godot/imported/UI_bag_export_highlight_02.png-3c40cc6d764913cde7bcc1bd97f1eb6d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/UI_bag_export_highlight_02.png"
|
||||
dest_files=["res://.godot/imported/UI_bag_export_highlight_02.png-3c40cc6d764913cde7bcc1bd97f1eb6d.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.9 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cxptule8n38ph"
|
||||
path="res://.godot/imported/UI_bag_export_highlight_03.png-d901f8d53fc4b996a469e8098ea5900b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/ui/UI/UI_bag_export_highlight_03.png"
|
||||
dest_files=["res://.godot/imported/UI_bag_export_highlight_03.png-d901f8d53fc4b996a469e8098ea5900b.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 |
@@ -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 = ""
|
||||
metadata/_latest_layer = "14"
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cgjc4wurbgimy"]
|
||||
[gd_scene load_steps=9 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://dcidjcsqk12p1" path="res://art/ui/UI/UI_bag_export_02.png" id="4_df8i8"]
|
||||
[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="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="Texture2D" uid="uid://qwia360i1ir1" path="res://art/ui/UI/inventory_active.png" id="8_df8i8"]
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer"]
|
||||
layer = 90
|
||||
@@ -16,52 +18,36 @@ 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("_slotsParent", "_slotsMover", "_headerSlots", "_slotSelect")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scale = Vector2(0.7, 0.7)
|
||||
size_flags_vertical = 8
|
||||
script = ExtResource("1_6wusm")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
_slotsParent = NodePath("SlotsContainer/SlotsMover/Slots")
|
||||
_slotsMover = NodePath("SlotsContainer/SlotsMover")
|
||||
_headerSlots = [NodePath("SlotsContainer/SlotsMover/Slots/Slot"), NodePath("SlotsContainer/SlotsMover/Slots/Slot2"), NodePath("SlotsContainer/SlotsMover/Slots/Slot3"), NodePath("SlotsContainer/SlotsMover/Slots/Slot4"), NodePath("SlotsContainer/SlotsMover/Slots/Slot5"), NodePath("SlotsContainer/SlotsMover/Slots/Slot6"), NodePath("SlotsContainer/SlotsMover/Slots/Slot7"), NodePath("SlotsContainer/SlotsMover/Slots/Slot8"), NodePath("SlotsContainer/SlotsMover/Slots/Slot9")]
|
||||
_slotSelect = NodePath("SlotsContainer/SlotsMover/SlotSelectContainer/Selector")
|
||||
|
||||
[node name="SlotsContainer" type="Control" parent="Inventory"]
|
||||
custom_minimum_size = Vector2(500, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = 13
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
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 = 1.0
|
||||
offset_right = 101.0
|
||||
offset_bottom = 100.0
|
||||
texture = ExtResource("4_tiss4")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="SlotsMover" type="Control" parent="Inventory/SlotsContainer"]
|
||||
custom_minimum_size = Vector2(900, 610)
|
||||
layout_mode = 1
|
||||
@@ -75,6 +61,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
|
||||
@@ -90,8 +77,9 @@ layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -305.0
|
||||
offset_right = 303.0
|
||||
offset_left = 435.0
|
||||
offset_right = 339.0
|
||||
offset_bottom = 30.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
@@ -103,6 +91,9 @@ layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -356.0
|
||||
offset_right = -452.0
|
||||
offset_bottom = 30.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
@@ -115,11 +106,53 @@ layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -142.429
|
||||
offset_top = 1.85717
|
||||
offset_right = -808.428
|
||||
offset_bottom = -774.143
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scale = Vector2(1.7, 1.7)
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("4_df8i8")
|
||||
expand_mode = 3
|
||||
texture = ExtResource("5_df8i8")
|
||||
expand_mode = 1
|
||||
stretch_mode = 3
|
||||
flip_h = true
|
||||
|
||||
[node name="TextureRect4" type="TextureRect" parent="Inventory/SlotsContainer/SlotsMover/BackgroundContainer"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 303.286
|
||||
offset_top = 209.0
|
||||
offset_right = -362.714
|
||||
offset_bottom = -567.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scale = Vector2(1.7, 1.7)
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("6_u7kje")
|
||||
expand_mode = 1
|
||||
stretch_mode = 3
|
||||
flip_h = true
|
||||
|
||||
[node name="TextureRect5" type="TextureRect" parent="Inventory/SlotsContainer/SlotsMover/BackgroundContainer"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 474.714
|
||||
offset_top = 754.714
|
||||
offset_right = -191.286
|
||||
offset_bottom = -21.2858
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scale = Vector2(1.7, 1.7)
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("7_l3npx")
|
||||
expand_mode = 1
|
||||
stretch_mode = 3
|
||||
flip_h = true
|
||||
|
||||
[node name="Slots" type="Control" parent="Inventory/SlotsContainer/SlotsMover"]
|
||||
@@ -128,53 +161,75 @@ layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = 496.0
|
||||
offset_bottom = 496.0
|
||||
offset_left = -48.5714
|
||||
offset_top = 501.0
|
||||
offset_right = -48.5714
|
||||
offset_bottom = 501.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Slot" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")]
|
||||
layout_mode = 1
|
||||
offset_left = 2.85714
|
||||
offset_top = -54.2857
|
||||
offset_right = 102.857
|
||||
offset_bottom = 45.7143
|
||||
|
||||
[node name="Slot2" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")]
|
||||
layout_mode = 1
|
||||
offset_left = 100.0
|
||||
offset_right = 200.0
|
||||
offset_left = 102.857
|
||||
offset_top = -54.2857
|
||||
offset_right = 202.857
|
||||
offset_bottom = 45.7143
|
||||
|
||||
[node name="Slot3" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")]
|
||||
layout_mode = 1
|
||||
offset_left = 201.0
|
||||
offset_right = 301.0
|
||||
offset_left = 203.857
|
||||
offset_top = -54.2857
|
||||
offset_right = 303.857
|
||||
offset_bottom = 45.7143
|
||||
|
||||
[node name="Slot4" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")]
|
||||
layout_mode = 1
|
||||
offset_left = 301.0
|
||||
offset_right = 401.0
|
||||
offset_left = 303.857
|
||||
offset_top = -54.2857
|
||||
offset_right = 403.857
|
||||
offset_bottom = 45.7143
|
||||
|
||||
[node name="Slot5" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")]
|
||||
layout_mode = 1
|
||||
offset_left = 401.0
|
||||
offset_right = 501.0
|
||||
offset_left = 403.857
|
||||
offset_top = -54.2857
|
||||
offset_right = 503.857
|
||||
offset_bottom = 45.7143
|
||||
|
||||
[node name="Slot6" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")]
|
||||
layout_mode = 1
|
||||
offset_left = 501.0
|
||||
offset_right = 601.0
|
||||
offset_left = 503.857
|
||||
offset_top = -54.2857
|
||||
offset_right = 603.857
|
||||
offset_bottom = 45.7143
|
||||
|
||||
[node name="Slot7" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")]
|
||||
layout_mode = 1
|
||||
offset_left = 601.0
|
||||
offset_right = 701.0
|
||||
offset_left = 603.857
|
||||
offset_top = -54.2857
|
||||
offset_right = 703.857
|
||||
offset_bottom = 45.7143
|
||||
|
||||
[node name="Slot8" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")]
|
||||
layout_mode = 1
|
||||
offset_left = 702.0
|
||||
offset_right = 802.0
|
||||
offset_left = 704.857
|
||||
offset_top = -54.2857
|
||||
offset_right = 804.857
|
||||
offset_bottom = 45.7143
|
||||
|
||||
[node name="Slot9" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")]
|
||||
layout_mode = 1
|
||||
offset_left = 802.0
|
||||
offset_right = 902.0
|
||||
offset_left = 804.857
|
||||
offset_top = -54.2857
|
||||
offset_right = 904.857
|
||||
offset_bottom = 45.7143
|
||||
|
||||
[node name="Slot10" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")]
|
||||
layout_mode = 1
|
||||
@@ -371,3 +426,27 @@ 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -13,14 +13,20 @@ config_version=5
|
||||
config/name="Babushka"
|
||||
run/main_scene="uid://bopv10dqm1knc"
|
||||
config/features=PackedStringArray("4.4", "C#", "Forward Plus")
|
||||
run/max_fps=120
|
||||
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"
|
||||
Signal_Debugger="*res://addons/SignalVisualizer/Debugger/SignalDebugger.gd"
|
||||
|
||||
[dialogic]
|
||||
|
||||
@@ -93,7 +99,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]
|
||||
|
||||
@@ -182,6 +188,11 @@ item={
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":71,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_inventory_close={
|
||||
"deadzone": 0.2,
|
||||
"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":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[internationalization]
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=69 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"]
|
||||
[ext_resource type="Texture2D" uid="uid://c7f3t65jskd6v" path="res://art/mockups/house_prototype.png" id="2_lhtpe"]
|
||||
[ext_resource type="PackedScene" uid="uid://bm21nqepnwaik" path="res://scenes/IndoorTest2.tscn" id="2_taxvr"]
|
||||
[ext_resource type="Texture2D" uid="uid://be1nofeo7an0" path="res://art/mockups/Kenney_Backgrounds/PNG/cloud2.png" id="3_r34wi"]
|
||||
[ext_resource type="Texture2D" uid="uid://o6vnf7n7qp8o" path="res://art/mockups/Kenney_Backgrounds/PNG/cloud6.png" id="4_xh22q"]
|
||||
[ext_resource type="Texture2D" uid="uid://cc0o84q5u437k" path="res://art/mockups/Kenney_Backgrounds/PNG/cloud7.png" id="5_k3wpj"]
|
||||
@@ -37,12 +37,19 @@
|
||||
[ext_resource type="Resource" uid="uid://datee0flk1e84" path="res://resources/items/scythe.tres" id="29_wtdui"]
|
||||
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="32_2nee2"]
|
||||
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="34_e5b7x"]
|
||||
[ext_resource type="PackedScene" uid="uid://bm21nqepnwaik" path="res://scenes/IndoorTest2.tscn" id="35_taxvr"]
|
||||
[ext_resource type="Texture2D" uid="uid://65e44yde224q" path="res://art/farm/Babushka_house_01.png" id="36_e5b7x"]
|
||||
[ext_resource type="AudioStream" uid="uid://cfqg50am0swb7" path="res://audio/Music/Farming_90BPM_69Bars_Loop.wav" id="37_8ey8m"]
|
||||
[ext_resource type="AudioStream" uid="uid://dku1rq5cocisg" path="res://audio/Music/Farming_90BPM_69Bars.wav" id="37_di1ed"]
|
||||
[ext_resource type="Shader" uid="uid://braevmqauoek7" path="res://shader/swaying_plant.gdshader" id="37_taxvr"]
|
||||
[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")
|
||||
@@ -77,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
|
||||
@@ -113,14 +124,14 @@ shader_parameter/hue_shift = 0.0
|
||||
shader_parameter/saturation_mult = 1.0
|
||||
shader_parameter/value_mult = 1.0
|
||||
shader_parameter/brightness_add = 0.0
|
||||
shader_parameter/contrast_mult = 1.183
|
||||
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
|
||||
@@ -131,12 +142,18 @@ resource_local_to_scene = true
|
||||
radius = 300.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_lhtpe"]
|
||||
shader = ExtResource("13_7p0hq")
|
||||
shader_parameter/hue_shift = 0.0
|
||||
shader_parameter/saturation_mult = 1.0
|
||||
shader_parameter/value_mult = 1.068
|
||||
shader_parameter/brightness_add = 0.0
|
||||
shader_parameter/contrast_mult = 0.913
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_bcdgk"]
|
||||
shader = ExtResource("37_taxvr")
|
||||
shader_parameter/speed = 1.0
|
||||
shader_parameter/minStrength = 0.05
|
||||
shader_parameter/maxStrength = 0.154
|
||||
shader_parameter/strengthScale = 100.0
|
||||
shader_parameter/interval = 3.5
|
||||
shader_parameter/detail = 2.095
|
||||
shader_parameter/distortion = 1.0
|
||||
shader_parameter/heightOffset = 0.0
|
||||
shader_parameter/offset = 1.0
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2nee2"]
|
||||
size = Vector2(5905, 1176)
|
||||
@@ -147,18 +164,28 @@ 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")
|
||||
_sceneToLoad = ExtResource("35_taxvr")
|
||||
_sceneToLoad = ExtResource("2_taxvr")
|
||||
|
||||
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
|
||||
|
||||
@@ -226,7 +253,7 @@ offset = Vector2(0, -100)
|
||||
[node name="background layer 3" type="ParallaxLayer" parent="ParallaxBackground"]
|
||||
position = Vector2(18, -713)
|
||||
motion_scale = Vector2(0.25, 0.25)
|
||||
motion_mirroring = Vector2(7200, 0)
|
||||
motion_mirroring = Vector2(5424, 0)
|
||||
|
||||
[node name="Kenney assets" type="Node2D" parent="ParallaxBackground/background layer 3"]
|
||||
position = Vector2(0, -39)
|
||||
@@ -323,13 +350,13 @@ texture = ExtResource("12_6b2nr")
|
||||
[node name="JelenaMockupBg01" type="Sprite2D" parent="ParallaxBackground/background layer 3"]
|
||||
visible = false
|
||||
position = Vector2(3552, 1296)
|
||||
scale = Vector2(1.7404, 1.77563)
|
||||
scale = Vector2(3, 3.062)
|
||||
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
|
||||
@@ -447,13 +474,13 @@ texture = ExtResource("14_d53cn")
|
||||
[node name="JelenaMockupBg02" type="Sprite2D" parent="ParallaxBackground/background layer 4"]
|
||||
material = SubResource("ShaderMaterial_wtdui")
|
||||
position = Vector2(2668, 726)
|
||||
scale = Vector2(1.3, 1.3)
|
||||
scale = Vector2(2.75, 2.75)
|
||||
texture = ExtResource("13_0qu0h")
|
||||
|
||||
[node name="JelenaMockupBg03" type="Sprite2D" parent="ParallaxBackground/background layer 4"]
|
||||
material = SubResource("ShaderMaterial_wtdui")
|
||||
position = Vector2(7965, 728)
|
||||
scale = Vector2(1.3, 1.3)
|
||||
position = Vector2(7923, 727)
|
||||
scale = Vector2(2.75, 2.75)
|
||||
texture = ExtResource("13_0qu0h")
|
||||
|
||||
[node name="back back trees layer" type="ParallaxLayer" parent="ParallaxBackground"]
|
||||
@@ -579,7 +606,7 @@ position = Vector2(1791.5, 1448)
|
||||
texture = ExtResource("14_mrwmr")
|
||||
flip_h = true
|
||||
region_enabled = true
|
||||
region_rect = Rect2(149, 15, 464, 478)
|
||||
region_rect = Rect2(130, 0, 201, 278)
|
||||
|
||||
[node name="bush3" type="Sprite2D" parent="ParallaxBackground/back back trees layer"]
|
||||
material = SubResource("ShaderMaterial_8ey8m")
|
||||
@@ -587,7 +614,7 @@ position = Vector2(1255.5, 1392)
|
||||
texture = ExtResource("14_mrwmr")
|
||||
flip_h = true
|
||||
region_enabled = true
|
||||
region_rect = Rect2(-6, 996, 467, 429)
|
||||
region_rect = Rect2(0, 604, 248, 228)
|
||||
|
||||
[node name="bush4" type="Sprite2D" parent="ParallaxBackground/back back trees layer"]
|
||||
material = SubResource("ShaderMaterial_8ey8m")
|
||||
@@ -595,14 +622,14 @@ position = Vector2(5471.5, 1432)
|
||||
texture = ExtResource("14_mrwmr")
|
||||
flip_h = true
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2319, 1079, 353, 327)
|
||||
region_rect = Rect2(1837, 651, 139, 180)
|
||||
|
||||
[node name="bush5" type="Sprite2D" parent="ParallaxBackground/back back trees layer"]
|
||||
material = SubResource("ShaderMaterial_8ey8m")
|
||||
position = Vector2(5007.5, 1312)
|
||||
texture = ExtResource("14_mrwmr")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2489, 707, 269, 224)
|
||||
region_rect = Rect2(1368, 673, 186, 136)
|
||||
|
||||
[node name="bush6" type="Sprite2D" parent="ParallaxBackground/back back trees layer"]
|
||||
material = SubResource("ShaderMaterial_8ey8m")
|
||||
@@ -611,7 +638,7 @@ scale = Vector2(0.575, 0.575)
|
||||
texture = ExtResource("14_mrwmr")
|
||||
flip_h = true
|
||||
region_enabled = true
|
||||
region_rect = Rect2(605, 877, 597, 537)
|
||||
region_rect = Rect2(358, 523, 345, 289)
|
||||
|
||||
[node name="back tree bois layer 5" type="ParallaxLayer" parent="ParallaxBackground"]
|
||||
visible = false
|
||||
@@ -832,19 +859,21 @@ material = SubResource("ShaderMaterial_2vojv")
|
||||
position = Vector2(7237, 3307)
|
||||
texture = ExtResource("21_ualyd")
|
||||
offset = Vector2(0, -800)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(0, 0, 1504, 1686)
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="YSorted/Brünnen"]
|
||||
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")]
|
||||
@@ -863,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")
|
||||
|
||||
@@ -902,24 +934,60 @@ position = Vector2(-60, 122)
|
||||
position = Vector2(-8213, 84)
|
||||
|
||||
[node name="House Mockup" type="Sprite2D" parent="YSorted/Farm visuals/Static"]
|
||||
y_sort_enabled = true
|
||||
material = SubResource("ShaderMaterial_lhtpe")
|
||||
position = Vector2(5280, 1600)
|
||||
scale = Vector2(5, 5)
|
||||
texture = ExtResource("2_lhtpe")
|
||||
position = Vector2(5986, 1718.25)
|
||||
scale = Vector2(4.5, 3.725)
|
||||
texture = ExtResource("36_e5b7x")
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="YSorted/Farm visuals/Static/House Mockup"]
|
||||
collision_layer = 2
|
||||
collision_mask = 6
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="YSorted/Farm visuals/Static/House Mockup/StaticBody2D"]
|
||||
position = Vector2(-257.6, 236.8)
|
||||
polygon = PackedVector2Array(232, -4.80005, 0, 0, 0, -96, -262.4, -97.6, -265.6, -260.8, -310.4, -260.8, -235.2, -321.6, -124.8, -323.2, -57.6, -424, 84.8, -436.8, 118.4, -452.8, 136, -436.8, 726.4, -452.8, 817.6, -299.2, 785.6, -291.2, 785.6, -108.8, 241.6, -94.4)
|
||||
disabled = true
|
||||
position = Vector2(-252.56, 231.32)
|
||||
polygon = PackedVector2Array(247.227, 43.5123, 44.7822, 43.5123, -87.2178, 45.123, -104.329, -55.2797, -154.107, -73.5347, -160.107, -380.38, -175.44, -400.783, -63.44, -512.461, 97.8934, -541.991, 261.671, -599.172, 374.782, -526.421, 502.338, -526.421, 637.893, -396.488, 598.56, -360.783, 596.338, -58.2327, 528.782, -58.2327, 501.449, 45.9283)
|
||||
|
||||
[node name="EnterHouseInteraction" parent="YSorted/Farm visuals/Static" instance=ExtResource("27_klb81")]
|
||||
position = Vector2(7178, 1965)
|
||||
position = Vector2(5839, 2349)
|
||||
scale = Vector2(2.425, 2.425)
|
||||
|
||||
[node name="bush" type="Sprite2D" parent="YSorted/Farm visuals/Static"]
|
||||
material = SubResource("ShaderMaterial_bcdgk")
|
||||
position = Vector2(4313, 2633)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("14_mrwmr")
|
||||
offset = Vector2(0, -237)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(130, 0, 201, 278)
|
||||
|
||||
[node name="bush2" type="Sprite2D" parent="YSorted/Farm visuals/Static"]
|
||||
material = SubResource("ShaderMaterial_bcdgk")
|
||||
position = Vector2(4590, 2971)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("14_mrwmr")
|
||||
offset = Vector2(0, -196)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1699, 76, 280, 230)
|
||||
|
||||
[node name="bush4" type="Sprite2D" parent="YSorted/Farm visuals/Static"]
|
||||
material = SubResource("ShaderMaterial_bcdgk")
|
||||
position = Vector2(7300, 2912)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("14_mrwmr")
|
||||
offset = Vector2(0, -172)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(0, 604, 248, 228)
|
||||
|
||||
[node name="bush3" type="Sprite2D" parent="YSorted/Farm visuals/Static"]
|
||||
material = SubResource("ShaderMaterial_bcdgk")
|
||||
position = Vector2(7053, 2891)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("14_mrwmr")
|
||||
offset = Vector2(0, -50)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1464, 419, 144, 115)
|
||||
|
||||
[node name="FieldParent" type="Node2D" parent="YSorted/Farm visuals"]
|
||||
position = Vector2(53, 20)
|
||||
scale = Vector2(1, 0.993819)
|
||||
@@ -944,50 +1012,81 @@ follow_viewport_enabled = false
|
||||
|
||||
[node name="Inventory" parent="CanvasLayer" index="1"]
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
offset_left = -172.8
|
||||
offset_top = -194.4
|
||||
offset_right = 172.8
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -116.0
|
||||
offset_top = -53.0
|
||||
offset_right = 231.82
|
||||
offset_bottom = 141.4
|
||||
grow_vertical = 0
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
_inventoryOpenedOffset = -600.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"]
|
||||
|
||||
[node name="Farming SFX" type="AudioStreamPlayer2D" parent="Audio/SFX"]
|
||||
stream = SubResource("AudioStreamRandomizer_ceriq")
|
||||
max_distance = 2e+07
|
||||
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")
|
||||
|
||||
[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"]
|
||||
|
||||
@@ -19,13 +19,24 @@ grow_vertical = 2
|
||||
texture = ExtResource("1_qerdf")
|
||||
expand_mode = 2
|
||||
stretch_mode = 6
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="Start" type="Button" parent="CanvasLayer/TextureRect"]
|
||||
offset_left = 571.0
|
||||
offset_top = 559.0
|
||||
offset_right = 617.0
|
||||
offset_bottom = 590.0
|
||||
custom_minimum_size = Vector2(100, 30)
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -76.0
|
||||
offset_top = -98.0
|
||||
offset_right = 24.0
|
||||
offset_bottom = -67.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
scale = Vector2(2, 2)
|
||||
text = "Start"
|
||||
icon_alignment = 1
|
||||
|
||||
[connection signal="pressed" from="CanvasLayer/TextureRect/Start" to="." method="LoadScene"]
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_a2ood"]
|
||||
resource_local_to_scene = true
|
||||
size = Vector2(7680, 1336)
|
||||
size = Vector2(3836, 1086)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_j5d18"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Room assets/hand:scale")
|
||||
tracks/0/path = NodePath("BackWall/Room assets/hand:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
@@ -51,7 +51,7 @@ tracks/1/keys = {
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = false
|
||||
tracks/2/path = NodePath("Room assets/eyes:visible")
|
||||
tracks/2/path = NodePath("BackWall/Room assets/eyes:visible")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
@@ -67,7 +67,7 @@ length = 4.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Room assets/hand:scale")
|
||||
tracks/0/path = NodePath("BackWall/Room assets/hand:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
@@ -91,7 +91,7 @@ tracks/1/keys = {
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Room assets/eyes:visible")
|
||||
tracks/2/path = NodePath("BackWall/Room assets/eyes:visible")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
@@ -115,16 +115,78 @@ radius = 300.0
|
||||
y_sort_enabled = true
|
||||
script = ExtResource("1_aivb2")
|
||||
|
||||
[node name="Foreground" type="Node" parent="."]
|
||||
|
||||
[node name="Table" type="Sprite2D" parent="Foreground"]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-1888, 1112)
|
||||
texture = ExtResource("3_je1cl")
|
||||
offset = Vector2(0, -200)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1012, 1743, 1470, 417)
|
||||
|
||||
[node name="Chair" type="Sprite2D" parent="Foreground"]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-3032, 2096)
|
||||
texture = ExtResource("4_hjjhl")
|
||||
offset = Vector2(216, -1064)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1534, 1976, 379, 184)
|
||||
|
||||
[node name="Chair2" type="Sprite2D" parent="Foreground"]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-1064, 2064)
|
||||
texture = ExtResource("4_hjjhl")
|
||||
offset = Vector2(184, -1056)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1534, 1976, 379, 184)
|
||||
|
||||
[node name="Samowar" type="Sprite2D" parent="Foreground"]
|
||||
z_index = 1
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-1904, 1192)
|
||||
texture = ExtResource("13_j5d18")
|
||||
offset = Vector2(0, -800)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2093, 49, 421, 630)
|
||||
|
||||
[node name="FrontCollider" type="StaticBody2D" parent="Foreground"]
|
||||
position = Vector2(-4344, 3056)
|
||||
scale = Vector2(2, 2)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Foreground/FrontCollider"]
|
||||
position = Vector2(950, -419)
|
||||
shape = SubResource("RectangleShape2D_a2ood")
|
||||
|
||||
[node name="SideColliderLeft" type="StaticBody2D" parent="."]
|
||||
position = Vector2(-4344, 3056)
|
||||
scale = Vector2(2, 2)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="SideColliderLeft"]
|
||||
position = Vector2(-2892, -1168)
|
||||
shape = SubResource("RectangleShape2D_a2ood")
|
||||
|
||||
[node name="SideColliderRight" type="StaticBody2D" parent="."]
|
||||
position = Vector2(10992, 2856)
|
||||
scale = Vector2(2, 2)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="SideColliderRight"]
|
||||
position = Vector2(-2892, -1168)
|
||||
shape = SubResource("RectangleShape2D_a2ood")
|
||||
|
||||
[node name="BackWall" type="Node" parent="."]
|
||||
|
||||
[node name="Room01Walls2" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -100
|
||||
position = Vector2(-1072, -264)
|
||||
position = Vector2(4992, -487)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("3_a2ood")
|
||||
offset = Vector2(-2768, 264)
|
||||
|
||||
[node name="wall 1" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -100
|
||||
position = Vector2(-4368, 40)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("3_a2ood")
|
||||
flip_h = true
|
||||
region_rect = Rect2(111, 292, 3323, 2160)
|
||||
@@ -132,129 +194,124 @@ region_rect = Rect2(111, 292, 3323, 2160)
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="BackWall/wall 1"]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="BackWall/wall 1/StaticBody2D"]
|
||||
position = Vector2(-1912, -396)
|
||||
position = Vector2(950, -419)
|
||||
shape = SubResource("RectangleShape2D_a2ood")
|
||||
|
||||
[node name="Room01DorrR" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -50
|
||||
position = Vector2(-744, 16)
|
||||
position = Vector2(936, -216)
|
||||
texture = ExtResource("5_8o6or")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(3161, 313, 679, 1050)
|
||||
|
||||
[node name="Room01DioorL" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -50
|
||||
position = Vector2(-3288, 8)
|
||||
position = Vector2(-3296, 48)
|
||||
texture = ExtResource("8_wuntg")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(0, 0, 3840, 2160)
|
||||
|
||||
[node name="Room01Pechka" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -80
|
||||
position = Vector2(-752, 0)
|
||||
position = Vector2(-224, -392)
|
||||
texture = ExtResource("9_aivb2")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2236, 0, 724, 1392)
|
||||
|
||||
[node name="Room01Window2" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -50
|
||||
position = Vector2(-2952, 16)
|
||||
position = Vector2(-3192, -344)
|
||||
texture = ExtResource("6_j5d18")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1020, 338, 607, 757)
|
||||
|
||||
[node name="Room01Window3" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -50
|
||||
position = Vector2(-944, -8)
|
||||
position = Vector2(-1792, -336)
|
||||
texture = ExtResource("6_j5d18")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1020, 338, 607, 757)
|
||||
|
||||
[node name="Room01PechkaDoor" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -50
|
||||
position = Vector2(-710, 0)
|
||||
position = Vector2(-248, -96)
|
||||
texture = ExtResource("10_835kg")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2360, 864, 356, 251)
|
||||
|
||||
[node name="Room01Chugun" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -40
|
||||
position = Vector2(-736, 8)
|
||||
position = Vector2(16, -560)
|
||||
texture = ExtResource("11_atjbs")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2469, 459, 247, 131)
|
||||
|
||||
[node name="Room01Shelf" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -50
|
||||
position = Vector2(-832, 56)
|
||||
position = Vector2(-880, -416)
|
||||
texture = ExtResource("8_8o6or")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1846, 471, 348, 490)
|
||||
|
||||
[node name="Player2d" parent="." instance=ExtResource("2_a2ood")]
|
||||
position = Vector2(-1464, 136)
|
||||
|
||||
[node name="CharacterBody2D" parent="Player2d" index="0"]
|
||||
_speed = 500.0
|
||||
|
||||
[node name="Animated Sprites" parent="Player2d/CharacterBody2D/visuals" index="0"]
|
||||
z_index = 50
|
||||
|
||||
[node name="Room01Table" type="Sprite2D" parent="."]
|
||||
[node name="Bench" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -10
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-2056, 888)
|
||||
texture = ExtResource("3_je1cl")
|
||||
offset = Vector2(192, -848)
|
||||
|
||||
[node name="Room01Chair" type="Sprite2D" parent="."]
|
||||
position = Vector2(-2792, 1096)
|
||||
texture = ExtResource("4_hjjhl")
|
||||
offset = Vector2(216, -1064)
|
||||
|
||||
[node name="Room01Chair2" type="Sprite2D" parent="."]
|
||||
position = Vector2(-1304, 1080)
|
||||
texture = ExtResource("4_hjjhl")
|
||||
offset = Vector2(184, -1056)
|
||||
|
||||
[node name="Room01Bench" type="Sprite2D" parent="."]
|
||||
position = Vector2(-3280, 24)
|
||||
position = Vector2(-3240, 224)
|
||||
texture = ExtResource("7_ciwvv")
|
||||
flip_h = true
|
||||
|
||||
[node name="Room01Bench2" type="Sprite2D" parent="."]
|
||||
position = Vector2(-784, 40)
|
||||
texture = ExtResource("7_ciwvv")
|
||||
|
||||
[node name="Room assets" type="Node" parent="."]
|
||||
|
||||
[node name="Samowar" type="Sprite2D" parent="Room assets"]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-2000, 696)
|
||||
texture = ExtResource("13_j5d18")
|
||||
offset = Vector2(0, -296)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2085, 40, 446, 654)
|
||||
region_rect = Rect2(1156, 1185, 940, 189)
|
||||
|
||||
[node name="wood" type="Sprite2D" parent="Room assets"]
|
||||
[node name="Bench2" type="Sprite2D" parent="BackWall"]
|
||||
z_index = -10
|
||||
position = Vector2(-1824, 224)
|
||||
texture = ExtResource("7_ciwvv")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1156, 1185, 940, 189)
|
||||
|
||||
[node name="Room assets" type="Node" parent="BackWall"]
|
||||
|
||||
[node name="wood" type="Sprite2D" parent="BackWall/Room assets"]
|
||||
z_index = -10
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-176, 560)
|
||||
position = Vector2(-177, 554.5)
|
||||
texture = ExtResource("13_j5d18")
|
||||
offset = Vector2(0, -296)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2244, 763, 274, 91)
|
||||
|
||||
[node name="Domovoi" type="Sprite2D" parent="Room assets"]
|
||||
[node name="Domovoi" type="Sprite2D" parent="BackWall/Room assets"]
|
||||
z_index = -10
|
||||
y_sort_enabled = true
|
||||
position = Vector2(336, 480)
|
||||
position = Vector2(335, 474.5)
|
||||
texture = ExtResource("13_j5d18")
|
||||
offset = Vector2(0, -296)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(3157, 688, 131, 221)
|
||||
region_rect = Rect2(3157, 688, 118.519, 221)
|
||||
|
||||
[node name="vase" type="Sprite2D" parent="Room assets"]
|
||||
[node name="vase" type="Sprite2D" parent="BackWall/Room assets"]
|
||||
z_index = -10
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-712, 72)
|
||||
position = Vector2(-857, -37.5)
|
||||
texture = ExtResource("13_j5d18")
|
||||
offset = Vector2(0, -296)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2748, 432, 174, 191)
|
||||
|
||||
[node name="candle" type="Sprite2D" parent="Room assets"]
|
||||
[node name="candle" type="Sprite2D" parent="BackWall/Room assets"]
|
||||
z_index = -10
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-272, -56)
|
||||
position = Vector2(-425, -77.5)
|
||||
rotation = -0.0663225
|
||||
texture = ExtResource("13_j5d18")
|
||||
offset = Vector2(0, -296)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2624, 435, 49, 76)
|
||||
|
||||
[node name="hand" type="Sprite2D" parent="Room assets"]
|
||||
[node name="hand" type="Sprite2D" parent="BackWall/Room assets"]
|
||||
z_index = -10
|
||||
y_sort_enabled = true
|
||||
position = Vector2(48.5969, 11.68)
|
||||
position = Vector2(47.5969, 6.18)
|
||||
rotation = -0.0663225
|
||||
scale = Vector2(1e-05, 1e-05)
|
||||
texture = ExtResource("13_j5d18")
|
||||
@@ -262,23 +319,24 @@ offset = Vector2(43.3898, 128.128)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(3362, 139, 101, 269)
|
||||
|
||||
[node name="SpiritAnimation" type="AnimationPlayer" parent="Room assets/hand"]
|
||||
[node name="SpiritAnimation" type="AnimationPlayer" parent="BackWall/Room assets/hand"]
|
||||
active = false
|
||||
root_node = NodePath("../../..")
|
||||
root_node = NodePath("../../../..")
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_ciwvv")
|
||||
}
|
||||
playback_auto_capture = false
|
||||
|
||||
[node name="herbsline" type="Sprite2D" parent="Room assets"]
|
||||
[node name="herbsline" type="Sprite2D" parent="BackWall/Room assets"]
|
||||
z_index = -10
|
||||
y_sort_enabled = true
|
||||
position = Vector2(440, -168)
|
||||
position = Vector2(287, -157.5)
|
||||
texture = ExtResource("13_j5d18")
|
||||
offset = Vector2(0, -296)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2964, 137, 321, 213)
|
||||
|
||||
[node name="herb 1" type="Sprite2D" parent="Room assets/herbsline"]
|
||||
[node name="herb 1" type="Sprite2D" parent="BackWall/Room assets/herbsline"]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-72, 136)
|
||||
texture = ExtResource("13_j5d18")
|
||||
@@ -286,7 +344,7 @@ offset = Vector2(0, -296)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2600, 165, 127, 199)
|
||||
|
||||
[node name="herb 2" type="Sprite2D" parent="Room assets/herbsline"]
|
||||
[node name="herb 2" type="Sprite2D" parent="BackWall/Room assets/herbsline"]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(64, 80)
|
||||
texture = ExtResource("13_j5d18")
|
||||
@@ -294,31 +352,31 @@ offset = Vector2(0, -296)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2761, 161, 135, 199)
|
||||
|
||||
[node name="eyes" type="Sprite2D" parent="Room assets"]
|
||||
[node name="eyes" type="Sprite2D" parent="BackWall/Room assets"]
|
||||
visible = false
|
||||
z_index = -10
|
||||
position = Vector2(32, -72)
|
||||
scale = Vector2(0.4, 0.4)
|
||||
texture = ExtResource("14_j5d18")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2647, 15, 286, 183)
|
||||
|
||||
[node name="offerings" type="Node2D" parent="Room assets"]
|
||||
visible = false
|
||||
[node name="offerings" type="Node2D" parent="BackWall/Room assets"]
|
||||
|
||||
[node name="apple" type="Sprite2D" parent="Room assets/offerings"]
|
||||
[node name="apple" type="Sprite2D" parent="BackWall/Room assets/offerings"]
|
||||
position = Vector2(229.5, 331.5)
|
||||
texture = ExtResource("13_j5d18")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2822, 764, 93, 87)
|
||||
|
||||
[node name="bread" type="Sprite2D" parent="Room assets/offerings"]
|
||||
[node name="bread" type="Sprite2D" parent="BackWall/Room assets/offerings"]
|
||||
z_index = -1
|
||||
position = Vector2(157.5, 339.5)
|
||||
texture = ExtResource("13_j5d18")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2951, 783, 155, 78)
|
||||
|
||||
[node name="plate" type="Sprite2D" parent="Room assets/offerings"]
|
||||
[node name="plate" type="Sprite2D" parent="BackWall/Room assets/offerings"]
|
||||
z_index = -20
|
||||
position = Vector2(189.5, 659.5)
|
||||
texture = ExtResource("13_j5d18")
|
||||
@@ -326,21 +384,28 @@ offset = Vector2(0, -296)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(2576, 802, 219, 64)
|
||||
|
||||
[node name="Vesna" parent="." instance=ExtResource("2_a2ood")]
|
||||
position = Vector2(-1464, 136)
|
||||
|
||||
[node name="Yeli" parent="." instance=ExtResource("15_ciwvv")]
|
||||
position = Vector2(-2912, 432)
|
||||
|
||||
[node name="CollisionShape3D" parent="Yeli/InteractionArea/Area2D" index="0"]
|
||||
position = Vector2(-205.348, 131.907)
|
||||
shape = SubResource("CircleShape2D_wuntg")
|
||||
|
||||
[node name="TalkingControl" parent="Yeli" index="1"]
|
||||
_timelinesToPlay = PackedStringArray("yeli_intro_05")
|
||||
|
||||
[node name="AnimatedSprite" parent="Yeli/TalkingControl" index="0"]
|
||||
position = Vector2(-576, 368)
|
||||
|
||||
[node name="dialogic_toggle" type="Node2D" parent="Yeli"]
|
||||
script = ExtResource("17_835kg")
|
||||
metadata/_custom_type_script = "uid://cvkw4qd2hxksi"
|
||||
|
||||
[connection signal="timelineEnded" from="Yeli/dialogic_toggle" to="." method="Quit"]
|
||||
|
||||
[editable path="Player2d"]
|
||||
[editable path="Vesna"]
|
||||
[editable path="Yeli"]
|
||||
[editable path="Yeli/InteractionArea"]
|
||||
|
||||
@@ -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;
|
||||
@@ -44,7 +45,33 @@ public partial class Player2D : CharacterBody2D
|
||||
if (!_canHandleInput)
|
||||
return;
|
||||
|
||||
if (Input.IsActionPressed("move_right"))
|
||||
bool right = Input.IsActionPressed("move_right");
|
||||
bool left = Input.IsActionPressed("move_left");
|
||||
bool up = Input.IsActionPressed("move_up");
|
||||
bool down = Input.IsActionPressed("move_down");
|
||||
bool walkingAnimationPicked = false;
|
||||
|
||||
if (up)
|
||||
{
|
||||
Velocity = new Vector2(0, -_speed);
|
||||
MoveAndSlide();
|
||||
_sprite.Animation = "back walking" + _toolString;
|
||||
anyActionPressed = true;
|
||||
_lastDirection = Vector2.Up;
|
||||
walkingAnimationPicked = true;
|
||||
}
|
||||
|
||||
if (down && !walkingAnimationPicked)
|
||||
{
|
||||
Velocity = new Vector2(0, _speed);
|
||||
MoveAndSlide();
|
||||
_sprite.Animation = "front walking" + _toolString;
|
||||
anyActionPressed = true;
|
||||
_lastDirection = Vector2.Down;
|
||||
walkingAnimationPicked = true;
|
||||
}
|
||||
|
||||
if (right && !walkingAnimationPicked)
|
||||
{
|
||||
Velocity = new Vector2(_speed, 0);
|
||||
MoveAndSlide();
|
||||
@@ -52,9 +79,10 @@ public partial class Player2D : CharacterBody2D
|
||||
_sprite.Animation = "side walking" + _toolString;
|
||||
anyActionPressed = true;
|
||||
_lastDirection = Vector2.Right;
|
||||
walkingAnimationPicked = true;
|
||||
}
|
||||
|
||||
if (Input.IsActionPressed("move_left"))
|
||||
if (left && !walkingAnimationPicked)
|
||||
{
|
||||
Velocity = new Vector2(-_speed, 0);
|
||||
MoveAndSlide();
|
||||
@@ -62,24 +90,7 @@ public partial class Player2D : CharacterBody2D
|
||||
_sprite.Animation = "side walking" + _toolString;
|
||||
anyActionPressed = true;
|
||||
_lastDirection = Vector2.Left;
|
||||
}
|
||||
|
||||
if (Input.IsActionPressed("move_up"))
|
||||
{
|
||||
Velocity = new Vector2(0, -_speed);
|
||||
MoveAndSlide();
|
||||
_sprite.Animation = "back walking" + _toolString;
|
||||
anyActionPressed = true;
|
||||
_lastDirection = Vector2.Up;
|
||||
}
|
||||
|
||||
if (Input.IsActionPressed("move_down"))
|
||||
{
|
||||
Velocity = new Vector2(0, _speed);
|
||||
MoveAndSlide();
|
||||
_sprite.Animation = "front walking" + _toolString;
|
||||
anyActionPressed = true;
|
||||
_lastDirection = Vector2.Down;
|
||||
walkingAnimationPicked = true;
|
||||
}
|
||||
|
||||
if (Input.IsActionPressed("interact2"))
|
||||
@@ -89,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)
|
||||
{
|
||||
@@ -144,6 +157,7 @@ public partial class Player2D : CharacterBody2D
|
||||
_sprite.Animation = "diagonal wateringcan";
|
||||
_sprite.Play();
|
||||
_canHandleInput = false;
|
||||
_wateringParticles.Emitting = true;
|
||||
Task.Run(DelayedInputHandlerReset);
|
||||
}
|
||||
}
|
||||
@@ -151,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)
|
||||
{
|
||||
_wateringCanFilled = fillUp;
|
||||
if (!inputEvent.IsPressed())
|
||||
{
|
||||
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,14 @@ 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();
|
||||
}
|
||||
|
||||
if (Input.IsActionJustPressed("ui_inventory_close"))
|
||||
{
|
||||
if(_inventoryExtended)
|
||||
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,44 @@
|
||||
using Babushka.scripts.CSharp.Common.Farming;
|
||||
using Godot;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.UI;
|
||||
|
||||
public partial class WateringCanUi : Node2D
|
||||
{
|
||||
[Export] private Sprite2D[] _stages;
|
||||
|
||||
private const int WATERING_CAN_ID = 1;
|
||||
|
||||
public void Refill()
|
||||
{
|
||||
WateringCanState.Fill();
|
||||
UpdateSprites();
|
||||
}
|
||||
|
||||
public void Water()
|
||||
{
|
||||
UpdateSprites();
|
||||
}
|
||||
|
||||
public void IsWateringCanActive(int toolId)
|
||||
{
|
||||
IsWateringCanActive(true, toolId);
|
||||
}
|
||||
|
||||
public void IsWateringCanActive(bool success, int toolId)
|
||||
{
|
||||
if (!success)
|
||||
return;
|
||||
UpdateSprites();
|
||||
}
|
||||
|
||||
|
||||
private void UpdateSprites()
|
||||
{
|
||||
for (int i = 0; i < _stages.Length; i++)
|
||||
{
|
||||
_stages[i].Visible = WateringCanState.Active && i < WateringCanState.GetFillState();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://er03dkj8axlr
|
||||
@@ -37,7 +37,7 @@ float getWind(vec2 vertex, vec2 uv, float time){
|
||||
|
||||
void vertex() {
|
||||
vec4 pos = MODEL_MATRIX * vec4(0.0, 0.0, 0.0, 1.0);
|
||||
float time = TIME * speed + offset;
|
||||
float time = TIME * speed + sin(float(INSTANCE_ID) * offset);
|
||||
//float time = TIME * speed + pos.x * pos.y ; not working when moving...
|
||||
VERTEX.x += getWind(VERTEX.xy, UV, time);
|
||||
}
|
||||