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:
2025-10-31 13:52:45 +01:00
parent ceae7af589
commit ed7a8bcb6e
167 changed files with 2665 additions and 1201 deletions

View File

@@ -0,0 +1,9 @@
extends Area2D
class_name Entity
var terrain : Terrain
var planet : Planet :
get(): return terrain if terrain is Planet else null
func save() -> EntityData:
return null

View File

@@ -0,0 +1 @@
uid://dxb383bmy4kdx

View File

@@ -0,0 +1,13 @@
extends Resource
class_name EntityData
@export var position : Vector2
func _init(e : Entity):
position = e.global_position
func get_position() -> Vector2:
return position
func load() -> Entity:
return null

View File

@@ -0,0 +1 @@
uid://bgbbce45hjv3d

View File

@@ -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)