update and improve ui
This commit was merged in pull request #36.
This commit is contained in:
@@ -9,6 +9,13 @@ var anti_aliasing: bool = true
|
||||
var window_mode_index: int = 0
|
||||
var resolution_x: int = 1920
|
||||
var resolution_y: int = 1080
|
||||
var train_color_1: String = ""
|
||||
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] = []
|
||||
@@ -23,6 +30,12 @@ func to_dictionary() -> Dictionary:
|
||||
"window_mode_index": window_mode_index,
|
||||
"resolution_x": resolution_x,
|
||||
"resolution_y": resolution_y,
|
||||
"train_color_1": train_color_1,
|
||||
"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:
|
||||
@@ -52,4 +65,22 @@ static func from_dictionary(data: Dictionary) -> SaveGameData:
|
||||
if data.has("resolution_y"):
|
||||
save_game_data.resolution_y = int(data["resolution_y"])
|
||||
|
||||
if data.has("train_color_1"):
|
||||
save_game_data.train_color_1 = str(data["train_color_1"])
|
||||
|
||||
if data.has("train_color_2"):
|
||||
save_game_data.train_color_2 = str(data["train_color_2"])
|
||||
|
||||
if data.has("train_color_1_index"):
|
||||
save_game_data.train_color_1_index = int(data["train_color_1_index"])
|
||||
|
||||
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