Merge branch 'openxr_vr' into 'openxr_vr'

Nicer VR meta menu

See merge request madsbuvi/openmw!9
pull/615/head
Mads Buvik Sandvei 4 years ago
commit 558b95e5f1

@ -15,11 +15,7 @@ namespace MWVR
: WindowBase("openmw_vr_metamenu.layout") : WindowBase("openmw_vr_metamenu.layout")
, mWidth (w) , mWidth (w)
, mHeight (h) , mHeight (h)
, mButtonBox(0)
{ {
getWidget(mButtonBox, "ButtonBox");
updateMenu(); updateMenu();
} }
@ -125,8 +121,6 @@ namespace MWVR
void VrMetaMenu::updateMenu() void VrMetaMenu::updateMenu()
{ {
setCoord(0,0, mWidth, mHeight);
static std::vector<std::string> buttons{ "return", "quicksave", "quickload", "console", "inventory", "journal", "rest", "gamemenu" }; static std::vector<std::string> buttons{ "return", "quicksave", "quickload", "console", "inventory", "journal", "rest", "gamemenu" };
if(mButtons.empty()) if(mButtons.empty())
@ -141,11 +135,5 @@ namespace MWVR
button->setVisible(true); button->setVisible(true);
mButtons[buttonId] = button; mButtons[buttonId] = button;
} }
int width = mButtonBox->getWidth();
int height = mButtonBox->getHeight();
mButtonBox->setCoord (mWidth/2 - width/2, mHeight/2 - height/2, width, height);
mButtonBox->setVisible(true);
} }
} }

@ -39,7 +39,6 @@ namespace MWVR
bool exit() override; bool exit() override;
private: private:
MyGUI::Widget* mButtonBox{ nullptr };
std::map<std::string, MyGUI::Button*> mButtons{}; std::map<std::string, MyGUI::Button*> mButtons{};
void onButtonClicked (MyGUI::Widget* sender); void onButtonClicked (MyGUI::Widget* sender);

@ -2,40 +2,67 @@
<MyGUI type="Layout"> <MyGUI type="Layout">
<!-- TODO: Multiple language support --> <!-- TODO: Multiple language support -->
<Widget type="Widget" layer="MainMenu" position="0 0 300 659" name="_Main" align="Center"> <Widget type="VBox" layer="MainMenu" name="_Main" align="Center">
<Widget type="Widget" position="63 0 173 659" name="ButtonBox"> <Property key="AutoResize" value="true"/>
<Widget type="Button" skin="MW_Button" position="30 0 112 64" name="return"> <Property key="Padding" value="50"/>
<Property key="Caption" value="Return"/> <Property key="Spacing" value="12"/>
<Property key="FontHeight" value="32"/>
</Widget> <Widget type="AutoSizedButton" skin="MW_Button" name="return" align="HCenter">
<Widget type="Button" skin="MW_Button" position="4 85 164 64" name="quicksave"> <Property key="Caption" value="Return"/>
<Property key="Caption" value="Quick Save"/> <Property key="FontHeight" value="32"/>
<Property key="FontHeight" value="32"/> </Widget>
</Widget>
<Widget type="Button" skin="MW_Button" position="3 170 166 64" name="quickload"> <Widget type="Spacer"/>
<Property key="Caption" value="Quick Load"/> <Widget type="Widget" skin="IB_T" align="HCenter" position="0 0 125 4">
<Property key="FontHeight" value="32"/> <Widget type="Widget"/>
</Widget> </Widget>
<Widget type="Button" skin="MW_Button" position="27 255 118 64" name="console"> <Widget type="Spacer"/>
<Property key="Caption" value="Console"/>
<Property key="FontHeight" value="32"/> <Widget type="AutoSizedButton" skin="MW_Button" name="quicksave" align="HCenter">
</Widget> <Property key="Caption" value="Quick Save"/>
<Widget type="Button" skin="MW_Button" position="14 340 145 64" name="inventory"> <Property key="FontHeight" value="32"/>
<Property key="Caption" value="Inventory"/> </Widget>
<Property key="FontHeight" value="32"/> <Widget type="AutoSizedButton" skin="MW_Button" name="quickload" align="HCenter">
</Widget> <Property key="Caption" value="Quick Load"/>
<Widget type="Button" skin="MW_Button" position="31 425 110 64" name="journal"> <Property key="FontHeight" value="32"/>
<Property key="Caption" value="Journal"/> </Widget>
<Property key="FontHeight" value="32"/>
</Widget> <Widget type="Spacer"/>
<Widget type="Button" skin="MW_Button" position="46 510 80 64" name="rest"> <Widget type="Widget" skin="IB_T" align="HCenter" position="0 0 125 4">
<Property key="Caption" value="Rest"/> <Widget type="Widget"/>
<Property key="FontHeight" value="32"/> </Widget>
</Widget> <Widget type="Spacer"/>
<Widget type="Button" skin="MW_Button" position="0 595 173 64" name="gamemenu">
<Property key="Caption" value="Game Menu"/> <Widget type="AutoSizedButton" skin="MW_Button" name="inventory" align="HCenter">
<Property key="FontHeight" value="32"/> <Property key="Caption" value="Inventory"/>
</Widget> <Property key="FontHeight" value="32"/>
</Widget> </Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="journal" align="HCenter">
<Property key="Caption" value="Journal"/>
<Property key="FontHeight" value="32"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="rest" align="HCenter">
<Property key="Caption" value="Rest"/>
<Property key="FontHeight" value="32"/>
</Widget>
<Widget type="Spacer"/>
<Widget type="Widget" skin="IB_T" align="HCenter" position="0 0 125 4">
<Widget type="Widget"/>
</Widget>
<Widget type="Spacer"/>
<Widget type="AutoSizedButton" skin="MW_Button" name="console" align="HCenter">
<Property key="Caption" value="Console"/>
<Property key="FontHeight" value="32"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="gamemenu" align="HCenter">
<Property key="Caption" value="Game Menu"/>
<Property key="FontHeight" value="32"/>
</Widget>
<!-- without this the last button wouldn't resize correctly -->
<Widget type="Widget"/>
</Widget> </Widget>
</MyGUI> </MyGUI>

Loading…
Cancel
Save