• Ugliest code you have written
    9 replies, posted
So I got inspired by the post about pretty code and I wondered, what's the ugliest code you guys have written? Here's mine: [code]local PANEL = { } function PANEL:Init() actionmenu = vgui.Create('DMenu', self) self.test = false end function PANEL:AddOption( string, func, icon ) actionmenu:AddOption( string, func ):SetIcon(icon) return self end function PANEL:AddSubMenu( string ) actionmenu:AddSpacer() local smenu = actionmenu:AddSubMenu( string ) smenu.Title = false function smenu:AddAdminPlugin( plugin ) if not self.Title then smenu:AddOption("Plugins") smenu:AddSpacer() self.Title = true end local adminmenu = self:AddSubMenu( plugin.Name ) adminmenu:AddOption("Users") adminmenu:AddSpacer() for _, u in pairs(player.GetAll()) do if plugin.Reasons then local usermenu = adminmenu:AddSubMenu(''..u:Nick()) usermenu:AddOption("Reasons") usermenu:AddSpacer() for _, v in pairs(plugin.Reasons) do if plugin.DefaultTime then local reasonmenu = usermenu:AddSubMenu(''..v) reasonmenu:AddOption("Time(Minutes)") reasonmenu:AddSpacer() for _,w in pairs(plugin.DefaultTime) do reasonmenu:AddOption(''..w, function () plugin.Func(u, v, w) end) end else usermenu:AddOption(''..v, function() plugin.Func(u, v) end) end end else adminmenu:AddOption(""..u:Nick(), function() plugin.Func(u) end) end end end return smenu end function PANEL:PerformLayout() if self.test == false then actionmenu:SetPos(ScrW() / 2 - 50, ScrH() / 2 - 10) self.test = true end function self:Setpos(x, y) self:SetPos(x, y) end end function PANEL:MakePopup() actionmenu:Open() end function PANEL:Close() actionmenu:Hide() end vgui.Register("ActionMenu", PANEL)[/code] Admin menu inspired by assmod [T]http://i.imgur.com/YMH8CIA.jpg[/T]
Use [ T] [T]http://i.imgur.com/YMH8CIA.jpg[/T]
i present to you; my first ever attempt at stylizing the spawnmenu :godzing: [T]https://feen.us/jozm.png[/T]
[QUOTE=Potatofactory;52101443]Use [ T] [T]http://i.imgur.com/YMH8CIA.jpg[/T][/QUOTE] Thank you actually [T] wasn't working but I realized there was a /a/ in the link. [editline]14th April 2017[/editline] [QUOTE=Bull29;52101500]i present to you; my first ever attempt at stylizing the spawnmenu :godzing: [T]https://feen.us/jozm.png[/T][/QUOTE] That's alot of childrens
Nice spin on my thread. :zoid:
Lets just allow users to input any text into BroadcastLua "what's the worst that could happen" [t]https://i.gyazo.com/59a878d5004c4578070dbd5570d1376f.png[/t]
[URL="https://github.com/Mysterypancake1/Gravity-Editor/blob/master/lua/weapons/gmod_tool/stools/gravityeditor.lua"]All of this[/URL]
not gmod related but one time I got drunk (way beyond ballmers peak) and slammed together an interpreter for a simplified version of brainfuck the code is somewhere deep in my backups and I don't care to try and find it but being that I was drunk I made no attempt to do anything sano with my code and used really nasty functions like strcpy and gits and didn't bother clearing memory since it clears on exit anyway so it breaks if you try to put a big string in it and it doesn't report errors correctly and there are lots of other things wrong with ti
[QUOTE=Bull29;52101500]i present to you; my first ever attempt at stylizing the spawnmenu :godzing: [T]https://feen.us/jozm.png[/T][/QUOTE] Have you posted this before? [editline]13th April 2017[/editline] I swear I've seen it before.
[IMG]https://scontent-sea1-1.xx.fbcdn.net/v/t35.0-12/17379791_1530068053702531_2139364565_o.png?oh=ead87a304d717dcfdefc249be0694d3e&oe=58F20BF1[/IMG] Derped super hard and forgot about short circuiting if statements
Sorry, you need to Log In to post a reply to this thread.