• Print

Author Topic: XGUI Problems  (Read 4540 times)

0 Members and 1 Guest are viewing this topic.

Offline captain1342

  • Full Member
  • ***
  • Posts: 104
  • Karma: 6
  • Quality is our standard
    • Aperture Development - Quality is our standard
XGUI Problems
« on: April 02, 2017, 07:25:56 am »
Hi I have some Problems with XGUI.

I create a Tab like in my MSync addon but here it simply doesen't work and even the label I generate is showed but not in an tab .. no its showed permanently on the screen and I dont know what I am doing wrong.

lua/ulx/xgui/server/sv_woltlabbridge_gui.lua
Code: Lua
  1. ULib.ucl.registerAccess(        "xgui_woltlabbridge", "superadmin", "Allows to see and change WCB Settings.", "XGUI" )
  2. local wcb = {}
  3. function wcb.Init()
  4.         xgui.addDataType( "WoltLabBridge_Settings", function() return WoltLabCBridge.Settings end, "xgui_woltlabbridge", 0, -10 )
  5. end
  6. xgui.addSVModule( "WoltLabBridge", wcb.Init )
  7.  
  8.  
  9. xgui.prepareDataType( "WoltLabBridge_Settings" )
  10.  

lua/ulx/xgui/settings/cl_woltlabbridge_gui.lua
Code: Lua
  1. WoltLabCBridge = WoltLabCBridge or {}
  2. WoltLabCBridge.Modules = WoltLabCBridge.Modules or {}
  3.  
  4. if(ULib.ucl.query(      LocalPlayer(),"xgui_WoltLabBridge"))then
  5.         --MSync.GetSettings()
  6. end
  7.  
  8. function WoltLabCBridge.Modules.init()
  9.         WoltLabCBridge.Modules.DescriptionText = xlib.makelabel{ x=180, y=235, w=300, wordwrap=true, label="TEST", parent=WoltLabCBridge.back }
  10. end
  11.  
  12. WoltLabCBridge.Modules.init()
  13.  
  14. xgui.addSettingModule( "WoltLabBridge", WoltLabCBridge.back, "icon16/shield.png" )
  15.  
Aperture Development
Quality is our standard

Website - GitHub  - Forum  - Steam  - Discord

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: XGUI Problems
« Reply #1 on: April 02, 2017, 10:18:18 am »
Mhm, that label is showing relative to the player’s entire window, instead of the XGUI window. You get this kind of behavior because you don’t start off with a base panel that has xgui.null as its parent.

You are using some kind of base panel (WoltLabCBridge.back), but it’s never initialized.

Using XLIB, you can initialize it like so:
Code: Lua
  1. WoltLabCBridge.back = xlib.makepanel{ parent=xgui.null }
« Last Edit: April 02, 2017, 01:32:10 pm by Timmy »

  • Print