Skip to content

Commit

Permalink
Metrics stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Caraxi committed Nov 22, 2023
1 parent 5b170e1 commit bf7cce7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Changelog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ internal static void AddGeneralChangelogs() {
.Sub("Categories can be disabled in settings.")
.Sub("The 'All Tweaks' pseudo-category displays all available tweaks.", 2)
.Sub("The 'Enabled Tweaks' pesudo-category displays only enabled tweaks.", 2);
Add(UnreleasedVersion, "Added optional metrics collection")
.Sub("Everyone will be given a chance to opt in or our to the collection of a list of enabled tweaks when first accessing the simple tweaks config window.")
.Sub("Anyone who preemptivly opted out will not see the notice as they already made the choice.")
.Sub("No information will be collected until the 'Allow collection' button is pressed.");
}

#if DEBUG
Expand Down
14 changes: 13 additions & 1 deletion ConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public override void Draw() {
"You may opt out of this collection now and no information will be sent. You may also choose to opt back in at a later date in the simple tweaks config.");


ImGui.Dummy(new Vector2(20));
ImGui.Dummy(new Vector2(20) * ImGuiHelpers.GlobalScale);

using (ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.2f, 0.7f, 0.3f, 0.8f)))
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.2f, 0.7f, 0.3f, 1f)))
Expand All @@ -60,6 +60,18 @@ public override void Draw() {

}

ImGui.Dummy(new Vector2(20) * ImGuiHelpers.GlobalScale);

ImGui.Separator();

ImGui.Dummy(new Vector2(20) * ImGuiHelpers.GlobalScale);

if (ImGui.Button("Open Changelog")) {
SimpleTweaksPlugin.Plugin.ChangelogWindow.IsOpen = true;
}



return;
}

Expand Down
2 changes: 1 addition & 1 deletion MetricsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void ParseTweakList(IEnumerable<BaseTweak> tweaks) {

#if DEBUG
if (ImGui.GetIO().KeyShift) {
payload.TweakNames.Add(t.Key, t.Name);
if (t is not SubTweakManager { AlwaysEnabled: true }) payload.TweakNames.Add(t.Key, t.Name);
}
#endif
if (t is SubTweakManager stm) {
Expand Down

0 comments on commit bf7cce7

Please sign in to comment.