start working on the XLib plugin, add evilium
This commit is contained in:
12
GameShit/ItemHandlers/base/evilium.tres
Normal file
12
GameShit/ItemHandlers/base/evilium.tres
Normal file
@@ -0,0 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="ItemData" format=3 uid="uid://cjdrlgjtalrit"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cjb16s8q73wkx" path="res://GameShit/PlayerController/Hotbar/ItemData.gd" id="1_uohj2"]
|
||||
[ext_resource type="Texture2D" uid="uid://cisnwwf0h8n20" path="res://Assets/grass.jpg" id="2_wtvso"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_uohj2")
|
||||
Name = "Evilium"
|
||||
ID = "base:evilium"
|
||||
description = "tis an evil kitty"
|
||||
texture = ExtResource("2_wtvso")
|
||||
metadata/_custom_type_script = "uid://cjb16s8q73wkx"
|
||||
@@ -7,21 +7,31 @@ extends Control
|
||||
## if you are looking for chat var storage
|
||||
## they are in GameShit/ChatSystem/ChatBox.gd
|
||||
|
||||
|
||||
## This dict holds a reference to all command IDs and their corresponding call
|
||||
var Commands : Dictionary = {
|
||||
"give": CommandHandler.registerCommand("base:giveItem").new(),
|
||||
"say": CommandHandler.registerCommand("base:say").new()
|
||||
}
|
||||
|
||||
## load the language manager
|
||||
var language = LanguageManager.loadLanguage()
|
||||
|
||||
## parse message
|
||||
func _parseMessage():
|
||||
|
||||
## get the contents
|
||||
var messageContents : String = %Input.text
|
||||
|
||||
## handle if its a command
|
||||
if messageContents.begins_with("/"):
|
||||
## strip out the /
|
||||
var command = messageContents.right(-1)
|
||||
## run the command
|
||||
runCommand(command)
|
||||
%Input.text = ""
|
||||
MainGame.hideChatbox.emit()
|
||||
## if its not a command, send the message and reset the field and hide the box
|
||||
else:
|
||||
sendMessage(messageContents)
|
||||
%Input.text = ""
|
||||
|
||||
Reference in New Issue
Block a user