forked from mirror/openmw-tes3mp
Added possibility to configure stat page to show factions, birth sign as well as reputation and bounty.
This commit is contained in:
parent
9683a7094d
commit
41ef0bc08f
4 changed files with 85 additions and 18 deletions
|
@ -15,8 +15,16 @@ void StatsWindow::configureSkills (const std::set<int>& major, const std::set<in
|
||||||
majorSkills = major;
|
majorSkills = major;
|
||||||
minorSkills = minor;
|
minorSkills = minor;
|
||||||
miscSkills = misc;
|
miscSkills = misc;
|
||||||
|
}
|
||||||
|
|
||||||
updateSkillArea();
|
void StatsWindow::configureFactions (const std::vector<std::string>& factions)
|
||||||
|
{
|
||||||
|
this->factions = factions;
|
||||||
|
}
|
||||||
|
|
||||||
|
void StatsWindow::configureBirthSign (const std::string& signId)
|
||||||
|
{
|
||||||
|
birthSignId = signId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatsWindow::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
void StatsWindow::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||||
|
@ -137,25 +145,38 @@ void StatsWindow::updateSkillArea()
|
||||||
addSkills(miscSkills, "sSkillClassMisc", "Misc Skills", coord1, coord2);
|
addSkills(miscSkills, "sSkillClassMisc", "Misc Skills", coord1, coord2);
|
||||||
|
|
||||||
WindowManager *wm = environment.mWindowManager;
|
WindowManager *wm = environment.mWindowManager;
|
||||||
|
ESMS::ESMStore &store = environment.mWorld->getStore();
|
||||||
|
|
||||||
|
if (!factions.empty())
|
||||||
|
{
|
||||||
|
// Add a line separator if there are items above
|
||||||
|
if (!skillWidgets.empty())
|
||||||
|
addSeparator(coord1, coord2);
|
||||||
|
|
||||||
|
addGroup(wm->getGameSettingString("sFaction", "Faction"), coord1, coord2);
|
||||||
|
std::vector<std::string>::const_iterator end = factions.end();
|
||||||
|
for (std::vector<std::string>::const_iterator it = factions.begin(); it != end; ++it)
|
||||||
|
{
|
||||||
|
const ESM::Faction *faction = store.factions.find(*it);
|
||||||
|
addItem(faction->name, coord1, coord2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!birthSignId.empty())
|
||||||
|
{
|
||||||
|
// Add a line separator if there are items above
|
||||||
|
if (!skillWidgets.empty())
|
||||||
|
addSeparator(coord1, coord2);
|
||||||
|
|
||||||
|
addGroup(wm->getGameSettingString("sSign", "Sign"), coord1, coord2);
|
||||||
|
const ESM::BirthSign *sign = store.birthSigns.find(birthSignId);
|
||||||
|
addItem(sign->name, coord1, coord2);
|
||||||
|
}
|
||||||
|
|
||||||
// Add a line separator if there are items above
|
// Add a line separator if there are items above
|
||||||
if (!skillWidgets.empty())
|
if (!skillWidgets.empty())
|
||||||
addSeparator(coord1, coord2);
|
addSeparator(coord1, coord2);
|
||||||
|
|
||||||
addGroup(wm->getGameSettingString("sFaction", "Faction"), coord1, coord2);
|
addValueItem(wm->getGameSettingString("sReputation", "Reputation"), boost::lexical_cast<std::string>(static_cast<int>(reputation)), CS_Normal, coord1, coord2);
|
||||||
addItem("Temple", coord1, coord2);
|
addValueItem(wm->getGameSettingString("sBounty", "Bounty"), boost::lexical_cast<std::string>(static_cast<int>(bounty)), CS_Normal, coord1, coord2);
|
||||||
|
|
||||||
// Add a line separator if there are items above
|
|
||||||
if (!skillWidgets.empty())
|
|
||||||
addSeparator(coord1, coord2);
|
|
||||||
|
|
||||||
addGroup(wm->getGameSettingString("sSign", "Sign"), coord1, coord2);
|
|
||||||
addItem("The Mage", coord1, coord2);
|
|
||||||
|
|
||||||
// Add a line separator if there are items above
|
|
||||||
if (!skillWidgets.empty())
|
|
||||||
addSeparator(coord1, coord2);
|
|
||||||
|
|
||||||
addValueItem(wm->getGameSettingString("sReputation", "Reputation"), boost::lexical_cast<std::string>(static_cast<int>(0)), CS_Normal, coord1, coord2);
|
|
||||||
addValueItem(wm->getGameSettingString("sBounty", "Bounty"), boost::lexical_cast<std::string>(static_cast<int>(0)), CS_Normal, coord1, coord2);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -294,6 +294,11 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureSkills (const std::set<int>& major, const std::set<int>& minor, const std::set<int>& misc);
|
void configureSkills (const std::set<int>& major, const std::set<int>& minor, const std::set<int>& misc);
|
||||||
|
void configureFactions (const std::vector<std::string>& factions);
|
||||||
|
void configureBirthSign (const std::string &signId);
|
||||||
|
void setReputation (int reputation) { this->reputation = reputation; }
|
||||||
|
void setBounty (int bounty) { this->bounty = bounty; }
|
||||||
|
void updateSkillArea();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum ColorStyle
|
enum ColorStyle
|
||||||
|
@ -302,7 +307,6 @@ namespace MWGui
|
||||||
CS_Normal,
|
CS_Normal,
|
||||||
CS_Super
|
CS_Super
|
||||||
};
|
};
|
||||||
void updateSkillArea();
|
|
||||||
void addSkills(const std::set<int> &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addSkills(const std::set<int> &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||||
|
@ -314,6 +318,9 @@ namespace MWGui
|
||||||
MWWorld::Environment& environment;
|
MWWorld::Environment& environment;
|
||||||
MyGUI::WidgetPtr skillAreaWidget;
|
MyGUI::WidgetPtr skillAreaWidget;
|
||||||
std::set<int> majorSkills, minorSkills, miscSkills;
|
std::set<int> majorSkills, minorSkills, miscSkills;
|
||||||
|
std::vector<std::string> factions;
|
||||||
|
std::string birthSignId;
|
||||||
|
int reputation, bounty;
|
||||||
std::vector<MyGUI::WidgetPtr> skillWidgets; //< Skills and other information
|
std::vector<MyGUI::WidgetPtr> skillWidgets; //< Skills and other information
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -171,6 +171,31 @@ void WindowManager::configureSkills (const std::set<int>& major, const std::set<
|
||||||
stats->configureSkills (major, minor, misc);
|
stats->configureSkills (major, minor, misc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WindowManager::configureFactions (const std::vector<std::string>& factions)
|
||||||
|
{
|
||||||
|
stats->configureFactions (factions);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowManager::configureBirthSign (const std::string &signId)
|
||||||
|
{
|
||||||
|
stats->configureBirthSign (signId);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowManager::setReputation (int reputation)
|
||||||
|
{
|
||||||
|
stats->setReputation (reputation);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowManager::setBounty (int bounty)
|
||||||
|
{
|
||||||
|
stats->setBounty (bounty);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowManager::updateSkillArea()
|
||||||
|
{
|
||||||
|
stats->updateSkillArea();
|
||||||
|
}
|
||||||
|
|
||||||
void WindowManager::messageBox (const std::string& message, const std::vector<std::string>& buttons)
|
void WindowManager::messageBox (const std::string& message, const std::vector<std::string>& buttons)
|
||||||
{
|
{
|
||||||
std::cout << "message box: " << message << std::endl;
|
std::cout << "message box: " << message << std::endl;
|
||||||
|
|
|
@ -141,6 +141,20 @@ namespace MWGui
|
||||||
void configureSkills (const std::set<int>& major, const std::set<int>& minor, const std::set<int>& misc);
|
void configureSkills (const std::set<int>& major, const std::set<int>& minor, const std::set<int>& misc);
|
||||||
///< configure skill groups, each set contains the skill ID for that group.
|
///< configure skill groups, each set contains the skill ID for that group.
|
||||||
|
|
||||||
|
void configureFactions (const std::vector<std::string>& factions);
|
||||||
|
///< configure factions to display on stat window, use an empty set to disable
|
||||||
|
|
||||||
|
void configureBirthSign (const std::string &signId);
|
||||||
|
///< configure birth sign to display on stat window, use an empty string to disable.
|
||||||
|
|
||||||
|
void setReputation (int reputation);
|
||||||
|
///< set the current reputation value
|
||||||
|
|
||||||
|
void setBounty (int bounty);
|
||||||
|
///< set the current bounty value
|
||||||
|
|
||||||
|
void updateSkillArea();
|
||||||
|
///< update display of skills, factions, birth sign, reputation and bounty
|
||||||
|
|
||||||
void messageBox (const std::string& message, const std::vector<std::string>& buttons);
|
void messageBox (const std::string& message, const std::vector<std::string>& buttons);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue