mirror of
https://github.com/Relintai/material-maker.git
synced 2025-01-09 05:39:38 +01:00
Fixed a few warnings
This commit is contained in:
parent
85bc6074b8
commit
9606f440e4
@ -51,7 +51,9 @@ func add_node(node) -> void:
|
|||||||
node.connect("close_request", self, "remove_node", [ node ])
|
node.connect("close_request", self, "remove_node", [ node ])
|
||||||
|
|
||||||
func connect_node(from, from_slot, to, to_slot):
|
func connect_node(from, from_slot, to, to_slot):
|
||||||
if generator.connect_children(get_node(from).generator, from_slot, get_node(to).generator, to_slot):
|
var from_node : MMGraphNodeBase = get_node(from)
|
||||||
|
var to_node : MMGraphNodeBase = get_node(to)
|
||||||
|
if generator.connect_children(from_node.generator, from_slot, to_node.generator, to_slot):
|
||||||
var disconnect = get_source(to, to_slot)
|
var disconnect = get_source(to, to_slot)
|
||||||
if !disconnect.empty():
|
if !disconnect.empty():
|
||||||
.disconnect_node(disconnect.node, disconnect.slot, to, to_slot)
|
.disconnect_node(disconnect.node, disconnect.slot, to, to_slot)
|
||||||
|
@ -3,9 +3,11 @@ extends Popup
|
|||||||
|
|
||||||
signal item_double_clicked(generator)
|
signal item_double_clicked(generator)
|
||||||
|
|
||||||
|
onready var tree = $Tree
|
||||||
|
|
||||||
func init(graph_name : String, generator : MMGenGraph) -> void:
|
func init(graph_name : String, generator : MMGenGraph) -> void:
|
||||||
$Tree.clear()
|
tree.clear()
|
||||||
var root : TreeItem = $Tree.create_item(null)
|
var root : TreeItem = tree.create_item(null)
|
||||||
root.set_text(0, graph_name)
|
root.set_text(0, graph_name)
|
||||||
root.set_custom_color(0, Color(1, 1, 1))
|
root.set_custom_color(0, Color(1, 1, 1))
|
||||||
root.set_metadata(0, generator)
|
root.set_metadata(0, generator)
|
||||||
@ -14,7 +16,7 @@ func init(graph_name : String, generator : MMGenGraph) -> void:
|
|||||||
func fill_item(parent : TreeItem, generator : MMGenGraph) -> void:
|
func fill_item(parent : TreeItem, generator : MMGenGraph) -> void:
|
||||||
for c in generator.get_children():
|
for c in generator.get_children():
|
||||||
if c is MMGenGraph:
|
if c is MMGenGraph:
|
||||||
var item : TreeItem = $Tree.create_item(parent)
|
var item : TreeItem = tree.create_item(parent)
|
||||||
item.set_text(0, c.get_type_name())
|
item.set_text(0, c.get_type_name())
|
||||||
if c.is_editable():
|
if c.is_editable():
|
||||||
item.set_custom_color(0, Color(1, 1, 1))
|
item.set_custom_color(0, Color(1, 1, 1))
|
||||||
@ -22,5 +24,5 @@ func fill_item(parent : TreeItem, generator : MMGenGraph) -> void:
|
|||||||
fill_item(item, c)
|
fill_item(item, c)
|
||||||
|
|
||||||
func _on_Tree_item_double_clicked() -> void:
|
func _on_Tree_item_double_clicked() -> void:
|
||||||
emit_signal("item_double_clicked", $Tree.get_selected().get_metadata(0))
|
emit_signal("item_double_clicked", tree.get_selected().get_metadata(0))
|
||||||
queue_free()
|
queue_free()
|
||||||
|
6
start.gd
6
start.gd
@ -2,6 +2,8 @@ extends Control
|
|||||||
|
|
||||||
var loader
|
var loader
|
||||||
|
|
||||||
|
onready var progress_bar = $VBoxContainer/ProgressBar
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
var path : String
|
var path : String
|
||||||
if Directory.new().file_exists("res://material_maker/main_window.tscn"):
|
if Directory.new().file_exists("res://material_maker/main_window.tscn"):
|
||||||
@ -13,7 +15,7 @@ func _ready():
|
|||||||
print("error")
|
print("error")
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|
||||||
func _process(delta):
|
func _process(_delta):
|
||||||
var err = loader.poll()
|
var err = loader.poll()
|
||||||
if err == ERR_FILE_EOF:
|
if err == ERR_FILE_EOF:
|
||||||
var resource = loader.get_resource()
|
var resource = loader.get_resource()
|
||||||
@ -21,7 +23,7 @@ func _process(delta):
|
|||||||
queue_free()
|
queue_free()
|
||||||
elif err == OK:
|
elif err == OK:
|
||||||
var progress = float(loader.get_stage()) / loader.get_stage_count()
|
var progress = float(loader.get_stage()) / loader.get_stage_count()
|
||||||
$VBoxContainer/ProgressBar.value = 100.0*progress
|
progress_bar.value = 100.0*progress
|
||||||
else: # error during loading
|
else: # error during loading
|
||||||
print("error")
|
print("error")
|
||||||
queue_free()
|
queue_free()
|
||||||
|
Loading…
Reference in New Issue
Block a user