From 6e62361b24ee2a2326ea66644ef4d0258161f88a Mon Sep 17 00:00:00 2001 From: Variable Date: Wed, 14 Aug 2024 20:50:31 +0500 Subject: [PATCH] Add more achievements --- src/Classes/Project.gd | 1 + src/Classes/SteamManager.gd | 5 +++++ src/Main.gd | 1 + src/UI/Dialogs/SplashDialog.gd | 2 ++ src/UI/Timeline/AnimationTimeline.gd | 2 ++ 5 files changed, 11 insertions(+) diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index aa2eb4a87..c70db4db1 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -150,6 +150,7 @@ func commit_undo() -> void: if Global.canvas.selection.is_moving_content: Global.canvas.selection.transform_content_cancel() else: + SteamManager.set_achievement("ACH_TIME_TRAVELLER") undo_redo.undo() diff --git a/src/Classes/SteamManager.gd b/src/Classes/SteamManager.gd index 9a8a6dfa4..eddcc29a3 100644 --- a/src/Classes/SteamManager.gd +++ b/src/Classes/SteamManager.gd @@ -10,12 +10,17 @@ const APP_ID := 2779170 ## because it is not available in non-Steam builds. static var steam_class static var achievements := { + "ACH_ART_LOVER": false, "ACH_FIRST_PIXEL": false, "ACH_ERASE_PIXEL": false, + "ACH_TIME_TRAVELLER": false, "ACH_SAVE": false, + "ACH_ALMOST_FORGOT": false, "ACH_PREFERENCES": false, "ACH_ONLINE_DOCS": false, "ACH_SUPPORT_DEVELOPMENT": false, + "ACH_BLEND_IN": false, + "ACH_STRONGER_TOGETHER": false, "ACH_3D_LAYER": false, } diff --git a/src/Main.gd b/src/Main.gd index 3fdcd4d2e..5f0828b29 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -532,6 +532,7 @@ func _on_QuitAndSaveDialog_custom_action(action: String) -> void: func _on_QuitAndSaveDialog_confirmed() -> void: is_quitting_on_save = true show_save_dialog(changed_projects_on_quit[0]) + SteamManager.set_achievement("ACH_ALMOST_FORGOT") func _quit() -> void: diff --git a/src/UI/Dialogs/SplashDialog.gd b/src/UI/Dialogs/SplashDialog.gd index 5c9e4bc5f..a34fb0822 100644 --- a/src/UI/Dialogs/SplashDialog.gd +++ b/src/UI/Dialogs/SplashDialog.gd @@ -90,6 +90,8 @@ func _on_SplashDialog_about_to_show() -> void: func change_artwork(direction: int) -> void: + if direction != 0: + SteamManager.set_achievement("ACH_ART_LOVER") chosen_artwork = wrapi(chosen_artwork + direction, 0, artworks.size()) splash_art_texturerect.texture = artworks[chosen_artwork].artwork set_process(artworks[chosen_artwork].artwork is AnimatedTexture) diff --git a/src/UI/Timeline/AnimationTimeline.gd b/src/UI/Timeline/AnimationTimeline.gd index ca6405850..9a170fd71 100644 --- a/src/UI/Timeline/AnimationTimeline.gd +++ b/src/UI/Timeline/AnimationTimeline.gd @@ -236,6 +236,7 @@ func _on_blend_modes_item_selected(index: int) -> void: project.undo_redo.add_undo_method(_update_layer_ui) project.undo_redo.add_undo_method(Global.canvas.draw_layers) project.undo_redo.commit_action() + SteamManager.set_achievement("ACH_BLEND_IN") func add_frame() -> void: @@ -793,6 +794,7 @@ func add_layer(type := 0) -> void: l = PixelLayer.new(project) Global.LayerTypes.GROUP: l = GroupLayer.new(project) + SteamManager.set_achievement("ACH_STRONGER_TOGETHER") Global.LayerTypes.THREE_D: l = Layer3D.new(project) SteamManager.set_achievement("ACH_3D_LAYER")