Author Topic: Tabbed ULX Motd  (Read 2228 times)

0 Members and 1 Guest are viewing this topic.

Offline Eremenion

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Tabbed ULX Motd
« on: February 15, 2015, 01:53:12 PM »
Hey everybody, I'm trying to make an MOTD with tabs to take users to different parts of the site, but none of them work.  Some of them don't even throw errors in the console. Any help would be appreciated.
My motdmenu.lua is as follows
Code: [Select]
ulx.motdmenu_exists = true
 
local isUrl
local url
 
function ulx.showMotdMenu()
local url1 = "http://powderedrp.net/"
local url2 = "http://powderedrp.net/donate/index.php"
local url3 = "http://steamcommunity.com/groups/powerderdmilkrp"
  local url4 = "http://www.powderedrp.net/forum/viewtopic.php?f=21&t=10"

local window = vgui.Create( "DFrame" )
if ScrW() > 640 then -- Make it larger if we can.
window:SetSize( ScrW()*0.9, ScrH()*0.9 )
else
window:SetSize( 640, 480 )
end
window:Center()
window:SetTitle( "ULX MOTD" )
window:SetVisible( true )
window:MakePopup()
 
local tabmenu = vgui.Create( "DPropertySheet", window )
 
 
local html1 = vgui.Create( "HTML" )
local html2 = vgui.Create( "HTML" )
local html3 = vgui.Create( "HTML" )
local html4 = vgui.Create( "HTML" )
 
local button = vgui.Create( "DButton", window )
button:SetText( "Close" )
button.DoClick = function() window:Close() end
button:SetSize( 100, 40 )
button:SetPos( (window:GetWide() - button:GetWide()) / 2, window:GetTall() - button:GetTall() - 10 )
 
tabmenu:SetSize( window:GetWide() - 20, window:GetTall() - button:GetTall() - 50 )
tabmenu:SetPos( 10, 30 )
 
html1:SetSize( window:GetWide() - 30, window:GetTall() - button:GetTall() - 70 )
html1:SetPos( 15, 50 )
html1:OpenURL( url1 )
 
html2:SetSize( window:GetWide() - 30, window:GetTall() - button:GetTall() - 70 )
html2:SetPos( 15, 50 )
html2:OpenURL( url2 )
 
html3:SetSize( window:GetWide() - 30, window:GetTall() - button:GetTall() - 70 )
html3:SetPos( 15, 50 )
html3:OpenURL( url3 )

html4:SetSize( window:GetWide() - 30, window:GetTall() - button:GetTall() - 70 )
html4:SetPos( 15, 50 )
html3:OpenURL( url4 )
 
tabmenu:AddSheet( "Website", html1, _, false, false, _)
tabmenu:AddSheet( "Donate", html2, _, false, false, _)
tabmenu:AddSheet( "Group", html3, _, false, false, _)
tabmenu:AddSheet( "Rules", html4, _, false, false, _)
end
 
function ulx.rcvMotd( isUrl_, text )
isUrl = isUrl_
if not isUrl then
ULib.fileWrite( "data/ulx_motd.txt", text )
else
if text:find( "://", 1, true ) then
url = text
else
url = "http://" .. text
end
end
end

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Tabbed ULX Motd
« Reply #1 on: February 15, 2015, 05:36:25 PM »
Have you looked at any of the other discussions or mentions of "tab" or "tabbed" within the Developers corner area?
Our search box is context sensitive - just go back to main index of the Developers Corner area and search for either word.
I know I've seen what you're trying to do discussed previously, and only presume at least one got it working.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline bender180

  • Full Member
  • ***
  • Posts: 217
  • Karma: 42
    • Benders Villa
Re: Tabbed ULX Motd
« Reply #2 on: February 15, 2015, 07:02:02 PM »
as jamminr said search is a good tool, i scripted this for someone a few months ago? http://forums.ulyssesmod.net/index.php/topic,7505.msg38190.html#msg38190
Made community pool and community bowling and for the life of me couldn't tell you why they are popular.
Also made the ttt ulx commands.

Offline Unknown Gamer

  • Jr. Member
  • **
  • Posts: 79
  • Karma: -2
    • TrueKnife TTT
Tabbed ULX Motd
« Reply #3 on: February 19, 2015, 03:56:54 PM »
No, there is also a problem.. The modt dosen't disapear..

I made one. Let me grab it for you
Newb Coder. Soon to get better

Offline bender180

  • Full Member
  • ***
  • Posts: 217
  • Karma: 42
    • Benders Villa
Re: Tabbed ULX Motd
« Reply #4 on: February 19, 2015, 04:22:46 PM »
i've never been able to figure out what he was talking about, it always closes for me in my tests....
Made community pool and community bowling and for the life of me couldn't tell you why they are popular.
Also made the ttt ulx commands.