spool system redo nearly done

still need to fix unload
This commit is contained in:
Tabby 2025-11-02 00:51:39 +11:00
parent 0ed04fbc93
commit b83ef6b77b
12 changed files with 286 additions and 46 deletions

View file

@ -2,8 +2,9 @@ extends Resource
class_name Printer
@export var name : String
@export var spool : Spool
@export var spools : Array[Spool] = []
@export var nozzle : String = "0.4mm"
@export var spool_slots : int = 1
static var nozzles : Array[String] = [
"0.6mm",
@ -15,13 +16,15 @@ static var nozzles : Array[String] = [
func list_string() -> String:
var result = name + ": "
if spool:
result += spool.name + " "
if spool.link:
result += "[Link]("+spool.link+")"
if spools.size() > 0:
for i : int in spools.size():
result += spools[i].list_string()
if i < spools.size() - 1:
result += ", "
else:
result += "***Unloaded***"
result += " (Slots: "+ str(spools.size()) +"/"+ str(spool_slots) +")"
result += " (Nozzle: "+nozzle+")"
return result

View file

@ -6,8 +6,10 @@ class_name Spool
@export var link : String
# tags?
func list_string() -> String:
func list_string(bold : bool = false) -> String:
var result : String = name
if bold:
result = "**" + result + "**"
if link:
result = "[" + result +"]("+link+")"
return result