Community Forum

GuiElement help

Forum Overview >> Scripting

Created05.12.2021 16:39

54reddog 05.12.2021 16:39
I'm trying to implement a new display on the escape menu. I've got the tab added, that works, but can find little to no documentation or help regarding the different Elements, what they look like, how they are used etc. I'm piecing together slowly, but it's torturous to do when there's no real demonstration or examples.

What I want to accomplish on the tab at the moment is a list of the AI farmers and player farmers down the left side and when an item is selected show in the middle-right section of the tab the number and size of their farmlands. I know the information is available, its the layout of the GUI that I am having trouble with. Some pointers would be appreciated.

Espen K. (estyx) 06.12.2021 21:53
If you have a discord user post it here and I can give you some help to get started :-)

54reddog 06.12.2021 23:03

Thanks, I'd appreciate it massively.

Kyle Petrunik (Muffin_Man) 07.12.2021 16:29
Hi Espen & 54reddog, I am also looking to create some mods using the GUI, do you mind adding me to discord as well? Maybe we can have a group chat?

Here is my discord name Mufein#1192

Thanks and all the best,

Sagichnicht Nein (djklesk) 09.12.2021 01:11
Espen pls upload example on github... knowlegde sharing always better :)

Espen K. (estyx) 09.12.2021 17:07
I usually commit stuff on my GitHub:

Working on a mod with GUI stuff, so keep an eye out :) Probably getting uploaded this weekend

Markus33_ITA 16.12.2021 16:47
Hi Espen K. (estyx). I'm trying to make a GUI mod for FS22. I downloaded a few to try to understand and didn't understand much. Documentation is scarce if not absent.
I consider myself an amateur programmer and if I find documentation I try to get by myself. In this case I can't.
My idea was a very similar gui to the menu. with 2 cards connected to 2 frames.
If I had a working foundation, I think I'm pretty sure I'd somehow be able to implement what I'd like to create.
The least I can do is put you in the credits as a GUI creator.
I would be very grateful if you could help me.

Olivier Beauchemin (obeauchemin) 17.12.2021 03:57
The GPS Mod by Wopster has a wonderful example of a working tabbed GUI :)

Markus33_ITA 17.12.2021 09:48
Hi Olivier Beauchemin (obeauchemin). I put "hand" to that mod. I managed to clean up an entire frame card but I can't figure out how to change the use of the mod and not that it is bound to the use of the medium (it's not at all easy to decode a mod to get and understand the pieces you need. then that mod is complex and has many lua).
my idea is to simplify the prices by putting the highest price of the moment and the price 1.0 multiplied by 1.x and, why not, also an alert when the price of a commodity reaches the multiplied price.
More than anything else I have to understand how Profiles work (default Giant).

54reddog 17.12.2021 13:23
Having struggled through this for a while now the best advice I can give is probably to reverse engineer from existing mods. GPS has indeed some detailed GUI, as well as Seasons. If you want to integrate to the main Ingame menu (escape menu) then the additionalSettings mod can help there.

The documentation on the GUI stuff is woeful and that's being charitable. It's slow, painful and bloody frustrating to have to do so, but reverse engineering should tell you more than you'll get from the GDN.

Any element needs to have a profile in the xml. The default profiles are OK to begin with, the main ones I've used are emptyPanel, framedEmptyPanel, textDefault, buttonBase, list, listItem and textInput. You can see from the GPS mod how he uses guiProfiles.xml to set these up.

Pay attention to how GIANTS have got the positioning and relative sizing done. You can see the base guiElement properties on the LUADOC under GUI. That's the real key one.

54reddog 17.12.2021 13:24
On another note, I'm trying to reduce the size of the map display that I have added to a GUI, but regardless of what I set the height, width, size, minheight, maxheight etc properties, it remains the same size. Anyone got any ideas?

Markus33_ITA 21.12.2021 19:57
I am looking at older fs mods.
On closer inspection, I find it easier to create a hud than a gui mod. perhaps the first step is to create the hud before moving on to the gui.
Small ot. without too much effort I added the tension belts to some bale forks. this should be the next level to the gui but it is much easier instead.

Bob Bobster (Bobster82) 21.12.2021 20:16

I have a simple Gui working on my autorepair mod, I stripped down a Gui from another mod (a pain indeed) But that one is working.
Maybe u could have a look on that if its something u need... Im also a beginner in programming, so its loads of trail and error ;)

Note: Log in to post. Create a new account here.