Skip to content

Commit b2ec4dc

Browse files
committed
Fixed bad default paths when trying to export from an unsaved project and no base folder is set.
1 parent 0db7d83 commit b2ec4dc

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

misc/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.2.0

src/guiSetup.gloa

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,11 +2078,13 @@ export setupGuiCallbacks :: () {
20782078
local ok, filename = pathObj.getFilename!()
20792079

20802080
if not ok {
2081-
if not project.path return false, NULL
2082-
2083-
_, filename = Path(project.path).getFilename!()
2084-
filename = replacePatternWithPattern(filename, "(.)%.[^.]+", "%1") ?: "untitled"
2085-
filename = filename..".lua"
2081+
if project.path {
2082+
_, filename = Path(project.path).getFilename!()
2083+
filename = replacePatternWithPattern(filename, "(.)%.[^.]+", "%1") ?: "untitled"
2084+
filename = filename..".lua"
2085+
} else {
2086+
filename = "untitled.lua"
2087+
}
20862088

20872089
pathObj.setFilename!(filename)
20882090

@@ -2101,7 +2103,7 @@ export setupGuiCallbacks :: () {
21012103
return true, pathObj.toString!()
21022104
}
21032105
local resolveTextureOuputPath :: (project:Project, system:System) -> (success:bool, path:string, sameAsInput:bool) {
2104-
local pathObj = Path(system.texturePath ?: format("%s/gfx/particles/%s.png", getAppDirectory(), system.textureName))
2106+
local pathObj = Path(system.texturePath ?: system.textureName..".png")
21052107

21062108
-- Resolve to current path.
21072109
if not pathObj.isAbsolute {

0 commit comments

Comments
 (0)