• Print

Author Topic: Changing the colors of the ulx motd  (Read 10423 times)

0 Members and 1 Guest are viewing this topic.

Offline hchips

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Changing the colors of the ulx motd
« on: January 20, 2014, 08:47:40 am »
hi i would like to know how to change the colors of the motd i have this scripts from another post on the forums but i want to change the color of text and border.
ulx.motdmenu_exists = true

local isUrl
local url

function ulx.showMotdMenu()
   local url1 = "www.vnbgameservers.net"
   local url2 = "http://www.vnbgameservers.net/misc.php?action=payments"
   local url3 = "http://www.vnbgameservers.net/thread-58.html"
   
   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 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 )
   
   tabmenu:AddSheet( "Forum", html1, _, false, false, _)
   tabmenu:AddSheet( "Donate", html2, _, false, false, _)
   tabmenu:AddSheet( "Rules", html3, _, 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



 

any help?

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Changing the colors of the ulx motd
« Reply #1 on: January 20, 2014, 09:34:24 am »
Wrong file to be editing for text color.
You edit the actual motd for that.
Out of the Garry's Mod business.

Offline hchips

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Changing the colors of the ulx motd
« Reply #2 on: January 20, 2014, 10:37:46 am »
hmm im please show me what to edit

Offline hchips

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Changing the colors of the ulx motd
« Reply #3 on: January 20, 2014, 10:45:28 am »
i dont get what you mean i just want to edit the colors of the border no whats inside the motd just the border and text to change the border

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Changing the colors of the ulx motd
« Reply #4 on: January 20, 2014, 01:33:08 pm »
i dont get what you mean i just want to edit the colors of the border no whats inside the motd just the border and text to change the border

Um...excuse me?
Out of the Garry's Mod business.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Changing the colors of the ulx motd
« Reply #5 on: January 20, 2014, 01:38:06 pm »
Um...excuse me?
He wants to change the colors of the actual Derma panel, not the contents.
I.E. He wants to change the default gray border and white button with black text/images to be something a bit prettier.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Changing the colors of the ulx motd
« Reply #6 on: January 20, 2014, 02:21:01 pm »
He wants to change the colors of the actual Derma panel, not the contents.
I.E. He wants to change the default gray border and white button with black text/images to be something a bit prettier.

Oh. He worded everything weird, so...

Anyway, I've never dealt with derma, so somebody else will need to help.
Out of the Garry's Mod business.

Offline stanhelman

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
Re: Changing the colors of the ulx motd
« Reply #7 on: May 08, 2014, 09:20:22 am »
I really don't care if this counts as bumping but I do know the answer to this topic for I have achieved this here is my motdmenu with the gray background the motd has completely transparent.

If you don't want the gray box to be completely transparent then change surface.SetDrawColor( 50, 50, 50, 0 ) this will be on line 18 if you can also change the 50's to whatever I would experiment with the numbers until you got the color you want as for me I wanted my motd to be completely transparent so I have mine surface.SetDrawColor( 50, 50, 50, 255 )
If you used the tabs like the first post then
window.Paint = function()
surface.SetDrawColor( 50, 50, 50, 255 )  Should be added to lines 21 to 22 also don't forget to add end to line 23 if you don't add end to line 23 the motdmenu will create an error


Code: Lua
  1. ulx.motdmenu_exists = true
  2.  
  3. local isUrl
  4. local url
  5.  
  6. function ulx.showMotdMenu( steamid )
  7.         local window = vgui.Create( "DFrame" )
  8.         if ScrW() > 640 then -- Make it larger if we can.
  9.                 window:SetSize( ScrW()*0.9, ScrH()*0.9 )
  10.         else
  11.                 window:SetSize( 640, 480 )
  12.         end
  13.         window:Center()
  14.         window:SetTitle( "ULX MOTD" )
  15.         window:SetVisible( true )
  16.         window:MakePopup()
  17.         window.Paint = function()
  18.         surface.SetDrawColor( 50, 50, 50, 255 )
  19.         end
  20.        
  21.         local html = vgui.Create( "HTML", window )
  22.  
  23.         local button = vgui.Create( "DButton", window )
  24.         button:SetText( "Close" )
  25.         button.DoClick = function() window:Close() end
  26.         button:SetSize( 100, 40 )
  27.         button:SetPos( (window:GetWide() - button:GetWide()) / 2, window:GetTall() - button:GetTall() - 10 )
  28.  
  29.         html:SetSize( window:GetWide() - 20, window:GetTall() - button:GetTall() - 50 )
  30.         html:SetPos( 10, 30 )
  31.         if not isUrl then
  32.                 html:SetHTML( ULib.fileRead( "data/ulx_motd.txt" ) )
  33.         else
  34.                 url = string.gsub( url, "%%curmap%%", game.GetMap() )
  35.                 url = string.gsub( url, "%%steamid%%", steamid )
  36.                 html:OpenURL( url )
  37.         end
  38. end
  39.  
  40. function ulx.rcvMotd( isUrl_, text )
  41.         isUrl = isUrl_
  42.         if not isUrl then
  43.                 ULib.fileWrite( "data/ulx_motd.txt", text )
  44.         else
  45.                 if text:find( "://", 1, true ) then
  46.                         url = text
  47.                 else
  48.                         url = "http://" .. text
  49.                 end
  50.         end
  51. end
  52.  

  • Print