Skip to content

Commit

Permalink
Merge pull request #22 from ModOrganizer2/loot_0_22
Browse files Browse the repository at this point in the history
Support for 0.22 and Starfield
  • Loading branch information
Silarn authored Oct 3, 2023
2 parents 9783e49 + 64083e7 commit 2d0a4c5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
14 changes: 14 additions & 0 deletions src/game_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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");
}
Expand Down Expand Up @@ -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");
}
Expand All @@ -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");
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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");
}
Expand Down
3 changes: 2 additions & 1 deletion src/game_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ enum struct GameId : uint8_t
fo3,
fonv,
fo4,
fo4vr
fo4vr,
starfield
};

GameType GetGameType(const GameId gameId);
Expand Down
15 changes: 8 additions & 7 deletions src/lootthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 2d0a4c5

Please sign in to comment.