Jump to content

[REL] GUI Editor 3.1.3


Remp

Recommended Posts

First of all i think its important to understand the distinction between designing the gui and actually running the gui. The editor will allow you to design the gui but will not actually implement it in a script. For that, you will need to copy the code for the gui you made (from guieditor_output) into a clientside resource .lua file, then start that resource on your server. Once you have the gui running in-game, you can use the "Load GUI" option in the gui editor to continue editing it if you want to

I suggest you take a look at the gui tutorials on the wiki (starting here with a general scripting tutorial, then onto some gui tutorials for some more in depth guidance on scripting gui

okay that makes pefect sense. so far what ive learned is i need a meta.xml to load the lua. so far so good, but how should i code the lua so that when it loads as a resourse, it will pop open when i press F6 for example?

Edit: i loaded a gui from a help resurce i downloaded from my clan's server. i managed to load it up right, but after ive made a few edits, i see no option for outputting the code... now how do i save this? its very unclear to me =(.

i suggest you to move to scripting section, and describe problem there

Link to comment
First of all i think its important to understand the distinction between designing the gui and actually running the gui. The editor will allow you to design the gui but will not actually implement it in a script. For that, you will need to copy the code for the gui you made (from guieditor_output) into a clientside resource .lua file, then start that resource on your server. Once you have the gui running in-game, you can use the "Load GUI" option in the gui editor to continue editing it if you want to

I suggest you take a look at the gui tutorials on the wiki (starting here with a general scripting tutorial, then onto some gui tutorials for some more in depth guidance on scripting gui

i loaded a gui from a help resurce i downloaded from my clan's server. i managed to load it up right, but after ive made a few edits, i see no option for outputting the code... now how do i save this? its very unclear to me =(.

i suggest you to move to scripting section, and describe problem there

Link to comment

It should do, can you tell me the exact steps you are using?

make sure when you use the "Load GUI" option you click on the element at the top of the tree (so the element that all the others are attached to, usually a window)

Link to comment
It should do, can you tell me the exact steps you are using?

make sure when you use the "Load GUI" option you click on the element at the top of the tree (so the element that all the others are attached to, usually a window)

Its loading the gui i pick just fine. I can alter the gui and add elements like buttons and labels etc...

the problem is i cant output the code anywhere. If i start from scrach with a gui and i right click off of that window i get the option to output the code. But i just dont get that option with a gui i loaded with loadgui.

If i do print date: it just tells me: (in console)

----------- Relative -----------

x: 0.0000 y: 0.0000

width: 1.0000 height: 1.0000

----------- Absolute -----------

x: 0.0000 y: 0.0000

width: 1280.0000 height: 960.0000

so i tried using /guioutput but that isnt working right, it only outputs one line of text:

Succesfully saved to GUIEditor_output.txt

with absolute screen and absolute children.

but what the GUIEditor_output.txt has in it is only:

--- --- --- --- ---

do you understand what i mean, im having the problem of loading... saving....loading... saving.... after a loaded gui is loaded i cant save it again. i just dont have the right clik menu option.

Link to comment

The options to output code ('Print code' / 'Output code') are always there, just right click on any empty part of the screen

Are you sure you are actually loading it? (right click on the screen -> select 'Load GUI' -> left click on the gui you want to load)

Does it output a message in the chat saying that it has successfully loaded?

the only reasons it would output nothing into guieditor_output.txt are either you havent actually loaded anything, or it has tried to load it and errored somewhere along the way

are there any errors in debugscript? (/debugscript 3)

Link to comment
The options to output code ('Print code' / 'Output code') are always there, just right click on any empty part of the screen

Are you sure you are actually loading it? (right click on the screen -> select 'Load GUI' -> left click on the gui you want to load)

Does it output a message in the chat saying that it has successfully loaded?

the only reasons it would output nothing into guieditor_output.txt are either you havent actually loaded anything, or it has tried to load it and errored somewhere along the way

are there any errors in debugscript? (/debugscript 3)

Im sorry im bugging you, i think i should take a step back and start from scratch. i'm obviously the one doing something wrong. I will learn the basics of scripting the gui and everything and then learn how to use your program to steamline the process once i get to that level.

my own noobish desire asks for 2 things in a future update to help us noobies.

1. auto output as a lua file.

2. a setting allowing you to load a gui by file name.

3. a setting to allow the window to be opened by keypress which would also be saved in the lua, like commandhandler etc. i dunno.

but i am sorry to bug you with my problems when i dont even have enough knowledge to use this yet.

If anyone can help btw, i started a thread asking for some help here:

https://forum.multitheftauto.com/viewtopic.php?f=91&t=27332&p=308165#p308165

Link to comment

ideally the editor should be usable by anyone, so any problems you have with it are good to know about

1: outputting a full lua file could definitely be done

2: it might be possible to load the gui in via resource name, im not sure, i will have to look into it

3: this is something ive thought about a lot, but ive never been able to come up with a powerful/flexible way of doing it through the game. i think this sort of thing is just better suited to manual coding

Link to comment
  • 2 weeks later...

Uploaded version 2.4.0

Based on some of the recent feedback:

- Various misc fixes

- Added the ability to load guieditor_output.txt directly. This will attempt to load the raw code back into the editor (which will also, unlike when using 'Load GUI', try and maintain variable names and misc settings) making it easier to just save and come back later

1840.png

- Added ability to generate basic onClientResourceStart() lua code with your GUI

- Added Undo/Redo functions (not every function of the editor can be undone, but most things relating to position/size and visual appearance can be)

- Added 'Share' allowing you to individually share the GUI you are working on with other people on the server by taking a 'snapshot' of your GUI and sending it to them (note the gridlist highlight colours only work in mta 1.0.4 and above)

1839.png

Link to comment

Excellent work, the "Share" idea and the concept is completly awesome, opens you many possibilities while building your own gui and sharing with others, no more screenshot previews, just go ingame and see that user View ( he must to share with you ofc. ).

Link to comment
  • 2 weeks later...
integration how? outputting textlib styled code?

might be nice if textlib was expanded to include some more dx items as well

I also made a textlib "spinoff", called imagelib which is used in the killmessages resource. It's not as useful as textlib which adds a couple of useful features like text styling, but it's main function is to just objectify images. I'm not sure anything else would require a library.

Link to comment
  • 3 months later...
  • 2 weeks later...
  • 4 months later...

First of all, great script and very handy! Good job!

But I found several bugs, which i would like to report; here are some of them (also some trivial feature requests):

- The "Created: " lines in GUIEditor_output.txt have a little "bug" at the date. The month value of getRealTime() is always between 0-11, but since you would normally expect it to be 1-12, you should add +1 to it, so that it doesn't say 13.00.2011 for today's date. Respective line would be in guieditor_s.lua, line 21.

- Any image, which is created, when loading code from the output file, is the mtalogo.png. I don't know, if it's a bug or deliberately done like this for debug reasons and forgotten about, but the respective line is found at load_gui_c.lua, line 259.

- When wanting to create an image by using "Create image" from the context menu, sometimes just nothing happens, when you try to drag the area for the image after selecting the source image. I don't know, why and when it won't work from time to time, but just mentioning it.

- When changing the title of a with dxDrawText created text, the old text isn't shown in the editbox, where you enter the new title, as it is when editing guiCreateLabel titles. Maybe this feature is just missing because you can't really retrieve the text from a drawn text like you could with guiGetText(), but you could save the titles in a table.

- You should really add the possibility to create scrollbars and scrollpanes, since it's a pain in the butt to create them manually. And with 1.1, there are also the comboboxes, to which it would be great, if you could add support for them, too.

- The horizontal and vertical alignment is not restored for the first dxDrawText to load, when loading code from the output file. If you have 2 dxDrawText lines to restore, just the first one won't have the correct alignment.

- I don't know if it's possible to do, but you could add the feature to change the item text for gridlist rows, but this might not be easy to do, since it seems that when you click a row, the clicked item is actually just the gridlist itself.

I found some more bugs, which I can't recall anymore, also the share feature seems to be quite buggy still (especially for the other one viewing your gui), but I hope you find this helpful and good job again! :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...