mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 09:53:50 +00:00
Merge remote-tracking branch 'galdor557/master'
Conflicts: apps/openmw/mwgui/travelwindow.cpp
This commit is contained in:
commit
3f846a50d9
84 changed files with 609 additions and 708 deletions
|
@ -24,9 +24,9 @@ add_openmw_dir (mwinput
|
||||||
)
|
)
|
||||||
|
|
||||||
add_openmw_dir (mwgui
|
add_openmw_dir (mwgui
|
||||||
text_input widgets race class birth review windowmanagerimp console dialogue
|
textinput widgets race class birth review windowmanagerimp console dialogue
|
||||||
dialogue_history window_base stats_window messagebox journalwindow charactercreation
|
dialoguehistory windowbase statswindow messagebox journalwindow charactercreation
|
||||||
map_window window_pinnable_base tooltips scrollwindow bookwindow list
|
mapwindow windowpinnablebase tooltips scrollwindow bookwindow list
|
||||||
formatting inventorywindow container hud countdialog tradewindow settingswindow
|
formatting inventorywindow container hud countdialog tradewindow settingswindow
|
||||||
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
|
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
|
||||||
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog
|
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog
|
||||||
|
|
|
@ -26,8 +26,8 @@ namespace
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
AlchemyWindow::AlchemyWindow(MWBase::WindowManager& parWindowManager)
|
AlchemyWindow::AlchemyWindow()
|
||||||
: WindowBase("openmw_alchemy_window.layout", parWindowManager)
|
: WindowBase("openmw_alchemy_window.layout")
|
||||||
, ContainerBase(0), mApparatus (4), mIngredients (4)
|
, ContainerBase(0), mApparatus (4), mIngredients (4)
|
||||||
{
|
{
|
||||||
getWidget(mCreateButton, "CreateButton");
|
getWidget(mCreateButton, "CreateButton");
|
||||||
|
@ -64,8 +64,8 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
mAlchemy.clear();
|
mAlchemy.clear();
|
||||||
|
|
||||||
mWindowManager.removeGuiMode(GM_Alchemy);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Alchemy);
|
||||||
mWindowManager.removeGuiMode(GM_Inventory);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Inventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlchemyWindow::onCreateButtonClicked(MyGUI::Widget* _sender)
|
void AlchemyWindow::onCreateButtonClicked(MyGUI::Widget* _sender)
|
||||||
|
@ -77,40 +77,40 @@ namespace MWGui
|
||||||
|
|
||||||
if (result == MWMechanics::Alchemy::Result_NoName)
|
if (result == MWMechanics::Alchemy::Result_NoName)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox("#{sNotifyMessage37}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage37}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if mortar & pestle is available (always needed)
|
// check if mortar & pestle is available (always needed)
|
||||||
if (result == MWMechanics::Alchemy::Result_NoMortarAndPestle)
|
if (result == MWMechanics::Alchemy::Result_NoMortarAndPestle)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox("#{sNotifyMessage45}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage45}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure 2 or more ingredients were selected
|
// make sure 2 or more ingredients were selected
|
||||||
if (result == MWMechanics::Alchemy::Result_LessThanTwoIngredients)
|
if (result == MWMechanics::Alchemy::Result_LessThanTwoIngredients)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox("#{sNotifyMessage6a}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage6a}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == MWMechanics::Alchemy::Result_NoEffects)
|
if (result == MWMechanics::Alchemy::Result_NoEffects)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox("#{sNotifyMessage8}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage8}");
|
||||||
MWBase::Environment::get().getSoundManager()->playSound("potion fail", 1.f, 1.f);
|
MWBase::Environment::get().getSoundManager()->playSound("potion fail", 1.f, 1.f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == MWMechanics::Alchemy::Result_Success)
|
if (result == MWMechanics::Alchemy::Result_Success)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox("#{sPotionSuccess}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sPotionSuccess}");
|
||||||
MWBase::Environment::get().getSoundManager()->playSound("potion success", 1.f, 1.f);
|
MWBase::Environment::get().getSoundManager()->playSound("potion success", 1.f, 1.f);
|
||||||
}
|
}
|
||||||
else if (result == MWMechanics::Alchemy::Result_RandomFailure)
|
else if (result == MWMechanics::Alchemy::Result_RandomFailure)
|
||||||
{
|
{
|
||||||
// potion failed
|
// potion failed
|
||||||
mWindowManager.messageBox("#{sNotifyMessage8}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage8}");
|
||||||
MWBase::Environment::get().getSoundManager()->playSound("potion fail", 1.f, 1.f);
|
MWBase::Environment::get().getSoundManager()->playSound("potion fail", 1.f, 1.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,6 @@ namespace MWGui
|
||||||
MyGUI::IntCoord coord(0, 0, mEffectsBox->getWidth(), 24);
|
MyGUI::IntCoord coord(0, 0, mEffectsBox->getWidth(), 24);
|
||||||
Widgets::MWEffectListPtr effectsWidget = mEffectsBox->createWidget<Widgets::MWEffectList>
|
Widgets::MWEffectListPtr effectsWidget = mEffectsBox->createWidget<Widgets::MWEffectList>
|
||||||
("MW_StatName", coord, MyGUI::Align::Left | MyGUI::Align::Top);
|
("MW_StatName", coord, MyGUI::Align::Left | MyGUI::Align::Top);
|
||||||
effectsWidget->setWindowManager(&mWindowManager);
|
|
||||||
|
|
||||||
Widgets::SpellEffectList _list = Widgets::MWEffectList::effectListFromESM(&list);
|
Widgets::SpellEffectList _list = Widgets::MWEffectList::effectListFromESM(&list);
|
||||||
effectsWidget->setEffectList(_list);
|
effectsWidget->setEffectList(_list);
|
||||||
|
|
|
@ -5,16 +5,16 @@
|
||||||
|
|
||||||
#include "../mwmechanics/alchemy.hpp"
|
#include "../mwmechanics/alchemy.hpp"
|
||||||
|
|
||||||
#include "window_base.hpp"
|
|
||||||
#include "container.hpp"
|
#include "container.hpp"
|
||||||
#include "widgets.hpp"
|
#include "widgets.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
class AlchemyWindow : public WindowBase, public ContainerBase
|
class AlchemyWindow : public WindowBase, public ContainerBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AlchemyWindow(MWBase::WindowManager& parWindowManager);
|
AlchemyWindow();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ namespace MWGui
|
||||||
virtual void onReferenceUnavailable() { ; }
|
virtual void onReferenceUnavailable() { ; }
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
MWMechanics::Alchemy mAlchemy;
|
MWMechanics::Alchemy mAlchemy;
|
||||||
|
|
|
@ -24,8 +24,8 @@ bool sortBirthSigns(const std::pair<std::string, const ESM::BirthSign*>& left, c
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BirthDialog::BirthDialog(MWBase::WindowManager& parWindowManager)
|
BirthDialog::BirthDialog()
|
||||||
: WindowModal("openmw_chargen_birth.layout", parWindowManager)
|
: WindowModal("openmw_chargen_birth.layout")
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
@ -46,7 +46,7 @@ BirthDialog::BirthDialog(MWBase::WindowManager& parWindowManager)
|
||||||
|
|
||||||
MyGUI::Button* okButton;
|
MyGUI::Button* okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
|
||||||
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BirthDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BirthDialog::onOkClicked);
|
||||||
|
|
||||||
updateBirths();
|
updateBirths();
|
||||||
|
@ -59,9 +59,9 @@ void BirthDialog::setNextButtonShow(bool shown)
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
|
|
||||||
if (shown)
|
if (shown)
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sNext", ""));
|
||||||
else
|
else
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BirthDialog::open()
|
void BirthDialog::open()
|
||||||
|
@ -221,7 +221,7 @@ void BirthDialog::updateSpells()
|
||||||
if (!categories[category].spells.empty())
|
if (!categories[category].spells.empty())
|
||||||
{
|
{
|
||||||
MyGUI::TextBox* label = mSpellArea->createWidget<MyGUI::TextBox>("SandBrightText", coord, MyGUI::Align::Default, std::string("Label"));
|
MyGUI::TextBox* label = mSpellArea->createWidget<MyGUI::TextBox>("SandBrightText", coord, MyGUI::Align::Default, std::string("Label"));
|
||||||
label->setCaption(mWindowManager.getGameSettingString(categories[category].label, ""));
|
label->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString(categories[category].label, ""));
|
||||||
mSpellItems.push_back(label);
|
mSpellItems.push_back(label);
|
||||||
coord.top += lineHeight;
|
coord.top += lineHeight;
|
||||||
|
|
||||||
|
@ -230,7 +230,6 @@ void BirthDialog::updateSpells()
|
||||||
{
|
{
|
||||||
const std::string &spellId = *it;
|
const std::string &spellId = *it;
|
||||||
spellWidget = mSpellArea->createWidget<MWSpell>("MW_StatName", coord, MyGUI::Align::Default, std::string("Spell") + boost::lexical_cast<std::string>(i));
|
spellWidget = mSpellArea->createWidget<MWSpell>("MW_StatName", coord, MyGUI::Align::Default, std::string("Spell") + boost::lexical_cast<std::string>(i));
|
||||||
spellWidget->setWindowManager(&mWindowManager);
|
|
||||||
spellWidget->setSpellId(spellId);
|
spellWidget->setSpellId(spellId);
|
||||||
|
|
||||||
mSpellItems.push_back(spellWidget);
|
mSpellItems.push_back(spellWidget);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_BIRTH_H
|
#ifndef MWGUI_BIRTH_H
|
||||||
#define MWGUI_BIRTH_H
|
#define MWGUI_BIRTH_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This file contains the dialog for choosing a birth sign.
|
This file contains the dialog for choosing a birth sign.
|
||||||
|
@ -13,7 +13,7 @@ namespace MWGui
|
||||||
class BirthDialog : public WindowModal
|
class BirthDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BirthDialog(MWBase::WindowManager& parWindowManager);
|
BirthDialog();
|
||||||
|
|
||||||
enum Gender
|
enum Gender
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
BookWindow::BookWindow (MWBase::WindowManager& parWindowManager)
|
BookWindow::BookWindow ()
|
||||||
: WindowBase("openmw_book.layout", parWindowManager)
|
: WindowBase("openmw_book.layout")
|
||||||
, mTakeButtonShow(true)
|
, mTakeButtonShow(true)
|
||||||
, mTakeButtonAllowed(true)
|
, mTakeButtonAllowed(true)
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,7 @@ void BookWindow::onCloseButtonClicked (MyGUI::Widget* sender)
|
||||||
// no 3d sounds because the object could be in a container.
|
// no 3d sounds because the object could be in a container.
|
||||||
MWBase::Environment::get().getSoundManager()->playSound ("book close", 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound ("book close", 1.0, 1.0);
|
||||||
|
|
||||||
mWindowManager.removeGuiMode(GM_Book);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Book);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookWindow::onTakeButtonClicked (MyGUI::Widget* sender)
|
void BookWindow::onTakeButtonClicked (MyGUI::Widget* sender)
|
||||||
|
@ -112,7 +112,7 @@ void BookWindow::onTakeButtonClicked (MyGUI::Widget* sender)
|
||||||
MWWorld::ActionTake take(mBook);
|
MWWorld::ActionTake take(mBook);
|
||||||
take.execute (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
take.execute (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
||||||
|
|
||||||
mWindowManager.removeGuiMode(GM_Book);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Book);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookWindow::onNextPageButtonClicked (MyGUI::Widget* sender)
|
void BookWindow::onNextPageButtonClicked (MyGUI::Widget* sender)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_BOOKWINDOW_H
|
#ifndef MWGUI_BOOKWINDOW_H
|
||||||
#define MWGUI_BOOKWINDOW_H
|
#define MWGUI_BOOKWINDOW_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ namespace MWGui
|
||||||
class BookWindow : public WindowBase
|
class BookWindow : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BookWindow(MWBase::WindowManager& parWindowManager);
|
BookWindow();
|
||||||
|
|
||||||
void open(MWWorld::Ptr book);
|
void open(MWWorld::Ptr book);
|
||||||
void setTakeButtonShow(bool show);
|
void setTakeButtonShow(bool show);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "charactercreation.hpp"
|
#include "charactercreation.hpp"
|
||||||
|
|
||||||
#include "text_input.hpp"
|
#include "textinput.hpp"
|
||||||
#include "race.hpp"
|
#include "race.hpp"
|
||||||
#include "class.hpp"
|
#include "class.hpp"
|
||||||
#include "birth.hpp"
|
#include "birth.hpp"
|
||||||
|
@ -47,7 +47,7 @@ namespace
|
||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
CharacterCreation::CharacterCreation(MWBase::WindowManager* _wm)
|
CharacterCreation::CharacterCreation()
|
||||||
: mNameDialog(0)
|
: mNameDialog(0)
|
||||||
, mRaceDialog(0)
|
, mRaceDialog(0)
|
||||||
, mClassChoiceDialog(0)
|
, mClassChoiceDialog(0)
|
||||||
|
@ -58,7 +58,6 @@ CharacterCreation::CharacterCreation(MWBase::WindowManager* _wm)
|
||||||
, mBirthSignDialog(0)
|
, mBirthSignDialog(0)
|
||||||
, mReviewDialog(0)
|
, mReviewDialog(0)
|
||||||
, mGenerateClassStep(0)
|
, mGenerateClassStep(0)
|
||||||
, mWM(_wm)
|
|
||||||
{
|
{
|
||||||
mCreationStage = CSE_NotStarted;
|
mCreationStage = CSE_NotStarted;
|
||||||
}
|
}
|
||||||
|
@ -118,10 +117,10 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case GM_Name:
|
case GM_Name:
|
||||||
mWM->removeDialog(mNameDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mNameDialog);
|
||||||
mNameDialog = 0;
|
mNameDialog = 0;
|
||||||
mNameDialog = new TextInputDialog(*mWM);
|
mNameDialog = new TextInputDialog();
|
||||||
mNameDialog->setTextLabel(mWM->getGameSettingString("sName", "Name"));
|
mNameDialog->setTextLabel(MWBase::Environment::get().getWindowManager()->getGameSettingString("sName", "Name"));
|
||||||
mNameDialog->setTextInput(mPlayerName);
|
mNameDialog->setTextInput(mPlayerName);
|
||||||
mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
|
mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
|
||||||
mNameDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
|
mNameDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
|
||||||
|
@ -129,9 +128,9 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GM_Race:
|
case GM_Race:
|
||||||
mWM->removeDialog(mRaceDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mRaceDialog);
|
||||||
mRaceDialog = 0;
|
mRaceDialog = 0;
|
||||||
mRaceDialog = new RaceDialog(*mWM);
|
mRaceDialog = new RaceDialog();
|
||||||
mRaceDialog->setNextButtonShow(mCreationStage >= CSE_RaceChosen);
|
mRaceDialog->setNextButtonShow(mCreationStage >= CSE_RaceChosen);
|
||||||
mRaceDialog->setRaceId(mPlayerRaceId);
|
mRaceDialog->setRaceId(mPlayerRaceId);
|
||||||
mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
|
mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
|
||||||
|
@ -142,9 +141,9 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GM_Class:
|
case GM_Class:
|
||||||
mWM->removeDialog(mClassChoiceDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mClassChoiceDialog);
|
||||||
mClassChoiceDialog = 0;
|
mClassChoiceDialog = 0;
|
||||||
mClassChoiceDialog = new ClassChoiceDialog(*mWM);
|
mClassChoiceDialog = new ClassChoiceDialog();
|
||||||
mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
|
mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
|
||||||
mClassChoiceDialog->setVisible(true);
|
mClassChoiceDialog->setVisible(true);
|
||||||
if (mCreationStage < CSE_RaceChosen)
|
if (mCreationStage < CSE_RaceChosen)
|
||||||
|
@ -152,9 +151,9 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GM_ClassPick:
|
case GM_ClassPick:
|
||||||
mWM->removeDialog(mPickClassDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mPickClassDialog);
|
||||||
mPickClassDialog = 0;
|
mPickClassDialog = 0;
|
||||||
mPickClassDialog = new PickClassDialog(*mWM);
|
mPickClassDialog = new PickClassDialog();
|
||||||
mPickClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
mPickClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
||||||
mPickClassDialog->setClassId(mPlayerClass.mName);
|
mPickClassDialog->setClassId(mPlayerClass.mName);
|
||||||
mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
|
mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
|
||||||
|
@ -165,9 +164,9 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GM_Birth:
|
case GM_Birth:
|
||||||
mWM->removeDialog(mBirthSignDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mBirthSignDialog);
|
||||||
mBirthSignDialog = 0;
|
mBirthSignDialog = 0;
|
||||||
mBirthSignDialog = new BirthDialog(*mWM);
|
mBirthSignDialog = new BirthDialog();
|
||||||
mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
|
mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
|
||||||
mBirthSignDialog->setBirthId(mPlayerBirthSignId);
|
mBirthSignDialog->setBirthId(mPlayerBirthSignId);
|
||||||
mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
|
mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
|
||||||
|
@ -178,9 +177,9 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GM_ClassCreate:
|
case GM_ClassCreate:
|
||||||
mWM->removeDialog(mCreateClassDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mCreateClassDialog);
|
||||||
mCreateClassDialog = 0;
|
mCreateClassDialog = 0;
|
||||||
mCreateClassDialog = new CreateClassDialog(*mWM);
|
mCreateClassDialog = new CreateClassDialog();
|
||||||
mCreateClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
mCreateClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
||||||
mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
|
mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
|
||||||
mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
|
mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
|
||||||
|
@ -199,9 +198,9 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
mCreationStage = CSE_RaceChosen;
|
mCreationStage = CSE_RaceChosen;
|
||||||
break;
|
break;
|
||||||
case GM_Review:
|
case GM_Review:
|
||||||
mWM->removeDialog(mReviewDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
|
||||||
mReviewDialog = 0;
|
mReviewDialog = 0;
|
||||||
mReviewDialog = new ReviewDialog(*mWM);
|
mReviewDialog = new ReviewDialog();
|
||||||
mReviewDialog->setPlayerName(mPlayerName);
|
mReviewDialog->setPlayerName(mPlayerName);
|
||||||
mReviewDialog->setRace(mPlayerRaceId);
|
mReviewDialog->setRace(mPlayerRaceId);
|
||||||
mReviewDialog->setClass(mPlayerClass);
|
mReviewDialog->setClass(mPlayerClass);
|
||||||
|
@ -212,7 +211,7 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
mReviewDialog->setFatigue(mPlayerFatigue);
|
mReviewDialog->setFatigue(mPlayerFatigue);
|
||||||
|
|
||||||
{
|
{
|
||||||
std::map<int, MWMechanics::Stat<int> > attributes = mWM->getPlayerAttributeValues();
|
std::map<int, MWMechanics::Stat<int> > attributes = MWBase::Environment::get().getWindowManager()->getPlayerAttributeValues();
|
||||||
for (std::map<int, MWMechanics::Stat<int> >::iterator it = attributes.begin();
|
for (std::map<int, MWMechanics::Stat<int> >::iterator it = attributes.begin();
|
||||||
it != attributes.end(); ++it)
|
it != attributes.end(); ++it)
|
||||||
{
|
{
|
||||||
|
@ -221,13 +220,13 @@ void CharacterCreation::spawnDialog(const char id)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::map<int, MWMechanics::Stat<float> > skills = mWM->getPlayerSkillValues();
|
std::map<int, MWMechanics::Stat<float> > skills = MWBase::Environment::get().getWindowManager()->getPlayerSkillValues();
|
||||||
for (std::map<int, MWMechanics::Stat<float> >::iterator it = skills.begin();
|
for (std::map<int, MWMechanics::Stat<float> >::iterator it = skills.begin();
|
||||||
it != skills.end(); ++it)
|
it != skills.end(); ++it)
|
||||||
{
|
{
|
||||||
mReviewDialog->setSkillValue(static_cast<ESM::Skill::SkillEnum> (it->first), it->second);
|
mReviewDialog->setSkillValue(static_cast<ESM::Skill::SkillEnum> (it->first), it->second);
|
||||||
}
|
}
|
||||||
mReviewDialog->configureSkills(mWM->getPlayerMajorSkills(), mWM->getPlayerMinorSkills());
|
mReviewDialog->configureSkills(MWBase::Environment::get().getWindowManager()->getPlayerMajorSkills(), MWBase::Environment::get().getWindowManager()->getPlayerMinorSkills());
|
||||||
}
|
}
|
||||||
|
|
||||||
mReviewDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
|
mReviewDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
|
||||||
|
@ -257,41 +256,41 @@ void CharacterCreation::setPlayerFatigue (const MWMechanics::DynamicStat<float>&
|
||||||
|
|
||||||
void CharacterCreation::onReviewDialogDone(WindowBase* parWindow)
|
void CharacterCreation::onReviewDialogDone(WindowBase* parWindow)
|
||||||
{
|
{
|
||||||
mWM->removeDialog(mReviewDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
|
||||||
mReviewDialog = 0;
|
mReviewDialog = 0;
|
||||||
|
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onReviewDialogBack()
|
void CharacterCreation::onReviewDialogBack()
|
||||||
{
|
{
|
||||||
mWM->removeDialog(mReviewDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
|
||||||
mReviewDialog = 0;
|
mReviewDialog = 0;
|
||||||
|
|
||||||
mWM->pushGuiMode(GM_Birth);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onReviewActivateDialog(int parDialog)
|
void CharacterCreation::onReviewActivateDialog(int parDialog)
|
||||||
{
|
{
|
||||||
mWM->removeDialog(mReviewDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
|
||||||
mReviewDialog = 0;
|
mReviewDialog = 0;
|
||||||
mCreationStage = CSE_ReviewNext;
|
mCreationStage = CSE_ReviewNext;
|
||||||
|
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
|
|
||||||
switch(parDialog)
|
switch(parDialog)
|
||||||
{
|
{
|
||||||
case ReviewDialog::NAME_DIALOG:
|
case ReviewDialog::NAME_DIALOG:
|
||||||
mWM->pushGuiMode(GM_Name);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Name);
|
||||||
break;
|
break;
|
||||||
case ReviewDialog::RACE_DIALOG:
|
case ReviewDialog::RACE_DIALOG:
|
||||||
mWM->pushGuiMode(GM_Race);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Race);
|
||||||
break;
|
break;
|
||||||
case ReviewDialog::CLASS_DIALOG:
|
case ReviewDialog::CLASS_DIALOG:
|
||||||
mWM->pushGuiMode(GM_Class);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
|
||||||
break;
|
break;
|
||||||
case ReviewDialog::BIRTHSIGN_DIALOG:
|
case ReviewDialog::BIRTHSIGN_DIALOG:
|
||||||
mWM->pushGuiMode(GM_Birth);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,27 +307,27 @@ void CharacterCreation::onPickClassDialogDone(WindowBase* parWindow)
|
||||||
if (klass)
|
if (klass)
|
||||||
{
|
{
|
||||||
mPlayerClass = *klass;
|
mPlayerClass = *klass;
|
||||||
mWM->setPlayerClass(mPlayerClass);
|
MWBase::Environment::get().getWindowManager()->setPlayerClass(mPlayerClass);
|
||||||
}
|
}
|
||||||
mWM->removeDialog(mPickClassDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mPickClassDialog);
|
||||||
mPickClassDialog = 0;
|
mPickClassDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO This bit gets repeated a few times; wrap it in a function
|
//TODO This bit gets repeated a few times; wrap it in a function
|
||||||
if (mCreationStage == CSE_ReviewNext)
|
if (mCreationStage == CSE_ReviewNext)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Review);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
||||||
}
|
}
|
||||||
else if (mCreationStage >= CSE_ClassChosen)
|
else if (mCreationStage >= CSE_ClassChosen)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Birth);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mCreationStage = CSE_ClassChosen;
|
mCreationStage = CSE_ClassChosen;
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,34 +338,34 @@ void CharacterCreation::onPickClassDialogBack()
|
||||||
const std::string classId = mPickClassDialog->getClassId();
|
const std::string classId = mPickClassDialog->getClassId();
|
||||||
if (!classId.empty())
|
if (!classId.empty())
|
||||||
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(classId);
|
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(classId);
|
||||||
mWM->removeDialog(mPickClassDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mPickClassDialog);
|
||||||
mPickClassDialog = 0;
|
mPickClassDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Class);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onClassChoice(int _index)
|
void CharacterCreation::onClassChoice(int _index)
|
||||||
{
|
{
|
||||||
mWM->removeDialog(mClassChoiceDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mClassChoiceDialog);
|
||||||
mClassChoiceDialog = 0;
|
mClassChoiceDialog = 0;
|
||||||
|
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
|
|
||||||
switch(_index)
|
switch(_index)
|
||||||
{
|
{
|
||||||
case ClassChoiceDialog::Class_Generate:
|
case ClassChoiceDialog::Class_Generate:
|
||||||
mWM->pushGuiMode(GM_ClassGenerate);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_ClassGenerate);
|
||||||
break;
|
break;
|
||||||
case ClassChoiceDialog::Class_Pick:
|
case ClassChoiceDialog::Class_Pick:
|
||||||
mWM->pushGuiMode(GM_ClassPick);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_ClassPick);
|
||||||
break;
|
break;
|
||||||
case ClassChoiceDialog::Class_Create:
|
case ClassChoiceDialog::Class_Create:
|
||||||
mWM->pushGuiMode(GM_ClassCreate);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_ClassCreate);
|
||||||
break;
|
break;
|
||||||
case ClassChoiceDialog::Class_Back:
|
case ClassChoiceDialog::Class_Back:
|
||||||
mWM->pushGuiMode(GM_Race);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Race);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -377,26 +376,26 @@ void CharacterCreation::onNameDialogDone(WindowBase* parWindow)
|
||||||
if (mNameDialog)
|
if (mNameDialog)
|
||||||
{
|
{
|
||||||
mPlayerName = mNameDialog->getTextInput();
|
mPlayerName = mNameDialog->getTextInput();
|
||||||
mWM->setValue("name", mPlayerName);
|
MWBase::Environment::get().getWindowManager()->setValue("name", mPlayerName);
|
||||||
MWBase::Environment::get().getMechanicsManager()->setPlayerName(mPlayerName);
|
MWBase::Environment::get().getMechanicsManager()->setPlayerName(mPlayerName);
|
||||||
mWM->removeDialog(mNameDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mNameDialog);
|
||||||
mNameDialog = 0;
|
mNameDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCreationStage == CSE_ReviewNext)
|
if (mCreationStage == CSE_ReviewNext)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Review);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
||||||
}
|
}
|
||||||
else if (mCreationStage >= CSE_NameChosen)
|
else if (mCreationStage >= CSE_NameChosen)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Race);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Race);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mCreationStage = CSE_NameChosen;
|
mCreationStage = CSE_NameChosen;
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -414,12 +413,12 @@ void CharacterCreation::onRaceDialogBack()
|
||||||
data.mHair
|
data.mHair
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
mWM->removeDialog(mRaceDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mRaceDialog);
|
||||||
mRaceDialog = 0;
|
mRaceDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Name);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onRaceDialogDone(WindowBase* parWindow)
|
void CharacterCreation::onRaceDialogDone(WindowBase* parWindow)
|
||||||
|
@ -436,26 +435,26 @@ void CharacterCreation::onRaceDialogDone(WindowBase* parWindow)
|
||||||
data.mHair
|
data.mHair
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
mWM->getInventoryWindow()->rebuildAvatar();
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->rebuildAvatar();
|
||||||
|
|
||||||
mWM->removeDialog(mRaceDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mRaceDialog);
|
||||||
mRaceDialog = 0;
|
mRaceDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCreationStage == CSE_ReviewNext)
|
if (mCreationStage == CSE_ReviewNext)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Review);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
||||||
}
|
}
|
||||||
else if (mCreationStage >= CSE_RaceChosen)
|
else if (mCreationStage >= CSE_RaceChosen)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Class);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mCreationStage = CSE_RaceChosen;
|
mCreationStage = CSE_RaceChosen;
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,19 +465,19 @@ void CharacterCreation::onBirthSignDialogDone(WindowBase* parWindow)
|
||||||
mPlayerBirthSignId = mBirthSignDialog->getBirthId();
|
mPlayerBirthSignId = mBirthSignDialog->getBirthId();
|
||||||
if (!mPlayerBirthSignId.empty())
|
if (!mPlayerBirthSignId.empty())
|
||||||
MWBase::Environment::get().getMechanicsManager()->setPlayerBirthsign(mPlayerBirthSignId);
|
MWBase::Environment::get().getMechanicsManager()->setPlayerBirthsign(mPlayerBirthSignId);
|
||||||
mWM->removeDialog(mBirthSignDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mBirthSignDialog);
|
||||||
mBirthSignDialog = 0;
|
mBirthSignDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCreationStage >= CSE_BirthSignChosen)
|
if (mCreationStage >= CSE_BirthSignChosen)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Review);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mCreationStage = CSE_BirthSignChosen;
|
mCreationStage = CSE_BirthSignChosen;
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,12 +486,12 @@ void CharacterCreation::onBirthSignDialogBack()
|
||||||
if (mBirthSignDialog)
|
if (mBirthSignDialog)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getMechanicsManager()->setPlayerBirthsign(mBirthSignDialog->getBirthId());
|
MWBase::Environment::get().getMechanicsManager()->setPlayerBirthsign(mBirthSignDialog->getBirthId());
|
||||||
mWM->removeDialog(mBirthSignDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mBirthSignDialog);
|
||||||
mBirthSignDialog = 0;
|
mBirthSignDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Class);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onCreateClassDialogDone(WindowBase* parWindow)
|
void CharacterCreation::onCreateClassDialogDone(WindowBase* parWindow)
|
||||||
|
@ -522,49 +521,49 @@ void CharacterCreation::onCreateClassDialogDone(WindowBase* parWindow)
|
||||||
|
|
||||||
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(klass);
|
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(klass);
|
||||||
mPlayerClass = klass;
|
mPlayerClass = klass;
|
||||||
mWM->setPlayerClass(klass);
|
MWBase::Environment::get().getWindowManager()->setPlayerClass(klass);
|
||||||
|
|
||||||
mWM->removeDialog(mCreateClassDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mCreateClassDialog);
|
||||||
mCreateClassDialog = 0;
|
mCreateClassDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCreationStage == CSE_ReviewNext)
|
if (mCreationStage == CSE_ReviewNext)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Review);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
||||||
}
|
}
|
||||||
else if (mCreationStage >= CSE_ClassChosen)
|
else if (mCreationStage >= CSE_ClassChosen)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Birth);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mCreationStage = CSE_ClassChosen;
|
mCreationStage = CSE_ClassChosen;
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onCreateClassDialogBack()
|
void CharacterCreation::onCreateClassDialogBack()
|
||||||
{
|
{
|
||||||
mWM->removeDialog(mCreateClassDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mCreateClassDialog);
|
||||||
mCreateClassDialog = 0;
|
mCreateClassDialog = 0;
|
||||||
|
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Class);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onClassQuestionChosen(int _index)
|
void CharacterCreation::onClassQuestionChosen(int _index)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getSoundManager()->stopSay();
|
MWBase::Environment::get().getSoundManager()->stopSay();
|
||||||
|
|
||||||
mWM->removeDialog(mGenerateClassQuestionDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mGenerateClassQuestionDialog);
|
||||||
mGenerateClassQuestionDialog = 0;
|
mGenerateClassQuestionDialog = 0;
|
||||||
|
|
||||||
if (_index < 0 || _index >= 3)
|
if (_index < 0 || _index >= 3)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Class);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -637,10 +636,10 @@ void CharacterCreation::showClassQuestionDialog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mWM->removeDialog(mGenerateClassResultDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mGenerateClassResultDialog);
|
||||||
mGenerateClassResultDialog = 0;
|
mGenerateClassResultDialog = 0;
|
||||||
|
|
||||||
mGenerateClassResultDialog = new GenerateClassResultDialog(*mWM);
|
mGenerateClassResultDialog = new GenerateClassResultDialog();
|
||||||
mGenerateClassResultDialog->setClassId(mGenerateClass);
|
mGenerateClassResultDialog->setClassId(mGenerateClass);
|
||||||
mGenerateClassResultDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
|
mGenerateClassResultDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
|
||||||
mGenerateClassResultDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
|
mGenerateClassResultDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
|
||||||
|
@ -650,15 +649,15 @@ void CharacterCreation::showClassQuestionDialog()
|
||||||
|
|
||||||
if (mGenerateClassStep > 10)
|
if (mGenerateClassStep > 10)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Class);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mWM->removeDialog(mGenerateClassQuestionDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mGenerateClassQuestionDialog);
|
||||||
mGenerateClassQuestionDialog = 0;
|
mGenerateClassQuestionDialog = 0;
|
||||||
|
|
||||||
mGenerateClassQuestionDialog = new InfoBoxDialog(*mWM);
|
mGenerateClassQuestionDialog = new InfoBoxDialog();
|
||||||
|
|
||||||
InfoBoxDialog::ButtonList buttons;
|
InfoBoxDialog::ButtonList buttons;
|
||||||
mGenerateClassQuestionDialog->setText(sGenerateClassSteps(mGenerateClassStep).mText);
|
mGenerateClassQuestionDialog->setText(sGenerateClassSteps(mGenerateClassStep).mText);
|
||||||
|
@ -674,18 +673,18 @@ void CharacterCreation::showClassQuestionDialog()
|
||||||
|
|
||||||
void CharacterCreation::onGenerateClassBack()
|
void CharacterCreation::onGenerateClassBack()
|
||||||
{
|
{
|
||||||
mWM->removeDialog(mGenerateClassResultDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mGenerateClassResultDialog);
|
||||||
mGenerateClassResultDialog = 0;
|
mGenerateClassResultDialog = 0;
|
||||||
|
|
||||||
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(mGenerateClass);
|
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(mGenerateClass);
|
||||||
|
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Class);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterCreation::onGenerateClassDone(WindowBase* parWindow)
|
void CharacterCreation::onGenerateClassDone(WindowBase* parWindow)
|
||||||
{
|
{
|
||||||
mWM->removeDialog(mGenerateClassResultDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mGenerateClassResultDialog);
|
||||||
mGenerateClassResultDialog = 0;
|
mGenerateClassResultDialog = 0;
|
||||||
|
|
||||||
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(mGenerateClass);
|
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(mGenerateClass);
|
||||||
|
@ -694,22 +693,22 @@ void CharacterCreation::onGenerateClassDone(WindowBase* parWindow)
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find(mGenerateClass);
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find(mGenerateClass);
|
||||||
|
|
||||||
mPlayerClass = *klass;
|
mPlayerClass = *klass;
|
||||||
mWM->setPlayerClass(mPlayerClass);
|
MWBase::Environment::get().getWindowManager()->setPlayerClass(mPlayerClass);
|
||||||
|
|
||||||
if (mCreationStage == CSE_ReviewNext)
|
if (mCreationStage == CSE_ReviewNext)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Review);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
|
||||||
}
|
}
|
||||||
else if (mCreationStage >= CSE_ClassChosen)
|
else if (mCreationStage >= CSE_ClassChosen)
|
||||||
{
|
{
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
mWM->pushGuiMode(GM_Birth);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mCreationStage = CSE_ClassChosen;
|
mCreationStage = CSE_ClassChosen;
|
||||||
mWM->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
#ifndef CHARACTER_CREATION_HPP
|
#ifndef CHARACTER_CREATION_HPP
|
||||||
#define CHARACTER_CREATION_HPP
|
#define CHARACTER_CREATION_HPP
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
|
||||||
|
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
#include "../mwmechanics/stat.hpp"
|
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
class WindowBase;
|
class WindowBase;
|
||||||
|
@ -29,7 +25,7 @@ namespace MWGui
|
||||||
public:
|
public:
|
||||||
typedef std::vector<int> SkillList;
|
typedef std::vector<int> SkillList;
|
||||||
|
|
||||||
CharacterCreation(MWBase::WindowManager* _wm);
|
CharacterCreation();
|
||||||
~CharacterCreation();
|
~CharacterCreation();
|
||||||
|
|
||||||
//Show a dialog
|
//Show a dialog
|
||||||
|
@ -58,8 +54,6 @@ namespace MWGui
|
||||||
BirthDialog* mBirthSignDialog;
|
BirthDialog* mBirthSignDialog;
|
||||||
ReviewDialog* mReviewDialog;
|
ReviewDialog* mReviewDialog;
|
||||||
|
|
||||||
MWBase::WindowManager* mWM;
|
|
||||||
|
|
||||||
//Player data
|
//Player data
|
||||||
std::string mPlayerName;
|
std::string mPlayerName;
|
||||||
std::string mPlayerRaceId;
|
std::string mPlayerRaceId;
|
||||||
|
|
|
@ -20,13 +20,13 @@ using namespace MWGui;
|
||||||
|
|
||||||
/* GenerateClassResultDialog */
|
/* GenerateClassResultDialog */
|
||||||
|
|
||||||
GenerateClassResultDialog::GenerateClassResultDialog(MWBase::WindowManager& parWindowManager)
|
GenerateClassResultDialog::GenerateClassResultDialog()
|
||||||
: WindowModal("openmw_chargen_generate_class_result.layout", parWindowManager)
|
: WindowModal("openmw_chargen_generate_class_result.layout")
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
|
||||||
setText("ReflectT", mWindowManager.getGameSettingString("sMessageQuestionAnswer1", ""));
|
setText("ReflectT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sMessageQuestionAnswer1", ""));
|
||||||
|
|
||||||
getWidget(mClassImage, "ClassImage");
|
getWidget(mClassImage, "ClassImage");
|
||||||
getWidget(mClassName, "ClassName");
|
getWidget(mClassName, "ClassName");
|
||||||
|
@ -37,7 +37,7 @@ GenerateClassResultDialog::GenerateClassResultDialog(MWBase::WindowManager& parW
|
||||||
|
|
||||||
MyGUI::Button* okButton;
|
MyGUI::Button* okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
|
||||||
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,8 +67,8 @@ void GenerateClassResultDialog::onBackClicked(MyGUI::Widget* _sender)
|
||||||
|
|
||||||
/* PickClassDialog */
|
/* PickClassDialog */
|
||||||
|
|
||||||
PickClassDialog::PickClassDialog(MWBase::WindowManager& parWindowManager)
|
PickClassDialog::PickClassDialog()
|
||||||
: WindowModal("openmw_chargen_class.layout", parWindowManager)
|
: WindowModal("openmw_chargen_class.layout")
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
@ -77,16 +77,12 @@ PickClassDialog::PickClassDialog(MWBase::WindowManager& parWindowManager)
|
||||||
|
|
||||||
getWidget(mFavoriteAttribute[0], "FavoriteAttribute0");
|
getWidget(mFavoriteAttribute[0], "FavoriteAttribute0");
|
||||||
getWidget(mFavoriteAttribute[1], "FavoriteAttribute1");
|
getWidget(mFavoriteAttribute[1], "FavoriteAttribute1");
|
||||||
mFavoriteAttribute[0]->setWindowManager(&mWindowManager);
|
|
||||||
mFavoriteAttribute[1]->setWindowManager(&mWindowManager);
|
|
||||||
|
|
||||||
for(int i = 0; i < 5; i++)
|
for(int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
char theIndex = '0'+i;
|
char theIndex = '0'+i;
|
||||||
getWidget(mMajorSkill[i], std::string("MajorSkill").append(1, theIndex));
|
getWidget(mMajorSkill[i], std::string("MajorSkill").append(1, theIndex));
|
||||||
getWidget(mMinorSkill[i], std::string("MinorSkill").append(1, theIndex));
|
getWidget(mMinorSkill[i], std::string("MinorSkill").append(1, theIndex));
|
||||||
mMajorSkill[i]->setWindowManager(&mWindowManager);
|
|
||||||
mMinorSkill[i]->setWindowManager(&mWindowManager);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getWidget(mClassList, "ClassList");
|
getWidget(mClassList, "ClassList");
|
||||||
|
@ -115,9 +111,9 @@ void PickClassDialog::setNextButtonShow(bool shown)
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
|
|
||||||
if (shown)
|
if (shown)
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sNext", ""));
|
||||||
else
|
else
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PickClassDialog::open()
|
void PickClassDialog::open()
|
||||||
|
@ -224,7 +220,7 @@ void PickClassDialog::updateStats()
|
||||||
"sSpecializationMagic",
|
"sSpecializationMagic",
|
||||||
"sSpecializationStealth"
|
"sSpecializationStealth"
|
||||||
};
|
};
|
||||||
std::string specName = mWindowManager.getGameSettingString(specIds[specialization], specIds[specialization]);
|
std::string specName = MWBase::Environment::get().getWindowManager()->getGameSettingString(specIds[specialization], specIds[specialization]);
|
||||||
mSpecializationName->setCaption(specName);
|
mSpecializationName->setCaption(specName);
|
||||||
ToolTips::createSpecializationToolTip(mSpecializationName, specName, specialization);
|
ToolTips::createSpecializationToolTip(mSpecializationName, specName, specialization);
|
||||||
|
|
||||||
|
@ -276,8 +272,8 @@ void InfoBoxDialog::layoutVertically(MyGUI::Widget* widget, int margin)
|
||||||
widget->setSize(width, pos);
|
widget->setSize(width, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
InfoBoxDialog::InfoBoxDialog(MWBase::WindowManager& parWindowManager)
|
InfoBoxDialog::InfoBoxDialog()
|
||||||
: WindowModal("openmw_infobox.layout", parWindowManager)
|
: WindowModal("openmw_infobox.layout")
|
||||||
, mCurrentButton(-1)
|
, mCurrentButton(-1)
|
||||||
{
|
{
|
||||||
getWidget(mTextBox, "TextBox");
|
getWidget(mTextBox, "TextBox");
|
||||||
|
@ -360,22 +356,22 @@ void InfoBoxDialog::onButtonClicked(MyGUI::Widget* _sender)
|
||||||
|
|
||||||
/* ClassChoiceDialog */
|
/* ClassChoiceDialog */
|
||||||
|
|
||||||
ClassChoiceDialog::ClassChoiceDialog(MWBase::WindowManager& parWindowManager)
|
ClassChoiceDialog::ClassChoiceDialog()
|
||||||
: InfoBoxDialog(parWindowManager)
|
: InfoBoxDialog()
|
||||||
{
|
{
|
||||||
setText("");
|
setText("");
|
||||||
ButtonList buttons;
|
ButtonList buttons;
|
||||||
buttons.push_back(mWindowManager.getGameSettingString("sClassChoiceMenu1", ""));
|
buttons.push_back(MWBase::Environment::get().getWindowManager()->getGameSettingString("sClassChoiceMenu1", ""));
|
||||||
buttons.push_back(mWindowManager.getGameSettingString("sClassChoiceMenu2", ""));
|
buttons.push_back(MWBase::Environment::get().getWindowManager()->getGameSettingString("sClassChoiceMenu2", ""));
|
||||||
buttons.push_back(mWindowManager.getGameSettingString("sClassChoiceMenu3", ""));
|
buttons.push_back(MWBase::Environment::get().getWindowManager()->getGameSettingString("sClassChoiceMenu3", ""));
|
||||||
buttons.push_back(mWindowManager.getGameSettingString("sBack", ""));
|
buttons.push_back(MWBase::Environment::get().getWindowManager()->getGameSettingString("sBack", ""));
|
||||||
setButtons(buttons);
|
setButtons(buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CreateClassDialog */
|
/* CreateClassDialog */
|
||||||
|
|
||||||
CreateClassDialog::CreateClassDialog(MWBase::WindowManager& parWindowManager)
|
CreateClassDialog::CreateClassDialog()
|
||||||
: WindowModal("openmw_chargen_create_class.layout", parWindowManager)
|
: WindowModal("openmw_chargen_create_class.layout")
|
||||||
, mSpecDialog(NULL)
|
, mSpecDialog(NULL)
|
||||||
, mAttribDialog(NULL)
|
, mAttribDialog(NULL)
|
||||||
, mSkillDialog(NULL)
|
, mSkillDialog(NULL)
|
||||||
|
@ -384,20 +380,18 @@ CreateClassDialog::CreateClassDialog(MWBase::WindowManager& parWindowManager)
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
|
||||||
setText("SpecializationT", mWindowManager.getGameSettingString("sChooseClassMenu1", "Specialization"));
|
setText("SpecializationT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sChooseClassMenu1", "Specialization"));
|
||||||
getWidget(mSpecializationName, "SpecializationName");
|
getWidget(mSpecializationName, "SpecializationName");
|
||||||
mSpecializationName->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationClicked);
|
mSpecializationName->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationClicked);
|
||||||
|
|
||||||
setText("FavoriteAttributesT", mWindowManager.getGameSettingString("sChooseClassMenu2", "Favorite Attributes:"));
|
setText("FavoriteAttributesT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sChooseClassMenu2", "Favorite Attributes:"));
|
||||||
getWidget(mFavoriteAttribute0, "FavoriteAttribute0");
|
getWidget(mFavoriteAttribute0, "FavoriteAttribute0");
|
||||||
getWidget(mFavoriteAttribute1, "FavoriteAttribute1");
|
getWidget(mFavoriteAttribute1, "FavoriteAttribute1");
|
||||||
mFavoriteAttribute0->setWindowManager(&mWindowManager);
|
|
||||||
mFavoriteAttribute1->setWindowManager(&mWindowManager);
|
|
||||||
mFavoriteAttribute0->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
|
mFavoriteAttribute0->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
|
||||||
mFavoriteAttribute1->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
|
mFavoriteAttribute1->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
|
||||||
|
|
||||||
setText("MajorSkillT", mWindowManager.getGameSettingString("sSkillClassMajor", ""));
|
setText("MajorSkillT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSkillClassMajor", ""));
|
||||||
setText("MinorSkillT", mWindowManager.getGameSettingString("sSkillClassMinor", ""));
|
setText("MinorSkillT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSkillClassMinor", ""));
|
||||||
for(int i = 0; i < 5; i++)
|
for(int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
char theIndex = '0'+i;
|
char theIndex = '0'+i;
|
||||||
|
@ -410,11 +404,10 @@ CreateClassDialog::CreateClassDialog(MWBase::WindowManager& parWindowManager)
|
||||||
std::vector<Widgets::MWSkillPtr>::const_iterator end = mSkills.end();
|
std::vector<Widgets::MWSkillPtr>::const_iterator end = mSkills.end();
|
||||||
for (std::vector<Widgets::MWSkillPtr>::const_iterator it = mSkills.begin(); it != end; ++it)
|
for (std::vector<Widgets::MWSkillPtr>::const_iterator it = mSkills.begin(); it != end; ++it)
|
||||||
{
|
{
|
||||||
(*it)->setWindowManager(&mWindowManager);
|
|
||||||
(*it)->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onSkillClicked);
|
(*it)->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onSkillClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
setText("LabelT", mWindowManager.getGameSettingString("sName", ""));
|
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sName", ""));
|
||||||
getWidget(mEditName, "EditName");
|
getWidget(mEditName, "EditName");
|
||||||
|
|
||||||
// Make sure the edit box has focus
|
// Make sure the edit box has focus
|
||||||
|
@ -522,32 +515,32 @@ void CreateClassDialog::setNextButtonShow(bool shown)
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
|
|
||||||
if (shown)
|
if (shown)
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sNext", ""));
|
||||||
else
|
else
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
// widget controls
|
// widget controls
|
||||||
|
|
||||||
void CreateClassDialog::onDialogCancel()
|
void CreateClassDialog::onDialogCancel()
|
||||||
{
|
{
|
||||||
mWindowManager.removeDialog(mSpecDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mSpecDialog);
|
||||||
mSpecDialog = 0;
|
mSpecDialog = 0;
|
||||||
|
|
||||||
mWindowManager.removeDialog(mAttribDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mAttribDialog);
|
||||||
mAttribDialog = 0;
|
mAttribDialog = 0;
|
||||||
|
|
||||||
mWindowManager.removeDialog(mSkillDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mSkillDialog);
|
||||||
mSkillDialog = 0;
|
mSkillDialog = 0;
|
||||||
|
|
||||||
mWindowManager.removeDialog(mDescDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mDescDialog);
|
||||||
mDescDialog = 0;
|
mDescDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateClassDialog::onSpecializationClicked(MyGUI::Widget* _sender)
|
void CreateClassDialog::onSpecializationClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
delete mSpecDialog;
|
delete mSpecDialog;
|
||||||
mSpecDialog = new SelectSpecializationDialog(mWindowManager);
|
mSpecDialog = new SelectSpecializationDialog();
|
||||||
mSpecDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
mSpecDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
||||||
mSpecDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationSelected);
|
mSpecDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationSelected);
|
||||||
mSpecDialog->setVisible(true);
|
mSpecDialog->setVisible(true);
|
||||||
|
@ -558,7 +551,7 @@ void CreateClassDialog::onSpecializationSelected()
|
||||||
mSpecializationId = mSpecDialog->getSpecializationId();
|
mSpecializationId = mSpecDialog->getSpecializationId();
|
||||||
setSpecialization(mSpecializationId);
|
setSpecialization(mSpecializationId);
|
||||||
|
|
||||||
mWindowManager.removeDialog(mSpecDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mSpecDialog);
|
||||||
mSpecDialog = 0;
|
mSpecDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,7 +563,7 @@ void CreateClassDialog::setSpecialization(int id)
|
||||||
"sSpecializationMagic",
|
"sSpecializationMagic",
|
||||||
"sSpecializationStealth"
|
"sSpecializationStealth"
|
||||||
};
|
};
|
||||||
std::string specName = mWindowManager.getGameSettingString(specIds[mSpecializationId], specIds[mSpecializationId]);
|
std::string specName = MWBase::Environment::get().getWindowManager()->getGameSettingString(specIds[mSpecializationId], specIds[mSpecializationId]);
|
||||||
mSpecializationName->setCaption(specName);
|
mSpecializationName->setCaption(specName);
|
||||||
ToolTips::createSpecializationToolTip(mSpecializationName, specName, mSpecializationId);
|
ToolTips::createSpecializationToolTip(mSpecializationName, specName, mSpecializationId);
|
||||||
}
|
}
|
||||||
|
@ -578,7 +571,7 @@ void CreateClassDialog::setSpecialization(int id)
|
||||||
void CreateClassDialog::onAttributeClicked(Widgets::MWAttributePtr _sender)
|
void CreateClassDialog::onAttributeClicked(Widgets::MWAttributePtr _sender)
|
||||||
{
|
{
|
||||||
delete mAttribDialog;
|
delete mAttribDialog;
|
||||||
mAttribDialog = new SelectAttributeDialog(mWindowManager);
|
mAttribDialog = new SelectAttributeDialog();
|
||||||
mAffectedAttribute = _sender;
|
mAffectedAttribute = _sender;
|
||||||
mAttribDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
mAttribDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
||||||
mAttribDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeSelected);
|
mAttribDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeSelected);
|
||||||
|
@ -599,7 +592,7 @@ void CreateClassDialog::onAttributeSelected()
|
||||||
mFavoriteAttribute0->setAttributeId(mFavoriteAttribute1->getAttributeId());
|
mFavoriteAttribute0->setAttributeId(mFavoriteAttribute1->getAttributeId());
|
||||||
}
|
}
|
||||||
mAffectedAttribute->setAttributeId(id);
|
mAffectedAttribute->setAttributeId(id);
|
||||||
mWindowManager.removeDialog(mAttribDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mAttribDialog);
|
||||||
mAttribDialog = 0;
|
mAttribDialog = 0;
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
@ -608,7 +601,7 @@ void CreateClassDialog::onAttributeSelected()
|
||||||
void CreateClassDialog::onSkillClicked(Widgets::MWSkillPtr _sender)
|
void CreateClassDialog::onSkillClicked(Widgets::MWSkillPtr _sender)
|
||||||
{
|
{
|
||||||
delete mSkillDialog;
|
delete mSkillDialog;
|
||||||
mSkillDialog = new SelectSkillDialog(mWindowManager);
|
mSkillDialog = new SelectSkillDialog();
|
||||||
mAffectedSkill = _sender;
|
mAffectedSkill = _sender;
|
||||||
mSkillDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
mSkillDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
|
||||||
mSkillDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSkillSelected);
|
mSkillDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSkillSelected);
|
||||||
|
@ -633,14 +626,14 @@ void CreateClassDialog::onSkillSelected()
|
||||||
}
|
}
|
||||||
|
|
||||||
mAffectedSkill->setSkillId(mSkillDialog->getSkillId());
|
mAffectedSkill->setSkillId(mSkillDialog->getSkillId());
|
||||||
mWindowManager.removeDialog(mSkillDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mSkillDialog);
|
||||||
mSkillDialog = 0;
|
mSkillDialog = 0;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateClassDialog::onDescriptionClicked(MyGUI::Widget* _sender)
|
void CreateClassDialog::onDescriptionClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
mDescDialog = new DescriptionDialog(mWindowManager);
|
mDescDialog = new DescriptionDialog();
|
||||||
mDescDialog->setTextInput(mDescription);
|
mDescDialog->setTextInput(mDescription);
|
||||||
mDescDialog->eventDone += MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionEntered);
|
mDescDialog->eventDone += MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionEntered);
|
||||||
mDescDialog->setVisible(true);
|
mDescDialog->setVisible(true);
|
||||||
|
@ -649,7 +642,7 @@ void CreateClassDialog::onDescriptionClicked(MyGUI::Widget* _sender)
|
||||||
void CreateClassDialog::onDescriptionEntered(WindowBase* parWindow)
|
void CreateClassDialog::onDescriptionEntered(WindowBase* parWindow)
|
||||||
{
|
{
|
||||||
mDescription = mDescDialog->getTextInput();
|
mDescription = mDescDialog->getTextInput();
|
||||||
mWindowManager.removeDialog(mDescDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mDescDialog);
|
||||||
mDescDialog = 0;
|
mDescDialog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -667,20 +660,20 @@ void CreateClassDialog::onBackClicked(MyGUI::Widget* _sender)
|
||||||
|
|
||||||
/* SelectSpecializationDialog */
|
/* SelectSpecializationDialog */
|
||||||
|
|
||||||
SelectSpecializationDialog::SelectSpecializationDialog(MWBase::WindowManager& parWindowManager)
|
SelectSpecializationDialog::SelectSpecializationDialog()
|
||||||
: WindowModal("openmw_chargen_select_specialization.layout", parWindowManager)
|
: WindowModal("openmw_chargen_select_specialization.layout")
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
|
||||||
setText("LabelT", mWindowManager.getGameSettingString("sSpecializationMenu1", ""));
|
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationMenu1", ""));
|
||||||
|
|
||||||
getWidget(mSpecialization0, "Specialization0");
|
getWidget(mSpecialization0, "Specialization0");
|
||||||
getWidget(mSpecialization1, "Specialization1");
|
getWidget(mSpecialization1, "Specialization1");
|
||||||
getWidget(mSpecialization2, "Specialization2");
|
getWidget(mSpecialization2, "Specialization2");
|
||||||
std::string combat = mWindowManager.getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Combat], "");
|
std::string combat = MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Combat], "");
|
||||||
std::string magic = mWindowManager.getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Magic], "");
|
std::string magic = MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Magic], "");
|
||||||
std::string stealth = mWindowManager.getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Stealth], "");
|
std::string stealth = MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Stealth], "");
|
||||||
|
|
||||||
mSpecialization0->setCaption(combat);
|
mSpecialization0->setCaption(combat);
|
||||||
mSpecialization0->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
mSpecialization0->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
|
||||||
|
@ -696,7 +689,7 @@ SelectSpecializationDialog::SelectSpecializationDialog(MWBase::WindowManager& pa
|
||||||
|
|
||||||
MyGUI::Button* cancelButton;
|
MyGUI::Button* cancelButton;
|
||||||
getWidget(cancelButton, "CancelButton");
|
getWidget(cancelButton, "CancelButton");
|
||||||
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
|
cancelButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sCancel", ""));
|
||||||
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
|
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,13 +720,13 @@ void SelectSpecializationDialog::onCancelClicked(MyGUI::Widget* _sender)
|
||||||
|
|
||||||
/* SelectAttributeDialog */
|
/* SelectAttributeDialog */
|
||||||
|
|
||||||
SelectAttributeDialog::SelectAttributeDialog(MWBase::WindowManager& parWindowManager)
|
SelectAttributeDialog::SelectAttributeDialog()
|
||||||
: WindowModal("openmw_chargen_select_attribute.layout", parWindowManager)
|
: WindowModal("openmw_chargen_select_attribute.layout")
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
|
||||||
setText("LabelT", mWindowManager.getGameSettingString("sAttributesMenu1", ""));
|
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sAttributesMenu1", ""));
|
||||||
|
|
||||||
for (int i = 0; i < 8; ++i)
|
for (int i = 0; i < 8; ++i)
|
||||||
{
|
{
|
||||||
|
@ -741,7 +734,6 @@ SelectAttributeDialog::SelectAttributeDialog(MWBase::WindowManager& parWindowMan
|
||||||
char theIndex = '0'+i;
|
char theIndex = '0'+i;
|
||||||
|
|
||||||
getWidget(attribute, std::string("Attribute").append(1, theIndex));
|
getWidget(attribute, std::string("Attribute").append(1, theIndex));
|
||||||
attribute->setWindowManager(&parWindowManager);
|
|
||||||
attribute->setAttributeId(ESM::Attribute::sAttributeIds[i]);
|
attribute->setAttributeId(ESM::Attribute::sAttributeIds[i]);
|
||||||
attribute->eventClicked += MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
|
attribute->eventClicked += MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
|
||||||
ToolTips::createAttributeToolTip(attribute, attribute->getAttributeId());
|
ToolTips::createAttributeToolTip(attribute, attribute->getAttributeId());
|
||||||
|
@ -749,7 +741,7 @@ SelectAttributeDialog::SelectAttributeDialog(MWBase::WindowManager& parWindowMan
|
||||||
|
|
||||||
MyGUI::Button* cancelButton;
|
MyGUI::Button* cancelButton;
|
||||||
getWidget(cancelButton, "CancelButton");
|
getWidget(cancelButton, "CancelButton");
|
||||||
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
|
cancelButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sCancel", ""));
|
||||||
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
|
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -774,16 +766,16 @@ void SelectAttributeDialog::onCancelClicked(MyGUI::Widget* _sender)
|
||||||
|
|
||||||
/* SelectSkillDialog */
|
/* SelectSkillDialog */
|
||||||
|
|
||||||
SelectSkillDialog::SelectSkillDialog(MWBase::WindowManager& parWindowManager)
|
SelectSkillDialog::SelectSkillDialog()
|
||||||
: WindowModal("openmw_chargen_select_skill.layout", parWindowManager)
|
: WindowModal("openmw_chargen_select_skill.layout")
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
|
||||||
setText("LabelT", mWindowManager.getGameSettingString("sSkillsMenu1", ""));
|
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSkillsMenu1", ""));
|
||||||
setText("CombatLabelT", mWindowManager.getGameSettingString("sSpecializationCombat", ""));
|
setText("CombatLabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationCombat", ""));
|
||||||
setText("MagicLabelT", mWindowManager.getGameSettingString("sSpecializationMagic", ""));
|
setText("MagicLabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationMagic", ""));
|
||||||
setText("StealthLabelT", mWindowManager.getGameSettingString("sSpecializationStealth", ""));
|
setText("StealthLabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationStealth", ""));
|
||||||
|
|
||||||
for(int i = 0; i < 9; i++)
|
for(int i = 0; i < 9; i++)
|
||||||
{
|
{
|
||||||
|
@ -833,7 +825,6 @@ SelectSkillDialog::SelectSkillDialog(MWBase::WindowManager& parWindowManager)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 9; ++i)
|
for (int i = 0; i < 9; ++i)
|
||||||
{
|
{
|
||||||
mSkills[spec][i].widget->setWindowManager(&mWindowManager);
|
|
||||||
mSkills[spec][i].widget->setSkillId(mSkills[spec][i].skillId);
|
mSkills[spec][i].widget->setSkillId(mSkills[spec][i].skillId);
|
||||||
mSkills[spec][i].widget->eventClicked += MyGUI::newDelegate(this, &SelectSkillDialog::onSkillClicked);
|
mSkills[spec][i].widget->eventClicked += MyGUI::newDelegate(this, &SelectSkillDialog::onSkillClicked);
|
||||||
ToolTips::createSkillToolTip(mSkills[spec][i].widget, mSkills[spec][i].widget->getSkillId());
|
ToolTips::createSkillToolTip(mSkills[spec][i].widget, mSkills[spec][i].widget->getSkillId());
|
||||||
|
@ -842,7 +833,7 @@ SelectSkillDialog::SelectSkillDialog(MWBase::WindowManager& parWindowManager)
|
||||||
|
|
||||||
MyGUI::Button* cancelButton;
|
MyGUI::Button* cancelButton;
|
||||||
getWidget(cancelButton, "CancelButton");
|
getWidget(cancelButton, "CancelButton");
|
||||||
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
|
cancelButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sCancel", ""));
|
||||||
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
|
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -865,8 +856,8 @@ void SelectSkillDialog::onCancelClicked(MyGUI::Widget* _sender)
|
||||||
|
|
||||||
/* DescriptionDialog */
|
/* DescriptionDialog */
|
||||||
|
|
||||||
DescriptionDialog::DescriptionDialog(MWBase::WindowManager& parWindowManager)
|
DescriptionDialog::DescriptionDialog()
|
||||||
: WindowModal("openmw_chargen_class_description.layout", parWindowManager)
|
: WindowModal("openmw_chargen_class_description.layout")
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
@ -876,7 +867,7 @@ DescriptionDialog::DescriptionDialog(MWBase::WindowManager& parWindowManager)
|
||||||
MyGUI::Button* okButton;
|
MyGUI::Button* okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &DescriptionDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &DescriptionDialog::onOkClicked);
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sInputMenu1", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sInputMenu1", ""));
|
||||||
|
|
||||||
// Make sure the edit box has focus
|
// Make sure the edit box has focus
|
||||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
|
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "widgets.hpp"
|
#include "widgets.hpp"
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This file contains the dialogs for choosing a class.
|
This file contains the dialogs for choosing a class.
|
||||||
|
@ -15,7 +15,7 @@ namespace MWGui
|
||||||
class InfoBoxDialog : public WindowModal
|
class InfoBoxDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoBoxDialog(MWBase::WindowManager& parWindowManager);
|
InfoBoxDialog();
|
||||||
|
|
||||||
typedef std::vector<std::string> ButtonList;
|
typedef std::vector<std::string> ButtonList;
|
||||||
|
|
||||||
|
@ -60,13 +60,13 @@ namespace MWGui
|
||||||
Class_Create = 2,
|
Class_Create = 2,
|
||||||
Class_Back = 3
|
Class_Back = 3
|
||||||
};
|
};
|
||||||
ClassChoiceDialog(MWBase::WindowManager& parWindowManager);
|
ClassChoiceDialog();
|
||||||
};
|
};
|
||||||
|
|
||||||
class GenerateClassResultDialog : public WindowModal
|
class GenerateClassResultDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GenerateClassResultDialog(MWBase::WindowManager& parWindowManager);
|
GenerateClassResultDialog();
|
||||||
|
|
||||||
std::string getClassId() const;
|
std::string getClassId() const;
|
||||||
void setClassId(const std::string &classId);
|
void setClassId(const std::string &classId);
|
||||||
|
@ -93,7 +93,7 @@ namespace MWGui
|
||||||
class PickClassDialog : public WindowModal
|
class PickClassDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PickClassDialog(MWBase::WindowManager& parWindowManager);
|
PickClassDialog();
|
||||||
|
|
||||||
const std::string &getClassId() const { return mCurrentClassId; }
|
const std::string &getClassId() const { return mCurrentClassId; }
|
||||||
void setClassId(const std::string &classId);
|
void setClassId(const std::string &classId);
|
||||||
|
@ -132,7 +132,7 @@ namespace MWGui
|
||||||
class SelectSpecializationDialog : public WindowModal
|
class SelectSpecializationDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SelectSpecializationDialog(MWBase::WindowManager& parWindowManager);
|
SelectSpecializationDialog();
|
||||||
~SelectSpecializationDialog();
|
~SelectSpecializationDialog();
|
||||||
|
|
||||||
ESM::Class::Specialization getSpecializationId() const { return mSpecializationId; }
|
ESM::Class::Specialization getSpecializationId() const { return mSpecializationId; }
|
||||||
|
@ -163,7 +163,7 @@ namespace MWGui
|
||||||
class SelectAttributeDialog : public WindowModal
|
class SelectAttributeDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SelectAttributeDialog(MWBase::WindowManager& parWindowManager);
|
SelectAttributeDialog();
|
||||||
~SelectAttributeDialog();
|
~SelectAttributeDialog();
|
||||||
|
|
||||||
ESM::Attribute::AttributeID getAttributeId() const { return mAttributeId; }
|
ESM::Attribute::AttributeID getAttributeId() const { return mAttributeId; }
|
||||||
|
@ -192,7 +192,7 @@ namespace MWGui
|
||||||
class SelectSkillDialog : public WindowModal
|
class SelectSkillDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SelectSkillDialog(MWBase::WindowManager& parWindowManager);
|
SelectSkillDialog();
|
||||||
~SelectSkillDialog();
|
~SelectSkillDialog();
|
||||||
|
|
||||||
ESM::Skill::SkillEnum getSkillId() const { return mSkillId; }
|
ESM::Skill::SkillEnum getSkillId() const { return mSkillId; }
|
||||||
|
@ -225,7 +225,7 @@ namespace MWGui
|
||||||
class DescriptionDialog : public WindowModal
|
class DescriptionDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DescriptionDialog(MWBase::WindowManager& parWindowManager);
|
DescriptionDialog();
|
||||||
~DescriptionDialog();
|
~DescriptionDialog();
|
||||||
|
|
||||||
std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; }
|
std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; }
|
||||||
|
@ -241,7 +241,7 @@ namespace MWGui
|
||||||
class CreateClassDialog : public WindowModal
|
class CreateClassDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CreateClassDialog(MWBase::WindowManager& parWindowManager);
|
CreateClassDialog();
|
||||||
virtual ~CreateClassDialog();
|
virtual ~CreateClassDialog();
|
||||||
|
|
||||||
std::string getName() const;
|
std::string getName() const;
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
CompanionWindow::CompanionWindow(MWBase::WindowManager &parWindowManager, DragAndDrop *dragAndDrop, MessageBoxManager* manager)
|
CompanionWindow::CompanionWindow(DragAndDrop *dragAndDrop, MessageBoxManager* manager)
|
||||||
: ContainerBase(dragAndDrop)
|
: ContainerBase(dragAndDrop)
|
||||||
, WindowBase("openmw_companion_window.layout", parWindowManager)
|
, WindowBase("openmw_companion_window.layout")
|
||||||
, mMessageBoxManager(manager)
|
, mMessageBoxManager(manager)
|
||||||
{
|
{
|
||||||
MyGUI::ScrollView* itemView;
|
MyGUI::ScrollView* itemView;
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace MWGui
|
||||||
class CompanionWindow : public ContainerBase, public WindowBase
|
class CompanionWindow : public ContainerBase, public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CompanionWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop, MessageBoxManager* manager);
|
CompanionWindow(DragAndDrop* dragAndDrop, MessageBoxManager* manager);
|
||||||
virtual ~CompanionWindow() {}
|
virtual ~CompanionWindow() {}
|
||||||
|
|
||||||
void open(MWWorld::Ptr npc);
|
void open(MWWorld::Ptr npc);
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
ConfirmationDialog::ConfirmationDialog(MWBase::WindowManager& parWindowManager) :
|
ConfirmationDialog::ConfirmationDialog() :
|
||||||
WindowModal("openmw_confirmation_dialog.layout", parWindowManager)
|
WindowModal("openmw_confirmation_dialog.layout")
|
||||||
{
|
{
|
||||||
getWidget(mMessage, "Message");
|
getWidget(mMessage, "Message");
|
||||||
getWidget(mOkButton, "OkButton");
|
getWidget(mOkButton, "OkButton");
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#ifndef MWGUI_CONFIRMATIONDIALOG_H
|
#ifndef MWGUI_CONFIRMATIONDIALOG_H
|
||||||
#define MWGUI_CONFIRMATIONDIALOG_H
|
#define MWGUI_CONFIRMATIONDIALOG_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
class ConfirmationDialog : public WindowModal
|
class ConfirmationDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConfirmationDialog(MWBase::WindowManager& parWindowManager);
|
ConfirmationDialog();
|
||||||
void open(const std::string& message);
|
void open(const std::string& message);
|
||||||
|
|
||||||
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
|
@ -649,9 +649,9 @@ MWWorld::ContainerStore& ContainerBase::getContainerStore()
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
ContainerWindow::ContainerWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop)
|
ContainerWindow::ContainerWindow(DragAndDrop* dragAndDrop)
|
||||||
: ContainerBase(dragAndDrop)
|
: ContainerBase(dragAndDrop)
|
||||||
, WindowBase("openmw_container_window.layout", parWindowManager)
|
, WindowBase("openmw_container_window.layout")
|
||||||
{
|
{
|
||||||
getWidget(mDisposeCorpseButton, "DisposeCorpseButton");
|
getWidget(mDisposeCorpseButton, "DisposeCorpseButton");
|
||||||
getWidget(mTakeButton, "TakeButton");
|
getWidget(mTakeButton, "TakeButton");
|
||||||
|
@ -751,7 +751,7 @@ void ContainerWindow::onDisposeCorpseButtonClicked(MyGUI::Widget *sender)
|
||||||
|
|
||||||
/// \todo I don't think this is the correct flag to check
|
/// \todo I don't think this is the correct flag to check
|
||||||
if (MWWorld::Class::get(mPtr).isEssential(mPtr))
|
if (MWWorld::Class::get(mPtr).isEssential(mPtr))
|
||||||
mWindowManager.messageBox("#{sDisposeCorpseFail}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sDisposeCorpseFail}");
|
||||||
else
|
else
|
||||||
MWBase::Environment::get().getWorld()->deleteObject(mPtr);
|
MWBase::Environment::get().getWorld()->deleteObject(mPtr);
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
#ifndef MGUI_CONTAINER_H
|
#ifndef MGUI_CONTAINER_H
|
||||||
#define MGUI_CONTAINER_H
|
#define MGUI_CONTAINER_H
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
#include "window_base.hpp"
|
|
||||||
#include "referenceinterface.hpp"
|
#include "referenceinterface.hpp"
|
||||||
|
|
||||||
#include "../mwclass/container.hpp"
|
#include "../mwclass/container.hpp"
|
||||||
#include "../mwworld/ptr.hpp"
|
|
||||||
#include "../mwworld/containerstore.hpp"
|
#include "../mwworld/containerstore.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,7 +131,7 @@ namespace MWGui
|
||||||
class ContainerWindow : public ContainerBase, public WindowBase
|
class ContainerWindow : public ContainerBase, public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ContainerWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop);
|
ContainerWindow(DragAndDrop* dragAndDrop);
|
||||||
|
|
||||||
virtual ~ContainerWindow();
|
virtual ~ContainerWindow();
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
CountDialog::CountDialog(MWBase::WindowManager& parWindowManager) :
|
CountDialog::CountDialog() :
|
||||||
WindowModal("openmw_count_window.layout", parWindowManager)
|
WindowModal("openmw_count_window.layout")
|
||||||
{
|
{
|
||||||
getWidget(mSlider, "CountSlider");
|
getWidget(mSlider, "CountSlider");
|
||||||
getWidget(mItemEdit, "ItemEdit");
|
getWidget(mItemEdit, "ItemEdit");
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#ifndef MWGUI_COUNTDIALOG_H
|
#ifndef MWGUI_COUNTDIALOG_H
|
||||||
#define MWGUI_COUNTDIALOG_H
|
#define MWGUI_COUNTDIALOG_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
class CountDialog : public WindowModal
|
class CountDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CountDialog(MWBase::WindowManager& parWindowManager);
|
CountDialog();
|
||||||
void open(const std::string& item, const std::string& message, const int maxCount);
|
void open(const std::string& item, const std::string& message, const int maxCount);
|
||||||
|
|
||||||
typedef MyGUI::delegates::CMultiDelegate2<MyGUI::Widget*, int> EventHandle_WidgetInt;
|
typedef MyGUI::delegates::CMultiDelegate2<MyGUI::Widget*, int> EventHandle_WidgetInt;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <MyGUI_IPointer.h>
|
#include <MyGUI_IPointer.h>
|
||||||
#include <MyGUI_ResourceImageSet.h>
|
#include <MyGUI_ResourceImageSet.h>
|
||||||
#include <MyGUI_RTTI.h>
|
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include "../mwdialogue/dialoguemanagerimp.hpp"
|
#include "../mwdialogue/dialoguemanagerimp.hpp"
|
||||||
|
|
||||||
#include "dialogue_history.hpp"
|
#include "dialoguehistory.hpp"
|
||||||
#include "widgets.hpp"
|
#include "widgets.hpp"
|
||||||
#include "list.hpp"
|
#include "list.hpp"
|
||||||
#include "tradewindow.hpp"
|
#include "tradewindow.hpp"
|
||||||
|
@ -55,8 +55,8 @@ bool sortByLength (const std::string& left, const std::string& right)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PersuasionDialog::PersuasionDialog(MWBase::WindowManager &parWindowManager)
|
PersuasionDialog::PersuasionDialog()
|
||||||
: WindowModal("openmw_persuasion_dialog.layout", parWindowManager)
|
: WindowModal("openmw_persuasion_dialog.layout")
|
||||||
{
|
{
|
||||||
getWidget(mCancelButton, "CancelButton");
|
getWidget(mCancelButton, "CancelButton");
|
||||||
getWidget(mAdmireButton, "AdmireButton");
|
getWidget(mAdmireButton, "AdmireButton");
|
||||||
|
@ -89,17 +89,17 @@ void PersuasionDialog::onPersuade(MyGUI::Widget *sender)
|
||||||
else if (sender == mTauntButton) type = MWBase::MechanicsManager::PT_Taunt;
|
else if (sender == mTauntButton) type = MWBase::MechanicsManager::PT_Taunt;
|
||||||
else if (sender == mBribe10Button)
|
else if (sender == mBribe10Button)
|
||||||
{
|
{
|
||||||
mWindowManager.getTradeWindow()->addOrRemoveGold(-10);
|
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-10);
|
||||||
type = MWBase::MechanicsManager::PT_Bribe10;
|
type = MWBase::MechanicsManager::PT_Bribe10;
|
||||||
}
|
}
|
||||||
else if (sender == mBribe100Button)
|
else if (sender == mBribe100Button)
|
||||||
{
|
{
|
||||||
mWindowManager.getTradeWindow()->addOrRemoveGold(-100);
|
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-100);
|
||||||
type = MWBase::MechanicsManager::PT_Bribe100;
|
type = MWBase::MechanicsManager::PT_Bribe100;
|
||||||
}
|
}
|
||||||
else /*if (sender == mBribe1000Button)*/
|
else /*if (sender == mBribe1000Button)*/
|
||||||
{
|
{
|
||||||
mWindowManager.getTradeWindow()->addOrRemoveGold(-1000);
|
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-1000);
|
||||||
type = MWBase::MechanicsManager::PT_Bribe1000;
|
type = MWBase::MechanicsManager::PT_Bribe1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ void PersuasionDialog::open()
|
||||||
WindowModal::open();
|
WindowModal::open();
|
||||||
center();
|
center();
|
||||||
|
|
||||||
int playerGold = mWindowManager.getInventoryWindow()->getPlayerGold();
|
int playerGold = MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold();
|
||||||
|
|
||||||
mBribe10Button->setEnabled (playerGold >= 10);
|
mBribe10Button->setEnabled (playerGold >= 10);
|
||||||
mBribe100Button->setEnabled (playerGold >= 100);
|
mBribe100Button->setEnabled (playerGold >= 100);
|
||||||
|
@ -124,9 +124,9 @@ void PersuasionDialog::open()
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
DialogueWindow::DialogueWindow(MWBase::WindowManager& parWindowManager)
|
DialogueWindow::DialogueWindow()
|
||||||
: WindowBase("openmw_dialogue_window.layout", parWindowManager)
|
: WindowBase("openmw_dialogue_window.layout")
|
||||||
, mPersuasionDialog(parWindowManager)
|
, mPersuasionDialog()
|
||||||
, mEnabled(false)
|
, mEnabled(false)
|
||||||
, mServices(0)
|
, mServices(0)
|
||||||
{
|
{
|
||||||
|
@ -251,45 +251,45 @@ void DialogueWindow::onSelectTopic(const std::string& topic, int id)
|
||||||
}
|
}
|
||||||
else if (topic == gmst.find("sCompanionShare")->getString())
|
else if (topic == gmst.find("sCompanionShare")->getString())
|
||||||
{
|
{
|
||||||
mWindowManager.pushGuiMode(GM_Companion);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Companion);
|
||||||
mWindowManager.showCompanionWindow(mPtr);
|
MWBase::Environment::get().getWindowManager()->showCompanionWindow(mPtr);
|
||||||
}
|
}
|
||||||
else if (!MWBase::Environment::get().getDialogueManager()->checkServiceRefused())
|
else if (!MWBase::Environment::get().getDialogueManager()->checkServiceRefused())
|
||||||
{
|
{
|
||||||
if (topic == gmst.find("sBarter")->getString())
|
if (topic == gmst.find("sBarter")->getString())
|
||||||
{
|
{
|
||||||
mWindowManager.pushGuiMode(GM_Barter);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Barter);
|
||||||
mWindowManager.getTradeWindow()->startTrade(mPtr);
|
MWBase::Environment::get().getWindowManager()->getTradeWindow()->startTrade(mPtr);
|
||||||
}
|
}
|
||||||
else if (topic == gmst.find("sSpells")->getString())
|
else if (topic == gmst.find("sSpells")->getString())
|
||||||
{
|
{
|
||||||
mWindowManager.pushGuiMode(GM_SpellBuying);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_SpellBuying);
|
||||||
mWindowManager.getSpellBuyingWindow()->startSpellBuying(mPtr);
|
MWBase::Environment::get().getWindowManager()->getSpellBuyingWindow()->startSpellBuying(mPtr);
|
||||||
}
|
}
|
||||||
else if (topic == gmst.find("sTravel")->getString())
|
else if (topic == gmst.find("sTravel")->getString())
|
||||||
{
|
{
|
||||||
mWindowManager.pushGuiMode(GM_Travel);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Travel);
|
||||||
mWindowManager.getTravelWindow()->startTravel(mPtr);
|
MWBase::Environment::get().getWindowManager()->getTravelWindow()->startTravel(mPtr);
|
||||||
}
|
}
|
||||||
else if (topic == gmst.find("sSpellMakingMenuTitle")->getString())
|
else if (topic == gmst.find("sSpellMakingMenuTitle")->getString())
|
||||||
{
|
{
|
||||||
mWindowManager.pushGuiMode(GM_SpellCreation);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_SpellCreation);
|
||||||
mWindowManager.startSpellMaking (mPtr);
|
MWBase::Environment::get().getWindowManager()->startSpellMaking (mPtr);
|
||||||
}
|
}
|
||||||
else if (topic == gmst.find("sEnchanting")->getString())
|
else if (topic == gmst.find("sEnchanting")->getString())
|
||||||
{
|
{
|
||||||
mWindowManager.pushGuiMode(GM_Enchanting);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Enchanting);
|
||||||
mWindowManager.startEnchanting (mPtr);
|
MWBase::Environment::get().getWindowManager()->startEnchanting (mPtr);
|
||||||
}
|
}
|
||||||
else if (topic == gmst.find("sServiceTrainingTitle")->getString())
|
else if (topic == gmst.find("sServiceTrainingTitle")->getString())
|
||||||
{
|
{
|
||||||
mWindowManager.pushGuiMode(GM_Training);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Training);
|
||||||
mWindowManager.startTraining (mPtr);
|
MWBase::Environment::get().getWindowManager()->startTraining (mPtr);
|
||||||
}
|
}
|
||||||
else if (topic == gmst.find("sRepair")->getString())
|
else if (topic == gmst.find("sRepair")->getString())
|
||||||
{
|
{
|
||||||
mWindowManager.pushGuiMode(GM_MerchantRepair);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_MerchantRepair);
|
||||||
mWindowManager.startRepair (mPtr);
|
MWBase::Environment::get().getWindowManager()->startRepair (mPtr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -456,7 +456,7 @@ std::string DialogueWindow::parseText(const std::string& text)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( !mWindowManager.getTranslationDataStorage().hasTranslation() )
|
if( !MWBase::Environment::get().getWindowManager()->getTranslationDataStorage().hasTranslation() )
|
||||||
{
|
{
|
||||||
for(std::vector<std::string>::const_iterator it = topics.begin(); it != topics.end(); ++it)
|
for(std::vector<std::string>::const_iterator it = topics.begin(); it != topics.end(); ++it)
|
||||||
{
|
{
|
||||||
|
@ -528,7 +528,7 @@ void DialogueWindow::goodbye()
|
||||||
|
|
||||||
void DialogueWindow::onReferenceUnavailable()
|
void DialogueWindow::onReferenceUnavailable()
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode(GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueWindow::onFrame()
|
void DialogueWindow::onFrame()
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
#ifndef MWGUI_DIALOGE_H
|
#ifndef MWGUI_DIALOGE_H
|
||||||
#define MWGUI_DIALOGE_H
|
#define MWGUI_DIALOGE_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
#include "referenceinterface.hpp"
|
#include "referenceinterface.hpp"
|
||||||
#include <boost/array.hpp>
|
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
@ -29,7 +26,7 @@ namespace MWGui
|
||||||
class PersuasionDialog : public WindowModal
|
class PersuasionDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PersuasionDialog(MWBase::WindowManager& parWindowManager);
|
PersuasionDialog();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
@ -50,7 +47,7 @@ namespace MWGui
|
||||||
class DialogueWindow: public WindowBase, public ReferenceInterface
|
class DialogueWindow: public WindowBase, public ReferenceInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DialogueWindow(MWBase::WindowManager& parWindowManager);
|
DialogueWindow();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "dialogue_history.hpp"
|
#include "dialoguehistory.hpp"
|
||||||
|
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#ifndef MWGUI_DIALOGE_HISTORY_H
|
#ifndef MWGUI_DIALOGE_HISTORY_H
|
||||||
#define MWGUI_DIALOGE_HISTORY_H
|
#define MWGUI_DIALOGE_HISTORY_H
|
||||||
|
|
||||||
#include <openengine/gui/layout.hpp>
|
#include <openengine/gui/layout.hpp>
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
|
@ -15,9 +15,9 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
EnchantingDialog::EnchantingDialog(MWBase::WindowManager &parWindowManager)
|
EnchantingDialog::EnchantingDialog()
|
||||||
: WindowBase("openmw_enchanting_dialog.layout", parWindowManager)
|
: WindowBase("openmw_enchanting_dialog.layout")
|
||||||
, EffectEditorBase(parWindowManager)
|
, EffectEditorBase()
|
||||||
, mItemSelectionDialog(NULL)
|
, mItemSelectionDialog(NULL)
|
||||||
{
|
{
|
||||||
getWidget(mName, "NameEdit");
|
getWidget(mName, "NameEdit");
|
||||||
|
@ -69,19 +69,19 @@ namespace MWGui
|
||||||
switch(mEnchanting.getEnchantType())
|
switch(mEnchanting.getEnchantType())
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
mTypeButton->setCaption(mWindowManager.getGameSettingString("sItemCastOnce","Cast Once"));
|
mTypeButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sItemCastOnce","Cast Once"));
|
||||||
mAddEffectDialog.constantEffect=false;
|
mAddEffectDialog.constantEffect=false;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
mTypeButton->setCaption(mWindowManager.getGameSettingString("sItemCastWhenStrikes", "When Strikes"));
|
mTypeButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sItemCastWhenStrikes", "When Strikes"));
|
||||||
mAddEffectDialog.constantEffect=false;
|
mAddEffectDialog.constantEffect=false;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
mTypeButton->setCaption(mWindowManager.getGameSettingString("sItemCastWhenUsed", "When Used"));
|
mTypeButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sItemCastWhenUsed", "When Used"));
|
||||||
mAddEffectDialog.constantEffect=false;
|
mAddEffectDialog.constantEffect=false;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
mTypeButton->setCaption(mWindowManager.getGameSettingString("sItemCastConstant", "Cast Constant"));
|
mTypeButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sItemCastConstant", "Cast Constant"));
|
||||||
mAddEffectDialog.constantEffect=true;
|
mAddEffectDialog.constantEffect=true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -126,20 +126,20 @@ namespace MWGui
|
||||||
|
|
||||||
void EnchantingDialog::onReferenceUnavailable ()
|
void EnchantingDialog::onReferenceUnavailable ()
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode (GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Dialogue);
|
||||||
mWindowManager.removeGuiMode (GM_Enchanting);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnchantingDialog::onCancelButtonClicked(MyGUI::Widget* sender)
|
void EnchantingDialog::onCancelButtonClicked(MyGUI::Widget* sender)
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode (GM_Enchanting);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnchantingDialog::onSelectItem(MyGUI::Widget *sender)
|
void EnchantingDialog::onSelectItem(MyGUI::Widget *sender)
|
||||||
{
|
{
|
||||||
delete mItemSelectionDialog;
|
delete mItemSelectionDialog;
|
||||||
mItemSelectionDialog = new ItemSelectionDialog("#{sEnchantItems}",
|
mItemSelectionDialog = new ItemSelectionDialog("#{sEnchantItems}",
|
||||||
ContainerBase::Filter_Apparel|ContainerBase::Filter_Weapon|ContainerBase::Filter_NoMagic, mWindowManager);
|
ContainerBase::Filter_Apparel|ContainerBase::Filter_Weapon|ContainerBase::Filter_NoMagic);
|
||||||
mItemSelectionDialog->eventItemSelected += MyGUI::newDelegate(this, &EnchantingDialog::onItemSelected);
|
mItemSelectionDialog->eventItemSelected += MyGUI::newDelegate(this, &EnchantingDialog::onItemSelected);
|
||||||
mItemSelectionDialog->eventDialogCanceled += MyGUI::newDelegate(this, &EnchantingDialog::onItemCancel);
|
mItemSelectionDialog->eventDialogCanceled += MyGUI::newDelegate(this, &EnchantingDialog::onItemCancel);
|
||||||
mItemSelectionDialog->setVisible(true);
|
mItemSelectionDialog->setVisible(true);
|
||||||
|
@ -190,7 +190,7 @@ namespace MWGui
|
||||||
|
|
||||||
if(mEnchanting.getGemCharge()==0)
|
if(mEnchanting.getGemCharge()==0)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage32}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage32}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,14 +227,14 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
delete mItemSelectionDialog;
|
delete mItemSelectionDialog;
|
||||||
mItemSelectionDialog = new ItemSelectionDialog("#{sSoulGemsWithSouls}",
|
mItemSelectionDialog = new ItemSelectionDialog("#{sSoulGemsWithSouls}",
|
||||||
ContainerBase::Filter_Misc|ContainerBase::Filter_ChargedSoulstones, mWindowManager);
|
ContainerBase::Filter_Misc|ContainerBase::Filter_ChargedSoulstones);
|
||||||
mItemSelectionDialog->eventItemSelected += MyGUI::newDelegate(this, &EnchantingDialog::onSoulSelected);
|
mItemSelectionDialog->eventItemSelected += MyGUI::newDelegate(this, &EnchantingDialog::onSoulSelected);
|
||||||
mItemSelectionDialog->eventDialogCanceled += MyGUI::newDelegate(this, &EnchantingDialog::onSoulCancel);
|
mItemSelectionDialog->eventDialogCanceled += MyGUI::newDelegate(this, &EnchantingDialog::onSoulCancel);
|
||||||
mItemSelectionDialog->setVisible(true);
|
mItemSelectionDialog->setVisible(true);
|
||||||
mItemSelectionDialog->openContainer(MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
mItemSelectionDialog->openContainer(MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
||||||
mItemSelectionDialog->drawItems ();
|
mItemSelectionDialog->drawItems ();
|
||||||
|
|
||||||
//mWindowManager.messageBox("#{sInventorySelectNoSoul}");
|
//MWBase::Environment::get().getWindowManager()->messageBox("#{sInventorySelectNoSoul}");
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnchantingDialog::notifyEffectsChanged ()
|
void EnchantingDialog::notifyEffectsChanged ()
|
||||||
|
@ -254,50 +254,50 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
if (mEffects.size() <= 0)
|
if (mEffects.size() <= 0)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage30}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage30}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mName->getCaption ().empty())
|
if (mName->getCaption ().empty())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage10}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage10}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEnchanting.soulEmpty())
|
if (mEnchanting.soulEmpty())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage52}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage52}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEnchanting.itemEmpty())
|
if (mEnchanting.itemEmpty())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage11}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage11}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEnchanting.getEnchantCost() > mEnchanting.getMaxEnchantValue())
|
if (mEnchanting.getEnchantCost() > mEnchanting.getMaxEnchantValue())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage29}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage29}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mEnchanting.setNewItemName(mName->getCaption());
|
mEnchanting.setNewItemName(mName->getCaption());
|
||||||
mEnchanting.setEffect(mEffectList);
|
mEnchanting.setEffect(mEffectList);
|
||||||
|
|
||||||
if (mEnchanting.getEnchantPrice() > mWindowManager.getInventoryWindow()->getPlayerGold())
|
if (mEnchanting.getEnchantPrice() > MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage18}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage18}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int result = mEnchanting.create();
|
int result = mEnchanting.create();
|
||||||
|
|
||||||
if(result==1)
|
if(result==1)
|
||||||
mWindowManager.messageBox ("#{sEnchantmentMenu12}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sEnchantmentMenu12}");
|
||||||
else
|
else
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage34}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage34}");
|
||||||
|
|
||||||
mWindowManager.removeGuiMode (GM_Enchanting);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#ifndef MWGUI_ENCHANTINGDIALOG_H
|
#ifndef MWGUI_ENCHANTINGDIALOG_H
|
||||||
#define MWGUI_ENCHANTINGDIALOG_H
|
#define MWGUI_ENCHANTINGDIALOG_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
|
||||||
#include "referenceinterface.hpp"
|
|
||||||
#include "spellcreationdialog.hpp"
|
#include "spellcreationdialog.hpp"
|
||||||
|
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
@ -17,7 +15,7 @@ namespace MWGui
|
||||||
class EnchantingDialog : public WindowBase, public ReferenceInterface, public EffectEditorBase
|
class EnchantingDialog : public WindowBase, public ReferenceInterface, public EffectEditorBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EnchantingDialog(MWBase::WindowManager& parWindowManager);
|
EnchantingDialog();
|
||||||
virtual ~EnchantingDialog();
|
virtual ~EnchantingDialog();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
#include "map_window.hpp"
|
#include "mapwindow.hpp"
|
||||||
|
|
||||||
#include <openengine/gui/layout.hpp>
|
|
||||||
|
|
||||||
#include "../mwmechanics/stat.hpp"
|
#include "../mwmechanics/stat.hpp"
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryWindow::InventoryWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop)
|
InventoryWindow::InventoryWindow(DragAndDrop* dragAndDrop)
|
||||||
: ContainerBase(dragAndDrop)
|
: ContainerBase(dragAndDrop)
|
||||||
, WindowPinnableBase("openmw_inventory_window.layout", parWindowManager)
|
, WindowPinnableBase("openmw_inventory_window.layout")
|
||||||
, mTrading(false)
|
, mTrading(false)
|
||||||
, mLastXSize(0)
|
, mLastXSize(0)
|
||||||
, mLastYSize(0)
|
, mLastYSize(0)
|
||||||
|
@ -130,7 +130,7 @@ namespace MWGui
|
||||||
|
|
||||||
void InventoryWindow::onPinToggled()
|
void InventoryWindow::onPinToggled()
|
||||||
{
|
{
|
||||||
mWindowManager.setWeaponVisibility(!mPinned);
|
MWBase::Environment::get().getWindowManager()->setWeaponVisibility(!mPinned);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InventoryWindow::onAvatarClicked(MyGUI::Widget* _sender)
|
void InventoryWindow::onAvatarClicked(MyGUI::Widget* _sender)
|
||||||
|
@ -163,13 +163,13 @@ namespace MWGui
|
||||||
// the "Take" button should not be visible.
|
// the "Take" button should not be visible.
|
||||||
// NOTE: the take button is "reset" when the window opens, so we can safely do the following
|
// NOTE: the take button is "reset" when the window opens, so we can safely do the following
|
||||||
// without screwing up future book windows
|
// without screwing up future book windows
|
||||||
mWindowManager.getBookWindow()->setTakeButtonShow(false);
|
MWBase::Environment::get().getWindowManager()->getBookWindow()->setTakeButtonShow(false);
|
||||||
mWindowManager.getScrollWindow()->setTakeButtonShow(false);
|
MWBase::Environment::get().getWindowManager()->getScrollWindow()->setTakeButtonShow(false);
|
||||||
|
|
||||||
mDragAndDrop->mIsOnDragAndDrop = false;
|
mDragAndDrop->mIsOnDragAndDrop = false;
|
||||||
MyGUI::Gui::getInstance().destroyWidget(mDragAndDrop->mDraggedWidget);
|
MyGUI::Gui::getInstance().destroyWidget(mDragAndDrop->mDraggedWidget);
|
||||||
|
|
||||||
mWindowManager.setDragDrop(false);
|
MWBase::Environment::get().getWindowManager()->setDragDrop(false);
|
||||||
|
|
||||||
drawItems();
|
drawItems();
|
||||||
|
|
||||||
|
@ -225,11 +225,11 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
invStore.equip(slot, invStore.end());
|
invStore.equip(slot, invStore.end());
|
||||||
std::string script = MWWorld::Class::get(*it).getScript(*it);
|
std::string script = MWWorld::Class::get(*it).getScript(*it);
|
||||||
|
|
||||||
// Unset OnPCEquip Variable on item's script, if it has a script with that variable declared
|
// Unset OnPCEquip Variable on item's script, if it has a script with that variable declared
|
||||||
if(script != "")
|
if(script != "")
|
||||||
(*it).mRefData->getLocals().setVarByInt(script, "onpcequip", 0);
|
(*it).mRefData->getLocals().setVarByInt(script, "onpcequip", 0);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -286,16 +286,16 @@ namespace MWGui
|
||||||
void InventoryWindow::notifyContentChanged()
|
void InventoryWindow::notifyContentChanged()
|
||||||
{
|
{
|
||||||
// update the spell window just in case new enchanted items were added to inventory
|
// update the spell window just in case new enchanted items were added to inventory
|
||||||
if (mWindowManager.getSpellWindow())
|
if (MWBase::Environment::get().getWindowManager()->getSpellWindow())
|
||||||
mWindowManager.getSpellWindow()->updateSpells();
|
MWBase::Environment::get().getWindowManager()->getSpellWindow()->updateSpells();
|
||||||
|
|
||||||
// update selected weapon icon
|
// update selected weapon icon
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(mPtr).getInventoryStore(mPtr);
|
MWWorld::InventoryStore& invStore = MWWorld::Class::get(mPtr).getInventoryStore(mPtr);
|
||||||
MWWorld::ContainerStoreIterator weaponSlot = invStore.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
MWWorld::ContainerStoreIterator weaponSlot = invStore.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||||
if (weaponSlot == invStore.end())
|
if (weaponSlot == invStore.end())
|
||||||
mWindowManager.unsetSelectedWeapon();
|
MWBase::Environment::get().getWindowManager()->unsetSelectedWeapon();
|
||||||
else
|
else
|
||||||
mWindowManager.setSelectedWeapon(*weaponSlot); /// \todo track weapon durability
|
MWBase::Environment::get().getWindowManager()->setSelectedWeapon(*weaponSlot); /// \todo track weapon durability
|
||||||
|
|
||||||
mPreviewDirty = true;
|
mPreviewDirty = true;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "../mwrender/characterpreview.hpp"
|
#include "../mwrender/characterpreview.hpp"
|
||||||
|
|
||||||
#include "container.hpp"
|
#include "container.hpp"
|
||||||
#include "window_pinnable_base.hpp"
|
#include "windowpinnablebase.hpp"
|
||||||
#include "widgets.hpp"
|
#include "widgets.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
|
@ -12,7 +12,7 @@ namespace MWGui
|
||||||
class InventoryWindow : public ContainerBase, public WindowPinnableBase
|
class InventoryWindow : public ContainerBase, public WindowPinnableBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InventoryWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop);
|
InventoryWindow(DragAndDrop* dragAndDrop);
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
ItemSelectionDialog::ItemSelectionDialog(const std::string &label, int filter, MWBase::WindowManager& parWindowManager)
|
ItemSelectionDialog::ItemSelectionDialog(const std::string &label, int filter)
|
||||||
: ContainerBase(NULL)
|
: ContainerBase(NULL)
|
||||||
, WindowModal("openmw_itemselection_dialog.layout", parWindowManager)
|
, WindowModal("openmw_itemselection_dialog.layout")
|
||||||
{
|
{
|
||||||
mFilter = filter;
|
mFilter = filter;
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
#include "container.hpp"
|
#include "container.hpp"
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
class ItemSelectionDialog : public ContainerBase, public WindowModal
|
class ItemSelectionDialog : public ContainerBase, public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ItemSelectionDialog(const std::string& label, int filter, MWBase::WindowManager& parWindowManager);
|
ItemSelectionDialog(const std::string& label, int filter);
|
||||||
|
|
||||||
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
typedef MyGUI::delegates::CMultiDelegate1<MWWorld::Ptr> EventHandle_Item;
|
typedef MyGUI::delegates::CMultiDelegate1<MWWorld::Ptr> EventHandle_Item;
|
||||||
|
|
|
@ -81,8 +81,8 @@ book formatText(std::string text,book mBook,int maxLine, int lineSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MWGui::JournalWindow::JournalWindow (MWBase::WindowManager& parWindowManager)
|
MWGui::JournalWindow::JournalWindow ()
|
||||||
: WindowBase("openmw_journal.layout", parWindowManager)
|
: WindowBase("openmw_journal.layout")
|
||||||
, mPageNumber(0)
|
, mPageNumber(0)
|
||||||
{
|
{
|
||||||
mMainWidget->setVisible(false);
|
mMainWidget->setVisible(false);
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
#ifndef MWGUI_JOURNAL_H
|
#ifndef MWGUI_JOURNAL_H
|
||||||
#define MWGUI_JOURNAL_H
|
#define MWGUI_JOURNAL_H
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <set>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
#include "imagebutton.hpp"
|
#include "imagebutton.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
|
@ -14,7 +11,7 @@ namespace MWGui
|
||||||
class JournalWindow : public WindowBase
|
class JournalWindow : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
JournalWindow(MWBase::WindowManager& parWindowManager);
|
JournalWindow();
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
LevelupDialog::LevelupDialog(MWBase::WindowManager &parWindowManager)
|
LevelupDialog::LevelupDialog()
|
||||||
: WindowBase("openmw_levelup_dialog.layout", parWindowManager)
|
: WindowBase("openmw_levelup_dialog.layout")
|
||||||
{
|
{
|
||||||
getWidget(mOkButton, "OkButton");
|
getWidget(mOkButton, "OkButton");
|
||||||
getWidget(mClassImage, "ClassImage");
|
getWidget(mClassImage, "ClassImage");
|
||||||
|
@ -183,7 +183,7 @@ namespace MWGui
|
||||||
creatureStats.setLevel (creatureStats.getLevel()+1);
|
creatureStats.setLevel (creatureStats.getLevel()+1);
|
||||||
pcStats.levelUp ();
|
pcStats.levelUp ();
|
||||||
|
|
||||||
mWindowManager.removeGuiMode (GM_Levelup);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Levelup);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_LEVELUPDIALOG_H
|
#ifndef MWGUI_LEVELUPDIALOG_H
|
||||||
#define MWGUI_LEVELUPDIALOG_H
|
#define MWGUI_LEVELUPDIALOG_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ namespace MWGui
|
||||||
class LevelupDialog : public WindowBase
|
class LevelupDialog : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LevelupDialog(MWBase::WindowManager& parWindowManager);
|
LevelupDialog();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef MWGUI_LIST_HPP
|
#ifndef MWGUI_LIST_HPP
|
||||||
#define MWGUI_LIST_HPP
|
#define MWGUI_LIST_HPP
|
||||||
|
|
||||||
#include <MyGUI_Widget.h>
|
|
||||||
#include <MyGUI_ScrollView.h>
|
#include <MyGUI_ScrollView.h>
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
LoadingScreen::LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw, MWBase::WindowManager& parWindowManager)
|
LoadingScreen::LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw)
|
||||||
: mSceneMgr(sceneMgr)
|
: mSceneMgr(sceneMgr)
|
||||||
, mWindow(rw)
|
, mWindow(rw)
|
||||||
, WindowBase("openmw_loading_screen.layout", parWindowManager)
|
, WindowBase("openmw_loading_screen.layout")
|
||||||
, mLoadingOn(false)
|
, mLoadingOn(false)
|
||||||
, mLastRenderTime(0.f)
|
, mLastRenderTime(0.f)
|
||||||
, mLastWallpaperChangeTime(0.f)
|
, mLastWallpaperChangeTime(0.f)
|
||||||
|
@ -195,12 +195,12 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
changeWallpaper();
|
changeWallpaper();
|
||||||
|
|
||||||
mWindowManager.pushGuiMode(GM_LoadingWallpaper);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_LoadingWallpaper);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mBackgroundImage->setImageTexture("");
|
mBackgroundImage->setImageTexture("");
|
||||||
mWindowManager.pushGuiMode(GM_Loading);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Loading);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,8 +211,8 @@ namespace MWGui
|
||||||
mLoadingOn = false;
|
mLoadingOn = false;
|
||||||
mFirstLoad = false;
|
mFirstLoad = false;
|
||||||
|
|
||||||
mWindowManager.removeGuiMode(GM_Loading);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Loading);
|
||||||
mWindowManager.removeGuiMode(GM_LoadingWallpaper);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_LoadingWallpaper);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadingScreen::changeWallpaper ()
|
void LoadingScreen::changeWallpaper ()
|
||||||
|
|
|
@ -2,16 +2,15 @@
|
||||||
#define MWGUI_LOADINGSCREEN_H
|
#define MWGUI_LOADINGSCREEN_H
|
||||||
|
|
||||||
#include <OgreSceneManager.h>
|
#include <OgreSceneManager.h>
|
||||||
#include <OgreResourceGroupManager.h>
|
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
class LoadingScreen : public WindowBase
|
class LoadingScreen : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw, MWBase::WindowManager& parWindowManager);
|
LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw);
|
||||||
virtual ~LoadingScreen();
|
virtual ~LoadingScreen();
|
||||||
|
|
||||||
void setLoadingProgress (const std::string& stage, int depth, int current, int total);
|
void setLoadingProgress (const std::string& stage, int depth, int current, int total);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "map_window.hpp"
|
#include "mapwindow.hpp"
|
||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
|
@ -262,8 +262,8 @@ void LocalMapBase::setPlayerDir(const float x, const float y)
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
MapWindow::MapWindow(MWBase::WindowManager& parWindowManager, const std::string& cacheDir)
|
MapWindow::MapWindow(const std::string& cacheDir)
|
||||||
: MWGui::WindowPinnableBase("openmw_map_window.layout", parWindowManager)
|
: MWGui::WindowPinnableBase("openmw_map_window.layout")
|
||||||
, mGlobal(false)
|
, mGlobal(false)
|
||||||
{
|
{
|
||||||
setCoord(500,0,320,300);
|
setCoord(500,0,320,300);
|
||||||
|
@ -376,7 +376,7 @@ void MapWindow::onWorldButtonClicked(MyGUI::Widget* _sender)
|
||||||
|
|
||||||
void MapWindow::onPinToggled()
|
void MapWindow::onPinToggled()
|
||||||
{
|
{
|
||||||
mWindowManager.setMinimapVisibility(!mPinned);
|
MWBase::Environment::get().getWindowManager()->setMinimapVisibility(!mPinned);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWindow::open()
|
void MapWindow::open()
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_MAPWINDOW_H
|
#ifndef MWGUI_MAPWINDOW_H
|
||||||
#define MWGUI_MAPWINDOW_H
|
#define MWGUI_MAPWINDOW_H
|
||||||
|
|
||||||
#include "window_pinnable_base.hpp"
|
#include "windowpinnablebase.hpp"
|
||||||
|
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
{
|
{
|
||||||
|
@ -65,7 +65,7 @@ namespace MWGui
|
||||||
class MapWindow : public MWGui::WindowPinnableBase, public LocalMapBase
|
class MapWindow : public MWGui::WindowPinnableBase, public LocalMapBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MapWindow(MWBase::WindowManager& parWindowManager, const std::string& cacheDir);
|
MapWindow(const std::string& cacheDir);
|
||||||
virtual ~MapWindow();
|
virtual ~MapWindow();
|
||||||
|
|
||||||
void setCellName(const std::string& cellName);
|
void setCellName(const std::string& cellName);
|
|
@ -19,8 +19,8 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
MerchantRepair::MerchantRepair(MWBase::WindowManager &parWindowManager)
|
MerchantRepair::MerchantRepair()
|
||||||
: WindowBase("openmw_merchantrepair.layout", parWindowManager)
|
: WindowBase("openmw_merchantrepair.layout")
|
||||||
{
|
{
|
||||||
getWidget(mList, "RepairView");
|
getWidget(mList, "RepairView");
|
||||||
getWidget(mOkButton, "OkButton");
|
getWidget(mOkButton, "OkButton");
|
||||||
|
@ -72,7 +72,7 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor)
|
||||||
|
|
||||||
MyGUI::Button* button =
|
MyGUI::Button* button =
|
||||||
mList->createWidget<MyGUI::Button>(
|
mList->createWidget<MyGUI::Button>(
|
||||||
(price>mWindowManager.getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton",
|
(price>MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton",
|
||||||
0,
|
0,
|
||||||
currentY,
|
currentY,
|
||||||
0,
|
0,
|
||||||
|
@ -82,7 +82,7 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor)
|
||||||
|
|
||||||
currentY += 18;
|
currentY += 18;
|
||||||
|
|
||||||
button->setEnabled(price<=mWindowManager.getInventoryWindow()->getPlayerGold());
|
button->setEnabled(price<=MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold());
|
||||||
button->setUserString("Price", boost::lexical_cast<std::string>(price));
|
button->setUserString("Price", boost::lexical_cast<std::string>(price));
|
||||||
button->setUserData(*iter);
|
button->setUserData(*iter);
|
||||||
button->setCaptionWithReplacing(name);
|
button->setCaptionWithReplacing(name);
|
||||||
|
@ -95,7 +95,7 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor)
|
||||||
mList->setCanvasSize (MyGUI::IntSize(mList->getWidth(), std::max(mList->getHeight(), currentY)));
|
mList->setCanvasSize (MyGUI::IntSize(mList->getWidth(), std::max(mList->getHeight(), currentY)));
|
||||||
|
|
||||||
mGoldLabel->setCaptionWithReplacing("#{sGold}: "
|
mGoldLabel->setCaptionWithReplacing("#{sGold}: "
|
||||||
+ boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
|
+ boost::lexical_cast<std::string>(MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MerchantRepair::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
void MerchantRepair::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
||||||
|
@ -120,14 +120,14 @@ void MerchantRepair::onRepairButtonClick(MyGUI::Widget *sender)
|
||||||
MWBase::Environment::get().getSoundManager()->playSound("Repair",1,1);
|
MWBase::Environment::get().getSoundManager()->playSound("Repair",1,1);
|
||||||
|
|
||||||
int price = boost::lexical_cast<int>(sender->getUserString("Price"));
|
int price = boost::lexical_cast<int>(sender->getUserString("Price"));
|
||||||
mWindowManager.getTradeWindow()->addOrRemoveGold(-price);
|
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-price);
|
||||||
|
|
||||||
startRepair(mActor);
|
startRepair(mActor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MerchantRepair::onOkButtonClick(MyGUI::Widget *sender)
|
void MerchantRepair::onOkButtonClick(MyGUI::Widget *sender)
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode(GM_MerchantRepair);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_MerchantRepair);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef OPENMW_MWGUI_MERCHANTREPAIR_H
|
#ifndef OPENMW_MWGUI_MERCHANTREPAIR_H
|
||||||
#define OPENMW_MWGUI_MERCHANTREPAIR_H
|
#define OPENMW_MWGUI_MERCHANTREPAIR_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ namespace MWGui
|
||||||
class MerchantRepair : public WindowBase
|
class MerchantRepair : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MerchantRepair(MWBase::WindowManager &parWindowManager);
|
MerchantRepair();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,8 @@
|
||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
MessageBoxManager::MessageBoxManager (MWBase::WindowManager *windowManager)
|
MessageBoxManager::MessageBoxManager ()
|
||||||
{
|
{
|
||||||
mWindowManager = windowManager;
|
|
||||||
// defines
|
// defines
|
||||||
mMessageBoxSpeed = 0.1;
|
mMessageBoxSpeed = 0.1;
|
||||||
mInterMessageBoxe = NULL;
|
mInterMessageBoxe = NULL;
|
||||||
|
@ -213,7 +212,7 @@ int MessageBox::getHeight ()
|
||||||
|
|
||||||
|
|
||||||
InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector<std::string>& buttons)
|
InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector<std::string>& buttons)
|
||||||
: WindowModal("openmw_interactive_messagebox.layout", *MWBase::Environment::get().getWindowManager())
|
: WindowModal("openmw_interactive_messagebox.layout")
|
||||||
, mMessageBoxManager(parMessageBoxManager)
|
, mMessageBoxManager(parMessageBoxManager)
|
||||||
, mButtonPressed(-1)
|
, mButtonPressed(-1)
|
||||||
{
|
{
|
||||||
|
@ -371,7 +370,7 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
||||||
|
|
||||||
void InteractiveMessageBox::enterPressed()
|
void InteractiveMessageBox::enterPressed()
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string ok = Misc::StringUtils::lowerCase(MyGUI::LanguageManager::getInstance().replaceTags("#{sOK}"));
|
std::string ok = Misc::StringUtils::lowerCase(MyGUI::LanguageManager::getInstance().replaceTags("#{sOK}"));
|
||||||
std::vector<MyGUI::Button*>::const_iterator button;
|
std::vector<MyGUI::Button*>::const_iterator button;
|
||||||
for(button = mButtons.begin(); button != mButtons.end(); ++button)
|
for(button = mButtons.begin(); button != mButtons.end(); ++button)
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#ifndef MWGUI_MESSAGE_BOX_H
|
#ifndef MWGUI_MESSAGE_BOX_H
|
||||||
#define MWGUI_MESSAGE_BOX_H
|
#define MWGUI_MESSAGE_BOX_H
|
||||||
|
|
||||||
#include <openengine/gui/layout.hpp>
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
#include "window_base.hpp"
|
|
||||||
|
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
|
@ -31,7 +29,7 @@ namespace MWGui
|
||||||
class MessageBoxManager
|
class MessageBoxManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MessageBoxManager (MWBase::WindowManager* windowManager);
|
MessageBoxManager ();
|
||||||
void onFrame (float frameDuration);
|
void onFrame (float frameDuration);
|
||||||
void createMessageBox (const std::string& message);
|
void createMessageBox (const std::string& message);
|
||||||
bool createInteractiveMessageBox (const std::string& message, const std::vector<std::string>& buttons);
|
bool createInteractiveMessageBox (const std::string& message, const std::vector<std::string>& buttons);
|
||||||
|
@ -40,7 +38,7 @@ namespace MWGui
|
||||||
void removeMessageBox (float time, MessageBox *msgbox);
|
void removeMessageBox (float time, MessageBox *msgbox);
|
||||||
bool removeMessageBox (MessageBox *msgbox);
|
bool removeMessageBox (MessageBox *msgbox);
|
||||||
void setMessageBoxSpeed (int speed);
|
void setMessageBoxSpeed (int speed);
|
||||||
|
|
||||||
void enterPressed();
|
void enterPressed();
|
||||||
int readPressedButton ();
|
int readPressedButton ();
|
||||||
|
|
||||||
|
@ -51,8 +49,6 @@ namespace MWGui
|
||||||
|
|
||||||
void onButtonPressed(int button) { eventButtonPressed(button); eventButtonPressed.clear(); }
|
void onButtonPressed(int button) { eventButtonPressed(button); eventButtonPressed.clear(); }
|
||||||
|
|
||||||
MWBase::WindowManager *mWindowManager;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<MessageBox*> mMessageBoxes;
|
std::vector<MessageBox*> mMessageBoxes;
|
||||||
InteractiveMessageBox* mInterMessageBoxe;
|
InteractiveMessageBox* mInterMessageBoxe;
|
||||||
|
@ -92,7 +88,7 @@ namespace MWGui
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void buttonActivated (MyGUI::Widget* _widget);
|
void buttonActivated (MyGUI::Widget* _widget);
|
||||||
|
|
||||||
MessageBoxManager& mMessageBoxManager;
|
MessageBoxManager& mMessageBoxManager;
|
||||||
MyGUI::EditBox* mMessageWidget;
|
MyGUI::EditBox* mMessageWidget;
|
||||||
MyGUI::Widget* mButtonsWidget;
|
MyGUI::Widget* mButtonsWidget;
|
||||||
|
|
|
@ -43,8 +43,8 @@ namespace
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
QuickKeysMenu::QuickKeysMenu(MWBase::WindowManager& parWindowManager)
|
QuickKeysMenu::QuickKeysMenu()
|
||||||
: WindowBase("openmw_quickkeys_menu.layout", parWindowManager)
|
: WindowBase("openmw_quickkeys_menu.layout")
|
||||||
, mAssignDialog(0)
|
, mAssignDialog(0)
|
||||||
, mItemSelectionDialog(0)
|
, mItemSelectionDialog(0)
|
||||||
, mMagicSelectionDialog(0)
|
, mMagicSelectionDialog(0)
|
||||||
|
@ -109,14 +109,14 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
// open assign dialog
|
// open assign dialog
|
||||||
if (!mAssignDialog)
|
if (!mAssignDialog)
|
||||||
mAssignDialog = new QuickKeysMenuAssign(mWindowManager, this);
|
mAssignDialog = new QuickKeysMenuAssign(this);
|
||||||
mAssignDialog->setVisible (true);
|
mAssignDialog->setVisible (true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuickKeysMenu::onOkButtonClicked (MyGUI::Widget *sender)
|
void QuickKeysMenu::onOkButtonClicked (MyGUI::Widget *sender)
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode(GM_QuickKeysMenu);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_QuickKeysMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
if (!mItemSelectionDialog )
|
if (!mItemSelectionDialog )
|
||||||
{
|
{
|
||||||
mItemSelectionDialog = new ItemSelectionDialog("#{sQuickMenu6}", ContainerBase::Filter_All, mWindowManager);
|
mItemSelectionDialog = new ItemSelectionDialog("#{sQuickMenu6}", ContainerBase::Filter_All);
|
||||||
mItemSelectionDialog->eventItemSelected += MyGUI::newDelegate(this, &QuickKeysMenu::onAssignItem);
|
mItemSelectionDialog->eventItemSelected += MyGUI::newDelegate(this, &QuickKeysMenu::onAssignItem);
|
||||||
mItemSelectionDialog->eventDialogCanceled += MyGUI::newDelegate(this, &QuickKeysMenu::onAssignItemCancel);
|
mItemSelectionDialog->eventDialogCanceled += MyGUI::newDelegate(this, &QuickKeysMenu::onAssignItemCancel);
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
if (!mMagicSelectionDialog )
|
if (!mMagicSelectionDialog )
|
||||||
{
|
{
|
||||||
mMagicSelectionDialog = new MagicSelectionDialog(mWindowManager, this);
|
mMagicSelectionDialog = new MagicSelectionDialog(this);
|
||||||
}
|
}
|
||||||
mMagicSelectionDialog->setVisible(true);
|
mMagicSelectionDialog->setVisible(true);
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ namespace MWGui
|
||||||
std::string spellId = button->getChildAt(0)->getUserString("Spell");
|
std::string spellId = button->getChildAt(0)->getUserString("Spell");
|
||||||
spells.setSelectedSpell(spellId);
|
spells.setSelectedSpell(spellId);
|
||||||
store.setSelectedEnchantItem(store.end());
|
store.setSelectedEnchantItem(store.end());
|
||||||
mWindowManager.setSelectedSpell(spellId, int(MWMechanics::getSpellSuccessChance(spellId, player)));
|
MWBase::Environment::get().getWindowManager()->setSelectedSpell(spellId, int(MWMechanics::getSpellSuccessChance(spellId, player)));
|
||||||
}
|
}
|
||||||
else if (type == Type_Item)
|
else if (type == Type_Item)
|
||||||
{
|
{
|
||||||
|
@ -303,11 +303,11 @@ namespace MWGui
|
||||||
// the "Take" button should not be visible.
|
// the "Take" button should not be visible.
|
||||||
// NOTE: the take button is "reset" when the window opens, so we can safely do the following
|
// NOTE: the take button is "reset" when the window opens, so we can safely do the following
|
||||||
// without screwing up future book windows
|
// without screwing up future book windows
|
||||||
mWindowManager.getBookWindow()->setTakeButtonShow(false);
|
MWBase::Environment::get().getWindowManager()->getBookWindow()->setTakeButtonShow(false);
|
||||||
mWindowManager.getScrollWindow()->setTakeButtonShow(false);
|
MWBase::Environment::get().getWindowManager()->getScrollWindow()->setTakeButtonShow(false);
|
||||||
|
|
||||||
// since we changed equipping status, update the inventory window
|
// since we changed equipping status, update the inventory window
|
||||||
mWindowManager.getInventoryWindow()->drawItems();
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->drawItems();
|
||||||
}
|
}
|
||||||
else if (type == Type_MagicItem)
|
else if (type == Type_MagicItem)
|
||||||
{
|
{
|
||||||
|
@ -341,19 +341,19 @@ namespace MWGui
|
||||||
action.execute (MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ());
|
action.execute (MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ());
|
||||||
|
|
||||||
// since we changed equipping status, update the inventory window
|
// since we changed equipping status, update the inventory window
|
||||||
mWindowManager.getInventoryWindow()->drawItems();
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->drawItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
store.setSelectedEnchantItem(it);
|
store.setSelectedEnchantItem(it);
|
||||||
spells.setSelectedSpell("");
|
spells.setSelectedSpell("");
|
||||||
mWindowManager.setSelectedEnchantItem(item);
|
MWBase::Environment::get().getWindowManager()->setSelectedEnchantItem(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
QuickKeysMenuAssign::QuickKeysMenuAssign (MWBase::WindowManager &parWindowManager, QuickKeysMenu* parent)
|
QuickKeysMenuAssign::QuickKeysMenuAssign (QuickKeysMenu* parent)
|
||||||
: WindowModal("openmw_quickkeys_menu_assign.layout", parWindowManager)
|
: WindowModal("openmw_quickkeys_menu_assign.layout")
|
||||||
, mParent(parent)
|
, mParent(parent)
|
||||||
{
|
{
|
||||||
getWidget(mLabel, "Label");
|
getWidget(mLabel, "Label");
|
||||||
|
@ -399,8 +399,8 @@ namespace MWGui
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
MagicSelectionDialog::MagicSelectionDialog(MWBase::WindowManager &parWindowManager, QuickKeysMenu* parent)
|
MagicSelectionDialog::MagicSelectionDialog(QuickKeysMenu* parent)
|
||||||
: WindowModal("openmw_magicselection_dialog.layout", parWindowManager)
|
: WindowModal("openmw_magicselection_dialog.layout")
|
||||||
, mParent(parent)
|
, mParent(parent)
|
||||||
, mWidth(0)
|
, mWidth(0)
|
||||||
, mHeight(0)
|
, mHeight(0)
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
#ifndef MWGUI_QUICKKEYS_H
|
#ifndef MWGUI_QUICKKEYS_H
|
||||||
#define MWGUI_QUICKKEYS_H
|
#define MWGUI_QUICKKEYS_H
|
||||||
|
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
@ -16,7 +15,7 @@ namespace MWGui
|
||||||
class QuickKeysMenu : public WindowBase
|
class QuickKeysMenu : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QuickKeysMenu(MWBase::WindowManager& parWindowManager);
|
QuickKeysMenu();
|
||||||
~QuickKeysMenu();
|
~QuickKeysMenu();
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +63,7 @@ namespace MWGui
|
||||||
class QuickKeysMenuAssign : public WindowModal
|
class QuickKeysMenuAssign : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QuickKeysMenuAssign(MWBase::WindowManager& parWindowManager, QuickKeysMenu* parent);
|
QuickKeysMenuAssign(QuickKeysMenu* parent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MyGUI::TextBox* mLabel;
|
MyGUI::TextBox* mLabel;
|
||||||
|
@ -79,7 +78,7 @@ namespace MWGui
|
||||||
class MagicSelectionDialog : public WindowModal
|
class MagicSelectionDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MagicSelectionDialog(MWBase::WindowManager& parWindowManager, QuickKeysMenu* parent);
|
MagicSelectionDialog(QuickKeysMenu* parent);
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,8 @@ int countParts(const std::string &part, const std::string &race, bool male)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
|
RaceDialog::RaceDialog()
|
||||||
: WindowModal("openmw_chargen_race.layout", parWindowManager)
|
: WindowModal("openmw_chargen_race.layout")
|
||||||
, mGenderIndex(0)
|
, mGenderIndex(0)
|
||||||
, mFaceIndex(0)
|
, mFaceIndex(0)
|
||||||
, mHairIndex(0)
|
, mHairIndex(0)
|
||||||
|
@ -74,7 +74,7 @@ RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
|
||||||
setText("AppearanceT", mWindowManager.getGameSettingString("sRaceMenu1", "Appearance"));
|
setText("AppearanceT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu1", "Appearance"));
|
||||||
getWidget(mPreviewImage, "PreviewImage");
|
getWidget(mPreviewImage, "PreviewImage");
|
||||||
|
|
||||||
getWidget(mHeadRotate, "HeadRotate");
|
getWidget(mHeadRotate, "HeadRotate");
|
||||||
|
@ -86,34 +86,34 @@ RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
|
||||||
// Set up next/previous buttons
|
// Set up next/previous buttons
|
||||||
MyGUI::Button *prevButton, *nextButton;
|
MyGUI::Button *prevButton, *nextButton;
|
||||||
|
|
||||||
setText("GenderChoiceT", mWindowManager.getGameSettingString("sRaceMenu2", "Change Sex"));
|
setText("GenderChoiceT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu2", "Change Sex"));
|
||||||
getWidget(prevButton, "PrevGenderButton");
|
getWidget(prevButton, "PrevGenderButton");
|
||||||
getWidget(nextButton, "NextGenderButton");
|
getWidget(nextButton, "NextGenderButton");
|
||||||
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender);
|
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender);
|
||||||
nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextGender);
|
nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextGender);
|
||||||
|
|
||||||
setText("FaceChoiceT", mWindowManager.getGameSettingString("sRaceMenu3", "Change Face"));
|
setText("FaceChoiceT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu3", "Change Face"));
|
||||||
getWidget(prevButton, "PrevFaceButton");
|
getWidget(prevButton, "PrevFaceButton");
|
||||||
getWidget(nextButton, "NextFaceButton");
|
getWidget(nextButton, "NextFaceButton");
|
||||||
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace);
|
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace);
|
||||||
nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextFace);
|
nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextFace);
|
||||||
|
|
||||||
setText("HairChoiceT", mWindowManager.getGameSettingString("sRaceMenu4", "Change Hair"));
|
setText("HairChoiceT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu4", "Change Hair"));
|
||||||
getWidget(prevButton, "PrevHairButton");
|
getWidget(prevButton, "PrevHairButton");
|
||||||
getWidget(nextButton, "NextHairButton");
|
getWidget(nextButton, "NextHairButton");
|
||||||
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair);
|
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair);
|
||||||
nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextHair);
|
nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextHair);
|
||||||
|
|
||||||
setText("RaceT", mWindowManager.getGameSettingString("sRaceMenu5", "Race"));
|
setText("RaceT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu5", "Race"));
|
||||||
getWidget(mRaceList, "RaceList");
|
getWidget(mRaceList, "RaceList");
|
||||||
mRaceList->setScrollVisible(true);
|
mRaceList->setScrollVisible(true);
|
||||||
mRaceList->eventListSelectAccept += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
mRaceList->eventListSelectAccept += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||||
mRaceList->eventListMouseItemActivate += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
mRaceList->eventListMouseItemActivate += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||||
mRaceList->eventListChangePosition += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
mRaceList->eventListChangePosition += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||||
|
|
||||||
setText("SkillsT", mWindowManager.getGameSettingString("sBonusSkillTitle", "Skill Bonus"));
|
setText("SkillsT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sBonusSkillTitle", "Skill Bonus"));
|
||||||
getWidget(mSkillList, "SkillList");
|
getWidget(mSkillList, "SkillList");
|
||||||
setText("SpellPowerT", mWindowManager.getGameSettingString("sRaceMenu7", "Specials"));
|
setText("SpellPowerT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu7", "Specials"));
|
||||||
getWidget(mSpellPowerList, "SpellPowerList");
|
getWidget(mSpellPowerList, "SpellPowerList");
|
||||||
|
|
||||||
MyGUI::Button* backButton;
|
MyGUI::Button* backButton;
|
||||||
|
@ -122,7 +122,7 @@ RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
|
||||||
|
|
||||||
MyGUI::Button* okButton;
|
MyGUI::Button* okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
|
||||||
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onOkClicked);
|
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onOkClicked);
|
||||||
|
|
||||||
updateRaces();
|
updateRaces();
|
||||||
|
@ -136,9 +136,9 @@ void RaceDialog::setNextButtonShow(bool shown)
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
|
|
||||||
if (shown)
|
if (shown)
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sNext", ""));
|
||||||
else
|
else
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RaceDialog::open()
|
void RaceDialog::open()
|
||||||
|
@ -156,7 +156,7 @@ void RaceDialog::open()
|
||||||
const ESM::NPC proto = mPreview->getPrototype();
|
const ESM::NPC proto = mPreview->getPrototype();
|
||||||
setRaceId(proto.mRace);
|
setRaceId(proto.mRace);
|
||||||
recountParts();
|
recountParts();
|
||||||
|
|
||||||
std::string index = proto.mHead.substr(proto.mHead.size() - 2, 2);
|
std::string index = proto.mHead.substr(proto.mHead.size() - 2, 2);
|
||||||
mFaceIndex = boost::lexical_cast<int>(index) - 1;
|
mFaceIndex = boost::lexical_cast<int>(index) - 1;
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ void RaceDialog::updateRaces()
|
||||||
const MWWorld::Store<ESM::Race> &races =
|
const MWWorld::Store<ESM::Race> &races =
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>();
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>();
|
||||||
|
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
MWWorld::Store<ESM::Race>::iterator it = races.begin();
|
MWWorld::Store<ESM::Race>::iterator it = races.begin();
|
||||||
for (; it != races.end(); ++it)
|
for (; it != races.end(); ++it)
|
||||||
|
@ -403,7 +403,6 @@ void RaceDialog::updateSkills()
|
||||||
|
|
||||||
skillWidget = mSkillList->createWidget<MWSkill>("MW_StatNameValue", coord1, MyGUI::Align::Default,
|
skillWidget = mSkillList->createWidget<MWSkill>("MW_StatNameValue", coord1, MyGUI::Align::Default,
|
||||||
std::string("Skill") + boost::lexical_cast<std::string>(i));
|
std::string("Skill") + boost::lexical_cast<std::string>(i));
|
||||||
skillWidget->setWindowManager(&mWindowManager);
|
|
||||||
skillWidget->setSkillNumber(skillId);
|
skillWidget->setSkillNumber(skillId);
|
||||||
skillWidget->setSkillValue(MWSkill::SkillValue(race->mData.mBonus[i].mBonus));
|
skillWidget->setSkillValue(MWSkill::SkillValue(race->mData.mBonus[i].mBonus));
|
||||||
ToolTips::createSkillToolTip(skillWidget, skillId);
|
ToolTips::createSkillToolTip(skillWidget, skillId);
|
||||||
|
@ -439,7 +438,6 @@ void RaceDialog::updateSpellPowers()
|
||||||
{
|
{
|
||||||
const std::string &spellpower = *it;
|
const std::string &spellpower = *it;
|
||||||
spellPowerWidget = mSpellPowerList->createWidget<MWSpell>("MW_StatName", coord, MyGUI::Align::Default, std::string("SpellPower") + boost::lexical_cast<std::string>(i));
|
spellPowerWidget = mSpellPowerList->createWidget<MWSpell>("MW_StatName", coord, MyGUI::Align::Default, std::string("SpellPower") + boost::lexical_cast<std::string>(i));
|
||||||
spellPowerWidget->setWindowManager(&mWindowManager);
|
|
||||||
spellPowerWidget->setSpellId(spellpower);
|
spellPowerWidget->setSpellId(spellpower);
|
||||||
spellPowerWidget->setUserString("ToolTipType", "Spell");
|
spellPowerWidget->setUserString("ToolTipType", "Spell");
|
||||||
spellPowerWidget->setUserString("Spell", spellpower);
|
spellPowerWidget->setUserString("Spell", spellpower);
|
||||||
|
|
|
@ -1,14 +1,9 @@
|
||||||
#ifndef MWGUI_RACE_H
|
#ifndef MWGUI_RACE_H
|
||||||
#define MWGUI_RACE_H
|
#define MWGUI_RACE_H
|
||||||
|
|
||||||
|
|
||||||
#include <boost/array.hpp>
|
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
|
||||||
|
|
||||||
#include "../mwrender/characterpreview.hpp"
|
#include "../mwrender/characterpreview.hpp"
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
|
@ -26,7 +21,7 @@ namespace MWGui
|
||||||
class RaceDialog : public WindowModal
|
class RaceDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RaceDialog(MWBase::WindowManager& parWindowManager);
|
RaceDialog();
|
||||||
|
|
||||||
enum Gender
|
enum Gender
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
Repair::Repair(MWBase::WindowManager &parWindowManager)
|
Repair::Repair()
|
||||||
: WindowBase("openmw_repair.layout", parWindowManager)
|
: WindowBase("openmw_repair.layout")
|
||||||
{
|
{
|
||||||
getWidget(mRepairBox, "RepairBox");
|
getWidget(mRepairBox, "RepairBox");
|
||||||
getWidget(mRepairView, "RepairView");
|
getWidget(mRepairView, "RepairView");
|
||||||
|
@ -133,7 +133,7 @@ void Repair::updateRepairView()
|
||||||
|
|
||||||
void Repair::onCancel(MyGUI::Widget *sender)
|
void Repair::onCancel(MyGUI::Widget *sender)
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode(GM_Repair);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Repair);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Repair::onRepairItem(MyGUI::Widget *sender)
|
void Repair::onRepairItem(MyGUI::Widget *sender)
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
#ifndef OPENMW_MWGUI_REPAIR_H
|
#ifndef OPENMW_MWGUI_REPAIR_H
|
||||||
#define OPENMW_MWGUI_REPAIR_H
|
#define OPENMW_MWGUI_REPAIR_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
|
||||||
#include "../mwmechanics/repair.hpp"
|
#include "../mwmechanics/repair.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
|
@ -12,7 +11,7 @@ namespace MWGui
|
||||||
class Repair : public WindowBase
|
class Repair : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Repair(MWBase::WindowManager &parWindowManager);
|
Repair();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ using namespace Widgets;
|
||||||
|
|
||||||
const int ReviewDialog::sLineHeight = 18;
|
const int ReviewDialog::sLineHeight = 18;
|
||||||
|
|
||||||
ReviewDialog::ReviewDialog(MWBase::WindowManager& parWindowManager)
|
ReviewDialog::ReviewDialog()
|
||||||
: WindowModal("openmw_chargen_review.layout", parWindowManager)
|
: WindowModal("openmw_chargen_review.layout")
|
||||||
, mLastPos(0)
|
, mLastPos(0)
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
|
@ -53,15 +53,15 @@ ReviewDialog::ReviewDialog(MWBase::WindowManager& parWindowManager)
|
||||||
|
|
||||||
// Setup dynamic stats
|
// Setup dynamic stats
|
||||||
getWidget(mHealth, "Health");
|
getWidget(mHealth, "Health");
|
||||||
mHealth->setTitle(mWindowManager.getGameSettingString("sHealth", ""));
|
mHealth->setTitle(MWBase::Environment::get().getWindowManager()->getGameSettingString("sHealth", ""));
|
||||||
mHealth->setValue(45, 45);
|
mHealth->setValue(45, 45);
|
||||||
|
|
||||||
getWidget(mMagicka, "Magicka");
|
getWidget(mMagicka, "Magicka");
|
||||||
mMagicka->setTitle(mWindowManager.getGameSettingString("sMagic", ""));
|
mMagicka->setTitle(MWBase::Environment::get().getWindowManager()->getGameSettingString("sMagic", ""));
|
||||||
mMagicka->setValue(50, 50);
|
mMagicka->setValue(50, 50);
|
||||||
|
|
||||||
getWidget(mFatigue, "Fatigue");
|
getWidget(mFatigue, "Fatigue");
|
||||||
mFatigue->setTitle(mWindowManager.getGameSettingString("sFatigue", ""));
|
mFatigue->setTitle(MWBase::Environment::get().getWindowManager()->getGameSettingString("sFatigue", ""));
|
||||||
mFatigue->setValue(160, 160);
|
mFatigue->setValue(160, 160);
|
||||||
|
|
||||||
// Setup attributes
|
// Setup attributes
|
||||||
|
@ -71,7 +71,6 @@ ReviewDialog::ReviewDialog(MWBase::WindowManager& parWindowManager)
|
||||||
{
|
{
|
||||||
getWidget(attribute, std::string("Attribute") + boost::lexical_cast<std::string>(idx));
|
getWidget(attribute, std::string("Attribute") + boost::lexical_cast<std::string>(idx));
|
||||||
mAttributeWidgets.insert(std::make_pair(static_cast<int>(ESM::Attribute::sAttributeIds[idx]), attribute));
|
mAttributeWidgets.insert(std::make_pair(static_cast<int>(ESM::Attribute::sAttributeIds[idx]), attribute));
|
||||||
attribute->setWindowManager(&mWindowManager);
|
|
||||||
attribute->setAttributeId(ESM::Attribute::sAttributeIds[idx]);
|
attribute->setAttributeId(ESM::Attribute::sAttributeIds[idx]);
|
||||||
attribute->setAttributeValue(MWAttribute::AttributeValue(0, 0));
|
attribute->setAttributeValue(MWAttribute::AttributeValue(0, 0));
|
||||||
}
|
}
|
||||||
|
@ -277,7 +276,7 @@ void ReviewDialog::addSkills(const SkillList &skills, const std::string &titleId
|
||||||
addSeparator(coord1, coord2);
|
addSeparator(coord1, coord2);
|
||||||
}
|
}
|
||||||
|
|
||||||
addGroup(mWindowManager.getGameSettingString(titleId, titleDefault), coord1, coord2);
|
addGroup(MWBase::Environment::get().getWindowManager()->getGameSettingString(titleId, titleDefault), coord1, coord2);
|
||||||
|
|
||||||
SkillList::const_iterator end = skills.end();
|
SkillList::const_iterator end = skills.end();
|
||||||
for (SkillList::const_iterator it = skills.begin(); it != end; ++it)
|
for (SkillList::const_iterator it = skills.begin(); it != end; ++it)
|
||||||
|
@ -296,7 +295,7 @@ void ReviewDialog::addSkills(const SkillList &skills, const std::string &titleId
|
||||||
state = "increased";
|
state = "increased";
|
||||||
else if (modified < base)
|
else if (modified < base)
|
||||||
state = "decreased";
|
state = "decreased";
|
||||||
MyGUI::TextBox* widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), boost::lexical_cast<std::string>(static_cast<int>(modified)), state, coord1, coord2);
|
MyGUI::TextBox* widget = addValueItem(MWBase::Environment::get().getWindowManager()->getGameSettingString(skillNameId, skillNameId), boost::lexical_cast<std::string>(static_cast<int>(modified)), state, coord1, coord2);
|
||||||
|
|
||||||
for (int i=0; i<2; ++i)
|
for (int i=0; i<2; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#ifndef MWGUI_REVIEW_H
|
#ifndef MWGUI_REVIEW_H
|
||||||
#define MWGUI_REVIEW_H
|
#define MWGUI_REVIEW_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
#include "../mwmechanics/stat.hpp"
|
|
||||||
#include "widgets.hpp"
|
#include "widgets.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
|
@ -28,7 +27,7 @@ namespace MWGui
|
||||||
};
|
};
|
||||||
typedef std::vector<int> SkillList;
|
typedef std::vector<int> SkillList;
|
||||||
|
|
||||||
ReviewDialog(MWBase::WindowManager& parWindowManager);
|
ReviewDialog();
|
||||||
|
|
||||||
void setPlayerName(const std::string &name);
|
void setPlayerName(const std::string &name);
|
||||||
void setRace(const std::string &raceId);
|
void setRace(const std::string &raceId);
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
ScrollWindow::ScrollWindow (MWBase::WindowManager& parWindowManager)
|
ScrollWindow::ScrollWindow ()
|
||||||
: WindowBase("openmw_scroll.layout", parWindowManager)
|
: WindowBase("openmw_scroll.layout")
|
||||||
, mTakeButtonShow(true)
|
, mTakeButtonShow(true)
|
||||||
, mTakeButtonAllowed(true)
|
, mTakeButtonAllowed(true)
|
||||||
{
|
{
|
||||||
|
@ -66,7 +66,7 @@ void ScrollWindow::onCloseButtonClicked (MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getSoundManager()->playSound ("scroll", 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound ("scroll", 1.0, 1.0);
|
||||||
|
|
||||||
mWindowManager.removeGuiMode(GM_Scroll);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Scroll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollWindow::onTakeButtonClicked (MyGUI::Widget* _sender)
|
void ScrollWindow::onTakeButtonClicked (MyGUI::Widget* _sender)
|
||||||
|
@ -76,5 +76,5 @@ void ScrollWindow::onTakeButtonClicked (MyGUI::Widget* _sender)
|
||||||
MWWorld::ActionTake take(mScroll);
|
MWWorld::ActionTake take(mScroll);
|
||||||
take.execute (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
take.execute (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
||||||
|
|
||||||
mWindowManager.removeGuiMode(GM_Scroll);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Scroll);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_SCROLLWINDOW_H
|
#ifndef MWGUI_SCROLLWINDOW_H
|
||||||
#define MWGUI_SCROLLWINDOW_H
|
#define MWGUI_SCROLLWINDOW_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
#include "imagebutton.hpp"
|
#include "imagebutton.hpp"
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
|
@ -11,7 +11,7 @@ namespace MWGui
|
||||||
class ScrollWindow : public WindowBase
|
class ScrollWindow : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ScrollWindow (MWBase::WindowManager& parWindowManager);
|
ScrollWindow ();
|
||||||
|
|
||||||
void open (MWWorld::Ptr scroll);
|
void open (MWWorld::Ptr scroll);
|
||||||
void setTakeButtonShow(bool show);
|
void setTakeButtonShow(bool show);
|
||||||
|
|
|
@ -93,8 +93,8 @@ namespace
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
SettingsWindow::SettingsWindow(MWBase::WindowManager& parWindowManager) :
|
SettingsWindow::SettingsWindow() :
|
||||||
WindowBase("openmw_settings_window.layout", parWindowManager)
|
WindowBase("openmw_settings_window.layout")
|
||||||
{
|
{
|
||||||
getWidget(mOkButton, "OkButton");
|
getWidget(mOkButton, "OkButton");
|
||||||
getWidget(mSubtitlesButton, "SubtitlesButton");
|
getWidget(mSubtitlesButton, "SubtitlesButton");
|
||||||
|
@ -272,7 +272,7 @@ namespace MWGui
|
||||||
|
|
||||||
void SettingsWindow::onOkButtonClicked(MyGUI::Widget* _sender)
|
void SettingsWindow::onOkButtonClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode(GM_Settings);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWindow::onResolutionSelected(MyGUI::ListBox* _sender, size_t index)
|
void SettingsWindow::onResolutionSelected(MyGUI::ListBox* _sender, size_t index)
|
||||||
|
@ -280,7 +280,7 @@ namespace MWGui
|
||||||
if (index == MyGUI::ITEM_NONE)
|
if (index == MyGUI::ITEM_NONE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ConfirmationDialog* dialog = mWindowManager.getConfirmationDialog();
|
ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
|
||||||
dialog->open("#{sNotifyMessage67}");
|
dialog->open("#{sNotifyMessage67}");
|
||||||
dialog->eventOkClicked.clear();
|
dialog->eventOkClicked.clear();
|
||||||
dialog->eventOkClicked += MyGUI::newDelegate(this, &SettingsWindow::onResolutionAccept);
|
dialog->eventOkClicked += MyGUI::newDelegate(this, &SettingsWindow::onResolutionAccept);
|
||||||
|
@ -327,8 +327,8 @@ namespace MWGui
|
||||||
|
|
||||||
void SettingsWindow::onButtonToggled(MyGUI::Widget* _sender)
|
void SettingsWindow::onButtonToggled(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
std::string on = mWindowManager.getGameSettingString("sOn", "On");
|
std::string on = MWBase::Environment::get().getWindowManager()->getGameSettingString("sOn", "On");
|
||||||
std::string off = mWindowManager.getGameSettingString("sOff", "On");
|
std::string off = MWBase::Environment::get().getWindowManager()->getGameSettingString("sOff", "On");
|
||||||
bool newState;
|
bool newState;
|
||||||
if (_sender->castType<MyGUI::Button>()->getCaption() == on)
|
if (_sender->castType<MyGUI::Button>()->getCaption() == on)
|
||||||
{
|
{
|
||||||
|
@ -435,8 +435,8 @@ namespace MWGui
|
||||||
|
|
||||||
void SettingsWindow::onShadersToggled(MyGUI::Widget* _sender)
|
void SettingsWindow::onShadersToggled(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
std::string on = mWindowManager.getGameSettingString("sOn", "On");
|
std::string on = MWBase::Environment::get().getWindowManager()->getGameSettingString("sOn", "On");
|
||||||
std::string off = mWindowManager.getGameSettingString("sOff", "On");
|
std::string off = MWBase::Environment::get().getWindowManager()->getGameSettingString("sOff", "On");
|
||||||
|
|
||||||
std::string val = static_cast<MyGUI::Button*>(_sender)->getCaption();
|
std::string val = static_cast<MyGUI::Button*>(_sender)->getCaption();
|
||||||
if (val == off)
|
if (val == off)
|
||||||
|
@ -608,7 +608,7 @@ namespace MWGui
|
||||||
|
|
||||||
void SettingsWindow::onResetDefaultBindings(MyGUI::Widget* _sender)
|
void SettingsWindow::onResetDefaultBindings(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
ConfirmationDialog* dialog = mWindowManager.getConfirmationDialog();
|
ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
|
||||||
dialog->open("#{sNotifyMessage66}");
|
dialog->open("#{sNotifyMessage66}");
|
||||||
dialog->eventOkClicked.clear();
|
dialog->eventOkClicked.clear();
|
||||||
dialog->eventOkClicked += MyGUI::newDelegate(this, &SettingsWindow::onResetDefaultBindingsAccept);
|
dialog->eventOkClicked += MyGUI::newDelegate(this, &SettingsWindow::onResetDefaultBindingsAccept);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_SETTINGS_H
|
#ifndef MWGUI_SETTINGS_H
|
||||||
#define MWGUI_SETTINGS_H
|
#define MWGUI_SETTINGS_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ namespace MWGui
|
||||||
class SettingsWindow : public WindowBase
|
class SettingsWindow : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SettingsWindow(MWBase::WindowManager& parWindowManager);
|
SettingsWindow();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
const int SpellBuyingWindow::sLineHeight = 18;
|
const int SpellBuyingWindow::sLineHeight = 18;
|
||||||
|
|
||||||
SpellBuyingWindow::SpellBuyingWindow(MWBase::WindowManager& parWindowManager) :
|
SpellBuyingWindow::SpellBuyingWindow() :
|
||||||
WindowBase("openmw_spell_buying_window.layout", parWindowManager)
|
WindowBase("openmw_spell_buying_window.layout")
|
||||||
, mCurrentY(0)
|
, mCurrentY(0)
|
||||||
, mLastPos(0)
|
, mLastPos(0)
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::Button* toAdd =
|
MyGUI::Button* toAdd =
|
||||||
mSpellsView->createWidget<MyGUI::Button>(
|
mSpellsView->createWidget<MyGUI::Button>(
|
||||||
(price>mWindowManager.getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton",
|
(price>MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton",
|
||||||
0,
|
0,
|
||||||
mCurrentY,
|
mCurrentY,
|
||||||
200,
|
200,
|
||||||
|
@ -120,13 +120,13 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
int price = *_sender->getUserData<int>();
|
int price = *_sender->getUserData<int>();
|
||||||
|
|
||||||
if (mWindowManager.getInventoryWindow()->getPlayerGold()>=price)
|
if (MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()>=price)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
||||||
MWMechanics::Spells& spells = stats.getSpells();
|
MWMechanics::Spells& spells = stats.getSpells();
|
||||||
spells.add (mSpellsWidgetMap.find(_sender)->second);
|
spells.add (mSpellsWidgetMap.find(_sender)->second);
|
||||||
mWindowManager.getTradeWindow()->addOrRemoveGold(-price);
|
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-price);
|
||||||
startSpellBuying(mPtr);
|
startSpellBuying(mPtr);
|
||||||
|
|
||||||
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
|
||||||
|
@ -135,12 +135,12 @@ namespace MWGui
|
||||||
|
|
||||||
void SpellBuyingWindow::onCancelButtonClicked(MyGUI::Widget* _sender)
|
void SpellBuyingWindow::onCancelButtonClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode(GM_SpellBuying);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_SpellBuying);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellBuyingWindow::updateLabels()
|
void SpellBuyingWindow::updateLabels()
|
||||||
{
|
{
|
||||||
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
|
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()));
|
||||||
mPlayerGold->setCoord(8,
|
mPlayerGold->setCoord(8,
|
||||||
mPlayerGold->getTop(),
|
mPlayerGold->getTop(),
|
||||||
mPlayerGold->getTextSize().width,
|
mPlayerGold->getTextSize().width,
|
||||||
|
@ -150,8 +150,8 @@ namespace MWGui
|
||||||
void SpellBuyingWindow::onReferenceUnavailable()
|
void SpellBuyingWindow::onReferenceUnavailable()
|
||||||
{
|
{
|
||||||
// remove both Spells and Dialogue (since you always trade with the NPC/creature that you have previously talked to)
|
// remove both Spells and Dialogue (since you always trade with the NPC/creature that you have previously talked to)
|
||||||
mWindowManager.removeGuiMode(GM_SpellBuying);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_SpellBuying);
|
||||||
mWindowManager.removeGuiMode(GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellBuyingWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
void SpellBuyingWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_SpellBuyingWINDOW_H
|
#ifndef MWGUI_SpellBuyingWINDOW_H
|
||||||
#define MWGUI_SpellBuyingWINDOW_H
|
#define MWGUI_SpellBuyingWINDOW_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
#include "referenceinterface.hpp"
|
#include "referenceinterface.hpp"
|
||||||
|
|
||||||
namespace MyGUI
|
namespace MyGUI
|
||||||
|
@ -21,7 +21,7 @@ namespace MWGui
|
||||||
class SpellBuyingWindow : public ReferenceInterface, public WindowBase
|
class SpellBuyingWindow : public ReferenceInterface, public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SpellBuyingWindow(MWBase::WindowManager& parWindowManager);
|
SpellBuyingWindow();
|
||||||
|
|
||||||
void startSpellBuying(const MWWorld::Ptr& actor);
|
void startSpellBuying(const MWWorld::Ptr& actor);
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ namespace
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
EditEffectDialog::EditEffectDialog(MWBase::WindowManager &parWindowManager)
|
EditEffectDialog::EditEffectDialog()
|
||||||
: WindowModal("openmw_edit_effect.layout", parWindowManager)
|
: WindowModal("openmw_edit_effect.layout")
|
||||||
, mEditing(false)
|
, mEditing(false)
|
||||||
{
|
{
|
||||||
getWidget(mCancelButton, "CancelButton");
|
getWidget(mCancelButton, "CancelButton");
|
||||||
|
@ -274,9 +274,9 @@ namespace MWGui
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
SpellCreationDialog::SpellCreationDialog(MWBase::WindowManager &parWindowManager)
|
SpellCreationDialog::SpellCreationDialog()
|
||||||
: WindowBase("openmw_spellcreation_dialog.layout", parWindowManager)
|
: WindowBase("openmw_spellcreation_dialog.layout")
|
||||||
, EffectEditorBase(parWindowManager)
|
, EffectEditorBase()
|
||||||
{
|
{
|
||||||
getWidget(mNameEdit, "NameEdit");
|
getWidget(mNameEdit, "NameEdit");
|
||||||
getWidget(mMagickaCost, "MagickaCost");
|
getWidget(mMagickaCost, "MagickaCost");
|
||||||
|
@ -303,38 +303,38 @@ namespace MWGui
|
||||||
|
|
||||||
void SpellCreationDialog::onCancelButtonClicked (MyGUI::Widget* sender)
|
void SpellCreationDialog::onCancelButtonClicked (MyGUI::Widget* sender)
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode (MWGui::GM_SpellCreation);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (MWGui::GM_SpellCreation);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellCreationDialog::onBuyButtonClicked (MyGUI::Widget* sender)
|
void SpellCreationDialog::onBuyButtonClicked (MyGUI::Widget* sender)
|
||||||
{
|
{
|
||||||
if (mEffects.size() <= 0)
|
if (mEffects.size() <= 0)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage30}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage30}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mNameEdit->getCaption () == "")
|
if (mNameEdit->getCaption () == "")
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage10}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage10}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mMagickaCost->getCaption() == "0")
|
if (mMagickaCost->getCaption() == "0")
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sEnchantmentMenu8}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sEnchantmentMenu8}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (boost::lexical_cast<int>(mPriceLabel->getCaption()) > mWindowManager.getInventoryWindow()->getPlayerGold())
|
if (boost::lexical_cast<int>(mPriceLabel->getCaption()) > MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage18}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage18}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mSpell.mName = mNameEdit->getCaption();
|
mSpell.mName = mNameEdit->getCaption();
|
||||||
|
|
||||||
mWindowManager.getTradeWindow()->addOrRemoveGold(-boost::lexical_cast<int>(mPriceLabel->getCaption()));
|
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-boost::lexical_cast<int>(mPriceLabel->getCaption()));
|
||||||
|
|
||||||
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ namespace MWGui
|
||||||
|
|
||||||
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
|
||||||
|
|
||||||
mWindowManager.removeGuiMode (GM_SpellCreation);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_SpellCreation);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellCreationDialog::open()
|
void SpellCreationDialog::open()
|
||||||
|
@ -357,8 +357,8 @@ namespace MWGui
|
||||||
|
|
||||||
void SpellCreationDialog::onReferenceUnavailable ()
|
void SpellCreationDialog::onReferenceUnavailable ()
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode (GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Dialogue);
|
||||||
mWindowManager.removeGuiMode (GM_SpellCreation);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_SpellCreation);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellCreationDialog::notifyEffectsChanged ()
|
void SpellCreationDialog::notifyEffectsChanged ()
|
||||||
|
@ -412,8 +412,8 @@ namespace MWGui
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
EffectEditorBase::EffectEditorBase(MWBase::WindowManager& parWindowManager)
|
EffectEditorBase::EffectEditorBase()
|
||||||
: mAddEffectDialog(parWindowManager)
|
: mAddEffectDialog()
|
||||||
, mSelectAttributeDialog(NULL)
|
, mSelectAttributeDialog(NULL)
|
||||||
, mSelectSkillDialog(NULL)
|
, mSelectSkillDialog(NULL)
|
||||||
{
|
{
|
||||||
|
@ -541,7 +541,7 @@ namespace MWGui
|
||||||
if (effect->mData.mFlags & ESM::MagicEffect::TargetSkill)
|
if (effect->mData.mFlags & ESM::MagicEffect::TargetSkill)
|
||||||
{
|
{
|
||||||
delete mSelectSkillDialog;
|
delete mSelectSkillDialog;
|
||||||
mSelectSkillDialog = new SelectSkillDialog(*MWBase::Environment::get().getWindowManager ());
|
mSelectSkillDialog = new SelectSkillDialog();
|
||||||
mSelectSkillDialog->eventCancel += MyGUI::newDelegate(this, &SpellCreationDialog::onAttributeOrSkillCancel);
|
mSelectSkillDialog->eventCancel += MyGUI::newDelegate(this, &SpellCreationDialog::onAttributeOrSkillCancel);
|
||||||
mSelectSkillDialog->eventItemSelected += MyGUI::newDelegate(this, &SpellCreationDialog::onSelectSkill);
|
mSelectSkillDialog->eventItemSelected += MyGUI::newDelegate(this, &SpellCreationDialog::onSelectSkill);
|
||||||
mSelectSkillDialog->setVisible (true);
|
mSelectSkillDialog->setVisible (true);
|
||||||
|
@ -549,7 +549,7 @@ namespace MWGui
|
||||||
else if (effect->mData.mFlags & ESM::MagicEffect::TargetAttribute)
|
else if (effect->mData.mFlags & ESM::MagicEffect::TargetAttribute)
|
||||||
{
|
{
|
||||||
delete mSelectAttributeDialog;
|
delete mSelectAttributeDialog;
|
||||||
mSelectAttributeDialog = new SelectAttributeDialog(*MWBase::Environment::get().getWindowManager ());
|
mSelectAttributeDialog = new SelectAttributeDialog();
|
||||||
mSelectAttributeDialog->eventCancel += MyGUI::newDelegate(this, &SpellCreationDialog::onAttributeOrSkillCancel);
|
mSelectAttributeDialog->eventCancel += MyGUI::newDelegate(this, &SpellCreationDialog::onAttributeOrSkillCancel);
|
||||||
mSelectAttributeDialog->eventItemSelected += MyGUI::newDelegate(this, &SpellCreationDialog::onSelectAttribute);
|
mSelectAttributeDialog->eventItemSelected += MyGUI::newDelegate(this, &SpellCreationDialog::onSelectAttribute);
|
||||||
mSelectAttributeDialog->setVisible (true);
|
mSelectAttributeDialog->setVisible (true);
|
||||||
|
@ -601,7 +601,6 @@ namespace MWGui
|
||||||
Widgets::MWSpellEffectPtr effect = button->createWidget<Widgets::MWSpellEffect>("MW_EffectImage", MyGUI::IntCoord(0,0,0,24), MyGUI::Align::Default);
|
Widgets::MWSpellEffectPtr effect = button->createWidget<Widgets::MWSpellEffect>("MW_EffectImage", MyGUI::IntCoord(0,0,0,24), MyGUI::Align::Default);
|
||||||
|
|
||||||
effect->setNeedMouseFocus (false);
|
effect->setNeedMouseFocus (false);
|
||||||
effect->setWindowManager (MWBase::Environment::get().getWindowManager ());
|
|
||||||
effect->setSpellEffect (params);
|
effect->setSpellEffect (params);
|
||||||
|
|
||||||
effect->setSize(effect->getRequestedWidth (), 24);
|
effect->setSize(effect->getRequestedWidth (), 24);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_SPELLCREATION_H
|
#ifndef MWGUI_SPELLCREATION_H
|
||||||
#define MWGUI_SPELLCREATION_H
|
#define MWGUI_SPELLCREATION_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
#include "referenceinterface.hpp"
|
#include "referenceinterface.hpp"
|
||||||
#include "list.hpp"
|
#include "list.hpp"
|
||||||
#include "widgets.hpp"
|
#include "widgets.hpp"
|
||||||
|
@ -15,7 +15,7 @@ namespace MWGui
|
||||||
class EditEffectDialog : public WindowModal
|
class EditEffectDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EditEffectDialog(MWBase::WindowManager& parWindowManager);
|
EditEffectDialog();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ namespace MWGui
|
||||||
class EffectEditorBase
|
class EffectEditorBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EffectEditorBase(MWBase::WindowManager& parWindowManager);
|
EffectEditorBase();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -123,7 +123,7 @@ namespace MWGui
|
||||||
class SpellCreationDialog : public WindowBase, public ReferenceInterface, public EffectEditorBase
|
class SpellCreationDialog : public WindowBase, public ReferenceInterface, public EffectEditorBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SpellCreationDialog(MWBase::WindowManager& parWindowManager);
|
SpellCreationDialog();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,8 @@ namespace
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
SpellWindow::SpellWindow(MWBase::WindowManager& parWindowManager)
|
SpellWindow::SpellWindow()
|
||||||
: WindowPinnableBase("openmw_spell_window.layout", parWindowManager)
|
: WindowPinnableBase("openmw_spell_window.layout")
|
||||||
, mHeight(0)
|
, mHeight(0)
|
||||||
, mWidth(0)
|
, mWidth(0)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@ namespace MWGui
|
||||||
|
|
||||||
void SpellWindow::onPinToggled()
|
void SpellWindow::onPinToggled()
|
||||||
{
|
{
|
||||||
mWindowManager.setSpellVisibility(!mPinned);
|
MWBase::Environment::get().getWindowManager()->setSpellVisibility(!mPinned);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellWindow::open()
|
void SpellWindow::open()
|
||||||
|
@ -140,7 +140,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
store.setSelectedEnchantItem(store.end());
|
store.setSelectedEnchantItem(store.end());
|
||||||
spells.setSelectedSpell("");
|
spells.setSelectedSpell("");
|
||||||
mWindowManager.unsetSelectedSpell();
|
MWBase::Environment::get().getWindowManager()->unsetSelectedSpell();
|
||||||
selectedItem = MWWorld::Ptr();
|
selectedItem = MWWorld::Ptr();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -377,12 +377,12 @@ namespace MWGui
|
||||||
action.execute (MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ());
|
action.execute (MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ());
|
||||||
|
|
||||||
// since we changed equipping status, update the inventory window
|
// since we changed equipping status, update the inventory window
|
||||||
mWindowManager.getInventoryWindow()->drawItems();
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->drawItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
store.setSelectedEnchantItem(it);
|
store.setSelectedEnchantItem(it);
|
||||||
spells.setSelectedSpell("");
|
spells.setSelectedSpell("");
|
||||||
mWindowManager.setSelectedEnchantItem(item);
|
MWBase::Environment::get().getWindowManager()->setSelectedEnchantItem(item);
|
||||||
|
|
||||||
updateSpells();
|
updateSpells();
|
||||||
}
|
}
|
||||||
|
@ -404,14 +404,14 @@ namespace MWGui
|
||||||
if (spell->mData.mFlags & ESM::Spell::F_Always
|
if (spell->mData.mFlags & ESM::Spell::F_Always
|
||||||
|| spell->mData.mType == ESM::Spell::ST_Power)
|
|| spell->mData.mType == ESM::Spell::ST_Power)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox("#{sDeleteSpellError}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sDeleteSpellError}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ask for confirmation
|
// ask for confirmation
|
||||||
mSpellToDelete = spellId;
|
mSpellToDelete = spellId;
|
||||||
ConfirmationDialog* dialog = mWindowManager.getConfirmationDialog();
|
ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
|
||||||
std::string question = mWindowManager.getGameSettingString("sQuestionDeleteSpell", "Delete %s?");
|
std::string question = MWBase::Environment::get().getWindowManager()->getGameSettingString("sQuestionDeleteSpell", "Delete %s?");
|
||||||
question = boost::str(boost::format(question) % spell->mName);
|
question = boost::str(boost::format(question) % spell->mName);
|
||||||
dialog->open(question);
|
dialog->open(question);
|
||||||
dialog->eventOkClicked.clear();
|
dialog->eventOkClicked.clear();
|
||||||
|
@ -423,7 +423,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
spells.setSelectedSpell(spellId);
|
spells.setSelectedSpell(spellId);
|
||||||
store.setSelectedEnchantItem(store.end());
|
store.setSelectedEnchantItem(store.end());
|
||||||
mWindowManager.setSelectedSpell(spellId, int(MWMechanics::getSpellSuccessChance(spellId, player)));
|
MWBase::Environment::get().getWindowManager()->setSelectedSpell(spellId, int(MWMechanics::getSpellSuccessChance(spellId, player)));
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSpells();
|
updateSpells();
|
||||||
|
@ -454,7 +454,7 @@ namespace MWGui
|
||||||
if (spells.getSelectedSpell() == mSpellToDelete)
|
if (spells.getSelectedSpell() == mSpellToDelete)
|
||||||
{
|
{
|
||||||
spells.setSelectedSpell("");
|
spells.setSelectedSpell("");
|
||||||
mWindowManager.unsetSelectedSpell();
|
MWBase::Environment::get().getWindowManager()->unsetSelectedSpell();
|
||||||
}
|
}
|
||||||
|
|
||||||
spells.remove(mSpellToDelete);
|
spells.remove(mSpellToDelete);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_SPELLWINDOW_H
|
#ifndef MWGUI_SPELLWINDOW_H
|
||||||
#define MWGUI_SPELLWINDOW_H
|
#define MWGUI_SPELLWINDOW_H
|
||||||
|
|
||||||
#include "window_pinnable_base.hpp"
|
#include "windowpinnablebase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ namespace MWGui
|
||||||
class SpellWindow : public WindowPinnableBase
|
class SpellWindow : public WindowPinnableBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SpellWindow(MWBase::WindowManager& parWindowManager);
|
SpellWindow();
|
||||||
virtual ~SpellWindow();
|
virtual ~SpellWindow();
|
||||||
|
|
||||||
void updateSpells();
|
void updateSpells();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "stats_window.hpp"
|
#include "statswindow.hpp"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -22,8 +22,8 @@
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
const int StatsWindow::sLineHeight = 18;
|
const int StatsWindow::sLineHeight = 18;
|
||||||
|
|
||||||
StatsWindow::StatsWindow (MWBase::WindowManager& parWindowManager)
|
StatsWindow::StatsWindow ()
|
||||||
: WindowPinnableBase("openmw_stats_window.layout", parWindowManager)
|
: WindowPinnableBase("openmw_stats_window.layout")
|
||||||
, mSkillView(NULL)
|
, mSkillView(NULL)
|
||||||
, mClientHeight(0)
|
, mClientHeight(0)
|
||||||
, mMajorSkills()
|
, mMajorSkills()
|
||||||
|
@ -363,7 +363,7 @@ void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId,
|
||||||
addSeparator(coord1, coord2);
|
addSeparator(coord1, coord2);
|
||||||
}
|
}
|
||||||
|
|
||||||
addGroup(mWindowManager.getGameSettingString(titleId, titleDefault), coord1, coord2);
|
addGroup(MWBase::Environment::get().getWindowManager()->getGameSettingString(titleId, titleDefault), coord1, coord2);
|
||||||
|
|
||||||
SkillList::const_iterator end = skills.end();
|
SkillList::const_iterator end = skills.end();
|
||||||
for (SkillList::const_iterator it = skills.begin(); it != end; ++it)
|
for (SkillList::const_iterator it = skills.begin(); it != end; ++it)
|
||||||
|
@ -395,7 +395,7 @@ void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId,
|
||||||
state = "increased";
|
state = "increased";
|
||||||
else if (modified < base)
|
else if (modified < base)
|
||||||
state = "decreased";
|
state = "decreased";
|
||||||
MyGUI::TextBox* widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId),
|
MyGUI::TextBox* widget = addValueItem(MWBase::Environment::get().getWindowManager()->getGameSettingString(skillNameId, skillNameId),
|
||||||
boost::lexical_cast<std::string>(static_cast<int>(modified)), state, coord1, coord2);
|
boost::lexical_cast<std::string>(static_cast<int>(modified)), state, coord1, coord2);
|
||||||
|
|
||||||
for (int i=0; i<2; ++i)
|
for (int i=0; i<2; ++i)
|
||||||
|
@ -476,7 +476,7 @@ void StatsWindow::updateSkillArea()
|
||||||
MWMechanics::NpcStats PCstats = MWWorld::Class::get(player).getNpcStats(player);
|
MWMechanics::NpcStats PCstats = MWWorld::Class::get(player).getNpcStats(player);
|
||||||
std::set<std::string>& expelled = PCstats.getExpelled ();
|
std::set<std::string>& expelled = PCstats.getExpelled ();
|
||||||
|
|
||||||
addGroup(mWindowManager.getGameSettingString("sFaction", "Faction"), coord1, coord2);
|
addGroup(MWBase::Environment::get().getWindowManager()->getGameSettingString("sFaction", "Faction"), coord1, coord2);
|
||||||
FactionList::const_iterator end = mFactions.end();
|
FactionList::const_iterator end = mFactions.end();
|
||||||
for (FactionList::const_iterator it = mFactions.begin(); it != end; ++it)
|
for (FactionList::const_iterator it = mFactions.begin(); it != end; ++it)
|
||||||
{
|
{
|
||||||
|
@ -537,7 +537,7 @@ void StatsWindow::updateSkillArea()
|
||||||
if (!mSkillWidgets.empty())
|
if (!mSkillWidgets.empty())
|
||||||
addSeparator(coord1, coord2);
|
addSeparator(coord1, coord2);
|
||||||
|
|
||||||
addGroup(mWindowManager.getGameSettingString("sBirthSign", "Sign"), coord1, coord2);
|
addGroup(MWBase::Environment::get().getWindowManager()->getGameSettingString("sBirthSign", "Sign"), coord1, coord2);
|
||||||
const ESM::BirthSign *sign =
|
const ESM::BirthSign *sign =
|
||||||
store.get<ESM::BirthSign>().find(mBirthSignId);
|
store.get<ESM::BirthSign>().find(mBirthSignId);
|
||||||
MyGUI::Widget* w = addItem(sign->mName, coord1, coord2);
|
MyGUI::Widget* w = addItem(sign->mName, coord1, coord2);
|
||||||
|
@ -549,7 +549,7 @@ void StatsWindow::updateSkillArea()
|
||||||
if (!mSkillWidgets.empty())
|
if (!mSkillWidgets.empty())
|
||||||
addSeparator(coord1, coord2);
|
addSeparator(coord1, coord2);
|
||||||
|
|
||||||
addValueItem(mWindowManager.getGameSettingString("sReputation", "Reputation"),
|
addValueItem(MWBase::Environment::get().getWindowManager()->getGameSettingString("sReputation", "Reputation"),
|
||||||
boost::lexical_cast<std::string>(static_cast<int>(mReputation)), "normal", coord1, coord2);
|
boost::lexical_cast<std::string>(static_cast<int>(mReputation)), "normal", coord1, coord2);
|
||||||
|
|
||||||
for (int i=0; i<2; ++i)
|
for (int i=0; i<2; ++i)
|
||||||
|
@ -559,7 +559,7 @@ void StatsWindow::updateSkillArea()
|
||||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_Text", "#{sSkillsMenuReputationHelp}");
|
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_Text", "#{sSkillsMenuReputationHelp}");
|
||||||
}
|
}
|
||||||
|
|
||||||
addValueItem(mWindowManager.getGameSettingString("sBounty", "Bounty"),
|
addValueItem(MWBase::Environment::get().getWindowManager()->getGameSettingString("sBounty", "Bounty"),
|
||||||
boost::lexical_cast<std::string>(static_cast<int>(mBounty)), "normal", coord1, coord2);
|
boost::lexical_cast<std::string>(static_cast<int>(mBounty)), "normal", coord1, coord2);
|
||||||
|
|
||||||
for (int i=0; i<2; ++i)
|
for (int i=0; i<2; ++i)
|
||||||
|
@ -576,5 +576,5 @@ void StatsWindow::updateSkillArea()
|
||||||
|
|
||||||
void StatsWindow::onPinToggled()
|
void StatsWindow::onPinToggled()
|
||||||
{
|
{
|
||||||
mWindowManager.setHMSVisibility(!mPinned);
|
MWBase::Environment::get().getWindowManager()->setHMSVisibility(!mPinned);
|
||||||
}
|
}
|
|
@ -3,13 +3,8 @@
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <set>
|
|
||||||
#include <string>
|
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
#include "../mwmechanics/stat.hpp"
|
#include "../mwmechanics/stat.hpp"
|
||||||
#include "window_pinnable_base.hpp"
|
#include "windowpinnablebase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
@ -22,7 +17,7 @@ namespace MWGui
|
||||||
|
|
||||||
typedef std::vector<int> SkillList;
|
typedef std::vector<int> SkillList;
|
||||||
|
|
||||||
StatsWindow(MWBase::WindowManager& parWindowManager);
|
StatsWindow();
|
||||||
|
|
||||||
/// automatically updates all the data in the stats window, but only if it has changed.
|
/// automatically updates all the data in the stats window, but only if it has changed.
|
||||||
void onFrame();
|
void onFrame();
|
|
@ -1,11 +1,12 @@
|
||||||
#include "text_input.hpp"
|
#include "textinput.hpp"
|
||||||
|
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
#include "../mwbase/environment.hpp"
|
||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
TextInputDialog::TextInputDialog(MWBase::WindowManager& parWindowManager)
|
TextInputDialog::TextInputDialog()
|
||||||
: WindowModal("openmw_text_input.layout", parWindowManager)
|
: WindowModal("openmw_text_input.layout")
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
@ -27,9 +28,9 @@ void TextInputDialog::setNextButtonShow(bool shown)
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
|
|
||||||
if (shown)
|
if (shown)
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sNext", ""));
|
||||||
else
|
else
|
||||||
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
|
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextInputDialog::setTextLabel(const std::string &label)
|
void TextInputDialog::setTextLabel(const std::string &label)
|
||||||
|
@ -50,7 +51,7 @@ void TextInputDialog::onOkClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
if (mTextEdit->getCaption() == "")
|
if (mTextEdit->getCaption() == "")
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage37}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage37}");
|
||||||
MyGUI::InputManager::getInstance ().setKeyFocusWidget (mTextEdit);
|
MyGUI::InputManager::getInstance ().setKeyFocusWidget (mTextEdit);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -61,7 +62,7 @@ void TextInputDialog::onTextAccepted(MyGUI::Edit* _sender)
|
||||||
{
|
{
|
||||||
if (mTextEdit->getCaption() == "")
|
if (mTextEdit->getCaption() == "")
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage37}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage37}");
|
||||||
MyGUI::InputManager::getInstance ().setKeyFocusWidget (mTextEdit);
|
MyGUI::InputManager::getInstance ().setKeyFocusWidget (mTextEdit);
|
||||||
}
|
}
|
||||||
else
|
else
|
|
@ -1,22 +1,19 @@
|
||||||
#ifndef MWGUI_TEXT_INPUT_H
|
#ifndef MWGUI_TEXT_INPUT_H
|
||||||
#define MWGUI_TEXT_INPUT_H
|
#define MWGUI_TEXT_INPUT_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
class WindowManager;
|
class WindowManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
class TextInputDialog : public WindowModal
|
class TextInputDialog : public WindowModal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TextInputDialog(MWBase::WindowManager& parWindowManager);
|
TextInputDialog();
|
||||||
|
|
||||||
std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; }
|
std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; }
|
||||||
void setTextInput(const std::string &text) { if (mTextEdit) mTextEdit->setOnlyText(text); }
|
void setTextInput(const std::string &text) { if (mTextEdit) mTextEdit->setOnlyText(text); }
|
|
@ -12,17 +12,16 @@
|
||||||
|
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
|
|
||||||
#include "map_window.hpp"
|
#include "mapwindow.hpp"
|
||||||
#include "widgets.hpp"
|
#include "widgets.hpp"
|
||||||
#include "inventorywindow.hpp"
|
#include "inventorywindow.hpp"
|
||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
using namespace MyGUI;
|
using namespace MyGUI;
|
||||||
|
|
||||||
ToolTips::ToolTips(MWBase::WindowManager* windowManager) :
|
ToolTips::ToolTips() :
|
||||||
Layout("openmw_tooltips.layout")
|
Layout("openmw_tooltips.layout")
|
||||||
, mGameMode(true)
|
, mGameMode(true)
|
||||||
, mWindowManager(windowManager)
|
|
||||||
, mFullHelp(false)
|
, mFullHelp(false)
|
||||||
, mEnabled(true)
|
, mEnabled(true)
|
||||||
, mFocusToolTipX(0.0)
|
, mFocusToolTipX(0.0)
|
||||||
|
@ -81,9 +80,9 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
{
|
{
|
||||||
const MyGUI::IntPoint& mousePos = InputManager::getInstance().getMousePosition();
|
const MyGUI::IntPoint& mousePos = InputManager::getInstance().getMousePosition();
|
||||||
|
|
||||||
if (mWindowManager->getWorldMouseOver() && ((mWindowManager->getMode() == GM_Console)
|
if (MWBase::Environment::get().getWindowManager()->getWorldMouseOver() && ((MWBase::Environment::get().getWindowManager()->getMode() == GM_Console)
|
||||||
|| (mWindowManager->getMode() == GM_Container)
|
|| (MWBase::Environment::get().getWindowManager()->getMode() == GM_Container)
|
||||||
|| (mWindowManager->getMode() == GM_Inventory)))
|
|| (MWBase::Environment::get().getWindowManager()->getMode() == GM_Inventory)))
|
||||||
{
|
{
|
||||||
mFocusObject = MWBase::Environment::get().getWorld()->getFacedObject();
|
mFocusObject = MWBase::Environment::get().getWorld()->getFacedObject();
|
||||||
|
|
||||||
|
@ -93,7 +92,7 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
const MWWorld::Class& objectclass = MWWorld::Class::get (mFocusObject);
|
const MWWorld::Class& objectclass = MWWorld::Class::get (mFocusObject);
|
||||||
|
|
||||||
IntSize tooltipSize;
|
IntSize tooltipSize;
|
||||||
if ((!objectclass.hasToolTip(mFocusObject))&&(mWindowManager->getMode() == GM_Console))
|
if ((!objectclass.hasToolTip(mFocusObject))&&(MWBase::Environment::get().getWindowManager()->getMode() == GM_Console))
|
||||||
{
|
{
|
||||||
setCoord(0, 0, 300, 300);
|
setCoord(0, 0, 300, 300);
|
||||||
mDynamicToolTipBox->setVisible(true);
|
mDynamicToolTipBox->setVisible(true);
|
||||||
|
@ -139,7 +138,7 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
mLastMouseX = mousePos.left;
|
mLastMouseX = mousePos.left;
|
||||||
mLastMouseY = mousePos.top;
|
mLastMouseY = mousePos.top;
|
||||||
|
|
||||||
|
|
||||||
if (mRemainingDelay > 0)
|
if (mRemainingDelay > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -167,8 +166,8 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// special handling for markers on the local map: the tooltip should only be visible
|
// special handling for markers on the local map: the tooltip should only be visible
|
||||||
// if the marker is not hidden due to the fog of war.
|
// if the marker is not hidden due to the fog of war.
|
||||||
if (focus->getUserString ("IsMarker") == "true")
|
if (focus->getUserString ("IsMarker") == "true")
|
||||||
|
@ -190,11 +189,11 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
}
|
}
|
||||||
else if (type == "AvatarItemSelection")
|
else if (type == "AvatarItemSelection")
|
||||||
{
|
{
|
||||||
MyGUI::IntCoord avatarPos = mWindowManager->getInventoryWindow ()->getAvatarScreenCoord ();
|
MyGUI::IntCoord avatarPos = MWBase::Environment::get().getWindowManager()->getInventoryWindow ()->getAvatarScreenCoord ();
|
||||||
MyGUI::IntPoint relMousePos = MyGUI::InputManager::getInstance ().getMousePosition () - MyGUI::IntPoint(avatarPos.left, avatarPos.top);
|
MyGUI::IntPoint relMousePos = MyGUI::InputManager::getInstance ().getMousePosition () - MyGUI::IntPoint(avatarPos.left, avatarPos.top);
|
||||||
int realX = int(float(relMousePos.left) / float(avatarPos.width) * 512.f );
|
int realX = int(float(relMousePos.left) / float(avatarPos.width) * 512.f );
|
||||||
int realY = int(float(relMousePos.top) / float(avatarPos.height) * 1024.f );
|
int realY = int(float(relMousePos.top) / float(avatarPos.height) * 1024.f );
|
||||||
MWWorld::Ptr item = mWindowManager->getInventoryWindow ()->getAvatarSelectedItem (realX, realY);
|
MWWorld::Ptr item = MWBase::Environment::get().getWindowManager()->getInventoryWindow ()->getAvatarSelectedItem (realX, realY);
|
||||||
|
|
||||||
mFocusObject = item;
|
mFocusObject = item;
|
||||||
if (!mFocusObject.isEmpty ())
|
if (!mFocusObject.isEmpty ())
|
||||||
|
@ -346,7 +345,7 @@ void ToolTips::findImageExtension(std::string& image)
|
||||||
}
|
}
|
||||||
|
|
||||||
IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
||||||
{
|
{
|
||||||
mDynamicToolTipBox->setVisible(true);
|
mDynamicToolTipBox->setVisible(true);
|
||||||
|
|
||||||
std::string caption = info.caption;
|
std::string caption = info.caption;
|
||||||
|
@ -380,7 +379,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
||||||
setCoord(0, 0, 300, 300);
|
setCoord(0, 0, 300, 300);
|
||||||
|
|
||||||
const IntPoint padding(8, 8);
|
const IntPoint padding(8, 8);
|
||||||
|
|
||||||
const int maximumWidth = 500;
|
const int maximumWidth = 500;
|
||||||
|
|
||||||
const int imageCaptionHPadding = (caption != "" ? 8 : 0);
|
const int imageCaptionHPadding = (caption != "" ? 8 : 0);
|
||||||
|
@ -424,7 +423,6 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
||||||
|
|
||||||
Widgets::MWEffectListPtr effectsWidget = effectArea->createWidget<Widgets::MWEffectList>
|
Widgets::MWEffectListPtr effectsWidget = effectArea->createWidget<Widgets::MWEffectList>
|
||||||
("MW_StatName", coord, Align::Default, "ToolTipEffectsWidget");
|
("MW_StatName", coord, Align::Default, "ToolTipEffectsWidget");
|
||||||
effectsWidget->setWindowManager(mWindowManager);
|
|
||||||
effectsWidget->setEffectList(info.effects);
|
effectsWidget->setEffectList(info.effects);
|
||||||
|
|
||||||
std::vector<MyGUI::Widget*> effectItems;
|
std::vector<MyGUI::Widget*> effectItems;
|
||||||
|
@ -444,7 +442,6 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
||||||
|
|
||||||
Widgets::MWEffectListPtr enchantWidget = enchantArea->createWidget<Widgets::MWEffectList>
|
Widgets::MWEffectListPtr enchantWidget = enchantArea->createWidget<Widgets::MWEffectList>
|
||||||
("MW_StatName", coord, Align::Default, "ToolTipEnchantWidget");
|
("MW_StatName", coord, Align::Default, "ToolTipEnchantWidget");
|
||||||
enchantWidget->setWindowManager(mWindowManager);
|
|
||||||
enchantWidget->setEffectList(Widgets::MWEffectList::effectListFromESM(&enchant->mEffects));
|
enchantWidget->setEffectList(Widgets::MWEffectList::effectListFromESM(&enchant->mEffects));
|
||||||
|
|
||||||
std::vector<MyGUI::Widget*> enchantEffectItems;
|
std::vector<MyGUI::Widget*> enchantEffectItems;
|
||||||
|
@ -493,7 +490,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
||||||
(captionHeight-captionSize.height)/2,
|
(captionHeight-captionSize.height)/2,
|
||||||
captionSize.width-imageSize,
|
captionSize.width-imageSize,
|
||||||
captionSize.height);
|
captionSize.height);
|
||||||
|
|
||||||
//if its too long we do hscroll with the caption
|
//if its too long we do hscroll with the caption
|
||||||
if (captionSize.width > maximumWidth)
|
if (captionSize.width > maximumWidth)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace MWGui
|
||||||
class ToolTips : public OEngine::GUI::Layout
|
class ToolTips : public OEngine::GUI::Layout
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ToolTips(MWBase::WindowManager* windowManager);
|
ToolTips();
|
||||||
|
|
||||||
void onFrame(float frameDuration);
|
void onFrame(float frameDuration);
|
||||||
|
|
||||||
|
@ -82,8 +82,6 @@ namespace MWGui
|
||||||
private:
|
private:
|
||||||
MyGUI::Widget* mDynamicToolTipBox;
|
MyGUI::Widget* mDynamicToolTipBox;
|
||||||
|
|
||||||
MWBase::WindowManager* mWindowManager;
|
|
||||||
|
|
||||||
MWWorld::Ptr mFocusObject;
|
MWWorld::Ptr mFocusObject;
|
||||||
|
|
||||||
void findImageExtension(std::string& image);
|
void findImageExtension(std::string& image);
|
||||||
|
@ -96,9 +94,9 @@ namespace MWGui
|
||||||
|
|
||||||
float mFocusToolTipX;
|
float mFocusToolTipX;
|
||||||
float mFocusToolTipY;
|
float mFocusToolTipY;
|
||||||
|
|
||||||
int mHorizontalScrollIndex;
|
int mHorizontalScrollIndex;
|
||||||
|
|
||||||
|
|
||||||
float mDelay;
|
float mDelay;
|
||||||
float mRemainingDelay; // remaining time until tooltip will show
|
float mRemainingDelay; // remaining time until tooltip will show
|
||||||
|
|
|
@ -24,8 +24,8 @@ namespace MWGui
|
||||||
const float TradeWindow::sBalanceChangeInitialPause = 0.5;
|
const float TradeWindow::sBalanceChangeInitialPause = 0.5;
|
||||||
const float TradeWindow::sBalanceChangeInterval = 0.1;
|
const float TradeWindow::sBalanceChangeInterval = 0.1;
|
||||||
|
|
||||||
TradeWindow::TradeWindow(MWBase::WindowManager& parWindowManager) :
|
TradeWindow::TradeWindow() :
|
||||||
WindowBase("openmw_trade_window.layout", parWindowManager)
|
WindowBase("openmw_trade_window.layout")
|
||||||
, ContainerBase(NULL) // no drag&drop
|
, ContainerBase(NULL) // no drag&drop
|
||||||
, mCurrentBalance(0)
|
, mCurrentBalance(0)
|
||||||
, mBalanceButtonsState(BBS_None)
|
, mBalanceButtonsState(BBS_None)
|
||||||
|
@ -85,7 +85,7 @@ namespace MWGui
|
||||||
mCurrentBalance = 0;
|
mCurrentBalance = 0;
|
||||||
mCurrentMerchantOffer = 0;
|
mCurrentMerchantOffer = 0;
|
||||||
|
|
||||||
mWindowManager.getInventoryWindow()->startTrade();
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->startTrade();
|
||||||
|
|
||||||
mBoughtItems.clear();
|
mBoughtItems.clear();
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
bool goldFound = false;
|
bool goldFound = false;
|
||||||
MWWorld::Ptr gold;
|
MWWorld::Ptr gold;
|
||||||
MWWorld::ContainerStore& playerStore = mWindowManager.getInventoryWindow()->getContainerStore();
|
MWWorld::ContainerStore& playerStore = MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getContainerStore();
|
||||||
|
|
||||||
for (MWWorld::ContainerStoreIterator it = playerStore.begin();
|
for (MWWorld::ContainerStoreIterator it = playerStore.begin();
|
||||||
it != playerStore.end(); ++it)
|
it != playerStore.end(); ++it)
|
||||||
|
@ -172,7 +172,7 @@ namespace MWGui
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
|
|
||||||
// were there any items traded at all?
|
// were there any items traded at all?
|
||||||
MWWorld::ContainerStore& playerBought = mWindowManager.getInventoryWindow()->getBoughtItems();
|
MWWorld::ContainerStore& playerBought = MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getBoughtItems();
|
||||||
MWWorld::ContainerStore& merchantBought = getBoughtItems();
|
MWWorld::ContainerStore& merchantBought = getBoughtItems();
|
||||||
if (playerBought.begin() == playerBought.end() && merchantBought.begin() == merchantBought.end())
|
if (playerBought.begin() == playerBought.end() && merchantBought.begin() == merchantBought.end())
|
||||||
{
|
{
|
||||||
|
@ -183,7 +183,7 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the player can afford this
|
// check if the player can afford this
|
||||||
if (mCurrentBalance < 0 && mWindowManager.getInventoryWindow()->getPlayerGold() < std::abs(mCurrentBalance))
|
if (mCurrentBalance < 0 && MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold() < std::abs(mCurrentBalance))
|
||||||
{
|
{
|
||||||
// user notification
|
// user notification
|
||||||
MWBase::Environment::get().getWindowManager()->
|
MWBase::Environment::get().getWindowManager()->
|
||||||
|
@ -257,14 +257,15 @@ namespace MWGui
|
||||||
MWBase::Environment::get().getDialogueManager()->applyTemporaryDispositionChange(iBarterSuccessDisposition);
|
MWBase::Environment::get().getDialogueManager()->applyTemporaryDispositionChange(iBarterSuccessDisposition);
|
||||||
|
|
||||||
// success! make the item transfer.
|
// success! make the item transfer.
|
||||||
MWWorld::ContainerStore& playerBoughtItems = mWindowManager.getInventoryWindow()->getBoughtItems();
|
MWWorld::ContainerStore& playerBoughtItems =
|
||||||
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getBoughtItems();
|
||||||
for (MWWorld::ContainerStoreIterator it = playerBoughtItems.begin(); it != playerBoughtItems.end(); ++it)
|
for (MWWorld::ContainerStoreIterator it = playerBoughtItems.begin(); it != playerBoughtItems.end(); ++it)
|
||||||
{
|
{
|
||||||
if (Misc::StringUtils::ciEqual(it->getCellRef().mOwner, MWWorld::Class::get(mPtr).getId(mPtr)))
|
if (Misc::StringUtils::ciEqual(it->getCellRef().mOwner, MWWorld::Class::get(mPtr).getId(mPtr)))
|
||||||
it->getCellRef().mOwner = "";
|
it->getCellRef().mOwner = "";
|
||||||
}
|
}
|
||||||
transferBoughtItems();
|
transferBoughtItems();
|
||||||
mWindowManager.getInventoryWindow()->transferBoughtItems();
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->transferBoughtItems();
|
||||||
|
|
||||||
// add or remove gold from the player.
|
// add or remove gold from the player.
|
||||||
if (mCurrentBalance != 0)
|
if (mCurrentBalance != 0)
|
||||||
|
@ -273,17 +274,17 @@ namespace MWGui
|
||||||
std::string sound = "Item Gold Up";
|
std::string sound = "Item Gold Up";
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
|
|
||||||
mWindowManager.removeGuiMode(GM_Barter);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Barter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TradeWindow::onCancelButtonClicked(MyGUI::Widget* _sender)
|
void TradeWindow::onCancelButtonClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
// i give you back your stuff!
|
// i give you back your stuff!
|
||||||
returnBoughtItems(mWindowManager.getInventoryWindow()->getContainerStore());
|
returnBoughtItems(MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getContainerStore());
|
||||||
// now gimme back my stuff!
|
// now gimme back my stuff!
|
||||||
mWindowManager.getInventoryWindow()->returnBoughtItems(MWWorld::Class::get(mPtr).getContainerStore(mPtr));
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->returnBoughtItems(MWWorld::Class::get(mPtr).getContainerStore(mPtr));
|
||||||
|
|
||||||
mWindowManager.removeGuiMode(GM_Barter);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Barter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TradeWindow::onMaxSaleButtonClicked(MyGUI::Widget* _sender)
|
void TradeWindow::onMaxSaleButtonClicked(MyGUI::Widget* _sender)
|
||||||
|
@ -327,7 +328,7 @@ namespace MWGui
|
||||||
|
|
||||||
void TradeWindow::updateLabels()
|
void TradeWindow::updateLabels()
|
||||||
{
|
{
|
||||||
mPlayerGold->setCaptionWithReplacing("#{sYourGold} " + boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
|
mPlayerGold->setCaptionWithReplacing("#{sYourGold} " + boost::lexical_cast<std::string>(MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()));
|
||||||
|
|
||||||
if (mCurrentBalance > 0)
|
if (mCurrentBalance > 0)
|
||||||
{
|
{
|
||||||
|
@ -403,8 +404,8 @@ namespace MWGui
|
||||||
void TradeWindow::onReferenceUnavailable()
|
void TradeWindow::onReferenceUnavailable()
|
||||||
{
|
{
|
||||||
// remove both Trade and Dialogue (since you always trade with the NPC/creature that you have previously talked to)
|
// remove both Trade and Dialogue (since you always trade with the NPC/creature that you have previously talked to)
|
||||||
mWindowManager.removeGuiMode(GM_Barter);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Barter);
|
||||||
mWindowManager.removeGuiMode(GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TradeWindow::getMerchantGold()
|
int TradeWindow::getMerchantGold()
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
#define MWGUI_TRADEWINDOW_H
|
#define MWGUI_TRADEWINDOW_H
|
||||||
|
|
||||||
#include "container.hpp"
|
#include "container.hpp"
|
||||||
#include "window_base.hpp"
|
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
|
||||||
|
|
||||||
namespace MyGUI
|
namespace MyGUI
|
||||||
{
|
{
|
||||||
|
@ -23,7 +20,7 @@ namespace MWGui
|
||||||
class TradeWindow : public ContainerBase, public WindowBase
|
class TradeWindow : public ContainerBase, public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TradeWindow(MWBase::WindowManager& parWindowManager);
|
TradeWindow();
|
||||||
|
|
||||||
void startTrade(MWWorld::Ptr actor);
|
void startTrade(MWWorld::Ptr actor);
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
TrainingWindow::TrainingWindow(MWBase::WindowManager &parWindowManager)
|
TrainingWindow::TrainingWindow()
|
||||||
: WindowBase("openmw_trainingwindow.layout", parWindowManager)
|
: WindowBase("openmw_trainingwindow.layout")
|
||||||
, mFadeTimeRemaining(0)
|
, mFadeTimeRemaining(0)
|
||||||
{
|
{
|
||||||
getWidget(mTrainingOptions, "TrainingOptions");
|
getWidget(mTrainingOptions, "TrainingOptions");
|
||||||
|
@ -40,7 +40,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
mPtr = actor;
|
mPtr = actor;
|
||||||
|
|
||||||
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
|
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()));
|
||||||
|
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(actor).getNpcStats (actor);
|
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(actor).getNpcStats (actor);
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ namespace MWGui
|
||||||
int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer
|
int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer
|
||||||
(mPtr,pcStats.getSkill (bestSkills[i].first).getBase() * gmst.find("iTrainingMod")->getInt (),true);
|
(mPtr,pcStats.getSkill (bestSkills[i].first).getBase() * gmst.find("iTrainingMod")->getInt (),true);
|
||||||
|
|
||||||
std::string skin = (price > mWindowManager.getInventoryWindow ()->getPlayerGold ()) ? "SandTextGreyedOut" : "SandTextButton";
|
std::string skin = (price > MWBase::Environment::get().getWindowManager()->getInventoryWindow ()->getPlayerGold ()) ? "SandTextGreyedOut" : "SandTextButton";
|
||||||
|
|
||||||
MyGUI::Button* button = mTrainingOptions->createWidget<MyGUI::Button>(skin,
|
MyGUI::Button* button = mTrainingOptions->createWidget<MyGUI::Button>(skin,
|
||||||
MyGUI::IntCoord(5, 5+i*18, mTrainingOptions->getWidth()-10, 18), MyGUI::Align::Default);
|
MyGUI::IntCoord(5, 5+i*18, mTrainingOptions->getWidth()-10, 18), MyGUI::Align::Default);
|
||||||
|
@ -102,12 +102,12 @@ namespace MWGui
|
||||||
|
|
||||||
void TrainingWindow::onReferenceUnavailable ()
|
void TrainingWindow::onReferenceUnavailable ()
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode(GM_Training);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Training);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrainingWindow::onCancelButtonClicked (MyGUI::Widget *sender)
|
void TrainingWindow::onCancelButtonClicked (MyGUI::Widget *sender)
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode (GM_Training);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Training);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrainingWindow::onTrainingSelected (MyGUI::Widget *sender)
|
void TrainingWindow::onTrainingSelected (MyGUI::Widget *sender)
|
||||||
|
@ -123,13 +123,13 @@ namespace MWGui
|
||||||
int price = pcStats.getSkill (skillId).getBase() * store.get<ESM::GameSetting>().find("iTrainingMod")->getInt ();
|
int price = pcStats.getSkill (skillId).getBase() * store.get<ESM::GameSetting>().find("iTrainingMod")->getInt ();
|
||||||
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true);
|
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true);
|
||||||
|
|
||||||
if (mWindowManager.getInventoryWindow()->getPlayerGold()<price)
|
if (MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()<price)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(mPtr).getNpcStats (mPtr);
|
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(mPtr).getNpcStats (mPtr);
|
||||||
if (npcStats.getSkill (skillId).getBase () <= pcStats.getSkill (skillId).getBase ())
|
if (npcStats.getSkill (skillId).getBase () <= pcStats.getSkill (skillId).getBase ())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sServiceTrainingWords}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sServiceTrainingWords}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,11 +141,11 @@ namespace MWGui
|
||||||
pcStats.increaseSkill (skillId, *class_, true);
|
pcStats.increaseSkill (skillId, *class_, true);
|
||||||
|
|
||||||
// remove gold
|
// remove gold
|
||||||
mWindowManager.getTradeWindow()->addOrRemoveGold(-price);
|
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-price);
|
||||||
|
|
||||||
// go back to game mode
|
// go back to game mode
|
||||||
mWindowManager.removeGuiMode (GM_Training);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Training);
|
||||||
mWindowManager.removeGuiMode (GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Dialogue);
|
||||||
|
|
||||||
// advance time
|
// advance time
|
||||||
MWBase::Environment::get().getWorld ()->advanceTime (2);
|
MWBase::Environment::get().getWorld ()->advanceTime (2);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_TRAININGWINDOW_H
|
#ifndef MWGUI_TRAININGWINDOW_H
|
||||||
#define MWGUI_TRAININGWINDOW_H
|
#define MWGUI_TRAININGWINDOW_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
#include "referenceinterface.hpp"
|
#include "referenceinterface.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
|
@ -10,7 +10,7 @@ namespace MWGui
|
||||||
class TrainingWindow : public WindowBase, public ReferenceInterface
|
class TrainingWindow : public WindowBase, public ReferenceInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TrainingWindow(MWBase::WindowManager& parWindowManager);
|
TrainingWindow();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
const int TravelWindow::sLineHeight = 18;
|
const int TravelWindow::sLineHeight = 18;
|
||||||
|
|
||||||
TravelWindow::TravelWindow(MWBase::WindowManager& parWindowManager) :
|
TravelWindow::TravelWindow() :
|
||||||
WindowBase("openmw_travel_window.layout", parWindowManager)
|
WindowBase("openmw_travel_window.layout")
|
||||||
, mCurrentY(0)
|
, mCurrentY(0)
|
||||||
, mLastPos(0)
|
, mLastPos(0)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@ namespace MWGui
|
||||||
|
|
||||||
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true);
|
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true);
|
||||||
|
|
||||||
MyGUI::Button* toAdd = mDestinationsView->createWidget<MyGUI::Button>((price>mWindowManager.getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton", 0, mCurrentY, 200, sLineHeight, MyGUI::Align::Default);
|
MyGUI::Button* toAdd = mDestinationsView->createWidget<MyGUI::Button>((price>MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton", 0, mCurrentY, 200, sLineHeight, MyGUI::Align::Default);
|
||||||
mCurrentY += sLineHeight;
|
mCurrentY += sLineHeight;
|
||||||
if(interior)
|
if(interior)
|
||||||
toAdd->setUserString("interior","y");
|
toAdd->setUserString("interior","y");
|
||||||
|
@ -129,10 +129,10 @@ namespace MWGui
|
||||||
int price;
|
int price;
|
||||||
iss >> price;
|
iss >> price;
|
||||||
|
|
||||||
if (mWindowManager.getInventoryWindow()->getPlayerGold()<price)
|
if (MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()<price)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mWindowManager.getTradeWindow ()->addOrRemoveGold (-price);
|
MWBase::Environment::get().getWindowManager()->getTradeWindow ()->addOrRemoveGold (-price);
|
||||||
|
|
||||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(1);
|
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(1);
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||||
|
@ -156,21 +156,22 @@ namespace MWGui
|
||||||
MWBase::Environment::get().getWorld()->advanceTime(time);
|
MWBase::Environment::get().getWorld()->advanceTime(time);
|
||||||
}
|
}
|
||||||
MWBase::Environment::get().getWorld()->moveObject(player,*cell,pos.pos[0],pos.pos[1],pos.pos[2]);
|
MWBase::Environment::get().getWorld()->moveObject(player,*cell,pos.pos[0],pos.pos[1],pos.pos[2]);
|
||||||
|
|
||||||
MWWorld::Class::get(player).adjustPosition(player);
|
MWWorld::Class::get(player).adjustPosition(player);
|
||||||
mWindowManager.removeGuiMode(GM_Travel);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
|
||||||
mWindowManager.removeGuiMode(GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
|
||||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0);
|
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0);
|
||||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(1);
|
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TravelWindow::onCancelButtonClicked(MyGUI::Widget* _sender)
|
void TravelWindow::onCancelButtonClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode(GM_Travel);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TravelWindow::updateLabels()
|
void TravelWindow::updateLabels()
|
||||||
{
|
{
|
||||||
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(mWindowManager.getInventoryWindow()->getPlayerGold()));
|
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()));
|
||||||
mPlayerGold->setCoord(8,
|
mPlayerGold->setCoord(8,
|
||||||
mPlayerGold->getTop(),
|
mPlayerGold->getTop(),
|
||||||
mPlayerGold->getTextSize().width,
|
mPlayerGold->getTextSize().width,
|
||||||
|
@ -179,8 +180,8 @@ namespace MWGui
|
||||||
|
|
||||||
void TravelWindow::onReferenceUnavailable()
|
void TravelWindow::onReferenceUnavailable()
|
||||||
{
|
{
|
||||||
mWindowManager.removeGuiMode(GM_Travel);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
|
||||||
mWindowManager.removeGuiMode(GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TravelWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
void TravelWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
#define MWGUI_TravelWINDOW_H
|
#define MWGUI_TravelWINDOW_H
|
||||||
|
|
||||||
#include "container.hpp"
|
#include "container.hpp"
|
||||||
#include "window_base.hpp"
|
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
|
||||||
|
|
||||||
namespace MyGUI
|
namespace MyGUI
|
||||||
{
|
{
|
||||||
|
@ -23,7 +20,7 @@ namespace MWGui
|
||||||
class TravelWindow : public ReferenceInterface, public WindowBase
|
class TravelWindow : public ReferenceInterface, public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TravelWindow(MWBase::WindowManager& parWindowManager);
|
TravelWindow();
|
||||||
|
|
||||||
void startTravel(const MWWorld::Ptr& actor);
|
void startTravel(const MWWorld::Ptr& actor);
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
WaitDialogProgressBar::WaitDialogProgressBar(MWBase::WindowManager &parWindowManager)
|
WaitDialogProgressBar::WaitDialogProgressBar()
|
||||||
: WindowBase("openmw_wait_dialog_progressbar.layout", parWindowManager)
|
: WindowBase("openmw_wait_dialog_progressbar.layout")
|
||||||
{
|
{
|
||||||
getWidget(mProgressBar, "ProgressBar");
|
getWidget(mProgressBar, "ProgressBar");
|
||||||
getWidget(mProgressText, "ProgressText");
|
getWidget(mProgressText, "ProgressText");
|
||||||
|
@ -46,9 +46,9 @@ namespace MWGui
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
WaitDialog::WaitDialog(MWBase::WindowManager &parWindowManager)
|
WaitDialog::WaitDialog()
|
||||||
: WindowBase("openmw_wait_dialog.layout", parWindowManager)
|
: WindowBase("openmw_wait_dialog.layout")
|
||||||
, mProgressBar(parWindowManager)
|
, mProgressBar()
|
||||||
, mWaiting(false)
|
, mWaiting(false)
|
||||||
, mSleeping(false)
|
, mSleeping(false)
|
||||||
, mHours(1)
|
, mHours(1)
|
||||||
|
@ -75,7 +75,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
if (!MWBase::Environment::get().getWindowManager ()->getRestEnabled ())
|
if (!MWBase::Environment::get().getWindowManager ()->getRestEnabled ())
|
||||||
{
|
{
|
||||||
mWindowManager.popGuiMode ();
|
MWBase::Environment::get().getWindowManager()->popGuiMode ();
|
||||||
}
|
}
|
||||||
|
|
||||||
int canRest = MWBase::Environment::get().getWorld ()->canRest ();
|
int canRest = MWBase::Environment::get().getWorld ()->canRest ();
|
||||||
|
@ -83,8 +83,8 @@ namespace MWGui
|
||||||
if (canRest == 2)
|
if (canRest == 2)
|
||||||
{
|
{
|
||||||
// resting underwater or mid-air not allowed
|
// resting underwater or mid-air not allowed
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage1}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage1}");
|
||||||
mWindowManager.popGuiMode ();
|
MWBase::Environment::get().getWindowManager()->popGuiMode ();
|
||||||
}
|
}
|
||||||
|
|
||||||
setCanRest(canRest == 0);
|
setCanRest(canRest == 0);
|
||||||
|
@ -212,7 +212,7 @@ namespace MWGui
|
||||||
|
|
||||||
void WaitDialog::onCancelButtonClicked(MyGUI::Widget* sender)
|
void WaitDialog::onCancelButtonClicked(MyGUI::Widget* sender)
|
||||||
{
|
{
|
||||||
mWindowManager.popGuiMode ();
|
MWBase::Environment::get().getWindowManager()->popGuiMode ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaitDialog::onHourSliderChangedPosition(MyGUI::ScrollBar* sender, size_t position)
|
void WaitDialog::onHourSliderChangedPosition(MyGUI::ScrollBar* sender, size_t position)
|
||||||
|
@ -263,8 +263,8 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(0.2);
|
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(0.2);
|
||||||
mProgressBar.setVisible (false);
|
mProgressBar.setVisible (false);
|
||||||
mWindowManager.removeGuiMode (GM_Rest);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Rest);
|
||||||
mWindowManager.removeGuiMode (GM_RestBed);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_RestBed);
|
||||||
mWaiting = false;
|
mWaiting = false;
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||||
|
@ -273,7 +273,7 @@ namespace MWGui
|
||||||
// trigger levelup if possible
|
// trigger levelup if possible
|
||||||
if (mSleeping && pcstats.getLevelProgress () >= 10)
|
if (mSleeping && pcstats.getLevelProgress () >= 10)
|
||||||
{
|
{
|
||||||
mWindowManager.pushGuiMode (GM_Levelup);
|
MWBase::Environment::get().getWindowManager()->pushGuiMode (GM_Levelup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_WAIT_DIALOG_H
|
#ifndef MWGUI_WAIT_DIALOG_H
|
||||||
#define MWGUI_WAIT_DIALOG_H
|
#define MWGUI_WAIT_DIALOG_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ namespace MWGui
|
||||||
class WaitDialogProgressBar : public WindowBase
|
class WaitDialogProgressBar : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WaitDialogProgressBar(MWBase::WindowManager& parWindowManager);
|
WaitDialogProgressBar();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ namespace MWGui
|
||||||
class WaitDialog : public WindowBase
|
class WaitDialog : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WaitDialog(MWBase::WindowManager& parWindowManager);
|
WaitDialog();
|
||||||
|
|
||||||
virtual void open();
|
virtual void open();
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,7 @@ void MWGui::Widgets::fixTexturePath(std::string &path)
|
||||||
/* MWSkill */
|
/* MWSkill */
|
||||||
|
|
||||||
MWSkill::MWSkill()
|
MWSkill::MWSkill()
|
||||||
: mManager(NULL)
|
: mSkillId(ESM::Skill::Length)
|
||||||
, mSkillId(ESM::Skill::Length)
|
|
||||||
, mSkillNameWidget(NULL)
|
, mSkillNameWidget(NULL)
|
||||||
, mSkillValueWidget(NULL)
|
, mSkillValueWidget(NULL)
|
||||||
{
|
{
|
||||||
|
@ -65,7 +64,7 @@ void MWSkill::setSkillValue(const SkillValue& value)
|
||||||
|
|
||||||
void MWSkill::updateWidgets()
|
void MWSkill::updateWidgets()
|
||||||
{
|
{
|
||||||
if (mSkillNameWidget && mManager)
|
if (mSkillNameWidget)
|
||||||
{
|
{
|
||||||
if (mSkillId == ESM::Skill::Length)
|
if (mSkillId == ESM::Skill::Length)
|
||||||
{
|
{
|
||||||
|
@ -73,7 +72,7 @@ void MWSkill::updateWidgets()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const std::string &name = mManager->getGameSettingString(ESM::Skill::sSkillNameIds[mSkillId], "");
|
const std::string &name = MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Skill::sSkillNameIds[mSkillId], "");
|
||||||
static_cast<MyGUI::TextBox*>(mSkillNameWidget)->setCaption(name);
|
static_cast<MyGUI::TextBox*>(mSkillNameWidget)->setCaption(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,8 +125,7 @@ void MWSkill::initialiseOverride()
|
||||||
/* MWAttribute */
|
/* MWAttribute */
|
||||||
|
|
||||||
MWAttribute::MWAttribute()
|
MWAttribute::MWAttribute()
|
||||||
: mManager(NULL)
|
: mId(-1)
|
||||||
, mId(-1)
|
|
||||||
, mAttributeNameWidget(NULL)
|
, mAttributeNameWidget(NULL)
|
||||||
, mAttributeValueWidget(NULL)
|
, mAttributeValueWidget(NULL)
|
||||||
{
|
{
|
||||||
|
@ -152,7 +150,7 @@ void MWAttribute::onClicked(MyGUI::Widget* _sender)
|
||||||
|
|
||||||
void MWAttribute::updateWidgets()
|
void MWAttribute::updateWidgets()
|
||||||
{
|
{
|
||||||
if (mAttributeNameWidget && mManager)
|
if (mAttributeNameWidget)
|
||||||
{
|
{
|
||||||
if (mId < 0 || mId >= 8)
|
if (mId < 0 || mId >= 8)
|
||||||
{
|
{
|
||||||
|
@ -170,7 +168,7 @@ void MWAttribute::updateWidgets()
|
||||||
"sAttributePersonality",
|
"sAttributePersonality",
|
||||||
"sAttributeLuck"
|
"sAttributeLuck"
|
||||||
};
|
};
|
||||||
const std::string &name = mManager->getGameSettingString(attributes[mId], "");
|
const std::string &name = MWBase::Environment::get().getWindowManager()->getGameSettingString(attributes[mId], "");
|
||||||
static_cast<MyGUI::TextBox*>(mAttributeNameWidget)->setCaption(name);
|
static_cast<MyGUI::TextBox*>(mAttributeNameWidget)->setCaption(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,8 +216,7 @@ void MWAttribute::initialiseOverride()
|
||||||
/* MWSpell */
|
/* MWSpell */
|
||||||
|
|
||||||
MWSpell::MWSpell()
|
MWSpell::MWSpell()
|
||||||
: mWindowManager(NULL)
|
: mSpellNameWidget(NULL)
|
||||||
, mSpellNameWidget(NULL)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +239,6 @@ void MWSpell::createEffectWidgets(std::vector<MyGUI::Widget*> &effects, MyGUI::W
|
||||||
for (std::vector<ESM::ENAMstruct>::const_iterator it = spell->mEffects.mList.begin(); it != end; ++it)
|
for (std::vector<ESM::ENAMstruct>::const_iterator it = spell->mEffects.mList.begin(); it != end; ++it)
|
||||||
{
|
{
|
||||||
effect = creator->createWidget<MWSpellEffect>("MW_EffectImage", coord, MyGUI::Align::Default);
|
effect = creator->createWidget<MWSpellEffect>("MW_EffectImage", coord, MyGUI::Align::Default);
|
||||||
effect->setWindowManager(mWindowManager);
|
|
||||||
SpellEffectParams params;
|
SpellEffectParams params;
|
||||||
params.mEffectID = it->mEffectID;
|
params.mEffectID = it->mEffectID;
|
||||||
params.mSkill = it->mSkill;
|
params.mSkill = it->mSkill;
|
||||||
|
@ -262,7 +258,7 @@ void MWSpell::createEffectWidgets(std::vector<MyGUI::Widget*> &effects, MyGUI::W
|
||||||
|
|
||||||
void MWSpell::updateWidgets()
|
void MWSpell::updateWidgets()
|
||||||
{
|
{
|
||||||
if (mSpellNameWidget && mWindowManager)
|
if (mSpellNameWidget && MWBase::Environment::get().getWindowManager())
|
||||||
{
|
{
|
||||||
const MWWorld::ESMStore &store =
|
const MWWorld::ESMStore &store =
|
||||||
MWBase::Environment::get().getWorld()->getStore();
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
@ -289,8 +285,7 @@ MWSpell::~MWSpell()
|
||||||
/* MWEffectList */
|
/* MWEffectList */
|
||||||
|
|
||||||
MWEffectList::MWEffectList()
|
MWEffectList::MWEffectList()
|
||||||
: mWindowManager(NULL)
|
: mEffectList(0)
|
||||||
, mEffectList(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,7 +306,6 @@ void MWEffectList::createEffectWidgets(std::vector<MyGUI::Widget*> &effects, MyG
|
||||||
it != mEffectList.end(); ++it)
|
it != mEffectList.end(); ++it)
|
||||||
{
|
{
|
||||||
effect = creator->createWidget<MWSpellEffect>("MW_EffectImage", coord, MyGUI::Align::Default);
|
effect = creator->createWidget<MWSpellEffect>("MW_EffectImage", coord, MyGUI::Align::Default);
|
||||||
effect->setWindowManager(mWindowManager);
|
|
||||||
it->mIsConstant = (flags & EF_Constant) || it->mIsConstant;
|
it->mIsConstant = (flags & EF_Constant) || it->mIsConstant;
|
||||||
it->mNoTarget = (flags & EF_NoTarget) || it->mNoTarget;
|
it->mNoTarget = (flags & EF_NoTarget) || it->mNoTarget;
|
||||||
effect->setSpellEffect(*it);
|
effect->setSpellEffect(*it);
|
||||||
|
@ -378,8 +372,7 @@ SpellEffectList MWEffectList::effectListFromESM(const ESM::EffectList* effects)
|
||||||
/* MWSpellEffect */
|
/* MWSpellEffect */
|
||||||
|
|
||||||
MWSpellEffect::MWSpellEffect()
|
MWSpellEffect::MWSpellEffect()
|
||||||
: mWindowManager(NULL)
|
: mImageWidget(NULL)
|
||||||
, mImageWidget(NULL)
|
|
||||||
, mTextWidget(NULL)
|
, mTextWidget(NULL)
|
||||||
, mRequestedWidth(0)
|
, mRequestedWidth(0)
|
||||||
{
|
{
|
||||||
|
@ -409,22 +402,22 @@ void MWSpellEffect::updateWidgets()
|
||||||
|
|
||||||
assert(magicEffect);
|
assert(magicEffect);
|
||||||
|
|
||||||
std::string pt = mWindowManager->getGameSettingString("spoint", "");
|
std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", "");
|
||||||
std::string pts = mWindowManager->getGameSettingString("spoints", "");
|
std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", "");
|
||||||
std::string to = " " + mWindowManager->getGameSettingString("sTo", "") + " ";
|
std::string to = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sTo", "") + " ";
|
||||||
std::string sec = " " + mWindowManager->getGameSettingString("ssecond", "");
|
std::string sec = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("ssecond", "");
|
||||||
std::string secs = " " + mWindowManager->getGameSettingString("sseconds", "");
|
std::string secs = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sseconds", "");
|
||||||
|
|
||||||
std::string effectIDStr = ESM::MagicEffect::effectIdToString(mEffectParams.mEffectID);
|
std::string effectIDStr = ESM::MagicEffect::effectIdToString(mEffectParams.mEffectID);
|
||||||
std::string spellLine = mWindowManager->getGameSettingString(effectIDStr, "");
|
std::string spellLine = MWBase::Environment::get().getWindowManager()->getGameSettingString(effectIDStr, "");
|
||||||
|
|
||||||
if (magicEffect->mData.mFlags & ESM::MagicEffect::TargetSkill)
|
if (magicEffect->mData.mFlags & ESM::MagicEffect::TargetSkill)
|
||||||
{
|
{
|
||||||
spellLine += " " + mWindowManager->getGameSettingString(ESM::Skill::sSkillNameIds[mEffectParams.mSkill], "");
|
spellLine += " " + MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Skill::sSkillNameIds[mEffectParams.mSkill], "");
|
||||||
}
|
}
|
||||||
if (magicEffect->mData.mFlags & ESM::MagicEffect::TargetAttribute)
|
if (magicEffect->mData.mFlags & ESM::MagicEffect::TargetAttribute)
|
||||||
{
|
{
|
||||||
spellLine += " " + mWindowManager->getGameSettingString(ESM::Attribute::sGmstAttributeIds[mEffectParams.mAttribute], "");
|
spellLine += " " + MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Attribute::sGmstAttributeIds[mEffectParams.mAttribute], "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mEffectParams.mMagnMin >= 0 || mEffectParams.mMagnMax >= 0) && !(magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude))
|
if ((mEffectParams.mMagnMin >= 0 || mEffectParams.mMagnMax >= 0) && !(magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude))
|
||||||
|
@ -442,7 +435,7 @@ void MWSpellEffect::updateWidgets()
|
||||||
{
|
{
|
||||||
if (mEffectParams.mDuration >= 0 && !(magicEffect->mData.mFlags & ESM::MagicEffect::NoDuration))
|
if (mEffectParams.mDuration >= 0 && !(magicEffect->mData.mFlags & ESM::MagicEffect::NoDuration))
|
||||||
{
|
{
|
||||||
spellLine += " " + mWindowManager->getGameSettingString("sfor", "") + " " + boost::lexical_cast<std::string>(mEffectParams.mDuration) + ((mEffectParams.mDuration == 1) ? sec : secs);
|
spellLine += " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sfor", "") + " " + boost::lexical_cast<std::string>(mEffectParams.mDuration) + ((mEffectParams.mDuration == 1) ? sec : secs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEffectParams.mArea > 0)
|
if (mEffectParams.mArea > 0)
|
||||||
|
@ -453,13 +446,13 @@ void MWSpellEffect::updateWidgets()
|
||||||
// potions have no target
|
// potions have no target
|
||||||
if (!mEffectParams.mNoTarget)
|
if (!mEffectParams.mNoTarget)
|
||||||
{
|
{
|
||||||
std::string on = mWindowManager->getGameSettingString("sonword", "");
|
std::string on = MWBase::Environment::get().getWindowManager()->getGameSettingString("sonword", "");
|
||||||
if (mEffectParams.mRange == ESM::RT_Self)
|
if (mEffectParams.mRange == ESM::RT_Self)
|
||||||
spellLine += " " + on + " " + mWindowManager->getGameSettingString("sRangeSelf", "");
|
spellLine += " " + on + " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sRangeSelf", "");
|
||||||
else if (mEffectParams.mRange == ESM::RT_Touch)
|
else if (mEffectParams.mRange == ESM::RT_Touch)
|
||||||
spellLine += " " + on + " " + mWindowManager->getGameSettingString("sRangeTouch", "");
|
spellLine += " " + on + " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sRangeTouch", "");
|
||||||
else if (mEffectParams.mRange == ESM::RT_Target)
|
else if (mEffectParams.mRange == ESM::RT_Target)
|
||||||
spellLine += " " + on + " " + mWindowManager->getGameSettingString("sRangeTarget", "");
|
spellLine += " " + on + " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sRangeTarget", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
#include "../mwmechanics/stat.hpp"
|
#include "../mwmechanics/stat.hpp"
|
||||||
|
|
||||||
#include <MyGUI_Widget.h>
|
|
||||||
#include <MyGUI_TextBox.h>
|
|
||||||
#include <MyGUI_Button.h>
|
#include <MyGUI_Button.h>
|
||||||
#include <MyGUI_EditBox.h>
|
#include <MyGUI_EditBox.h>
|
||||||
|
|
||||||
|
@ -94,12 +92,10 @@ namespace MWGui
|
||||||
|
|
||||||
typedef MWMechanics::Stat<float> SkillValue;
|
typedef MWMechanics::Stat<float> SkillValue;
|
||||||
|
|
||||||
void setWindowManager(MWBase::WindowManager *m) { mManager = m; } /// \todo remove
|
|
||||||
void setSkillId(ESM::Skill::SkillEnum skillId);
|
void setSkillId(ESM::Skill::SkillEnum skillId);
|
||||||
void setSkillNumber(int skillId);
|
void setSkillNumber(int skillId);
|
||||||
void setSkillValue(const SkillValue& value);
|
void setSkillValue(const SkillValue& value);
|
||||||
|
|
||||||
MWBase::WindowManager *getWindowManager() const { return mManager; }
|
|
||||||
ESM::Skill::SkillEnum getSkillId() const { return mSkillId; }
|
ESM::Skill::SkillEnum getSkillId() const { return mSkillId; }
|
||||||
const SkillValue& getSkillValue() const { return mValue; }
|
const SkillValue& getSkillValue() const { return mValue; }
|
||||||
|
|
||||||
|
@ -122,7 +118,6 @@ namespace MWGui
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
MWBase::WindowManager *mManager;
|
|
||||||
ESM::Skill::SkillEnum mSkillId;
|
ESM::Skill::SkillEnum mSkillId;
|
||||||
SkillValue mValue;
|
SkillValue mValue;
|
||||||
MyGUI::Widget* mSkillNameWidget;
|
MyGUI::Widget* mSkillNameWidget;
|
||||||
|
@ -138,11 +133,9 @@ namespace MWGui
|
||||||
|
|
||||||
typedef MWMechanics::Stat<int> AttributeValue;
|
typedef MWMechanics::Stat<int> AttributeValue;
|
||||||
|
|
||||||
void setWindowManager(MWBase::WindowManager *m) { mManager = m; }
|
|
||||||
void setAttributeId(int attributeId);
|
void setAttributeId(int attributeId);
|
||||||
void setAttributeValue(const AttributeValue& value);
|
void setAttributeValue(const AttributeValue& value);
|
||||||
|
|
||||||
MWBase::WindowManager *getWindowManager() const { return mManager; }
|
|
||||||
int getAttributeId() const { return mId; }
|
int getAttributeId() const { return mId; }
|
||||||
const AttributeValue& getAttributeValue() const { return mValue; }
|
const AttributeValue& getAttributeValue() const { return mValue; }
|
||||||
|
|
||||||
|
@ -165,7 +158,6 @@ namespace MWGui
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
MWBase::WindowManager *mManager;
|
|
||||||
int mId;
|
int mId;
|
||||||
AttributeValue mValue;
|
AttributeValue mValue;
|
||||||
MyGUI::Widget* mAttributeNameWidget;
|
MyGUI::Widget* mAttributeNameWidget;
|
||||||
|
@ -185,7 +177,6 @@ namespace MWGui
|
||||||
|
|
||||||
typedef MWMechanics::Stat<int> SpellValue;
|
typedef MWMechanics::Stat<int> SpellValue;
|
||||||
|
|
||||||
void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
|
|
||||||
void setSpellId(const std::string &id);
|
void setSpellId(const std::string &id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -207,7 +198,6 @@ namespace MWGui
|
||||||
private:
|
private:
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
MWBase::WindowManager* mWindowManager;
|
|
||||||
std::string mId;
|
std::string mId;
|
||||||
MyGUI::TextBox* mSpellNameWidget;
|
MyGUI::TextBox* mSpellNameWidget;
|
||||||
};
|
};
|
||||||
|
@ -227,7 +217,6 @@ namespace MWGui
|
||||||
EF_Constant = 0x02 // constant effect means that duration will not be displayed
|
EF_Constant = 0x02 // constant effect means that duration will not be displayed
|
||||||
};
|
};
|
||||||
|
|
||||||
void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
|
|
||||||
void setEffectList(const SpellEffectList& list);
|
void setEffectList(const SpellEffectList& list);
|
||||||
|
|
||||||
static SpellEffectList effectListFromESM(const ESM::EffectList* effects);
|
static SpellEffectList effectListFromESM(const ESM::EffectList* effects);
|
||||||
|
@ -249,7 +238,6 @@ namespace MWGui
|
||||||
private:
|
private:
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
MWBase::WindowManager* mWindowManager;
|
|
||||||
SpellEffectList mEffectList;
|
SpellEffectList mEffectList;
|
||||||
};
|
};
|
||||||
typedef MWEffectList* MWEffectListPtr;
|
typedef MWEffectList* MWEffectListPtr;
|
||||||
|
@ -262,7 +250,6 @@ namespace MWGui
|
||||||
|
|
||||||
typedef ESM::ENAMstruct SpellEffectValue;
|
typedef ESM::ENAMstruct SpellEffectValue;
|
||||||
|
|
||||||
void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
|
|
||||||
void setSpellEffect(const SpellEffectParams& params);
|
void setSpellEffect(const SpellEffectParams& params);
|
||||||
|
|
||||||
int getRequestedWidth() const { return mRequestedWidth; }
|
int getRequestedWidth() const { return mRequestedWidth; }
|
||||||
|
@ -276,7 +263,6 @@ namespace MWGui
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
MWBase::WindowManager* mWindowManager;
|
|
||||||
SpellEffectParams mEffectParams;
|
SpellEffectParams mEffectParams;
|
||||||
MyGUI::ImageBox* mImageWidget;
|
MyGUI::ImageBox* mImageWidget;
|
||||||
MyGUI::TextBox* mTextWidget;
|
MyGUI::TextBox* mTextWidget;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/settings.hpp>
|
||||||
|
|
||||||
|
@ -6,9 +6,8 @@
|
||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
WindowBase::WindowBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
|
WindowBase::WindowBase(const std::string& parLayout)
|
||||||
: Layout(parLayout)
|
: Layout(parLayout)
|
||||||
, mWindowManager(parWindowManager)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,8 +38,8 @@ void WindowBase::center()
|
||||||
mMainWidget->setCoord(coord);
|
mMainWidget->setCoord(coord);
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowModal::WindowModal(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
|
WindowModal::WindowModal(const std::string& parLayout)
|
||||||
: WindowBase(parLayout, parWindowManager)
|
: WindowBase(parLayout)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace MWGui
|
||||||
class WindowBase: public OEngine::GUI::Layout
|
class WindowBase: public OEngine::GUI::Layout
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WindowBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
|
WindowBase(const std::string& parLayout);
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
|
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
|
||||||
|
@ -29,10 +29,6 @@ namespace MWGui
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
*/
|
*/
|
||||||
EventHandle_WindowBase eventDone;
|
EventHandle_WindowBase eventDone;
|
||||||
|
|
||||||
protected:
|
|
||||||
/// \todo remove
|
|
||||||
MWBase::WindowManager& mWindowManager;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +38,7 @@ namespace MWGui
|
||||||
class WindowModal : public WindowBase
|
class WindowModal : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WindowModal(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
|
WindowModal(const std::string& parLayout);
|
||||||
virtual void open();
|
virtual void open();
|
||||||
virtual void close();
|
virtual void close();
|
||||||
};
|
};
|
|
@ -21,12 +21,12 @@
|
||||||
#include "console.hpp"
|
#include "console.hpp"
|
||||||
#include "journalwindow.hpp"
|
#include "journalwindow.hpp"
|
||||||
#include "charactercreation.hpp"
|
#include "charactercreation.hpp"
|
||||||
#include "text_input.hpp"
|
#include "textinput.hpp"
|
||||||
#include "review.hpp"
|
#include "review.hpp"
|
||||||
#include "dialogue.hpp"
|
#include "dialogue.hpp"
|
||||||
#include "dialogue_history.hpp"
|
#include "dialoguehistory.hpp"
|
||||||
#include "map_window.hpp"
|
#include "mapwindow.hpp"
|
||||||
#include "stats_window.hpp"
|
#include "statswindow.hpp"
|
||||||
#include "messagebox.hpp"
|
#include "messagebox.hpp"
|
||||||
#include "container.hpp"
|
#include "container.hpp"
|
||||||
#include "inventorywindow.hpp"
|
#include "inventorywindow.hpp"
|
||||||
|
@ -162,38 +162,38 @@ WindowManager::WindowManager(
|
||||||
mDragAndDrop->mDragAndDropWidget = dragAndDropWidget;
|
mDragAndDrop->mDragAndDropWidget = dragAndDropWidget;
|
||||||
|
|
||||||
mMenu = new MainMenu(w,h);
|
mMenu = new MainMenu(w,h);
|
||||||
mMap = new MapWindow(*this, cacheDir);
|
mMap = new MapWindow(cacheDir);
|
||||||
mStatsWindow = new StatsWindow(*this);
|
mStatsWindow = new StatsWindow();
|
||||||
mConsole = new Console(w,h, consoleOnlyScripts);
|
mConsole = new Console(w,h, consoleOnlyScripts);
|
||||||
mJournal = new JournalWindow(*this);
|
mJournal = new JournalWindow();
|
||||||
mMessageBoxManager = new MessageBoxManager(this);
|
mMessageBoxManager = new MessageBoxManager();
|
||||||
mInventoryWindow = new InventoryWindow(*this,mDragAndDrop);
|
mInventoryWindow = new InventoryWindow(mDragAndDrop);
|
||||||
mTradeWindow = new TradeWindow(*this);
|
mTradeWindow = new TradeWindow();
|
||||||
mSpellBuyingWindow = new SpellBuyingWindow(*this);
|
mSpellBuyingWindow = new SpellBuyingWindow();
|
||||||
mTravelWindow = new TravelWindow(*this);
|
mTravelWindow = new TravelWindow();
|
||||||
mDialogueWindow = new DialogueWindow(*this);
|
mDialogueWindow = new DialogueWindow();
|
||||||
mContainerWindow = new ContainerWindow(*this,mDragAndDrop);
|
mContainerWindow = new ContainerWindow(mDragAndDrop);
|
||||||
mHud = new HUD(w,h, mShowFPSLevel, mDragAndDrop);
|
mHud = new HUD(w,h, mShowFPSLevel, mDragAndDrop);
|
||||||
mToolTips = new ToolTips(this);
|
mToolTips = new ToolTips();
|
||||||
mScrollWindow = new ScrollWindow(*this);
|
mScrollWindow = new ScrollWindow();
|
||||||
mBookWindow = new BookWindow(*this);
|
mBookWindow = new BookWindow();
|
||||||
mCountDialog = new CountDialog(*this);
|
mCountDialog = new CountDialog();
|
||||||
mSettingsWindow = new SettingsWindow(*this);
|
mSettingsWindow = new SettingsWindow();
|
||||||
mConfirmationDialog = new ConfirmationDialog(*this);
|
mConfirmationDialog = new ConfirmationDialog();
|
||||||
mAlchemyWindow = new AlchemyWindow(*this);
|
mAlchemyWindow = new AlchemyWindow();
|
||||||
mSpellWindow = new SpellWindow(*this);
|
mSpellWindow = new SpellWindow();
|
||||||
mQuickKeysMenu = new QuickKeysMenu(*this);
|
mQuickKeysMenu = new QuickKeysMenu();
|
||||||
mLevelupDialog = new LevelupDialog(*this);
|
mLevelupDialog = new LevelupDialog();
|
||||||
mWaitDialog = new WaitDialog(*this);
|
mWaitDialog = new WaitDialog();
|
||||||
mSpellCreationDialog = new SpellCreationDialog(*this);
|
mSpellCreationDialog = new SpellCreationDialog();
|
||||||
mEnchantingDialog = new EnchantingDialog(*this);
|
mEnchantingDialog = new EnchantingDialog();
|
||||||
mTrainingWindow = new TrainingWindow(*this);
|
mTrainingWindow = new TrainingWindow();
|
||||||
mMerchantRepair = new MerchantRepair(*this);
|
mMerchantRepair = new MerchantRepair();
|
||||||
mRepair = new Repair(*this);
|
mRepair = new Repair();
|
||||||
mSoulgemDialog = new SoulgemDialog(mMessageBoxManager);
|
mSoulgemDialog = new SoulgemDialog(mMessageBoxManager);
|
||||||
mCompanionWindow = new CompanionWindow(*this, mDragAndDrop, mMessageBoxManager);
|
mCompanionWindow = new CompanionWindow(mDragAndDrop, mMessageBoxManager);
|
||||||
|
|
||||||
mLoadingScreen = new LoadingScreen(mRendering->getScene (), mRendering->getWindow (), *this);
|
mLoadingScreen = new LoadingScreen(mRendering->getScene (), mRendering->getWindow ());
|
||||||
mLoadingScreen->onResChange (w,h);
|
mLoadingScreen->onResChange (w,h);
|
||||||
|
|
||||||
mInputBlocker = mGui->createWidget<MyGUI::Widget>("",0,0,w,h,MyGUI::Align::Default,"Windows","");
|
mInputBlocker = mGui->createWidget<MyGUI::Widget>("",0,0,w,h,MyGUI::Align::Default,"Windows","");
|
||||||
|
@ -202,7 +202,7 @@ WindowManager::WindowManager(
|
||||||
|
|
||||||
mHud->setVisible(mHudEnabled);
|
mHud->setVisible(mHudEnabled);
|
||||||
|
|
||||||
mCharGen = new CharacterCreation(this);
|
mCharGen = new CharacterCreation();
|
||||||
|
|
||||||
// Setup player stats
|
// Setup player stats
|
||||||
for (int i = 0; i < ESM::Attribute::Length; ++i)
|
for (int i = 0; i < ESM::Attribute::Length; ++i)
|
||||||
|
|
|
@ -10,11 +10,6 @@
|
||||||
this class.
|
this class.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <components/esm/loadclas.hpp>
|
|
||||||
|
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
namespace MyGUI
|
namespace MyGUI
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "window_pinnable_base.hpp"
|
#include "windowpinnablebase.hpp"
|
||||||
|
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
|
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout)
|
||||||
: WindowBase(parLayout, parWindowManager), mPinned(false), mVisible(false)
|
: WindowBase(parLayout), mPinned(false), mVisible(false)
|
||||||
{
|
{
|
||||||
ExposedWindow* window = static_cast<ExposedWindow*>(mMainWidget);
|
ExposedWindow* window = static_cast<ExposedWindow*>(mMainWidget);
|
||||||
mPinButton = window->getSkinWidget ("Button");
|
mPinButton = window->getSkinWidget ("Button");
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_WINDOW_PINNABLE_BASE_H
|
#ifndef MWGUI_WINDOW_PINNABLE_BASE_H
|
||||||
#define MWGUI_WINDOW_PINNABLE_BASE_H
|
#define MWGUI_WINDOW_PINNABLE_BASE_H
|
||||||
|
|
||||||
#include "window_base.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ namespace MWGui
|
||||||
class WindowPinnableBase: public WindowBase
|
class WindowPinnableBase: public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
|
WindowPinnableBase(const std::string& parLayout);
|
||||||
bool pinned() { return mPinned; }
|
bool pinned() { return mPinned; }
|
||||||
|
|
||||||
private:
|
private:
|
Loading…
Reference in a new issue