Merge pull request #22 from ModOrganizer2/loot_0_22

Support for 0.22 and Starfield
This commit is contained in:
Jeremy Rimpo
2023-10-03 15:38:42 -05:00
committed by GitHub
3 changed files with 24 additions and 8 deletions
+14
View File
@@ -9,6 +9,7 @@ static constexpr float SKYRIM_FO3_MINIMUM_HEADER_VERSION = 0.94f;
static constexpr float SKYRIM_SE_MINIMUM_HEADER_VERSION = 1.7f;
static constexpr float FONV_MINIMUM_HEADER_VERSION = 1.32f;
static constexpr float FO4_MINIMUM_HEADER_VERSION = 0.95f;
static constexpr float STARFIELD_MINIMUM_HEADER_VERSION = 0.96f;
GameType GetGameType(const GameId gameId)
{
@@ -34,6 +35,8 @@ GameType GetGameType(const GameId gameId)
return GameType::fo4;
case GameId::fo4vr:
return GameType::fo4vr;
case GameId::starfield:
return GameType::starfield;
default:
throw std::logic_error("Unrecognised game ID");
}
@@ -61,6 +64,8 @@ float GetMinimumHeaderVersion(const GameId gameId)
case GameId::fo4:
case GameId::fo4vr:
return FO4_MINIMUM_HEADER_VERSION;
case GameId::starfield:
return STARFIELD_MINIMUM_HEADER_VERSION;
default:
throw std::logic_error("Unrecognised game ID");
}
@@ -82,6 +87,7 @@ std::string GetPluginsFolderName(GameId gameId)
case GameId::fonv:
case GameId::fo4:
case GameId::fo4vr:
case GameId::starfield:
return "Data";
default:
throw std::logic_error("Unrecognised game ID");
@@ -115,6 +121,8 @@ std::string ToString(const GameId gameId)
return "Fallout4";
case GameId::fo4vr:
return "Fallout4VR";
case GameId::starfield:
return "Starfield";
default:
throw std::logic_error("Unrecognised game ID");
}
@@ -148,6 +156,8 @@ std::string GetMasterFilename(const GameId gameId)
case GameId::fo4:
case GameId::fo4vr:
return "Fallout4.esm";
case GameId::starfield:
return "Starfield.esm";
default:
throw std::logic_error("Unrecognised game ID");
}
@@ -180,6 +190,8 @@ std::string GetGameName(const GameId gameId)
return "Fallout 4";
case GameId::fo4vr:
return "Fallout 4 VR";
case GameId::starfield:
return "Starfield";
default:
throw std::logic_error("Unrecognised game ID");
}
@@ -210,6 +222,8 @@ std::string GetDefaultMasterlistRepositoryName(const GameId gameId)
return "fallout4";
case GameId::fo4vr:
return "fallout4vr";
case GameId::starfield:
return "starfield";
default:
throw std::logic_error("Unrecognised game type");
}
+2 -1
View File
@@ -29,7 +29,8 @@ enum struct GameId : uint8_t
fo3,
fonv,
fo4,
fo4vr
fo4vr,
starfield
};
GameType GetGameType(const GameId gameId);
+8 -7
View File
@@ -19,7 +19,7 @@ namespace lootcli
{
static const std::set<std::string> oldDefaultBranches({"master", "v0.7", "v0.8",
"v0.10", "v0.13", "v0.14",
"v0.15", "v0.17"});
"v0.15", "v0.17", "v0.18"});
static const std::regex GITHUB_REPO_URL_REGEX =
std::regex(R"(^https://github\.com/([^/]+)/([^/]+?)(?:\.git)?/?$)",
std::regex::ECMAScript | std::regex::icase);
@@ -55,12 +55,13 @@ std::string ToLower(std::string text)
void LOOTWorker::setGame(const std::string& gameName)
{
static std::map<std::string, loot::GameId> gameMap = {
{"morrowind", loot::GameId::tes3}, {"oblivion", loot::GameId::tes4},
{"fallout3", loot::GameId::fo3}, {"fallout4", loot::GameId::fo4},
{"fallout4vr", loot::GameId::fo4vr}, {"falloutnv", loot::GameId::fonv},
{"skyrim", loot::GameId::tes5}, {"skyrimse", loot::GameId::tes5se},
{"skyrimvr", loot::GameId::tes5vr}, {"nehrim", loot::GameId::nehrim},
{"enderal", loot::GameId::enderal}, {"enderalse", loot::GameId::enderalse}};
{"morrowind", loot::GameId::tes3}, {"oblivion", loot::GameId::tes4},
{"fallout3", loot::GameId::fo3}, {"fallout4", loot::GameId::fo4},
{"fallout4vr", loot::GameId::fo4vr}, {"falloutnv", loot::GameId::fonv},
{"skyrim", loot::GameId::tes5}, {"skyrimse", loot::GameId::tes5se},
{"skyrimvr", loot::GameId::tes5vr}, {"nehrim", loot::GameId::nehrim},
{"enderal", loot::GameId::enderal}, {"enderalse", loot::GameId::enderalse},
{"starfield", loot::GameId::starfield}};
auto iter = gameMap.find(ToLower(gameName));