mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
Make sure important data is synchronized between ImHex and plugins
This commit is contained in:
@@ -13,13 +13,13 @@ namespace hex {
|
||||
|
||||
ViewPatches::ViewPatches() : View("Patches") {
|
||||
View::subscribeEvent(Events::ProjectFileStore, [this](const void*) {
|
||||
auto provider = prv::Provider::getCurrentProvider();
|
||||
auto provider = *SharedData::get().currentProvider;
|
||||
if (provider != nullptr)
|
||||
ProjectFile::setPatches(provider->getPatches());
|
||||
});
|
||||
|
||||
View::subscribeEvent(Events::ProjectFileLoad, [this](const void*) {
|
||||
auto provider = prv::Provider::getCurrentProvider();
|
||||
auto provider = *SharedData::get().currentProvider;
|
||||
if (provider != nullptr)
|
||||
provider->getPatches() = ProjectFile::getPatches();
|
||||
});
|
||||
@@ -32,7 +32,7 @@ namespace hex {
|
||||
|
||||
void ViewPatches::drawContent() {
|
||||
if (ImGui::Begin("Patches", &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse)) {
|
||||
auto provider = prv::Provider::getCurrentProvider();
|
||||
auto provider = *SharedData::get().currentProvider;
|
||||
|
||||
if (provider != nullptr && provider->isReadable()) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user