Skip to content

Commit

Permalink
per game config.yml (#2418)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemoralis authored and Nekotekina committed Feb 23, 2017
1 parent 5fce74a commit 3e0c356
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Utilities/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ std::string fs::get_data_dir(const std::string& prefix, const std::string& locat
{
static const std::string s_dir = []
{
const std::string& dir = get_config_dir() + "/data/";
const std::string& dir = get_config_dir() + "data/";

if (!is_dir(dir) && !create_path(dir))
{
Expand Down
4 changes: 2 additions & 2 deletions rpcs3/Emu/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ void Emulator::Load()
}

// Load custom config-1
if (fs::file cfg_file{m_cache_path + "config.yml"})
if (fs::file cfg_file{ fs::get_config_dir() + "data/" + m_title_id + "/config.yml" })
{
LOG_NOTICE(LOADER, "Applying custom config (config.yml)");
LOG_NOTICE(LOADER, "Applying custom config %s", fs::get_config_dir() + "data/" + m_title_id + "/config.yml");
cfg::root.from_string(cfg_file.to_string());
}

Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Gui/GameViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ void GameViewer::ConfigureGame(wxCommandEvent& WXUNUSED(event))
{
long i = GetFirstSelected();
if (i < 0) return;

LOG_TODO(LOADER, "Configure: %s", m_game_data[i].root);
SettingsDialog(this, fs::get_config_dir() + "data/" + m_game_data[i].root + "/config.yml");
}

void GameViewer::RemoveGame(wxCommandEvent& event)
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Gui/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ void MainFrame::SendOpenCloseSysMenu(wxCommandEvent& event)

void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
{
SettingsDialog(this);
SettingsDialog(this,"");
}

void MainFrame::ConfigPad(wxCommandEvent& WXUNUSED(event))
Expand Down
5 changes: 3 additions & 2 deletions rpcs3/Gui/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,15 @@ struct textctrl_pad : cfg_adapter
};


SettingsDialog::SettingsDialog(wxWindow* parent)
SettingsDialog::SettingsDialog(wxWindow* parent, const wxString& pergameload)
: wxDialog(parent, wxID_ANY, "Settings", wxDefaultPosition)
{
// Load default config
loaded = YAML::Load(g_cfg_defaults);

// Incrementally load config.yml
const fs::file config(fs::get_config_dir() + "/config.yml", fs::read + fs::write + fs::create);
const fs::file config(!pergameload.IsEmpty() ? pergameload.ToStdString() : fs::get_config_dir() + "/config.yml", fs::read + fs::write + fs::create);

loaded += YAML::Load(config.to_string());

std::vector<std::unique_ptr<cfg_adapter>> pads;
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Gui/SettingsDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class SettingsDialog : public wxDialog
{
public:
SettingsDialog(wxWindow* parent);
SettingsDialog(wxWindow* parent, const wxString& pergameload);

private:
wxCheckListBox* chbox_list_core_lle;
Expand Down

0 comments on commit 3e0c356

Please sign in to comment.