forked from mirror/openmw-tes3mp
read attribute names from GMST instead of using hard-coded names (doesn't fully work yet, because of encoding issues)
parent
532ccbd1f8
commit
61d09c4768
@ -0,0 +1,43 @@
|
||||
|
||||
#include "mechanicsmanager.hpp"
|
||||
|
||||
#include <components/esm_store/store.hpp>
|
||||
|
||||
#include "../mwgui/window_manager.hpp"
|
||||
|
||||
namespace MWMechanics
|
||||
{
|
||||
MechanicsManager::MechanicsManager (const ESMS::ESMStore& store,
|
||||
MWGui::WindowManager& windowManager)
|
||||
: mStore (store), mWindowManager (windowManager)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MechanicsManager::configureGUI()
|
||||
{
|
||||
const char *names[][2] =
|
||||
{
|
||||
{ "Attrib1", "sAttributeStrength" },
|
||||
{ "Attrib2", "sAttributeIntelligence" },
|
||||
{ "Attrib3", "sAttributeWillpower" },
|
||||
{ "Attrib4", "sAttributeAgility" },
|
||||
{ "Attrib5", "sAttributeSpeed" },
|
||||
{ "Attrib6", "sAttributeEndurance" },
|
||||
{ "Attrib7", "sAttributePersonality" },
|
||||
{ "Attrib8", "sAttributeLuck" },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
for (int i=0; names[i][0]; ++i)
|
||||
{
|
||||
// This crashes because of encoding problems:
|
||||
// std::string label = mStore.gameSettings.find (names[i][1])->str;
|
||||
|
||||
std::string label = names[i][1]; // until the problem is fixed, use the GMST ID as label
|
||||
|
||||
mWindowManager.setLabel (names[i][0], label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
#ifndef GAME_MWMECHANICS_PTR_H
|
||||
#define GAME_MWMECHANICS_PTR_H
|
||||
|
||||
namespace ESMS
|
||||
{
|
||||
class ESMStore;
|
||||
}
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class WindowManager;
|
||||
}
|
||||
|
||||
namespace MWMechanics
|
||||
{
|
||||
class MechanicsManager
|
||||
{
|
||||
const ESMS::ESMStore& mStore;
|
||||
MWGui::WindowManager& mWindowManager;
|
||||
|
||||
public:
|
||||
|
||||
MechanicsManager (const ESMS::ESMStore& store, MWGui::WindowManager& windowManager);
|
||||
|
||||
void configureGUI();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue