• I need help with derma
    3 replies, posted
Hi, I try to customize the default DarkRP f4 menu but there is one thing I am clueless about. These are the tabs of the menu: [IMG]http://i.imgur.com/3E658mv.png[/IMG] And I want the color of the tab names to change if the tab is active. [IMG]http://imgur.com/Ud4He44.png[/IMG] But it only works with the ammo tab. Thats the code: [CODE] hook.Add("Think" , "ActiveF4Tab", function() if sheet.Tab:IsActive() then sheet.Tab:SetTextColor( Color( 0, 255, 0, 255 ) ) else if not sheet.Tab:GetDisabled() then sheet.Tab:SetTextColor( Color( 255, 255, 255, 255 ) ) end end end)[/CODE] I'm not sure if you need the entire f4 menu code to solve the problem but if you need it i will post it. By the way I dont edit the core files of darkrp. I edit it in the darkrpmodification addon.
[url]https://facepunch.com/showthread.php?t=1310132[/url] Use it on sheet:Paint() hook, not in think [url]http://wiki.garrysmod.com/page/PANEL/Paint[/url] And, as its for darkrp, please, dont try to sell it
[QUOTE=iJohnny;49879808][url]https://facepunch.com/showthread.php?t=1310132[/url] [/QUOTE] It seems like it doesn't change anything. [QUOTE=Koolaidmini;44477682][CODE]for k, v in pairs(PropertySheet.Items) do if (!v.Tab) then continue end v.Tab.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(math.random(0,255),0,0)) if v.Tab:IsDown() then draw.RoundedBox( 0, 2, 2, w - 4, h - 4, Color( 0, 0, 0, 100 ) ) end end end[/CODE][/QUOTE] It somehow only affects the ammo tab too. [QUOTE=iJohnny;49879808]Use it on sheet:Paint() hook, not in think [url]http://wiki.garrysmod.com/page/PANEL/Paint[/url][/QUOTE] Thats a good point :smile: [QUOTE=iJohnny;49879808]And, as its for darkrp, please, dont try to sell it [/QUOTE] Don't worry. It's just for my server.
*Bump* Does no one know how to solve that issue? Edit: Nevermind. I solved the issue by putting the code in a Paint hook.
Sorry, you need to Log In to post a reply to this thread.