Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add quiver analytics #28

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/release-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
# Ensure the build works on main
push:
branches: [main]
tags:
tags: ['*']
# Ensure the build works on each pull request
pull_request:

Expand Down Expand Up @@ -44,6 +44,9 @@ jobs:
- name: Load dotenv
run: just ci-load-dotenv

- name: Setup Quiver
run: just quiver ${{ secrets.QUIVER_AUTH_TOKEN }}

- name: Cache Godot
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -113,6 +116,9 @@ jobs:
- name: Load dotenv
run: just ci-load-dotenv

- name: Setup Quiver
run: just quiver ${{ secrets.QUIVER_AUTH_TOKEN }}

- name: Download artifact
uses: dawidd6/action-download-artifact@v3
with:
Expand All @@ -125,4 +131,4 @@ jobs:
run: just ci-publish
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT }}
6 changes: 6 additions & 0 deletions .godot/global_script_class_cache.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ list=Array[Dictionary]([{
"language": &"GDScript",
"path": "res://addons/logger/config.gd"
}, {
"base": &"CanvasLayer",
"class": &"ConsentDialog",
"icon": "",
"language": &"GDScript",
"path": "res://addons/quiver_analytics/consent_dialog.gd"
}, {
"base": &"Observable",
"class": &"DarkRoad",
"icon": "",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [Unreleased]
### Added
- Add custom bootsplash ([#25](https://github.com/MechanicalFlower/HazyRoad/pull/25))
- Add Quiver Analtics ([#28](https://github.com/MechanicalFlower/HazyRoad/pull/28))
### Changed
### Deprecated
### Removed
Expand Down
4 changes: 4 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ butler *ARGS: check-butler
echo "Update version in the project.godot"
sed -i "s,config/version=.*$,config/version=\"{{ game_version }}\",g" ./project.godot

@quiver $QUIVER_AUTH_TOKEN:
echo "Add Quiver authentication token in the project.godot"
sed -i "s,REPLACE_ME,"$QUIVER_AUTH_TOKEN",g" ./project.godot

[private]
pre-export: clean-addons makedirs bump-version install-addons import-resources

Expand Down
7 changes: 7 additions & 0 deletions plug.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ func _plugging():
"include": ["addons/kanban_tasks"]
}
)
plug(
"quiver-dev/quiver-analytics-godot-plugin",
{
"commit": "7430a4533911701845c3f1f59945543d63962263",
"renovate-branch": "main",
}
)

# Patched version
plug(
Expand Down
11 changes: 8 additions & 3 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ GlobalSignal="*res://scripts/framework/global_signal.gd"
GameState="*res://scripts/framework/game_state.gd"
MenuTemplateManager="*res://addons/EasyMenus/Nodes/menu_template_manager.tscn"
Log="*res://addons/logger/logger.gd"
Analytics="*res://addons/quiver_analytics/analytics.tscn"

[custom_options]

build_info/commit="a9602d15680d01d0406f54ed85a3d02b4ab69d4f"
build_info/date="2024/02/10"
build_info/commit="a340227663d7250445ca4ac8b0f59f41b64e9a03"
build_info/date="2024/03/22"

[display]

Expand All @@ -53,7 +54,7 @@ export/convert_text_resources_to_binary=false

[editor_plugins]

enabled=PackedStringArray("res://addons/debug_menu/plugin.cfg", "res://addons/dialogue_label/plugin.cfg", "res://addons/export-build-info/plugin.cfg", "res://addons/kanban_tasks/plugin.cfg", "res://addons/logger/plugin.cfg", "res://addons/proton_scatter/plugin.cfg")
enabled=PackedStringArray("res://addons/debug_menu/plugin.cfg", "res://addons/dialogue_label/plugin.cfg", "res://addons/export-build-info/plugin.cfg", "res://addons/kanban_tasks/plugin.cfg", "res://addons/logger/plugin.cfg", "res://addons/proton_scatter/plugin.cfg", "res://addons/quiver_analytics/plugin.cfg")

[filesystem]

Expand Down Expand Up @@ -146,6 +147,10 @@ locale/translations=PackedStringArray("res://assets/i18n/locale.fr.translation",
3d_physics/layer_2="Player"
3d_physics/layer_3="Floor"

[quiver]

general/auth_token="REPLACE_ME"

[rendering]

occlusion_culling/bvh_build_quality=0
Expand Down
7 changes: 7 additions & 0 deletions scripts/player/inventory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ func _on_Accessory_current_item_updated(new_current_item: StringName):
fuse.show()
&"tire":
tire.show()
await Analytics.add_event(
"current_item_updated",
{
"game_version": ProjectSettings.get("application/config/version"),
"item_name": new_current_item
}
)


func hide_all():
Expand Down
6 changes: 6 additions & 0 deletions scripts/scenario.gd
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ func _ready():

func _on_Scenario_animation_finished(anim_name: StringName):
if anim_name == &"intro":
await Analytics.add_event(
"Start the game", {"game_version": ProjectSettings.get("application/config/version")}
)
camera_car.get_parent().get_node("Engine").stop()

# Transition that launch the playable game
camera_car.set_current(false)
player.set_process_mode(PROCESS_MODE_INHERIT)

elif anim_name == &"outro":
await Analytics.add_event(
"Finish the game", {"game_version": ProjectSettings.get("application/config/version")}
)
await Fade.fade_out(1, Color.BLACK, "Diamond", false, false).finished
get_tree().change_scene_to_file("res://scenes/menu.tscn")

Expand Down