mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
refactor: More init sequence refactors
This commit is contained in:
@@ -596,21 +596,25 @@ namespace hex::plugin::builtin {
|
||||
const auto infoBannerPath = defaultPath / "info_banner.png";
|
||||
if (wolv::io::fs::exists(infoBannerPath)) {
|
||||
s_infoBannerTexture = ImGuiExt::Texture(wolv::util::toUTF8String(infoBannerPath).c_str());
|
||||
break;
|
||||
} else {
|
||||
TaskManager::createBackgroundTask("Load banner", [](auto&) {
|
||||
HttpRequest request("GET", ImHexApiURL + std::string("/info_banner"));
|
||||
auto response = request.downloadFile().get();
|
||||
|
||||
if (response.isSuccess()) {
|
||||
const auto &data = response.getData();
|
||||
TaskManager::doLater([data] {
|
||||
s_infoBannerTexture = ImGuiExt::Texture(data.data(), data.size());
|
||||
});
|
||||
}
|
||||
});
|
||||
if (s_infoBannerTexture.isValid())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!s_infoBannerTexture.isValid()) {
|
||||
TaskManager::createBackgroundTask("Load banner", [](auto&) {
|
||||
HttpRequest request("GET", ImHexApiURL + std::string("/info_banner"));
|
||||
auto response = request.downloadFile().get();
|
||||
|
||||
if (response.isSuccess()) {
|
||||
const auto &data = response.getData();
|
||||
TaskManager::doLater([data] {
|
||||
s_infoBannerTexture = ImGuiExt::Texture(data.data(), data.size());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user