Skip to content

Commit 18c79df

Browse files
committed
1 parent b85d550 commit 18c79df

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/Modules/Main.lua

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ function main:Init()
8383
-- If running in dev mode or standalone mode, put user data in the script path
8484
self.userPath = GetScriptPath().."/"
8585
else
86-
local invalidPath
87-
self.userPath, invalidPath = GetUserPath()
86+
local invalidPath, errMsg
87+
self.userPath, invalidPath, errMsg = GetUserPath()
8888
if not self.userPath then
89-
self:OpenPathPopup(invalidPath, ignoreBuild)
89+
self:OpenPathPopup(invalidPath, errMsg, ignoreBuild)
9090
else
9191
self.userPath = self.userPath.."/Path of Building/"
9292
end
@@ -769,17 +769,23 @@ function main:SaveSettings()
769769
end
770770
end
771771

772-
function main:OpenPathPopup(invalidPath, ignoreBuild)
772+
function main:OpenPathPopup(invalidPath, errMsg, ignoreBuild)
773773
local controls = { }
774774
local defaultLabelPlacementX = 8
775775

776776
controls.label = new("LabelControl", { "TOPLEFT", nil, "TOPLEFT" }, { defaultLabelPlacementX, 20, 206, 16 }, function()
777-
return "^7User settings path contains unicode characters and cannot be loaded."..
777+
return "^7User settings path cannot be loaded: ".. errMsg ..
778778
"\nCurrent Path: "..invalidPath:gsub("?", "^1?^7").."/Path of Building/"..
779+
<<<<<<<
779780
"\nSpecify a new location for your Settings.xml:"
780781
end)
781782
controls.explainButton = new("ButtonControl", { "LEFT", controls.label, "RIGHT" }, { 4, 0, 20, 20 }, "?", function()
782783
OpenURL("https://github.com/PathOfBuildingCommunity/PathOfBuilding/wiki/Why-do-I-have-to-change-my-Settings-path%3F")
784+
=======
785+
"\nIf this location is managed by OneDrive, navigate to that folder and manually try" ..
786+
"\nto open Settings.xml in a text editor before re-opening Path of Building" ..
787+
"\nOtherwise, specify a new location for your Settings.xml:"
788+
>>>>>>>
783789
end)
784790
controls.userPath = new("EditControl", { "TOPLEFT", controls.label, "TOPLEFT" }, { 0, 60, 206, 20 }, invalidPath, nil, nil, nil, function(buf)
785791
invalidPath = sanitiseText(buf)

src/UpdateCheck.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,15 @@ end
8989
ConPrintf("Checking for update...")
9090

9191
-- Use built-in helpers to obtain absolute paths without spawning a shell.
92+
<<<<<<<
9293
local scriptPath = (GetScriptPath and GetScriptPath()) or "."
9394
local runtimePath = (GetRuntimePath and GetRuntimePath()) or scriptPath
95+
=======
96+
local scriptPath, scriptFallback = GetScriptPath()
97+
scriptPath = scriptPath or scriptFallback or "."
98+
local runtimePath, runtimeFallback = GetRuntimePath()
99+
runtimePath = runtimePath or runtimeFallback or scriptPath
100+
>>>>>>>
94101

95102
-- Load and process local manifest
96103
local localVer

0 commit comments

Comments
 (0)