Apple, and the interminable oddness implied by that name........
-
sigh...so Horizen... lets you install expansions, and shows you what you have installed and what is also available - in a list.
It does this by using some meta data about available and installed expansions, and shows you a named(in the meta data) image for each expansion.....
It gets this image from the {AppData}/images folder... where the expansion installer has put every expansions image as part of any given expansions download....
like this:
// get the proper images folder..... if (destinations.OS == destinations.WINDOWS) { ifolder = destinations.IMAGES_FOLDER + "\\"; }else{ ifolder = destinations.IMAGES_FOLDER + "/"; };``` reg imageList = FileSystem.findFiles(imageDirFile, "*.png",false); //and later... InstalledExpansionDisplayPanel.loadImage(ifolder + e.Image, e.Image);
Still with me so far?
So this works flawlessly on Windows for everyone, and flawlessly on MacOS for about 80% of the customer base, but for those other 20%? Well it cant seem to find the images....at all....
I cant see what Im doing inconsistently... anyone else have MacOS behave this way? and if so do you have a work around?
-
@Lindon I would avoid specifying forward slashes and back slashes manually, and use the FileSystem API to get references to files/folders.
Don't know if that will make a difference to the problem here though.
Does the value of
imageList
change later in your script?Do you have any more data that links the people who are having the issue, other than they are using MacOS?
-
@d-healey said in Apple, and the interminable oddness implied by that name........:
@Lindon I would avoid specifying forward slashes and back slashes manually, and use the FileSystem API to get references to files/folders.
Okay, not sure how you do that, every time I use the FileSystem API I get back a path to a folder without slashes at the end - so I can get (say) AppData folder, but now I want to get the images folder inside there, how are you proposing to do this with "just" the FileSystem API?
Don't know if that will make a difference to the problem here though.
Does the value of
imageList
change later in your script?Nope. fixed fixed fixed at init.
Do you have any more data that links the people who are having the issue, other than they are using MacOS?
Sadly no - I cant see any common OS version or permissions hoo-ha going on...
-
@Lindon said in Apple, and the interminable oddness implied by that name........:
Okay, not sure how you do that, every time I use the FileSystem API I get back a path to a folder without slashes at the end - so I can get (say) AppData folder, but now I want to get the images folder inside there, how are you proposing to do this with "just" the FileSystem API?
Let's say your image is called
uberSynth.png
and it lives in theImages
folder within yourappData
folder.// createDirectory will return the directory if it already exists and create it if it doesn't const img = FileSystem.getFolder(FileSystem.AppData).createDirectory("Images").getChildFile("uberSynth.png");
-
@d-healey said in Apple, and the interminable oddness implied by that name........:
@Lindon said in Apple, and the interminable oddness implied by that name........:
Okay, not sure how you do that, every time I use the FileSystem API I get back a path to a folder without slashes at the end - so I can get (say) AppData folder, but now I want to get the images folder inside there, how are you proposing to do this with "just" the FileSystem API?
Let's say your image is called
uberSynth.png
and it lives in theImages
folder within yourappData
folder.// createDirectory will return the directory if it already exists and create it if it doesn't const img = FileSystem.getFolder(FileSystem.AppData).createDirectory("Images").getChildFile("uberSynth.png");
yeah - but sadly no. What I need to do is inspect the images folder and get out from it all the png files....so this line from above:
reg imageList = FileSystem.findFiles(imageDirFile, "*.png",false);
Sadly in this case I need to get the directory as an object not a file in that directory...maybe I just need createDirectory....
so
myImageDir = FileSystem.getFolder(FileSystem.AppData).createDirectory("Images");
-
@Lindon said in Apple, and the interminable oddness implied by that name........:
Sadly in this case I need to get the directory as an object
const dir = FileSystem.getFolder(FileSystem.AppData).createDirectory("Images");
Yep, you got it
-
@d-healey Ok I will add that in and see if it makes a difference....thanks.
-
actually thinking about it - its a bit round the houses, to get it to be useful here:
InstalledExpansionDisplayPanel.loadImage(ifolder + "factory.png", "factory.png");
I end up having to say:
const img = FileSystem.getFolder(FileSystem.AppData).createDirectory("Images").getChildFile("factory.png"); InstalledExpansionDisplayPanel.loadImage(img.toString(img.FullPath), "factory.png");
-
I would use the API here too
local img = ifolder.getChildFile("factory.png"); InstalledExpansionDisplayPanel.loadImage(img.toString(img.FullPath), "factory.png");
Yeah you came to the same conclusion :)
-
@d-healey yeah sorry my slow half typing skills...