#E (sharpE) Json editor with schema and templates
I have been working on a little side project #E or SharpE, it is an Editor which I am hoping will making StoneHearth mods easier.
It has 3 main functions to help you.
- Realtime json evaluation
- Autocomplet in json
- Templates (Scripts)
#Realtime json evaluation
The evaluation of json is split in two parts. One it validates if the file is correct json.
This will help when you forgot a comma or simular. This will be marked in the left margin in red.
The second part is validation against a schema.
This can be used to test if you are missing something or have asigned an in to a value that should be bool.
This will offcouse require that some one writes a schema, for the files that you editing.
#Autocomplet
Autocomplet in json is normaly restricted to surgest from words allready in the file.
When you have a schema in the file you know what keys to expec.
I have also extended the normal json schema to include some autocomplete definitions of what a value field is.
For example a file, an enum or event a set of keys collected from an other file.
#Templates (Scripts)
This is for now a simple scripts with 5 different commands that can make it easier to create new files for your mod.
*It can copy a file.
*Create folder
*Replace string in the file.
*Insert a string in a file.
*And last it can inject content in to a json file.
When the template is opened it you can edit parameters easy and hit run.
I have recorded a short video that shows how easy i create a mode with a single object.
Normaly you would offcouse replace the image and qb file and edit the description but that is about it. Sorry for the poor quality and no sound.
#Download and setup
Editor can be downloaded at https://github.com/grarup/SharpE/releases/download/0.1/sharpE_0_1.zip
And schemas and templates for Stonehearth at https://dl.dropboxusercontent.com/u/10294497/stonehearth%20schemas%20and%20templates.zip.
After you have installet the editor and unziped the schemas you will need to edit the settings to point to these.
Click the “Settings->General” this opens the settings.json
Under schemas and templates the paths to where you unziped them.
It should look something like this.
{
"$schema" : "generalsettings.schema.json",
"schemas" : [
"C:\\Users\\peter_000\\Dropbox\\stonehearth schemas",
],
"templates" : [
"C:\\Users\\peter_000\\Dropbox\\stonehearth templates"
],
"converttabs" : true,
"tabsize" : 2,
"shortcuts" : [
{
"gesture" : "ctrl+s",
"command" : "Save"
},
{
"gesture" : "ctrl+p",
"command" : "OpenFileSearch"
},
{
"gesture" : "ctrl+tab",
"command" : "ShowSwitchFile",
},
{
"gesture" : "f5",
"command" : "Run"
},
{
"gesture" : "ctrl+shift+f",
"command" : "FindInFile"
}
],
"editors" : [
"QubicleViewer.dll",
],
"runpath" : "",
"runparameters" : "",
}
The code for the editor can be found at
https://github.com/grarup/SharpE
A trello board on work jet to be done can be found at
https://trello.com/b/Dpol0wqT
The editor is still in its infent state so be gental, but as Stonehearth modders you should have surden class and thick hide.
I am looking forward to hearing your comments and surgestients.
Do keep in mind that this is a project I can work on in my spare time, that isn’t other wise ocupied.
Winter is comming and in Florida that actualy means less time in front of the computer.
One last thing, I created a quick qb viewer for the editor. Just because I need something to play with when every thing else and me needed a break.