Closed cooperuser closed 8 years ago
So the levels on the first page would be [ ], [1], [2]...
all the way up to [15]
? As opposed to [1], [2], [3]...
up to [16]
no, on the open screen in the editor
got it to happen again:
Huh, weird. Could it have something to do with one of the hidden files in that directory? Because hidden files always start with a .
and I assume you're stripping the file from the .
on. But it seems strange that it only happens occasionally.
of course!!!
the .DS_STORE
on macs!
You might at least consider checking to make sure the file name doesn't start with a .
before you list it, and see if that fixes the bug.
But isn't that file always there?
I can go fix it now
Actually you should make sure that's even the problem first, just get rid of the part where it strips the file extension and see if you can trigger the glitch (then you'd see the exact name of the file)
confirmed:
Aha ok just check to make sure the file name doesn't begin with a .
and if it does remove the dot and everything after it
It works now, and it also works if you start the level with a .
, It just saves it like that
and it loads fine
How did you achieve that? Will other hidden files show up by accident with that solution?
there shouldn't be any other hidden files though
if (files[i] != ".DS_Store") {
levelName = files[i].split('.')
levelName.pop();
levelName = levelName.join('.');
$("#selectBox").append(`<option>${levelName}</option>`)
}
Doesn't Mac OS automatically make any files beginning with a dot hidden? In that case you shouldn't even allow players to make a level name start with a dot.
No, it doesn't do that? I'm pretty sure all system-created files created by the kernel starting with a .
are hidden
wait.... your right
i just checked
wait... by using those methods we can make the default levels hidden
Why would we do that...?
to stop modding?
Uh.... why don't you just encrypt them?
Making them hidden would hardly do anything for people who know a thing or two about computers...
And for alpha and beta, I think they should be left editable
Good point
Isn't this closed?
I noticed this bug a while ago, pretty self explanatory but sometimes there is an extra first level to choose from thats name is empty