path is now a vector of localized strings

This commit is contained in:
SweetId
2023-10-21 10:22:44 -04:00
parent f2790e45ad
commit da21340331
3 changed files with 17 additions and 21 deletions

View File

@@ -19,7 +19,7 @@ namespace Nz
{
std::string className;
Nz::LocalizedText description;
Nz::LocalizedText path;
std::vector<Nz::LocalizedText> path;
std::string category;
Nz::Shortcut shortcut;

View File

@@ -23,8 +23,8 @@ namespace Nz
virtual void OnRenderImgui() override;
void AddMenuAction(const std::string& path, const std::string& shortcut, ActionCallback callback, const std::shared_ptr<Nz::Texture>& icon = {});
void AddMenuSeparator(const std::string& path);
void AddMenuAction(const std::vector<Nz::LocalizedText>& path, const std::string& shortcut, ActionCallback callback, const std::shared_ptr<Nz::Texture>& icon = {});
void AddMenuSeparator(const std::vector<Nz::LocalizedText>& path);
EditorBaseApplication* GetApplication() { return m_application; }
const EditorBaseApplication* GetApplication() const { return m_application; }
@@ -46,7 +46,7 @@ namespace Nz
struct MenuAction
{
std::string label;
Nz::LocalizedText label;
std::string shortcut;
std::shared_ptr<Nz::Texture> icon;
ActionCallback callback;
@@ -57,12 +57,12 @@ namespace Nz
struct MenuList
{
std::string label;
Nz::LocalizedText label;
std::vector<std::variant<MenuAction, MenuSeparator, MenuList>> entries;
};
MenuList m_root;
MenuList& GetOrCreateMenuHierarchy(const std::vector<std::string_view>& hierarchy);
MenuList& GetOrCreateMenuHierarchy(const std::vector<Nz::LocalizedText>& hierarchy);
};
}