Dinamically change text in formspecs?
Dinamically change text in formspecs?
Is it possible to dinamically change the text in formspecs? Without reloading the form again I mean.
- texmex
- Member
- Posts: 1752
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: Dinamically change text in formspecs?
Have a look at ActiveFormspecs.
- v-rob
- Developer
- Posts: 813
- Joined: Thu Mar 24, 2016 03:19
- GitHub: v-rob
- IRC: v-rob
- Location: Right behind you.
Re: Dinamically change text in formspecs?
No, it is impossible, no matter what mod you use. ActiveFormspecs probably makes it simpler to use (I haven't looked much, I prefer the raw stuff), but the engine limitation remains.
- Linuxdirk
- Member
- Posts: 2711
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Dinamically change text in formspecs?
No, not without reloading it. Formspecs are static.runs wrote:Without reloading the form again I mean.
Re: Dinamically change text in formspecs?
It is for my WIP Dialogue Mod. It is fundamentral to me a form to set the changing dialogue in a cool and easy way.
-
- Member
- Posts: 167
- Joined: Mon May 22, 2017 20:27
Re: Dinamically change text in formspecs?
When you show a form using minetest.show_formspec you pass a "name" for the form (which is also passed to your formspec handler callback if you want to respond to e.g. button clicks in the form). If you later show another form with the same name (and to the same player), this will replace the previous form without the player needing to re-load the form (i.e. it will immediately update what the player sees). So all you need to do is re-generate the entire form with the new text in response to whatever event triggered the change, and then show this to the player as you normally would.
Who is online
Users browsing this forum: No registered users and 1 guest