Added combo box widget and use it in options menu. Fixes to VBox / HBox. Added savegame dialog.
parent
c3d9bc31bb
commit
bf5529819d
@ -0,0 +1,49 @@
|
||||
#include "savegamedialog.hpp"
|
||||
#include "widgets.hpp"
|
||||
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
SaveGameDialog::SaveGameDialog()
|
||||
: WindowModal("openmw_savegame_dialog.layout")
|
||||
{
|
||||
getWidget(mScreenshot, "Screenshot");
|
||||
getWidget(mCharacterSelection, "SelectCharacter");
|
||||
getWidget(mInfoText, "InfoText");
|
||||
getWidget(mOkButton, "OkButton");
|
||||
getWidget(mCancelButton, "CancelButton");
|
||||
getWidget(mSaveList, "SaveList");
|
||||
getWidget(mSaveNameEdit, "SaveNameEdit");
|
||||
getWidget(mSpacer, "Spacer");
|
||||
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onOkButtonClicked);
|
||||
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onCancelButtonClicked);
|
||||
|
||||
}
|
||||
|
||||
void SaveGameDialog::open()
|
||||
{
|
||||
center();
|
||||
}
|
||||
|
||||
void SaveGameDialog::setLoadOrSave(bool load)
|
||||
{
|
||||
mSaveNameEdit->setVisible(!load);
|
||||
mCharacterSelection->setUserString("Hidden", load ? "false" : "true");
|
||||
mCharacterSelection->setVisible(load);
|
||||
mSpacer->setUserString("Hidden", load ? "false" : "true");
|
||||
|
||||
center();
|
||||
}
|
||||
|
||||
void SaveGameDialog::onCancelButtonClicked(MyGUI::Widget *sender)
|
||||
{
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
void SaveGameDialog::onOkButtonClicked(MyGUI::Widget *sender)
|
||||
{
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
#ifndef OPENMW_MWGUI_SAVEGAMEDIALOG_H
|
||||
#define OPENMW_MWGUI_SAVEGAMEDIALOG_H
|
||||
|
||||
#include "windowbase.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
||||
class SaveGameDialog : public MWGui::WindowModal
|
||||
{
|
||||
public:
|
||||
SaveGameDialog();
|
||||
|
||||
virtual void open();
|
||||
|
||||
void setLoadOrSave(bool load);
|
||||
|
||||
void onCancelButtonClicked (MyGUI::Widget* sender);
|
||||
void onOkButtonClicked (MyGUI::Widget* sender);
|
||||
|
||||
|
||||
private:
|
||||
MyGUI::ImageBox* mScreenshot;
|
||||
|
||||
MyGUI::ComboBox* mCharacterSelection;
|
||||
MyGUI::EditBox* mInfoText;
|
||||
MyGUI::Button* mOkButton;
|
||||
MyGUI::Button* mCancelButton;
|
||||
MyGUI::ListBox* mSaveList;
|
||||
MyGUI::EditBox* mSaveNameEdit;
|
||||
MyGUI::Widget* mSpacer;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="VBox" skin="MW_Dialog" layer="Windows" position="0 0 600 400" name="_Main">
|
||||
<Property key="Padding" value="8"/>
|
||||
<Property key="Spacing" value="6"/>
|
||||
|
||||
<Widget type="HBox" skin="">
|
||||
<UserString key="HStretch" value="true"/>
|
||||
<UserString key="VStretch" value="true"/>
|
||||
|
||||
|
||||
<Widget type="VBox" skin="">
|
||||
|
||||
<UserString key="HStretch" value="true"/>
|
||||
<UserString key="VStretch" value="true"/>
|
||||
|
||||
<Widget type="ComboBox" skin="MW_ComboBox" position="0 0 200 24" name="SelectCharacter">
|
||||
<Property key="Caption" value="Select Character"/>
|
||||
<Property key="AddItem" value="Gandalf (Level 654)"/>
|
||||
<Property key="AddItem" value="Frodo (Level 3)"/>
|
||||
<UserString key="HStretch" value="true"/>
|
||||
</Widget>
|
||||
|
||||
|
||||
<Widget type="ListBox" skin="MW_List" position="0 0 200 200" name="SaveList">
|
||||
<UserString key="HStretch" value="true"/>
|
||||
<UserString key="VStretch" value="true"/>
|
||||
<Property key="AddItem" value="Quicksave"/>
|
||||
<Property key="AddItem" value="Autosave"/>
|
||||
<Property key="AddItem" value="Save 3"/>
|
||||
<Property key="AddItem" value="Save 2"/>
|
||||
<Property key="AddItem" value="Save 1"/>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
||||
<Widget type="VBox" skin="">
|
||||
<UserString key="HStretch" value="false"/>
|
||||
<UserString key="VStretch" value="true"/>
|
||||
<Property key="Spacing" value="4"/>
|
||||
|
||||
<Widget type="AutoSizedButton" skin="" name="Spacer">
|
||||
<Property key="Visible" value="false"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="Widget" skin="MW_Box" position="0 0 263 137">
|
||||
<Widget type="ImageBox" skin="ImageBox" position="2 2 259 133" name="Screenshot"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedEditBox" skin="SandText" position="0 0 263 0" name="InfoText">
|
||||
<Property key="Static" value="true"/>
|
||||
<Property key="MultiLine" value="true"/>
|
||||
|
||||
<Property key="Caption" value="4:21 AM\nTuesday, November 5, 2013\n\nLevel 23\nBalmora, Guild of Mages\n16 Last Seed (Day 12) 9 a.m. "/>
|
||||
</Widget>
|
||||
|
||||
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
||||
<Widget type="HBox" skin="">
|
||||
<UserString key="HStretch" value="true"/>
|
||||
<Widget type="EditBox" skin="MW_TextEdit" name="SaveNameEdit">
|
||||
<UserString key="HStretch" value="true"/>
|
||||
<UserString key="VStretch" value="true"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton">
|
||||
<Property key="Caption" value="#{sCancel}"/>
|
||||
</Widget>
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="OkButton">
|
||||
<Property key="Caption" value="#{sOk}"/>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
|
||||
|
||||
</Widget>
|
||||
</MyGUI>
|
Loading…
Reference in New Issue