fancy printer list, time to get ready for twenty10
This commit is contained in:
parent
c26b350e49
commit
319e30e3d4
5 changed files with 49 additions and 1 deletions
1
Library.gd.uid
Normal file
1
Library.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ow8cfjxy4fio
|
||||
23
application_cmds/printer-status.gd
Normal file
23
application_cmds/printer-status.gd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
extends RefCounted
|
||||
|
||||
#func on_ready(main, bot: DiscordBot) -> void:
|
||||
# pass
|
||||
#
|
||||
#func on_autocomplete(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
# pass
|
||||
|
||||
func execute(main, bot: DiscordBot, interaction: DiscordInteraction, options: Array) -> void:
|
||||
|
||||
var response : String = "Listing printers..."
|
||||
var embed = Embed.new().set_description(Library.list_printers())
|
||||
|
||||
interaction.reply({
|
||||
"content": response,
|
||||
"embeds":[embed]
|
||||
})
|
||||
pass
|
||||
|
||||
var data = ApplicationCommand.new()\
|
||||
.set_name("printer-status")\
|
||||
.set_description("view the status of all printers")\
|
||||
|
||||
1
application_cmds/printer-status.gd.uid
Normal file
1
application_cmds/printer-status.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ble32gllmjgwm
|
||||
|
|
@ -3,3 +3,25 @@ class_name Printer
|
|||
|
||||
@export var name : String
|
||||
@export var spool : Spool
|
||||
@export var nozzle : String = "0.4mm"
|
||||
|
||||
static var nozzles : Array[String] = [
|
||||
"0.6mm",
|
||||
"0.4mm",
|
||||
"0.2mm",
|
||||
]
|
||||
|
||||
|
||||
func list_string() -> String:
|
||||
var result = name + ": "
|
||||
|
||||
if spool:
|
||||
result += spool.name + " "
|
||||
if spool.link:
|
||||
result += "[Link]("+spool.link+")"
|
||||
else:
|
||||
result += "***Unloaded***"
|
||||
|
||||
result += " (Nozzle: "+nozzle+")"
|
||||
|
||||
return result
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ extends Node
|
|||
var save_path : String = "user://librarySave.tres"
|
||||
var save : LibrarySave
|
||||
|
||||
# nozzles here or in save maybe?
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
|
@ -41,7 +42,7 @@ func save_new():
|
|||
func list_printers() -> String:
|
||||
var response : String = "Current Printers:"
|
||||
for printer : Printer in save.printers:
|
||||
response += "\n- " + printer.name
|
||||
response += "\n- " + printer.list_string()
|
||||
return response
|
||||
|
||||
func printer_choies() -> Array[Dictionary]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue