Correction de bug de Dialogic et réparation de la décontamination de la planète de l'écran titre

This commit is contained in:
2026-06-22 20:44:06 +02:00
parent caace67d12
commit a7dcd6d725
3 changed files with 29 additions and 20 deletions

View File

@@ -9,17 +9,18 @@ class_name DialogicNode_NameLabel
@export var use_character_color := true
func _ready() -> void:
add_to_group('dialogic_name_label')
if hide_when_empty:
name_label_root.visible = false
text = ""
add_to_group('dialogic_name_label')
if hide_when_empty:
name_label_root.visible = false
text = ""
func _set(property, what):
if property == 'text' and typeof(what) == TYPE_STRING:
text = what
if hide_when_empty:
name_label_root.visible = !what.is_empty()
else:
name_label_root.show()
return true
if property == 'text' and typeof(what) == TYPE_STRING:
text = what
if hide_when_empty:
name_label_root.visible = !what.is_empty()
else:
name_label_root.show()
return true
return false

View File

@@ -3,8 +3,7 @@ extends Node
const SAVE_GAME_LOCATION = "user://stw_playtest_2_save.tres"
const SAVE_SETTINGS_LOCATION = "user://stw_settings.tres"
var game_loaded = false
signal game_loaded
signal game_data_updated(g : GameData)
var game_data : GameData :
@@ -20,6 +19,7 @@ func load_game_data() -> GameData:
game_data = null
if ResourceLoader.exists(SAVE_GAME_LOCATION) and ResourceLoader.load(SAVE_GAME_LOCATION):
game_data = ResourceLoader.load(SAVE_GAME_LOCATION).duplicate_deep()
game_loaded.emit()
return game_data

View File

@@ -16,15 +16,15 @@ func _ready():
%Version.text = ProjectSettings.get_setting("application/config/version")
%Start.text = tr("CONTINUE") if GameInfo.game_data else tr("START")
%Restart.visible = GameInfo.game_data != null
if GameInfo.game_data:
%Planet3d.fertility_factor = (
max(0,float(GameInfo.game_data.progression_data.story_step_i - 1))
/ len(
GameInfo.game_data.progression_data.get_all_story_steps()
) - 1
)
%Settings.close_settings()
%Controls.close_controls()
if not GameInfo.game_data:
GameInfo.game_loaded.connect(
func ():
decontaminate_3D_planet(GameInfo.game_data)
)
else :
decontaminate_3D_planet(GameInfo.game_data)
func _on_start_pressed():
if GameInfo.game_data :
@@ -36,6 +36,14 @@ func _on_start_pressed():
GameInfo.start_game_data()
SceneManager.change_to_scene(IntroScene.new())
func decontaminate_3D_planet(game_data):
%Planet3d.fertility_factor = (
max(0,float(GameInfo.game_data.progression_data.story_step_i))
/ len(
GameInfo.game_data.progression_data.get_all_story_steps()
)
)
func _process(delta):
next_mouse_pos = get_viewport().get_mouse_position()
if Input.is_action_just_pressed("action"):