Kayl Posted May 22, 2010 Share Posted May 22, 2010 (edited) Hello there, Being quite active in scripting this past months, I inevitably had, at some point, to script some GUI. Happy to discover the lua functions provided by MTA team, I followed the tutorial and created my first GUI. Then, when I started to have more complex interfaces to create, I was discouraged by the time I spent playing with margins, positions, sizing in order to have something decent. I had a look at the guieditor resource, which I liked, but then I was a bit disappointed by some of the aspects of GUI creation within MTA itself. I create my scripts outside of MTA (notepad++ ftw, sorry I didn't try the unofficial script editor ), so why not my interfaces? Furthermore, with my additional geeky/nerdy activities, I already happened to use the Qt Framework quite a lot for normal applications. Qt comes with a GUI Editor that I really like (especially the layout/space concept). I therefore decided (a while ago, this is a late release) to create a small application - Qt to Lua - that converts the interfaces created with Qt Designer (the GUI editor of Qt) into lua code usable in your MTA resources. Two screenshots for you to have a quick idea of the result (more available on the paged provided below): In Qt Designer The result in MTA If you are interested, feel free to grab it and test it at the following URL: http://dkrclan.com/?p=qttolua&large MODERATION: http://www.mediafire.com/download/u24e3 ... tToLua.rar You can just play with it without reading the shit load of details I provide in the URL above. However if you want to really control what's going on, I suggest you take 10 minutes to have a look at the details, to make sure you can, from now on, create the best MTA interfaces ever Most of the work I do for MTA is confined/reserved to the server I script for but this is my gift (if of course anyone is interested by it) to the community. On a site note, I release this application just before a small week of holiday, I may not be able to respond to your questions/comments before a week. I apologize in advance for that. ------------------------ Updates: - 17 June: Version 0.1.4 guiWindowSetSizable using the name of the window instead of _root > fixed - 31 August: Version 0.1.5 Support of comboboxes (for MTA 1.1) viewtopic.php?f=91&t=27739&start=15#p319392 - 15 October: Version 0.1.6 Support of scrollbars and label color viewtopic.php?f=91&t=27739&p=323628#p323628 - 20 January 2011: Version 0.1.7 Fix of scrollbar export bug (scrollarea's own scrollbars where also exported) viewtopic.php?p=335732#p335732 Edited January 20, 2011 by Guest Link to comment
robhol Posted May 22, 2010 Share Posted May 22, 2010 Looks very nice. The in-game editor is very nice, but an external GUI editor is cool. Good work! Link to comment
Castillo Posted May 22, 2010 Share Posted May 22, 2010 Good job, i made a test one and was nice Link to comment
kevin11 Posted May 22, 2010 Share Posted May 22, 2010 nice idk what it is but looks nice Link to comment
Jason_Gregory Posted May 22, 2010 Share Posted May 22, 2010 Wow not bad. The Nokia QT Designer looks a bit like Visual Studio. Is it for building Themes/GUI´s for Mobile Phones ? Nice Converter Link to comment
Xierra Posted May 24, 2010 Share Posted May 24, 2010 (edited) Cool!! Now I don't really need to go into MTA SA to make GUIs anymore Thanks very much Kayl, probably useful if you want to make GUI, but you don't have MTA SA. Any ideas to make this sticky? One suggestion: Now add DX things to the editor! Edit: Wow, now this topic has a great adhesive glue! Edited June 14, 2010 by Guest Link to comment
Ayanami Posted June 12, 2010 Share Posted June 12, 2010 Really great job! One thing I ran into though: Window name: wndLogin Created code (not working): guiWindowSetSizable(gui["wndLogin"], false) Should be (I guess): guiWindowSetSizable(gui["_root"], false) Furthermore, the size of some elements is not very accurate in the actual MTA dialog compared to the draft in QT. But one can definitely live with that, and your tool is still a wonderful help and time-saver! Link to comment
Spider Pork Posted June 12, 2010 Share Posted June 12, 2010 Great job. Though I haven't found any way to add images. Have I missed something or they aren't included? Link to comment
Kayl Posted June 16, 2010 Author Share Posted June 16, 2010 Thank you all for your comments and feedback. And thanks to whoever glued the topic. Jason_Gregory > Qt is a cross-plateform framework. It got extended to mobile phones first through QTopia and Trolltech was bought by Nokia only recently in the company's history. But it's more than suitable for normal desktop applications. Qt is also used as the core of KDE (linux). XX3 > Indeed, good idea (dx functions integration). I'll have to think about that. Ayanami > Indeed, the name of the main widget is not used (beside function name) and is accessible through gui._root or gui["root"]. This allows the rest of your code (window show/hide, destruction, etc) to always work with the same _root object. As for the difference of size: make sure you use layouts as mentioned in the help but yes, I concur that for some widgets (mainly gridlist) there is still a difference. As you said, most of the time we can live with that so I didn't try to hack into it to make a perfect match. Spider pork > Images can be used, have a look at the web page and the test resource. In QtDesigner use a QLabel and set its pixmap attribute (look at the example .qrc file). However it only works fine if the images and .qrc file are at the same level as the .ui file. The generated code contains, as expected, calls to guiCreateStaticImage. Link to comment
vovo4ka Posted June 16, 2010 Share Posted June 16, 2010 WoW! cool programm!! Can you add some features?: saving current window and load from file Link to comment
Kayl Posted June 17, 2010 Author Share Posted June 17, 2010 One thing I ran into though:Window name: wndLogin Created code (not working): guiWindowSetSizable(gui["wndLogin"], false) Should be (I guess): guiWindowSetSizable(gui["_root"], false) Thanks. I misunderstood your post and I thought it was a question. Indeed it was buggy. Fixed it now in 0.1.4. Link to comment
Chusmadones Posted June 20, 2010 Share Posted June 20, 2010 Great work, thanks for sharing Link to comment
Exploit Posted August 13, 2010 Share Posted August 13, 2010 Is it me or the link is down? Please can csomeone provide a mirror or something? Link to comment
Kayl Posted August 13, 2010 Author Share Posted August 13, 2010 It was our host having issues. Don't worry it's back now. If the current download location were to be down for too long, I would provide a mirror indeed. Link to comment
Kayl Posted August 31, 2010 Author Share Posted August 31, 2010 Version 1.0.5 available: http://dkrclan.com/qttolua_data/download/QtToLua.zip Added support (for MTA 1.1) of comboboxes: guitest resource updated with combobox examples: http://dkrclan.com/qttolua_data/download/guitest.zip Read help page for details: http://dkrclan.com/?p=qttolua&large Link to comment
Xierra Posted September 16, 2010 Share Posted September 16, 2010 Gonna test the Combobox soon. Nice work, as R3mp hasn't even put this feature on his guieditor yet! Link to comment
[M2S]moe Posted September 18, 2010 Share Posted September 18, 2010 Very nice! I have to +1 DX support. When thats added, I'll drop guieditor and use this instead. Link to comment
GodFather Posted October 8, 2010 Share Posted October 8, 2010 Nice!! Thanks for this. Link to comment
12p Posted October 9, 2010 Share Posted October 9, 2010 Nº1 MTA outside software! I just tried it, I LOVE it! Link to comment
jyrno42 Posted October 9, 2010 Share Posted October 9, 2010 Nice, but what about the scrollbars(GuiCreateScrollBar)? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now