mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-08 13:33:42 +08:00
2b4d050e9c
* cabana: fix video startup and desktop interactions * cabana: remove util comments
30 lines
775 B
C++
30 lines
775 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
#include "imgui_internal.h"
|
|
|
|
// Dims the window and shows each widget's whatsThis text at its center; any click closes it.
|
|
// The texts are rich text: <b>, <br />, <span style="color:..;background-color:..">, &entities; and #rrggbb
|
|
// tokens (the video legend) are rendered, everything else is ignored.
|
|
class HelpOverlay {
|
|
public:
|
|
void toggle();
|
|
bool visible() const { return visible_; }
|
|
// collected while the widgets draw, consumed by draw()
|
|
void add(const std::string &text, const ImRect &rect);
|
|
void draw();
|
|
|
|
private:
|
|
struct Entry {
|
|
std::string text;
|
|
ImRect rect;
|
|
ImGuiViewport *viewport;
|
|
};
|
|
std::vector<Entry> texts_;
|
|
bool visible_ = false;
|
|
int opened_frame_ = -1;
|
|
};
|