When paused in simulate, add index of history scrubber if not 0.

PiperOrigin-RevId: 590184966
Change-Id: Id0914c41a1339cf71ebdea02ec486c52c3d37179
This commit is contained in:
Yuval Tassa
2023-12-12 06:42:40 -08:00
committed by Copybara-Service
parent 28a9e6d9a2
commit 35f095d7c5
+8 -1
View File
@@ -2476,7 +2476,14 @@ void Simulate::Render() {
// show pause/loading label
if (!this->run || this->loadrequest) {
const char* label = this->loadrequest ? "LOADING..." : "PAUSE";
char label[30] = {'\0'};
if (this->loadrequest) {
std::snprintf(label, sizeof(label), "LOADING...");
} if (this->scrub_index == 0) {
std::snprintf(label, sizeof(label), "PAUSE");
} else {
std::snprintf(label, sizeof(label), "PAUSE (%d)", this->scrub_index);
}
mjr_overlay(mjFONT_BIG, mjGRID_TOP, smallrect, label, nullptr,
&this->platform_ui->mjr_context());
}