2010-10-20 21:40:32 +02:00
|
|
|
#ifndef MWGUI_REVIEW_H
|
|
|
|
#define MWGUI_REVIEW_H
|
|
|
|
|
2010-10-21 09:28:09 +02:00
|
|
|
#include "widgets.hpp"
|
2013-04-10 00:32:05 -04:00
|
|
|
#include "windowbase.hpp"
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
#include <components/esm/refid.hpp>
|
2022-01-22 15:58:41 +01:00
|
|
|
#include <components/esm3/loadclas.hpp>
|
2010-10-20 21:40:32 +02:00
|
|
|
|
2016-11-18 17:59:05 +01:00
|
|
|
namespace ESM
|
|
|
|
{
|
2016-11-20 15:10:37 +01:00
|
|
|
struct Spell;
|
2016-11-18 17:59:05 +01:00
|
|
|
}
|
|
|
|
|
2010-10-20 21:40:32 +02:00
|
|
|
namespace MWGui
|
|
|
|
{
|
2013-02-25 06:57:32 +01:00
|
|
|
class ReviewDialog : public WindowModal
|
2010-10-20 21:40:32 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-01-02 16:43:13 +01:00
|
|
|
enum Dialogs
|
|
|
|
{
|
|
|
|
NAME_DIALOG,
|
|
|
|
RACE_DIALOG,
|
|
|
|
CLASS_DIALOG,
|
|
|
|
BIRTHSIGN_DIALOG
|
|
|
|
};
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2013-04-10 14:46:21 -04:00
|
|
|
ReviewDialog();
|
2010-10-20 21:40:32 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
bool exit() override { return false; }
|
2017-09-23 12:18:39 +02:00
|
|
|
|
2010-10-21 09:28:09 +02:00
|
|
|
void setPlayerName(const std::string& name);
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
void setRace(const ESM::RefId& raceId);
|
2024-01-07 19:10:09 +04:00
|
|
|
void setClass(const ESM::Class& playerClass);
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
void setBirthSign(const ESM::RefId& signId);
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2012-09-15 17:12:42 +02:00
|
|
|
void setHealth(const MWMechanics::DynamicStat<float>& value);
|
|
|
|
void setMagicka(const MWMechanics::DynamicStat<float>& value);
|
|
|
|
void setFatigue(const MWMechanics::DynamicStat<float>& value);
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2023-08-03 20:21:44 +02:00
|
|
|
void setAttribute(ESM::RefId attributeId, const MWMechanics::AttributeValue& value);
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2023-06-06 19:17:03 +02:00
|
|
|
void configureSkills(const std::vector<ESM::RefId>& major, const std::vector<ESM::RefId>& minor);
|
2023-06-06 12:35:01 +02:00
|
|
|
void setSkillValue(ESM::RefId id, const MWMechanics::SkillValue& value);
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void onOpen() override;
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void onFrame(float duration) override;
|
2016-11-18 17:59:05 +01:00
|
|
|
|
2010-10-20 21:40:32 +02:00
|
|
|
// Events
|
2023-07-15 15:02:27 +02:00
|
|
|
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
|
|
|
|
typedef MyGUI::delegates::MultiDelegate<int> EventHandle_Int;
|
2010-10-20 21:40:32 +02:00
|
|
|
|
|
|
|
/** Event : Back button clicked.\n
|
|
|
|
signature : void method()\n
|
|
|
|
*/
|
|
|
|
EventHandle_Void eventBack;
|
|
|
|
|
2014-09-07 03:21:24 +02:00
|
|
|
/** Event : Dialog finished, OK button clicked.\n
|
|
|
|
signature : void method()\n
|
|
|
|
*/
|
|
|
|
EventHandle_WindowBase eventDone;
|
|
|
|
|
2011-01-02 16:43:13 +01:00
|
|
|
EventHandle_Int eventActivateDialog;
|
2010-10-23 01:00:07 +02:00
|
|
|
|
2010-10-20 21:40:32 +02:00
|
|
|
protected:
|
|
|
|
void onOkClicked(MyGUI::Widget* _sender);
|
|
|
|
void onBackClicked(MyGUI::Widget* _sender);
|
|
|
|
|
2010-10-23 01:00:07 +02:00
|
|
|
void onNameClicked(MyGUI::Widget* _sender);
|
|
|
|
void onRaceClicked(MyGUI::Widget* _sender);
|
|
|
|
void onClassClicked(MyGUI::Widget* _sender);
|
|
|
|
void onBirthSignClicked(MyGUI::Widget* _sender);
|
|
|
|
|
2012-05-27 06:39:10 +02:00
|
|
|
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
|
|
|
|
2010-10-20 21:40:32 +02:00
|
|
|
private:
|
2023-06-06 19:17:03 +02:00
|
|
|
void addSkills(const std::vector<ESM::RefId>& skills, const std::string& titleId,
|
|
|
|
const std::string& titleDefault, MyGUI::IntCoord& coord1, MyGUI::IntCoord& coord2);
|
2010-10-21 09:28:09 +02:00
|
|
|
void addSeparator(MyGUI::IntCoord& coord1, MyGUI::IntCoord& coord2);
|
2022-08-24 22:16:03 +02:00
|
|
|
void addGroup(std::string_view label, MyGUI::IntCoord& coord1, MyGUI::IntCoord& coord2);
|
|
|
|
MyGUI::TextBox* addValueItem(std::string_view text, const std::string& value, const std::string& state,
|
|
|
|
MyGUI::IntCoord& coord1, MyGUI::IntCoord& coord2);
|
2012-06-06 20:29:30 +02:00
|
|
|
void addItem(const std::string& text, MyGUI::IntCoord& coord1, MyGUI::IntCoord& coord2);
|
2016-11-18 17:59:05 +01:00
|
|
|
void addItem(const ESM::Spell* spell, MyGUI::IntCoord& coord1, MyGUI::IntCoord& coord2);
|
2010-10-23 00:11:54 +02:00
|
|
|
void updateSkillArea();
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2012-07-13 03:51:58 -07:00
|
|
|
MyGUI::TextBox *mNameWidget, *mRaceWidget, *mClassWidget, *mBirthSignWidget;
|
2012-09-10 13:39:22 +02:00
|
|
|
MyGUI::ScrollView* mSkillView;
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2012-07-13 03:51:58 -07:00
|
|
|
Widgets::MWDynamicStatPtr mHealth, mMagicka, mFatigue;
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2023-08-03 20:21:44 +02:00
|
|
|
std::map<ESM::RefId, Widgets::MWAttributePtr> mAttributeWidgets;
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2023-06-06 19:17:03 +02:00
|
|
|
std::vector<ESM::RefId> mMajorSkills, mMinorSkills, mMiscSkills;
|
2023-06-05 21:21:30 +02:00
|
|
|
std::map<ESM::RefId, MWMechanics::SkillValue> mSkillValues;
|
2023-06-06 12:35:01 +02:00
|
|
|
std::map<ESM::RefId, MyGUI::TextBox*> mSkillWidgetMap;
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
ESM::RefId mRaceId, mBirthSignId;
|
|
|
|
std::string mName;
|
2024-01-07 19:10:09 +04:00
|
|
|
ESM::Class mClass;
|
2013-03-03 13:11:02 +01:00
|
|
|
std::vector<MyGUI::Widget*> mSkillWidgets; //< Skills and other information
|
2016-11-18 17:59:05 +01:00
|
|
|
|
|
|
|
bool mUpdateSkillArea;
|
2010-10-20 21:40:32 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|