Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/Core/Common/CommonPaths.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#define ANAGLYPH_DIR "Anaglyph"
#define PIPES_DIR "Pipes"
#define MEMORYWATCHER_DIR "MemoryWatcher"
#define SCRIPTS_DIR "Scripts"

// This one is only used to remove it if it was present
#define SHADERCACHE_LEGACY_DIR "ShaderCache"
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/FileUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ static void RebuildUserDirectories(unsigned int dir_index)
s_user_paths[F_GCSRAM_IDX] = s_user_paths[D_GCUSER_IDX] + GC_SRAM;

s_user_paths[D_MEMORYWATCHER_IDX] = s_user_paths[D_USER_IDX] + MEMORYWATCHER_DIR DIR_SEP;
s_user_paths[D_SCRIPTS_IDX] = s_user_paths[D_USER_IDX] + SCRIPTS_DIR DIR_SEP;
s_user_paths[F_MEMORYWATCHERLOCATIONS_IDX] = s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_LOCATIONS;
s_user_paths[F_MEMORYWATCHERSOCKET_IDX] = s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_SOCKET;

Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/FileUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ enum {
D_THEMES_IDX,
D_PIPES_IDX,
D_MEMORYWATCHER_IDX,
D_SCRIPTS_IDX,
F_DOLPHINCONFIG_IDX,
F_DEBUGGERCONFIG_IDX,
F_LOGGERCONFIG_IDX,
Expand Down
7 changes: 3 additions & 4 deletions Source/Core/Core/LUA/Lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ int GetGameID(lua_State* L)

int GetScriptsDir(lua_State* L)
{
lua_pushstring(L, (SYSDATA_DIR "/Scripts/"));
lua_pushstring(L, File::GetUserPath(D_SCRIPTS_IDX));
return 1;
}

Expand Down Expand Up @@ -899,8 +899,7 @@ namespace Lua

//Auto launch Scripts that start with _


std::vector<std::string> rFilenames = DoFileSearch({".lua"}, {SYSDATA_DIR "/Scripts"});
std::vector<std::string> rFilenames = DoFileSearch({".lua"}, {File::GetUserPath(D_SCRIPTS_IDX)});

if (rFilenames.size() > 0)
{
Expand Down Expand Up @@ -1019,7 +1018,7 @@ namespace Lua
//Unique to normal Scripts
lua_register(it->luaState, "CancelScript", CancelScript);

std::string file = SYSDATA_DIR "/Scripts/" + it->fileName;
std::string file = File::GetUserPath(D_SCRIPTS_IDX) + it->fileName;

status = luaL_dofile(it->luaState, file.c_str());

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/DolphinWX/LaunchLuaScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void LuaWindow::OnButtonPressed(wxCommandEvent& event)

if (event.GetId() == 2) //Start
{
if (File::Exists(SYSDATA_DIR "/Scripts/" + FileName) == false)
if (File::Exists(File::GetUserPath(D_SCRIPTS_IDX) + FileName) == false)
{
wxMessageBox("Script file does not exist anymore!");
return;
Expand Down Expand Up @@ -152,7 +152,7 @@ void LuaWindow::Shown()
m_choice_script->Clear();

//Find all Lua files
std::vector<std::string> rFilenames = DoFileSearch({".lua"}, {SYSDATA_DIR "/Scripts" });
std::vector<std::string> rFilenames = DoFileSearch({".lua"}, {File::GetUserPath(D_SCRIPTS_IDX)});

if (rFilenames.size() > 0)
{
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/UICommon/UICommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ void CreateDirectories()
File::CopyDir(File::GetSysDirectory() + WII_USER_DIR,
File::GetUserPath(D_WIIROOT_IDX));

// Copy built-in scripts.
File::CopyDir(File::GetSysDirectory() + SCRIPTS_DIR,
File::GetUserPath(D_SCRIPTS_IDX));

File::CreateFullPath(File::GetUserPath(D_USER_IDX));
File::CreateFullPath(File::GetUserPath(D_CACHE_IDX));
File::CreateFullPath(File::GetUserPath(D_CONFIG_IDX));
Expand Down