[Mod] Formspex - Consistent Backgrounds [formspex]
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
[Mod] Formspex - Consistent Backgrounds [formspex]
THIS MOD IS OBSOLETE
Its functionality is achieved by formspec prepends.
This mod makes all formspecs automatically look like they look in minetest_game. No work on the side of other mods is required.
-specific background image and colors for forms
-player inventory hotbar is highlighted in a darker color.
Depends: default
License: WTFPL
There are no textures and sounds
Notes: formspecs set by set_inventory_formspec and set_creative_formspec remain unchanged (would be too difficult to implement). For many containers, it is required to re-place the node.
I won't continue development on this mod except if bugs are found.
Latest version: -fixed: forms already declaring a background element (e.g. signs_lib) looked weird
-fixed some other stuff I don't remember
Old versions: - Fix: meta:from_table() not working
- Fix: showed a warning "invalid use of background without a size[] element" when using short form of field[] in formspecs (won't modify these forms.)
Its functionality is achieved by formspec prepends.
This mod makes all formspecs automatically look like they look in minetest_game. No work on the side of other mods is required.
-specific background image and colors for forms
-player inventory hotbar is highlighted in a darker color.
Depends: default
License: WTFPL
There are no textures and sounds
Notes: formspecs set by set_inventory_formspec and set_creative_formspec remain unchanged (would be too difficult to implement). For many containers, it is required to re-place the node.
I won't continue development on this mod except if bugs are found.
Latest version: -fixed: forms already declaring a background element (e.g. signs_lib) looked weird
-fixed some other stuff I don't remember
Old versions: - Fix: meta:from_table() not working
- Fix: showed a warning "invalid use of background without a size[] element" when using short form of field[] in formspecs (won't modify these forms.)
Last edited by orwell on Thu Nov 07, 2019 12:07, edited 6 times in total.
Re: [Mod] Formspex [formspex]
A screenie? Pretty please?
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: [Mod] Formspex [formspex]
screenshot showing a craft-guide form.
nothing in craft-guide's source was changed.
nothing in craft-guide's source was changed.
Last edited by orwell on Wed Aug 19, 2015 10:01, edited 1 time in total.
Re: [Mod] Formspex [formspex]
A before/after image would be great :)
Anyways, judging by the code, this mod will add extra lag when opening inventories.
It is One Thing to concat strings while registering nodes (i.e. at a server startup) and The Other Thing to do that every time someone opens inventory. Aside from additional calculations this adds an extra delay - once the minetest.show_formspec is called the server will wait it to finish. The same goes to the get_meta replacement.
The idea of quickly changing formspecs IS great on it's own nevertheless.
To speed-up your code, try using a table.
Just populate it with the pieces of a formspec and then use table.concat.
Regards!
Anyways, judging by the code, this mod will add extra lag when opening inventories.
It is One Thing to concat strings while registering nodes (i.e. at a server startup) and The Other Thing to do that every time someone opens inventory. Aside from additional calculations this adds an extra delay - once the minetest.show_formspec is called the server will wait it to finish. The same goes to the get_meta replacement.
The idea of quickly changing formspecs IS great on it's own nevertheless.
To speed-up your code, try using a table.
Just populate it with the pieces of a formspec and then use table.concat.
Regards!
- Minetestforfun
- Member
- Posts: 940
- Joined: Tue Aug 05, 2014 14:09
- GitHub: MinetestForFun
- IRC: MinetestForFun
- In-game: MinetestForFun
- Location: On earth
- Contact:
Re: [Mod] Formspex [formspex]
+1 for screens
MinetestForFun Team mods : [spidermob] [fishing]
---
Our Minetest servers :
MinetestForFun (Survival - PvP - Hardcore)[FR/EN]
MinetestForFun HUNGER GAMES
MinetestForFun SKYBLOCK
MinetestForFun CREATIVE
---
Our Minetest servers :
MinetestForFun (Survival - PvP - Hardcore)[FR/EN]
MinetestForFun HUNGER GAMES
MinetestForFun SKYBLOCK
MinetestForFun CREATIVE
- rubenwardy
- Moderator
- Posts: 6972
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: [Mod] Formspex [formspex]
The name was confusing to me, maybe put: [Mod] Formspex [formspex] - Consistent backgrounds
I doubt that the delay will be noticeable. Even with 40 players there won't be more than 100 opens per second. Optimise in the right places, in the places that need it most. If this was C++ or a lower level language, then yes these optimisations would be good.4aiman wrote:It is One Thing to concat strings while registering nodes (i.e. at a server startup) and The Other Thing to do that every time someone opens inventory. Aside from additional calculations this adds an extra delay - once the minetest.show_formspec is called the server will wait it to finish. The same goes to the get_meta replacement.
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: [Mod] Formspex [formspex]
Thanks. I changed the title.rubenwardy wrote:The name was confusing to me, maybe put: [Mod] Formspex [formspex] - Consistent backgrounds
To the show_formspec method: It is a function, and so it is unpredictable for my mod what it will return.4aiman wrote:It is One Thing to concat strings while registering nodes (i.e. at a server startup) and The Other Thing to do that every time someone opens inventory. Aside from additional calculations this adds an extra delay - once the minetest.show_formspec is called the server will wait it to finish. The same goes to the get_meta replacement.
To the meta replacement: every time a mod sets the "formspec" meta tag, the style information is added. (not every time someone opens formspecs). Again, it is unpredictable what the tag will be set to.
So, nothing can be set on load time.
This is Lua, and Lua is great!rubenwardy wrote: I doubt that the delay will be noticeable. Even with 40 players there won't be more than 100 opens per second. Optimise in the right places, in the places that need it most. If this was C++ or a lower level language, then yes these optimisations would be good.
Re: [Mod] Formspex [formspex] - Consistent Backgrounds
@orwell
You don't have to explain anything to me, since I can't remember suggesting to use concatenation only at load-time. :/
Actually, I can't really tell why you decided I've told you to do that...
Anyway, I'd like to cite the other part of my message (which was the reason to post it):
You don't have to explain anything to me, since I can't remember suggesting to use concatenation only at load-time. :/
Actually, I can't really tell why you decided I've told you to do that...
Anyway, I'd like to cite the other part of my message (which was the reason to post it):
^ This is really important. Just try it and you'll see the difference.4aiman wrote:To speed-up your code, try using a table.
Just populate it with the pieces of a formspec and then use table.concat.
- Minetestforfun
- Member
- Posts: 940
- Joined: Tue Aug 05, 2014 14:09
- GitHub: MinetestForFun
- IRC: MinetestForFun
- In-game: MinetestForFun
- Location: On earth
- Contact:
Re: [Mod] Formspex [formspex] - Consistent Backgrounds
Always no screens :(
EDIT : i see it, sorry and thank you :)
EDIT : i see it, sorry and thank you :)
Last edited by Minetestforfun on Tue Aug 11, 2015 11:01, edited 1 time in total.
MinetestForFun Team mods : [spidermob] [fishing]
---
Our Minetest servers :
MinetestForFun (Survival - PvP - Hardcore)[FR/EN]
MinetestForFun HUNGER GAMES
MinetestForFun SKYBLOCK
MinetestForFun CREATIVE
---
Our Minetest servers :
MinetestForFun (Survival - PvP - Hardcore)[FR/EN]
MinetestForFun HUNGER GAMES
MinetestForFun SKYBLOCK
MinetestForFun CREATIVE
Re: [Mod] Formspex [formspex] - Consistent Backgrounds
See this post, Minetestforrun: viewtopic.php?f=9&t=12939&p=186824#p185813
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: [Mod] Formspex [formspex] - Consistent Backgrounds
Sorry, now I understand what you mean with this part of your post. I've seen it in another mod.4aiman wrote:@orwell
Anyway, I'd like to cite the other part of my message (which was the reason to post it):^ This is really important. Just try it and you'll see the difference.4aiman wrote:To speed-up your code, try using a table.
Just populate it with the pieces of a formspec and then use table.concat.
I will think about it.
Re: [Mod] Formspex - Consistent Backgrounds [formspex]
How change color for slots by using formspecx?
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: [Mod] Formspex - Consistent Backgrounds [formspex]
just enable both your mod and this one.
Re: [Mod] Formspex - Consistent Backgrounds [formspex]
I mean change to not default color, for example to red.
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: [Mod] Formspex - Consistent Backgrounds [formspex]
And I mean, just try to enable both your mod viewtopic.php?f=11&t=15640 and this one.amadin wrote:I mean change to not default color, for example to red.
See what happens when you open e.g. a homedecor nightstand(it must have been placed after formspex was enabled)
Who is online
Users browsing this forum: No registered users and 19 guests