Use new ctor to avoid verbose LocalizedText creation

This commit is contained in:
SweetId 2023-10-21 10:17:29 -04:00
parent 77d4c747ef
commit f2790e45ad
6 changed files with 14 additions and 14 deletions

View File

@ -3,7 +3,7 @@
namespace NzEditor namespace NzEditor
{ {
AssetsWindow::AssetsWindow(Nz::EditorBaseApplication* app) AssetsWindow::AssetsWindow(Nz::EditorBaseApplication* app)
: Nz::EditorWindow(app, Nz::LocalizedText("LOC_EDITOR_WINDOW_ASSET_BROWSER_TITLE"), { "Assets" }) : Nz::EditorWindow(app, "LOC_EDITOR_WINDOW_ASSET_BROWSER_TITLE", { "Assets" })
{ {
BuildMenuBar(); BuildMenuBar();
} }
@ -15,6 +15,6 @@ namespace NzEditor
void AssetsWindow::BuildMenuBar() void AssetsWindow::BuildMenuBar()
{ {
AddMenuAction("Import", "Ctrl+I", [this]() { ImportAsset(); }); AddMenuAction({ "LOC_EDITOR_MENU_IMPORT" }, "Ctrl+I", [this]() { ImportAsset(); });
} }
} }

View File

@ -5,7 +5,7 @@
namespace NzEditor namespace NzEditor
{ {
InspectorWindow::InspectorWindow(Nz::EditorBaseApplication* app) InspectorWindow::InspectorWindow(Nz::EditorBaseApplication* app)
: Nz::EditorWindow(app, Nz::LocalizedText("LOC_EDITOR_WINDOW_INSPECTOR_TITLE")) : Nz::EditorWindow(app, "LOC_EDITOR_WINDOW_INSPECTOR_TITLE")
{ {
app->OnEntitySelected.Connect(this, &InspectorWindow::OnEntitySelected); app->OnEntitySelected.Connect(this, &InspectorWindow::OnEntitySelected);
} }

View File

@ -6,7 +6,7 @@
namespace NzEditor namespace NzEditor
{ {
LevelWindow::LevelWindow(Nz::EditorBaseApplication* app) LevelWindow::LevelWindow(Nz::EditorBaseApplication* app)
: Nz::EditorWindow(app, Nz::LocalizedText("LOC_EDITOR_WINDOW_LEVEL_TITLE")) : Nz::EditorWindow(app, "LOC_EDITOR_WINDOW_LEVEL_TITLE")
, m_currentLevel(app->GetLevel()) , m_currentLevel(app->GetLevel())
, m_dirty(true) , m_dirty(true)
{ {

View File

@ -3,7 +3,7 @@
namespace NzEditor namespace NzEditor
{ {
MainWindow::MainWindow(Nz::EditorBaseApplication* app) MainWindow::MainWindow(Nz::EditorBaseApplication* app)
: Nz::EditorMainWindow(app, Nz::LocalizedText("LOC_EDITOR_WINDOW_MAIN_TITLE"), { "General", "Plugins" }) : Nz::EditorMainWindow(app, "LOC_EDITOR_WINDOW_MAIN_TITLE", { "General", "Tools", "Plugins" })
{ {
} }
} }

View File

@ -6,7 +6,7 @@
namespace NzEditor namespace NzEditor
{ {
OutputWindow::OutputWindow(Nz::EditorBaseApplication* app) OutputWindow::OutputWindow(Nz::EditorBaseApplication* app)
: Nz::EditorWindow(app, Nz::LocalizedText("LOC_EDITOR_WINDOW_OUTPUT_TITLE"), { "Output" }) : Nz::EditorWindow(app, "LOC_EDITOR_WINDOW_OUTPUT_TITLE", { "Output" })
, m_bScrollToBottom(true) , m_bScrollToBottom(true)
, m_bScrollToTop(false) , m_bScrollToTop(false)
{ {

View File

@ -52,25 +52,25 @@ int WinMain(int argc, char* argv[])
texParams.loadFormat = Nz::PixelFormat::RGBA8_SRGB; texParams.loadFormat = Nz::PixelFormat::RGBA8_SRGB;
app.RegisterAction<Nz::EditorAction_Level_New>({ app.RegisterAction<Nz::EditorAction_Level_New>({
.description = Nz::LocalizedText("LOC_EDITOR_ACTION_LEVEL_NEW_DESC"), .description = "LOC_EDITOR_ACTION_LEVEL_NEW_DESC",
.path = Nz::LocalizedText("LOC_EDITOR_ACTION_LEVEL_NEW_PATH"), .path = { "LOC_EDITOR_MENU_FILE", "LOC_EDITOR_MENU_LEVEL", "LOC_EDITOR_MENU_NEW" },
.category = "General", .category = "General",
.shortcut = Nz::Shortcut::Create(Nz::Keyboard::VKey::N, true, true), .shortcut = Nz::Shortcut::Create(Nz::Keyboard::VKey::N, true, true),
.icon = Nz::Texture::LoadFromFile(app.GetResourceFolder() / "file_new.png", texParams) .icon = Nz::Texture::LoadFromFile(app.GetResourceFolder() / "file_new.png", texParams)
}); });
app.RegisterAction<Nz::EditorAction_Log_Clear>({ app.RegisterAction<Nz::EditorAction_Log_Clear>({
.description = Nz::LocalizedText("LOC_EDITOR_ACTION_LOG_CLEAR_DESC"), .description = "LOC_EDITOR_ACTION_LOG_CLEAR_DESC",
.path = Nz::LocalizedText("LOC_EDITOR_ACTION_LOG_CLEAR_PATH"), .path = { "LOC_EDITOR_MENU_LOG_CLEAR" },
.category = "Output", .category = "Output",
}); });
app.RegisterAction<Nz::EditorAction_Log_CopyToClipboard>({ app.RegisterAction<Nz::EditorAction_Log_CopyToClipboard>({
.description = Nz::LocalizedText("LOC_EDITOR_ACTION_LOG_COPY_DESC"), .description = "LOC_EDITOR_ACTION_LOG_COPY_DESC",
.path = Nz::LocalizedText("LOC_EDITOR_ACTION_LOG_COPY_PATH"), .path = { "LOC_EDITOR_MENU_LOG_COPY" },
.category = "Output", .category = "Output",
}); });
app.RegisterAction<Nz::EditorAction_Quit>({ app.RegisterAction<Nz::EditorAction_Quit>({
.description = Nz::LocalizedText("LOC_EDITOR_ACTION_QUIT_DESC"), .description = "LOC_EDITOR_ACTION_QUIT_DESC",
.path = Nz::LocalizedText("LOC_EDITOR_ACTION_QUIT_PATH"), .path = { "LOC_EDITOR_MENU_FILE", "LOC_EDITOR_MENU_QUIT" },
.category = "General", .category = "General",
.shortcut = Nz::Shortcut::Create(Nz::Keyboard::VKey::F4, false, false, true), .shortcut = Nz::Shortcut::Create(Nz::Keyboard::VKey::F4, false, false, true),
}); });