[FIXED] Box borders don’t work?

Post Reply
User avatar
Wuzzy
Member
Posts: 5104
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

[FIXED] Box borders don’t work?

by Wuzzy » Post

I recently stumbled upon a formspec styling feature that flew under my radar: You can add border around box formspec elements, apparently. At least that's what lua_api.md claims.

So I experimented around with it a bit, but I can’t seem to get the border to appear, no matter what I do.

Here’s my latest attempt using the luacmd mod:

Code: Select all

/lua core.show_formspec(me:get_player_name(), "test", "formspec_version[6]size[5,5]style_type[box;borderwidths=5;bordercolors=#FF0000FF]box[1,1;1,1;#00FF00FF]")
I expect a green box to appear surrounded by a red border of 5 pixels. But I only get a green box, no border.

Am I doing something wrong or is this a bug?

I tested in Luanti 5.12.0 and Luanti 5.13.0.
Last edited by Wuzzy on Wed Feb 04, 2026 12:08, edited 1 time in total.

User avatar
cx384
Member
Posts: 782
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: Box borders don’t work?

by cx384 » Post

Can confirm, bordercolors and borderwidths always stay 0.
See here: https://github.com/luanti-org/luanti/bl ... 2279-L2294

According to my testing it only works if you don't set any color directly in the element
(this is also documented https://github.com/luanti-org/luanti/bl ... in=1#L3324)
but positive borderwidths just don't work?

E.g. this works:

Code: Select all

"formspec_version[6]size[5,5]style_type[box;borderwidths=-5;bordercolors=#FF0000FF;colors=#00FF00FF]box[1,1;1,1;]"
You should probably still fill out a bug report.
Can your read this?

User avatar
Wuzzy
Member
Posts: 5104
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Box borders don’t work?

by Wuzzy » Post

Ah. I only looked at the style documentation of the box, not the box itself. Documentation should probably mention the awkward behavior in both places.

Even if intentional, the fact that box color overwrites everything is kinda annoying. But for full customization, I can just always put style_type before each individual box then. Still, it's not greatly designed.

In any case, the fact that positive borderwidths are ignored completely definitely looks like a bug.

User avatar
cx384
Member
Posts: 782
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: Box borders don’t work?

by cx384 » Post

Can your read this?

User avatar
Wuzzy
Member
Posts: 5104
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Box borders don’t work?

by Wuzzy » Post

It turned out it was indeed a bug; I posted a bugfix PR here:

https://github.com/luanti-org/luanti/pull/16845

User avatar
Wuzzy
Member
Posts: 5104
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Box borders don’t work?

by Wuzzy » Post

Great news! The bugfix has been accepted and will (hopefully) arrive in the next release.

https://github.com/luanti-org/luanti/co ... 39e43731e7

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests