From e30e0304c4e5179898ad64be8f6332a5b2d854b7 Mon Sep 17 00:00:00 2001 From: Jared McCluskey Date: Thu, 23 May 2024 05:57:56 -0700 Subject: [PATCH] Fix env designation pt 2 (#186) * Fix env designation pt 2 * fix method --- mirror-godot-app/scripts/autoload/analytics/analytics_v2.gd | 6 +++++- mirror-godot-app/scripts/autoload/util_funcs.gd | 4 ++++ mirror-godot-app/ui/global_version_label/version_label.gd | 6 ++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mirror-godot-app/scripts/autoload/analytics/analytics_v2.gd b/mirror-godot-app/scripts/autoload/analytics/analytics_v2.gd index 972c2b85..8450fef8 100644 --- a/mirror-godot-app/scripts/autoload/analytics/analytics_v2.gd +++ b/mirror-godot-app/scripts/autoload/analytics/analytics_v2.gd @@ -36,10 +36,14 @@ func track_event(event_type: String, properties:={}) -> void: ## Send a single event to the Mixpanel Analytics service func _send_track_event(event: AnalyticsEvent, properties := {}) -> void: + var version := Util.get_version_string() + var release := Util.get_release_name() var standard_properties = { "token": api_token, "distinct_id": event.user_id, - "env": "open-source-v2" + "env": "open-source-v2", + "version": version, + "release": release } if not properties.is_empty(): standard_properties.merge(properties) diff --git a/mirror-godot-app/scripts/autoload/util_funcs.gd b/mirror-godot-app/scripts/autoload/util_funcs.gd index cea173fb..83e2bc75 100644 --- a/mirror-godot-app/scripts/autoload/util_funcs.gd +++ b/mirror-godot-app/scripts/autoload/util_funcs.gd @@ -105,6 +105,10 @@ static func current_platform_is_windows() -> bool: return get_current_platform_name() == WIN_NAME +static func get_release_name() -> String: + return "Horizon" + + static func get_simple_platform_name(os_name:String) -> String: var lower_os_name = os_name.to_lower() return PLATFORMS.get(lower_os_name, lower_os_name) diff --git a/mirror-godot-app/ui/global_version_label/version_label.gd b/mirror-godot-app/ui/global_version_label/version_label.gd index a2f58c34..34a65109 100644 --- a/mirror-godot-app/ui/global_version_label/version_label.gd +++ b/mirror-godot-app/ui/global_version_label/version_label.gd @@ -10,9 +10,10 @@ func _ready(): ## Sets the version label to the parsed version string. func _set_version_label() -> void: var version := Util.get_version_string() + var release := Util.get_release_name() text = ' '.join([ text, - _release_name(version), + release, "v%s-%s" % [ version, ProjectSettings.get_setting("mirror/env_name") @@ -20,6 +21,3 @@ func _set_version_label() -> void: ]) if ProjectSettings.get_setting("feature_flags/large_text_size", false): add_theme_font_size_override(&"font_size", 22) - -func _release_name(version) -> String: - return "Gravity"