mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Merge commit 'amos/gui-windows' into newchar
This commit is contained in:
commit
8de9619579
@ -270,6 +270,7 @@ void OMW::Engine::go()
|
|||||||
// Sets up the input system
|
// Sets up the input system
|
||||||
MWInput::MWInputManager input(mOgre, mEnvironment.mWorld->getPlayerPos(),
|
MWInput::MWInputManager input(mOgre, mEnvironment.mWorld->getPlayerPos(),
|
||||||
*mEnvironment.mWindowManager, mDebug, *this);
|
*mEnvironment.mWindowManager, mDebug, *this);
|
||||||
|
mEnvironment.mInputManager = &input;
|
||||||
|
|
||||||
focusFrameCounter = 0;
|
focusFrameCounter = 0;
|
||||||
|
|
||||||
|
@ -285,6 +285,7 @@ namespace MWGui
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if 0
|
||||||
class InventoryWindow : public OEngine::GUI::Layout
|
class InventoryWindow : public OEngine::GUI::Layout
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -403,5 +404,6 @@ namespace MWGui
|
|||||||
MyGUI::Colour activeColor;
|
MyGUI::Colour activeColor;
|
||||||
MyGUI::Colour inactiveColor;
|
MyGUI::Colour inactiveColor;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
43
apps/openmw/mwgui/mode.hpp
Normal file
43
apps/openmw/mwgui/mode.hpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#ifndef MWGUI_MODE_H
|
||||||
|
#define MWGUI_MODE_H
|
||||||
|
|
||||||
|
namespace MWGui
|
||||||
|
{
|
||||||
|
enum GuiMode
|
||||||
|
{
|
||||||
|
GM_Game, // Game mode, only HUD
|
||||||
|
GM_Inventory, // Inventory mode
|
||||||
|
GM_MainMenu, // Main menu mode
|
||||||
|
|
||||||
|
GM_Console, // Console mode
|
||||||
|
|
||||||
|
// None of the following are implemented yet
|
||||||
|
|
||||||
|
GM_Dialogue, // NPC interaction
|
||||||
|
GM_Barter,
|
||||||
|
GM_Rest,
|
||||||
|
// .. more here ..
|
||||||
|
|
||||||
|
// Startup character creation dialogs
|
||||||
|
GM_Name,
|
||||||
|
GM_Race,
|
||||||
|
GM_Birth,
|
||||||
|
GM_Class,
|
||||||
|
GM_Review
|
||||||
|
};
|
||||||
|
|
||||||
|
// Windows shown in inventory mode
|
||||||
|
enum GuiWindow
|
||||||
|
{
|
||||||
|
GW_None = 0,
|
||||||
|
|
||||||
|
GW_Map = 0x01,
|
||||||
|
GW_Inventory = 0x02,
|
||||||
|
GW_Magic = 0x04,
|
||||||
|
GW_Stats = 0x08,
|
||||||
|
|
||||||
|
GW_ALL = 0xFF
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -1,6 +1,7 @@
|
|||||||
#include "race.hpp"
|
#include "race.hpp"
|
||||||
#include "../mwworld/environment.hpp"
|
#include "../mwworld/environment.hpp"
|
||||||
#include "../mwworld/world.hpp"
|
#include "../mwworld/world.hpp"
|
||||||
|
#include "window_manager.hpp"
|
||||||
#include "components/esm_store/store.hpp"
|
#include "components/esm_store/store.hpp"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -12,7 +13,7 @@
|
|||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
RaceDialog::RaceDialog(MWWorld::Environment& environment, bool showNext)
|
RaceDialog::RaceDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||||
: Layout("openmw_chargen_race_layout.xml")
|
: Layout("openmw_chargen_race_layout.xml")
|
||||||
, environment(environment)
|
, environment(environment)
|
||||||
, genderIndex(0)
|
, genderIndex(0)
|
||||||
@ -21,12 +22,17 @@ RaceDialog::RaceDialog(MWWorld::Environment& environment, bool showNext)
|
|||||||
, faceCount(10)
|
, faceCount(10)
|
||||||
, hairCount(14)
|
, hairCount(14)
|
||||||
{
|
{
|
||||||
mMainWidget->setCoord(mMainWidget->getCoord() + MyGUI::IntPoint(0, 100));
|
// Centre dialog
|
||||||
|
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||||
|
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||||
|
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||||
|
mMainWidget->setCoord(coord);
|
||||||
|
|
||||||
// These are just demo values, you should replace these with
|
// These are just demo values, you should replace these with
|
||||||
// real calls from outside the class later.
|
// real calls from outside the class later.
|
||||||
|
|
||||||
setText("AppearanceT", "Appearance");
|
WindowManager *wm = environment.mWindowManager;
|
||||||
|
setText("AppearanceT", wm->getGameSettingString("sRaceMenu1", "Appearance"));
|
||||||
getWidget(appearanceBox, "AppearanceBox");
|
getWidget(appearanceBox, "AppearanceBox");
|
||||||
|
|
||||||
getWidget(headRotate, "HeadRotate");
|
getWidget(headRotate, "HeadRotate");
|
||||||
@ -38,29 +44,34 @@ RaceDialog::RaceDialog(MWWorld::Environment& environment, bool showNext)
|
|||||||
// Set up next/previous buttons
|
// Set up next/previous buttons
|
||||||
MyGUI::ButtonPtr prevButton, nextButton;
|
MyGUI::ButtonPtr prevButton, nextButton;
|
||||||
|
|
||||||
|
setText("GenderChoiceT", wm->getGameSettingString("sRaceMenu2", "Change Sex"));
|
||||||
getWidget(prevButton, "PrevGenderButton");
|
getWidget(prevButton, "PrevGenderButton");
|
||||||
getWidget(nextButton, "NextGenderButton");
|
getWidget(nextButton, "NextGenderButton");
|
||||||
prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender);
|
prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender);
|
||||||
nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextGender);
|
nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextGender);
|
||||||
|
|
||||||
|
setText("FaceChoiceT", wm->getGameSettingString("sRaceMenu3", "Change Face"));
|
||||||
getWidget(prevButton, "PrevFaceButton");
|
getWidget(prevButton, "PrevFaceButton");
|
||||||
getWidget(nextButton, "NextFaceButton");
|
getWidget(nextButton, "NextFaceButton");
|
||||||
prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace);
|
prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace);
|
||||||
nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextFace);
|
nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextFace);
|
||||||
|
|
||||||
|
setText("HairChoiceT", wm->getGameSettingString("sRaceMenu3", "Change Hair"));
|
||||||
getWidget(prevButton, "PrevHairButton");
|
getWidget(prevButton, "PrevHairButton");
|
||||||
getWidget(nextButton, "NextHairButton");
|
getWidget(nextButton, "NextHairButton");
|
||||||
prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair);
|
prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair);
|
||||||
nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextHair);
|
nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextHair);
|
||||||
|
|
||||||
setText("RaceT", "Race");
|
setText("RaceT", wm->getGameSettingString("sRaceMenu4", "Race"));
|
||||||
getWidget(raceList, "RaceList");
|
getWidget(raceList, "RaceList");
|
||||||
raceList->setScrollVisible(true);
|
raceList->setScrollVisible(true);
|
||||||
raceList->eventListSelectAccept = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
raceList->eventListSelectAccept = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||||
raceList->eventListMouseItemActivate = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
raceList->eventListMouseItemActivate = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||||
raceList->eventListChangePosition = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
raceList->eventListChangePosition = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
|
||||||
|
|
||||||
|
setText("SkillsT", wm->getGameSettingString("sBonusSkillTitle", "Skill Bonus"));
|
||||||
getWidget(skillList, "SkillList");
|
getWidget(skillList, "SkillList");
|
||||||
|
setText("SpellPowerT", wm->getGameSettingString("sRaceMenu7", "Specials"));
|
||||||
getWidget(spellPowerList, "SpellPowerList");
|
getWidget(spellPowerList, "SpellPowerList");
|
||||||
|
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
@ -71,28 +82,54 @@ RaceDialog::RaceDialog(MWWorld::Environment& environment, bool showNext)
|
|||||||
MyGUI::ButtonPtr okButton;
|
MyGUI::ButtonPtr okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onOkClicked);
|
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onOkClicked);
|
||||||
if (showNext)
|
|
||||||
{
|
|
||||||
okButton->setCaption("Next");
|
|
||||||
|
|
||||||
// Adjust back button when next is shown
|
|
||||||
backButton->setCoord(backButton->getCoord() - MyGUI::IntPoint(18, 0));
|
|
||||||
okButton->setCoord(okButton->getCoord() + MyGUI::IntCoord(-18, 0, 18, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
updateRaces();
|
updateRaces();
|
||||||
updateSkills();
|
updateSkills();
|
||||||
updateSpellPowers();
|
updateSpellPowers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RaceDialog::setRace(const std::string &race)
|
void RaceDialog::setNextButtonShow(bool shown)
|
||||||
{
|
{
|
||||||
currentRace = race;
|
MyGUI::ButtonPtr backButton;
|
||||||
|
getWidget(backButton, "BackButton");
|
||||||
|
|
||||||
|
MyGUI::ButtonPtr okButton;
|
||||||
|
getWidget(okButton, "OKButton");
|
||||||
|
|
||||||
|
// TODO: All hardcoded coords for buttons are temporary, will be replaced with a dynamic system.
|
||||||
|
if (shown)
|
||||||
|
{
|
||||||
|
okButton->setCaption("Next");
|
||||||
|
|
||||||
|
// Adjust back button when next is shown
|
||||||
|
backButton->setCoord(MyGUI::IntCoord(471 - 18, 397, 53, 23));
|
||||||
|
okButton->setCoord(MyGUI::IntCoord(532 - 18, 397, 42 + 18, 23));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
okButton->setCaption("OK");
|
||||||
|
backButton->setCoord(MyGUI::IntCoord(471, 397, 53, 23));
|
||||||
|
okButton->setCoord(MyGUI::IntCoord(532, 397, 42, 23));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RaceDialog::open()
|
||||||
|
{
|
||||||
|
updateRaces();
|
||||||
|
updateSkills();
|
||||||
|
updateSpellPowers();
|
||||||
|
setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RaceDialog::setRaceId(const std::string &raceId)
|
||||||
|
{
|
||||||
|
currentRaceId = raceId;
|
||||||
raceList->setIndexSelected(MyGUI::ITEM_NONE);
|
raceList->setIndexSelected(MyGUI::ITEM_NONE);
|
||||||
size_t count = raceList->getItemCount();
|
size_t count = raceList->getItemCount();
|
||||||
for (size_t i = 0; i < count; ++i)
|
for (size_t i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
if (boost::iequals(raceList->getItem(i), race))
|
if (boost::iequals(raceList->getItem(i), raceId))
|
||||||
{
|
{
|
||||||
raceList->setIndexSelected(i);
|
raceList->setIndexSelected(i);
|
||||||
break;
|
break;
|
||||||
@ -165,11 +202,11 @@ void RaceDialog::onSelectRace(MyGUI::List* _sender, size_t _index)
|
|||||||
if (_index == MyGUI::ITEM_NONE)
|
if (_index == MyGUI::ITEM_NONE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const std::string race = raceList->getItem(_index);
|
const std::string *raceId = raceList->getItemDataAt<std::string>(_index);
|
||||||
if (boost::iequals(currentRace, race))
|
if (boost::iequals(currentRaceId, *raceId))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
currentRace = race;
|
currentRaceId = *raceId;
|
||||||
updateSkills();
|
updateSkills();
|
||||||
updateSpellPowers();
|
updateSpellPowers();
|
||||||
}
|
}
|
||||||
@ -192,8 +229,8 @@ void RaceDialog::updateRaces()
|
|||||||
if (!playable) // Only display playable races
|
if (!playable) // Only display playable races
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
raceList->addItem(race.name);
|
raceList->addItem(race.name, it->first);
|
||||||
if (boost::iequals(race.name, currentRace))
|
if (boost::iequals(race.name, currentRaceId))
|
||||||
raceList->setIndexSelected(index);
|
raceList->setIndexSelected(index);
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
@ -207,7 +244,7 @@ void RaceDialog::updateSkills()
|
|||||||
}
|
}
|
||||||
skillItems.clear();
|
skillItems.clear();
|
||||||
|
|
||||||
if (currentRace.empty())
|
if (currentRaceId.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MyGUI::StaticTextPtr skillNameWidget, skillBonusWidget;
|
MyGUI::StaticTextPtr skillNameWidget, skillBonusWidget;
|
||||||
@ -215,8 +252,9 @@ void RaceDialog::updateSkills()
|
|||||||
MyGUI::IntCoord coord1(0, 0, skillList->getWidth() - (40 + 4), 18);
|
MyGUI::IntCoord coord1(0, 0, skillList->getWidth() - (40 + 4), 18);
|
||||||
MyGUI::IntCoord coord2(coord1.left + coord1.width, 0, 40, 18);
|
MyGUI::IntCoord coord2(coord1.left + coord1.width, 0, 40, 18);
|
||||||
|
|
||||||
|
WindowManager *wm = environment.mWindowManager;
|
||||||
ESMS::ESMStore &store = environment.mWorld->getStore();
|
ESMS::ESMStore &store = environment.mWorld->getStore();
|
||||||
const ESM::Race *race = store.races.find(currentRace);
|
const ESM::Race *race = store.races.find(currentRaceId);
|
||||||
int count = sizeof(race->data.bonus)/sizeof(race->data.bonus[0]); // TODO: Find a portable macro for this ARRAYSIZE?
|
int count = sizeof(race->data.bonus)/sizeof(race->data.bonus[0]); // TODO: Find a portable macro for this ARRAYSIZE?
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
@ -227,7 +265,8 @@ void RaceDialog::updateSkills()
|
|||||||
skillNameWidget = skillList->createWidget<MyGUI::StaticText>("SandText", coord1, MyGUI::Align::Default,
|
skillNameWidget = skillList->createWidget<MyGUI::StaticText>("SandText", coord1, MyGUI::Align::Default,
|
||||||
std::string("SkillName") + boost::lexical_cast<std::string>(i));
|
std::string("SkillName") + boost::lexical_cast<std::string>(i));
|
||||||
assert(skillId >= 0 && skillId < ESM::Skill::Length);
|
assert(skillId >= 0 && skillId < ESM::Skill::Length);
|
||||||
skillNameWidget->setCaption(ESMS::Skill::sSkillNames[skillId]);
|
const std::string &skillNameId = ESMS::Skill::sSkillNameIds[skillId];
|
||||||
|
skillNameWidget->setCaption(wm->getGameSettingString(skillNameId, skillNameId));
|
||||||
|
|
||||||
skillBonusWidget = skillList->createWidget<MyGUI::StaticText>("SandTextRight", coord2, MyGUI::Align::Default,
|
skillBonusWidget = skillList->createWidget<MyGUI::StaticText>("SandTextRight", coord2, MyGUI::Align::Default,
|
||||||
std::string("SkillBonus") + boost::lexical_cast<std::string>(i));
|
std::string("SkillBonus") + boost::lexical_cast<std::string>(i));
|
||||||
@ -250,7 +289,7 @@ void RaceDialog::updateSpellPowers()
|
|||||||
}
|
}
|
||||||
spellPowerItems.clear();
|
spellPowerItems.clear();
|
||||||
|
|
||||||
if (currentRace.empty())
|
if (currentRaceId.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MyGUI::StaticTextPtr spellPowerWidget;
|
MyGUI::StaticTextPtr spellPowerWidget;
|
||||||
@ -258,7 +297,7 @@ void RaceDialog::updateSpellPowers()
|
|||||||
MyGUI::IntCoord coord(0, 0, spellPowerList->getWidth(), 18);
|
MyGUI::IntCoord coord(0, 0, spellPowerList->getWidth(), 18);
|
||||||
|
|
||||||
ESMS::ESMStore &store = environment.mWorld->getStore();
|
ESMS::ESMStore &store = environment.mWorld->getStore();
|
||||||
const ESM::Race *race = store.races.find(currentRace);
|
const ESM::Race *race = store.races.find(currentRaceId);
|
||||||
|
|
||||||
std::vector<std::string>::const_iterator it = race->powers.list.begin();
|
std::vector<std::string>::const_iterator it = race->powers.list.begin();
|
||||||
std::vector<std::string>::const_iterator end = race->powers.list.end();
|
std::vector<std::string>::const_iterator end = race->powers.list.end();
|
||||||
|
@ -21,12 +21,10 @@ namespace MWGui
|
|||||||
{
|
{
|
||||||
using namespace MyGUI;
|
using namespace MyGUI;
|
||||||
|
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
|
||||||
|
|
||||||
class RaceDialog : public OEngine::GUI::Layout
|
class RaceDialog : public OEngine::GUI::Layout
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RaceDialog(MWWorld::Environment& environment, bool showNext);
|
RaceDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||||
|
|
||||||
enum Gender
|
enum Gender
|
||||||
{
|
{
|
||||||
@ -34,17 +32,21 @@ namespace MWGui
|
|||||||
GM_Female
|
GM_Female
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::string &getRace() const { return currentRace; }
|
const std::string &getRaceId() const { return currentRaceId; }
|
||||||
Gender getGender() const { return genderIndex == 0 ? GM_Male : GM_Female; }
|
Gender getGender() const { return genderIndex == 0 ? GM_Male : GM_Female; }
|
||||||
// getFace()
|
// getFace()
|
||||||
// getHair()
|
// getHair()
|
||||||
|
|
||||||
void setRace(const std::string &race);
|
void setRaceId(const std::string &raceId);
|
||||||
void setGender(Gender gender) { genderIndex = gender == GM_Male ? 0 : 1; }
|
void setGender(Gender gender) { genderIndex = gender == GM_Male ? 0 : 1; }
|
||||||
// setFace()
|
// setFace()
|
||||||
// setHair()
|
// setHair()
|
||||||
|
|
||||||
|
void setNextButtonShow(bool shown);
|
||||||
|
void open();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
|
typedef delegates::CDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Back button clicked.\n
|
/** Event : Back button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
@ -93,7 +95,7 @@ namespace MWGui
|
|||||||
int genderIndex, faceIndex, hairIndex;
|
int genderIndex, faceIndex, hairIndex;
|
||||||
int faceCount, hairCount;
|
int faceCount, hairCount;
|
||||||
|
|
||||||
std::string currentRace;
|
std::string currentRaceId;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -4,32 +4,55 @@
|
|||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
TextInputDialog::TextInputDialog(MWWorld::Environment& environment, const std::string &label, bool showNext, MyGUI::IntSize size)
|
TextInputDialog::TextInputDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||||
: Layout("openmw_text_input_layout.xml")
|
: Layout("openmw_text_input_layout.xml")
|
||||||
, environment(environment)
|
, environment(environment)
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||||
coord.left = (size.width - coord.width)/2;
|
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||||
coord.top = (size.height - coord.height)/2;
|
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||||
mMainWidget->setCoord(coord);
|
mMainWidget->setCoord(coord);
|
||||||
|
|
||||||
setText("LabelT", label);
|
|
||||||
|
|
||||||
getWidget(textEdit, "TextEdit");
|
getWidget(textEdit, "TextEdit");
|
||||||
// textEdit->eventEditSelectAccept = newDelegate(this, &TextInputDialog::onTextAccepted);
|
textEdit->eventEditSelectAccept = newDelegate(this, &TextInputDialog::onTextAccepted);
|
||||||
|
|
||||||
// TODO: These buttons should be managed by a Dialog class
|
// TODO: These buttons should be managed by a Dialog class
|
||||||
MyGUI::ButtonPtr okButton;
|
MyGUI::ButtonPtr okButton;
|
||||||
getWidget(okButton, "OKButton");
|
getWidget(okButton, "OKButton");
|
||||||
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &TextInputDialog::onOkClicked);
|
okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &TextInputDialog::onOkClicked);
|
||||||
if (showNext)
|
|
||||||
|
// Make sure the edit box has focus
|
||||||
|
MyGUI::InputManager::getInstance().setKeyFocusWidget(textEdit);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextInputDialog::setNextButtonShow(bool shown)
|
||||||
|
{
|
||||||
|
MyGUI::ButtonPtr okButton;
|
||||||
|
getWidget(okButton, "OKButton");
|
||||||
|
if (shown)
|
||||||
{
|
{
|
||||||
okButton->setCaption("Next");
|
okButton->setCaption("Next");
|
||||||
|
okButton->setCoord(MyGUI::IntCoord(264 - 18, 60, 42 + 18, 23));
|
||||||
// Adjust back button when next is shown
|
|
||||||
okButton->setCoord(okButton->getCoord() + MyGUI::IntCoord(-18, 0, 18, 0));
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
okButton->setCaption("OK");
|
||||||
|
okButton->setCoord(MyGUI::IntCoord(264, 60, 42, 23));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextInputDialog::setTextLabel(const std::string &label)
|
||||||
|
{
|
||||||
|
setText("LabelT", label);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextInputDialog::open()
|
||||||
|
{
|
||||||
|
// Make sure the edit box has focus
|
||||||
|
MyGUI::InputManager::getInstance().setKeyFocusWidget(textEdit);
|
||||||
|
textEdit->setOnlyText("");
|
||||||
|
setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// widget controls
|
// widget controls
|
||||||
|
@ -15,17 +15,20 @@ namespace MWGui
|
|||||||
{
|
{
|
||||||
using namespace MyGUI;
|
using namespace MyGUI;
|
||||||
|
|
||||||
typedef delegates::CDelegate0 EventHandle_Void;
|
|
||||||
|
|
||||||
class TextInputDialog : public OEngine::GUI::Layout
|
class TextInputDialog : public OEngine::GUI::Layout
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TextInputDialog(MWWorld::Environment& environment, const std::string &label, bool showNext, MyGUI::IntSize size);
|
TextInputDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||||
|
|
||||||
std::string getTextInput() const { return textEdit ? textEdit->getOnlyText() : ""; }
|
std::string getTextInput() const { return textEdit ? textEdit->getOnlyText() : ""; }
|
||||||
void setTextInput(const std::string &text) { if (textEdit) textEdit->setOnlyText(text); }
|
void setTextInput(const std::string &text) { if (textEdit) textEdit->setOnlyText(text); }
|
||||||
|
|
||||||
|
void setNextButtonShow(bool shown);
|
||||||
|
void setTextLabel(const std::string &label);
|
||||||
|
void open();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
|
typedef delegates::CDelegate0 EventHandle_Void;
|
||||||
|
|
||||||
/** Event : Dialog finished, OK button clicked.\n
|
/** Event : Dialog finished, OK button clicked.\n
|
||||||
signature : void method()\n
|
signature : void method()\n
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "race.hpp"
|
#include "race.hpp"
|
||||||
|
|
||||||
#include "../mwmechanics/mechanicsmanager.hpp"
|
#include "../mwmechanics/mechanicsmanager.hpp"
|
||||||
|
#include "../mwinput/inputmanager.hpp"
|
||||||
|
|
||||||
#include "console.hpp"
|
#include "console.hpp"
|
||||||
|
|
||||||
@ -37,7 +38,9 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment
|
|||||||
menu = new MainMenu(w,h);
|
menu = new MainMenu(w,h);
|
||||||
map = new MapWindow();
|
map = new MapWindow();
|
||||||
stats = new StatsWindow (environment.mWorld->getStore());
|
stats = new StatsWindow (environment.mWorld->getStore());
|
||||||
|
#if 0
|
||||||
inventory = new InventoryWindow ();
|
inventory = new InventoryWindow ();
|
||||||
|
#endif
|
||||||
console = new Console(w,h, environment, extensions);
|
console = new Console(w,h, environment, extensions);
|
||||||
|
|
||||||
// The HUD is always on
|
// The HUD is always on
|
||||||
@ -54,7 +57,9 @@ WindowManager::~WindowManager()
|
|||||||
delete map;
|
delete map;
|
||||||
delete menu;
|
delete menu;
|
||||||
delete stats;
|
delete stats;
|
||||||
|
#if 0
|
||||||
delete inventory;
|
delete inventory;
|
||||||
|
#endif
|
||||||
|
|
||||||
delete nameDialog;
|
delete nameDialog;
|
||||||
delete raceDialog;
|
delete raceDialog;
|
||||||
@ -66,7 +71,9 @@ void WindowManager::updateVisible()
|
|||||||
map->setVisible(false);
|
map->setVisible(false);
|
||||||
menu->setVisible(false);
|
menu->setVisible(false);
|
||||||
stats->setVisible(false);
|
stats->setVisible(false);
|
||||||
|
#if 0
|
||||||
inventory->setVisible(false);
|
inventory->setVisible(false);
|
||||||
|
#endif
|
||||||
console->disable();
|
console->disable();
|
||||||
|
|
||||||
// Mouse is visible whenever we're not in game mode
|
// Mouse is visible whenever we're not in game mode
|
||||||
@ -94,19 +101,24 @@ void WindowManager::updateVisible()
|
|||||||
if (mode == GM_Name)
|
if (mode == GM_Name)
|
||||||
{
|
{
|
||||||
if (!nameDialog)
|
if (!nameDialog)
|
||||||
nameDialog = new TextInputDialog(environment, "Name", nameChosen, gui->getViewSize());
|
nameDialog = new TextInputDialog(environment, gui->getViewSize());
|
||||||
|
|
||||||
|
std::string sName = getGameSettingString("sName", "Name");
|
||||||
|
nameDialog->setTextLabel(sName);
|
||||||
|
nameDialog->setNextButtonShow(nameChosen);
|
||||||
nameDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onNameDialogDone);
|
nameDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onNameDialogDone);
|
||||||
nameDialog->setVisible(true);
|
nameDialog->open();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == GM_Race)
|
if (mode == GM_Race)
|
||||||
{
|
{
|
||||||
if (!raceDialog)
|
if (!raceDialog)
|
||||||
raceDialog = new RaceDialog (environment, raceChosen);
|
raceDialog = new RaceDialog(environment, gui->getViewSize());
|
||||||
|
raceDialog->setNextButtonShow(raceChosen);
|
||||||
raceDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onRaceDialogDone);
|
raceDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onRaceDialogDone);
|
||||||
raceDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onRaceDialogBack);
|
raceDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onRaceDialogBack);
|
||||||
raceDialog->setVisible(true);
|
raceDialog->open();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,14 +131,18 @@ void WindowManager::updateVisible()
|
|||||||
int eff = shown & allowed;
|
int eff = shown & allowed;
|
||||||
|
|
||||||
// Show the windows we want
|
// Show the windows we want
|
||||||
map -> setVisible( eff & GW_Map );
|
map -> setVisible( (eff & GW_Map) != 0 );
|
||||||
stats -> setVisible( eff & GW_Stats );
|
stats -> setVisible( (eff & GW_Stats) != 0 );
|
||||||
|
#if 0
|
||||||
// inventory -> setVisible( eff & GW_Inventory );
|
// inventory -> setVisible( eff & GW_Inventory );
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// All other modes are ignored
|
// Unsupported mode, switch back to game
|
||||||
mode = GM_Game;
|
// Note: The call will eventually end up this method again but
|
||||||
|
// will stop at the check if(mode == GM_Game) above.
|
||||||
|
environment.mInputManager->setGuiMode(GM_Game);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::setValue (const std::string& id, const MWMechanics::Stat<int>& value)
|
void WindowManager::setValue (const std::string& id, const MWMechanics::Stat<int>& value)
|
||||||
@ -162,6 +178,14 @@ void WindowManager::messageBox (const std::string& message, const std::vector<st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::string &WindowManager::getGameSettingString(const std::string &id, const std::string &default)
|
||||||
|
{
|
||||||
|
const ESM::GameSetting *setting = environment.mWorld->getStore().gameSettings.search(id);
|
||||||
|
if (setting && setting->type == ESM::VT_String)
|
||||||
|
return setting->str;
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
|
||||||
void WindowManager::updateCharacterGeneration()
|
void WindowManager::updateCharacterGeneration()
|
||||||
{
|
{
|
||||||
if (raceDialog)
|
if (raceDialog)
|
||||||
@ -175,40 +199,46 @@ void WindowManager::updateCharacterGeneration()
|
|||||||
|
|
||||||
void WindowManager::onNameDialogDone()
|
void WindowManager::onNameDialogDone()
|
||||||
{
|
{
|
||||||
|
nameDialog->eventDone = MWGui::TextInputDialog::EventHandle_Void();
|
||||||
|
|
||||||
|
bool goNext = nameChosen; // Go to next dialog if name was previously chosen
|
||||||
nameChosen = true;
|
nameChosen = true;
|
||||||
if (nameDialog)
|
if (nameDialog)
|
||||||
{
|
{
|
||||||
nameDialog->setVisible(false);
|
nameDialog->setVisible(false);
|
||||||
environment.mMechanicsManager->setPlayerName(nameDialog->getTextInput());
|
environment.mMechanicsManager->setPlayerName(nameDialog->getTextInput());
|
||||||
}
|
}
|
||||||
delete nameDialog;
|
|
||||||
nameDialog = nullptr;
|
|
||||||
|
|
||||||
updateCharacterGeneration();
|
updateCharacterGeneration();
|
||||||
|
|
||||||
if (reviewNext)
|
if (reviewNext)
|
||||||
setMode(GM_Review);
|
environment.mInputManager->setGuiMode(GM_Review);
|
||||||
else if (raceChosen)
|
else if (goNext)
|
||||||
setMode(GM_Race);
|
environment.mInputManager->setGuiMode(GM_Race);
|
||||||
|
else
|
||||||
|
environment.mInputManager->setGuiMode(GM_Game);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::onRaceDialogDone()
|
void WindowManager::onRaceDialogDone()
|
||||||
{
|
{
|
||||||
|
raceDialog->eventDone = MWGui::RaceDialog::EventHandle_Void();
|
||||||
|
|
||||||
|
bool goNext = raceChosen; // Go to next dialog if race was previously chosen
|
||||||
raceChosen = true;
|
raceChosen = true;
|
||||||
if (raceDialog)
|
if (raceDialog)
|
||||||
{
|
{
|
||||||
raceDialog->setVisible(false);
|
raceDialog->setVisible(false);
|
||||||
environment.mMechanicsManager->setPlayerRace(raceDialog->getRace(), raceDialog->getGender() == RaceDialog::GM_Male);
|
environment.mMechanicsManager->setPlayerRace(raceDialog->getRaceId(), raceDialog->getGender() == RaceDialog::GM_Male);
|
||||||
}
|
}
|
||||||
delete raceDialog;
|
|
||||||
raceDialog = nullptr;
|
|
||||||
|
|
||||||
updateCharacterGeneration();
|
updateCharacterGeneration();
|
||||||
|
|
||||||
if (reviewNext)
|
if (reviewNext)
|
||||||
setMode(GM_Review);
|
environment.mInputManager->setGuiMode(GM_Review);
|
||||||
else if (classChosen)
|
else if (goNext)
|
||||||
setMode(GM_Class);
|
environment.mInputManager->setGuiMode(GM_Class);
|
||||||
|
else
|
||||||
|
environment.mInputManager->setGuiMode(GM_Game);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::onRaceDialogBack()
|
void WindowManager::onRaceDialogBack()
|
||||||
@ -216,12 +246,10 @@ void WindowManager::onRaceDialogBack()
|
|||||||
if (raceDialog)
|
if (raceDialog)
|
||||||
{
|
{
|
||||||
raceDialog->setVisible(false);
|
raceDialog->setVisible(false);
|
||||||
environment.mMechanicsManager->setPlayerRace(raceDialog->getRace(), raceDialog->getGender() == RaceDialog::GM_Male);
|
environment.mMechanicsManager->setPlayerRace(raceDialog->getRaceId(), raceDialog->getGender() == RaceDialog::GM_Male);
|
||||||
}
|
}
|
||||||
delete raceDialog;
|
|
||||||
raceDialog = nullptr;
|
|
||||||
|
|
||||||
updateCharacterGeneration();
|
updateCharacterGeneration();
|
||||||
|
|
||||||
setMode(GM_Name);
|
environment.mInputManager->setGuiMode(GM_Name);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "../mwmechanics/stat.hpp"
|
#include "../mwmechanics/stat.hpp"
|
||||||
|
#include "mode.hpp"
|
||||||
|
|
||||||
namespace MyGUI
|
namespace MyGUI
|
||||||
{
|
{
|
||||||
@ -42,42 +43,6 @@ namespace MWGui
|
|||||||
class TextInputDialog;
|
class TextInputDialog;
|
||||||
class RaceDialog;
|
class RaceDialog;
|
||||||
|
|
||||||
enum GuiMode
|
|
||||||
{
|
|
||||||
GM_Game, // Game mode, only HUD
|
|
||||||
GM_Inventory, // Inventory mode
|
|
||||||
GM_MainMenu, // Main menu mode
|
|
||||||
|
|
||||||
GM_Console, // Console mode
|
|
||||||
|
|
||||||
// None of the following are implemented yet
|
|
||||||
|
|
||||||
GM_Dialogue, // NPC interaction
|
|
||||||
GM_Barter,
|
|
||||||
GM_Rest,
|
|
||||||
// .. more here ..
|
|
||||||
|
|
||||||
// Startup character creation dialogs
|
|
||||||
GM_Name,
|
|
||||||
GM_Race,
|
|
||||||
GM_Birth,
|
|
||||||
GM_Class,
|
|
||||||
GM_Review
|
|
||||||
};
|
|
||||||
|
|
||||||
// Windows shown in inventory mode
|
|
||||||
enum GuiWindow
|
|
||||||
{
|
|
||||||
GW_None = 0,
|
|
||||||
|
|
||||||
GW_Map = 0x01,
|
|
||||||
GW_Inventory = 0x02,
|
|
||||||
GW_Magic = 0x04,
|
|
||||||
GW_Stats = 0x08,
|
|
||||||
|
|
||||||
GW_ALL = 0xFF
|
|
||||||
};
|
|
||||||
|
|
||||||
class WindowManager
|
class WindowManager
|
||||||
{
|
{
|
||||||
MWWorld::Environment& environment;
|
MWWorld::Environment& environment;
|
||||||
@ -85,7 +50,9 @@ namespace MWGui
|
|||||||
MapWindow *map;
|
MapWindow *map;
|
||||||
MainMenu *menu;
|
MainMenu *menu;
|
||||||
StatsWindow *stats;
|
StatsWindow *stats;
|
||||||
|
#if 0
|
||||||
InventoryWindow *inventory;
|
InventoryWindow *inventory;
|
||||||
|
#endif
|
||||||
Console *console;
|
Console *console;
|
||||||
|
|
||||||
// Character creation
|
// Character creation
|
||||||
@ -172,6 +139,15 @@ namespace MWGui
|
|||||||
|
|
||||||
void messageBox (const std::string& message, const std::vector<std::string>& buttons);
|
void messageBox (const std::string& message, const std::vector<std::string>& buttons);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches a GMST string from the store, if there is no setting with the given
|
||||||
|
* ID or it is not a string the default string is returned.
|
||||||
|
*
|
||||||
|
* @param id Identifier for the GMST setting, e.g. "aName"
|
||||||
|
* @param default Default value if the GMST setting cannot be used.
|
||||||
|
*/
|
||||||
|
const std::string &getGameSettingString(const std::string &id, const std::string &default);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateCharacterGeneration();
|
void updateCharacterGeneration();
|
||||||
void checkCharacterGeneration(GuiMode mode);
|
void checkCharacterGeneration(GuiMode mode);
|
||||||
|
@ -79,34 +79,6 @@ namespace MWInput
|
|||||||
ogre.screenshot(buf);
|
ogre.screenshot(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch between gui modes. Besides controlling the Gui windows
|
|
||||||
// this also makes sure input is directed to the right place
|
|
||||||
void setGuiMode(MWGui::GuiMode mode)
|
|
||||||
{
|
|
||||||
// Tell the GUI what to show (this also takes care of the mouse
|
|
||||||
// pointer)
|
|
||||||
windows.setMode(mode);
|
|
||||||
|
|
||||||
// Are we in GUI mode now?
|
|
||||||
if(windows.isGuiMode())
|
|
||||||
{
|
|
||||||
// Disable mouse look
|
|
||||||
mouse->setCamera(NULL);
|
|
||||||
|
|
||||||
// Enable GUI events
|
|
||||||
guiEvents->enabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Start mouse-looking again. TODO: This should also allow
|
|
||||||
// for other ways to disable mouselook, like paralyzation.
|
|
||||||
mouse->setCamera(player.getCamera());
|
|
||||||
|
|
||||||
// Disable GUI events
|
|
||||||
guiEvents->enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the user presses the button to toggle the inventory
|
// Called when the user presses the button to toggle the inventory
|
||||||
// screen.
|
// screen.
|
||||||
void toggleInventory()
|
void toggleInventory()
|
||||||
@ -275,6 +247,34 @@ namespace MWInput
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Switch between gui modes. Besides controlling the Gui windows
|
||||||
|
// this also makes sure input is directed to the right place
|
||||||
|
void setGuiMode(MWGui::GuiMode mode)
|
||||||
|
{
|
||||||
|
// Tell the GUI what to show (this also takes care of the mouse
|
||||||
|
// pointer)
|
||||||
|
windows.setMode(mode);
|
||||||
|
|
||||||
|
// Are we in GUI mode now?
|
||||||
|
if(windows.isGuiMode())
|
||||||
|
{
|
||||||
|
// Disable mouse look
|
||||||
|
mouse->setCamera(NULL);
|
||||||
|
|
||||||
|
// Enable GUI events
|
||||||
|
guiEvents->enabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Start mouse-looking again. TODO: This should also allow
|
||||||
|
// for other ways to disable mouselook, like paralyzation.
|
||||||
|
mouse->setCamera(player.getCamera());
|
||||||
|
|
||||||
|
// Disable GUI events
|
||||||
|
guiEvents->enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MWInputManager::MWInputManager(OEngine::Render::OgreRenderer &ogre,
|
MWInputManager::MWInputManager(OEngine::Render::OgreRenderer &ogre,
|
||||||
@ -290,4 +290,9 @@ namespace MWInput
|
|||||||
{
|
{
|
||||||
delete impl;
|
delete impl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MWInputManager::setGuiMode(MWGui::GuiMode mode)
|
||||||
|
{
|
||||||
|
impl->setGuiMode(mode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#ifndef _MWINPUT_MWINPUTMANAGER_H
|
#ifndef _MWINPUT_MWINPUTMANAGER_H
|
||||||
#define _MWINPUT_MWINPUTMANAGER_H
|
#define _MWINPUT_MWINPUTMANAGER_H
|
||||||
|
|
||||||
|
#include "../mwgui/mode.hpp"
|
||||||
|
|
||||||
namespace OEngine
|
namespace OEngine
|
||||||
{
|
{
|
||||||
namespace Render
|
namespace Render
|
||||||
@ -45,6 +47,8 @@ namespace MWInput
|
|||||||
bool debug,
|
bool debug,
|
||||||
OMW::Engine& engine);
|
OMW::Engine& engine);
|
||||||
~MWInputManager();
|
~MWInputManager();
|
||||||
|
|
||||||
|
void setGuiMode(MWGui::GuiMode mode);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <components/interpreter/opcodes.hpp>
|
#include <components/interpreter/opcodes.hpp>
|
||||||
|
|
||||||
#include "../mwgui/window_manager.hpp"
|
#include "../mwgui/window_manager.hpp"
|
||||||
|
#include "../mwinput/inputmanager.hpp"
|
||||||
|
|
||||||
#include "interpretercontext.hpp"
|
#include "interpretercontext.hpp"
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ namespace MWScript
|
|||||||
InterpreterContext& context =
|
InterpreterContext& context =
|
||||||
static_cast<InterpreterContext&> (runtime.getContext());
|
static_cast<InterpreterContext&> (runtime.getContext());
|
||||||
|
|
||||||
context.getWindowManager().setMode(mDialogue);
|
context.getInputManager().setGuiMode(mDialogue);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
#include "../mwgui/window_manager.hpp"
|
#include "../mwgui/window_manager.hpp"
|
||||||
|
|
||||||
|
#include "../mwinput/inputmanager.hpp"
|
||||||
|
|
||||||
#include "locals.hpp"
|
#include "locals.hpp"
|
||||||
#include "globalscripts.hpp"
|
#include "globalscripts.hpp"
|
||||||
|
|
||||||
@ -263,6 +265,11 @@ namespace MWScript
|
|||||||
return *mEnvironment.mWindowManager;
|
return *mEnvironment.mWindowManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MWInput::MWInputManager& InterpreterContext::getInputManager()
|
||||||
|
{
|
||||||
|
return *mEnvironment.mInputManager;
|
||||||
|
}
|
||||||
|
|
||||||
MWWorld::World& InterpreterContext::getWorld()
|
MWWorld::World& InterpreterContext::getWorld()
|
||||||
{
|
{
|
||||||
return *mEnvironment.mWorld;
|
return *mEnvironment.mWorld;
|
||||||
|
@ -15,6 +15,11 @@ namespace MWSound
|
|||||||
class SoundManager;
|
class SoundManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace MWInput
|
||||||
|
{
|
||||||
|
struct MWInputManager;
|
||||||
|
}
|
||||||
|
|
||||||
namespace MWScript
|
namespace MWScript
|
||||||
{
|
{
|
||||||
struct Locals;
|
struct Locals;
|
||||||
@ -107,6 +112,8 @@ namespace MWScript
|
|||||||
|
|
||||||
MWGui::WindowManager& getWindowManager();
|
MWGui::WindowManager& getWindowManager();
|
||||||
|
|
||||||
|
MWInput::MWInputManager& getInputManager();
|
||||||
|
|
||||||
MWWorld::Ptr getReference();
|
MWWorld::Ptr getReference();
|
||||||
///< Reference, that the script is running from (can be empty)
|
///< Reference, that the script is running from (can be empty)
|
||||||
};
|
};
|
||||||
|
@ -26,6 +26,11 @@ namespace MWDialogue
|
|||||||
class DialogueManager;
|
class DialogueManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace MWInput
|
||||||
|
{
|
||||||
|
struct MWInputManager;
|
||||||
|
}
|
||||||
|
|
||||||
namespace MWWorld
|
namespace MWWorld
|
||||||
{
|
{
|
||||||
class World;
|
class World;
|
||||||
@ -36,7 +41,8 @@ namespace MWWorld
|
|||||||
public:
|
public:
|
||||||
Environment()
|
Environment()
|
||||||
: mWorld (0), mSoundManager (0), mGlobalScripts (0), mWindowManager (0),
|
: mWorld (0), mSoundManager (0), mGlobalScripts (0), mWindowManager (0),
|
||||||
mMechanicsManager (0), mDialogueManager (0), mFrameDuration (0)
|
mMechanicsManager (0), mDialogueManager (0), mFrameDuration (0),
|
||||||
|
mInputManager (0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
World *mWorld;
|
World *mWorld;
|
||||||
@ -46,6 +52,9 @@ namespace MWWorld
|
|||||||
MWMechanics::MechanicsManager *mMechanicsManager;
|
MWMechanics::MechanicsManager *mMechanicsManager;
|
||||||
MWDialogue::DialogueManager *mDialogueManager;
|
MWDialogue::DialogueManager *mDialogueManager;
|
||||||
float mFrameDuration;
|
float mFrameDuration;
|
||||||
|
|
||||||
|
// For setting GUI mode
|
||||||
|
MWInput::MWInputManager *mInputManager;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ struct Skill
|
|||||||
HandToHand = 26,
|
HandToHand = 26,
|
||||||
Length
|
Length
|
||||||
};
|
};
|
||||||
static const std::string sSkillNames[Length];
|
static const std::string sSkillNameIds[Length];
|
||||||
|
|
||||||
void load(ESMReader &esm)
|
void load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
|
@ -2,33 +2,33 @@
|
|||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
const std::string Skill::sSkillNames[Length] = {
|
const std::string Skill::sSkillNameIds[Length] = {
|
||||||
"Block",
|
"sSkillBlock",
|
||||||
"Armorer",
|
"sSkillArmorer",
|
||||||
"Medium Armor",
|
"sSkillMediumarmor",
|
||||||
"Heavy Armor",
|
"sSkillHeavyarmor",
|
||||||
"Blunt Weapon",
|
"sSkillBluntweapon",
|
||||||
"Long Blade",
|
"sSkillLongblade",
|
||||||
"Axe",
|
"sSkillAxe",
|
||||||
"Spear",
|
"sSkillSpear",
|
||||||
"Athletics",
|
"sSkillAthletics",
|
||||||
"Enchant",
|
"sSkillEnchant",
|
||||||
"Destruction",
|
"sSkillDestruction",
|
||||||
"Alteration",
|
"sSkillAlteration",
|
||||||
"Illusion",
|
"sSkillIllusion",
|
||||||
"Conjuration",
|
"sSkillConjuration",
|
||||||
"Mysticism",
|
"sSkillMysticism",
|
||||||
"Restoration",
|
"sSkillRestoration",
|
||||||
"Alchemy",
|
"sSkillAlchemy",
|
||||||
"Unarmored",
|
"sSkillUnarmored",
|
||||||
"Security",
|
"sSkillSecurity",
|
||||||
"Sneak",
|
"sSkillSneak",
|
||||||
"Acrobatics",
|
"sSkillAcrobatics",
|
||||||
"Light Armor",
|
"sSkillLightarmor",
|
||||||
"Short Blade",
|
"sSkillShortblade",
|
||||||
"Marksman",
|
"sSkillMarksman",
|
||||||
"Mercantile",
|
"sSkillMercantile",
|
||||||
"Speechcraft",
|
"sSkillSpeechcraft",
|
||||||
"Hand To Hand",
|
"sSkillHandtohand",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user