fix ui, add labels for distance and time, add choo choo button and hide button
This commit is contained in:
@@ -31,6 +31,10 @@ func _ready() -> void:
|
||||
apply_video_settings()
|
||||
apply_train_colors()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if not get_tree().paused and is_loaded:
|
||||
save_data.total_time_played_seconds += delta
|
||||
|
||||
func apply_video_settings() -> void:
|
||||
get_viewport().use_taa = save_data.anti_aliasing
|
||||
var msaa_mode = Viewport.MSAA_2X if save_data.anti_aliasing else Viewport.MSAA_DISABLED
|
||||
|
||||
@@ -14,6 +14,9 @@ var train_color_2: String = ""
|
||||
var train_color_1_index: int = 0
|
||||
var train_color_2_index: int = 0
|
||||
|
||||
var total_distance_km: float = 0.0
|
||||
var total_time_played_seconds: float = 0.0
|
||||
|
||||
func to_dictionary() -> Dictionary:
|
||||
var serialized_collectible_ids: Array[String] = []
|
||||
for collectible_id in unlocked_collectibles_ids:
|
||||
@@ -31,6 +34,8 @@ func to_dictionary() -> Dictionary:
|
||||
"train_color_2": train_color_2,
|
||||
"train_color_1_index": train_color_1_index,
|
||||
"train_color_2_index": train_color_2_index,
|
||||
"total_distance_km": total_distance_km,
|
||||
"total_time_played_seconds": total_time_played_seconds,
|
||||
}
|
||||
|
||||
static func from_dictionary(data: Dictionary) -> SaveGameData:
|
||||
@@ -72,4 +77,10 @@ static func from_dictionary(data: Dictionary) -> SaveGameData:
|
||||
if data.has("train_color_2_index"):
|
||||
save_game_data.train_color_2_index = int(data["train_color_2_index"])
|
||||
|
||||
if data.has("total_distance_km"):
|
||||
save_game_data.total_distance_km = float(data["total_distance_km"])
|
||||
|
||||
if data.has("total_time_played_seconds"):
|
||||
save_game_data.total_time_played_seconds = float(data["total_time_played_seconds"])
|
||||
|
||||
return save_game_data
|
||||
|
||||
Reference in New Issue
Block a user