Added support to GuiSettings to change the menu size and to specifically set the cursor to a row when adding it.

This commit is contained in:
Leon Styhre 2021-08-22 15:20:10 +02:00
parent a0c2c21a99
commit 7b111807ae

View file

@ -22,7 +22,10 @@ public:
virtual ~GuiSettings();
void save();
void addRow(const ComponentListRow& row) { mMenu.addRow(row); }
void addRow(const ComponentListRow& row, bool setCursorHere = false)
{
mMenu.addRow(row, setCursorHere);
}
void addWithLabel(const std::string& label, const std::shared_ptr<GuiComponent>& comp)
{
mMenu.addWithLabel(label, comp);
@ -34,6 +37,11 @@ public:
bool isPassword = false);
void addSaveFunc(const std::function<void()>& func) { mSaveFuncs.push_back(func); }
glm::vec2 getMenuSize() { return mMenu.getSize(); }
void setMenuSize(glm::vec2 size) { mMenu.setSize(size); }
glm::vec3 getMenuPosition() { return mMenu.getPosition(); }
void setMenuPosition(glm::vec3 position) { mMenu.setPosition(position); }
void setNeedsSaving(bool state = true) { mNeedsSaving = state; }
void setNeedsReloadHelpPrompts() { mNeedsReloadHelpPrompts = true; }
void setNeedsCollectionsUpdate() { mNeedsCollectionsUpdate = true; }