mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-25 09:26:37 +00:00
Initialize inventory tabs in a loop
This commit is contained in:
parent
582b409f7f
commit
23e3d0b49a
1 changed files with 7 additions and 15 deletions
|
|
@ -14,22 +14,14 @@ namespace MWGui
|
||||||
: WindowBase("openmw_inventory_tabs.layout")
|
: WindowBase("openmw_inventory_tabs.layout")
|
||||||
{
|
{
|
||||||
MyGUI::Button* tab;
|
MyGUI::Button* tab;
|
||||||
|
constexpr char* kTabIds[] = { "TabMap", "TabInventory", "TabSpells", "TabStats" };
|
||||||
|
|
||||||
getWidget(tab, "TabMap");
|
for (const char* id : kTabIds)
|
||||||
tab->eventMouseButtonClick += MyGUI::newDelegate(this, &InventoryTabsOverlay::onTabClicked);
|
{
|
||||||
mTabs.push_back(tab);
|
getWidget(tab, id);
|
||||||
|
|
||||||
getWidget(tab, "TabInventory");
|
|
||||||
tab->eventMouseButtonClick += MyGUI::newDelegate(this, &InventoryTabsOverlay::onTabClicked);
|
|
||||||
mTabs.push_back(tab);
|
|
||||||
|
|
||||||
getWidget(tab, "TabSpells");
|
|
||||||
tab->eventMouseButtonClick += MyGUI::newDelegate(this, &InventoryTabsOverlay::onTabClicked);
|
|
||||||
mTabs.push_back(tab);
|
|
||||||
|
|
||||||
getWidget(tab, "TabStats");
|
|
||||||
tab->eventMouseButtonClick += MyGUI::newDelegate(this, &InventoryTabsOverlay::onTabClicked);
|
tab->eventMouseButtonClick += MyGUI::newDelegate(this, &InventoryTabsOverlay::onTabClicked);
|
||||||
mTabs.push_back(tab);
|
mTabs.push_back(tab);
|
||||||
|
}
|
||||||
|
|
||||||
MyGUI::ImageBox* image;
|
MyGUI::ImageBox* image;
|
||||||
getWidget(image, "BtnL2Image");
|
getWidget(image, "BtnL2Image");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue