Ulysses

General => Developers Corner => Topic started by: Professor_Smiley on September 26, 2015, 03:43:22 AM

Title: Ulx !servers window thing
Post by: Professor_Smiley on September 26, 2015, 03:43:22 AM
Hey there, I am learning to code lua and have modified your motd a bit to fit my server.
Here it is
(http://www.daniellebedev.com/randomstuff/motd.png)
As you can see I made two buttons side by side one closes the motd and one disconnects the player. Impressive huh?

Now I want to somehow create a window that looks like this:
(http://www.daniellebedev.com/randomstuff/server.png)

The buttons will make the player execute this console command "connect", "insert longip here"
I am not a very good coder and I have no idea how to do this. I can modify the size of the window but I don't really know anything else such as how to place buttons in specific locations and text and such.

Besides, I need a second motdmenu.lua or something like that and I have no idea if to copy the module and paste it in the same folder or make a different addons folder...
 :(
Can someone explain to me what to do and how all this works? ;DThank you
Title: Re: Ulx !servers window thing
Post by: JamminR on September 26, 2015, 07:42:17 AM
We appreciate creativity.
I moved your post here to Developers corner as this section of the forum is intended for such coding questions.
Because you had the full size of the images, I added height/width to your image tags so as to better fit when browsing.

Personally, I've not dabbled in Gmod gui (or even Xgui) enough to assist you other than what I can read / understand / comprehend* when looking at our XGUI code and the Gmod wiki in general.
* sometimes, comprehending and explanations are a good addition and all that are needed

However, your ideas sounded like something I've seen before, and I found two server hoppers in our releases section.
I saw quickly that both have GUI menus, and you may want to look at thier code and learn from them.
(or even, save yourself time and simply use either on your server)

Server "Hopper" + Platform (http://forums.ulyssesmod.net/index.php/topic,8609.0.html)
and
Simple Hopper (http://forums.ulyssesmod.net/index.php/topic,8464.0.html)


Title: Re: Ulx !servers window thing
Post by: Professor_Smiley on September 28, 2015, 01:30:42 AM
Nice! That was exactly was I was looking for. Saves me time and effort coding it.
And it's called a hopper... lol

Thanks for the links. Kudos to you