mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
Added Footer and API for it and the welcome screen
This commit is contained in:
@@ -37,6 +37,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.welcome.learn.plugins.title", "Plugins API\"" },
|
||||
{ "hex.welcome.learn.plugins.desc", "Extend ImHex with additional features using plugins" },
|
||||
{ "hex.welcome.learn.plugins.link", "https://github.com/WerWolv/ImHex/wiki/Plugins-Development-Guide" },
|
||||
{ "hex.welcome.header.various", "Various" },
|
||||
|
||||
{ "hex.common.little_endian", "Little Endian" },
|
||||
{ "hex.common.big_endian", "Big Endian" },
|
||||
|
||||
@@ -183,6 +183,16 @@ namespace hex {
|
||||
static std::map<std::string, std::string>& getLanguages();
|
||||
static std::map<std::string, std::vector<LanguageDefinition>>& getLanguageDefinitions();
|
||||
};
|
||||
|
||||
struct Interface {
|
||||
using DrawCallback = std::function<void()>;
|
||||
|
||||
static void addWelcomeScreenEntry(const DrawCallback &function);
|
||||
static void addFooterItem(const DrawCallback &function);
|
||||
|
||||
static std::vector<DrawCallback>& getWelcomeScreenEntries();
|
||||
static std::vector<DrawCallback>& getFooterItems();
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -68,6 +68,9 @@ namespace hex {
|
||||
static std::map<std::string, std::vector<LanguageDefinition>> languageDefinitions;
|
||||
static std::map<std::string, std::string> loadedLanguageStrings;
|
||||
|
||||
static std::vector<ContentRegistry::Interface::DrawCallback> welcomeScreenEntries;
|
||||
static std::vector<ContentRegistry::Interface::DrawCallback> footerItems;
|
||||
|
||||
static imgui_addons::ImGuiFileBrowser fileBrowser;
|
||||
static imgui_addons::ImGuiFileBrowser::DialogMode fileBrowserDialogMode;
|
||||
static std::string fileBrowserTitle;
|
||||
|
||||
@@ -225,4 +225,21 @@ namespace hex {
|
||||
std::map<std::string, std::vector<LanguageDefinition>>& ContentRegistry::Language::getLanguageDefinitions() {
|
||||
return SharedData::languageDefinitions;
|
||||
}
|
||||
|
||||
|
||||
void ContentRegistry::Interface::addWelcomeScreenEntry(const ContentRegistry::Interface::DrawCallback &function) {
|
||||
getWelcomeScreenEntries().push_back(function);
|
||||
}
|
||||
|
||||
void ContentRegistry::Interface::addFooterItem(const ContentRegistry::Interface::DrawCallback &function){
|
||||
getFooterItems().push_back(function);
|
||||
}
|
||||
|
||||
|
||||
std::vector<ContentRegistry::Interface::DrawCallback>& ContentRegistry::Interface::getWelcomeScreenEntries() {
|
||||
return SharedData::welcomeScreenEntries;
|
||||
}
|
||||
std::vector<ContentRegistry::Interface::DrawCallback>& ContentRegistry::Interface::getFooterItems() {
|
||||
return SharedData::footerItems;
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,9 @@ namespace hex {
|
||||
std::map<std::string, std::vector<LanguageDefinition>> SharedData::languageDefinitions;
|
||||
std::map<std::string, std::string> SharedData::loadedLanguageStrings;
|
||||
|
||||
std::vector<ContentRegistry::Interface::DrawCallback> SharedData::welcomeScreenEntries;
|
||||
std::vector<ContentRegistry::Interface::DrawCallback> SharedData::footerItems;
|
||||
|
||||
imgui_addons::ImGuiFileBrowser SharedData::fileBrowser;
|
||||
imgui_addons::ImGuiFileBrowser::DialogMode SharedData::fileBrowserDialogMode;
|
||||
std::string SharedData::fileBrowserTitle;
|
||||
|
||||
Reference in New Issue
Block a user