mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
feat: Added basic introduction tutorial
This commit is contained in:
@@ -32,7 +32,10 @@
|
||||
|
||||
/* Forward declarations */
|
||||
struct GLFWwindow;
|
||||
namespace hex { class Achievement; }
|
||||
namespace hex {
|
||||
class Achievement;
|
||||
class View;
|
||||
}
|
||||
|
||||
|
||||
namespace hex {
|
||||
@@ -248,6 +251,7 @@ namespace hex {
|
||||
EVENT_DEF(EventImHexClosing);
|
||||
EVENT_DEF(EventAchievementUnlocked, const Achievement&);
|
||||
EVENT_DEF(EventSearchBoxClicked);
|
||||
EVENT_DEF(EventViewOpened, View*);
|
||||
|
||||
EVENT_DEF(EventProviderDataModified, prv::Provider *, u64, u64, const u8*);
|
||||
EVENT_DEF(EventProviderDataInserted, prv::Provider *, u64, u64);
|
||||
@@ -269,6 +273,7 @@ namespace hex {
|
||||
EVENT_DEF(RequestAddBookmark, Region, std::string, std::string, color_t, u64*);
|
||||
EVENT_DEF(RequestRemoveBookmark, u64);
|
||||
EVENT_DEF(RequestSetPatternLanguageCode, std::string);
|
||||
EVENT_DEF(RequestRunPatternCode);
|
||||
EVENT_DEF(RequestLoadPatternLanguageFile, std::fs::path);
|
||||
EVENT_DEF(RequestSavePatternLanguageFile, std::fs::path);
|
||||
EVENT_DEF(RequestUpdateWindowTitle);
|
||||
|
||||
@@ -61,6 +61,9 @@ namespace hex {
|
||||
*/
|
||||
Step& allowSkip();
|
||||
|
||||
Step& onAppear(std::function<void()> callback);
|
||||
Step& onComplete(std::function<void()> callback);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Checks if this step is the current step
|
||||
@@ -76,7 +79,7 @@ namespace hex {
|
||||
private:
|
||||
struct Highlight {
|
||||
std::string unlocalizedText;
|
||||
ImGuiID highlightId;
|
||||
std::vector<std::variant<Lang, std::string, int>> highlightIds;
|
||||
};
|
||||
|
||||
struct Message {
|
||||
@@ -97,6 +100,7 @@ namespace hex {
|
||||
Tutorial *m_parent;
|
||||
std::vector<Highlight> m_highlights;
|
||||
std::optional<Message> m_message;
|
||||
std::function<void()> m_onAppear, m_onComplete;
|
||||
};
|
||||
|
||||
Step& addStep();
|
||||
|
||||
@@ -92,6 +92,8 @@ namespace hex {
|
||||
[[nodiscard]] bool didWindowJustOpen();
|
||||
void setWindowJustOpened(bool state);
|
||||
|
||||
void trackViewOpenState();
|
||||
|
||||
static void discardNavigationRequests();
|
||||
|
||||
[[nodiscard]] static std::string toWindowName(const std::string &unlocalizedName);
|
||||
@@ -104,7 +106,7 @@ namespace hex {
|
||||
|
||||
private:
|
||||
std::string m_unlocalizedViewName;
|
||||
bool m_windowOpen = false;
|
||||
bool m_windowOpen = false, m_prevWindowOpen = false;
|
||||
std::map<Shortcut, ShortcutManager::ShortcutEntry> m_shortcuts;
|
||||
bool m_windowJustOpened = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user