From d2e995478e57afe1664159e487f7a9b42345e9ac Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 7 Jun 2024 22:47:56 +0200 Subject: [PATCH] Add initial achievements data. --- profiler/CMakeLists.txt | 1 + .../src/profiler/TracyAchievementData.cpp | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 profiler/src/profiler/TracyAchievementData.cpp diff --git a/profiler/CMakeLists.txt b/profiler/CMakeLists.txt index 8cdb5449..07d86b48 100644 --- a/profiler/CMakeLists.txt +++ b/profiler/CMakeLists.txt @@ -22,6 +22,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../cmake/server.cmake) set(SERVER_FILES + TracyAchievementData.cpp TracyAchievements.cpp TracyBadVersion.cpp TracyColor.cpp diff --git a/profiler/src/profiler/TracyAchievementData.cpp b/profiler/src/profiler/TracyAchievementData.cpp new file mode 100644 index 00000000..6ccafe00 --- /dev/null +++ b/profiler/src/profiler/TracyAchievementData.cpp @@ -0,0 +1,44 @@ +#include "IconsFontAwesome6.h" +#include "TracyAchievements.hpp" +#include "TracyImGui.hpp" +#include "TracyWeb.hpp" + +namespace tracy::data +{ + +AchievementItem ai_connectToServer = { "connectToClient", "First profiling session", [](const ctx&){ + ImGui::TextWrapped( "Let's start our adventure by instrumenting your application and connecting it to the profiler. Here's a quick refresher:" ); + ImGui::TextWrapped( " 1. Integrate Tracy Profiler into your application. This can be done using CMake, Meson, or simply by adding the source files to your project." ); + ImGui::TextWrapped( " 2. Make sure that TracyClient.cpp (or the Tracy library) is included in your build." ); + ImGui::TextWrapped( " 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." ); + ImGui::TextWrapped( " 4. Start your application, and connect to it with the profiler." ); + ImGui::TextWrapped( "Please refer to the user manual for more details." ); + if( ImGui::SmallButton( "Download the user manual" ) ) + { + tracy::OpenWebpage( "https://github.com/wolfpld/tracy/releases" ); + } +} }; + +AchievementItem* ac_achievementsIntroItems[] = { + &ai_connectToServer, + nullptr +}; + +AchievementItem ai_achievementsIntro = { "achievementsIntro", "Click here to discover achievements!", [](const ctx&){ + ImGui::TextWrapped( "Clicking on the " ICON_FA_STAR " button opens the Achievements List. Here you can see the tasks to be completed along with a short description of what needs to be done." ); + ImGui::TextWrapped( "As you complete each Achievement, new Achievements will appear, so be sure to keep checking the list for new ones!" ); + ImGui::TextUnformatted( "New tasks:" ); + ImGui::SameLine(); + TextColoredUnformatted( 0xFF4488FF, ICON_FA_CIRCLE_EXCLAMATION ); + ImGui::TextUnformatted( "Completed tasks:" ); + ImGui::SameLine(); + TextColoredUnformatted( 0xFF44FF44, ICON_FA_CIRCLE_CHECK ); + ImGui::TextWrapped( "Good luck!" ); +}, ac_achievementsIntroItems, true, 1 }; + +AchievementItem* ac_firstStepsItems[] = { &ai_achievementsIntro, nullptr }; +AchievementCategory ac_firstSteps = { "firstSteps", "First steps", ac_firstStepsItems, 1 }; + +AchievementCategory* AchievementCategories[] = { &ac_firstSteps, nullptr }; + +}