mirror of
https://github.com/Winded/StopMotionHelper.git
synced 2025-03-04 03:13:33 -05:00
Fixes to overwrite prompt not working with the folder system, as well as made quicksave copying abide folder system too
This commit is contained in:
parent
019180956f
commit
b4fd710a31
@ -283,7 +283,7 @@ function CTRL.QuickSave()
|
||||
local qs1 = "quicksave_" .. nick
|
||||
local qs2 = "quicksave_" .. nick .. "_backup"
|
||||
|
||||
SMH.Saves.CopyIfExists(qs1, qs2)
|
||||
SMH.Saves.CopyIfExists(qs1, qs2, LocalPlayer())
|
||||
CTRL.Save(qs1, false)
|
||||
end
|
||||
|
||||
|
@ -333,7 +333,7 @@ local function RequestSave(msgLength, player)
|
||||
if not isFolder then
|
||||
local properties = SMH.PropertiesManager.GetAllProperties(player)
|
||||
|
||||
local fileExists = SMH.Saves.CheckIfExists(path)
|
||||
local fileExists = SMH.Saves.CheckIfExists(path, player)
|
||||
|
||||
if fileExists then
|
||||
local names = SMH.Saves.GetUnusedNames(path, properties, player)
|
||||
|
@ -181,12 +181,12 @@ function MGR.Serialize(keyframes, properties, player)
|
||||
return serializedKeyframes
|
||||
end
|
||||
|
||||
function MGR.CheckIfExists(path)
|
||||
function MGR.CheckIfExists(path, player)
|
||||
if not file.Exists(SaveDir, "DATA") or not file.IsDir(SaveDir, "DATA") then
|
||||
file.CreateDir(SaveDir)
|
||||
end
|
||||
|
||||
path = SaveDir .. path .. ".txt"
|
||||
path = SaveDir .. (PlayerPath[player] or "") .. path .. ".txt"
|
||||
if file.Exists(path, "DATA") and not file.IsDir(path, "DATA") then return true end
|
||||
|
||||
return false
|
||||
@ -274,9 +274,9 @@ function MGR.AddFolder(path, player)
|
||||
return path
|
||||
end
|
||||
|
||||
function MGR.CopyIfExists(pathFrom, pathTo)
|
||||
pathFrom = SaveDir .. pathFrom .. ".txt"
|
||||
pathTo = SaveDir .. pathTo .. ".txt"
|
||||
function MGR.CopyIfExists(pathFrom, pathTo, player)
|
||||
pathFrom = SaveDir .. (PlayerPath[player] or "") .. pathFrom .. ".txt"
|
||||
pathTo = SaveDir .. (PlayerPath[player] or "") .. pathTo .. ".txt"
|
||||
|
||||
if file.Exists(pathFrom, "DATA") then
|
||||
file.Write(pathTo, file.Read(pathFrom));
|
||||
|
Loading…
Reference in New Issue
Block a user