1
0
mirror of synced 2025-01-18 17:14:13 +01:00

fix: Prevent exporting of zero-sized files to language arrays

This commit is contained in:
WerWolv 2023-11-12 00:25:37 +01:00
parent 3d04669ef0
commit 60e3a657f0

View File

@ -220,7 +220,7 @@ namespace hex::plugin::builtin {
void drawExportLanguageMenu() {
for (const auto &formatter : ContentRegistry::DataFormatter::impl::getEntries()) {
if (ImGui::MenuItem(LangEntry(formatter.unlocalizedName))) {
if (ImGui::MenuItem(LangEntry(formatter.unlocalizedName), nullptr, false, ImHexApi::Provider::get()->getActualSize() > 0)) {
fs::openFileBrowser(fs::DialogMode::Save, {}, [&formatter](const auto &path) {
TaskManager::createTask("Exporting data", TaskManager::NoProgress, [&formatter, path](auto&){
auto provider = ImHexApi::Provider::get();