VideoCommon: pass a graphics mod base path to the graphics mod, so it can lookup other relative files if necessary
This commit is contained in:
parent
fbb3db71b2
commit
20dc4401c5
|
@ -10,7 +10,8 @@
|
||||||
|
|
||||||
namespace GraphicsModActionFactory
|
namespace GraphicsModActionFactory
|
||||||
{
|
{
|
||||||
std::unique_ptr<GraphicsModAction> Create(std::string_view name, const picojson::value& json_data)
|
std::unique_ptr<GraphicsModAction> Create(std::string_view name, const picojson::value& json_data,
|
||||||
|
std::string_view path)
|
||||||
{
|
{
|
||||||
if (name == "print")
|
if (name == "print")
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,5 +12,6 @@
|
||||||
|
|
||||||
namespace GraphicsModActionFactory
|
namespace GraphicsModActionFactory
|
||||||
{
|
{
|
||||||
std::unique_ptr<GraphicsModAction> Create(std::string_view name, const picojson::value& json_data);
|
std::unique_ptr<GraphicsModAction> Create(std::string_view name, const picojson::value& json_data,
|
||||||
|
std::string_view path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <variant>
|
#include <variant>
|
||||||
|
|
||||||
#include "Common/Logging/Log.h"
|
#include "Common/Logging/Log.h"
|
||||||
|
#include "Common/StringUtil.h"
|
||||||
#include "Common/VariantUtil.h"
|
#include "Common/VariantUtil.h"
|
||||||
|
|
||||||
#include "Core/ConfigManager.h"
|
#include "Core/ConfigManager.h"
|
||||||
|
@ -198,7 +199,10 @@ void GraphicsModManager::Load(const GraphicsModGroupConfig& config)
|
||||||
const auto create_action =
|
const auto create_action =
|
||||||
[](const std::string_view& action_name, const picojson::value& json_data,
|
[](const std::string_view& action_name, const picojson::value& json_data,
|
||||||
GraphicsModConfig mod_config) -> std::unique_ptr<GraphicsModAction> {
|
GraphicsModConfig mod_config) -> std::unique_ptr<GraphicsModAction> {
|
||||||
auto action = GraphicsModActionFactory::Create(action_name, json_data);
|
std::string base_path;
|
||||||
|
SplitPath(mod_config.GetAbsolutePath(), &base_path, nullptr, nullptr);
|
||||||
|
|
||||||
|
auto action = GraphicsModActionFactory::Create(action_name, json_data, base_path);
|
||||||
if (action == nullptr)
|
if (action == nullptr)
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Reference in New Issue