gros dev pre proto
* Changement de l'UI, ajouts de l'inspecteur par carte et changement de police * Ajout d'un semblant d'exploration * Ajout de la sauvegarde des entités * Restructuration mineure de l'arborescence * Fix divers et réécriture des textes
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
extends Area2D
|
||||
extends Entity
|
||||
class_name InspectableEntity
|
||||
|
||||
const MODULATE_INSPECTED_COLOR = Color.GRAY
|
||||
const MODULATE_AFFECTED_COLOR = Color.RED
|
||||
|
||||
var terrain : Terrain
|
||||
var planet : Planet :
|
||||
get(): return terrain if terrain is Planet else null
|
||||
const DESC_ICON = preload("res://common/icons/align-right.svg")
|
||||
|
||||
@export var default_info_title = ""
|
||||
@export var default_info_desc = ""
|
||||
@export_multiline var default_info_desc = ""
|
||||
|
||||
@onready var default_modulate : Color = modulate
|
||||
@onready var inspectable_signals_setuped : bool = setup_inspectable_signals()
|
||||
@@ -26,7 +23,7 @@ func setup_inspectable_signals() -> bool:
|
||||
return true
|
||||
|
||||
func _on_mouse_entered():
|
||||
Pointer.inspect(self, inspector_info())
|
||||
Pointer.inspect(self)
|
||||
|
||||
func _on_mouse_excited():
|
||||
Pointer.stop_inspect(self)
|
||||
@@ -34,12 +31,23 @@ func _on_mouse_excited():
|
||||
func pointer_text() -> String:
|
||||
return default_info_title
|
||||
|
||||
func inspector_info() -> Inspector.Info:
|
||||
return Inspector.Info.new(
|
||||
pointer_text(),
|
||||
default_info_desc
|
||||
func card_info() -> CardInfo:
|
||||
var info = CardInfo.new(
|
||||
pointer_text()
|
||||
)
|
||||
|
||||
if default_info_desc != "":
|
||||
var desc_section = CardSectionInfo.new(
|
||||
"Description",
|
||||
default_info_desc
|
||||
)
|
||||
desc_section.title_icon = DESC_ICON
|
||||
info.sections.append(
|
||||
desc_section
|
||||
)
|
||||
|
||||
return info
|
||||
|
||||
func _notification(what):
|
||||
if (what == NOTIFICATION_PREDELETE):
|
||||
Pointer.stop_inspect(self)
|
||||
|
||||
Reference in New Issue
Block a user