GUI update (Help me, Please)

Place to get help with not working mods / modding interface.
User avatar
yaim904
Fast Inserter
Fast Inserter
Posts: 111
Joined: Wed Nov 17, 2021 11:26 pm
Contact:

GUI update (Help me, Please)

Post by yaim904 »

Context
Some time ago I created my version of Star whit items, but I couldn't get the GUI to look like the Vanilla GUI.

Now that I'm updating it, I'm in the same place, I don't know what styles to use and in what sequence to use; I also didn't find updated guides on the subject.

I tried to check the GUI with Ctrl + F5 and Ctrl + F6 but I don't understand anything. It's a lot of Flow and I always seem to be missing some detail.

Below is the GUI I made some time ago.
4.png
4.png (18.28 KiB) Viewed 109 times
5.png
5.png (39.74 KiB) Viewed 109 times
6.png
6.png (19.58 KiB) Viewed 109 times
7.png
7.png (19.66 KiB) Viewed 109 times

What I want from the GUI
I want it to look like the infinite chest, with a blank space always at the end (to add the next item).
12.png
12.png (55.68 KiB) Viewed 109 times


When I want to add a new object, the list of objects (like the one in the requirement chests) will be displayed.
13.png
13.png (203.58 KiB) Viewed 109 times

I need help with the GUI, I code the logic.
Help me, Please
Solo entiendo español, pero si tu también lo entiendes, escríbeme
:D
Everything i write in English is translated by Deepl.
:D
User avatar
yaim904
Fast Inserter
Fast Inserter
Posts: 111
Joined: Wed Nov 17, 2021 11:26 pm
Contact:

Re: [2.0.43] GUI update (Help me, Please)

Post by yaim904 »

I have created a Frame as the main container
But I don't know how to add the buttons in the title bar.
In the images you can see that there are two children
How can I select a children from an element?

Code: Select all

---------------------------------------------------------------------------------------------------
---> control.lua <---
---------------------------------------------------------------------------------------------------

script.on_event(defines.events.on_player_created, function(event)
    local player = game.get_player(event.player_index)
    local screen_element = player.gui.screen
    local main_frame = screen_element.add({
        type    = "frame",
        name    = "main_frame",
        style   = "frame_without_left_side",
        caption = "Hello world"
    })
    main_frame.style.size = { 484, 632 }
    main_frame.auto_center = true

    -- main_frame.children[1].add({
    --     type = "button",
    --     style = "close_button"
    -- })
end)
Captura de pantalla (357).png
Captura de pantalla (357).png (5.01 KiB) Viewed 61 times
Captura de pantalla (358).png
Captura de pantalla (358).png (5.1 KiB) Viewed 61 times
Captura de pantalla (359).png
Captura de pantalla (359).png (50.91 KiB) Viewed 61 times
Captura de pantalla (360).png
Captura de pantalla (360).png (70.2 KiB) Viewed 61 times
Solo entiendo español, pero si tu también lo entiendes, escríbeme
:D
Everything i write in English is translated by Deepl.
:D
Post Reply

Return to “Modding help”