update resolvers
This commit is contained in:
@ -240,6 +240,47 @@ auto resolver::file_data(const std::string& name) -> std::tuple<const std::strin
|
||||
throw error("couldn't open gsc file '" + name + "'");
|
||||
}
|
||||
|
||||
std::set<std::string_view> paths
|
||||
{
|
||||
"character"sv,
|
||||
"codescripts"sv,
|
||||
"common_scripts"sv,
|
||||
"destructible_scripts"sv,
|
||||
"maps"sv,
|
||||
"mptype"sv,
|
||||
"soundscripts"sv,
|
||||
"vehicle_scripts"sv,
|
||||
"xmodelalias"sv,
|
||||
"maps/animated_models"sv,
|
||||
"maps/createart"sv,
|
||||
"maps/createfx"sv,
|
||||
"maps/mp"sv,
|
||||
"maps/mp/gametypes"sv,
|
||||
"maps/mp/killstreaks"sv,
|
||||
"maps/mp/perks"sv,
|
||||
};
|
||||
|
||||
auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path
|
||||
{
|
||||
auto result = std::filesystem::path();
|
||||
auto root = false;
|
||||
|
||||
for (auto& entry : file)
|
||||
{
|
||||
if (!root && paths.contains(entry.string()))
|
||||
{
|
||||
result = entry;
|
||||
root = true;
|
||||
}
|
||||
else if (paths.contains(result.string()))
|
||||
{
|
||||
result /= entry;
|
||||
}
|
||||
}
|
||||
|
||||
return result.empty() ? file : result;
|
||||
}
|
||||
|
||||
const std::array<std::pair<std::uint8_t, const char*>, 154> opcode_list
|
||||
{{
|
||||
{ 0x17, "SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0" },
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
|
||||
static auto make_token(std::string_view str) -> std::string;
|
||||
static auto file_data(const std::string& name) -> std::tuple<const std::string*, char*, size_t>;
|
||||
static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path;
|
||||
};
|
||||
|
||||
} // namespace xsk::gsc::h1
|
||||
|
Reference in New Issue
Block a user