Add a time range achievement.

This commit is contained in:
Bartosz Taudul
2026-11-04 01:29:15 +01:00
parent f86bdf7bb1
commit 02a825b393
4 changed files with 22 additions and 1 deletions
+1
View File
@@ -248,6 +248,7 @@ Embed(PROFILER_FILES TextSamplingIntro src/achievements/SamplingIntro.md TEXT)
Embed(PROFILER_FILES TextSamplingStats src/achievements/SamplingStats.md TEXT)
Embed(PROFILER_FILES TextSaveTrace src/achievements/SaveTrace.md TEXT)
Embed(PROFILER_FILES TextSurviveCrash src/achievements/SurviveCrash.md TEXT)
Embed(PROFILER_FILES TextTimeRanges src/achievements/TimeRanges.md TEXT)
Embed(PROFILER_FILES TextWaitStacks src/achievements/WaitStacks.md TEXT)
Embed(PROFILER_FILES TextZoneCallstacks src/achievements/ZoneCallstacks.md TEXT)
Embed(PROFILER_FILES TextSections src/achievements/Sections.md TEXT)
+9
View File
@@ -0,0 +1,9 @@
# Set a time range
Statistics cover the whole capture by default. A [time range](#timeranges) limits a window to one part of the run.
To mark a range, hold Ctrl and drag over the timeline. The menu that opens applies the range to one of six windows: Find zone, Statistics, Flame graph, Wait stacks, Memory, Frame statistics. Right-clicking a zone, section or frame opens the same menu with that item's extent.
You can adjust a range by dragging its edges. The [Time range limits](#timerangelimits) window, under the * Tools* menu, lists all ranges.
Try it out: Ctrl-drag a part of your capture, pick Statistics from the menu, and compare the numbers with the full capture.
+11 -1
View File
@@ -46,6 +46,7 @@
#include "data/TextSections.hpp"
#include "data/TextSaveTrace.hpp"
#include "data/TextSurviveCrash.hpp"
#include "data/TextTimeRanges.hpp"
#include "data/TextWaitStacks.hpp"
#include "data/TextZoneCallstacks.hpp"
@@ -228,10 +229,19 @@ AchievementItem ai_readSource = {
.items = ac_readSourceItems
};
AchievementItem ai_timeRanges = {
.id = "timeRanges",
.name = "Set a time range",
.text = Unpack( TextTimeRanges )
};
AchievementItem* ac_annotationsItems[] = { &ai_timeRanges, nullptr };
AchievementItem ai_annotations = {
.id = "annotations",
.name = "Annotate the timeline",
.text = Unpack( TextAnnotations )
.text = Unpack( TextAnnotations ),
.items = ac_annotationsItems
};
AchievementItem* ac_lightFlameItems[] = { &ai_annotations, nullptr };
+1
View File
@@ -1261,6 +1261,7 @@ bool View::DrawImpl()
{
if( ImGui::Selectable( r.name ) )
{
if( s_config.achievements ) Achieve( "timeRanges" );
r.range->active = true;
r.range->min = s;
r.range->max = e;