formspec: dropdowns drop down behind lists

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

formspec: dropdowns drop down behind lists

by Linuxdirk » Post

In a soon-to-be released mod I create a formspec like so:

Code: Select all

return [[
    size[8,10]
    list[context;input;0,0;1,1;]
    list[current_player;main;0,6;8,4;]
    list[context;signs;0,1.5;8,4;]
    listring[context;input]
    listring[current_player;main]
    dropdown[2,0;6;category;]]..dropdown_list..[[;1]
    ]]
This is a part of a function that does some checking and properly creates dropdown_list as I want it do be, so no big deal here (except formspecs in general look ugly *g*). But during testing I noticed that the dropdown drops down behind the signs list.

Image

As described: The formspec works perfectly as I want it to work, it is only that the dropdown is rendered behind the list slots of the signs list.

It does not matter in which order I place the definitions and if the dropdown is defined first or last.

By simply searching for dropdown in the forums and on GitHub I was not able to find something similar.

Any hints on how to properly display the dropdown?

User avatar
Pyrollo
Developer
Posts: 385
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

Re: formspec: dropdowns drop down behind lists

by Pyrollo » Post

This may be a stupid idea but have you tried to change the order of your widgets ? For example, put the dropdown just after size, before everything ?
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

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

Re: formspec: dropdowns drop down behind lists

by Linuxdirk » Post

Pyrollo wrote:This may be a stupid idea but have you tried to change the order of your widgets ? For example, put the dropdown just after size, before everything ?
As described I did this, yes. I tried all possible positions, dug the node and placed it again after restarting Minetest.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: formspec: dropdowns drop down behind lists

by Krock » Post

It's possible to change the drawing order in the source code, but the problem is that Irrlicht elements and custom implemented formspec GUI elements are mixed.

Irrlicht code: Buttons, dropdown lists, checkboxes, labels and input fields
Minetest code: Images, inventory lists, itemstacks (also as images), tooltips and boxes.

If you want to draw stuff in the most logical way, that would be: boxes, inventory lists, images,
buttons, itemstacks, dropdown lists, tooltips (on top of all).
No problem, right? No, it can't be that easy. The Irrlicht elements are drawn in the order they were registered in the formspec string: gui::IGUIElement::draw();. Good luck interleaving that with the Minetest code.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

Re: formspec: dropdowns drop down behind lists

by Linuxdirk » Post

So we have a weird mishmash of Irrlicht code and Minetest code.

The most logical way of drawing stuff would be the order they’s defined in, with dynamic overlays (tooltips, dropdown lists) on top of everything.

But who’s issue is this? Minetest’s because there is no proper implementation of Irrlicht’s GUI elements or Irrlicht’s because it ignores custom GUI elements when rendering the GUI?

Since this likely won’t be solved ever except with ditching formspecs and implement something sane I guess I need to redesign my mod’s formspec :/

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: formspec: dropdowns drop down behind lists

by runs » Post

Linuxdirk wrote:So we have a weird mishmash of Irrlicht code and Minetest code.

The most logical way of drawing stuff would be the order they’s defined in, with dynamic overlays (tooltips, dropdown lists) on top of everything.

But who’s issue is this? Minetest’s because there is no proper implementation of Irrlicht’s GUI elements or Irrlicht’s because it ignores custom GUI elements when rendering the GUI?

Since this likely won’t be solved ever except with ditching formspecs and implement something sane I guess I need to redesign my mod’s formspec :/
The way is to put a request to Minetest code to change.

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

Re: formspec: dropdowns drop down behind lists

by Linuxdirk » Post

runs wrote:The way is to put a request to Minetest code to change.
I lean towards this, too because I don’t see why Irrlicht should change because of a single game using a combination of Irrlicht and custom UI elements.

I guess I’ll write something up and create a minimal working example.

Edit: https://github.com/minetest/minetest/issues/8036

Post Reply

Who is online

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