So im able to access anything within the media folder just fine within javascript code. I am refering to things with coui:// directly, and am not using relitive paths which can get extremely confusing. And i would reccomend everyone to start doing this also. so for example refering to a mod within the mods folder would be like this coui://ui/mods/modName/mod_file.js, rather than /../../mods/modName/mod_file.js. Im thinking people just got confused with the relative url's. I hadn't actually tried this for myself until just now, i just took proeleert, and chargrove's word and assumed what they did was correct. So far i have tried to access a few shaders, and some of the json files. Edit: I dont know if this makes a differance, but im currently running the game and the ui debugger in linux. This is the code i used to verify it. I had put this in the ui_mod_list.json just because why not Code: var req = new XMLHttpRequest(); req.open('GET', 'coui://pa/units/land/energy_plant/energy_plant.json', false); req.send(''); var test = JSON.parse(req.responseText); console.log(test)
So today after thinking through something, i had somewhat of a useful idea. Instead of adding an engine callback so we can get loaded mods. Why not just mount the mods folders under /mods/ this would allow us to just load the json files directly. Engine callbacks would be a nicer solution though.
Nice job on the lateral thinking! I hadn't even considered using the coui links directly, and yes you're right the relative path issue was strictly because using ../ parent directories outside of coui://ui/ was giving me trouble (at least in the little bit of time I've looked at it so far). But the internal file handler didn't have a problem with the above-ui paths, so yeah specifying a coui path directly to coui://pa/ makes a lot sense. Glad it worked!
Ok so yeah its definitely the relitive pathing causing the issue tried using them myself and it caps it all within the ui folder. so any idea on how your are going to fix this. Now that you specifically know its the relitive paths. And should a bug tracker entry be made for it? Also those engine callbacks for the mod information would be useful here soon
@chargrove Will you guys implement a engine hook so we could write to our mod folders ? Cause at best html5 let's you write files to a sandbox. Or not at all cause of security reasons And that isn't really handy. If we could change json files in our mod folders we could do lovely things I know there are security implications but that's why I would only allow writing to your own mod folder and only parsable json/papa/ ... modtype files .
I've been playing around with shadowing and I have a quick question. Does it only work for files in the media/UI folder or can you shadow stuff in, say the media/pa folder? I tried using the structure from an icons mod that shadows in the UI folder to shadow a unit json file in the pa folder but it's not working. Thanks!
You can. I put the Linux shader fix in a personal catch-all mod that shadows stuff in media/shaders for example. If you look at the mods, there is always a ui folder in there, which shadows the media/ui folder. Your mods have that too, right? Just create a new folder shaders next to it and then files in there should shadow files from media/shaders.
Yep. Well thanks to you I just finished my stargate bug fix mod. You can check it out in my sig if you're interested.
@chargrove, @masterdigital : API Request : getKeyboardLayout() This can't be done in javascript / would help me a lot I know you need to do it crossplatform so could be a bitch.