17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 10:29:13 +01:00

feat(editor): the node bank in two panes, as the assets of unity: its groups on the left with the scenery templates, the entries of the chosen one on the right, as cards or a list, a search going through all of them; the models dragged from the node bank onto a model set, the templates of a set or the list of the brush or the area fill; the templates of the model sets shown with their previews; the model sets docked by the node bank by default; Polish translation

This commit is contained in:
2026-10-09 12:01:00 +02:00
parent 645a54a739
commit 1bf687b4c9
4 changed files with 379 additions and 130 deletions

View File

@@ -166,6 +166,18 @@ class nodebank_panel : public ui_panel
void index_previews();
// entries of a group as cards with their previews, in rows as many as fit the width
void render_cards(std::vector<std::pair<std::string, std::shared_ptr<std::string>> const *> const &Entries);
// the same entries as a list, for when the previews are off
void render_list(std::vector<std::pair<std::string, std::shared_ptr<std::string>> const *> const &Entries);
// the scenery templates (.inc), as a list; they're placed with include directives, so they take a scenery opened for editing
void render_templates_list(std::string const &Filter);
// the entry dragged from the item drawn last, to drop it on a list of the model sets or of a tool
void drag_entry(std::pair<std::string, std::shared_ptr<std::string>> const &Entry);
// image of a node definition as the node bank has it, or an empty string
std::string const &template_preview(std::string const &Template) const;
// texture of the small preview of the image, 0 if there's none (yet)
std::uint64_t preview_texture(std::string const &Path, char const *&Placeholder);
// the templates of the edited model set as cards with their previews
void render_set_cards(int const Setid);
// the entry pointed at for a moment: a popup with its preview, big, and the model and skin it shows
void preview_popup(std::pair<std::string, std::shared_ptr<std::string>> const &Entry);
// true if the node bank selection is a definition of a node, which the hand-made lists and the model sets can take
@@ -179,6 +191,10 @@ class nodebank_panel : public ui_panel
std::unique_ptr<editor_previews::image_cache> m_previews;
std::unique_ptr<editor_previews::image_cache> m_largepreviews; // a few, for the popup
bool m_previewfolder{false}; // the generator was run, there's the folder of the images
std::unordered_map<std::string, std::string> m_templatepreviews; // images of the node definitions by their text, for the model sets
// the group of the node bank shown, by its place among the groups; scenery_templates for the scenery templates
static int constexpr scenery_templates{-1};
int m_category{0};
// set manager window
bool m_setsopen{false};
int m_setsselected{0}; // id of the user set being edited