mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 12:45:36 +00:00
Removed gameWindowSize parameter from all dialogs that had it, instead this is fetched via the environment variable.
This commit is contained in:
parent
12fe9305a6
commit
025af1717f
11 changed files with 25 additions and 18 deletions
|
@ -11,11 +11,12 @@
|
|||
using namespace MWGui;
|
||||
using namespace Widgets;
|
||||
|
||||
BirthDialog::BirthDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
BirthDialog::BirthDialog(MWWorld::Environment& environment)
|
||||
: Layout("openmw_chargen_birth_layout.xml")
|
||||
, environment(environment)
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize();
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace MWGui
|
|||
class BirthDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
BirthDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
BirthDialog(MWWorld::Environment& environment);
|
||||
|
||||
enum Gender
|
||||
{
|
||||
|
|
|
@ -73,11 +73,12 @@ void GenerateClassResultDialog::onBackClicked(MyGUI::Widget* _sender)
|
|||
|
||||
/* PickClassDialog */
|
||||
|
||||
PickClassDialog::PickClassDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
PickClassDialog::PickClassDialog(MWWorld::Environment& environment)
|
||||
: Layout("openmw_chargen_class_layout.xml")
|
||||
, environment(environment)
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize();
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
|
@ -427,7 +428,7 @@ ClassChoiceDialog::ClassChoiceDialog(MWWorld::Environment& environment)
|
|||
|
||||
/* CreateClassDialog */
|
||||
|
||||
CreateClassDialog::CreateClassDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
CreateClassDialog::CreateClassDialog(MWWorld::Environment& environment)
|
||||
: Layout("openmw_chargen_create_class_layout.xml")
|
||||
, environment(environment)
|
||||
, specDialog(nullptr)
|
||||
|
@ -436,6 +437,7 @@ CreateClassDialog::CreateClassDialog(MWWorld::Environment& environment, MyGUI::I
|
|||
, descDialog(nullptr)
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize();
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace MWGui
|
|||
class PickClassDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
PickClassDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
PickClassDialog(MWWorld::Environment& environment);
|
||||
|
||||
const std::string &getClassId() const { return currentClassId; }
|
||||
void setClassId(const std::string &classId);
|
||||
|
@ -287,7 +287,7 @@ namespace MWGui
|
|||
class CreateClassDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
CreateClassDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
CreateClassDialog(MWWorld::Environment& environment);
|
||||
virtual ~CreateClassDialog();
|
||||
|
||||
std::string getName() const;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
using namespace MWGui;
|
||||
using namespace Widgets;
|
||||
|
||||
RaceDialog::RaceDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
RaceDialog::RaceDialog(MWWorld::Environment& environment)
|
||||
: Layout("openmw_chargen_race_layout.xml")
|
||||
, environment(environment)
|
||||
, genderIndex(0)
|
||||
|
@ -25,6 +25,7 @@ RaceDialog::RaceDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWin
|
|||
, hairCount(14)
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize();
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace MWGui
|
|||
class RaceDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
RaceDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
RaceDialog(MWWorld::Environment& environment);
|
||||
|
||||
enum Gender
|
||||
{
|
||||
|
|
|
@ -13,12 +13,13 @@ using namespace Widgets;
|
|||
|
||||
const int ReviewDialog::lineHeight = 18;
|
||||
|
||||
ReviewDialog::ReviewDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
ReviewDialog::ReviewDialog(MWWorld::Environment& environment)
|
||||
: Layout("openmw_chargen_review_layout.xml")
|
||||
, environment(environment)
|
||||
, lastPos(0)
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize();
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace MWGui
|
|||
public:
|
||||
typedef std::vector<int> SkillList;
|
||||
|
||||
ReviewDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
ReviewDialog(MWWorld::Environment& environment);
|
||||
|
||||
void setPlayerName(const std::string &name);
|
||||
void setRace(const std::string &raceId);
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
#include "text_input.hpp"
|
||||
#include "window_manager.hpp"
|
||||
#include "../mwworld/environment.hpp"
|
||||
#include "../mwworld/world.hpp"
|
||||
|
||||
using namespace MWGui;
|
||||
|
||||
TextInputDialog::TextInputDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
|
||||
TextInputDialog::TextInputDialog(MWWorld::Environment& environment)
|
||||
: Layout("openmw_text_input_layout.xml")
|
||||
, environment(environment)
|
||||
{
|
||||
// Centre dialog
|
||||
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize();
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace MWGui
|
|||
class TextInputDialog : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
TextInputDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize);
|
||||
TextInputDialog(MWWorld::Environment& environment);
|
||||
|
||||
std::string getTextInput() const { return textEdit ? textEdit->getOnlyText() : ""; }
|
||||
void setTextInput(const std::string &text) { if (textEdit) textEdit->setOnlyText(text); }
|
||||
|
|
|
@ -169,7 +169,7 @@ void WindowManager::updateVisible()
|
|||
{
|
||||
if (nameDialog)
|
||||
removeDialog(nameDialog);
|
||||
nameDialog = new TextInputDialog(environment, gui->getViewSize());
|
||||
nameDialog = new TextInputDialog(environment);
|
||||
std::string sName = getGameSettingString("sName", "Name");
|
||||
nameDialog->setTextLabel(sName);
|
||||
nameDialog->setTextInput(playerName);
|
||||
|
@ -183,7 +183,7 @@ void WindowManager::updateVisible()
|
|||
{
|
||||
if (raceDialog)
|
||||
removeDialog(raceDialog);
|
||||
raceDialog = new RaceDialog(environment, gui->getViewSize());
|
||||
raceDialog = new RaceDialog(environment);
|
||||
raceDialog->setNextButtonShow(raceChosen);
|
||||
raceDialog->setRaceId(playerRaceId);
|
||||
raceDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onRaceDialogDone);
|
||||
|
@ -213,7 +213,7 @@ void WindowManager::updateVisible()
|
|||
{
|
||||
if (pickClassDialog)
|
||||
removeDialog(pickClassDialog);
|
||||
pickClassDialog = new PickClassDialog(environment, gui->getViewSize());
|
||||
pickClassDialog = new PickClassDialog(environment);
|
||||
pickClassDialog->setNextButtonShow(classChosen);
|
||||
pickClassDialog->setClassId(playerClass.name);
|
||||
pickClassDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onPickClassDialogDone);
|
||||
|
@ -226,7 +226,7 @@ void WindowManager::updateVisible()
|
|||
{
|
||||
if (createClassDialog)
|
||||
removeDialog(createClassDialog);
|
||||
createClassDialog = new CreateClassDialog(environment, gui->getViewSize());
|
||||
createClassDialog = new CreateClassDialog(environment);
|
||||
createClassDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onCreateClassDialogDone);
|
||||
createClassDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onCreateClassDialogBack);
|
||||
createClassDialog->open();
|
||||
|
@ -237,7 +237,7 @@ void WindowManager::updateVisible()
|
|||
{
|
||||
if (birthSignDialog)
|
||||
removeDialog(birthSignDialog);
|
||||
birthSignDialog = new BirthDialog(environment, gui->getViewSize());
|
||||
birthSignDialog = new BirthDialog(environment);
|
||||
birthSignDialog->setNextButtonShow(birthSignChosen);
|
||||
birthSignDialog->setBirthId(playerBirthSignId);
|
||||
birthSignDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onBirthSignDialogDone);
|
||||
|
@ -251,7 +251,7 @@ void WindowManager::updateVisible()
|
|||
reviewNext = false;
|
||||
if (reviewDialog)
|
||||
removeDialog(reviewDialog);
|
||||
reviewDialog = new ReviewDialog(environment, gui->getViewSize());
|
||||
reviewDialog = new ReviewDialog(environment);
|
||||
reviewDialog->setPlayerName(playerName);
|
||||
reviewDialog->setRace(playerRaceId);
|
||||
reviewDialog->setClass(playerClass);
|
||||
|
|
Loading…
Reference in a new issue