formspec: dropdowns drop down behind lists

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

formspec: dropdowns drop down behind lists

by Linuxdirk » Sun Dec 30, 2018 08:35

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
Member
 
Posts: 316
Joined: Mon Jan 08, 2018 15:14
Location: Paris
GitHub: pyrollo
In-game: Naj

Re: formspec: dropdowns drop down behind lists

by Pyrollo » Sun Dec 30, 2018 09:30

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: 2177
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

Re: formspec: dropdowns drop down behind lists

by Linuxdirk » Sun Dec 30, 2018 09:43

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: 4376
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: formspec: dropdowns drop down behind lists

by Krock » Sun Dec 30, 2018 10:32

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.
>> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

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

Re: formspec: dropdowns drop down behind lists

by Linuxdirk » Sun Dec 30, 2018 18:41

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: 812
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: formspec: dropdowns drop down behind lists

by runs » Mon Dec 31, 2018 00:24

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: 2177
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

Re: formspec: dropdowns drop down behind lists

by Linuxdirk » Mon Dec 31, 2018 00:59

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
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 5 guests