From afb16f68d31560e57e2d2300ee35f25b089dc940 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 7 Oct 2026 21:10:36 +0200 Subject: [PATCH] Add a user manual achievement. --- profiler/CMakeLists.txt | 1 + profiler/src/achievements/ConnectToClient.md | 1 - profiler/src/achievements/Manual.md | 10 ++++++++++ profiler/src/main.cpp | 1 + profiler/src/profiler/TracyAchievementData.cpp | 8 ++++++++ profiler/src/profiler/TracyView.cpp | 1 + 6 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 profiler/src/achievements/Manual.md diff --git a/profiler/CMakeLists.txt b/profiler/CMakeLists.txt index 3c77457c..3cf72a94 100644 --- a/profiler/CMakeLists.txt +++ b/profiler/CMakeLists.txt @@ -214,6 +214,7 @@ Embed(PROFILER_FILES TextInstrumentationStatistics src/achievements/Instrumentat Embed(PROFILER_FILES TextInstrumentFrames src/achievements/InstrumentFrames.md TEXT) Embed(PROFILER_FILES TextIntro src/achievements/Intro.md TEXT) Embed(PROFILER_FILES TextLoadTrace src/achievements/LoadTrace.md TEXT) +Embed(PROFILER_FILES TextManual src/achievements/Manual.md TEXT) Embed(PROFILER_FILES TextSamplingIntro src/achievements/SamplingIntro.md TEXT) Embed(PROFILER_FILES TextSaveTrace src/achievements/SaveTrace.md TEXT) diff --git a/profiler/src/achievements/ConnectToClient.md b/profiler/src/achievements/ConnectToClient.md index 32dd405e..b15c3576 100644 --- a/profiler/src/achievements/ConnectToClient.md +++ b/profiler/src/achievements/ConnectToClient.md @@ -7,4 +7,3 @@ Let's start our adventure by instrumenting your application and connecting it to 3. Define `TRACY_ENABLE` in your build configuration, for the whole application. Do not do it in a single source file because it won't work. 4. Start your application, and * Connect* to it with the profiler. -Please refer to the [user manual](https://github.com/wolfpld/tracy/releases) for more details. diff --git a/profiler/src/achievements/Manual.md b/profiler/src/achievements/Manual.md new file mode 100644 index 00000000..303a1e8f --- /dev/null +++ b/profiler/src/achievements/Manual.md @@ -0,0 +1,10 @@ +# Read the manual + +Tracy ships with a built-in user manual that describes all of its features. You can open it by clicking the * Manual* icon in the top toolbar of the profiler window. + +It's an alternative to external documentation — always available offline, and it covers everything from basic instrumentation to advanced sampling and memory profiling. + +> [!TIP] +> **Tip** +> +> When you're unsure how to do something, the manual is the quickest way to find out. Keep it handy while you explore. diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index c7dd9a16..e53f8f13 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -810,6 +810,7 @@ static void DrawContents() if( ImGui::Button( ICON_FA_BOOK " Manual" ) ) { s_manualWindow.Show() = true; + if( tracy::s_config.achievements ) s_achievements->Achieve( "manual" ); } ImGui::SameLine(); if( ImGui::Button( ICON_FA_EARTH_AMERICAS " Web" ) ) diff --git a/profiler/src/profiler/TracyAchievementData.cpp b/profiler/src/profiler/TracyAchievementData.cpp index 2b9dc165..51c9bb0f 100644 --- a/profiler/src/profiler/TracyAchievementData.cpp +++ b/profiler/src/profiler/TracyAchievementData.cpp @@ -11,6 +11,7 @@ #include "data/TextInstrumentationStatistics.hpp" #include "data/TextIntro.hpp" #include "data/TextLoadTrace.hpp" +#include "data/TextManual.hpp" #include "data/TextSamplingIntro.hpp" #include "data/TextSaveTrace.hpp" @@ -130,9 +131,16 @@ AchievementItem ai_globalSettings = { .text = Unpack( TextGlobalSettings ) }; +AchievementItem ai_manual = { + .id = "manual", + .name = "Read the manual", + .text = Unpack( TextManual ) +}; + AchievementItem* ac_achievementsIntroItems[] = { &ai_connectToServer, &ai_globalSettings, + &ai_manual, nullptr }; diff --git a/profiler/src/profiler/TracyView.cpp b/profiler/src/profiler/TracyView.cpp index 06f9fbbb..99a454ac 100644 --- a/profiler/src/profiler/TracyView.cpp +++ b/profiler/src/profiler/TracyView.cpp @@ -769,6 +769,7 @@ bool View::DrawImpl() if( m_worker.GetZoneCount() > 100 * 1000 * 1000 ) Achieve( "100million" ); if( m_worker.GetCallstackSampleCount() > 0 ) Achieve( "samplingIntro" ); if( m_worker.AreFramesUsed() ) Achieve( "instrumentFrames" ); + if( m_manualWindow.Show() ) Achieve( "manual" ); } Attention( m_attnWorking );