impr: Upper case pattern data export options

This commit is contained in:
WerWolv 2023-06-21 17:49:03 +02:00
parent da11c47693
commit 3fe6cd057b
1 changed files with 7 additions and 2 deletions

View File

@ -1057,11 +1057,16 @@ namespace hex::plugin::builtin::ui {
ImGui::SetNextWindowPos(ImGui::GetWindowPos() + ImVec2(startPos.x, ImGui::GetCursorPosY()));
if (ImGui::BeginPopup("ExportPatterns")) {
for (const auto &formatter : this->m_formatters) {
const auto &name = formatter->getName();
const auto name = [&]{
auto name = formatter->getName();
std::transform(name.begin(), name.end(), name.begin(), [](char c){ return char(std::toupper(c)); });
return name;
}();
const auto &extension = formatter->getFileExtension();
if (ImGui::MenuItem(name.c_str())) {
fs::openFileBrowser(fs::DialogMode::Save, { { name.c_str(), extension.c_str() } }, [&](const std::fs::path &path) {
auto result = formatter->format(*runtime);