mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-18 02:45:21 +02:00
TouchScreenGUI: Show status text above grid menu
This commit is contained in:
@@ -412,6 +412,10 @@ TouchControls::TouchControls(IrrlichtDevice *device, ISimpleTextureSource *tsrc)
|
||||
|
||||
pos.X += spacing.X;
|
||||
}
|
||||
|
||||
m_status_text = grab_gui_element<IGUIStaticText>(
|
||||
m_guienv->addStaticText(L"", recti(), false, false));
|
||||
m_status_text->setVisible(false);
|
||||
}
|
||||
|
||||
void TouchControls::addButton(std::vector<button_info> &buttons, touch_gui_button_id id,
|
||||
|
@@ -177,6 +177,9 @@ public:
|
||||
void registerHotbarRect(u16 index, const recti &rect);
|
||||
std::optional<u16> getHotbarSelection();
|
||||
|
||||
bool isStatusTextOverriden() { return m_overflow_open; }
|
||||
IGUIStaticText *getStatusText() { return m_status_text.get(); }
|
||||
|
||||
private:
|
||||
IrrlichtDevice *m_device = nullptr;
|
||||
IGUIEnvironment *m_guienv = nullptr;
|
||||
@@ -235,6 +238,8 @@ private:
|
||||
std::vector<std::shared_ptr<IGUIStaticText>> m_overflow_button_titles;
|
||||
std::vector<recti> m_overflow_button_rects;
|
||||
|
||||
std::shared_ptr<IGUIStaticText> m_status_text;
|
||||
|
||||
void toggleOverflowMenu();
|
||||
void updateVisibility();
|
||||
void releaseAll();
|
||||
|
Reference in New Issue
Block a user