* Modification de l'apparence de l'UI des dialogues * Changement de l'ordre de déblocage des mutations * Ajout d'une confirmation pour l'abandon * Ajout de la scène de fin avec la base Boréa, en tant que fin de démo * Modification des icône de durée de vie, temps de pousse, et de mort * Ajout d'un icône au dessus du joueur quand il n'a plus d'énergie * Amélioration des dialogues du jeu * Changement du modèle du téléphone * Ajout de cellule d'énergie et de cellule de talion trouvable sur la carte * Il est à nouveau possible de se recharger après la fin d'une région * Buff des mutations ancien sociale et solide * Modification de la mutation fertile (ne donne de gain de graine qu'à la maturation) * Ajout d'une récupération automatique des graines * Ajout de deux cartons de tutoriel ainsi qu'une option pour les revoir dans l'aide de jeu * Amélioration générale du tutoriel * Ajout d'un écran titre digne de ce nom * Lors de l'arrivée à destination, ne téléporte plus le joueur sur une map vide, mais directement dans les lieux de cinématique * Ajout graphique de plus de pattern de mousse et de roche * Le talion apparait maintenant sur toute la carte * La roche peut désormais apparaitre sur la zone de départ * Ajout dud modificateur de région Canyon * Equilibrage général * Fix de bugs en tout genre
108 lines
3.6 KiB
GDScript
108 lines
3.6 KiB
GDScript
@tool
|
|
extends CanvasLayer
|
|
class_name Announce
|
|
|
|
const DEFAULT_OBJECT_ACCELERATION = Vector2(3,0)
|
|
|
|
@export var announce_object : AnnouceObject = null : set = set_announce_object
|
|
|
|
@export_tool_button("Update", "Callable") var update_action = set_announce_object
|
|
|
|
var announce_objects : Array[AnnouceObject] = []
|
|
|
|
var object_acceleration := Vector2(0,0)
|
|
|
|
var rotating := false
|
|
|
|
var prev_mouse_pos : Vector2
|
|
var next_mouse_pos : Vector2
|
|
|
|
const YELLOW_COLOR = Color("e29f32")
|
|
const RED_COLOR = Color("f20058")
|
|
|
|
func _ready():
|
|
set_announce_object()
|
|
%OkButton.button_down.connect(_on_ok_button_down)
|
|
hide()
|
|
|
|
|
|
GameInfo.game_data.player_data.inventory.tool_added.connect(
|
|
func (i : Item):
|
|
if not i.name in GameInfo.game_data.item_announced:
|
|
announce_objects.append(AnnounceTool.new(i, get_screenshots_for_item(i)))
|
|
GameInfo.game_data.item_announced.append(i.name)
|
|
)
|
|
|
|
func _process(delta):
|
|
if announce_object == null and not visible and len(announce_objects) > 0:
|
|
announce_object = announce_objects.pop_front()
|
|
update_rotation(delta)
|
|
|
|
func get_screenshots_for_item(i : Item) -> Texture:
|
|
if i is Pickaxe:
|
|
return preload("res://gui/game/announce/screenshots/pickaxe.png")
|
|
if i is Detector:
|
|
return preload("res://gui/game/announce/screenshots/detector.png")
|
|
if i is Fork:
|
|
return preload("res://gui/game/announce/screenshots/fork.png")
|
|
return null
|
|
|
|
func update_rotation(delta):
|
|
if visible:
|
|
next_mouse_pos = get_viewport().get_mouse_position()
|
|
if Input.is_action_just_pressed("action"):
|
|
rotating = true
|
|
prev_mouse_pos = get_viewport().get_mouse_position()
|
|
if Input.is_action_just_released("action"):
|
|
rotating = false
|
|
object_acceleration = Vector2(
|
|
float(next_mouse_pos.x - prev_mouse_pos.x),
|
|
float(next_mouse_pos.y - prev_mouse_pos.y)
|
|
)
|
|
|
|
var object_rotation = object_acceleration
|
|
|
|
if rotating:
|
|
object_rotation = Vector2(
|
|
float(next_mouse_pos.x - prev_mouse_pos.x),
|
|
float(next_mouse_pos.y - prev_mouse_pos.y)
|
|
)
|
|
prev_mouse_pos = next_mouse_pos
|
|
else :
|
|
object_acceleration = object_acceleration.lerp(DEFAULT_OBJECT_ACCELERATION, 0.1)
|
|
|
|
%AnnouceObject.rotate(Vector3.UP, object_rotation.x * delta)
|
|
%AnnouceObject.rotate(Vector3.RIGHT, object_rotation.y * delta)
|
|
|
|
|
|
func set_announce_object(object := announce_object):
|
|
Pointer.action_disabled = not object
|
|
if is_node_ready() and object:
|
|
for children in %AnnouceObject.get_children():
|
|
children.queue_free()
|
|
|
|
%AnnouceObject.add_child(object.get_3d_object())
|
|
%AnnouceObject.rotation = Vector3.ZERO
|
|
%AnnounceTitle.text = object.get_title()
|
|
%AnnounceText.text = object.get_text()
|
|
%AnnounceDesc.text = object.get_desc()
|
|
%AnnounceImage.texture = object.get_image()
|
|
%ObjectVisualiser.info = object.get_card_info()
|
|
|
|
if not visible:
|
|
%AnimationPlayer.play("appear")
|
|
Pointer.action_disabled = true
|
|
AudioManager.play_sfx("Unlock_tool")
|
|
elif object == null and visible:
|
|
%AnimationPlayer.play_backwards("appear")
|
|
get_tree().create_timer(0.2).timeout.connect( # Put a delay to not interfere with the ok button click
|
|
func():
|
|
Pointer.action_disabled = false
|
|
)
|
|
announce_object = object
|
|
|
|
func _on_ok_button_down():
|
|
if announce_object:
|
|
announce_object._on_dismiss()
|
|
announce_object = null
|