mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
feat: Added tutorials view
This commit is contained in:
@@ -101,6 +101,9 @@ namespace hex {
|
||||
|
||||
Step& addStep();
|
||||
|
||||
const std::string& getUnlocalizedName() const { return this->m_unlocalizedName; }
|
||||
const std::string& getUnlocalizedDescription() const { return this->m_unlocalizedDescription; }
|
||||
|
||||
private:
|
||||
friend class TutorialManager;
|
||||
|
||||
@@ -112,6 +115,17 @@ namespace hex {
|
||||
decltype(m_steps)::iterator m_currentStep, m_latestStep;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Gets a list of all tutorials
|
||||
* @return List of all tutorials
|
||||
*/
|
||||
static const std::map<std::string, Tutorial>& getTutorials();
|
||||
|
||||
/**
|
||||
* @brief Gets the currently running tutorial
|
||||
* @return Iterator pointing to the current tutorial
|
||||
*/
|
||||
static std::map<std::string, Tutorial>::iterator getCurrentTutorial();
|
||||
|
||||
/**
|
||||
* @brief Creates a new tutorial that can be started later
|
||||
|
||||
@@ -55,6 +55,16 @@ namespace hex {
|
||||
|
||||
}
|
||||
|
||||
|
||||
const std::map<std::string, TutorialManager::Tutorial>& TutorialManager::getTutorials() {
|
||||
return s_tutorials;
|
||||
}
|
||||
|
||||
std::map<std::string, TutorialManager::Tutorial>::iterator TutorialManager::getCurrentTutorial() {
|
||||
return s_currentTutorial;
|
||||
}
|
||||
|
||||
|
||||
TutorialManager::Tutorial& TutorialManager::createTutorial(const std::string& unlocalizedName, const std::string& unlocalizedDescription) {
|
||||
return s_tutorials.try_emplace(unlocalizedName, Tutorial(unlocalizedName, unlocalizedDescription)).first->second;
|
||||
}
|
||||
@@ -228,6 +238,8 @@ namespace hex {
|
||||
|
||||
if (m_parent->m_currentStep != m_parent->m_steps.end())
|
||||
m_parent->m_currentStep->addHighlights();
|
||||
else
|
||||
s_currentTutorial = s_tutorials.end();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user