|
|
|
@ -46,7 +46,7 @@ const char* CSMWorld::ConstInfoSelectWrapper::FunctionEnumStrings[] =
|
|
|
|
|
"PC Sneak",
|
|
|
|
|
"PC Acrobatics",
|
|
|
|
|
"PC Light Armor",
|
|
|
|
|
"PC Shorth Blade",
|
|
|
|
|
"PC Short Blade",
|
|
|
|
|
"PC Marksman",
|
|
|
|
|
"PC Merchantile",
|
|
|
|
|
"PC Speechcraft",
|
|
|
|
@ -74,8 +74,8 @@ const char* CSMWorld::ConstInfoSelectWrapper::FunctionEnumStrings[] =
|
|
|
|
|
"PC Corpus",
|
|
|
|
|
"Weather",
|
|
|
|
|
"PC Vampire",
|
|
|
|
|
"PC Level",
|
|
|
|
|
"PC Attacked",
|
|
|
|
|
"Level",
|
|
|
|
|
"Attacked",
|
|
|
|
|
"Talked to PC",
|
|
|
|
|
"PC Health",
|
|
|
|
|
"Creature Target",
|
|
|
|
@ -247,8 +247,6 @@ std::string CSMWorld::ConstInfoSelectWrapper::toString() const
|
|
|
|
|
|
|
|
|
|
switch (mConstSelect.mValue.getType())
|
|
|
|
|
{
|
|
|
|
|
case ESM::VT_Short:
|
|
|
|
|
case ESM::VT_Long:
|
|
|
|
|
case ESM::VT_Int:
|
|
|
|
|
stream << mConstSelect.mValue.getInteger();
|
|
|
|
|
break;
|
|
|
|
@ -257,10 +255,6 @@ std::string CSMWorld::ConstInfoSelectWrapper::toString() const
|
|
|
|
|
stream << mConstSelect.mValue.getFloat();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ESM::VT_String:
|
|
|
|
|
stream << mConstSelect.mValue.getString();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
stream << "(Invalid value type)";
|
|
|
|
|
break;
|
|
|
|
@ -377,6 +371,7 @@ void CSMWorld::ConstInfoSelectWrapper::updateComparisonType()
|
|
|
|
|
case Function_NotClass:
|
|
|
|
|
case Function_NotRace:
|
|
|
|
|
case Function_NotCell:
|
|
|
|
|
case Function_NotLocal:
|
|
|
|
|
case Function_PcExpelled:
|
|
|
|
|
case Function_PcCommonDisease:
|
|
|
|
|
case Function_PcBlightDisease:
|
|
|
|
@ -459,7 +454,7 @@ void CSMWorld::ConstInfoSelectWrapper::updateComparisonType()
|
|
|
|
|
// Numeric
|
|
|
|
|
case Function_Global:
|
|
|
|
|
case Function_Local:
|
|
|
|
|
case Function_NotLocal:
|
|
|
|
|
|
|
|
|
|
case Function_Health_Percent:
|
|
|
|
|
case Function_PcHealthPercent:
|
|
|
|
|
case Function_PcMagicka:
|
|
|
|
@ -559,14 +554,13 @@ std::pair<int, int> CSMWorld::ConstInfoSelectWrapper::getValidIntRange() const
|
|
|
|
|
|
|
|
|
|
switch (mFunctionName)
|
|
|
|
|
{
|
|
|
|
|
// TODO these need to be checked
|
|
|
|
|
|
|
|
|
|
// Boolean
|
|
|
|
|
case Function_NotId:
|
|
|
|
|
case Function_NotFaction:
|
|
|
|
|
case Function_NotClass:
|
|
|
|
|
case Function_NotRace:
|
|
|
|
|
case Function_NotCell:
|
|
|
|
|
case Function_NotLocal:
|
|
|
|
|
case Function_PcExpelled:
|
|
|
|
|
case Function_PcCommonDisease:
|
|
|
|
|
case Function_PcBlightDisease:
|
|
|
|
@ -633,12 +627,14 @@ std::pair<int, int> CSMWorld::ConstInfoSelectWrapper::getValidIntRange() const
|
|
|
|
|
case Function_PcPersonality:
|
|
|
|
|
case Function_PcLuck:
|
|
|
|
|
case Function_Level:
|
|
|
|
|
case Function_PcWerewolfKills:
|
|
|
|
|
return std::pair<int, int>(0, IntMax);
|
|
|
|
|
|
|
|
|
|
case Function_Fight:
|
|
|
|
|
case Function_Hello:
|
|
|
|
|
case Function_Alarm:
|
|
|
|
|
case Function_Flee:
|
|
|
|
|
case Function_PcWerewolfKills:
|
|
|
|
|
return std::pair<int, int>(0, IntMax);
|
|
|
|
|
return std::pair<int, int>(0, 100);
|
|
|
|
|
|
|
|
|
|
case Function_Weather:
|
|
|
|
|
return std::pair<int, int>(0, 9);
|
|
|
|
@ -661,17 +657,16 @@ std::pair<int, int> CSMWorld::ConstInfoSelectWrapper::getValidIntRange() const
|
|
|
|
|
// Numeric
|
|
|
|
|
case Function_Global:
|
|
|
|
|
case Function_Local:
|
|
|
|
|
case Function_NotLocal:
|
|
|
|
|
return std::pair<int, int>(IntMin, IntMax);
|
|
|
|
|
|
|
|
|
|
case Function_Health_Percent:
|
|
|
|
|
case Function_PcHealthPercent:
|
|
|
|
|
return std::pair<int, int>(0, 100);
|
|
|
|
|
|
|
|
|
|
case Function_PcMagicka:
|
|
|
|
|
case Function_PcFatigue:
|
|
|
|
|
case Function_PcHealth:
|
|
|
|
|
return std::pair<int, int>(0,0);
|
|
|
|
|
return std::pair<int, int>(0, IntMax);
|
|
|
|
|
|
|
|
|
|
case Function_Health_Percent:
|
|
|
|
|
case Function_PcHealthPercent:
|
|
|
|
|
return std::pair<int, int>(0, 100);
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
throw std::runtime_error("InfoSelectWrapper: function does not exist");
|
|
|
|
@ -691,14 +686,14 @@ std::pair<float, float> CSMWorld::ConstInfoSelectWrapper::getValidFloatRange() c
|
|
|
|
|
case Function_NotLocal:
|
|
|
|
|
return std::pair<float, float>(FloatMin, FloatMax);
|
|
|
|
|
|
|
|
|
|
case Function_Health_Percent:
|
|
|
|
|
case Function_PcHealthPercent:
|
|
|
|
|
return std::pair<float, float>(0, 100);
|
|
|
|
|
|
|
|
|
|
case Function_PcMagicka:
|
|
|
|
|
case Function_PcFatigue:
|
|
|
|
|
case Function_PcHealth:
|
|
|
|
|
return std::pair<float, float>(0,0);
|
|
|
|
|
return std::pair<float, float>(0, FloatMax);
|
|
|
|
|
|
|
|
|
|
case Function_Health_Percent:
|
|
|
|
|
case Function_PcHealthPercent:
|
|
|
|
|
return std::pair<float, float>(0, 100);
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
throw std::runtime_error("InfoSelectWrapper: function does not exist or is not numeric");
|
|
|
|
@ -839,7 +834,7 @@ void CSMWorld::InfoSelectWrapper::update()
|
|
|
|
|
// Write Function
|
|
|
|
|
|
|
|
|
|
bool writeIndex = false;
|
|
|
|
|
int functionIndex = static_cast<int>(mFunctionName);
|
|
|
|
|
size_t functionIndex = static_cast<size_t>(mFunctionName);
|
|
|
|
|
|
|
|
|
|
switch (mFunctionName)
|
|
|
|
|
{
|
|
|
|
|