beginnings of the gui

actorid
scrawl 12 years ago
parent 44c644dd7b
commit b76a28f69c

@ -29,7 +29,7 @@ add_openmw_dir (mwgui
map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list
formatting inventorywindow container hud countdialog tradewindow settingswindow
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
itemselection spellbuyingwindow loadingscreen
itemselection spellbuyingwindow loadingscreen levelupdialog
)
add_openmw_dir (mwdialogue

@ -0,0 +1,63 @@
#include "levelupdialog.hpp"
#include <boost/lexical_cast.hpp>
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/environment.hpp"
namespace MWGui
{
LevelupDialog::LevelupDialog(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_levelup_dialog.layout", parWindowManager)
{
getWidget(mOkButton, "OkButton");
getWidget(mClassImage, "ClassImage");
getWidget(mLevelText, "LevelText");
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &LevelupDialog::onOkButtonClicked);
for (int i=1; i<9; ++i)
{
MyGUI::TextBox* t;
getWidget(t, "AttribVal" + boost::lexical_cast<std::string>(i));
MyGUI::Button* b;
getWidget(b, "Attrib" + boost::lexical_cast<std::string>(i));
b->setUserData (i-1);
b->eventMouseButtonClick += MyGUI::newDelegate(this, &LevelupDialog::onAttributeClicked);
mAttributeValues.push_back(t);
getWidget(t, "AttribMultiplier" + boost::lexical_cast<std::string>(i));
t->setCaption("x2");
mAttributeMultipliers.push_back(t);
}
center();
open();
}
void LevelupDialog::open()
{
center();
mClassImage->setImageTexture ("textures\\levelup\\acrobat.dds");
/// \todo replace this with INI-imported texts
int level = 2;
mLevelText->setCaptionWithReplacing("#{sLevelUpMenu1} " + boost::lexical_cast<std::string>(level));
}
void LevelupDialog::onOkButtonClicked (MyGUI::Widget* sender)
{
MWBase::Environment::get().getWindowManager ()->messageBox("#{sNotifyMessage36}", std::vector<std::string>());
}
void LevelupDialog::onAttributeClicked (MyGUI::Widget *sender)
{
int index = *sender->getUserData<int>();
}
}

@ -0,0 +1,30 @@
#ifndef MWGUI_LEVELUPDIALOG_H
#define MWGUI_LEVELUPDIALOG_H
#include "window_base.hpp"
namespace MWGui
{
class LevelupDialog : public WindowBase
{
public:
LevelupDialog(MWBase::WindowManager& parWindowManager);
virtual void open();
private:
MyGUI::Button* mOkButton;
MyGUI::ImageBox* mClassImage;
MyGUI::TextBox* mLevelText;
std::vector<MyGUI::TextBox*> mAttributeValues;
std::vector<MyGUI::TextBox*> mAttributeMultipliers;
void onOkButtonClicked (MyGUI::Widget* sender);
void onAttributeClicked (MyGUI::Widget* sender);
};
}
#endif

@ -22,6 +22,8 @@ namespace MWGui
GM_Rest,
GM_SpellBuying,
GM_Levelup,
// Startup character creation dialogs
GM_Name,
GM_Race,

@ -44,6 +44,7 @@
#include "spellwindow.hpp"
#include "quickkeysmenu.hpp"
#include "loadingscreen.hpp"
#include "levelupdialog.hpp"
using namespace MWGui;
@ -147,6 +148,7 @@ WindowManager::WindowManager(
mAlchemyWindow = new AlchemyWindow(*this);
mSpellWindow = new SpellWindow(*this);
mQuickKeysMenu = new QuickKeysMenu(*this);
mLevelupDialog = new LevelupDialog(*this);
mLoadingScreen = new LoadingScreen(mOgre->getScene (), mOgre->getWindow (), *this);
mLoadingScreen->onResChange (w,h);
@ -200,6 +202,7 @@ WindowManager::~WindowManager()
delete mAlchemyWindow;
delete mSpellWindow;
delete mLoadingScreen;
delete mLevelupDialog;
cleanupGarbage();

@ -62,6 +62,7 @@ namespace MWGui
class AlchemyWindow;
class QuickKeysMenu;
class LoadingScreen;
class LevelupDialog;
class WindowManager : public MWBase::WindowManager
{
@ -224,6 +225,7 @@ namespace MWGui
SpellWindow* mSpellWindow;
QuickKeysMenu* mQuickKeysMenu;
LoadingScreen* mLoadingScreen;
LevelupDialog* mLevelupDialog;
CharacterCreation* mCharGen;

@ -35,7 +35,7 @@ set(MYGUI_FILES
openmw_dialogue_window.layout
openmw_dialogue_window_skin.xml
openmw_edit.skin.xml
openmw.font.xml
openmw_font.xml
openmw_hud_box.skin.xml
openmw_hud_energybar.skin.xml
openmw_hud.layout
@ -51,7 +51,7 @@ set(MYGUI_FILES
openmw_map_window.layout
openmw_map_window_skin.xml
openmw_messagebox.layout
openmw.pointer.xml
openmw_pointer.xml
openmw_progress.skin.xml
openmw_resources.xml
openmw_scroll.layout
@ -72,6 +72,7 @@ set(MYGUI_FILES
openmw_magicselection_dialog.layout
openmw_spell_buying_window.layout
openmw_loading_screen.layout
openmw_levelup_dialog.layout
smallbars.png
VeraMono.ttf
markers.png

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 440 438" name="_Main">
<Widget type="Widget" skin="MW_Box" position="28 14 391 198">
<Widget type="ImageBox" skin="ImageBox" name="ClassImage" position="0 0 391 198">
</Widget>
</Widget>
<Widget type="TextBox" skin="SandText" position="28 218 391 24" name="LevelText">
</Widget>
<Widget type="Widget" skin="" position="36 280 400 400">
<Widget type="TextBox" skin="SandText" position="0 0 100 24" name="AttribMultiplier1"/>
<Widget type="TextBox" skin="SandText" position="0 24 100 24" name="AttribMultiplier2"/>
<Widget type="TextBox" skin="SandText" position="0 48 100 24" name="AttribMultiplier3"/>
<Widget type="TextBox" skin="SandText" position="0 72 100 24" name="AttribMultiplier4"/>
<Widget type="TextBox" skin="SandText" position="200 0 100 24" name="AttribMultiplier5"/>
<Widget type="TextBox" skin="SandText" position="200 24 100 24" name="AttribMultiplier6"/>
<Widget type="TextBox" skin="SandText" position="200 48 100 24" name="AttribMultiplier7"/>
<Widget type="TextBox" skin="SandText" position="200 72 100 24" name="AttribMultiplier8"/>
<Widget type="HBox" position="22 0 200 24">
<Widget type="AutoSizedButton" skin="SandTextButton" name="Attrib1">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeStrength}"/>
<UserString key="Caption_AttributeDescription" value="#{sStrDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_strength.dds"/>
<Property key="Caption" value="#{sAttributeStrength}"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" name="AttribVal1">
<Property key="Caption" value="54"/>
</Widget>
</Widget>
<Widget type="HBox" position="22 24 200 24">
<Widget type="AutoSizedButton" skin="SandTextButton" name="Attrib2">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeIntelligence}"/>
<UserString key="Caption_AttributeDescription" value="#{sIntDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_int.dds"/>
<Property key="Caption" value="#{sAttributeIntelligence}"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" name="AttribVal2">
<Property key="Caption" value="54"/>
</Widget>
</Widget>
<Widget type="HBox" position="22 48 200 24">
<Widget type="AutoSizedButton" skin="SandTextButton" name="Attrib3">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeWillpower}"/>
<UserString key="Caption_AttributeDescription" value="#{sWilDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_wilpower.dds"/>
<Property key="Caption" value="#{sAttributeWillpower}"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" name="AttribVal3">
<Property key="Caption" value="54"/>
</Widget>
</Widget>
<Widget type="HBox" position="22 72 200 24">
<Widget type="AutoSizedButton" skin="SandTextButton" name="Attrib4">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeAgility}"/>
<UserString key="Caption_AttributeDescription" value="#{sAgiDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_agility.dds"/>
<Property key="Caption" value="#{sAttributeAgility}"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" name="AttribVal4">
<Property key="Caption" value="54"/>
</Widget>
</Widget>
<Widget type="HBox" position="222 0 200 24">
<Widget type="AutoSizedButton" skin="SandTextButton" name="Attrib5">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeSpeed}"/>
<UserString key="Caption_AttributeDescription" value="#{sSpdDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_speed.dds"/>
<Property key="Caption" value="#{sAttributeSpeed}"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" name="AttribVal5">
<Property key="Caption" value="54"/>
</Widget>
</Widget>
<Widget type="HBox" position="222 24 200 24">
<Widget type="AutoSizedButton" skin="SandTextButton" name="Attrib6">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeEndurance}"/>
<UserString key="Caption_AttributeDescription" value="#{sEndDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_endurance.dds"/>
<Property key="Caption" value="#{sAttributeEndurance}"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" name="AttribVal6">
<Property key="Caption" value="54"/>
</Widget>
</Widget>
<Widget type="HBox" position="222 48 200 24">
<Widget type="AutoSizedButton" skin="SandTextButton" name="Attrib7">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributePersonality}"/>
<UserString key="Caption_AttributeDescription" value="#{sPerDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_personality.dds"/>
<Property key="Caption" value="#{sAttributePersonality}"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" name="AttribVal7">
<Property key="Caption" value="54"/>
</Widget>
</Widget>
<Widget type="HBox" position="222 72 200 24">
<Widget type="AutoSizedButton" skin="SandTextButton" name="Attrib8">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeLuck}"/>
<UserString key="Caption_AttributeDescription" value="#{sLucDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_luck.dds"/>
<Property key="Caption" value="#{sAttributeLuck}"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" name="AttribVal8">
<Property key="Caption" value="54"/>
</Widget>
</Widget>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" position="422 398 0 24" name="OkButton">
<Property key="ExpandDirection" value="Left"/>
<Property key="Caption" value="#{sOk}"/>
</Widget>
</Widget>
</MyGUI>
Loading…
Cancel
Save