mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 10:21:11 +00:00
Merge branch 'fallbacks2' into 'master'
Validate fallbacks in openmw.cfg with a whitelist and add them to GMST store See merge request OpenMW/openmw!3129
This commit is contained in:
commit
d4e1f9c5de
@ -141,7 +141,8 @@ namespace MWGui
|
|||||||
mLevelText->setCaptionWithReplacing("#{sLevelUpMenu1} " + MyGUI::utility::toString(level));
|
mLevelText->setCaptionWithReplacing("#{sLevelUpMenu1} " + MyGUI::utility::toString(level));
|
||||||
|
|
||||||
std::string_view levelupdescription;
|
std::string_view levelupdescription;
|
||||||
levelupdescription = Fallback::Map::getString("Level_Up_Level" + MyGUI::utility::toString(level));
|
if (level <= 20)
|
||||||
|
levelupdescription = Fallback::Map::getString("Level_Up_Level" + MyGUI::utility::toString(level));
|
||||||
|
|
||||||
if (levelupdescription.empty())
|
if (levelupdescription.empty())
|
||||||
levelupdescription = Fallback::Map::getString("Level_Up_Default");
|
levelupdescription = Fallback::Map::getString("Level_Up_Default");
|
||||||
|
@ -131,16 +131,28 @@ namespace MWLua
|
|||||||
addTimeBindings(api, context, false);
|
addTimeBindings(api, context, false);
|
||||||
api["magic"] = initCoreMagicBindings(context);
|
api["magic"] = initCoreMagicBindings(context);
|
||||||
api["l10n"] = LuaUtil::initL10nLoader(lua->sol(), MWBase::Environment::get().getL10nManager());
|
api["l10n"] = LuaUtil::initL10nLoader(lua->sol(), MWBase::Environment::get().getL10nManager());
|
||||||
const MWWorld::Store<ESM::GameSetting>* gmst
|
const MWWorld::Store<ESM::GameSetting>* gmstStore
|
||||||
= &MWBase::Environment::get().getESMStore()->get<ESM::GameSetting>();
|
= &MWBase::Environment::get().getESMStore()->get<ESM::GameSetting>();
|
||||||
api["getGMST"] = [lua = context.mLua, gmst](const std::string& setting) -> sol::object {
|
api["getGMST"] = [lua = context.mLua, gmstStore](const std::string& setting) -> sol::object {
|
||||||
const ESM::Variant& value = gmst->find(setting)->mValue;
|
const ESM::GameSetting* gmst = gmstStore->search(setting);
|
||||||
if (value.getType() == ESM::VT_String)
|
if (gmst == nullptr)
|
||||||
return sol::make_object<std::string>(lua->sol(), value.getString());
|
return sol::nil;
|
||||||
else if (value.getType() == ESM::VT_Int)
|
const ESM::Variant& value = gmst->mValue;
|
||||||
return sol::make_object<int>(lua->sol(), value.getInteger());
|
switch (value.getType())
|
||||||
else
|
{
|
||||||
return sol::make_object<float>(lua->sol(), value.getFloat());
|
case ESM::VT_Float:
|
||||||
|
return sol::make_object<float>(lua->sol(), value.getFloat());
|
||||||
|
case ESM::VT_Short:
|
||||||
|
case ESM::VT_Long:
|
||||||
|
case ESM::VT_Int:
|
||||||
|
return sol::make_object<int>(lua->sol(), value.getInteger());
|
||||||
|
case ESM::VT_String:
|
||||||
|
return sol::make_object<std::string>(lua->sol(), value.getString());
|
||||||
|
case ESM::VT_Unknown:
|
||||||
|
case ESM::VT_None:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return sol::nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
sol::table skill(context.mLua->sol(), sol::create);
|
sol::table skill(context.mLua->sol(), sol::create);
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <components/esm3/esmwriter.hpp>
|
#include <components/esm3/esmwriter.hpp>
|
||||||
#include <components/esm4/loadland.hpp>
|
#include <components/esm4/loadland.hpp>
|
||||||
#include <components/esm4/loadwrld.hpp>
|
#include <components/esm4/loadwrld.hpp>
|
||||||
|
#include <components/fallback/fallback.hpp>
|
||||||
#include <components/loadinglistener/loadinglistener.hpp>
|
#include <components/loadinglistener/loadinglistener.hpp>
|
||||||
#include <components/misc/rng.hpp>
|
#include <components/misc/rng.hpp>
|
||||||
|
|
||||||
@ -980,6 +981,24 @@ namespace MWWorld
|
|||||||
return TypedDynamicStore::search(ESM::RefId::stringRefId(id));
|
return TypedDynamicStore::search(ESM::RefId::stringRefId(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Store<ESM::GameSetting>::setUp()
|
||||||
|
{
|
||||||
|
auto addSetting = [&](const std::string& key, ESM::Variant value) {
|
||||||
|
ESM::GameSetting setting;
|
||||||
|
setting.blank();
|
||||||
|
setting.mId = ESM::RefId::stringRefId(key);
|
||||||
|
setting.mValue = std::move(value);
|
||||||
|
mStatic.emplace(setting.mId, std::move(setting));
|
||||||
|
};
|
||||||
|
for (auto& [key, value] : Fallback::Map::getIntFallbackMap())
|
||||||
|
addSetting(key, ESM::Variant(value));
|
||||||
|
for (auto& [key, value] : Fallback::Map::getFloatFallbackMap())
|
||||||
|
addSetting(key, ESM::Variant(value));
|
||||||
|
for (auto& [key, value] : Fallback::Map::getNonNumericFallbackMap())
|
||||||
|
addSetting(key, ESM::Variant(value));
|
||||||
|
TypedDynamicStore<ESM::GameSetting>::setUp();
|
||||||
|
}
|
||||||
|
|
||||||
// Magic effect
|
// Magic effect
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
Store<ESM::MagicEffect>::Store() {}
|
Store<ESM::MagicEffect>::Store() {}
|
||||||
|
@ -292,6 +292,8 @@ namespace MWWorld
|
|||||||
|
|
||||||
const ESM::GameSetting* find(const std::string_view id) const;
|
const ESM::GameSetting* find(const std::string_view id) const;
|
||||||
const ESM::GameSetting* search(const std::string_view id) const;
|
const ESM::GameSetting* search(const std::string_view id) const;
|
||||||
|
|
||||||
|
void setUp() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -7,21 +7,36 @@
|
|||||||
#include <components/misc/strings/algorithm.hpp>
|
#include <components/misc/strings/algorithm.hpp>
|
||||||
#include <components/misc/strings/conversion.hpp>
|
#include <components/misc/strings/conversion.hpp>
|
||||||
|
|
||||||
|
#include "validate.hpp"
|
||||||
|
|
||||||
namespace Fallback
|
namespace Fallback
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string, std::less<>> Map::mFallbackMap;
|
std::map<std::string, int, std::less<>> Map::mIntFallbackMap;
|
||||||
|
std::map<std::string, float, std::less<>> Map::mFloatFallbackMap;
|
||||||
|
std::map<std::string, std::string, std::less<>> Map::mNonNumericFallbackMap;
|
||||||
|
|
||||||
void Map::init(const std::map<std::string, std::string>& fallback)
|
void Map::init(const std::map<std::string, std::string>& fallback)
|
||||||
{
|
{
|
||||||
for (const auto& entry : fallback)
|
for (const auto& [key, value] : fallback)
|
||||||
mFallbackMap.insert(entry);
|
{
|
||||||
|
if (isAllowedIntFallbackKey(key))
|
||||||
|
mIntFallbackMap.emplace(key, Misc::StringUtils::toNumeric<int>(value, 0));
|
||||||
|
else if (isAllowedFloatFallbackKey(key))
|
||||||
|
mFloatFallbackMap.emplace(key, Misc::StringUtils::toNumeric<float>(value, 0.0f));
|
||||||
|
else if (isAllowedNonNumericFallbackKey(key))
|
||||||
|
mNonNumericFallbackMap.emplace(key, value);
|
||||||
|
else if (!isAllowedUnusedFallbackKey(key))
|
||||||
|
Log(Debug::Error) << "Ignoring unknown fallback: " << key;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view Map::getString(std::string_view fall)
|
std::string_view Map::getString(std::string_view fall)
|
||||||
{
|
{
|
||||||
auto it = mFallbackMap.find(fall);
|
const auto it = mNonNumericFallbackMap.find(fall);
|
||||||
if (it == mFallbackMap.end())
|
if (it == mNonNumericFallbackMap.end())
|
||||||
{
|
{
|
||||||
|
if (!isAllowedNonNumericFallbackKey(fall))
|
||||||
|
throw std::logic_error("Requested invalid string fallback: " + std::string(fall));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
return it->second;
|
return it->second;
|
||||||
@ -29,20 +44,31 @@ namespace Fallback
|
|||||||
|
|
||||||
float Map::getFloat(std::string_view fall)
|
float Map::getFloat(std::string_view fall)
|
||||||
{
|
{
|
||||||
std::string_view fallback = getString(fall);
|
const auto it = mFloatFallbackMap.find(fall);
|
||||||
return Misc::StringUtils::toNumeric<float>(fallback, 0.0f);
|
if (it == mFloatFallbackMap.end())
|
||||||
|
{
|
||||||
|
if (!isAllowedFloatFallbackKey(fall))
|
||||||
|
throw std::logic_error("Requested invalid float fallback: " + std::string(fall));
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Map::getInt(std::string_view fall)
|
int Map::getInt(std::string_view fall)
|
||||||
{
|
{
|
||||||
std::string_view fallback = getString(fall);
|
const auto it = mIntFallbackMap.find(fall);
|
||||||
return Misc::StringUtils::toNumeric<int>(fallback, 0);
|
if (it == mIntFallbackMap.end())
|
||||||
|
{
|
||||||
|
if (!isAllowedIntFallbackKey(fall))
|
||||||
|
throw std::logic_error("Requested invalid int fallback: " + std::string(fall));
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Map::getBool(std::string_view fall)
|
bool Map::getBool(std::string_view fall)
|
||||||
{
|
{
|
||||||
std::string_view fallback = getString(fall);
|
return getInt(fall) != 0;
|
||||||
return !fallback.empty() && fallback != "0";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::Vec4f Map::getColour(std::string_view fall)
|
osg::Vec4f Map::getColour(std::string_view fall)
|
||||||
|
@ -12,11 +12,20 @@ namespace Fallback
|
|||||||
/// @brief contains settings imported from the Morrowind INI file.
|
/// @brief contains settings imported from the Morrowind INI file.
|
||||||
class Map
|
class Map
|
||||||
{
|
{
|
||||||
static std::map<std::string, std::string, std::less<>> mFallbackMap;
|
static std::map<std::string, int, std::less<>> mIntFallbackMap;
|
||||||
|
static std::map<std::string, float, std::less<>> mFloatFallbackMap;
|
||||||
|
static std::map<std::string, std::string, std::less<>> mNonNumericFallbackMap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void init(const std::map<std::string, std::string>& fallback);
|
static void init(const std::map<std::string, std::string>& fallback);
|
||||||
|
|
||||||
|
static const std::map<std::string, int, std::less<>>& getIntFallbackMap() { return mIntFallbackMap; }
|
||||||
|
static const std::map<std::string, float, std::less<>>& getFloatFallbackMap() { return mFloatFallbackMap; }
|
||||||
|
static const std::map<std::string, std::string, std::less<>>& getNonNumericFallbackMap()
|
||||||
|
{
|
||||||
|
return mNonNumericFallbackMap;
|
||||||
|
}
|
||||||
|
|
||||||
static std::string_view getString(std::string_view fall);
|
static std::string_view getString(std::string_view fall);
|
||||||
static float getFloat(std::string_view fall);
|
static float getFloat(std::string_view fall);
|
||||||
static int getInt(std::string_view fall);
|
static int getInt(std::string_view fall);
|
||||||
|
@ -2,6 +2,247 @@
|
|||||||
|
|
||||||
#include <boost/any.hpp>
|
#include <boost/any.hpp>
|
||||||
#include <boost/program_options/errors.hpp>
|
#include <boost/program_options/errors.hpp>
|
||||||
|
#include <set>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
static const std::set<std::string, std::less<>> allowedKeysInt = { "LightAttenuation_LinearMethod",
|
||||||
|
"LightAttenuation_OutQuadInLin", "LightAttenuation_QuadraticMethod", "LightAttenuation_UseConstant",
|
||||||
|
"LightAttenuation_UseLinear", "LightAttenuation_UseQuadratic", "Water_NearWaterRadius", "Water_NearWaterPoints",
|
||||||
|
"Water_RippleFrameCount", "Water_SurfaceTileCount", "Water_SurfaceFrameCount", "Weather_Clear_Using_Precip",
|
||||||
|
"Weather_Cloudy_Using_Precip", "Weather_Foggy_Using_Precip", "Weather_Overcast_Using_Precip",
|
||||||
|
"Weather_Rain_Using_Precip", "Weather_Thunderstorm_Using_Precip", "Weather_Ashstorm_Using_Precip",
|
||||||
|
"Weather_Blight_Using_Precip", "Weather_Snow_Using_Precip", "Weather_Blizzard_Using_Precip" };
|
||||||
|
|
||||||
|
static const std::set<std::string, std::less<>> allowedKeysFloat = { "Inventory_DirectionalAmbientB",
|
||||||
|
"Inventory_DirectionalAmbientG", "Inventory_DirectionalAmbientR", "Inventory_DirectionalDiffuseB",
|
||||||
|
"Inventory_DirectionalDiffuseG", "Inventory_DirectionalDiffuseR", "Inventory_DirectionalRotationX",
|
||||||
|
"Inventory_DirectionalRotationY", "LightAttenuation_ConstantValue", "LightAttenuation_LinearValue",
|
||||||
|
"LightAttenuation_LinearRadiusMult", "LightAttenuation_QuadraticValue", "LightAttenuation_QuadraticRadiusMult",
|
||||||
|
"Moons_Masser_Axis_Offset", "Moons_Masser_Daily_Increment", "Moons_Masser_Fade_End_Angle",
|
||||||
|
"Moons_Masser_Fade_In_Finish", "Moons_Masser_Fade_In_Start", "Moons_Masser_Fade_Out_Finish",
|
||||||
|
"Moons_Masser_Fade_Out_Start", "Moons_Masser_Fade_Start_Angle", "Moons_Masser_Moon_Shadow_Early_Fade_Angle",
|
||||||
|
"Moons_Masser_Size", "Moons_Masser_Speed", "Moons_Secunda_Axis_Offset", "Moons_Secunda_Daily_Increment",
|
||||||
|
"Moons_Secunda_Fade_End_Angle", "Moons_Secunda_Fade_In_Finish", "Moons_Secunda_Fade_In_Start",
|
||||||
|
"Moons_Secunda_Fade_Out_Finish", "Moons_Secunda_Fade_Out_Start", "Moons_Secunda_Fade_Start_Angle",
|
||||||
|
"Moons_Secunda_Moon_Shadow_Early_Fade_Angle", "Moons_Secunda_Size", "Moons_Secunda_Speed", "Water_World_Alpha",
|
||||||
|
"Water_Map_Alpha", "Water_NearWaterIndoorTolerance", "Water_NearWaterOutdoorTolerance", "Water_RippleLifetime",
|
||||||
|
"Water_RippleRotSpeed", "Water_SurfaceFPS", "Water_UnderwaterColorWeight", "Water_UnderwaterDayFog",
|
||||||
|
"Water_UnderwaterIndoorFog", "Water_UnderwaterNightFog", "Water_UnderwaterSunriseFog", "Water_UnderwaterSunsetFog",
|
||||||
|
"Weather_Ambient_Post-Sunrise_Time", "Weather_Ambient_Post-Sunset_Time", "Weather_Ambient_Pre-Sunrise_Time",
|
||||||
|
"Weather_Ambient_Pre-Sunset_Time", "Weather_Ashstorm_Clouds_Maximum_Percent", "Weather_Ashstorm_Cloud_Speed",
|
||||||
|
"Weather_Ashstorm_Flash_Decrement", "Weather_Ashstorm_Glare_View", "Weather_Ashstorm_Land_Fog_Day_Depth",
|
||||||
|
"Weather_Ashstorm_Land_Fog_Night_Depth", "Weather_Ashstorm_Max_Raindrops", "Weather_Ashstorm_Rain_Diameter",
|
||||||
|
"Weather_Ashstorm_Rain_Entrance_Speed", "Weather_Ashstorm_Rain_Height_Max", "Weather_Ashstorm_Rain_Height_Min",
|
||||||
|
"Weather_Ashstorm_Rain_Threshold", "Weather_Ashstorm_Thunder_Frequency", "Weather_Ashstorm_Thunder_Threshold",
|
||||||
|
"Weather_Ashstorm_Transition_Delta", "Weather_Ashstorm_Wind_Speed", "Weather_Blight_Clouds_Maximum_Percent",
|
||||||
|
"Weather_Blight_Cloud_Speed", "Weather_Blight_Flash_Decrement", "Weather_Blight_Glare_View",
|
||||||
|
"Weather_Blight_Land_Fog_Day_Depth", "Weather_Blight_Land_Fog_Night_Depth", "Weather_Blight_Max_Raindrops",
|
||||||
|
"Weather_Blight_Rain_Diameter", "Weather_Blight_Rain_Entrance_Speed", "Weather_Blight_Rain_Height_Max",
|
||||||
|
"Weather_Blight_Rain_Height_Min", "Weather_Blight_Rain_Threshold", "Weather_Blight_Thunder_Frequency",
|
||||||
|
"Weather_Blight_Thunder_Threshold", "Weather_Blight_Transition_Delta", "Weather_Blight_Wind_Speed",
|
||||||
|
"Weather_Blizzard_Clouds_Maximum_Percent", "Weather_Blizzard_Cloud_Speed", "Weather_Blizzard_Flash_Decrement",
|
||||||
|
"Weather_Blizzard_Glare_View", "Weather_Blizzard_Land_Fog_Day_Depth", "Weather_Blizzard_Land_Fog_Night_Depth",
|
||||||
|
"Weather_Blizzard_Max_Raindrops", "Weather_Blizzard_Rain_Diameter", "Weather_Blizzard_Rain_Entrance_Speed",
|
||||||
|
"Weather_Blizzard_Rain_Height_Max", "Weather_Blizzard_Rain_Height_Min", "Weather_Blizzard_Rain_Threshold",
|
||||||
|
"Weather_Blizzard_Thunder_Frequency", "Weather_Blizzard_Thunder_Threshold", "Weather_Blizzard_Transition_Delta",
|
||||||
|
"Weather_Blizzard_Wind_Speed", "Weather_Clear_Clouds_Maximum_Percent", "Weather_Clear_Cloud_Speed",
|
||||||
|
"Weather_Clear_Flash_Decrement", "Weather_Clear_Glare_View", "Weather_Clear_Land_Fog_Day_Depth",
|
||||||
|
"Weather_Clear_Land_Fog_Night_Depth", "Weather_Clear_Max_Raindrops", "Weather_Clear_Rain_Diameter",
|
||||||
|
"Weather_Clear_Rain_Entrance_Speed", "Weather_Clear_Rain_Height_Max", "Weather_Clear_Rain_Height_Min",
|
||||||
|
"Weather_Clear_Rain_Threshold", "Weather_Clear_Thunder_Frequency", "Weather_Clear_Thunder_Threshold",
|
||||||
|
"Weather_Clear_Transition_Delta", "Weather_Clear_Wind_Speed", "Weather_Cloudy_Clouds_Maximum_Percent",
|
||||||
|
"Weather_Cloudy_Cloud_Speed", "Weather_Cloudy_Flash_Decrement", "Weather_Cloudy_Glare_View",
|
||||||
|
"Weather_Cloudy_Land_Fog_Day_Depth", "Weather_Cloudy_Land_Fog_Night_Depth", "Weather_Cloudy_Max_Raindrops",
|
||||||
|
"Weather_Cloudy_Rain_Diameter", "Weather_Cloudy_Rain_Entrance_Speed", "Weather_Cloudy_Rain_Height_Max",
|
||||||
|
"Weather_Cloudy_Rain_Height_Min", "Weather_Cloudy_Rain_Threshold", "Weather_Cloudy_Thunder_Frequency",
|
||||||
|
"Weather_Cloudy_Thunder_Threshold", "Weather_Cloudy_Transition_Delta", "Weather_Cloudy_Wind_Speed",
|
||||||
|
"Weather_Foggy_Clouds_Maximum_Percent", "Weather_Foggy_Cloud_Speed", "Weather_Foggy_Flash_Decrement",
|
||||||
|
"Weather_Foggy_Glare_View", "Weather_Foggy_Land_Fog_Day_Depth", "Weather_Foggy_Land_Fog_Night_Depth",
|
||||||
|
"Weather_Foggy_Max_Raindrops", "Weather_Foggy_Rain_Diameter", "Weather_Foggy_Rain_Entrance_Speed",
|
||||||
|
"Weather_Foggy_Rain_Height_Max", "Weather_Foggy_Rain_Height_Min", "Weather_Foggy_Rain_Threshold",
|
||||||
|
"Weather_Foggy_Thunder_Frequency", "Weather_Foggy_Thunder_Threshold", "Weather_Foggy_Transition_Delta",
|
||||||
|
"Weather_Foggy_Wind_Speed", "Weather_Fog_Post-Sunrise_Time", "Weather_Fog_Post-Sunset_Time",
|
||||||
|
"Weather_Fog_Pre-Sunrise_Time", "Weather_Fog_Pre-Sunset_Time", "Weather_Hours_Between_Weather_Changes",
|
||||||
|
"Weather_Maximum_Time_Between_Environmental_Sounds", "Weather_Minimum_Time_Between_Environmental_Sounds",
|
||||||
|
"Weather_Overcast_Clouds_Maximum_Percent", "Weather_Overcast_Cloud_Speed", "Weather_Overcast_Flash_Decrement",
|
||||||
|
"Weather_Overcast_Glare_View", "Weather_Overcast_Land_Fog_Day_Depth", "Weather_Overcast_Land_Fog_Night_Depth",
|
||||||
|
"Weather_Overcast_Max_Raindrops", "Weather_Overcast_Rain_Diameter", "Weather_Overcast_Rain_Entrance_Speed",
|
||||||
|
"Weather_Overcast_Rain_Height_Max", "Weather_Overcast_Rain_Height_Min", "Weather_Overcast_Rain_Threshold",
|
||||||
|
"Weather_Overcast_Thunder_Frequency", "Weather_Overcast_Thunder_Threshold", "Weather_Overcast_Transition_Delta",
|
||||||
|
"Weather_Overcast_Wind_Speed", "Weather_Precip_Gravity", "Weather_Rain_Clouds_Maximum_Percent",
|
||||||
|
"Weather_Rain_Cloud_Speed", "Weather_Rain_Flash_Decrement", "Weather_Rain_Glare_View",
|
||||||
|
"Weather_Rain_Land_Fog_Day_Depth", "Weather_Rain_Land_Fog_Night_Depth", "Weather_Rain_Max_Raindrops",
|
||||||
|
"Weather_Rain_Rain_Diameter", "Weather_Rain_Rain_Entrance_Speed", "Weather_Rain_Rain_Height_Max",
|
||||||
|
"Weather_Rain_Rain_Height_Min", "Weather_Rain_Rain_Threshold", "Weather_Rain_Thunder_Frequency",
|
||||||
|
"Weather_Rain_Thunder_Threshold", "Weather_Rain_Transition_Delta", "Weather_Rain_Wind_Speed",
|
||||||
|
"Weather_Sky_Post-Sunrise_Time", "Weather_Sky_Post-Sunset_Time", "Weather_Sky_Pre-Sunrise_Time",
|
||||||
|
"Weather_Sky_Pre-Sunset_Time", "Weather_Snow_Clouds_Maximum_Percent", "Weather_Snow_Cloud_Speed",
|
||||||
|
"Weather_Snow_Flash_Decrement", "Weather_Snow_Glare_View", "Weather_Snow_Land_Fog_Day_Depth",
|
||||||
|
"Weather_Snow_Land_Fog_Night_Depth", "Weather_Snow_Max_Raindrops", "Weather_Snow_Rain_Diameter",
|
||||||
|
"Weather_Snow_Rain_Entrance_Speed", "Weather_Snow_Rain_Height_Max", "Weather_Snow_Rain_Height_Min",
|
||||||
|
"Weather_Snow_Rain_Threshold", "Weather_Snow_Thunder_Frequency", "Weather_Snow_Thunder_Threshold",
|
||||||
|
"Weather_Snow_Transition_Delta", "Weather_Snow_Wind_Speed", "Weather_Stars_Fading_Duration",
|
||||||
|
"Weather_Stars_Post-Sunset_Start", "Weather_Stars_Pre-Sunrise_Finish", "Weather_Sun_Glare_Fader_Angle_Max",
|
||||||
|
"Weather_Sun_Glare_Fader_Max", "Weather_Sun_Post-Sunrise_Time", "Weather_Sun_Post-Sunset_Time",
|
||||||
|
"Weather_Sun_Pre-Sunrise_Time", "Weather_Sun_Pre-Sunset_Time", "Weather_Sunrise_Duration", "Weather_Sunrise_Time",
|
||||||
|
"Weather_Sunset_Duration", "Weather_Sunset_Time", "Weather_Thunderstorm_Clouds_Maximum_Percent",
|
||||||
|
"Weather_Thunderstorm_Cloud_Speed", "Weather_Thunderstorm_Flash_Decrement", "Weather_Thunderstorm_Glare_View",
|
||||||
|
"Weather_Thunderstorm_Land_Fog_Day_Depth", "Weather_Thunderstorm_Land_Fog_Night_Depth",
|
||||||
|
"Weather_Thunderstorm_Max_Raindrops", "Weather_Thunderstorm_Rain_Diameter",
|
||||||
|
"Weather_Thunderstorm_Rain_Entrance_Speed", "Weather_Thunderstorm_Rain_Height_Max",
|
||||||
|
"Weather_Thunderstorm_Rain_Height_Min", "Weather_Thunderstorm_Rain_Threshold",
|
||||||
|
"Weather_Thunderstorm_Thunder_Frequency", "Weather_Thunderstorm_Thunder_Threshold",
|
||||||
|
"Weather_Thunderstorm_Transition_Delta", "Weather_Thunderstorm_Wind_Speed" };
|
||||||
|
|
||||||
|
static const std::set<std::string, std::less<>> allowedKeysNonNumeric = { "Blood_Model_0", "Blood_Model_1",
|
||||||
|
"Blood_Model_2", "Blood_Texture_0", "Blood_Texture_1", "Blood_Texture_2", "Blood_Texture_Name_0",
|
||||||
|
"Blood_Texture_Name_1", "Blood_Texture_Name_2", "FontColor_color_active", "FontColor_color_active_over",
|
||||||
|
"FontColor_color_active_pressed", "FontColor_color_answer", "FontColor_color_answer_over",
|
||||||
|
"FontColor_color_answer_pressed", "FontColor_color_background", "FontColor_color_big_answer",
|
||||||
|
"FontColor_color_big_answer_over", "FontColor_color_big_answer_pressed", "FontColor_color_big_header",
|
||||||
|
"FontColor_color_big_link", "FontColor_color_big_link_over", "FontColor_color_big_link_pressed",
|
||||||
|
"FontColor_color_big_normal", "FontColor_color_big_normal_over", "FontColor_color_big_normal_pressed",
|
||||||
|
"FontColor_color_big_notify", "FontColor_color_count", "FontColor_color_disabled", "FontColor_color_disabled_over",
|
||||||
|
"FontColor_color_disabled_pressed", "FontColor_color_fatigue", "FontColor_color_focus", "FontColor_color_header",
|
||||||
|
"FontColor_color_health", "FontColor_color_journal_link", "FontColor_color_journal_link_over",
|
||||||
|
"FontColor_color_journal_link_pressed", "FontColor_color_journal_topic", "FontColor_color_journal_topic_over",
|
||||||
|
"FontColor_color_journal_topic_pressed", "FontColor_color_link", "FontColor_color_link_over",
|
||||||
|
"FontColor_color_link_pressed", "FontColor_color_magic", "FontColor_color_magic_fill", "FontColor_color_misc",
|
||||||
|
"FontColor_color_negative", "FontColor_color_normal", "FontColor_color_normal_over",
|
||||||
|
"FontColor_color_normal_pressed", "FontColor_color_notify", "FontColor_color_positive",
|
||||||
|
"FontColor_color_weapon_fill", "Fonts_Font_0", "Fonts_Font_1", "Fonts_Font_2", "Level_Up_Default",
|
||||||
|
"Level_Up_Level10", "Level_Up_Level11", "Level_Up_Level12", "Level_Up_Level13", "Level_Up_Level14",
|
||||||
|
"Level_Up_Level15", "Level_Up_Level16", "Level_Up_Level17", "Level_Up_Level18", "Level_Up_Level19",
|
||||||
|
"Level_Up_Level2", "Level_Up_Level20", "Level_Up_Level3", "Level_Up_Level4", "Level_Up_Level5", "Level_Up_Level6",
|
||||||
|
"Level_Up_Level7", "Level_Up_Level8", "Level_Up_Level9", "Moons_Script_Color", "Movies_Company_Logo",
|
||||||
|
"Movies_Morrowind_Logo", "Movies_New_Game", "Question_10_AnswerOne", "Question_10_AnswerThree",
|
||||||
|
"Question_10_AnswerTwo", "Question_10_Question", "Question_10_Sound", "Question_1_AnswerOne",
|
||||||
|
"Question_1_AnswerThree", "Question_1_AnswerTwo", "Question_1_Question", "Question_1_Sound", "Question_2_AnswerOne",
|
||||||
|
"Question_2_AnswerThree", "Question_2_AnswerTwo", "Question_2_Question", "Question_2_Sound", "Question_3_AnswerOne",
|
||||||
|
"Question_3_AnswerThree", "Question_3_AnswerTwo", "Question_3_Question", "Question_3_Sound", "Question_4_AnswerOne",
|
||||||
|
"Question_4_AnswerThree", "Question_4_AnswerTwo", "Question_4_Question", "Question_4_Sound", "Question_5_AnswerOne",
|
||||||
|
"Question_5_AnswerThree", "Question_5_AnswerTwo", "Question_5_Question", "Question_5_Sound", "Question_6_AnswerOne",
|
||||||
|
"Question_6_AnswerThree", "Question_6_AnswerTwo", "Question_6_Question", "Question_6_Sound", "Question_7_AnswerOne",
|
||||||
|
"Question_7_AnswerThree", "Question_7_AnswerTwo", "Question_7_Question", "Question_7_Sound", "Question_8_AnswerOne",
|
||||||
|
"Question_8_AnswerThree", "Question_8_AnswerTwo", "Question_8_Question", "Question_8_Sound", "Question_9_AnswerOne",
|
||||||
|
"Question_9_AnswerThree", "Question_9_AnswerTwo", "Question_9_Question", "Question_9_Sound",
|
||||||
|
"Water_NearWaterIndoorID", "Water_NearWaterOutdoorID", "Water_RippleTexture", "Water_SurfaceTexture",
|
||||||
|
"Water_UnderwaterColor", "Weather_Blizzard_Ambient_Day_Color", "Weather_Blizzard_Ambient_Loop_Sound_ID",
|
||||||
|
"Weather_Blizzard_Ambient_Night_Color", "Weather_Blizzard_Ambient_Sunrise_Color",
|
||||||
|
"Weather_Blizzard_Ambient_Sunset_Color", "Weather_Blizzard_Cloud_Texture", "Weather_Blizzard_Fog_Day_Color",
|
||||||
|
"Weather_Blizzard_Fog_Night_Color", "Weather_Blizzard_Fog_Sunrise_Color", "Weather_Blizzard_Fog_Sunset_Color",
|
||||||
|
"Weather_Blizzard_Sky_Day_Color", "Weather_Blizzard_Sky_Night_Color", "Weather_Blizzard_Sky_Sunrise_Color",
|
||||||
|
"Weather_Blizzard_Sky_Sunset_Color", "Weather_Blizzard_Storm_Threshold", "Weather_Blizzard_Sun_Day_Color",
|
||||||
|
"Weather_Blizzard_Sun_Disc_Sunset_Color", "Weather_Blizzard_Sun_Night_Color", "Weather_Blizzard_Sun_Sunrise_Color",
|
||||||
|
"Weather_Blizzard_Sun_Sunset_Color", "Weather_BumpFadeColor", "Weather_Clear_Ambient_Day_Color",
|
||||||
|
"Weather_Clear_Ambient_Loop_Sound_ID", "Weather_Clear_Ambient_Night_Color", "Weather_Clear_Ambient_Sunrise_Color",
|
||||||
|
"Weather_Clear_Ambient_Sunset_Color", "Weather_Clear_Cloud_Texture", "Weather_Clear_Fog_Day_Color",
|
||||||
|
"Weather_Clear_Fog_Night_Color", "Weather_Clear_Fog_Sunrise_Color", "Weather_Clear_Fog_Sunset_Color",
|
||||||
|
"Weather_Clear_Sky_Day_Color", "Weather_Clear_Sky_Night_Color", "Weather_Clear_Sky_Sunrise_Color",
|
||||||
|
"Weather_Clear_Sky_Sunset_Color", "Weather_Clear_Sun_Day_Color", "Weather_Clear_Sun_Disc_Sunset_Color",
|
||||||
|
"Weather_Clear_Sun_Night_Color", "Weather_Clear_Sun_Sunrise_Color", "Weather_Clear_Sun_Sunset_Color",
|
||||||
|
"Weather_Cloudy_Ambient_Day_Color", "Weather_Cloudy_Ambient_Loop_Sound_ID", "Weather_Cloudy_Ambient_Night_Color",
|
||||||
|
"Weather_Cloudy_Ambient_Sunrise_Color", "Weather_Cloudy_Ambient_Sunset_Color", "Weather_Cloudy_Cloud_Texture",
|
||||||
|
"Weather_Cloudy_Fog_Day_Color", "Weather_Cloudy_Fog_Night_Color", "Weather_Cloudy_Fog_Sunrise_Color",
|
||||||
|
"Weather_Cloudy_Fog_Sunset_Color", "Weather_Cloudy_Sky_Day_Color", "Weather_Cloudy_Sky_Night_Color",
|
||||||
|
"Weather_Cloudy_Sky_Sunrise_Color", "Weather_Cloudy_Sky_Sunset_Color", "Weather_Cloudy_Sun_Day_Color",
|
||||||
|
"Weather_Cloudy_Sun_Disc_Sunset_Color", "Weather_Cloudy_Sun_Night_Color", "Weather_Cloudy_Sun_Sunrise_Color",
|
||||||
|
"Weather_Cloudy_Sun_Sunset_Color", "Weather_EnvReduceColor", "Weather_Fog_Depth_Change_Speed",
|
||||||
|
"Weather_Foggy_Ambient_Day_Color", "Weather_Foggy_Ambient_Loop_Sound_ID", "Weather_Foggy_Ambient_Night_Color",
|
||||||
|
"Weather_Foggy_Ambient_Sunrise_Color", "Weather_Foggy_Ambient_Sunset_Color", "Weather_Foggy_Cloud_Texture",
|
||||||
|
"Weather_Foggy_Fog_Day_Color", "Weather_Foggy_Fog_Night_Color", "Weather_Foggy_Fog_Sunrise_Color",
|
||||||
|
"Weather_Foggy_Fog_Sunset_Color", "Weather_Foggy_Sky_Day_Color", "Weather_Foggy_Sky_Night_Color",
|
||||||
|
"Weather_Foggy_Sky_Sunrise_Color", "Weather_Foggy_Sky_Sunset_Color", "Weather_Foggy_Sun_Day_Color",
|
||||||
|
"Weather_Foggy_Sun_Disc_Sunset_Color", "Weather_Foggy_Sun_Night_Color", "Weather_Foggy_Sun_Sunrise_Color",
|
||||||
|
"Weather_Foggy_Sun_Sunset_Color", "Weather_LerpCloseColor", "Weather_Overcast_Ambient_Day_Color",
|
||||||
|
"Weather_Overcast_Ambient_Loop_Sound_ID", "Weather_Overcast_Ambient_Night_Color",
|
||||||
|
"Weather_Overcast_Ambient_Sunrise_Color", "Weather_Overcast_Ambient_Sunset_Color", "Weather_Overcast_Cloud_Texture",
|
||||||
|
"Weather_Overcast_Fog_Day_Color", "Weather_Overcast_Fog_Night_Color", "Weather_Overcast_Fog_Sunrise_Color",
|
||||||
|
"Weather_Overcast_Fog_Sunset_Color", "Weather_Overcast_Sky_Day_Color", "Weather_Overcast_Sky_Night_Color",
|
||||||
|
"Weather_Overcast_Sky_Sunrise_Color", "Weather_Overcast_Sky_Sunset_Color", "Weather_Overcast_Sun_Day_Color",
|
||||||
|
"Weather_Overcast_Sun_Disc_Sunset_Color", "Weather_Overcast_Sun_Night_Color", "Weather_Overcast_Sun_Sunrise_Color",
|
||||||
|
"Weather_Overcast_Sun_Sunset_Color", "Weather_Rain_Ambient_Day_Color", "Weather_Rain_Ambient_Loop_Sound_ID",
|
||||||
|
"Weather_Rain_Ambient_Night_Color", "Weather_Rain_Ambient_Sunrise_Color", "Weather_Rain_Ambient_Sunset_Color",
|
||||||
|
"Weather_Rain_Cloud_Texture", "Weather_Rain_Fog_Day_Color", "Weather_Rain_Fog_Night_Color",
|
||||||
|
"Weather_Rain_Fog_Sunrise_Color", "Weather_Rain_Fog_Sunset_Color", "Weather_Rain_Rain_Loop_Sound_ID",
|
||||||
|
"Weather_Rain_Ripple_Radius", "Weather_Rain_Ripples", "Weather_Rain_Ripple_Scale", "Weather_Rain_Ripple_Speed",
|
||||||
|
"Weather_Rain_Ripples_Per_Drop", "Weather_Rain_Sky_Day_Color", "Weather_Rain_Sky_Night_Color",
|
||||||
|
"Weather_Rain_Sky_Sunrise_Color", "Weather_Rain_Sky_Sunset_Color", "Weather_Rain_Sun_Day_Color",
|
||||||
|
"Weather_Rain_Sun_Disc_Sunset_Color", "Weather_Rain_Sun_Night_Color", "Weather_Rain_Sun_Sunrise_Color",
|
||||||
|
"Weather_Rain_Sun_Sunset_Color", "Weather_Snow_Ambient_Day_Color", "Weather_Snow_Ambient_Loop_Sound_ID",
|
||||||
|
"Weather_Snow_Ambient_Night_Color", "Weather_Snow_Ambient_Sunrise_Color", "Weather_Snow_Ambient_Sunset_Color",
|
||||||
|
"Weather_Snow_Cloud_Texture", "Weather_Snow_Fog_Day_Color", "Weather_Snow_Fog_Night_Color",
|
||||||
|
"Weather_Snow_Fog_Sunrise_Color", "Weather_Snow_Fog_Sunset_Color", "Weather_Snow_Gravity_Scale",
|
||||||
|
"Weather_Snow_High_Kill", "Weather_Snow_Low_Kill", "Weather_Snow_Max_Snowflakes", "Weather_Snow_Ripple_Radius",
|
||||||
|
"Weather_Snow_Ripples", "Weather_Snow_Ripple_Scale", "Weather_Snow_Ripple_Speed", "Weather_Snow_Ripples_Per_Flake",
|
||||||
|
"Weather_Snow_Sky_Day_Color", "Weather_Snow_Sky_Night_Color", "Weather_Snow_Sky_Sunrise_Color",
|
||||||
|
"Weather_Snow_Sky_Sunset_Color", "Weather_Snow_Snow_Diameter", "Weather_Snow_Snow_Entrance_Speed",
|
||||||
|
"Weather_Snow_Snow_Height_Max", "Weather_Snow_Snow_Height_Min", "Weather_Snow_Snow_Threshold",
|
||||||
|
"Weather_Snow_Sun_Day_Color", "Weather_Snow_Sun_Disc_Sunset_Color", "Weather_Snow_Sun_Night_Color",
|
||||||
|
"Weather_Snow_Sun_Sunrise_Color", "Weather_Snow_Sun_Sunset_Color", "Weather_Sun_Glare_Fader_Color",
|
||||||
|
"Weather_Thunderstorm_Ambient_Day_Color", "Weather_Thunderstorm_Ambient_Loop_Sound_ID",
|
||||||
|
"Weather_Thunderstorm_Ambient_Night_Color", "Weather_Thunderstorm_Ambient_Sunrise_Color",
|
||||||
|
"Weather_Thunderstorm_Ambient_Sunset_Color", "Weather_Thunderstorm_Cloud_Texture",
|
||||||
|
"Weather_Thunderstorm_Fog_Day_Color", "Weather_Thunderstorm_Fog_Night_Color",
|
||||||
|
"Weather_Thunderstorm_Fog_Sunrise_Color", "Weather_Thunderstorm_Fog_Sunset_Color",
|
||||||
|
"Weather_Thunderstorm_Rain_Loop_Sound_ID", "Weather_Thunderstorm_Sky_Day_Color",
|
||||||
|
"Weather_Thunderstorm_Sky_Night_Color", "Weather_Thunderstorm_Sky_Sunrise_Color",
|
||||||
|
"Weather_Thunderstorm_Sky_Sunset_Color", "Weather_Thunderstorm_Sun_Day_Color",
|
||||||
|
"Weather_Thunderstorm_Sun_Disc_Sunset_Color", "Weather_Thunderstorm_Sun_Night_Color",
|
||||||
|
"Weather_Thunderstorm_Sun_Sunrise_Color", "Weather_Thunderstorm_Sun_Sunset_Color",
|
||||||
|
"Weather_Thunderstorm_Thunder_Sound_ID_0", "Weather_Thunderstorm_Thunder_Sound_ID_1",
|
||||||
|
"Weather_Thunderstorm_Thunder_Sound_ID_2", "Weather_Thunderstorm_Thunder_Sound_ID_3", "Weather_Timescale_Clouds",
|
||||||
|
"Weather_Clear_Thunder_Sound_ID_0", "Weather_Clear_Thunder_Sound_ID_1", "Weather_Clear_Thunder_Sound_ID_2",
|
||||||
|
"Weather_Clear_Thunder_Sound_ID_3", "Weather_Cloudy_Thunder_Sound_ID_0", "Weather_Cloudy_Thunder_Sound_ID_1",
|
||||||
|
"Weather_Cloudy_Thunder_Sound_ID_2", "Weather_Cloudy_Thunder_Sound_ID_3", "Weather_Foggy_Thunder_Sound_ID_0",
|
||||||
|
"Weather_Foggy_Thunder_Sound_ID_1", "Weather_Foggy_Thunder_Sound_ID_2", "Weather_Foggy_Thunder_Sound_ID_3",
|
||||||
|
"Weather_Overcast_Thunder_Sound_ID_0", "Weather_Overcast_Thunder_Sound_ID_1", "Weather_Overcast_Thunder_Sound_ID_2",
|
||||||
|
"Weather_Overcast_Thunder_Sound_ID_3", "Weather_Rain_Thunder_Sound_ID_0", "Weather_Rain_Thunder_Sound_ID_1",
|
||||||
|
"Weather_Rain_Thunder_Sound_ID_2", "Weather_Rain_Thunder_Sound_ID_3", "Weather_Ashstorm_Cloud_Texture",
|
||||||
|
"Weather_Ashstorm_Sky_Sunrise_Color", "Weather_Ashstorm_Sky_Day_Color", "Weather_Ashstorm_Sky_Sunset_Color",
|
||||||
|
"Weather_Ashstorm_Sky_Night_Color", "Weather_Ashstorm_Fog_Sunrise_Color", "Weather_Ashstorm_Fog_Day_Color",
|
||||||
|
"Weather_Ashstorm_Fog_Sunset_Color", "Weather_Ashstorm_Fog_Night_Color", "Weather_Ashstorm_Ambient_Sunrise_Color",
|
||||||
|
"Weather_Ashstorm_Ambient_Day_Color", "Weather_Ashstorm_Ambient_Sunset_Color",
|
||||||
|
"Weather_Ashstorm_Ambient_Night_Color", "Weather_Ashstorm_Sun_Sunrise_Color", "Weather_Ashstorm_Sun_Day_Color",
|
||||||
|
"Weather_Ashstorm_Sun_Sunset_Color", "Weather_Ashstorm_Sun_Night_Color", "Weather_Ashstorm_Sun_Disc_Sunset_Color",
|
||||||
|
"Weather_Ashstorm_Thunder_Sound_ID_0", "Weather_Ashstorm_Thunder_Sound_ID_1", "Weather_Ashstorm_Thunder_Sound_ID_2",
|
||||||
|
"Weather_Ashstorm_Thunder_Sound_ID_3", "Weather_Ashstorm_Ambient_Loop_Sound_ID", "Weather_Blight_Cloud_Texture",
|
||||||
|
"Weather_Blight_Sky_Sunrise_Color", "Weather_Blight_Sky_Day_Color", "Weather_Blight_Sky_Sunset_Color",
|
||||||
|
"Weather_Blight_Sky_Night_Color", "Weather_Blight_Fog_Sunrise_Color", "Weather_Blight_Fog_Day_Color",
|
||||||
|
"Weather_Blight_Fog_Sunset_Color", "Weather_Blight_Fog_Night_Color", "Weather_Blight_Ambient_Sunrise_Color",
|
||||||
|
"Weather_Blight_Ambient_Day_Color", "Weather_Blight_Ambient_Sunset_Color", "Weather_Blight_Ambient_Night_Color",
|
||||||
|
"Weather_Blight_Sun_Sunrise_Color", "Weather_Blight_Sun_Day_Color", "Weather_Blight_Sun_Sunset_Color",
|
||||||
|
"Weather_Blight_Sun_Night_Color", "Weather_Blight_Sun_Disc_Sunset_Color", "Weather_Blight_Thunder_Sound_ID_0",
|
||||||
|
"Weather_Blight_Thunder_Sound_ID_1", "Weather_Blight_Thunder_Sound_ID_2", "Weather_Blight_Thunder_Sound_ID_3",
|
||||||
|
"Weather_Blight_Ambient_Loop_Sound_ID", "Weather_Snow_Thunder_Sound_ID_0", "Weather_Snow_Thunder_Sound_ID_1",
|
||||||
|
"Weather_Snow_Thunder_Sound_ID_2", "Weather_Snow_Thunder_Sound_ID_3", "Weather_Blizzard_Thunder_Sound_ID_0",
|
||||||
|
"Weather_Blizzard_Thunder_Sound_ID_1", "Weather_Blizzard_Thunder_Sound_ID_2",
|
||||||
|
"Weather_Blizzard_Thunder_Sound_ID_3" };
|
||||||
|
|
||||||
|
static const std::set<std::string, std::less<>> allowedKeysUnused = { "Inventory_UniformScaling", "Movies_Game_Logo",
|
||||||
|
"Movies_Loading", "Movies_Options_Menu", "Movies_Project_Logo", "Water_MaxNumberRipples",
|
||||||
|
"Water_NearWaterUnderwaterFreq", "Water_NearWaterUnderwaterVolume", "Water_RippleAlphas", "Water_RippleScale",
|
||||||
|
"Water_SurfaceTextureSize", "Water_TileTextureDivisor", "Weather_AlphaReduce" };
|
||||||
|
|
||||||
|
bool Fallback::isAllowedIntFallbackKey(std::string_view key)
|
||||||
|
{
|
||||||
|
return allowedKeysInt.contains(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Fallback::isAllowedFloatFallbackKey(std::string_view key)
|
||||||
|
{
|
||||||
|
return allowedKeysFloat.contains(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Fallback::isAllowedNonNumericFallbackKey(std::string_view key)
|
||||||
|
{
|
||||||
|
return allowedKeysNonNumeric.contains(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Fallback::isAllowedUnusedFallbackKey(std::string_view key)
|
||||||
|
{
|
||||||
|
return allowedKeysUnused.contains(key);
|
||||||
|
}
|
||||||
|
|
||||||
void Fallback::validate(boost::any& v, std::vector<std::string> const& tokens, FallbackMap*, int)
|
void Fallback::validate(boost::any& v, std::vector<std::string> const& tokens, FallbackMap*, int)
|
||||||
{
|
{
|
||||||
|
@ -5,10 +5,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
// Parses and validates a fallback map from boost program_options.
|
|
||||||
// Note: for boost to pick up the validate function, you need to pull in the namespace e.g.
|
|
||||||
// by using namespace Fallback;
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
class any;
|
class any;
|
||||||
@ -17,11 +13,19 @@ namespace boost
|
|||||||
namespace Fallback
|
namespace Fallback
|
||||||
{
|
{
|
||||||
|
|
||||||
|
bool isAllowedIntFallbackKey(std::string_view key);
|
||||||
|
bool isAllowedFloatFallbackKey(std::string_view key);
|
||||||
|
bool isAllowedNonNumericFallbackKey(std::string_view key);
|
||||||
|
bool isAllowedUnusedFallbackKey(std::string_view key); // imported from Morrowind.ini but unused
|
||||||
|
|
||||||
struct FallbackMap
|
struct FallbackMap
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string> mMap;
|
std::map<std::string, std::string> mMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Parses and validates a fallback map from boost program_options.
|
||||||
|
// Note: for boost to pick up the validate function, you need to pull in the namespace e.g.
|
||||||
|
// by using namespace Fallback;
|
||||||
void validate(boost::any& v, std::vector<std::string> const& tokens, FallbackMap*, int);
|
void validate(boost::any& v, std::vector<std::string> const& tokens, FallbackMap*, int);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
scripts/data/integration_tests/test_lua_api/openmw.cfg
Normal file
6
scripts/data/integration_tests/test_lua_api/openmw.cfg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
content=test.omwscripts
|
||||||
|
|
||||||
|
# Needed to test `core.getGMST`
|
||||||
|
fallback=Water_RippleFrameCount,4
|
||||||
|
fallback=Inventory_DirectionalDiffuseR,0.5
|
||||||
|
fallback=Level_Up_Level2,something
|
@ -51,6 +51,13 @@ local function testTeleport()
|
|||||||
testing.expectEqualWithDelta(player.rotation.z, math.rad(-90), 0.05, 'teleporting changes rotation')
|
testing.expectEqualWithDelta(player.rotation.z, math.rad(-90), 0.05, 'teleporting changes rotation')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function testGetGMST()
|
||||||
|
testing.expectEqual(core.getGMST('non-existed gmst'), nil)
|
||||||
|
testing.expectEqual(core.getGMST('Water_RippleFrameCount'), 4)
|
||||||
|
testing.expectEqual(core.getGMST('Inventory_DirectionalDiffuseR'), 0.5)
|
||||||
|
testing.expectEqual(core.getGMST('Level_Up_Level2'), 'something')
|
||||||
|
end
|
||||||
|
|
||||||
local function initPlayer()
|
local function initPlayer()
|
||||||
player:teleport('', util.vector3(4096, 4096, 867.237), util.vector3(0, 0, 0))
|
player:teleport('', util.vector3(4096, 4096, 867.237), util.vector3(0, 0, 0))
|
||||||
coroutine.yield()
|
coroutine.yield()
|
||||||
@ -83,6 +90,7 @@ tests = {
|
|||||||
testing.runLocalTest(player, 'castNavigationRay')
|
testing.runLocalTest(player, 'castNavigationRay')
|
||||||
end},
|
end},
|
||||||
{'teleport', testTeleport},
|
{'teleport', testTeleport},
|
||||||
|
{'getGMST', testGetGMST},
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -51,7 +51,9 @@ def runTest(name):
|
|||||||
"content=template.omwgame\n",
|
"content=template.omwgame\n",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if (test_dir / "test.omwscripts").exists():
|
if (test_dir / "openmw.cfg").exists():
|
||||||
|
omw_cfg.write(open(test_dir / "openmw.cfg").read())
|
||||||
|
elif (test_dir / "test.omwscripts").exists():
|
||||||
omw_cfg.write("content=test.omwscripts\n")
|
omw_cfg.write("content=test.omwscripts\n")
|
||||||
with open(config_dir / "settings.cfg", "a", encoding="utf-8") as settings_cfg:
|
with open(config_dir / "settings.cfg", "a", encoding="utf-8") as settings_cfg:
|
||||||
settings_cfg.write(
|
settings_cfg.write(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user