k2d222 / twwe

Teeworlds collaborative map editor online
GNU Affero General Public License v3.0
13 stars 1 forks source link

Support sub folders in the map list #54

Closed ChillerDragon closed 2 years ago

k2d222 commented 2 years ago

Like the idea. How would we show that in the ui? have some kind of file explorer view?

ChillerDragon commented 2 years ago

Like the idea. How would we show that in the ui? have some kind of file explorer view?

Not sure. My first idea was to display the full path. But maybe it makes sense to stay close to the original editor. Where you have to open folders to get the maps inside of it.

Would be nice tho if the fuzzy search could directly find maps inside of folders like any proper file search in a IDE

k2d222 commented 2 years ago

Would be a good first implementation to just show the full path in the list, not to complicated either, just have to recursive glob in the server I think

k2d222 commented 2 years ago

Would be a good first implementation to just show the full path in the list, not to complicated either, just have to recursive glob in the server I think

there https://github.com/k2d222/twwe/blob/81f0cfa1935ba0c04060c826613d4c51076ace02/server/src/main.rs#L515

ChillerDragon commented 2 years ago

Would be a good first implementation to just show the full path in the list, not to complicated either, just have to recursive glob in the server I think

there

https://github.com/k2d222/twwe/blob/81f0cfa1935ba0c04060c826613d4c51076ace02/server/src/main.rs#L515

You want me to do it? :D

k2d222 commented 2 years ago

that would be great

ChillerDragon commented 2 years ago

Yea so

let rooms = glob("maps/**/*.map") 

does the job. But sadly it does not work out of the box :(

Seems like the server does not even recognize a map join request if the client trys to access the url http://localhost:3000/edit/some/path/mapname

k2d222 commented 2 years ago

yeah.. It has to do with svelte-routing probably (https://github.com/EmilTholin/svelte-routing) cuz it doesn't recognize foo/bar as a path parameter, just foo

the readme says something about named wildcards, maybe that's just what we need.

https://github.com/k2d222/twwe/blob/81f0cfa1935ba0c04060c826613d4c51076ace02/client/src/ui/index.svelte#L18 there try *mapName instead of :

ChillerDragon commented 2 years ago

yeah.. It has to do with svelte-routing probably (https://github.com/EmilTholin/svelte-routing) cuz it doesn't recognize foo/bar as a path parameter, just foo

the readme says something about named wildcards, maybe that's just what we need.

https://github.com/k2d222/twwe/blob/81f0cfa1935ba0c04060c826613d4c51076ace02/client/src/ui/index.svelte#L18

there try *mapName instead of :

Nice thanks that helped a lot!