flixel-ui icon indicating copy to clipboard operation
flixel-ui copied to clipboard

Uppercase in asset id broken

Open MSGhero opened this issue 10 years ago • 7 comments
trafficstars

I have an input tf with id="loadTf". When I call _ui.getFlxText("loadTf"), I get an error, but "loadtf" (lowercased) is fine. The ui's internal Map shows that all the keys got lowercased.

Maybe related, this line doesn't do anything since toLowerCase doesn't change the string you call it on.

MSGhero avatar Jun 16 '15 22:06 MSGhero

Yeah probably what I should do here is just call toLowerCase on any id's you pass in to the get commands.

larsiusprime avatar Jun 17 '15 01:06 larsiusprime

Why lowercase at all though? First thought would be "load" and "Load" are two different ids.

Side note, I'm gonna mess with flixel-docs and try to go about adding flixel-ui as I use the lib more.

MSGhero avatar Jun 17 '15 04:06 MSGhero

Hm, maybe I'm missing something, but there are case-sensitive OSes. Lower-casing everything might work for Windows, but not on OSX (depends on you FS config, but still) and Linux.

Specially when I'm using a RAW path:

<sprite src="RAW:assets/images/mainmenu/mainMenu_bg" x="0" y="0"/>

Assets ends up looking for mainmenu_bg and breaks. I'm sorry, but this is a terrible idea and it really grinds my gears when libraries think they know better than me about my project.

Now to rename a whole lot of files...

ivodopiviz avatar Oct 01 '15 19:10 ivodopiviz

hmm, let me look into this. I don't want to cause OS specific errors.

larsiusprime avatar Oct 01 '15 19:10 larsiusprime

Maybe keep it case-sensitive for RAW paths? I mean, changing it now would produce breakage on already existing projects :/

ivodopiviz avatar Oct 02 '15 00:10 ivodopiviz

I'm assuming OpenFL doesn't lowercase anything when it sticks keys in it's asset cache?

larsiusprime avatar Oct 02 '15 00:10 larsiusprime

Ah, good point. I haven't had case issues with OpenFL so far.

ivodopiviz avatar Oct 02 '15 00:10 ivodopiviz