Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map editor import json #140

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thmsndk
Copy link
Contributor

@thmsndk thmsndk commented May 20, 2024

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
Copy link
Contributor Author

thmsndk commented Jun 1, 2024

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

Notes:

  • it's annoying you can't close the modal via ESC / X in the corner, but the other modals behave the same way.

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

@thmsndk thmsndk marked this pull request as ready for review June 1, 2024 10:04
@thmsndk thmsndk force-pushed the feature/map-editor-import-json branch from eb31743 to a40d50a Compare July 27, 2024 20:34
@Telokis Telokis added Type: feature Adds new content to the game Scope: central server The central server is impacted Status: waiting for review This PR is waiting for a maintainer to review it Scope: Map Editor Related to the map editor located in the central server labels Aug 13, 2024
@thmsndk thmsndk force-pushed the feature/map-editor-import-json branch from a40d50a to 1a17289 Compare August 13, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: central server The central server is impacted Scope: Map Editor Related to the map editor located in the central server Status: waiting for review This PR is waiting for a maintainer to review it Type: feature Adds new content to the game
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants