32 lines
867 B
GDScript
32 lines
867 B
GDScript
extends Node3D
|
|
|
|
|
|
## define all of the game variables, ill replace this with a settings file later
|
|
## ignore duplicate keys, idrc atp
|
|
## this game is jus a mess of spaghetti anyhow
|
|
var selectedBlockID : String = "base:testMachine"
|
|
var selectedSlot = 0
|
|
var currentHeldItemID : String = "base:air"
|
|
var canPlaceBlock : bool = false
|
|
var username = "Xtimhedi"
|
|
var loadedLanguage = "en-US"
|
|
var isInputLocked = false
|
|
|
|
signal hideChatbox
|
|
|
|
|
|
|
|
|
|
func getIfIDExists(ID:String) -> bool:
|
|
var segments = ID.split(":")
|
|
return ResourceLoader.exists("res://WorldObjects/{namespace}/{id}.tscn".format({"namespace": segments[0], "id": segments[1]}))
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
if currentHeldItemID != "base:air" and getIfIDExists(currentHeldItemID):
|
|
canPlaceBlock = true
|
|
selectedBlockID = currentHeldItemID
|
|
else:
|
|
canPlaceBlock = false
|
|
selectedBlockID = "base:air"
|