• Print

Author Topic: Help with Main Module  (Read 5151 times)

0 Members and 1 Guest are viewing this topic.

Offline deathhood

  • Newbie
  • *
  • Posts: 2
  • Karma: 1
Help with Main Module
« on: July 07, 2017, 03:17:07 am »
I am trying to create a Strike system however I cannot for the life of me find out how to create it as a main module. I have created commands for it but I am trying to make it better for staff members on the server. The file I have created loads and it shows up as loaded but I cannot find out how to create the tab to edit with the actual gui setup. I have been attempting to use the other Main Modules to base it off of but with little avail.



Any help with the tabs would be greatly appreciated, I also cannot find any documentation of the ULX menu I found Ulib but not the menu.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Help with Main Module
« Reply #1 on: July 07, 2017, 07:43:02 am »
Yeah, sorry about that, I never got around to making documentation for XGUI. Using maps.lua (lines 6, 176) as an example:
Code: Lua
  1. local maps = xlib.makepanel{ parent=xgui.null }
  2. -- ...
  3. xgui.addModule( "Maps", maps, "icon16/map.png" )

These two lines should be the bare minimum you need to get a panel showing up. Note that the addModule function has a fourth parameter that describes what access level you need to be able to see the tab at all. Everyone should be able to see it if it's not specified. Here's an example from the groups tab:
Code: Lua
  1. xgui.addModule( "Groups", groups, "icon16/group_gear.png", "xgui_managegroups" )

If you've set this to your own custom access level, you'll have to register it with ULib in serverside code, like so sv_groups.lua (line 6):
Code: Lua
  1. ULib.ucl.registerAccess( "xgui_managegroups", "superadmin", "Allows managing of groups, users, and access strings via the groups tab in XGUI.", "XGUI" )

From there, make sure your group has access to this new setting. Let me know if you still can't get it to show up after all that!
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline deathhood

  • Newbie
  • *
  • Posts: 2
  • Karma: 1
Re: Help with Main Module
« Reply #2 on: July 07, 2017, 09:20:07 am »
Thank you for the fast reply! I got it showing up and over the next few days I will be trying to edit the module to fit my needs should I just post here if I require more help or would it be more beneficial to create a new thread?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Help with Main Module
« Reply #3 on: July 07, 2017, 02:56:16 pm »
Posting in this thread is fine. I'll be moving it to Developers corner.
Though the forum section you posted it works, as Help and Support is intended for help with our projects, your questions are more geared towards development in them, not so much how to use the projects themselves.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

  • Print