mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Factions now has a rank value in the stats window.
This commit is contained in:
parent
6f1a41c1bd
commit
ccdff570ad
@ -84,7 +84,7 @@ void StatsWindow::configureSkills (const std::set<int>& major, const std::set<in
|
||||
miscSkills = misc;
|
||||
}
|
||||
|
||||
void StatsWindow::configureFactions (const std::vector<std::string>& factions)
|
||||
void StatsWindow::setFactions (const std::vector<Faction>& factions)
|
||||
{
|
||||
this->factions = factions;
|
||||
}
|
||||
@ -212,11 +212,12 @@ void StatsWindow::updateSkillArea()
|
||||
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)
|
||||
FactionList::const_iterator end = factions.end();
|
||||
for (FactionList::const_iterator it = factions.begin(); it != end; ++it)
|
||||
{
|
||||
const ESM::Faction *faction = store.factions.find(*it);
|
||||
const ESM::Faction *faction = store.factions.find(it->first);
|
||||
addItem(faction->name, coord1, coord2);
|
||||
// TODO: Faction rank should be placed in tooltip
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "../mwmechanics/stat.hpp"
|
||||
#include "../mwworld/environment.hpp"
|
||||
@ -178,6 +180,9 @@ namespace MWGui
|
||||
class StatsWindow : public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
typedef std::pair<std::string, int> Faction;
|
||||
typedef std::vector<Faction> FactionList;
|
||||
|
||||
void setBar(const std::string& name, const std::string& tname, int val, int max)
|
||||
{
|
||||
MyGUI::ProgressPtr pt;
|
||||
@ -302,7 +307,7 @@ namespace MWGui
|
||||
void setValue (const std::string& id, const MWMechanics::Stat<float>& value);
|
||||
|
||||
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 setFactions (const std::vector<Faction>& factions);
|
||||
void configureBirthSign (const std::string &signId);
|
||||
void setReputation (int reputation) { this->reputation = reputation; }
|
||||
void setBounty (int bounty) { this->bounty = bounty; }
|
||||
@ -329,7 +334,8 @@ namespace MWGui
|
||||
std::set<int> majorSkills, minorSkills, miscSkills;
|
||||
std::map<int, MWMechanics::Stat<float> > skillValues;
|
||||
std::map<int, MyGUI::WidgetPtr> skillWidgetMap;
|
||||
std::vector<std::string> factions;
|
||||
std::map<std::string, MyGUI::WidgetPtr> factionWidgetMap;
|
||||
FactionList factions; ///< Stores a list of factions and the current rank
|
||||
std::string birthSignId;
|
||||
int reputation, bounty;
|
||||
std::vector<MyGUI::WidgetPtr> skillWidgets; //< Skills and other information
|
||||
|
@ -176,9 +176,9 @@ void WindowManager::configureSkills (const std::set<int>& major, const std::set<
|
||||
stats->configureSkills (major, minor, misc);
|
||||
}
|
||||
|
||||
void WindowManager::configureFactions (const std::vector<std::string>& factions)
|
||||
void WindowManager::setFactions (const FactionList& factions)
|
||||
{
|
||||
stats->configureFactions (factions);
|
||||
stats->setFactions (factions);
|
||||
}
|
||||
|
||||
void WindowManager::configureBirthSign (const std::string &signId)
|
||||
|
@ -126,6 +126,9 @@ namespace MWGui
|
||||
|
||||
MyGUI::Gui* getGui() const { return gui; }
|
||||
|
||||
typedef std::pair<std::string, int> Faction;
|
||||
typedef std::vector<Faction> FactionList;
|
||||
|
||||
void setValue (const std::string& id, const MWMechanics::Stat<int>& value);
|
||||
///< Set value for the given ID.
|
||||
|
||||
@ -144,8 +147,8 @@ namespace MWGui
|
||||
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.
|
||||
|
||||
void configureFactions (const std::vector<std::string>& factions);
|
||||
///< configure factions to display on stat window, use an empty set to disable
|
||||
void setFactions (const FactionList& factions);
|
||||
///< set faction and rank to display on stat window, use an empty vector to disable
|
||||
|
||||
void configureBirthSign (const std::string &signId);
|
||||
///< configure birth sign to display on stat window, use an empty string to disable.
|
||||
|
Loading…
x
Reference in New Issue
Block a user