Merge remote-tracking branch 'galdor557/master'

Conflicts:
	apps/openmw/mwgui/travelwindow.cpp
actorid
Marc Zinnschlag 12 years ago
commit 3f846a50d9

@ -24,9 +24,9 @@ add_openmw_dir (mwinput
)
add_openmw_dir (mwgui
text_input widgets race class birth review windowmanagerimp console dialogue
dialogue_history window_base stats_window messagebox journalwindow charactercreation
map_window window_pinnable_base tooltips scrollwindow bookwindow list
textinput widgets race class birth review windowmanagerimp console dialogue
dialoguehistory windowbase statswindow messagebox journalwindow charactercreation
mapwindow windowpinnablebase tooltips scrollwindow bookwindow list
formatting inventorywindow container hud countdialog tradewindow settingswindow
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog

@ -26,8 +26,8 @@ namespace
namespace MWGui
{
AlchemyWindow::AlchemyWindow(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_alchemy_window.layout", parWindowManager)
AlchemyWindow::AlchemyWindow()
: WindowBase("openmw_alchemy_window.layout")
, ContainerBase(0), mApparatus (4), mIngredients (4)
{
getWidget(mCreateButton, "CreateButton");
@ -64,8 +64,8 @@ namespace MWGui
{
mAlchemy.clear();
mWindowManager.removeGuiMode(GM_Alchemy);
mWindowManager.removeGuiMode(GM_Inventory);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Alchemy);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Inventory);
}
void AlchemyWindow::onCreateButtonClicked(MyGUI::Widget* _sender)
@ -77,40 +77,40 @@ namespace MWGui
if (result == MWMechanics::Alchemy::Result_NoName)
{
mWindowManager.messageBox("#{sNotifyMessage37}");
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage37}");
return;
}
// check if mortar & pestle is available (always needed)
if (result == MWMechanics::Alchemy::Result_NoMortarAndPestle)
{
mWindowManager.messageBox("#{sNotifyMessage45}");
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage45}");
return;
}
// make sure 2 or more ingredients were selected
if (result == MWMechanics::Alchemy::Result_LessThanTwoIngredients)
{
mWindowManager.messageBox("#{sNotifyMessage6a}");
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage6a}");
return;
}
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);
return;
}
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);
}
else if (result == MWMechanics::Alchemy::Result_RandomFailure)
{
// potion failed
mWindowManager.messageBox("#{sNotifyMessage8}");
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage8}");
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);
Widgets::MWEffectListPtr effectsWidget = mEffectsBox->createWidget<Widgets::MWEffectList>
("MW_StatName", coord, MyGUI::Align::Left | MyGUI::Align::Top);
effectsWidget->setWindowManager(&mWindowManager);
Widgets::SpellEffectList _list = Widgets::MWEffectList::effectListFromESM(&list);
effectsWidget->setEffectList(_list);

@ -5,16 +5,16 @@
#include "../mwmechanics/alchemy.hpp"
#include "window_base.hpp"
#include "container.hpp"
#include "widgets.hpp"
namespace MWGui
{
class AlchemyWindow : public WindowBase, public ContainerBase
{
public:
AlchemyWindow(MWBase::WindowManager& parWindowManager);
AlchemyWindow();
virtual void open();
@ -38,7 +38,7 @@ namespace MWGui
virtual void onReferenceUnavailable() { ; }
void update();
private:
MWMechanics::Alchemy mAlchemy;

@ -24,8 +24,8 @@ bool sortBirthSigns(const std::pair<std::string, const ESM::BirthSign*>& left, c
}
BirthDialog::BirthDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_chargen_birth.layout", parWindowManager)
BirthDialog::BirthDialog()
: WindowModal("openmw_chargen_birth.layout")
{
// Centre dialog
center();
@ -46,7 +46,7 @@ BirthDialog::BirthDialog(MWBase::WindowManager& parWindowManager)
MyGUI::Button* okButton;
getWidget(okButton, "OKButton");
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BirthDialog::onOkClicked);
updateBirths();
@ -59,9 +59,9 @@ void BirthDialog::setNextButtonShow(bool shown)
getWidget(okButton, "OKButton");
if (shown)
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sNext", ""));
else
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
}
void BirthDialog::open()
@ -221,7 +221,7 @@ void BirthDialog::updateSpells()
if (!categories[category].spells.empty())
{
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);
coord.top += lineHeight;
@ -230,7 +230,6 @@ void BirthDialog::updateSpells()
{
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->setWindowManager(&mWindowManager);
spellWidget->setSpellId(spellId);
mSpellItems.push_back(spellWidget);

@ -1,7 +1,7 @@
#ifndef MWGUI_BIRTH_H
#define MWGUI_BIRTH_H
#include "window_base.hpp"
#include "windowbase.hpp"
/*
This file contains the dialog for choosing a birth sign.
@ -13,7 +13,7 @@ namespace MWGui
class BirthDialog : public WindowModal
{
public:
BirthDialog(MWBase::WindowManager& parWindowManager);
BirthDialog();
enum Gender
{

@ -14,8 +14,8 @@
using namespace MWGui;
BookWindow::BookWindow (MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_book.layout", parWindowManager)
BookWindow::BookWindow ()
: WindowBase("openmw_book.layout")
, mTakeButtonShow(true)
, mTakeButtonAllowed(true)
{
@ -102,7 +102,7 @@ void BookWindow::onCloseButtonClicked (MyGUI::Widget* sender)
// no 3d sounds because the object could be in a container.
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)
@ -112,7 +112,7 @@ void BookWindow::onTakeButtonClicked (MyGUI::Widget* sender)
MWWorld::ActionTake take(mBook);
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)

@ -1,7 +1,7 @@
#ifndef MWGUI_BOOKWINDOW_H
#define MWGUI_BOOKWINDOW_H
#include "window_base.hpp"
#include "windowbase.hpp"
#include "../mwworld/ptr.hpp"
@ -12,7 +12,7 @@ namespace MWGui
class BookWindow : public WindowBase
{
public:
BookWindow(MWBase::WindowManager& parWindowManager);
BookWindow();
void open(MWWorld::Ptr book);
void setTakeButtonShow(bool show);

@ -1,6 +1,6 @@
#include "charactercreation.hpp"
#include "text_input.hpp"
#include "textinput.hpp"
#include "race.hpp"
#include "class.hpp"
#include "birth.hpp"
@ -47,7 +47,7 @@ namespace
using namespace MWGui;
CharacterCreation::CharacterCreation(MWBase::WindowManager* _wm)
CharacterCreation::CharacterCreation()
: mNameDialog(0)
, mRaceDialog(0)
, mClassChoiceDialog(0)
@ -58,7 +58,6 @@ CharacterCreation::CharacterCreation(MWBase::WindowManager* _wm)
, mBirthSignDialog(0)
, mReviewDialog(0)
, mGenerateClassStep(0)
, mWM(_wm)
{
mCreationStage = CSE_NotStarted;
}
@ -118,10 +117,10 @@ void CharacterCreation::spawnDialog(const char id)
switch (id)
{
case GM_Name:
mWM->removeDialog(mNameDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mNameDialog);
mNameDialog = 0;
mNameDialog = new TextInputDialog(*mWM);
mNameDialog->setTextLabel(mWM->getGameSettingString("sName", "Name"));
mNameDialog = new TextInputDialog();
mNameDialog->setTextLabel(MWBase::Environment::get().getWindowManager()->getGameSettingString("sName", "Name"));
mNameDialog->setTextInput(mPlayerName);
mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
mNameDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
@ -129,9 +128,9 @@ void CharacterCreation::spawnDialog(const char id)
break;
case GM_Race:
mWM->removeDialog(mRaceDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mRaceDialog);
mRaceDialog = 0;
mRaceDialog = new RaceDialog(*mWM);
mRaceDialog = new RaceDialog();
mRaceDialog->setNextButtonShow(mCreationStage >= CSE_RaceChosen);
mRaceDialog->setRaceId(mPlayerRaceId);
mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
@ -142,9 +141,9 @@ void CharacterCreation::spawnDialog(const char id)
break;
case GM_Class:
mWM->removeDialog(mClassChoiceDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mClassChoiceDialog);
mClassChoiceDialog = 0;
mClassChoiceDialog = new ClassChoiceDialog(*mWM);
mClassChoiceDialog = new ClassChoiceDialog();
mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
mClassChoiceDialog->setVisible(true);
if (mCreationStage < CSE_RaceChosen)
@ -152,9 +151,9 @@ void CharacterCreation::spawnDialog(const char id)
break;
case GM_ClassPick:
mWM->removeDialog(mPickClassDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mPickClassDialog);
mPickClassDialog = 0;
mPickClassDialog = new PickClassDialog(*mWM);
mPickClassDialog = new PickClassDialog();
mPickClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
mPickClassDialog->setClassId(mPlayerClass.mName);
mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
@ -165,9 +164,9 @@ void CharacterCreation::spawnDialog(const char id)
break;
case GM_Birth:
mWM->removeDialog(mBirthSignDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mBirthSignDialog);
mBirthSignDialog = 0;
mBirthSignDialog = new BirthDialog(*mWM);
mBirthSignDialog = new BirthDialog();
mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
mBirthSignDialog->setBirthId(mPlayerBirthSignId);
mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
@ -178,9 +177,9 @@ void CharacterCreation::spawnDialog(const char id)
break;
case GM_ClassCreate:
mWM->removeDialog(mCreateClassDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mCreateClassDialog);
mCreateClassDialog = 0;
mCreateClassDialog = new CreateClassDialog(*mWM);
mCreateClassDialog = new CreateClassDialog();
mCreateClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
@ -199,9 +198,9 @@ void CharacterCreation::spawnDialog(const char id)
mCreationStage = CSE_RaceChosen;
break;
case GM_Review:
mWM->removeDialog(mReviewDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
mReviewDialog = 0;
mReviewDialog = new ReviewDialog(*mWM);
mReviewDialog = new ReviewDialog();
mReviewDialog->setPlayerName(mPlayerName);
mReviewDialog->setRace(mPlayerRaceId);
mReviewDialog->setClass(mPlayerClass);
@ -212,7 +211,7 @@ void CharacterCreation::spawnDialog(const char id)
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();
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();
it != skills.end(); ++it)
{
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);
@ -257,41 +256,41 @@ void CharacterCreation::setPlayerFatigue (const MWMechanics::DynamicStat<float>&
void CharacterCreation::onReviewDialogDone(WindowBase* parWindow)
{
mWM->removeDialog(mReviewDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
mReviewDialog = 0;
mWM->popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
void CharacterCreation::onReviewDialogBack()
{
mWM->removeDialog(mReviewDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
mReviewDialog = 0;
mWM->pushGuiMode(GM_Birth);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
}
void CharacterCreation::onReviewActivateDialog(int parDialog)
{
mWM->removeDialog(mReviewDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
mReviewDialog = 0;
mCreationStage = CSE_ReviewNext;
mWM->popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
switch(parDialog)
{
case ReviewDialog::NAME_DIALOG:
mWM->pushGuiMode(GM_Name);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Name);
break;
case ReviewDialog::RACE_DIALOG:
mWM->pushGuiMode(GM_Race);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Race);
break;
case ReviewDialog::CLASS_DIALOG:
mWM->pushGuiMode(GM_Class);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
break;
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)
{
mPlayerClass = *klass;
mWM->setPlayerClass(mPlayerClass);
MWBase::Environment::get().getWindowManager()->setPlayerClass(mPlayerClass);
}
mWM->removeDialog(mPickClassDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mPickClassDialog);
mPickClassDialog = 0;
}
//TODO This bit gets repeated a few times; wrap it in a function
if (mCreationStage == CSE_ReviewNext)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Review);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
}
else if (mCreationStage >= CSE_ClassChosen)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Birth);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
}
else
{
mCreationStage = CSE_ClassChosen;
mWM->popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
}
@ -339,34 +338,34 @@ void CharacterCreation::onPickClassDialogBack()
const std::string classId = mPickClassDialog->getClassId();
if (!classId.empty())
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(classId);
mWM->removeDialog(mPickClassDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mPickClassDialog);
mPickClassDialog = 0;
}
mWM->popGuiMode();
mWM->pushGuiMode(GM_Class);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
}
void CharacterCreation::onClassChoice(int _index)
{
mWM->removeDialog(mClassChoiceDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mClassChoiceDialog);
mClassChoiceDialog = 0;
mWM->popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
switch(_index)
{
case ClassChoiceDialog::Class_Generate:
mWM->pushGuiMode(GM_ClassGenerate);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_ClassGenerate);
break;
case ClassChoiceDialog::Class_Pick:
mWM->pushGuiMode(GM_ClassPick);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_ClassPick);
break;
case ClassChoiceDialog::Class_Create:
mWM->pushGuiMode(GM_ClassCreate);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_ClassCreate);
break;
case ClassChoiceDialog::Class_Back:
mWM->pushGuiMode(GM_Race);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Race);
break;
};
@ -377,26 +376,26 @@ void CharacterCreation::onNameDialogDone(WindowBase* parWindow)
if (mNameDialog)
{
mPlayerName = mNameDialog->getTextInput();
mWM->setValue("name", mPlayerName);
MWBase::Environment::get().getWindowManager()->setValue("name", mPlayerName);
MWBase::Environment::get().getMechanicsManager()->setPlayerName(mPlayerName);
mWM->removeDialog(mNameDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mNameDialog);
mNameDialog = 0;
}
if (mCreationStage == CSE_ReviewNext)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Review);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
}
else if (mCreationStage >= CSE_NameChosen)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Race);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Race);
}
else
{
mCreationStage = CSE_NameChosen;
mWM->popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
}
@ -414,12 +413,12 @@ void CharacterCreation::onRaceDialogBack()
data.mHair
);
}
mWM->removeDialog(mRaceDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mRaceDialog);
mRaceDialog = 0;
}
mWM->popGuiMode();
mWM->pushGuiMode(GM_Name);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Name);
}
void CharacterCreation::onRaceDialogDone(WindowBase* parWindow)
@ -436,26 +435,26 @@ void CharacterCreation::onRaceDialogDone(WindowBase* parWindow)
data.mHair
);
}
mWM->getInventoryWindow()->rebuildAvatar();
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->rebuildAvatar();
mWM->removeDialog(mRaceDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mRaceDialog);
mRaceDialog = 0;
}
if (mCreationStage == CSE_ReviewNext)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Review);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
}
else if (mCreationStage >= CSE_RaceChosen)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Class);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
}
else
{
mCreationStage = CSE_RaceChosen;
mWM->popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
}
@ -466,19 +465,19 @@ void CharacterCreation::onBirthSignDialogDone(WindowBase* parWindow)
mPlayerBirthSignId = mBirthSignDialog->getBirthId();
if (!mPlayerBirthSignId.empty())
MWBase::Environment::get().getMechanicsManager()->setPlayerBirthsign(mPlayerBirthSignId);
mWM->removeDialog(mBirthSignDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mBirthSignDialog);
mBirthSignDialog = 0;
}
if (mCreationStage >= CSE_BirthSignChosen)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Review);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
}
else
{
mCreationStage = CSE_BirthSignChosen;
mWM->popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
}
@ -487,12 +486,12 @@ void CharacterCreation::onBirthSignDialogBack()
if (mBirthSignDialog)
{
MWBase::Environment::get().getMechanicsManager()->setPlayerBirthsign(mBirthSignDialog->getBirthId());
mWM->removeDialog(mBirthSignDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mBirthSignDialog);
mBirthSignDialog = 0;
}
mWM->popGuiMode();
mWM->pushGuiMode(GM_Class);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
}
void CharacterCreation::onCreateClassDialogDone(WindowBase* parWindow)
@ -522,49 +521,49 @@ void CharacterCreation::onCreateClassDialogDone(WindowBase* parWindow)
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(klass);
mPlayerClass = klass;
mWM->setPlayerClass(klass);
MWBase::Environment::get().getWindowManager()->setPlayerClass(klass);
mWM->removeDialog(mCreateClassDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mCreateClassDialog);
mCreateClassDialog = 0;
}
if (mCreationStage == CSE_ReviewNext)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Review);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
}
else if (mCreationStage >= CSE_ClassChosen)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Birth);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
}
else
{
mCreationStage = CSE_ClassChosen;
mWM->popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
}
void CharacterCreation::onCreateClassDialogBack()
{
mWM->removeDialog(mCreateClassDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mCreateClassDialog);
mCreateClassDialog = 0;
mWM->popGuiMode();
mWM->pushGuiMode(GM_Class);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
}
void CharacterCreation::onClassQuestionChosen(int _index)
{
MWBase::Environment::get().getSoundManager()->stopSay();
mWM->removeDialog(mGenerateClassQuestionDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mGenerateClassQuestionDialog);
mGenerateClassQuestionDialog = 0;
if (_index < 0 || _index >= 3)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Class);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
return;
}
@ -637,10 +636,10 @@ void CharacterCreation::showClassQuestionDialog()
}
}
mWM->removeDialog(mGenerateClassResultDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mGenerateClassResultDialog);
mGenerateClassResultDialog = 0;
mGenerateClassResultDialog = new GenerateClassResultDialog(*mWM);
mGenerateClassResultDialog = new GenerateClassResultDialog();
mGenerateClassResultDialog->setClassId(mGenerateClass);
mGenerateClassResultDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
mGenerateClassResultDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
@ -650,15 +649,15 @@ void CharacterCreation::showClassQuestionDialog()
if (mGenerateClassStep > 10)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Class);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
return;
}
mWM->removeDialog(mGenerateClassQuestionDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mGenerateClassQuestionDialog);
mGenerateClassQuestionDialog = 0;
mGenerateClassQuestionDialog = new InfoBoxDialog(*mWM);
mGenerateClassQuestionDialog = new InfoBoxDialog();
InfoBoxDialog::ButtonList buttons;
mGenerateClassQuestionDialog->setText(sGenerateClassSteps(mGenerateClassStep).mText);
@ -674,18 +673,18 @@ void CharacterCreation::showClassQuestionDialog()
void CharacterCreation::onGenerateClassBack()
{
mWM->removeDialog(mGenerateClassResultDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mGenerateClassResultDialog);
mGenerateClassResultDialog = 0;
MWBase::Environment::get().getMechanicsManager()->setPlayerClass(mGenerateClass);
mWM->popGuiMode();
mWM->pushGuiMode(GM_Class);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Class);
}
void CharacterCreation::onGenerateClassDone(WindowBase* parWindow)
{
mWM->removeDialog(mGenerateClassResultDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mGenerateClassResultDialog);
mGenerateClassResultDialog = 0;
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);
mPlayerClass = *klass;
mWM->setPlayerClass(mPlayerClass);
MWBase::Environment::get().getWindowManager()->setPlayerClass(mPlayerClass);
if (mCreationStage == CSE_ReviewNext)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Review);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Review);
}
else if (mCreationStage >= CSE_ClassChosen)
{
mWM->popGuiMode();
mWM->pushGuiMode(GM_Birth);
MWBase::Environment::get().getWindowManager()->popGuiMode();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Birth);
}
else
{
mCreationStage = CSE_ClassChosen;
mWM->popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
}

@ -1,13 +1,9 @@
#ifndef CHARACTER_CREATION_HPP
#define CHARACTER_CREATION_HPP
#include "../mwworld/esmstore.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwmechanics/stat.hpp"
namespace MWGui
{
class WindowBase;
@ -29,7 +25,7 @@ namespace MWGui
public:
typedef std::vector<int> SkillList;
CharacterCreation(MWBase::WindowManager* _wm);
CharacterCreation();
~CharacterCreation();
//Show a dialog
@ -58,8 +54,6 @@ namespace MWGui
BirthDialog* mBirthSignDialog;
ReviewDialog* mReviewDialog;
MWBase::WindowManager* mWM;
//Player data
std::string mPlayerName;
std::string mPlayerRaceId;

@ -20,13 +20,13 @@ using namespace MWGui;
/* GenerateClassResultDialog */
GenerateClassResultDialog::GenerateClassResultDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_chargen_generate_class_result.layout", parWindowManager)
GenerateClassResultDialog::GenerateClassResultDialog()
: WindowModal("openmw_chargen_generate_class_result.layout")
{
// Centre dialog
center();
setText("ReflectT", mWindowManager.getGameSettingString("sMessageQuestionAnswer1", ""));
setText("ReflectT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sMessageQuestionAnswer1", ""));
getWidget(mClassImage, "ClassImage");
getWidget(mClassName, "ClassName");
@ -37,7 +37,7 @@ GenerateClassResultDialog::GenerateClassResultDialog(MWBase::WindowManager& parW
MyGUI::Button* okButton;
getWidget(okButton, "OKButton");
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
}
@ -67,8 +67,8 @@ void GenerateClassResultDialog::onBackClicked(MyGUI::Widget* _sender)
/* PickClassDialog */
PickClassDialog::PickClassDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_chargen_class.layout", parWindowManager)
PickClassDialog::PickClassDialog()
: WindowModal("openmw_chargen_class.layout")
{
// Centre dialog
center();
@ -77,16 +77,12 @@ PickClassDialog::PickClassDialog(MWBase::WindowManager& parWindowManager)
getWidget(mFavoriteAttribute[0], "FavoriteAttribute0");
getWidget(mFavoriteAttribute[1], "FavoriteAttribute1");
mFavoriteAttribute[0]->setWindowManager(&mWindowManager);
mFavoriteAttribute[1]->setWindowManager(&mWindowManager);
for(int i = 0; i < 5; i++)
{
char theIndex = '0'+i;
getWidget(mMajorSkill[i], std::string("MajorSkill").append(1, theIndex));
getWidget(mMinorSkill[i], std::string("MinorSkill").append(1, theIndex));
mMajorSkill[i]->setWindowManager(&mWindowManager);
mMinorSkill[i]->setWindowManager(&mWindowManager);
}
getWidget(mClassList, "ClassList");
@ -115,9 +111,9 @@ void PickClassDialog::setNextButtonShow(bool shown)
getWidget(okButton, "OKButton");
if (shown)
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sNext", ""));
else
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
}
void PickClassDialog::open()
@ -224,7 +220,7 @@ void PickClassDialog::updateStats()
"sSpecializationMagic",
"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);
ToolTips::createSpecializationToolTip(mSpecializationName, specName, specialization);
@ -276,8 +272,8 @@ void InfoBoxDialog::layoutVertically(MyGUI::Widget* widget, int margin)
widget->setSize(width, pos);
}
InfoBoxDialog::InfoBoxDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_infobox.layout", parWindowManager)
InfoBoxDialog::InfoBoxDialog()
: WindowModal("openmw_infobox.layout")
, mCurrentButton(-1)
{
getWidget(mTextBox, "TextBox");
@ -360,22 +356,22 @@ void InfoBoxDialog::onButtonClicked(MyGUI::Widget* _sender)
/* ClassChoiceDialog */
ClassChoiceDialog::ClassChoiceDialog(MWBase::WindowManager& parWindowManager)
: InfoBoxDialog(parWindowManager)
ClassChoiceDialog::ClassChoiceDialog()
: InfoBoxDialog()
{
setText("");
ButtonList buttons;
buttons.push_back(mWindowManager.getGameSettingString("sClassChoiceMenu1", ""));
buttons.push_back(mWindowManager.getGameSettingString("sClassChoiceMenu2", ""));
buttons.push_back(mWindowManager.getGameSettingString("sClassChoiceMenu3", ""));
buttons.push_back(mWindowManager.getGameSettingString("sBack", ""));
buttons.push_back(MWBase::Environment::get().getWindowManager()->getGameSettingString("sClassChoiceMenu1", ""));
buttons.push_back(MWBase::Environment::get().getWindowManager()->getGameSettingString("sClassChoiceMenu2", ""));
buttons.push_back(MWBase::Environment::get().getWindowManager()->getGameSettingString("sClassChoiceMenu3", ""));
buttons.push_back(MWBase::Environment::get().getWindowManager()->getGameSettingString("sBack", ""));
setButtons(buttons);
}
/* CreateClassDialog */
CreateClassDialog::CreateClassDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_chargen_create_class.layout", parWindowManager)
CreateClassDialog::CreateClassDialog()
: WindowModal("openmw_chargen_create_class.layout")
, mSpecDialog(NULL)
, mAttribDialog(NULL)
, mSkillDialog(NULL)
@ -384,20 +380,18 @@ CreateClassDialog::CreateClassDialog(MWBase::WindowManager& parWindowManager)
// Centre dialog
center();
setText("SpecializationT", mWindowManager.getGameSettingString("sChooseClassMenu1", "Specialization"));
setText("SpecializationT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sChooseClassMenu1", "Specialization"));
getWidget(mSpecializationName, "SpecializationName");
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(mFavoriteAttribute1, "FavoriteAttribute1");
mFavoriteAttribute0->setWindowManager(&mWindowManager);
mFavoriteAttribute1->setWindowManager(&mWindowManager);
mFavoriteAttribute0->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
mFavoriteAttribute1->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
setText("MajorSkillT", mWindowManager.getGameSettingString("sSkillClassMajor", ""));
setText("MinorSkillT", mWindowManager.getGameSettingString("sSkillClassMinor", ""));
setText("MajorSkillT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSkillClassMajor", ""));
setText("MinorSkillT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSkillClassMinor", ""));
for(int i = 0; i < 5; i++)
{
char theIndex = '0'+i;
@ -410,11 +404,10 @@ CreateClassDialog::CreateClassDialog(MWBase::WindowManager& parWindowManager)
std::vector<Widgets::MWSkillPtr>::const_iterator end = mSkills.end();
for (std::vector<Widgets::MWSkillPtr>::const_iterator it = mSkills.begin(); it != end; ++it)
{
(*it)->setWindowManager(&mWindowManager);
(*it)->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onSkillClicked);
}
setText("LabelT", mWindowManager.getGameSettingString("sName", ""));
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sName", ""));
getWidget(mEditName, "EditName");
// Make sure the edit box has focus
@ -522,32 +515,32 @@ void CreateClassDialog::setNextButtonShow(bool shown)
getWidget(okButton, "OKButton");
if (shown)
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sNext", ""));
else
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
}
// widget controls
void CreateClassDialog::onDialogCancel()
{
mWindowManager.removeDialog(mSpecDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mSpecDialog);
mSpecDialog = 0;
mWindowManager.removeDialog(mAttribDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mAttribDialog);
mAttribDialog = 0;
mWindowManager.removeDialog(mSkillDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mSkillDialog);
mSkillDialog = 0;
mWindowManager.removeDialog(mDescDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mDescDialog);
mDescDialog = 0;
}
void CreateClassDialog::onSpecializationClicked(MyGUI::Widget* _sender)
{
delete mSpecDialog;
mSpecDialog = new SelectSpecializationDialog(mWindowManager);
mSpecDialog = new SelectSpecializationDialog();
mSpecDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
mSpecDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationSelected);
mSpecDialog->setVisible(true);
@ -558,7 +551,7 @@ void CreateClassDialog::onSpecializationSelected()
mSpecializationId = mSpecDialog->getSpecializationId();
setSpecialization(mSpecializationId);
mWindowManager.removeDialog(mSpecDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mSpecDialog);
mSpecDialog = 0;
}
@ -570,7 +563,7 @@ void CreateClassDialog::setSpecialization(int id)
"sSpecializationMagic",
"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);
ToolTips::createSpecializationToolTip(mSpecializationName, specName, mSpecializationId);
}
@ -578,7 +571,7 @@ void CreateClassDialog::setSpecialization(int id)
void CreateClassDialog::onAttributeClicked(Widgets::MWAttributePtr _sender)
{
delete mAttribDialog;
mAttribDialog = new SelectAttributeDialog(mWindowManager);
mAttribDialog = new SelectAttributeDialog();
mAffectedAttribute = _sender;
mAttribDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
mAttribDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeSelected);
@ -599,7 +592,7 @@ void CreateClassDialog::onAttributeSelected()
mFavoriteAttribute0->setAttributeId(mFavoriteAttribute1->getAttributeId());
}
mAffectedAttribute->setAttributeId(id);
mWindowManager.removeDialog(mAttribDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mAttribDialog);
mAttribDialog = 0;
update();
@ -608,7 +601,7 @@ void CreateClassDialog::onAttributeSelected()
void CreateClassDialog::onSkillClicked(Widgets::MWSkillPtr _sender)
{
delete mSkillDialog;
mSkillDialog = new SelectSkillDialog(mWindowManager);
mSkillDialog = new SelectSkillDialog();
mAffectedSkill = _sender;
mSkillDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
mSkillDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSkillSelected);
@ -633,14 +626,14 @@ void CreateClassDialog::onSkillSelected()
}
mAffectedSkill->setSkillId(mSkillDialog->getSkillId());
mWindowManager.removeDialog(mSkillDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mSkillDialog);
mSkillDialog = 0;
update();
}
void CreateClassDialog::onDescriptionClicked(MyGUI::Widget* _sender)
{
mDescDialog = new DescriptionDialog(mWindowManager);
mDescDialog = new DescriptionDialog();
mDescDialog->setTextInput(mDescription);
mDescDialog->eventDone += MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionEntered);
mDescDialog->setVisible(true);
@ -649,7 +642,7 @@ void CreateClassDialog::onDescriptionClicked(MyGUI::Widget* _sender)
void CreateClassDialog::onDescriptionEntered(WindowBase* parWindow)
{
mDescription = mDescDialog->getTextInput();
mWindowManager.removeDialog(mDescDialog);
MWBase::Environment::get().getWindowManager()->removeDialog(mDescDialog);
mDescDialog = 0;
}
@ -667,20 +660,20 @@ void CreateClassDialog::onBackClicked(MyGUI::Widget* _sender)
/* SelectSpecializationDialog */
SelectSpecializationDialog::SelectSpecializationDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_chargen_select_specialization.layout", parWindowManager)
SelectSpecializationDialog::SelectSpecializationDialog()
: WindowModal("openmw_chargen_select_specialization.layout")
{
// Centre dialog
center();
setText("LabelT", mWindowManager.getGameSettingString("sSpecializationMenu1", ""));
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationMenu1", ""));
getWidget(mSpecialization0, "Specialization0");
getWidget(mSpecialization1, "Specialization1");
getWidget(mSpecialization2, "Specialization2");
std::string combat = mWindowManager.getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Combat], "");
std::string magic = mWindowManager.getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Magic], "");
std::string stealth = mWindowManager.getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Stealth], "");
std::string combat = MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Combat], "");
std::string magic = MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Magic], "");
std::string stealth = MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Stealth], "");
mSpecialization0->setCaption(combat);
mSpecialization0->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
@ -696,7 +689,7 @@ SelectSpecializationDialog::SelectSpecializationDialog(MWBase::WindowManager& pa
MyGUI::Button* cancelButton;
getWidget(cancelButton, "CancelButton");
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
cancelButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sCancel", ""));
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
}
@ -727,13 +720,13 @@ void SelectSpecializationDialog::onCancelClicked(MyGUI::Widget* _sender)
/* SelectAttributeDialog */
SelectAttributeDialog::SelectAttributeDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_chargen_select_attribute.layout", parWindowManager)
SelectAttributeDialog::SelectAttributeDialog()
: WindowModal("openmw_chargen_select_attribute.layout")
{
// Centre dialog
center();
setText("LabelT", mWindowManager.getGameSettingString("sAttributesMenu1", ""));
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sAttributesMenu1", ""));
for (int i = 0; i < 8; ++i)
{
@ -741,7 +734,6 @@ SelectAttributeDialog::SelectAttributeDialog(MWBase::WindowManager& parWindowMan
char theIndex = '0'+i;
getWidget(attribute, std::string("Attribute").append(1, theIndex));
attribute->setWindowManager(&parWindowManager);
attribute->setAttributeId(ESM::Attribute::sAttributeIds[i]);
attribute->eventClicked += MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
ToolTips::createAttributeToolTip(attribute, attribute->getAttributeId());
@ -749,7 +741,7 @@ SelectAttributeDialog::SelectAttributeDialog(MWBase::WindowManager& parWindowMan
MyGUI::Button* cancelButton;
getWidget(cancelButton, "CancelButton");
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
cancelButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sCancel", ""));
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
}
@ -774,16 +766,16 @@ void SelectAttributeDialog::onCancelClicked(MyGUI::Widget* _sender)
/* SelectSkillDialog */
SelectSkillDialog::SelectSkillDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_chargen_select_skill.layout", parWindowManager)
SelectSkillDialog::SelectSkillDialog()
: WindowModal("openmw_chargen_select_skill.layout")
{
// Centre dialog
center();
setText("LabelT", mWindowManager.getGameSettingString("sSkillsMenu1", ""));
setText("CombatLabelT", mWindowManager.getGameSettingString("sSpecializationCombat", ""));
setText("MagicLabelT", mWindowManager.getGameSettingString("sSpecializationMagic", ""));
setText("StealthLabelT", mWindowManager.getGameSettingString("sSpecializationStealth", ""));
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSkillsMenu1", ""));
setText("CombatLabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationCombat", ""));
setText("MagicLabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationMagic", ""));
setText("StealthLabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationStealth", ""));
for(int i = 0; i < 9; i++)
{
@ -833,7 +825,6 @@ SelectSkillDialog::SelectSkillDialog(MWBase::WindowManager& parWindowManager)
{
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->eventClicked += MyGUI::newDelegate(this, &SelectSkillDialog::onSkillClicked);
ToolTips::createSkillToolTip(mSkills[spec][i].widget, mSkills[spec][i].widget->getSkillId());
@ -842,7 +833,7 @@ SelectSkillDialog::SelectSkillDialog(MWBase::WindowManager& parWindowManager)
MyGUI::Button* cancelButton;
getWidget(cancelButton, "CancelButton");
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
cancelButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sCancel", ""));
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
}
@ -865,8 +856,8 @@ void SelectSkillDialog::onCancelClicked(MyGUI::Widget* _sender)
/* DescriptionDialog */
DescriptionDialog::DescriptionDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_chargen_class_description.layout", parWindowManager)
DescriptionDialog::DescriptionDialog()
: WindowModal("openmw_chargen_class_description.layout")
{
// Centre dialog
center();
@ -876,7 +867,7 @@ DescriptionDialog::DescriptionDialog(MWBase::WindowManager& parWindowManager)
MyGUI::Button* okButton;
getWidget(okButton, "OKButton");
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
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);

@ -3,7 +3,7 @@
#include "widgets.hpp"
#include "window_base.hpp"
#include "windowbase.hpp"
/*
This file contains the dialogs for choosing a class.
@ -15,7 +15,7 @@ namespace MWGui
class InfoBoxDialog : public WindowModal
{
public:
InfoBoxDialog(MWBase::WindowManager& parWindowManager);
InfoBoxDialog();
typedef std::vector<std::string> ButtonList;
@ -60,13 +60,13 @@ namespace MWGui
Class_Create = 2,
Class_Back = 3
};
ClassChoiceDialog(MWBase::WindowManager& parWindowManager);
ClassChoiceDialog();
};
class GenerateClassResultDialog : public WindowModal
{
public:
GenerateClassResultDialog(MWBase::WindowManager& parWindowManager);
GenerateClassResultDialog();
std::string getClassId() const;
void setClassId(const std::string &classId);
@ -93,7 +93,7 @@ namespace MWGui
class PickClassDialog : public WindowModal
{
public:
PickClassDialog(MWBase::WindowManager& parWindowManager);
PickClassDialog();
const std::string &getClassId() const { return mCurrentClassId; }
void setClassId(const std::string &classId);
@ -132,7 +132,7 @@ namespace MWGui
class SelectSpecializationDialog : public WindowModal
{
public:
SelectSpecializationDialog(MWBase::WindowManager& parWindowManager);
SelectSpecializationDialog();
~SelectSpecializationDialog();
ESM::Class::Specialization getSpecializationId() const { return mSpecializationId; }
@ -163,7 +163,7 @@ namespace MWGui
class SelectAttributeDialog : public WindowModal
{
public:
SelectAttributeDialog(MWBase::WindowManager& parWindowManager);
SelectAttributeDialog();
~SelectAttributeDialog();
ESM::Attribute::AttributeID getAttributeId() const { return mAttributeId; }
@ -192,7 +192,7 @@ namespace MWGui
class SelectSkillDialog : public WindowModal
{
public:
SelectSkillDialog(MWBase::WindowManager& parWindowManager);
SelectSkillDialog();
~SelectSkillDialog();
ESM::Skill::SkillEnum getSkillId() const { return mSkillId; }
@ -225,7 +225,7 @@ namespace MWGui
class DescriptionDialog : public WindowModal
{
public:
DescriptionDialog(MWBase::WindowManager& parWindowManager);
DescriptionDialog();
~DescriptionDialog();
std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; }
@ -241,7 +241,7 @@ namespace MWGui
class CreateClassDialog : public WindowModal
{
public:
CreateClassDialog(MWBase::WindowManager& parWindowManager);
CreateClassDialog();
virtual ~CreateClassDialog();
std::string getName() const;

@ -13,9 +13,9 @@
namespace MWGui
{
CompanionWindow::CompanionWindow(MWBase::WindowManager &parWindowManager, DragAndDrop *dragAndDrop, MessageBoxManager* manager)
CompanionWindow::CompanionWindow(DragAndDrop *dragAndDrop, MessageBoxManager* manager)
: ContainerBase(dragAndDrop)
, WindowBase("openmw_companion_window.layout", parWindowManager)
, WindowBase("openmw_companion_window.layout")
, mMessageBoxManager(manager)
{
MyGUI::ScrollView* itemView;

@ -11,7 +11,7 @@ namespace MWGui
class CompanionWindow : public ContainerBase, public WindowBase
{
public:
CompanionWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop, MessageBoxManager* manager);
CompanionWindow(DragAndDrop* dragAndDrop, MessageBoxManager* manager);
virtual ~CompanionWindow() {}
void open(MWWorld::Ptr npc);

@ -7,8 +7,8 @@
namespace MWGui
{
ConfirmationDialog::ConfirmationDialog(MWBase::WindowManager& parWindowManager) :
WindowModal("openmw_confirmation_dialog.layout", parWindowManager)
ConfirmationDialog::ConfirmationDialog() :
WindowModal("openmw_confirmation_dialog.layout")
{
getWidget(mMessage, "Message");
getWidget(mOkButton, "OkButton");

@ -1,14 +1,14 @@
#ifndef MWGUI_CONFIRMATIONDIALOG_H
#define MWGUI_CONFIRMATIONDIALOG_H
#include "window_base.hpp"
#include "windowbase.hpp"
namespace MWGui
{
class ConfirmationDialog : public WindowModal
{
public:
ConfirmationDialog(MWBase::WindowManager& parWindowManager);
ConfirmationDialog();
void open(const std::string& message);
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)
, WindowBase("openmw_container_window.layout", parWindowManager)
, WindowBase("openmw_container_window.layout")
{
getWidget(mDisposeCorpseButton, "DisposeCorpseButton");
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
if (MWWorld::Class::get(mPtr).isEssential(mPtr))
mWindowManager.messageBox("#{sDisposeCorpseFail}");
MWBase::Environment::get().getWindowManager()->messageBox("#{sDisposeCorpseFail}");
else
MWBase::Environment::get().getWorld()->deleteObject(mPtr);

@ -1,13 +1,10 @@
#ifndef MGUI_CONTAINER_H
#define MGUI_CONTAINER_H
#include "../mwworld/esmstore.hpp"
#include "window_base.hpp"
#include "windowbase.hpp"
#include "referenceinterface.hpp"
#include "../mwclass/container.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/containerstore.hpp"
@ -134,7 +131,7 @@ namespace MWGui
class ContainerWindow : public ContainerBase, public WindowBase
{
public:
ContainerWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop);
ContainerWindow(DragAndDrop* dragAndDrop);
virtual ~ContainerWindow();

@ -7,8 +7,8 @@
namespace MWGui
{
CountDialog::CountDialog(MWBase::WindowManager& parWindowManager) :
WindowModal("openmw_count_window.layout", parWindowManager)
CountDialog::CountDialog() :
WindowModal("openmw_count_window.layout")
{
getWidget(mSlider, "CountSlider");
getWidget(mItemEdit, "ItemEdit");

@ -1,14 +1,14 @@
#ifndef MWGUI_COUNTDIALOG_H
#define MWGUI_COUNTDIALOG_H
#include "window_base.hpp"
#include "windowbase.hpp"
namespace MWGui
{
class CountDialog : public WindowModal
{
public:
CountDialog(MWBase::WindowManager& parWindowManager);
CountDialog();
void open(const std::string& item, const std::string& message, const int maxCount);
typedef MyGUI::delegates::CMultiDelegate2<MyGUI::Widget*, int> EventHandle_WidgetInt;

@ -3,7 +3,6 @@
#include <MyGUI_IPointer.h>
#include <MyGUI_ResourceImageSet.h>
#include <MyGUI_RTTI.h>
namespace MWGui
{

@ -18,7 +18,7 @@
#include "../mwdialogue/dialoguemanagerimp.hpp"
#include "dialogue_history.hpp"
#include "dialoguehistory.hpp"
#include "widgets.hpp"
#include "list.hpp"
#include "tradewindow.hpp"
@ -55,8 +55,8 @@ bool sortByLength (const std::string& left, const std::string& right)
PersuasionDialog::PersuasionDialog(MWBase::WindowManager &parWindowManager)
: WindowModal("openmw_persuasion_dialog.layout", parWindowManager)
PersuasionDialog::PersuasionDialog()
: WindowModal("openmw_persuasion_dialog.layout")
{
getWidget(mCancelButton, "CancelButton");
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 == mBribe10Button)
{
mWindowManager.getTradeWindow()->addOrRemoveGold(-10);
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-10);
type = MWBase::MechanicsManager::PT_Bribe10;
}
else if (sender == mBribe100Button)
{
mWindowManager.getTradeWindow()->addOrRemoveGold(-100);
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-100);
type = MWBase::MechanicsManager::PT_Bribe100;
}
else /*if (sender == mBribe1000Button)*/
{
mWindowManager.getTradeWindow()->addOrRemoveGold(-1000);
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-1000);
type = MWBase::MechanicsManager::PT_Bribe1000;
}
@ -113,7 +113,7 @@ void PersuasionDialog::open()
WindowModal::open();
center();
int playerGold = mWindowManager.getInventoryWindow()->getPlayerGold();
int playerGold = MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold();
mBribe10Button->setEnabled (playerGold >= 10);
mBribe100Button->setEnabled (playerGold >= 100);
@ -124,9 +124,9 @@ void PersuasionDialog::open()
// --------------------------------------------------------------------------------------------------
DialogueWindow::DialogueWindow(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_dialogue_window.layout", parWindowManager)
, mPersuasionDialog(parWindowManager)
DialogueWindow::DialogueWindow()
: WindowBase("openmw_dialogue_window.layout")
, mPersuasionDialog()
, mEnabled(false)
, mServices(0)
{
@ -251,45 +251,45 @@ void DialogueWindow::onSelectTopic(const std::string& topic, int id)
}
else if (topic == gmst.find("sCompanionShare")->getString())
{
mWindowManager.pushGuiMode(GM_Companion);
mWindowManager.showCompanionWindow(mPtr);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Companion);
MWBase::Environment::get().getWindowManager()->showCompanionWindow(mPtr);
}
else if (!MWBase::Environment::get().getDialogueManager()->checkServiceRefused())
{
if (topic == gmst.find("sBarter")->getString())
{
mWindowManager.pushGuiMode(GM_Barter);
mWindowManager.getTradeWindow()->startTrade(mPtr);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Barter);
MWBase::Environment::get().getWindowManager()->getTradeWindow()->startTrade(mPtr);
}
else if (topic == gmst.find("sSpells")->getString())
{
mWindowManager.pushGuiMode(GM_SpellBuying);
mWindowManager.getSpellBuyingWindow()->startSpellBuying(mPtr);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_SpellBuying);
MWBase::Environment::get().getWindowManager()->getSpellBuyingWindow()->startSpellBuying(mPtr);
}
else if (topic == gmst.find("sTravel")->getString())
{
mWindowManager.pushGuiMode(GM_Travel);
mWindowManager.getTravelWindow()->startTravel(mPtr);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Travel);
MWBase::Environment::get().getWindowManager()->getTravelWindow()->startTravel(mPtr);
}
else if (topic == gmst.find("sSpellMakingMenuTitle")->getString())
{
mWindowManager.pushGuiMode(GM_SpellCreation);
mWindowManager.startSpellMaking (mPtr);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_SpellCreation);
MWBase::Environment::get().getWindowManager()->startSpellMaking (mPtr);
}
else if (topic == gmst.find("sEnchanting")->getString())
{
mWindowManager.pushGuiMode(GM_Enchanting);
mWindowManager.startEnchanting (mPtr);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Enchanting);
MWBase::Environment::get().getWindowManager()->startEnchanting (mPtr);
}
else if (topic == gmst.find("sServiceTrainingTitle")->getString())
{
mWindowManager.pushGuiMode(GM_Training);
mWindowManager.startTraining (mPtr);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Training);
MWBase::Environment::get().getWindowManager()->startTraining (mPtr);
}
else if (topic == gmst.find("sRepair")->getString())
{
mWindowManager.pushGuiMode(GM_MerchantRepair);
mWindowManager.startRepair (mPtr);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_MerchantRepair);
MWBase::Environment::get().getWindowManager()->startRepair (mPtr);
}
}
}
@ -456,7 +456,7 @@ std::string DialogueWindow::parseText(const std::string& text)
}
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)
{
@ -528,7 +528,7 @@ void DialogueWindow::goodbye()
void DialogueWindow::onReferenceUnavailable()
{
mWindowManager.removeGuiMode(GM_Dialogue);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
}
void DialogueWindow::onFrame()

@ -1,11 +1,8 @@
#ifndef MWGUI_DIALOGE_H
#define MWGUI_DIALOGE_H
#include "window_base.hpp"
#include "windowbase.hpp"
#include "referenceinterface.hpp"
#include <boost/array.hpp>
#include "../mwworld/ptr.hpp"
namespace MWGui
{
@ -29,7 +26,7 @@ namespace MWGui
class PersuasionDialog : public WindowModal
{
public:
PersuasionDialog(MWBase::WindowManager& parWindowManager);
PersuasionDialog();
virtual void open();
@ -50,7 +47,7 @@ namespace MWGui
class DialogueWindow: public WindowBase, public ReferenceInterface
{
public:
DialogueWindow(MWBase::WindowManager& parWindowManager);
DialogueWindow();
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;

@ -1,4 +1,4 @@
#include "dialogue_history.hpp"
#include "dialoguehistory.hpp"
#include "../mwbase/windowmanager.hpp"

@ -1,5 +1,6 @@
#ifndef MWGUI_DIALOGE_HISTORY_H
#define MWGUI_DIALOGE_HISTORY_H
#include <openengine/gui/layout.hpp>
namespace MWGui

@ -15,9 +15,9 @@ namespace MWGui
{
EnchantingDialog::EnchantingDialog(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_enchanting_dialog.layout", parWindowManager)
, EffectEditorBase(parWindowManager)
EnchantingDialog::EnchantingDialog()
: WindowBase("openmw_enchanting_dialog.layout")
, EffectEditorBase()
, mItemSelectionDialog(NULL)
{
getWidget(mName, "NameEdit");
@ -69,19 +69,19 @@ namespace MWGui
switch(mEnchanting.getEnchantType())
{
case 0:
mTypeButton->setCaption(mWindowManager.getGameSettingString("sItemCastOnce","Cast Once"));
mTypeButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sItemCastOnce","Cast Once"));
mAddEffectDialog.constantEffect=false;
break;
case 1:
mTypeButton->setCaption(mWindowManager.getGameSettingString("sItemCastWhenStrikes", "When Strikes"));
mTypeButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sItemCastWhenStrikes", "When Strikes"));
mAddEffectDialog.constantEffect=false;
break;
case 2:
mTypeButton->setCaption(mWindowManager.getGameSettingString("sItemCastWhenUsed", "When Used"));
mTypeButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sItemCastWhenUsed", "When Used"));
mAddEffectDialog.constantEffect=false;
break;
case 3:
mTypeButton->setCaption(mWindowManager.getGameSettingString("sItemCastConstant", "Cast Constant"));
mTypeButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sItemCastConstant", "Cast Constant"));
mAddEffectDialog.constantEffect=true;
break;
}
@ -126,20 +126,20 @@ namespace MWGui
void EnchantingDialog::onReferenceUnavailable ()
{
mWindowManager.removeGuiMode (GM_Dialogue);
mWindowManager.removeGuiMode (GM_Enchanting);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Dialogue);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting);
}
void EnchantingDialog::onCancelButtonClicked(MyGUI::Widget* sender)
{
mWindowManager.removeGuiMode (GM_Enchanting);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Enchanting);
}
void EnchantingDialog::onSelectItem(MyGUI::Widget *sender)
{
delete mItemSelectionDialog;
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->eventDialogCanceled += MyGUI::newDelegate(this, &EnchantingDialog::onItemCancel);
mItemSelectionDialog->setVisible(true);
@ -190,7 +190,7 @@ namespace MWGui
if(mEnchanting.getGemCharge()==0)
{
mWindowManager.messageBox ("#{sNotifyMessage32}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage32}");
return;
}
@ -227,14 +227,14 @@ namespace MWGui
{
delete mItemSelectionDialog;
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->eventDialogCanceled += MyGUI::newDelegate(this, &EnchantingDialog::onSoulCancel);
mItemSelectionDialog->setVisible(true);
mItemSelectionDialog->openContainer(MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
mItemSelectionDialog->drawItems ();
//mWindowManager.messageBox("#{sInventorySelectNoSoul}");
//MWBase::Environment::get().getWindowManager()->messageBox("#{sInventorySelectNoSoul}");
}
void EnchantingDialog::notifyEffectsChanged ()
@ -254,50 +254,50 @@ namespace MWGui
{
if (mEffects.size() <= 0)
{
mWindowManager.messageBox ("#{sNotifyMessage30}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage30}");
return;
}
if (mName->getCaption ().empty())
{
mWindowManager.messageBox ("#{sNotifyMessage10}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage10}");
return;
}
if (mEnchanting.soulEmpty())
{
mWindowManager.messageBox ("#{sNotifyMessage52}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage52}");
return;
}
if (mEnchanting.itemEmpty())
{
mWindowManager.messageBox ("#{sNotifyMessage11}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage11}");
return;
}
if (mEnchanting.getEnchantCost() > mEnchanting.getMaxEnchantValue())
{
mWindowManager.messageBox ("#{sNotifyMessage29}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage29}");
return;
}
mEnchanting.setNewItemName(mName->getCaption());
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;
}
int result = mEnchanting.create();
if(result==1)
mWindowManager.messageBox ("#{sEnchantmentMenu12}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sEnchantmentMenu12}");
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
#define MWGUI_ENCHANTINGDIALOG_H
#include "window_base.hpp"
#include "referenceinterface.hpp"
#include "spellcreationdialog.hpp"
#include "../mwbase/windowmanager.hpp"
@ -17,7 +15,7 @@ namespace MWGui
class EnchantingDialog : public WindowBase, public ReferenceInterface, public EffectEditorBase
{
public:
EnchantingDialog(MWBase::WindowManager& parWindowManager);
EnchantingDialog();
virtual ~EnchantingDialog();
virtual void open();

@ -1,6 +1,4 @@
#include "map_window.hpp"
#include <openengine/gui/layout.hpp>
#include "mapwindow.hpp"
#include "../mwmechanics/stat.hpp"
#include "../mwworld/ptr.hpp"

@ -30,9 +30,9 @@
namespace MWGui
{
InventoryWindow::InventoryWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop)
InventoryWindow::InventoryWindow(DragAndDrop* dragAndDrop)
: ContainerBase(dragAndDrop)
, WindowPinnableBase("openmw_inventory_window.layout", parWindowManager)
, WindowPinnableBase("openmw_inventory_window.layout")
, mTrading(false)
, mLastXSize(0)
, mLastYSize(0)
@ -130,7 +130,7 @@ namespace MWGui
void InventoryWindow::onPinToggled()
{
mWindowManager.setWeaponVisibility(!mPinned);
MWBase::Environment::get().getWindowManager()->setWeaponVisibility(!mPinned);
}
void InventoryWindow::onAvatarClicked(MyGUI::Widget* _sender)
@ -163,13 +163,13 @@ namespace MWGui
// the "Take" button should not be visible.
// NOTE: the take button is "reset" when the window opens, so we can safely do the following
// without screwing up future book windows
mWindowManager.getBookWindow()->setTakeButtonShow(false);
mWindowManager.getScrollWindow()->setTakeButtonShow(false);
MWBase::Environment::get().getWindowManager()->getBookWindow()->setTakeButtonShow(false);
MWBase::Environment::get().getWindowManager()->getScrollWindow()->setTakeButtonShow(false);
mDragAndDrop->mIsOnDragAndDrop = false;
MyGUI::Gui::getInstance().destroyWidget(mDragAndDrop->mDraggedWidget);
mWindowManager.setDragDrop(false);
MWBase::Environment::get().getWindowManager()->setDragDrop(false);
drawItems();
@ -225,11 +225,11 @@ namespace MWGui
{
invStore.equip(slot, invStore.end());
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
if(script != "")
(*it).mRefData->getLocals().setVarByInt(script, "onpcequip", 0);
return;
}
}
@ -286,16 +286,16 @@ namespace MWGui
void InventoryWindow::notifyContentChanged()
{
// update the spell window just in case new enchanted items were added to inventory
if (mWindowManager.getSpellWindow())
mWindowManager.getSpellWindow()->updateSpells();
if (MWBase::Environment::get().getWindowManager()->getSpellWindow())
MWBase::Environment::get().getWindowManager()->getSpellWindow()->updateSpells();
// update selected weapon icon
MWWorld::InventoryStore& invStore = MWWorld::Class::get(mPtr).getInventoryStore(mPtr);
MWWorld::ContainerStoreIterator weaponSlot = invStore.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
if (weaponSlot == invStore.end())
mWindowManager.unsetSelectedWeapon();
MWBase::Environment::get().getWindowManager()->unsetSelectedWeapon();
else
mWindowManager.setSelectedWeapon(*weaponSlot); /// \todo track weapon durability
MWBase::Environment::get().getWindowManager()->setSelectedWeapon(*weaponSlot); /// \todo track weapon durability
mPreviewDirty = true;

@ -4,7 +4,7 @@
#include "../mwrender/characterpreview.hpp"
#include "container.hpp"
#include "window_pinnable_base.hpp"
#include "windowpinnablebase.hpp"
#include "widgets.hpp"
namespace MWGui
@ -12,7 +12,7 @@ namespace MWGui
class InventoryWindow : public ContainerBase, public WindowPinnableBase
{
public:
InventoryWindow(MWBase::WindowManager& parWindowManager,DragAndDrop* dragAndDrop);
InventoryWindow(DragAndDrop* dragAndDrop);
virtual void open();

@ -3,9 +3,9 @@
namespace MWGui
{
ItemSelectionDialog::ItemSelectionDialog(const std::string &label, int filter, MWBase::WindowManager& parWindowManager)
ItemSelectionDialog::ItemSelectionDialog(const std::string &label, int filter)
: ContainerBase(NULL)
, WindowModal("openmw_itemselection_dialog.layout", parWindowManager)
, WindowModal("openmw_itemselection_dialog.layout")
{
mFilter = filter;

@ -1,14 +1,12 @@
#include "container.hpp"
#include "../mwworld/ptr.hpp"
namespace MWGui
{
class ItemSelectionDialog : public ContainerBase, public WindowModal
{
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::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)
: WindowBase("openmw_journal.layout", parWindowManager)
MWGui::JournalWindow::JournalWindow ()
: WindowBase("openmw_journal.layout")
, mPageNumber(0)
{
mMainWidget->setVisible(false);

@ -1,12 +1,9 @@
#ifndef MWGUI_JOURNAL_H
#define MWGUI_JOURNAL_H
#include <sstream>
#include <set>
#include <string>
#include <utility>
#include "window_base.hpp"
#include "windowbase.hpp"
#include "imagebutton.hpp"
namespace MWGui
@ -14,7 +11,7 @@ namespace MWGui
class JournalWindow : public WindowBase
{
public:
JournalWindow(MWBase::WindowManager& parWindowManager);
JournalWindow();
virtual void open();
private:

@ -18,8 +18,8 @@
namespace MWGui
{
LevelupDialog::LevelupDialog(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_levelup_dialog.layout", parWindowManager)
LevelupDialog::LevelupDialog()
: WindowBase("openmw_levelup_dialog.layout")
{
getWidget(mOkButton, "OkButton");
getWidget(mClassImage, "ClassImage");
@ -183,7 +183,7 @@ namespace MWGui
creatureStats.setLevel (creatureStats.getLevel()+1);
pcStats.levelUp ();
mWindowManager.removeGuiMode (GM_Levelup);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Levelup);
}
}

@ -1,7 +1,7 @@
#ifndef MWGUI_LEVELUPDIALOG_H
#define MWGUI_LEVELUPDIALOG_H
#include "window_base.hpp"
#include "windowbase.hpp"
namespace MWGui
{
@ -9,7 +9,7 @@ namespace MWGui
class LevelupDialog : public WindowBase
{
public:
LevelupDialog(MWBase::WindowManager& parWindowManager);
LevelupDialog();
virtual void open();

@ -1,7 +1,6 @@
#ifndef MWGUI_LIST_HPP
#define MWGUI_LIST_HPP
#include <MyGUI_Widget.h>
#include <MyGUI_ScrollView.h>
namespace MWGui

@ -23,10 +23,10 @@
namespace MWGui
{
LoadingScreen::LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw, MWBase::WindowManager& parWindowManager)
LoadingScreen::LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw)
: mSceneMgr(sceneMgr)
, mWindow(rw)
, WindowBase("openmw_loading_screen.layout", parWindowManager)
, WindowBase("openmw_loading_screen.layout")
, mLoadingOn(false)
, mLastRenderTime(0.f)
, mLastWallpaperChangeTime(0.f)
@ -195,12 +195,12 @@ namespace MWGui
{
changeWallpaper();
mWindowManager.pushGuiMode(GM_LoadingWallpaper);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_LoadingWallpaper);
}
else
{
mBackgroundImage->setImageTexture("");
mWindowManager.pushGuiMode(GM_Loading);
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Loading);
}
}
@ -211,8 +211,8 @@ namespace MWGui
mLoadingOn = false;
mFirstLoad = false;
mWindowManager.removeGuiMode(GM_Loading);
mWindowManager.removeGuiMode(GM_LoadingWallpaper);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Loading);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_LoadingWallpaper);
}
void LoadingScreen::changeWallpaper ()

@ -2,16 +2,15 @@
#define MWGUI_LOADINGSCREEN_H
#include <OgreSceneManager.h>
#include <OgreResourceGroupManager.h>
#include "window_base.hpp"
#include "windowbase.hpp"
namespace MWGui
{
class LoadingScreen : public WindowBase
{
public:
LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw, MWBase::WindowManager& parWindowManager);
LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw);
virtual ~LoadingScreen();
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>
@ -262,8 +262,8 @@ void LocalMapBase::setPlayerDir(const float x, const float y)
// ------------------------------------------------------------------------------------------
MapWindow::MapWindow(MWBase::WindowManager& parWindowManager, const std::string& cacheDir)
: MWGui::WindowPinnableBase("openmw_map_window.layout", parWindowManager)
MapWindow::MapWindow(const std::string& cacheDir)
: MWGui::WindowPinnableBase("openmw_map_window.layout")
, mGlobal(false)
{
setCoord(500,0,320,300);
@ -376,7 +376,7 @@ void MapWindow::onWorldButtonClicked(MyGUI::Widget* _sender)
void MapWindow::onPinToggled()
{
mWindowManager.setMinimapVisibility(!mPinned);
MWBase::Environment::get().getWindowManager()->setMinimapVisibility(!mPinned);
}
void MapWindow::open()

@ -1,7 +1,7 @@
#ifndef MWGUI_MAPWINDOW_H
#define MWGUI_MAPWINDOW_H
#include "window_pinnable_base.hpp"
#include "windowpinnablebase.hpp"
namespace MWRender
{
@ -65,7 +65,7 @@ namespace MWGui
class MapWindow : public MWGui::WindowPinnableBase, public LocalMapBase
{
public:
MapWindow(MWBase::WindowManager& parWindowManager, const std::string& cacheDir);
MapWindow(const std::string& cacheDir);
virtual ~MapWindow();
void setCellName(const std::string& cellName);

@ -19,8 +19,8 @@
namespace MWGui
{
MerchantRepair::MerchantRepair(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_merchantrepair.layout", parWindowManager)
MerchantRepair::MerchantRepair()
: WindowBase("openmw_merchantrepair.layout")
{
getWidget(mList, "RepairView");
getWidget(mOkButton, "OkButton");
@ -72,7 +72,7 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor)
MyGUI::Button* button =
mList->createWidget<MyGUI::Button>(
(price>mWindowManager.getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton",
(price>MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton",
0,
currentY,
0,
@ -82,7 +82,7 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor)
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->setUserData(*iter);
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)));
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)
@ -120,14 +120,14 @@ void MerchantRepair::onRepairButtonClick(MyGUI::Widget *sender)
MWBase::Environment::get().getSoundManager()->playSound("Repair",1,1);
int price = boost::lexical_cast<int>(sender->getUserString("Price"));
mWindowManager.getTradeWindow()->addOrRemoveGold(-price);
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-price);
startRepair(mActor);
}
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
#define OPENMW_MWGUI_MERCHANTREPAIR_H
#include "window_base.hpp"
#include "windowbase.hpp"
#include "../mwworld/ptr.hpp"
@ -12,7 +12,7 @@ namespace MWGui
class MerchantRepair : public WindowBase
{
public:
MerchantRepair(MWBase::WindowManager &parWindowManager);
MerchantRepair();
virtual void open();

@ -7,9 +7,8 @@
using namespace MWGui;
MessageBoxManager::MessageBoxManager (MWBase::WindowManager *windowManager)
MessageBoxManager::MessageBoxManager ()
{
mWindowManager = windowManager;
// defines
mMessageBoxSpeed = 0.1;
mInterMessageBoxe = NULL;
@ -213,7 +212,7 @@ int MessageBox::getHeight ()
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)
, mButtonPressed(-1)
{
@ -371,7 +370,7 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
void InteractiveMessageBox::enterPressed()
{
std::string ok = Misc::StringUtils::lowerCase(MyGUI::LanguageManager::getInstance().replaceTags("#{sOK}"));
std::vector<MyGUI::Button*>::const_iterator button;
for(button = mButtons.begin(); button != mButtons.end(); ++button)

@ -1,9 +1,7 @@
#ifndef MWGUI_MESSAGE_BOX_H
#define MWGUI_MESSAGE_BOX_H
#include <openengine/gui/layout.hpp>
#include "window_base.hpp"
#include "windowbase.hpp"
#include "../mwbase/windowmanager.hpp"
@ -31,7 +29,7 @@ namespace MWGui
class MessageBoxManager
{
public:
MessageBoxManager (MWBase::WindowManager* windowManager);
MessageBoxManager ();
void onFrame (float frameDuration);
void createMessageBox (const std::string& message);
bool createInteractiveMessageBox (const std::string& message, const std::vector<std::string>& buttons);
@ -40,7 +38,7 @@ namespace MWGui
void removeMessageBox (float time, MessageBox *msgbox);
bool removeMessageBox (MessageBox *msgbox);
void setMessageBoxSpeed (int speed);
void enterPressed();
int readPressedButton ();
@ -51,8 +49,6 @@ namespace MWGui
void onButtonPressed(int button) { eventButtonPressed(button); eventButtonPressed.clear(); }
MWBase::WindowManager *mWindowManager;
private:
std::vector<MessageBox*> mMessageBoxes;
InteractiveMessageBox* mInterMessageBoxe;
@ -92,7 +88,7 @@ namespace MWGui
private:
void buttonActivated (MyGUI::Widget* _widget);
MessageBoxManager& mMessageBoxManager;
MyGUI::EditBox* mMessageWidget;
MyGUI::Widget* mButtonsWidget;

@ -43,8 +43,8 @@ namespace
namespace MWGui
{
QuickKeysMenu::QuickKeysMenu(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_quickkeys_menu.layout", parWindowManager)
QuickKeysMenu::QuickKeysMenu()
: WindowBase("openmw_quickkeys_menu.layout")
, mAssignDialog(0)
, mItemSelectionDialog(0)
, mMagicSelectionDialog(0)
@ -109,14 +109,14 @@ namespace MWGui
{
// open assign dialog
if (!mAssignDialog)
mAssignDialog = new QuickKeysMenuAssign(mWindowManager, this);
mAssignDialog = new QuickKeysMenuAssign(this);
mAssignDialog->setVisible (true);
}
}
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 )
{
mItemSelectionDialog = new ItemSelectionDialog("#{sQuickMenu6}", ContainerBase::Filter_All, mWindowManager);
mItemSelectionDialog = new ItemSelectionDialog("#{sQuickMenu6}", ContainerBase::Filter_All);
mItemSelectionDialog->eventItemSelected += MyGUI::newDelegate(this, &QuickKeysMenu::onAssignItem);
mItemSelectionDialog->eventDialogCanceled += MyGUI::newDelegate(this, &QuickKeysMenu::onAssignItemCancel);
}
@ -139,7 +139,7 @@ namespace MWGui
{
if (!mMagicSelectionDialog )
{
mMagicSelectionDialog = new MagicSelectionDialog(mWindowManager, this);
mMagicSelectionDialog = new MagicSelectionDialog(this);
}
mMagicSelectionDialog->setVisible(true);
@ -281,7 +281,7 @@ namespace MWGui
std::string spellId = button->getChildAt(0)->getUserString("Spell");
spells.setSelectedSpell(spellId);
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)
{
@ -303,11 +303,11 @@ namespace MWGui
// the "Take" button should not be visible.
// NOTE: the take button is "reset" when the window opens, so we can safely do the following
// without screwing up future book windows
mWindowManager.getBookWindow()->setTakeButtonShow(false);
mWindowManager.getScrollWindow()->setTakeButtonShow(false);
MWBase::Environment::get().getWindowManager()->getBookWindow()->setTakeButtonShow(false);
MWBase::Environment::get().getWindowManager()->getScrollWindow()->setTakeButtonShow(false);
// since we changed equipping status, update the inventory window
mWindowManager.getInventoryWindow()->drawItems();
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->drawItems();
}
else if (type == Type_MagicItem)
{
@ -341,19 +341,19 @@ namespace MWGui
action.execute (MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ());
// since we changed equipping status, update the inventory window
mWindowManager.getInventoryWindow()->drawItems();
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->drawItems();
}
store.setSelectedEnchantItem(it);
spells.setSelectedSpell("");
mWindowManager.setSelectedEnchantItem(item);
MWBase::Environment::get().getWindowManager()->setSelectedEnchantItem(item);
}
}
// ---------------------------------------------------------------------------------------------------------
QuickKeysMenuAssign::QuickKeysMenuAssign (MWBase::WindowManager &parWindowManager, QuickKeysMenu* parent)
: WindowModal("openmw_quickkeys_menu_assign.layout", parWindowManager)
QuickKeysMenuAssign::QuickKeysMenuAssign (QuickKeysMenu* parent)
: WindowModal("openmw_quickkeys_menu_assign.layout")
, mParent(parent)
{
getWidget(mLabel, "Label");
@ -399,8 +399,8 @@ namespace MWGui
// ---------------------------------------------------------------------------------------------------------
MagicSelectionDialog::MagicSelectionDialog(MWBase::WindowManager &parWindowManager, QuickKeysMenu* parent)
: WindowModal("openmw_magicselection_dialog.layout", parWindowManager)
MagicSelectionDialog::MagicSelectionDialog(QuickKeysMenu* parent)
: WindowModal("openmw_magicselection_dialog.layout")
, mParent(parent)
, mWidth(0)
, mHeight(0)

@ -1,10 +1,9 @@
#ifndef MWGUI_QUICKKEYS_H
#define MWGUI_QUICKKEYS_H
#include "../mwworld/ptr.hpp"
#include "window_base.hpp"
#include "windowbase.hpp"
namespace MWGui
{
@ -16,7 +15,7 @@ namespace MWGui
class QuickKeysMenu : public WindowBase
{
public:
QuickKeysMenu(MWBase::WindowManager& parWindowManager);
QuickKeysMenu();
~QuickKeysMenu();
@ -64,7 +63,7 @@ namespace MWGui
class QuickKeysMenuAssign : public WindowModal
{
public:
QuickKeysMenuAssign(MWBase::WindowManager& parWindowManager, QuickKeysMenu* parent);
QuickKeysMenuAssign(QuickKeysMenu* parent);
private:
MyGUI::TextBox* mLabel;
@ -79,7 +78,7 @@ namespace MWGui
class MagicSelectionDialog : public WindowModal
{
public:
MagicSelectionDialog(MWBase::WindowManager& parWindowManager, QuickKeysMenu* parent);
MagicSelectionDialog(QuickKeysMenu* parent);
virtual void open();

@ -62,8 +62,8 @@ int countParts(const std::string &part, const std::string &race, bool male)
}
}
RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_chargen_race.layout", parWindowManager)
RaceDialog::RaceDialog()
: WindowModal("openmw_chargen_race.layout")
, mGenderIndex(0)
, mFaceIndex(0)
, mHairIndex(0)
@ -74,7 +74,7 @@ RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
// Centre dialog
center();
setText("AppearanceT", mWindowManager.getGameSettingString("sRaceMenu1", "Appearance"));
setText("AppearanceT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu1", "Appearance"));
getWidget(mPreviewImage, "PreviewImage");
getWidget(mHeadRotate, "HeadRotate");
@ -86,34 +86,34 @@ RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
// Set up next/previous buttons
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(nextButton, "NextGenderButton");
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender);
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(nextButton, "NextFaceButton");
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace);
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(nextButton, "NextHairButton");
prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair);
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");
mRaceList->setScrollVisible(true);
mRaceList->eventListSelectAccept += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
mRaceList->eventListMouseItemActivate += 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");
setText("SpellPowerT", mWindowManager.getGameSettingString("sRaceMenu7", "Specials"));
setText("SpellPowerT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu7", "Specials"));
getWidget(mSpellPowerList, "SpellPowerList");
MyGUI::Button* backButton;
@ -122,7 +122,7 @@ RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
MyGUI::Button* okButton;
getWidget(okButton, "OKButton");
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onOkClicked);
updateRaces();
@ -136,9 +136,9 @@ void RaceDialog::setNextButtonShow(bool shown)
getWidget(okButton, "OKButton");
if (shown)
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sNext", ""));
else
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
}
void RaceDialog::open()
@ -156,7 +156,7 @@ void RaceDialog::open()
const ESM::NPC proto = mPreview->getPrototype();
setRaceId(proto.mRace);
recountParts();
std::string index = proto.mHead.substr(proto.mHead.size() - 2, 2);
mFaceIndex = boost::lexical_cast<int>(index) - 1;
@ -361,7 +361,7 @@ void RaceDialog::updateRaces()
const MWWorld::Store<ESM::Race> &races =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>();
int index = 0;
MWWorld::Store<ESM::Race>::iterator it = races.begin();
for (; it != races.end(); ++it)
@ -403,7 +403,6 @@ void RaceDialog::updateSkills()
skillWidget = mSkillList->createWidget<MWSkill>("MW_StatNameValue", coord1, MyGUI::Align::Default,
std::string("Skill") + boost::lexical_cast<std::string>(i));
skillWidget->setWindowManager(&mWindowManager);
skillWidget->setSkillNumber(skillId);
skillWidget->setSkillValue(MWSkill::SkillValue(race->mData.mBonus[i].mBonus));
ToolTips::createSkillToolTip(skillWidget, skillId);
@ -439,7 +438,6 @@ void RaceDialog::updateSpellPowers()
{
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->setWindowManager(&mWindowManager);
spellPowerWidget->setSpellId(spellpower);
spellPowerWidget->setUserString("ToolTipType", "Spell");
spellPowerWidget->setUserString("Spell", spellpower);

@ -1,14 +1,9 @@
#ifndef MWGUI_RACE_H
#define MWGUI_RACE_H
#include <boost/array.hpp>
#include "../mwworld/esmstore.hpp"
#include "../mwrender/characterpreview.hpp"
#include "window_base.hpp"
#include "windowbase.hpp"
namespace MWGui
@ -26,7 +21,7 @@ namespace MWGui
class RaceDialog : public WindowModal
{
public:
RaceDialog(MWBase::WindowManager& parWindowManager);
RaceDialog();
enum Gender
{

@ -15,8 +15,8 @@
namespace MWGui
{
Repair::Repair(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_repair.layout", parWindowManager)
Repair::Repair()
: WindowBase("openmw_repair.layout")
{
getWidget(mRepairBox, "RepairBox");
getWidget(mRepairView, "RepairView");
@ -133,7 +133,7 @@ void Repair::updateRepairView()
void Repair::onCancel(MyGUI::Widget *sender)
{
mWindowManager.removeGuiMode(GM_Repair);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Repair);
}
void Repair::onRepairItem(MyGUI::Widget *sender)

@ -1,9 +1,8 @@
#ifndef OPENMW_MWGUI_REPAIR_H
#define OPENMW_MWGUI_REPAIR_H
#include "window_base.hpp"
#include "windowbase.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwmechanics/repair.hpp"
namespace MWGui
@ -12,7 +11,7 @@ namespace MWGui
class Repair : public WindowBase
{
public:
Repair(MWBase::WindowManager &parWindowManager);
Repair();
virtual void open();

@ -22,8 +22,8 @@ using namespace Widgets;
const int ReviewDialog::sLineHeight = 18;
ReviewDialog::ReviewDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_chargen_review.layout", parWindowManager)
ReviewDialog::ReviewDialog()
: WindowModal("openmw_chargen_review.layout")
, mLastPos(0)
{
// Centre dialog
@ -53,15 +53,15 @@ ReviewDialog::ReviewDialog(MWBase::WindowManager& parWindowManager)
// Setup dynamic stats
getWidget(mHealth, "Health");
mHealth->setTitle(mWindowManager.getGameSettingString("sHealth", ""));
mHealth->setTitle(MWBase::Environment::get().getWindowManager()->getGameSettingString("sHealth", ""));
mHealth->setValue(45, 45);
getWidget(mMagicka, "Magicka");
mMagicka->setTitle(mWindowManager.getGameSettingString("sMagic", ""));
mMagicka->setTitle(MWBase::Environment::get().getWindowManager()->getGameSettingString("sMagic", ""));
mMagicka->setValue(50, 50);
getWidget(mFatigue, "Fatigue");
mFatigue->setTitle(mWindowManager.getGameSettingString("sFatigue", ""));
mFatigue->setTitle(MWBase::Environment::get().getWindowManager()->getGameSettingString("sFatigue", ""));
mFatigue->setValue(160, 160);
// Setup attributes
@ -71,7 +71,6 @@ ReviewDialog::ReviewDialog(MWBase::WindowManager& parWindowManager)
{
getWidget(attribute, std::string("Attribute") + boost::lexical_cast<std::string>(idx));
mAttributeWidgets.insert(std::make_pair(static_cast<int>(ESM::Attribute::sAttributeIds[idx]), attribute));
attribute->setWindowManager(&mWindowManager);
attribute->setAttributeId(ESM::Attribute::sAttributeIds[idx]);
attribute->setAttributeValue(MWAttribute::AttributeValue(0, 0));
}
@ -277,7 +276,7 @@ void ReviewDialog::addSkills(const SkillList &skills, const std::string &titleId
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();
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";
else if (modified < base)
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)
{

@ -1,8 +1,7 @@
#ifndef MWGUI_REVIEW_H
#define MWGUI_REVIEW_H
#include "window_base.hpp"
#include "../mwmechanics/stat.hpp"
#include "windowbase.hpp"
#include "widgets.hpp"
namespace MWGui
@ -28,7 +27,7 @@ namespace MWGui
};
typedef std::vector<int> SkillList;
ReviewDialog(MWBase::WindowManager& parWindowManager);
ReviewDialog();
void setPlayerName(const std::string &name);
void setRace(const std::string &raceId);

@ -12,8 +12,8 @@
using namespace MWGui;
ScrollWindow::ScrollWindow (MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_scroll.layout", parWindowManager)
ScrollWindow::ScrollWindow ()
: WindowBase("openmw_scroll.layout")
, mTakeButtonShow(true)
, mTakeButtonAllowed(true)
{
@ -66,7 +66,7 @@ void ScrollWindow::onCloseButtonClicked (MyGUI::Widget* _sender)
{
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)
@ -76,5 +76,5 @@ void ScrollWindow::onTakeButtonClicked (MyGUI::Widget* _sender)
MWWorld::ActionTake take(mScroll);
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
#define MWGUI_SCROLLWINDOW_H
#include "window_base.hpp"
#include "windowbase.hpp"
#include "imagebutton.hpp"
#include "../mwworld/ptr.hpp"
@ -11,7 +11,7 @@ namespace MWGui
class ScrollWindow : public WindowBase
{
public:
ScrollWindow (MWBase::WindowManager& parWindowManager);
ScrollWindow ();
void open (MWWorld::Ptr scroll);
void setTakeButtonShow(bool show);

@ -93,8 +93,8 @@ namespace
namespace MWGui
{
SettingsWindow::SettingsWindow(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_settings_window.layout", parWindowManager)
SettingsWindow::SettingsWindow() :
WindowBase("openmw_settings_window.layout")
{
getWidget(mOkButton, "OkButton");
getWidget(mSubtitlesButton, "SubtitlesButton");
@ -272,7 +272,7 @@ namespace MWGui
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)
@ -280,7 +280,7 @@ namespace MWGui
if (index == MyGUI::ITEM_NONE)
return;
ConfirmationDialog* dialog = mWindowManager.getConfirmationDialog();
ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
dialog->open("#{sNotifyMessage67}");
dialog->eventOkClicked.clear();
dialog->eventOkClicked += MyGUI::newDelegate(this, &SettingsWindow::onResolutionAccept);
@ -327,8 +327,8 @@ namespace MWGui
void SettingsWindow::onButtonToggled(MyGUI::Widget* _sender)
{
std::string on = mWindowManager.getGameSettingString("sOn", "On");
std::string off = mWindowManager.getGameSettingString("sOff", "On");
std::string on = MWBase::Environment::get().getWindowManager()->getGameSettingString("sOn", "On");
std::string off = MWBase::Environment::get().getWindowManager()->getGameSettingString("sOff", "On");
bool newState;
if (_sender->castType<MyGUI::Button>()->getCaption() == on)
{
@ -435,8 +435,8 @@ namespace MWGui
void SettingsWindow::onShadersToggled(MyGUI::Widget* _sender)
{
std::string on = mWindowManager.getGameSettingString("sOn", "On");
std::string off = mWindowManager.getGameSettingString("sOff", "On");
std::string on = MWBase::Environment::get().getWindowManager()->getGameSettingString("sOn", "On");
std::string off = MWBase::Environment::get().getWindowManager()->getGameSettingString("sOff", "On");
std::string val = static_cast<MyGUI::Button*>(_sender)->getCaption();
if (val == off)
@ -608,7 +608,7 @@ namespace MWGui
void SettingsWindow::onResetDefaultBindings(MyGUI::Widget* _sender)
{
ConfirmationDialog* dialog = mWindowManager.getConfirmationDialog();
ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
dialog->open("#{sNotifyMessage66}");
dialog->eventOkClicked.clear();
dialog->eventOkClicked += MyGUI::newDelegate(this, &SettingsWindow::onResetDefaultBindingsAccept);

@ -1,7 +1,7 @@
#ifndef MWGUI_SETTINGS_H
#define MWGUI_SETTINGS_H
#include "window_base.hpp"
#include "windowbase.hpp"
namespace MWGui
{
@ -13,7 +13,7 @@ namespace MWGui
class SettingsWindow : public WindowBase
{
public:
SettingsWindow(MWBase::WindowManager& parWindowManager);
SettingsWindow();
virtual void open();

@ -23,8 +23,8 @@ namespace MWGui
{
const int SpellBuyingWindow::sLineHeight = 18;
SpellBuyingWindow::SpellBuyingWindow(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_spell_buying_window.layout", parWindowManager)
SpellBuyingWindow::SpellBuyingWindow() :
WindowBase("openmw_spell_buying_window.layout")
, mCurrentY(0)
, mLastPos(0)
{
@ -48,7 +48,7 @@ namespace MWGui
MyGUI::Button* toAdd =
mSpellsView->createWidget<MyGUI::Button>(
(price>mWindowManager.getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton",
(price>MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()) ? "SandTextGreyedOut" : "SandTextButton",
0,
mCurrentY,
200,
@ -120,13 +120,13 @@ namespace MWGui
{
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();
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
MWMechanics::Spells& spells = stats.getSpells();
spells.add (mSpellsWidgetMap.find(_sender)->second);
mWindowManager.getTradeWindow()->addOrRemoveGold(-price);
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-price);
startSpellBuying(mPtr);
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
@ -135,12 +135,12 @@ namespace MWGui
void SpellBuyingWindow::onCancelButtonClicked(MyGUI::Widget* _sender)
{
mWindowManager.removeGuiMode(GM_SpellBuying);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_SpellBuying);
}
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->getTop(),
mPlayerGold->getTextSize().width,
@ -150,8 +150,8 @@ namespace MWGui
void SpellBuyingWindow::onReferenceUnavailable()
{
// remove both Spells and Dialogue (since you always trade with the NPC/creature that you have previously talked to)
mWindowManager.removeGuiMode(GM_SpellBuying);
mWindowManager.removeGuiMode(GM_Dialogue);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_SpellBuying);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
}
void SpellBuyingWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)

@ -1,7 +1,7 @@
#ifndef MWGUI_SpellBuyingWINDOW_H
#define MWGUI_SpellBuyingWINDOW_H
#include "window_base.hpp"
#include "windowbase.hpp"
#include "referenceinterface.hpp"
namespace MyGUI
@ -21,7 +21,7 @@ namespace MWGui
class SpellBuyingWindow : public ReferenceInterface, public WindowBase
{
public:
SpellBuyingWindow(MWBase::WindowManager& parWindowManager);
SpellBuyingWindow();
void startSpellBuying(const MWWorld::Ptr& actor);

@ -40,8 +40,8 @@ namespace
namespace MWGui
{
EditEffectDialog::EditEffectDialog(MWBase::WindowManager &parWindowManager)
: WindowModal("openmw_edit_effect.layout", parWindowManager)
EditEffectDialog::EditEffectDialog()
: WindowModal("openmw_edit_effect.layout")
, mEditing(false)
{
getWidget(mCancelButton, "CancelButton");
@ -274,9 +274,9 @@ namespace MWGui
// ------------------------------------------------------------------------------------------------
SpellCreationDialog::SpellCreationDialog(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_spellcreation_dialog.layout", parWindowManager)
, EffectEditorBase(parWindowManager)
SpellCreationDialog::SpellCreationDialog()
: WindowBase("openmw_spellcreation_dialog.layout")
, EffectEditorBase()
{
getWidget(mNameEdit, "NameEdit");
getWidget(mMagickaCost, "MagickaCost");
@ -303,38 +303,38 @@ namespace MWGui
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)
{
if (mEffects.size() <= 0)
{
mWindowManager.messageBox ("#{sNotifyMessage30}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage30}");
return;
}
if (mNameEdit->getCaption () == "")
{
mWindowManager.messageBox ("#{sNotifyMessage10}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage10}");
return;
}
if (mMagickaCost->getCaption() == "0")
{
mWindowManager.messageBox ("#{sEnchantmentMenu8}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sEnchantmentMenu8}");
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;
}
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);
@ -347,7 +347,7 @@ namespace MWGui
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()
@ -357,8 +357,8 @@ namespace MWGui
void SpellCreationDialog::onReferenceUnavailable ()
{
mWindowManager.removeGuiMode (GM_Dialogue);
mWindowManager.removeGuiMode (GM_SpellCreation);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Dialogue);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_SpellCreation);
}
void SpellCreationDialog::notifyEffectsChanged ()
@ -412,8 +412,8 @@ namespace MWGui
// ------------------------------------------------------------------------------------------------
EffectEditorBase::EffectEditorBase(MWBase::WindowManager& parWindowManager)
: mAddEffectDialog(parWindowManager)
EffectEditorBase::EffectEditorBase()
: mAddEffectDialog()
, mSelectAttributeDialog(NULL)
, mSelectSkillDialog(NULL)
{
@ -541,7 +541,7 @@ namespace MWGui
if (effect->mData.mFlags & ESM::MagicEffect::TargetSkill)
{
delete mSelectSkillDialog;
mSelectSkillDialog = new SelectSkillDialog(*MWBase::Environment::get().getWindowManager ());
mSelectSkillDialog = new SelectSkillDialog();
mSelectSkillDialog->eventCancel += MyGUI::newDelegate(this, &SpellCreationDialog::onAttributeOrSkillCancel);
mSelectSkillDialog->eventItemSelected += MyGUI::newDelegate(this, &SpellCreationDialog::onSelectSkill);
mSelectSkillDialog->setVisible (true);
@ -549,7 +549,7 @@ namespace MWGui
else if (effect->mData.mFlags & ESM::MagicEffect::TargetAttribute)
{
delete mSelectAttributeDialog;
mSelectAttributeDialog = new SelectAttributeDialog(*MWBase::Environment::get().getWindowManager ());
mSelectAttributeDialog = new SelectAttributeDialog();
mSelectAttributeDialog->eventCancel += MyGUI::newDelegate(this, &SpellCreationDialog::onAttributeOrSkillCancel);
mSelectAttributeDialog->eventItemSelected += MyGUI::newDelegate(this, &SpellCreationDialog::onSelectAttribute);
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);
effect->setNeedMouseFocus (false);
effect->setWindowManager (MWBase::Environment::get().getWindowManager ());
effect->setSpellEffect (params);
effect->setSize(effect->getRequestedWidth (), 24);

@ -1,7 +1,7 @@
#ifndef MWGUI_SPELLCREATION_H
#define MWGUI_SPELLCREATION_H
#include "window_base.hpp"
#include "windowbase.hpp"
#include "referenceinterface.hpp"
#include "list.hpp"
#include "widgets.hpp"
@ -15,7 +15,7 @@ namespace MWGui
class EditEffectDialog : public WindowModal
{
public:
EditEffectDialog(MWBase::WindowManager& parWindowManager);
EditEffectDialog();
virtual void open();
@ -83,7 +83,7 @@ namespace MWGui
class EffectEditorBase
{
public:
EffectEditorBase(MWBase::WindowManager& parWindowManager);
EffectEditorBase();
protected:
@ -123,7 +123,7 @@ namespace MWGui
class SpellCreationDialog : public WindowBase, public ReferenceInterface, public EffectEditorBase
{
public:
SpellCreationDialog(MWBase::WindowManager& parWindowManager);
SpellCreationDialog();
virtual void open();

@ -47,8 +47,8 @@ namespace
namespace MWGui
{
SpellWindow::SpellWindow(MWBase::WindowManager& parWindowManager)
: WindowPinnableBase("openmw_spell_window.layout", parWindowManager)
SpellWindow::SpellWindow()
: WindowPinnableBase("openmw_spell_window.layout")
, mHeight(0)
, mWidth(0)
{
@ -71,7 +71,7 @@ namespace MWGui
void SpellWindow::onPinToggled()
{
mWindowManager.setSpellVisibility(!mPinned);
MWBase::Environment::get().getWindowManager()->setSpellVisibility(!mPinned);
}
void SpellWindow::open()
@ -140,7 +140,7 @@ namespace MWGui
{
store.setSelectedEnchantItem(store.end());
spells.setSelectedSpell("");
mWindowManager.unsetSelectedSpell();
MWBase::Environment::get().getWindowManager()->unsetSelectedSpell();
selectedItem = MWWorld::Ptr();
}
}
@ -377,12 +377,12 @@ namespace MWGui
action.execute (MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer ());
// since we changed equipping status, update the inventory window
mWindowManager.getInventoryWindow()->drawItems();
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->drawItems();
}
store.setSelectedEnchantItem(it);
spells.setSelectedSpell("");
mWindowManager.setSelectedEnchantItem(item);
MWBase::Environment::get().getWindowManager()->setSelectedEnchantItem(item);
updateSpells();
}
@ -404,14 +404,14 @@ namespace MWGui
if (spell->mData.mFlags & ESM::Spell::F_Always
|| spell->mData.mType == ESM::Spell::ST_Power)
{
mWindowManager.messageBox("#{sDeleteSpellError}");
MWBase::Environment::get().getWindowManager()->messageBox("#{sDeleteSpellError}");
}
else
{
// ask for confirmation
mSpellToDelete = spellId;
ConfirmationDialog* dialog = mWindowManager.getConfirmationDialog();
std::string question = mWindowManager.getGameSettingString("sQuestionDeleteSpell", "Delete %s?");
ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
std::string question = MWBase::Environment::get().getWindowManager()->getGameSettingString("sQuestionDeleteSpell", "Delete %s?");
question = boost::str(boost::format(question) % spell->mName);
dialog->open(question);
dialog->eventOkClicked.clear();
@ -423,7 +423,7 @@ namespace MWGui
{
spells.setSelectedSpell(spellId);
store.setSelectedEnchantItem(store.end());
mWindowManager.setSelectedSpell(spellId, int(MWMechanics::getSpellSuccessChance(spellId, player)));
MWBase::Environment::get().getWindowManager()->setSelectedSpell(spellId, int(MWMechanics::getSpellSuccessChance(spellId, player)));
}
updateSpells();
@ -454,7 +454,7 @@ namespace MWGui
if (spells.getSelectedSpell() == mSpellToDelete)
{
spells.setSelectedSpell("");
mWindowManager.unsetSelectedSpell();
MWBase::Environment::get().getWindowManager()->unsetSelectedSpell();
}
spells.remove(mSpellToDelete);

@ -1,7 +1,7 @@
#ifndef MWGUI_SPELLWINDOW_H
#define MWGUI_SPELLWINDOW_H
#include "window_pinnable_base.hpp"
#include "windowpinnablebase.hpp"
namespace MWGui
{
@ -10,7 +10,7 @@ namespace MWGui
class SpellWindow : public WindowPinnableBase
{
public:
SpellWindow(MWBase::WindowManager& parWindowManager);
SpellWindow();
virtual ~SpellWindow();
void updateSpells();

@ -1,4 +1,4 @@
#include "stats_window.hpp"
#include "statswindow.hpp"
#include <cmath>
#include <algorithm>
@ -22,8 +22,8 @@
using namespace MWGui;
const int StatsWindow::sLineHeight = 18;
StatsWindow::StatsWindow (MWBase::WindowManager& parWindowManager)
: WindowPinnableBase("openmw_stats_window.layout", parWindowManager)
StatsWindow::StatsWindow ()
: WindowPinnableBase("openmw_stats_window.layout")
, mSkillView(NULL)
, mClientHeight(0)
, mMajorSkills()
@ -363,7 +363,7 @@ void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId,
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();
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";
else if (modified < base)
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);
for (int i=0; i<2; ++i)
@ -476,7 +476,7 @@ void StatsWindow::updateSkillArea()
MWMechanics::NpcStats PCstats = MWWorld::Class::get(player).getNpcStats(player);
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();
for (FactionList::const_iterator it = mFactions.begin(); it != end; ++it)
{
@ -537,7 +537,7 @@ void StatsWindow::updateSkillArea()
if (!mSkillWidgets.empty())
addSeparator(coord1, coord2);
addGroup(mWindowManager.getGameSettingString("sBirthSign", "Sign"), coord1, coord2);
addGroup(MWBase::Environment::get().getWindowManager()->getGameSettingString("sBirthSign", "Sign"), coord1, coord2);
const ESM::BirthSign *sign =
store.get<ESM::BirthSign>().find(mBirthSignId);
MyGUI::Widget* w = addItem(sign->mName, coord1, coord2);
@ -549,7 +549,7 @@ void StatsWindow::updateSkillArea()
if (!mSkillWidgets.empty())
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);
for (int i=0; i<2; ++i)
@ -559,7 +559,7 @@ void StatsWindow::updateSkillArea()
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);
for (int i=0; i<2; ++i)
@ -576,5 +576,5 @@ void StatsWindow::updateSkillArea()
void StatsWindow::onPinToggled()
{
mWindowManager.setHMSVisibility(!mPinned);
MWBase::Environment::get().getWindowManager()->setHMSVisibility(!mPinned);
}

@ -3,13 +3,8 @@
#include "../mwworld/esmstore.hpp"
#include <sstream>
#include <set>
#include <string>
#include <utility>
#include "../mwmechanics/stat.hpp"
#include "window_pinnable_base.hpp"
#include "windowpinnablebase.hpp"
namespace MWGui
{
@ -22,7 +17,7 @@ namespace MWGui
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.
void onFrame();

@ -1,11 +1,12 @@
#include "text_input.hpp"
#include "textinput.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/environment.hpp"
using namespace MWGui;
TextInputDialog::TextInputDialog(MWBase::WindowManager& parWindowManager)
: WindowModal("openmw_text_input.layout", parWindowManager)
TextInputDialog::TextInputDialog()
: WindowModal("openmw_text_input.layout")
{
// Centre dialog
center();
@ -27,9 +28,9 @@ void TextInputDialog::setNextButtonShow(bool shown)
getWidget(okButton, "OKButton");
if (shown)
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sNext", ""));
else
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
}
void TextInputDialog::setTextLabel(const std::string &label)
@ -50,7 +51,7 @@ void TextInputDialog::onOkClicked(MyGUI::Widget* _sender)
{
if (mTextEdit->getCaption() == "")
{
mWindowManager.messageBox ("#{sNotifyMessage37}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage37}");
MyGUI::InputManager::getInstance ().setKeyFocusWidget (mTextEdit);
}
else
@ -61,7 +62,7 @@ void TextInputDialog::onTextAccepted(MyGUI::Edit* _sender)
{
if (mTextEdit->getCaption() == "")
{
mWindowManager.messageBox ("#{sNotifyMessage37}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage37}");
MyGUI::InputManager::getInstance ().setKeyFocusWidget (mTextEdit);
}
else

@ -1,22 +1,19 @@
#ifndef MWGUI_TEXT_INPUT_H
#define MWGUI_TEXT_INPUT_H
#include "window_base.hpp"
#include "windowbase.hpp"
namespace MWGui
{
class WindowManager;
}
/*
*/
namespace MWGui
{
class TextInputDialog : public WindowModal
{
public:
TextInputDialog(MWBase::WindowManager& parWindowManager);
TextInputDialog();
std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; }
void setTextInput(const std::string &text) { if (mTextEdit) mTextEdit->setOnlyText(text); }

@ -12,17 +12,16 @@
#include "../mwworld/class.hpp"
#include "map_window.hpp"
#include "mapwindow.hpp"
#include "widgets.hpp"
#include "inventorywindow.hpp"
using namespace MWGui;
using namespace MyGUI;
ToolTips::ToolTips(MWBase::WindowManager* windowManager) :
ToolTips::ToolTips() :
Layout("openmw_tooltips.layout")
, mGameMode(true)
, mWindowManager(windowManager)
, mFullHelp(false)
, mEnabled(true)
, mFocusToolTipX(0.0)
@ -81,9 +80,9 @@ void ToolTips::onFrame(float frameDuration)
{
const MyGUI::IntPoint& mousePos = InputManager::getInstance().getMousePosition();
if (mWindowManager->getWorldMouseOver() && ((mWindowManager->getMode() == GM_Console)
|| (mWindowManager->getMode() == GM_Container)
|| (mWindowManager->getMode() == GM_Inventory)))
if (MWBase::Environment::get().getWindowManager()->getWorldMouseOver() && ((MWBase::Environment::get().getWindowManager()->getMode() == GM_Console)
|| (MWBase::Environment::get().getWindowManager()->getMode() == GM_Container)
|| (MWBase::Environment::get().getWindowManager()->getMode() == GM_Inventory)))
{
mFocusObject = MWBase::Environment::get().getWorld()->getFacedObject();
@ -93,7 +92,7 @@ void ToolTips::onFrame(float frameDuration)
const MWWorld::Class& objectclass = MWWorld::Class::get (mFocusObject);
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);
mDynamicToolTipBox->setVisible(true);
@ -139,7 +138,7 @@ void ToolTips::onFrame(float frameDuration)
mLastMouseX = mousePos.left;
mLastMouseY = mousePos.top;
if (mRemainingDelay > 0)
return;
@ -167,8 +166,8 @@ void ToolTips::onFrame(float frameDuration)
{
return;
}
// 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 (focus->getUserString ("IsMarker") == "true")
@ -190,11 +189,11 @@ void ToolTips::onFrame(float frameDuration)
}
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);
int realX = int(float(relMousePos.left) / float(avatarPos.width) * 512.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;
if (!mFocusObject.isEmpty ())
@ -346,7 +345,7 @@ void ToolTips::findImageExtension(std::string& image)
}
IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
{
{
mDynamicToolTipBox->setVisible(true);
std::string caption = info.caption;
@ -380,7 +379,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
setCoord(0, 0, 300, 300);
const IntPoint padding(8, 8);
const int maximumWidth = 500;
const int imageCaptionHPadding = (caption != "" ? 8 : 0);
@ -424,7 +423,6 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
Widgets::MWEffectListPtr effectsWidget = effectArea->createWidget<Widgets::MWEffectList>
("MW_StatName", coord, Align::Default, "ToolTipEffectsWidget");
effectsWidget->setWindowManager(mWindowManager);
effectsWidget->setEffectList(info.effects);
std::vector<MyGUI::Widget*> effectItems;
@ -444,7 +442,6 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
Widgets::MWEffectListPtr enchantWidget = enchantArea->createWidget<Widgets::MWEffectList>
("MW_StatName", coord, Align::Default, "ToolTipEnchantWidget");
enchantWidget->setWindowManager(mWindowManager);
enchantWidget->setEffectList(Widgets::MWEffectList::effectListFromESM(&enchant->mEffects));
std::vector<MyGUI::Widget*> enchantEffectItems;
@ -493,7 +490,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
(captionHeight-captionSize.height)/2,
captionSize.width-imageSize,
captionSize.height);
//if its too long we do hscroll with the caption
if (captionSize.width > maximumWidth)
{

@ -39,7 +39,7 @@ namespace MWGui
class ToolTips : public OEngine::GUI::Layout
{
public:
ToolTips(MWBase::WindowManager* windowManager);
ToolTips();
void onFrame(float frameDuration);
@ -82,8 +82,6 @@ namespace MWGui
private:
MyGUI::Widget* mDynamicToolTipBox;
MWBase::WindowManager* mWindowManager;
MWWorld::Ptr mFocusObject;
void findImageExtension(std::string& image);
@ -96,9 +94,9 @@ namespace MWGui
float mFocusToolTipX;
float mFocusToolTipY;
int mHorizontalScrollIndex;
float mDelay;
float mRemainingDelay; // remaining time until tooltip will show

@ -24,8 +24,8 @@ namespace MWGui
const float TradeWindow::sBalanceChangeInitialPause = 0.5;
const float TradeWindow::sBalanceChangeInterval = 0.1;
TradeWindow::TradeWindow(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_trade_window.layout", parWindowManager)
TradeWindow::TradeWindow() :
WindowBase("openmw_trade_window.layout")
, ContainerBase(NULL) // no drag&drop
, mCurrentBalance(0)
, mBalanceButtonsState(BBS_None)
@ -85,7 +85,7 @@ namespace MWGui
mCurrentBalance = 0;
mCurrentMerchantOffer = 0;
mWindowManager.getInventoryWindow()->startTrade();
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->startTrade();
mBoughtItems.clear();
@ -127,7 +127,7 @@ namespace MWGui
{
bool goldFound = false;
MWWorld::Ptr gold;
MWWorld::ContainerStore& playerStore = mWindowManager.getInventoryWindow()->getContainerStore();
MWWorld::ContainerStore& playerStore = MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getContainerStore();
for (MWWorld::ContainerStoreIterator it = playerStore.begin();
it != playerStore.end(); ++it)
@ -172,7 +172,7 @@ namespace MWGui
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
// 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();
if (playerBought.begin() == playerBought.end() && merchantBought.begin() == merchantBought.end())
{
@ -183,7 +183,7 @@ namespace MWGui
}
// 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
MWBase::Environment::get().getWindowManager()->
@ -257,14 +257,15 @@ namespace MWGui
MWBase::Environment::get().getDialogueManager()->applyTemporaryDispositionChange(iBarterSuccessDisposition);
// 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)
{
if (Misc::StringUtils::ciEqual(it->getCellRef().mOwner, MWWorld::Class::get(mPtr).getId(mPtr)))
it->getCellRef().mOwner = "";
}
transferBoughtItems();
mWindowManager.getInventoryWindow()->transferBoughtItems();
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->transferBoughtItems();
// add or remove gold from the player.
if (mCurrentBalance != 0)
@ -273,17 +274,17 @@ namespace MWGui
std::string sound = "Item Gold Up";
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)
{
// i give you back your stuff!
returnBoughtItems(mWindowManager.getInventoryWindow()->getContainerStore());
returnBoughtItems(MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getContainerStore());
// 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)
@ -327,7 +328,7 @@ namespace MWGui
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)
{
@ -403,8 +404,8 @@ namespace MWGui
void TradeWindow::onReferenceUnavailable()
{
// remove both Trade and Dialogue (since you always trade with the NPC/creature that you have previously talked to)
mWindowManager.removeGuiMode(GM_Barter);
mWindowManager.removeGuiMode(GM_Dialogue);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Barter);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
}
int TradeWindow::getMerchantGold()

@ -2,9 +2,6 @@
#define MWGUI_TRADEWINDOW_H
#include "container.hpp"
#include "window_base.hpp"
#include "../mwworld/ptr.hpp"
namespace MyGUI
{
@ -23,7 +20,7 @@ namespace MWGui
class TradeWindow : public ContainerBase, public WindowBase
{
public:
TradeWindow(MWBase::WindowManager& parWindowManager);
TradeWindow();
void startTrade(MWWorld::Ptr actor);

@ -20,8 +20,8 @@
namespace MWGui
{
TrainingWindow::TrainingWindow(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_trainingwindow.layout", parWindowManager)
TrainingWindow::TrainingWindow()
: WindowBase("openmw_trainingwindow.layout")
, mFadeTimeRemaining(0)
{
getWidget(mTrainingOptions, "TrainingOptions");
@ -40,7 +40,7 @@ namespace MWGui
{
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);
@ -82,7 +82,7 @@ namespace MWGui
int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer
(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::IntCoord(5, 5+i*18, mTrainingOptions->getWidth()-10, 18), MyGUI::Align::Default);
@ -102,12 +102,12 @@ namespace MWGui
void TrainingWindow::onReferenceUnavailable ()
{
mWindowManager.removeGuiMode(GM_Training);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Training);
}
void TrainingWindow::onCancelButtonClicked (MyGUI::Widget *sender)
{
mWindowManager.removeGuiMode (GM_Training);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Training);
}
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 ();
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true);
if (mWindowManager.getInventoryWindow()->getPlayerGold()<price)
if (MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()<price)
return;
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(mPtr).getNpcStats (mPtr);
if (npcStats.getSkill (skillId).getBase () <= pcStats.getSkill (skillId).getBase ())
{
mWindowManager.messageBox ("#{sServiceTrainingWords}");
MWBase::Environment::get().getWindowManager()->messageBox ("#{sServiceTrainingWords}");
return;
}
@ -141,11 +141,11 @@ namespace MWGui
pcStats.increaseSkill (skillId, *class_, true);
// remove gold
mWindowManager.getTradeWindow()->addOrRemoveGold(-price);
MWBase::Environment::get().getWindowManager()->getTradeWindow()->addOrRemoveGold(-price);
// go back to game mode
mWindowManager.removeGuiMode (GM_Training);
mWindowManager.removeGuiMode (GM_Dialogue);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Training);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Dialogue);
// advance time
MWBase::Environment::get().getWorld ()->advanceTime (2);

@ -1,7 +1,7 @@
#ifndef MWGUI_TRAININGWINDOW_H
#define MWGUI_TRAININGWINDOW_H
#include "window_base.hpp"
#include "windowbase.hpp"
#include "referenceinterface.hpp"
namespace MWGui
@ -10,7 +10,7 @@ namespace MWGui
class TrainingWindow : public WindowBase, public ReferenceInterface
{
public:
TrainingWindow(MWBase::WindowManager& parWindowManager);
TrainingWindow();
virtual void open();

@ -25,8 +25,8 @@ namespace MWGui
{
const int TravelWindow::sLineHeight = 18;
TravelWindow::TravelWindow(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_travel_window.layout", parWindowManager)
TravelWindow::TravelWindow() :
WindowBase("openmw_travel_window.layout")
, mCurrentY(0)
, mLastPos(0)
{
@ -71,7 +71,7 @@ namespace MWGui
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;
if(interior)
toAdd->setUserString("interior","y");
@ -129,10 +129,10 @@ namespace MWGui
int price;
iss >> price;
if (mWindowManager.getInventoryWindow()->getPlayerGold()<price)
if (MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getPlayerGold()<price)
return;
mWindowManager.getTradeWindow ()->addOrRemoveGold (-price);
MWBase::Environment::get().getWindowManager()->getTradeWindow ()->addOrRemoveGold (-price);
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(1);
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()->moveObject(player,*cell,pos.pos[0],pos.pos[1],pos.pos[2]);
MWWorld::Class::get(player).adjustPosition(player);
mWindowManager.removeGuiMode(GM_Travel);
mWindowManager.removeGuiMode(GM_Dialogue);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0);
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(1);
}
void TravelWindow::onCancelButtonClicked(MyGUI::Widget* _sender)
{
mWindowManager.removeGuiMode(GM_Travel);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
}
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->getTop(),
mPlayerGold->getTextSize().width,
@ -179,8 +180,8 @@ namespace MWGui
void TravelWindow::onReferenceUnavailable()
{
mWindowManager.removeGuiMode(GM_Travel);
mWindowManager.removeGuiMode(GM_Dialogue);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
}
void TravelWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)

@ -2,9 +2,6 @@
#define MWGUI_TravelWINDOW_H
#include "container.hpp"
#include "window_base.hpp"
#include "../mwworld/ptr.hpp"
namespace MyGUI
{
@ -23,7 +20,7 @@ namespace MWGui
class TravelWindow : public ReferenceInterface, public WindowBase
{
public:
TravelWindow(MWBase::WindowManager& parWindowManager);
TravelWindow();
void startTravel(const MWWorld::Ptr& actor);

@ -25,8 +25,8 @@
namespace MWGui
{
WaitDialogProgressBar::WaitDialogProgressBar(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_wait_dialog_progressbar.layout", parWindowManager)
WaitDialogProgressBar::WaitDialogProgressBar()
: WindowBase("openmw_wait_dialog_progressbar.layout")
{
getWidget(mProgressBar, "ProgressBar");
getWidget(mProgressText, "ProgressText");
@ -46,9 +46,9 @@ namespace MWGui
// ---------------------------------------------------------------------------------------------------------
WaitDialog::WaitDialog(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_wait_dialog.layout", parWindowManager)
, mProgressBar(parWindowManager)
WaitDialog::WaitDialog()
: WindowBase("openmw_wait_dialog.layout")
, mProgressBar()
, mWaiting(false)
, mSleeping(false)
, mHours(1)
@ -75,7 +75,7 @@ namespace MWGui
{
if (!MWBase::Environment::get().getWindowManager ()->getRestEnabled ())
{
mWindowManager.popGuiMode ();
MWBase::Environment::get().getWindowManager()->popGuiMode ();
}
int canRest = MWBase::Environment::get().getWorld ()->canRest ();
@ -83,8 +83,8 @@ namespace MWGui
if (canRest == 2)
{
// resting underwater or mid-air not allowed
mWindowManager.messageBox ("#{sNotifyMessage1}");
mWindowManager.popGuiMode ();
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage1}");
MWBase::Environment::get().getWindowManager()->popGuiMode ();
}
setCanRest(canRest == 0);
@ -212,7 +212,7 @@ namespace MWGui
void WaitDialog::onCancelButtonClicked(MyGUI::Widget* sender)
{
mWindowManager.popGuiMode ();
MWBase::Environment::get().getWindowManager()->popGuiMode ();
}
void WaitDialog::onHourSliderChangedPosition(MyGUI::ScrollBar* sender, size_t position)
@ -263,8 +263,8 @@ namespace MWGui
{
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(0.2);
mProgressBar.setVisible (false);
mWindowManager.removeGuiMode (GM_Rest);
mWindowManager.removeGuiMode (GM_RestBed);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Rest);
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_RestBed);
mWaiting = false;
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
@ -273,7 +273,7 @@ namespace MWGui
// trigger levelup if possible
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
#define MWGUI_WAIT_DIALOG_H
#include "window_base.hpp"
#include "windowbase.hpp"
namespace MWGui
{
@ -9,7 +9,7 @@ namespace MWGui
class WaitDialogProgressBar : public WindowBase
{
public:
WaitDialogProgressBar(MWBase::WindowManager& parWindowManager);
WaitDialogProgressBar();
virtual void open();
@ -23,7 +23,7 @@ namespace MWGui
class WaitDialog : public WindowBase
{
public:
WaitDialog(MWBase::WindowManager& parWindowManager);
WaitDialog();
virtual void open();

@ -34,8 +34,7 @@ void MWGui::Widgets::fixTexturePath(std::string &path)
/* MWSkill */
MWSkill::MWSkill()
: mManager(NULL)
, mSkillId(ESM::Skill::Length)
: mSkillId(ESM::Skill::Length)
, mSkillNameWidget(NULL)
, mSkillValueWidget(NULL)
{
@ -65,7 +64,7 @@ void MWSkill::setSkillValue(const SkillValue& value)
void MWSkill::updateWidgets()
{
if (mSkillNameWidget && mManager)
if (mSkillNameWidget)
{
if (mSkillId == ESM::Skill::Length)
{
@ -73,7 +72,7 @@ void MWSkill::updateWidgets()
}
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);
}
}
@ -126,8 +125,7 @@ void MWSkill::initialiseOverride()
/* MWAttribute */
MWAttribute::MWAttribute()
: mManager(NULL)
, mId(-1)
: mId(-1)
, mAttributeNameWidget(NULL)
, mAttributeValueWidget(NULL)
{
@ -152,7 +150,7 @@ void MWAttribute::onClicked(MyGUI::Widget* _sender)
void MWAttribute::updateWidgets()
{
if (mAttributeNameWidget && mManager)
if (mAttributeNameWidget)
{
if (mId < 0 || mId >= 8)
{
@ -170,7 +168,7 @@ void MWAttribute::updateWidgets()
"sAttributePersonality",
"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);
}
}
@ -218,8 +216,7 @@ void MWAttribute::initialiseOverride()
/* 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)
{
effect = creator->createWidget<MWSpellEffect>("MW_EffectImage", coord, MyGUI::Align::Default);
effect->setWindowManager(mWindowManager);
SpellEffectParams params;
params.mEffectID = it->mEffectID;
params.mSkill = it->mSkill;
@ -262,7 +258,7 @@ void MWSpell::createEffectWidgets(std::vector<MyGUI::Widget*> &effects, MyGUI::W
void MWSpell::updateWidgets()
{
if (mSpellNameWidget && mWindowManager)
if (mSpellNameWidget && MWBase::Environment::get().getWindowManager())
{
const MWWorld::ESMStore &store =
MWBase::Environment::get().getWorld()->getStore();
@ -289,8 +285,7 @@ MWSpell::~MWSpell()
/* 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)
{
effect = creator->createWidget<MWSpellEffect>("MW_EffectImage", coord, MyGUI::Align::Default);
effect->setWindowManager(mWindowManager);
it->mIsConstant = (flags & EF_Constant) || it->mIsConstant;
it->mNoTarget = (flags & EF_NoTarget) || it->mNoTarget;
effect->setSpellEffect(*it);
@ -378,8 +372,7 @@ SpellEffectList MWEffectList::effectListFromESM(const ESM::EffectList* effects)
/* MWSpellEffect */
MWSpellEffect::MWSpellEffect()
: mWindowManager(NULL)
, mImageWidget(NULL)
: mImageWidget(NULL)
, mTextWidget(NULL)
, mRequestedWidth(0)
{
@ -409,22 +402,22 @@ void MWSpellEffect::updateWidgets()
assert(magicEffect);
std::string pt = mWindowManager->getGameSettingString("spoint", "");
std::string pts = mWindowManager->getGameSettingString("spoints", "");
std::string to = " " + mWindowManager->getGameSettingString("sTo", "") + " ";
std::string sec = " " + mWindowManager->getGameSettingString("ssecond", "");
std::string secs = " " + mWindowManager->getGameSettingString("sseconds", "");
std::string pt = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoint", "");
std::string pts = MWBase::Environment::get().getWindowManager()->getGameSettingString("spoints", "");
std::string to = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sTo", "") + " ";
std::string sec = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("ssecond", "");
std::string secs = " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sseconds", "");
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)
{
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)
{
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))
@ -442,7 +435,7 @@ void MWSpellEffect::updateWidgets()
{
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)
@ -453,13 +446,13 @@ void MWSpellEffect::updateWidgets()
// potions have no target
if (!mEffectParams.mNoTarget)
{
std::string on = mWindowManager->getGameSettingString("sonword", "");
std::string on = MWBase::Environment::get().getWindowManager()->getGameSettingString("sonword", "");
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)
spellLine += " " + on + " " + mWindowManager->getGameSettingString("sRangeTouch", "");
spellLine += " " + on + " " + MWBase::Environment::get().getWindowManager()->getGameSettingString("sRangeTouch", "");
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 "../mwmechanics/stat.hpp"
#include <MyGUI_Widget.h>
#include <MyGUI_TextBox.h>
#include <MyGUI_Button.h>
#include <MyGUI_EditBox.h>
@ -94,12 +92,10 @@ namespace MWGui
typedef MWMechanics::Stat<float> SkillValue;
void setWindowManager(MWBase::WindowManager *m) { mManager = m; } /// \todo remove
void setSkillId(ESM::Skill::SkillEnum skillId);
void setSkillNumber(int skillId);
void setSkillValue(const SkillValue& value);
MWBase::WindowManager *getWindowManager() const { return mManager; }
ESM::Skill::SkillEnum getSkillId() const { return mSkillId; }
const SkillValue& getSkillValue() const { return mValue; }
@ -122,7 +118,6 @@ namespace MWGui
void updateWidgets();
MWBase::WindowManager *mManager;
ESM::Skill::SkillEnum mSkillId;
SkillValue mValue;
MyGUI::Widget* mSkillNameWidget;
@ -138,11 +133,9 @@ namespace MWGui
typedef MWMechanics::Stat<int> AttributeValue;
void setWindowManager(MWBase::WindowManager *m) { mManager = m; }
void setAttributeId(int attributeId);
void setAttributeValue(const AttributeValue& value);
MWBase::WindowManager *getWindowManager() const { return mManager; }
int getAttributeId() const { return mId; }
const AttributeValue& getAttributeValue() const { return mValue; }
@ -165,7 +158,6 @@ namespace MWGui
void updateWidgets();
MWBase::WindowManager *mManager;
int mId;
AttributeValue mValue;
MyGUI::Widget* mAttributeNameWidget;
@ -185,7 +177,6 @@ namespace MWGui
typedef MWMechanics::Stat<int> SpellValue;
void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
void setSpellId(const std::string &id);
/**
@ -207,7 +198,6 @@ namespace MWGui
private:
void updateWidgets();
MWBase::WindowManager* mWindowManager;
std::string mId;
MyGUI::TextBox* mSpellNameWidget;
};
@ -227,7 +217,6 @@ namespace MWGui
EF_Constant = 0x02 // constant effect means that duration will not be displayed
};
void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
void setEffectList(const SpellEffectList& list);
static SpellEffectList effectListFromESM(const ESM::EffectList* effects);
@ -249,7 +238,6 @@ namespace MWGui
private:
void updateWidgets();
MWBase::WindowManager* mWindowManager;
SpellEffectList mEffectList;
};
typedef MWEffectList* MWEffectListPtr;
@ -262,7 +250,6 @@ namespace MWGui
typedef ESM::ENAMstruct SpellEffectValue;
void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
void setSpellEffect(const SpellEffectParams& params);
int getRequestedWidth() const { return mRequestedWidth; }
@ -276,7 +263,6 @@ namespace MWGui
void updateWidgets();
MWBase::WindowManager* mWindowManager;
SpellEffectParams mEffectParams;
MyGUI::ImageBox* mImageWidget;
MyGUI::TextBox* mTextWidget;

@ -1,4 +1,4 @@
#include "window_base.hpp"
#include "windowbase.hpp"
#include <components/settings/settings.hpp>
@ -6,9 +6,8 @@
using namespace MWGui;
WindowBase::WindowBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
WindowBase::WindowBase(const std::string& parLayout)
: Layout(parLayout)
, mWindowManager(parWindowManager)
{
}
@ -39,8 +38,8 @@ void WindowBase::center()
mMainWidget->setCoord(coord);
}
WindowModal::WindowModal(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
: WindowBase(parLayout, parWindowManager)
WindowModal::WindowModal(const std::string& parLayout)
: WindowBase(parLayout)
{
}

@ -15,7 +15,7 @@ namespace MWGui
class WindowBase: public OEngine::GUI::Layout
{
public:
WindowBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
WindowBase(const std::string& parLayout);
// Events
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
@ -29,10 +29,6 @@ namespace MWGui
signature : void method()\n
*/
EventHandle_WindowBase eventDone;
protected:
/// \todo remove
MWBase::WindowManager& mWindowManager;
};
@ -42,7 +38,7 @@ namespace MWGui
class WindowModal : public WindowBase
{
public:
WindowModal(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
WindowModal(const std::string& parLayout);
virtual void open();
virtual void close();
};

@ -21,12 +21,12 @@
#include "console.hpp"
#include "journalwindow.hpp"
#include "charactercreation.hpp"
#include "text_input.hpp"
#include "textinput.hpp"
#include "review.hpp"
#include "dialogue.hpp"
#include "dialogue_history.hpp"
#include "map_window.hpp"
#include "stats_window.hpp"
#include "dialoguehistory.hpp"
#include "mapwindow.hpp"
#include "statswindow.hpp"
#include "messagebox.hpp"
#include "container.hpp"
#include "inventorywindow.hpp"
@ -162,38 +162,38 @@ WindowManager::WindowManager(
mDragAndDrop->mDragAndDropWidget = dragAndDropWidget;
mMenu = new MainMenu(w,h);
mMap = new MapWindow(*this, cacheDir);
mStatsWindow = new StatsWindow(*this);
mMap = new MapWindow(cacheDir);
mStatsWindow = new StatsWindow();
mConsole = new Console(w,h, consoleOnlyScripts);
mJournal = new JournalWindow(*this);
mMessageBoxManager = new MessageBoxManager(this);
mInventoryWindow = new InventoryWindow(*this,mDragAndDrop);
mTradeWindow = new TradeWindow(*this);
mSpellBuyingWindow = new SpellBuyingWindow(*this);
mTravelWindow = new TravelWindow(*this);
mDialogueWindow = new DialogueWindow(*this);
mContainerWindow = new ContainerWindow(*this,mDragAndDrop);
mJournal = new JournalWindow();
mMessageBoxManager = new MessageBoxManager();
mInventoryWindow = new InventoryWindow(mDragAndDrop);
mTradeWindow = new TradeWindow();
mSpellBuyingWindow = new SpellBuyingWindow();
mTravelWindow = new TravelWindow();
mDialogueWindow = new DialogueWindow();
mContainerWindow = new ContainerWindow(mDragAndDrop);
mHud = new HUD(w,h, mShowFPSLevel, mDragAndDrop);
mToolTips = new ToolTips(this);
mScrollWindow = new ScrollWindow(*this);
mBookWindow = new BookWindow(*this);
mCountDialog = new CountDialog(*this);
mSettingsWindow = new SettingsWindow(*this);
mConfirmationDialog = new ConfirmationDialog(*this);
mAlchemyWindow = new AlchemyWindow(*this);
mSpellWindow = new SpellWindow(*this);
mQuickKeysMenu = new QuickKeysMenu(*this);
mLevelupDialog = new LevelupDialog(*this);
mWaitDialog = new WaitDialog(*this);
mSpellCreationDialog = new SpellCreationDialog(*this);
mEnchantingDialog = new EnchantingDialog(*this);
mTrainingWindow = new TrainingWindow(*this);
mMerchantRepair = new MerchantRepair(*this);
mRepair = new Repair(*this);
mToolTips = new ToolTips();
mScrollWindow = new ScrollWindow();
mBookWindow = new BookWindow();
mCountDialog = new CountDialog();
mSettingsWindow = new SettingsWindow();
mConfirmationDialog = new ConfirmationDialog();
mAlchemyWindow = new AlchemyWindow();
mSpellWindow = new SpellWindow();
mQuickKeysMenu = new QuickKeysMenu();
mLevelupDialog = new LevelupDialog();
mWaitDialog = new WaitDialog();
mSpellCreationDialog = new SpellCreationDialog();
mEnchantingDialog = new EnchantingDialog();
mTrainingWindow = new TrainingWindow();
mMerchantRepair = new MerchantRepair();
mRepair = new Repair();
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);
mInputBlocker = mGui->createWidget<MyGUI::Widget>("",0,0,w,h,MyGUI::Align::Default,"Windows","");
@ -202,7 +202,7 @@ WindowManager::WindowManager(
mHud->setVisible(mHudEnabled);
mCharGen = new CharacterCreation(this);
mCharGen = new CharacterCreation();
// Setup player stats
for (int i = 0; i < ESM::Attribute::Length; ++i)

@ -10,11 +10,6 @@
this class.
**/
#include <vector>
#include <string>
#include <components/esm/loadclas.hpp>
#include "../mwbase/windowmanager.hpp"
namespace MyGUI

@ -1,4 +1,4 @@
#include "window_pinnable_base.hpp"
#include "windowpinnablebase.hpp"
#include "../mwbase/windowmanager.hpp"
@ -6,8 +6,8 @@
using namespace MWGui;
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
: WindowBase(parLayout, parWindowManager), mPinned(false), mVisible(false)
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout)
: WindowBase(parLayout), mPinned(false), mVisible(false)
{
ExposedWindow* window = static_cast<ExposedWindow*>(mMainWidget);
mPinButton = window->getSkinWidget ("Button");

@ -1,7 +1,7 @@
#ifndef MWGUI_WINDOW_PINNABLE_BASE_H
#define MWGUI_WINDOW_PINNABLE_BASE_H
#include "window_base.hpp"
#include "windowbase.hpp"
namespace MWGui
{
@ -10,7 +10,7 @@ namespace MWGui
class WindowPinnableBase: public WindowBase
{
public:
WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
WindowPinnableBase(const std::string& parLayout);
bool pinned() { return mPinned; }
private:
Loading…
Cancel
Save