Skip to content

Commit

Permalink
Fix save game method in demo project
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Ibáñez Sánchez <jacobibanez@jacobibanez.com>
  • Loading branch information
Iakobs committed Dec 27, 2023
1 parent bb5ab1c commit ca8ac6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugin/demo/scenes/snapshots/Snapshots.gd
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func _connect_save_game_data() -> void:
_reset_save_game_data()
SnapshotsClient.save_game(
_current_name,
_current_data,
_current_description
_current_description,
_current_data.to_utf8_buffer()
)
)
SnapshotsClient.game_saved.connect(
Expand Down
13 changes: 10 additions & 3 deletions plugin/export_scripts_template/autoloads/snapshots_client.gd
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,17 @@ func show_saved_games(
## [br]
## [param fileName]: The name of the save file. Must be between 1 and 100 non-URL-reserved characters (a-z, A-Z, 0-9, or the symbols "-", ".", "_", or "~").[br]
## [param saveData]: A String with the saved data of the game.[br]
## [param description]: The description of the save file.
func save_game(file_name: String, save_data: String, description: String) -> void:
## [param played_time_millis]: Optional. The played time of this snapshot in milliseconds.[br]
## [param progress_value]: Optional. The progress value for this snapshot.
func save_game(
file_name: String,
description: String,
save_data: PackedByteArray,
played_time_millis: int = 0,
progress_value: int = 0,
) -> void:
if GodotPlayGameServices.android_plugin:
GodotPlayGameServices.android_plugin.saveGame(file_name, save_data, description)
GodotPlayGameServices.android_plugin.saveGame(file_name, description, save_data, played_time_millis, progress_value)

## Loads game data from the Google Cloud.[br]
## [br]
Expand Down

0 comments on commit ca8ac6b

Please sign in to comment.