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:
@@ -9,17 +9,18 @@ class_name DialogicNode_NameLabel
|
|||||||
@export var use_character_color := true
|
@export var use_character_color := true
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
add_to_group('dialogic_name_label')
|
add_to_group('dialogic_name_label')
|
||||||
if hide_when_empty:
|
if hide_when_empty:
|
||||||
name_label_root.visible = false
|
name_label_root.visible = false
|
||||||
text = ""
|
text = ""
|
||||||
|
|
||||||
|
|
||||||
func _set(property, what):
|
func _set(property, what):
|
||||||
if property == 'text' and typeof(what) == TYPE_STRING:
|
if property == 'text' and typeof(what) == TYPE_STRING:
|
||||||
text = what
|
text = what
|
||||||
if hide_when_empty:
|
if hide_when_empty:
|
||||||
name_label_root.visible = !what.is_empty()
|
name_label_root.visible = !what.is_empty()
|
||||||
else:
|
else:
|
||||||
name_label_root.show()
|
name_label_root.show()
|
||||||
return true
|
return true
|
||||||
|
return false
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ extends Node
|
|||||||
const SAVE_GAME_LOCATION = "user://stw_playtest_2_save.tres"
|
const SAVE_GAME_LOCATION = "user://stw_playtest_2_save.tres"
|
||||||
const SAVE_SETTINGS_LOCATION = "user://stw_settings.tres"
|
const SAVE_SETTINGS_LOCATION = "user://stw_settings.tres"
|
||||||
|
|
||||||
var game_loaded = false
|
signal game_loaded
|
||||||
|
|
||||||
signal game_data_updated(g : GameData)
|
signal game_data_updated(g : GameData)
|
||||||
|
|
||||||
var game_data : GameData :
|
var game_data : GameData :
|
||||||
@@ -20,6 +19,7 @@ func load_game_data() -> GameData:
|
|||||||
game_data = null
|
game_data = null
|
||||||
if ResourceLoader.exists(SAVE_GAME_LOCATION) and ResourceLoader.load(SAVE_GAME_LOCATION):
|
if ResourceLoader.exists(SAVE_GAME_LOCATION) and ResourceLoader.load(SAVE_GAME_LOCATION):
|
||||||
game_data = ResourceLoader.load(SAVE_GAME_LOCATION).duplicate_deep()
|
game_data = ResourceLoader.load(SAVE_GAME_LOCATION).duplicate_deep()
|
||||||
|
game_loaded.emit()
|
||||||
|
|
||||||
return game_data
|
return game_data
|
||||||
|
|
||||||
|
|||||||
@@ -16,15 +16,15 @@ func _ready():
|
|||||||
%Version.text = ProjectSettings.get_setting("application/config/version")
|
%Version.text = ProjectSettings.get_setting("application/config/version")
|
||||||
%Start.text = tr("CONTINUE") if GameInfo.game_data else tr("START")
|
%Start.text = tr("CONTINUE") if GameInfo.game_data else tr("START")
|
||||||
%Restart.visible = GameInfo.game_data != null
|
%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()
|
%Settings.close_settings()
|
||||||
%Controls.close_controls()
|
%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():
|
func _on_start_pressed():
|
||||||
if GameInfo.game_data :
|
if GameInfo.game_data :
|
||||||
@@ -36,6 +36,14 @@ func _on_start_pressed():
|
|||||||
GameInfo.start_game_data()
|
GameInfo.start_game_data()
|
||||||
SceneManager.change_to_scene(IntroScene.new())
|
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):
|
func _process(delta):
|
||||||
next_mouse_pos = get_viewport().get_mouse_position()
|
next_mouse_pos = get_viewport().get_mouse_position()
|
||||||
if Input.is_action_just_pressed("action"):
|
if Input.is_action_just_pressed("action"):
|
||||||
|
|||||||
Reference in New Issue
Block a user