Web-based formspec editor

Post Reply
User avatar
luk3yx
Member
Posts: 83
Joined: Sun Oct 21, 2012 18:14
GitHub: luk3yx
IRC: luk3yx
In-game: luk3yx
Location: Earth
Contact:

Web-based formspec editor

by luk3yx » Post

Web-based formspec edtior

Really actually removing the pains of formspec design.

Git repository

Try it online

Uses Fengari to run my formspec_ast and fs51 mods on web browsers.

image[​] elements use HDX textures by default (dynamically loaded when required).

Screenshot

Image

Major features
  • Web-based (no waiting for MT to load)
  • Property editor
  • ${lua code} substitution in text values.
    • Don't remove the weird comments generated when exporting these formspecs if you plan to import them again.
  • The ability to load existing formspecs (provided they are version 2 or above).
Limitations
  • Although it can save formspecs in the version 1 format, it cannot load them in this format. Co-ordinates are backported with help from my fs51 mod.
  • The properties editor is slow when manipulating lots of properties.
  • Malicious formspecs imported with the ${...} substitution option enabled can freeze the webpage.
  • Element alignment might not be perfect.
  • There may be bugs in Google Chrome, I have only tested this in Firefox.
  • Texture modifiers in image[​] will not be displayed in the preview.
  • Not all formspec elements are supported.
Copyright / License

Copyright © 2020 by luk3yx

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Last edited by luk3yx on Thu Mar 11, 2021 04:47, edited 4 times in total.
git_undo() { [ -e .git ] || return 1; local r=$(git remote get-url origin); cd ..; rm -rf "$OLDPWD"; git clone "$r" "$OLDPWD"; cd "$OLDPWD"; }

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: Web-based formspec editor (beta)

by twoelk » Post

ooooooh cool

played a little

ups, decimal point not comma , yeah I always blunder into that ...
maybe displaying a grid might be usefull?
hmm colorchooser somewhere?

nevertheless pretty interesting
gotta do some real testing later

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Web-based formspec editor (beta)

by texmex » Post

This is a game changer! Pun intended!

User avatar
luk3yx
Member
Posts: 83
Joined: Sun Oct 21, 2012 18:14
GitHub: luk3yx
IRC: luk3yx
In-game: luk3yx
Location: Earth
Contact:

Re: Web-based formspec editor (beta)

by luk3yx » Post

twoelk wrote: ups, decimal point not comma , yeah I always blunder into that ...
Number inputs now treat commas as decimal points (however they still use . to display them).
twoelk wrote: maybe displaying a grid might be usefull?
Added a grid option (currently grid lines are 2px wide, however).
twoelk wrote: hmm colorchooser somewhere?
The only element that it would currently be used on is the box element, I probably won't add one for now.
git_undo() { [ -e .git ] || return 1; local r=$(git remote get-url origin); cd ..; rm -rf "$OLDPWD"; git clone "$r" "$OLDPWD"; cd "$OLDPWD"; }

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: Web-based formspec editor (beta)

by Nathan.S » Post

This seems extremely useful, I always hate launching a world a dozen times just to get a formspec laid out correctly. The only thing I'm seeing that's missing is the scaling when you change the size of the browser window.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
v-rob
Developer
Posts: 970
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: Web-based formspec editor (beta)

by v-rob » Post

Well, you'll have a hard time keeping up with all the formspec changes. A few people are still pumping out formspec PRs (I have 4 PRs currently open, 2 merged, and I have plans for a few more) besides all the things other people are doing.

And actually, colors can also be set on buttons using style and style_type, not just boxes.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Web-based formspec editor (beta)

by Linuxdirk » Post

Thanks for the work, looks pretty nice for standard formspec things.

In the future I totally can see live preview of changes, configuration dialogs not closing when pressing enter, and drag’n’drop positioning and size changes.

User avatar
luk3yx
Member
Posts: 83
Joined: Sun Oct 21, 2012 18:14
GitHub: luk3yx
IRC: luk3yx
In-game: luk3yx
Location: Earth
Contact:

Re: Web-based formspec editor (beta)

by luk3yx » Post

v-rob wrote:Well, you'll have a hard time keeping up with all the formspec changes. A few people are still pumping out formspec PRs (I have 4 PRs currently open, 2 merged, and I have plans for a few more) besides all the things other people are doing.

And actually, colors can also be set on buttons using style and style_type, not just boxes.
I haven't implemented style[] yet (and would have to figure out a UI for changing styles if/when I do).
Linuxdirk wrote:Thanks for the work, looks pretty nice for standard formspec things.

In the future I totally can see live preview of changes, configuration dialogs not closing when pressing enter, and drag’n’drop positioning and size changes.
The properties dialog no longer closes when you save properties or create an element. I'd like to add drag+drop, however I haven't found a simple/lightweight JS library that meets my requirements.
git_undo() { [ -e .git ] || return 1; local r=$(git remote get-url origin); cd ..; rm -rf "$OLDPWD"; git clone "$r" "$OLDPWD"; cd "$OLDPWD"; }

User avatar
AFCM
Member
Posts: 36
Joined: Tue Jun 30, 2020 12:21
GitHub: AFCMS
IRC: AFCM
In-game: AFCM
Location: France
Contact:

Re: Web-based formspec editor (beta)

by AFCM » Post

@luk3yx Could you make possible to use this editor with legacity coordinates ? I can't use it to design mcl2 formspec.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Web-based formspec editor (beta)

by rubenwardy » Post

You can do that when exporting.

You can also disable and enable legacy coordinates on demand, using real_coordinates. You should move to real_coords sooner rather than later
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
AFCM
Member
Posts: 36
Joined: Tue Jun 30, 2020 12:21
GitHub: AFCMS
IRC: AFCM
In-game: AFCM
Location: France
Contact:

Re: Web-based formspec editor (beta)

by AFCM » Post

Its work thank you !

User avatar
AntumDeluge
Member
Posts: 213
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge
Contact:

Re: Web-based formspec editor

by AntumDeluge » Post

Thank you very much for this!

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Web-based formspec editor

by Blockhead » Post

This tool is still working great! A few things I would improve:
  • Sometimes elements are too small to have a move handle, only resize handles on all the corners. Not sure how t to fix exactly but see my next point.
  • Allow for tweaking element position with arrow keys. Something like: move 0.5 with arrow key and 0.1 with ctrl+arrow key (Alt-arrow keys are used for browser forward back :))
  • Have a checkbox to configure field_close_on_enter and tooltip (possibly others like listrings too) within the element properties at right. That way I don't have to add those manually after export.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests