chore: Refactor file_dialog.cc and file_dialog.h to use namespace aliases

This commit is contained in:
scawful
2024-08-13 23:56:17 -04:00
parent e72ae83d48
commit 9bbb6c6114
10 changed files with 38 additions and 17 deletions

View File

@@ -1,7 +1,6 @@
#include "assembly_editor.h"
#include "ImGuiColorTextEdit/TextEditor.h"
#include "app/core/platform/file_dialog.h"
#include "app/gui/icons.h"
#include "app/gui/input.h"
@@ -11,6 +10,8 @@ namespace yaze {
namespace app {
namespace editor {
using core::FileDialogWrapper;
namespace {
std::vector<std::string> RemoveIgnoredFiles(

View File

@@ -46,7 +46,7 @@ struct MemoryEditorWithDiffChecker : public SharedRom {
static Rom comparison_rom;
ImGui::Begin("Hex Editor", &show_memory_editor);
if (ImGui::Button("Compare Rom")) {
auto file_name = FileDialogWrapper::ShowOpenFileDialog();
auto file_name = core::FileDialogWrapper::ShowOpenFileDialog();
PRINT_IF_ERROR(comparison_rom.LoadFromFile(file_name));
show_compare_rom = true;
}

View File

@@ -39,6 +39,7 @@ namespace app {
namespace editor {
using namespace ImGui;
using core::FileDialogWrapper;
namespace {
@@ -484,8 +485,8 @@ void EditorManager::DrawYazeMenuBar() {
}
if (MenuItem("Open Project")) {
// Open an existing project
status_ =
current_project_.Open(FileDialogWrapper::ShowOpenFileDialog());
status_ = current_project_.Open(
core::FileDialogWrapper::ShowOpenFileDialog());
if (status_.ok()) {
status_ = OpenProject();
}

View File

@@ -370,10 +370,10 @@ absl::Status GraphicsEditor::UpdatePaletteColumn() {
RETURN_IF_ERROR(
rom()
->mutable_gfx_sheets()
->at(current_sheet_)
->data()[current_sheet_]
.ApplyPaletteWithTransparent(palette, edit_palette_sub_index_));
Renderer::GetInstance().UpdateBitmap(
&rom()->mutable_gfx_sheets()->at(current_sheet_), true);
&rom()->mutable_gfx_sheets()->data()[current_sheet_], true);
refresh_graphics_ = false;
}
}

View File

@@ -243,7 +243,7 @@ void SpriteEditor::DrawCustomSpritesMetadata() {
// ZSprite Maker format open file dialog
if (ImGui::Button("Open ZSprite")) {
// Open ZSprite file
std::string file_path = FileDialogWrapper::ShowOpenFileDialog();
std::string file_path = core::FileDialogWrapper::ShowOpenFileDialog();
if (!file_path.empty()) {
zsprite::ZSprite zsprite;
status_ = zsprite.Load(file_path);