kaansoral / adventureland

Adventure Land The Open Source CODE MMORPG
Other
189 stars 60 forks source link

map editor import json #140

Open thmsndk opened 3 months ago

thmsndk commented 3 months ago

Working on the bee dungeon, I've added an import button to the map editor so it can import the data from JSON. so starting on a fresh map I can import it either by choosing a file or pasting the JSON. It's very crude and could be made prettier, but it works.

Pressing the import button shows this modal image

When you load the json the map will be replaced. Remember to press save to persist it in the database image Early on in my develop environment I lost my database every time I made code changes, so this works nicely, it also allows to supply a map in a json file for easy import when the server boots up.

It does this by looking in design/maps/[keyname].json for a json file with the contents you get from pressing the JSON button in the map editor. This allows for us to easily make a PR containing a map that will be loaded when the server restarts.

This PR is temporarily marked as draft untill Drippy has verified it works on their local environment.

thmsndk commented 3 months ago

Drippy has been using it, and it is working out very well.

Notes:

I'm marking this as ready, it can always be enhanced.