Jump to content

[REL] GUI Editor 3.1.3


Remp

Recommended Posts

As it is in README

Note: Due to the current limitations in MTA that evolves around Lua environments and Object Orientated Programming, this GUI system only works within one resource and can only be used by one resource. We do not recommend running multiple dxGUI scripts (across different resources or within a single resource) as this may cause a significant impact to visitors of your server. We recommend that all important logic that utilises the GUI exists within a centralised resource (take care for security, keep secure scripts away from the main GUI). 

So it won't be any exported functions. Anyway, whole script works on OOP. OOP functions as far as I know are impossible to export.

Personally I tested this script and it is really good, tho. You have to just see functions in files. For example creation window:

local window = dxWindow:create ( x, y, width, height, text ) 

And if you want to change something

window:setTitleColor ( r, g, b ) 

If you want to make it work this dxGUI library has to be inside your script.

Link to comment
  • 4 months later...

Is there a way to make the output of GUI's relative value exactly as it is in the dimensions tab (right-click on an element>dimensions), because it outputs 0.06 instead of 0.057 and that causes me some trouble when I need something in the exact same position, I've tried searching code_generation.lua for this but found nothing...

Link to comment

You should be able to change the global decimal place variable to 3 to force it to output with an extra decimal place. It's defined in code_generation.lua, line 10 in the current version (gDecimalPlaces). It will also mean other things are output with an extra decimal place (like width/height), but that shouldn't matter.

Link to comment
  • 3 months later...

I noticed an issue when I was outputting my code.

At first, it wouldn't show the output window at all with no errors or outputs.

I then shared the code to my laptop and that showed the code output, but when I tried to view it, it came up with this error:

[string "___PositionCoder___ = PositionCoder..."]:753: '}' expected near 't'

I decided to copy the code to a file, then sent it to my main computer, put it in the output folder of guieditor and tried loading it from there, only the error occurred again.

exact error from loading code: INFO::801 loadGUICode loading error: [string "___PositionCoder___ = PositionCoder..."]:753: '}' expected near 't'

Not sure what it means, any ideas?

Link to comment

It most likely means that the gui editor can't understand some part of the code, and is erroring trying to figure it out.

Is it your own (hand written) gui code that you are loading in and trying to edit, or is it something that you created entirely inside the editor?

Are you using the latest version (3.1.2)?

Can you send me a copy of the code you are trying to load in?

Link to comment

I have isolated the problem to the text that is in one of your dxDrawText calls. The combination of commas and single quotation marks trips an obscure bug in how the editor loads in the data. You can work around this for now by removing the commas from the text string and adding them back in manually outside the gui editor.

I will pm you more specific details, and i'll try to upload a fix for this soon.

Edit (9th Jan 2016):

GUI Editor 3.1.3 update (minor):

- Fixed obscure bug loading in text with a specific comma/quote pattern in dx text strings

MTA Community link

Thanks for the report alberto2345, sorry for the delay in putting out a fix.

Link to comment
  • 4 weeks later...

Another feature request would be a sort of ruler/grid system. It should be a fairly easy implementation, and I'm sure some people will find it useful. I know I would, because I tend to set it up all the time.

For example;

iieYscxl.jpg

@Tails:

Adding the render target would be rather redundant. If anything, you could simply draw a rectangle to get a sort of preview of how big it would be. Then you simply draw whatever you to be drawn onto this render target.

What I usually do is I draw the rectangle, then I hold ctrl and right-click the rectangle, then you will have the option to lock it. When it's locked, it won't register right-clicking so you won't accidentally move or change it.

Same applies to guiCreateBrowser and createBrowser.

Link to comment
  • 4 weeks later...
  • 6 months later...

It could be a bug with the GUI Editor, but I have not heard of it happening before. When you say nothing happens, does that mean the output window doesn't appear?

Are you using the latest version (3.1.3)?

Are there any errors in the debug console?

There is only one code path in the "Ouptut" code, so the only way I can think that it would fail is if it is throwing an error somewhere. Do you have a code sample (that I can load in to the editor) you can send me that will cause this problem to happen?

Link to comment
  • 2 months later...
17 minutes ago, Remp said:

I'm not sure what you mean exactly, can you explain the problem a little more?

Let's say I create a DX window with a text label using my DXGUI. I then decide to add a button, then I'd like to use your guieditor since it's easy to use and gives me a visual representation on the fly.

So if I draw for example a rectangle somewhere, I can right-click it and move it around or resize it. However, as soon as I move it on top of one of my custom DX elements - if I try and right-click the rectangle, I won't get the option to manipulate the rectangle. But rather a window to load code from the element underneath the cursor.

Edit:

Recorded a short video to showcase what's going on.

Edited by Dealman
  • Like 1
Link to comment
4 minutes ago, Remp said:

I see now, thanks

Does it work as you want it to if you enable "Post GUI" on the rectangle? That should work for now. I could perhaps add a setting to disable loading prompts completely, i'll have to look into it

Oh derp, yeah that makes sense - that works just fine. :P

Link to comment
  • 9 months later...

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...