Author Topic: XGUI - Fully featured modular GUI for ULX! (Included with ULX v3.51 and SVN)  (Read 530975 times)

0 Members and 2 Guests are viewing this topic.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #15 on: July 26, 2009, 10:36:50 PM »
I've already given the code a quick perusal a couple times and it seems pretty good. :)

Whew, that's a relief   ;D--  and now-- An update!

(This ones for you, Jay  :D)

Added a tab for plugins/addons! You can now integrate any GUI you want into XGUI with just a few lines of code!



As you can see, there is a dropdown box at the top to list all the addons, and it will display info about the addon to the right. The rest of the space is used for whichever addon is currently selected! For those of you looking to work with integrating your addon into XGUI, check out the 'xgui_addon_examples.lua' file. It shows the code behind those two addons shown on the image.

But, in a nutshell, it works like this:

Code: [Select]
local function function1( parent )
--Using xgui_helpers, this will make a simple label parented to the xgui menu.
x_makelabel{ label="I am an Addon!", textcolor=Color( 0, 0, 0, 255 ), parent=parent }
end

local function function2()
xgui_add_addon{ func=function1, name="Addon_Name", author="Author", version="Version", description="Description" }
end
hook.Add( "xgui_addon", "xgui_addon_test", function2 )

function1 is where you put all of the gui code, and function2 is where the command is to add your gui elements in function1 to XGUI (along with your name, version, description, etc.)
Also note that everything in function1 needs to be parented to 'parent', which is basically just a 570 x 330 panel parented to the plugins tab.

Anyways, tell me what you guys think! If you have any questions/suggestions, feel free to let me know! I do want to hear what you think when putting URestrict on here, Jay  ;)

Give it a try and get the code at http://github.com/SticklyMan/xgui/tree/master!
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #16 on: July 27, 2009, 10:24:30 AM »
I think I'm about to cry, an update dedicated to me? Really? Lol :D
I will work on testing this out tonight.
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline [WCA]AIDS

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 7
    • PlanetWCA Forums
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #17 on: July 29, 2009, 05:50:19 PM »
I have a couple suggestions for when XGUI is finished,
Having so many options right there at your fingertips is wonderful, I truly enjoy what you have accomplished so far.

What I would like to see, and I'm sure you already had plans to do this, is that all of the variables (alltalk, votemap success ratio, pvp damage, etc.) that you can change using your various panels would all start at their current setting.

eg.
if sv_alltalk == 1
then the check box for "alltalk enabled" would be checked.

votemap success ratio is set to 0.5
so the slider would start at 0.5

Sorry if thats difficult to understand, I can't explain it any different.


The second suggestion I have for you is in regards to the votemap panel.

Currently, I have about ~50 maps on the server from the extra content I have installed. I have set ulx votemapsmode to 2 and made a list of the maps I want available for votemap accordingly.
 
My suggestion is that you have your votemap function retrieve ulx votemapsmode and if 2 then use only the maps listed in ulx votemap.



Thanks for reading, keep up the good work. I can't wait till its finished.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #18 on: July 29, 2009, 07:20:24 PM »
Thank you for the feedback, AIDS!  :D

For the convars, I haven't really been testing XGUI on any regular servers.. only listen servers.. So I didn't even notice that was a problem haha (I would have, eventually..) Megiddo has taught me about using replicated convars, so I'll hopefully have those working properly for the next update! Oh and also, I don't play gmod as often as I used to, so if you have any variables you would like to see added to the settings page that I missed, let me know!

As for the votemaps-- Megiddo has brought a few other things to my attention concerning that, so I need to work on that menu quite a bit. I will be putting your suggestion in ASAP!

I am working on fixing everything that I have so far and making a working public release, as Jay has almost recoded most of the GUI for URestrict to work with my GUI-- So stay tuned for more details!
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #19 on: July 29, 2009, 07:51:17 PM »
As for the votemaps

Ulx table "ulx.votemaps" is your friend. Should contain the maps you need no matter what mode. :)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #20 on: July 29, 2009, 08:25:02 PM »
Yes, Megiddo informed me too haha, the thought never crossed my mind when I was working on it
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline [WCA]AIDS

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 7
    • PlanetWCA Forums
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #21 on: July 29, 2009, 10:05:48 PM »
I think that for the most part you have included all of the most used convars, so I don't think there are to many that have yet to be added.
The "start a server-wide vote of the selected maps" feature is glorious.



Also, something I forgot to mention in my earlier post.

Most if not all of the ulx convars you have are not written correctly.
You have included an underscore between ulx and <var> which causes them to return as unknown.

For example,
maps.lua
Code: [Select]
xgmp_settings_votemap:AddItem( x_makecheckbox{ label="Enable Player Votemaps", convar="ulx_votemapEnabled" } )
xgmp_settings_votemap:AddItem( x_makeslider{ label="Minimum Time", min=10, max=10,convar="ulx_votemapMintime", tooltip="Time in minutes after a map change before a votemap can be started" } )
xgmp_settings_votemap:AddItem( x_makeslider{ label="Wait Time", min=5, max=5, decimal=1, convar="ulx_votemapWaitTime", tooltip="Time in minutes after voting for a map before you can change your vote" } )
xgmp_settings_votemap:AddItem( x_makeslider{ label="Success Ratio", min=0.7, max=0.7, decimal=2, convar="ulx_votemapSuccessratio", tooltip="Ratio of votes needed to consider a vote successful.Votes for map / Total players" } )
xgmp_settings_votemap:AddItem( x_makeslider{ label="Minimum Votes", min=3, max=3, convar="ulx_votemapMinvotes", tooltip="Minimum number of votes needed to change a level" } )
xgmp_settings_votemap:AddItem( x_makeslider{ label="Veto Time", min=30, max=30, convar="ulx_votemapVetotime", tooltip="Time in seconds after a map change before an admin can veto the mapchange" } )
xgmp_settings_votemap:AddItem( x_makelabel{ label="Server-wide Votemap Settings" } )
xgmp_settings_votemap:AddItem( x_makeslider{ label="Success Ratio", min=0, max=1, decimal=2, convar="ulx_votemap2Successratio", tooltip="Ratio of votes needed to consider a vote successful.Votes for map / Total players" } )
xgmp_settings_votemap:AddItem( x_makeslider{ label="Minimum Votes", min=0, max=10, convar="ulx_votemap2Minvotes", tooltip="Minimum number of votes needed to change a level" } )

convar="ulx_votemapEnabled"
convar="ulx_votemapMintime"
convar="ulx_votemapWaitTime"
convar="ulx_votemapSuccessratio"
convar="ulx_votemapMinvotes"
convar="ulx_votemapVetotime"
convar="ulx_votemap2Successratio"
convar="ulx_votemap2Minvotes"

Should all have the underscores replaced with a space, so then they would be

convar="ulx votemapEnabled"
convar="ulx votemapMintime"
convar="ulx votemapWaitTime"
convar="ulx votemapSuccessratio"
convar="ulx votemapMinvotes"
convar="ulx votemapVetotime"
convar="ulx votemap2Successratio"
convar="ulx votemap2Minvotes"

Which will stop them from returning as unknown.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #22 on: July 29, 2009, 10:22:54 PM »
thats odd.. when I run:

lua_run print( GetConVarString( "ulx_votemapEnabled" ) )

It returns the correct value.. however,

lua_run print( GetConVarString( "ulx votemapEnabled" ) )

doesn't show anything  ???

Either way, Megiddo is modifying ULX and will be using those replicated convars I mentioned, so, hopefully with my next update along with the SVN update of ULX, things should be working much better  :D
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline [WCA]AIDS

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 7
    • PlanetWCA Forums
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #23 on: July 29, 2009, 10:35:47 PM »
that is odd.

When i close the xgui menu it spits up ulx_votemapEnabled/etc. as being unknown in my console.

also,
server.ini
Code: [Select]
ulx votemapEnabled 1 // Enable/Disable the entire votemap command
ulx votemapMintime 10 // Time after map change before votes count.
ulx votemapWaittime 5 // Time before a user must wait before they can change their vote.
ulx votemapSuccessratio 0.4 // Ratio of (votes for map)/(total players) needed to change map. (Rounds up)
ulx votemapMinvotes 3 // Number of minimum votes needed to change map (Prevents llamas). This supercedes the above convar on small servers.
ulx votemapVetotime 30 // Time in seconds an admin has after a successful votemap to veto the vote. Set to 0 to disable.
ulx votemapMapmode 1 // 1 = Use all maps but what's specified below, 2 = Use only the maps specified below.


But if Megiddo is going to modify ULX then might as well wait and try again when his changes are completed and pushed through the SVN.


I hope I don't sound like I'm backhanding you and calling you stupid, I really am trying to help lol.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #24 on: July 29, 2009, 10:52:10 PM »
lol no, I really do like the help and suggestions-- Seriously, if you have any ideas whatsoever, or something you'd like to see, I'd be happy to put it in there for ya  :D

Anyways, about the convars, it makes sense now lol-- by using ulx votemapWaittime or something with the space-- that's used as a console command to change the variable-- the actual name of the convar accessed through the lua is ulx_votemapWaittime (with the underscore).. But that doesn't matter anymore as megiddo has just pretty much recoded how the ULX convars work lol-- you'll see with the next release  ;D
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #25 on: July 29, 2009, 11:25:03 PM »
Good to see you around, [WCA]AIDS!

I spent my evening ripping out and replacing the cvar implementation in ULX. It's completely different now. The way we were doing it before wasn't at all conducive to having a menu change it. ULX is now handling cvars the same way UPS does; basically there's a server cvar and a client cvar that are kept in sync and obey permissions. The "pretty" way to access cvars is to use "ulx showMotd 1/0", but behind the scenes it's really using "ulx_showMotd" and "ulx_cl_showMotd" (for the client).

Happy updating! :)
Experiencing God's grace one day at a time.

Offline [WCA]AIDS

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 7
    • PlanetWCA Forums
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #26 on: July 29, 2009, 11:51:30 PM »
Good to see you around, [WCA]AIDS!
:)

I spent my evening ripping out and replacing the cvar implementation in ULX.
The next step is to have XGUI included with ULX as the replacement for the present menu when XGUI is completed. ;)

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #27 on: July 30, 2009, 12:34:33 AM »
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline nofear1999

  • Newbie
  • *
  • Posts: 30
  • Karma: 0
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #28 on: July 30, 2009, 10:51:01 AM »
Wait, by both do you mean

if SERVER then
AddCSLuaFile( "filehere" )
end
if CLIENT then
thecodegoeshere
end

Do you  mean that?

Offline atomicspark

  • Full Member
  • ***
  • Posts: 196
  • Karma: 12
Re: XGUI - Fully featured modular GUI for ULX! (WIP)
« Reply #29 on: July 30, 2009, 01:29:39 PM »
Megiddo said I should put my suggestions here, instead of on random IMs to him. I was inquiring if the GUI windows will autosize based on the resolution of the game. This way those whom have decent sized monitors shouldn't have to bother with the millions of scrollbars that I currently see in the screenshots.