Hopefully fixed the whole plugin mess I started

This commit is contained in:
WerWolv
2021-01-12 23:28:41 +01:00
parent 8ae15abb85
commit dc85616549
27 changed files with 137 additions and 173 deletions

View File

@@ -13,13 +13,13 @@ namespace hex {
ViewPatches::ViewPatches() : View("Patches") {
View::subscribeEvent(Events::ProjectFileStore, [this](const void*) {
auto provider = *SharedData::get().currentProvider;
auto provider = SharedData::currentProvider;
if (provider != nullptr)
ProjectFile::setPatches(provider->getPatches());
});
View::subscribeEvent(Events::ProjectFileLoad, [this](const void*) {
auto provider = *SharedData::get().currentProvider;
auto provider = SharedData::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 = *SharedData::get().currentProvider;
auto provider = SharedData::currentProvider;
if (provider != nullptr && provider->isReadable()) {