cellGem: implement real ps move handler

This commit is contained in:
Megamouse 2024-07-08 20:17:21 +02:00
parent e7faec6b0e
commit b89cc9b973
34 changed files with 3628 additions and 130 deletions

View file

@ -0,0 +1,40 @@
#include "stdafx.h"
#include "ps_move_config.h"
LOG_CHANNEL(ps_move);
cfg_ps_moves g_cfg_move;
cfg_ps_moves::cfg_ps_moves()
: cfg::node()
#ifdef _WIN32
, path(fs::get_config_dir() + "config/ps_move.yml")
#else
, path(fs::get_config_dir() + "ps_move.yml")
#endif
{
}
bool cfg_ps_moves::load()
{
ps_move.notice("Loading PS Move config from '%s'", path);
if (fs::file cfg_file{ path, fs::read })
{
return from_string(cfg_file.to_string());
}
ps_move.notice("PS Move config missing. Using default settings. Path: %s", path);
from_default();
return false;
}
void cfg_ps_moves::save() const
{
ps_move.notice("Saving PS Move config to '%s'", path);
if (!cfg::node::save(path))
{
ps_move.error("Failed to save PS Move config to '%s' (error=%s)", path, fs::g_tls_error);
}
}