Add new entity and item definitions, refactor related code
- Introduced new CSV files for entities and items, defining various properties and characteristics. - Refactored the stage.gd script to handle item selection and descriptions instead of entities. - Updated item button script to reflect changes in item properties and signals. - Created a new entity.gd script to define the OwniverseEntity class with initialization and parsing methods. - Modified owniverse.gd to initialize entities from the new definitions. - Adjusted versioning in export presets and project files to reflect recent changes.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
extends Control
|
||||
class_name OwniverseEntity
|
||||
class_name OwniverseItem
|
||||
|
||||
signal entity_activated(entity)
|
||||
signal item_activated(item)
|
||||
|
||||
const ENTITY_WIDTH = 216
|
||||
const ENTITY_HEIGHT = 256
|
||||
@@ -11,10 +11,10 @@ const ENTITY_HEIGHT = 256
|
||||
@onready var description: Label = $Description
|
||||
@onready var selection: TextureRect = $Selection
|
||||
|
||||
@export var entity_name: String = ""
|
||||
@export var entity_id: String = ""
|
||||
@export var entity_page: int = -1
|
||||
@export var sub_page: int = -1
|
||||
var item_id: String = ""
|
||||
var item_name: String = ""
|
||||
var item_page: int = -1
|
||||
var item_sub_page: int = -1
|
||||
|
||||
|
||||
func set_selection(flag: bool) -> void:
|
||||
@@ -25,16 +25,14 @@ func init_button(properties: Dictionary):
|
||||
var image_path = "res://" + properties.image + properties.name + ".png"
|
||||
texture_button.texture_normal = load(image_path)
|
||||
position = Vector2i(int(properties.col) * ENTITY_WIDTH, int(properties.row) * ENTITY_HEIGHT)
|
||||
entity_id = properties.id
|
||||
entity_name = properties.name
|
||||
entity_page = int(properties.page)
|
||||
sub_page = int(properties.sub_page)
|
||||
item_id = properties.id
|
||||
item_name = properties.name
|
||||
item_page = int(properties.page)
|
||||
item_sub_page = int(properties.sub_page)
|
||||
name = properties.id
|
||||
set_selection(false)
|
||||
#print(properties)
|
||||
|
||||
|
||||
func _on_button_up() -> void:
|
||||
set_selection(true)
|
||||
entity_activated.emit(self)
|
||||
#Texture_button.texture_normal = load("res://UI/0-Forces/Inflatin.png")
|
||||
item_activated.emit(self)
|
||||
|
||||
Reference in New Issue
Block a user