mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
Make File Dialogs less hacky
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
#include <hex/views/view.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <ImGuiFileBrowser.h>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hex { class SharedData; }
|
||||
@@ -59,6 +61,12 @@ namespace hex {
|
||||
static std::string errorPopupMessage;
|
||||
static std::list<ImHexApi::Bookmarks::Entry> bookmarkEntries;
|
||||
|
||||
static imgui_addons::ImGuiFileBrowser fileBrowser;
|
||||
static imgui_addons::ImGuiFileBrowser::DialogMode fileBrowserDialogMode;
|
||||
static std::string fileBrowserTitle;
|
||||
static std::string fileBrowserValidExtensions;
|
||||
static std::function<void(std::string)> fileBrowserCallback;
|
||||
|
||||
static int mainArgc;
|
||||
static char **mainArgv;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <hex.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <ImGuiFileBrowser.h>
|
||||
|
||||
#include <hex/api/event.hpp>
|
||||
|
||||
@@ -22,6 +23,7 @@ namespace hex {
|
||||
virtual void drawMenu();
|
||||
virtual bool handleShortcut(int key, int mods);
|
||||
|
||||
static void openFileBrowser(std::string title, imgui_addons::ImGuiFileBrowser::DialogMode mode, std::string validExtensions, const std::function<void(std::string)> &callback);
|
||||
static void doLater(std::function<void()> &&function);
|
||||
static std::vector<std::function<void()>>& getDeferedCalls();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user