Author Topic: XLib Documentation  (Read 1087 times)

0 Members and 1 Guest are viewing this topic.

Online captain1342

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 3
    • View Profile
    • Aperture-Hosting
XLib Documentation
« on: December 26, 2016, 10:44:05 AM »
Heyo,

I am working on a XGUI Module for my Lua Script MRSync ... but I can't find a Documentation for it so... do i Need to search for the stuff I Need in the Lua file or is theer a Documentation i am just to stupid to find?

thanks for reading,

~RD
Aperture-Hosting Manager

Web: https://Aperture-Hosting.de
Mail: Webmaster@Aperture-Hosting.de
Github: https://github.com/captain1242
Discord: https://discord.gg/wxpbtYk
Teamspeak: ts3.Aperture-Hosting.de
Support: https://www.aperture-hosting.de/ticketsystem/
"Hosting with Vision"

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 7610
  • Karma: 343
  • Sertafide Ulysses Jenius
    • View Profile
    • Team Ulysses [ULib/ULX, other fine releases]
Re: XLib Documentation
« Reply #1 on: December 26, 2016, 01:33:37 PM »
No documentation other than the lua files themselves - but at one time he actually thought he'd have time to do it.
Reference - https://forums.ulyssesmod.net/index.php/topic,9110.msg46561.html
The price one pays for pursuing any profession or calling is an intimate knowledge of its ugly side. - James Baldwin

Online captain1342

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 3
    • View Profile
    • Aperture-Hosting
XLib Hidepanel
« Reply #2 on: December 30, 2016, 09:31:52 AM »
Hey is there a way to hide ^text Entrys fully? I Just make them non selectable when i set visible to false
« Last Edit: December 30, 2016, 09:39:47 AM by captain1342 »
Aperture-Hosting Manager

Web: https://Aperture-Hosting.de
Mail: Webmaster@Aperture-Hosting.de
Github: https://github.com/captain1242
Discord: https://discord.gg/wxpbtYk
Teamspeak: ts3.Aperture-Hosting.de
Support: https://www.aperture-hosting.de/ticketsystem/
"Hosting with Vision"

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 474
  • Karma: 83
  • I write code
    • View Profile
Re: XLib Documentation
« Reply #3 on: December 31, 2016, 04:19:21 AM »
What do you mean by "hide fully?" Isn't making them unselectable and invisible hiding them fully?
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Online captain1342

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 3
    • View Profile
    • Aperture-Hosting
Re: XLib Documentation
« Reply #4 on: December 31, 2016, 06:45:32 AM »
Strangely.. making them Unselectable and Unvisible doesent make them Unvisible .. but when i just make them Invisible it works
Aperture-Hosting Manager

Web: https://Aperture-Hosting.de
Mail: Webmaster@Aperture-Hosting.de
Github: https://github.com/captain1242
Discord: https://discord.gg/wxpbtYk
Teamspeak: ts3.Aperture-Hosting.de
Support: https://www.aperture-hosting.de/ticketsystem/
"Hosting with Vision"

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 474
  • Karma: 83
  • I write code
    • View Profile
Re: XLib Documentation
« Reply #5 on: January 01, 2017, 02:23:45 PM »
Can you give us a code snippet to show exactly what you're doing?
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Online captain1342

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 3
    • View Profile
    • Aperture-Hosting
Re: XLib Documentation
« Reply #6 on: January 04, 2017, 11:50:57 AM »
http://pastebin.com/1NPCpcdD

Thats where I get Currently Errors

and here is the Error:


[ERROR] lua/vgui/dlistview.lua:107: attempt to index local 'Line' (a nil value)
  1. RemoveLine - lua/vgui/dlistview.lua:107
   2. DoClick - addons/msync/lua/ulx/xgui/settings/cl_msync_gui.lua:162
    3. unknown - lua/vgui/dlabel.lua:232

it means this MSync.Modules.enabledModulesList:AddLine( MSync.Modules.enabledModulesList:GetSelected()[1]:GetValue() )

but i dont see anything wrong with it
Aperture-Hosting Manager

Web: https://Aperture-Hosting.de
Mail: Webmaster@Aperture-Hosting.de
Github: https://github.com/captain1242
Discord: https://discord.gg/wxpbtYk
Teamspeak: ts3.Aperture-Hosting.de
Support: https://www.aperture-hosting.de/ticketsystem/
"Hosting with Vision"

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 474
  • Karma: 83
  • I write code
    • View Profile
Re: XLib Documentation
« Reply #7 on: January 04, 2017, 01:56:02 PM »
I don't think it's that line. The error references RemoveLine, but the line you're saying is causing the error doesn't remove a line; it adds one. My best guess is that it's the next line, but I can't be sure unless you give me the entire file so I can cross reference the line numbers. I'm on an airplane now, posting this via the in-plane WiFi (painfully slow in-plane WiFi, might I add. But I am on a plane, thousands of feet up in the air, so I'm not sure why I expected better), so I can't test what DListView:GetSelected returns. But my guess is that when it returns a table of the lines (according to the wiki), it's not returning a table of the line numbers. I'll do some spelunking in the code for DListView to see what exactly GetSelected returns and how to get the line number from a line (because it doesn't seem to be documented in the wiki) and get back to you.

edit 2: The magic of GitHub strikes again. If the version of DListView_Line on GitHub is to be trusted, then you should be able to do something like Line:GetID() and supply that as the argument to DListView:RemoveLine(). I should probably be a good citizen and document this on the wiki, but I'm lazy and not looking forward to waiting for the page to load on this slow WiFi. Maybe once I get home.

An additional, less important, fact is that DListView:GetSelected()[1] is identical to DListView:GetSelected() (according to the wiki, at least. It's proven to be less than accurate in the past, but usually pretty good).

edit: Looking back at the previous replies, I'm very much confused what this has to do with XLib or making things invisible.
« Last Edit: January 04, 2017, 02:03:20 PM by roastchicken »
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Online captain1342

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 3
    • View Profile
    • Aperture-Hosting
Re: XLib Documentation
« Reply #8 on: January 04, 2017, 03:56:41 PM »
GetSelected returns a Table cause it allows to give the full Selection back .. but strangely it stays Empty and says its nil but that cant be true .. i mean i see the entries.. also it is add line cause remove line is doing its job but re adding the line to the other table doesent work
Aperture-Hosting Manager

Web: https://Aperture-Hosting.de
Mail: Webmaster@Aperture-Hosting.de
Github: https://github.com/captain1242
Discord: https://discord.gg/wxpbtYk
Teamspeak: ts3.Aperture-Hosting.de
Support: https://www.aperture-hosting.de/ticketsystem/
"Hosting with Vision"

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 474
  • Karma: 83
  • I write code
    • View Profile
Re: XLib Documentation
« Reply #9 on: January 06, 2017, 10:05:20 AM »
I'm not sure what your issue is. Are you still having errors?
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Online captain1342

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 3
    • View Profile
    • Aperture-Hosting
Re: XLib Documentation
« Reply #10 on: January 06, 2017, 06:49:44 PM »
Add line is Causing issues cause Remove line does its Job .. and now I dont know what to do.. i mean i need it for a Disabled and Enabled modules list .. if you know a better way to do that then please tell me
Aperture-Hosting Manager

Web: https://Aperture-Hosting.de
Mail: Webmaster@Aperture-Hosting.de
Github: https://github.com/captain1242
Discord: https://discord.gg/wxpbtYk
Teamspeak: ts3.Aperture-Hosting.de
Support: https://www.aperture-hosting.de/ticketsystem/
"Hosting with Vision"

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 474
  • Karma: 83
  • I write code
    • View Profile
Re: XLib Documentation
« Reply #11 on: January 09, 2017, 11:53:24 AM »
Again, please provide me with any errors and the full files those errors point to. Without this crucial information any help I give is just guesswork. I'm still skeptical that your issue is with the Add line, but I can't weigh in further without the full file so I can look at the corresponding line numbers.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Online captain1342

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 3
    • View Profile
    • Aperture-Hosting
Re: XLib Documentation
« Reply #12 on: January 22, 2017, 09:26:06 AM »
Now a COMPLETE other thing .. i need to Overwrite the ULX ban and ULX banid commands to be able to write bans into a database but when i overwrite it with

Code: Lua
  1. function ulx.banid( calling_ply, steamid, minutes, reason )
  2.                 steamid = steamid:upper()
  3.                 if not ULib.isValidSteamID( steamid ) then
  4.                         ULib.tsayError( calling_ply, "Invalid steamid." )
  5.                         return
  6.                 end
  7.  
  8.                 local name
  9.                 local plys = player.GetAll()
  10.                 for i=1, #plys do
  11.                         if plys[ i ]:SteamID() == steamid then
  12.                                 name = plys[ i ]:Nick()
  13.                                 break
  14.                         end
  15.                 end
  16.  
  17.                 MSync.AddBanID(steamid,reason,calling_ply,minutes)
  18.                
  19.         end
  20.        
  21.         function ulx.ban( calling_ply, target_ply, minutes, reason )
  22.                 if target_ply:IsBot() then
  23.                         ULib.tsayError( calling_ply, "Cannot ban a bot", true )
  24.                         return
  25.                 end
  26.  
  27.                
  28.                 MSync.AddBan(target_ply,reason,calling_ply,minutes)
  29.         end

Then it still bans Regular with the Local ban File
Aperture-Hosting Manager

Web: https://Aperture-Hosting.de
Mail: Webmaster@Aperture-Hosting.de
Github: https://github.com/captain1242
Discord: https://discord.gg/wxpbtYk
Teamspeak: ts3.Aperture-Hosting.de
Support: https://www.aperture-hosting.de/ticketsystem/
"Hosting with Vision"

Offline iViscosity

  • Hero Member
  • *****
  • Posts: 606
  • Karma: 25
    • View Profile
    • iViscosity Gaming
Re: XLib Documentation
« Reply #13 on: January 22, 2017, 01:39:35 PM »
Or, you could just make your addon look through the ban table (ULib.bans) and add it that way. Look at this for information about how it works.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me a PM or Join my Discord!.
--==[ Links ]==--
Steam
YouTube
Steam Group (feel free to join!)
Forums
Public Discord
Teamspeak

Quote from: Steve Jobs
Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.

Online captain1342

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 3
    • View Profile
    • Aperture-Hosting
Re: XLib Documentation
« Reply #14 on: January 22, 2017, 02:26:14 PM »
Then it would need to check the table every 5 minutes which would cause Lags due to the MySQL query which is repeating

btw my code works but it doesent load ... I need to manual load the file to get it working .. maybe ULX isn't loaded when the file loads
Aperture-Hosting Manager

Web: https://Aperture-Hosting.de
Mail: Webmaster@Aperture-Hosting.de
Github: https://github.com/captain1242
Discord: https://discord.gg/wxpbtYk
Teamspeak: ts3.Aperture-Hosting.de
Support: https://www.aperture-hosting.de/ticketsystem/
"Hosting with Vision"