-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminified.lua
More file actions
1 lines (1 loc) · 3.3 KB
/
minified.lua
File metadata and controls
1 lines (1 loc) · 3.3 KB
1
a=screen StormUI={}function StormUI.Create(f)local function g(n,o)local p,q=o[1],o[2]return o[3]and p>=n.x and p<n.x+n.w and q>=n.y and q<n.y+n.w end local function h(n)a.drawRectF(n.x,n.y,n.w,n.h)end local function i(n)a.drawRect(n.x,n.y,n.w,n.h)end local function j(n,o,p,q)a.drawTextBox(n.x+1,n.y+1,n.w,n.h,o,p or 0,q or 0)end local k={pages={},currentPage='default',t=0,theme={}}local function l(n,o,p,q)o=o..(p and"_"..p or"")return(n and n[o])or k.theme[o]or q end local function m(n,o,p)StormUI.utils.setColorToList(l(n,o,p,{255,0,255}))end function k.addPage(n,o)local p={widgets={},background=o or{type=0},id=n}function p.proccess(q,r)for s,t in pairs(p.widgets)do t.proccess(q,r)end end function p.draw()local q=p.background if o.type==1 then StormUI.utils.setColorToList(o.color)a.drawClear()elseif o.type==2 then a.drawMap(o.pos[1],o.pos[2],o.pos[3])elseif o.type==3 then o.func(p.id)end for r,s in pairs(p.widgets)do s.draw()end end function p.addToggle(q,r,s,t,u,v,w)local x={x=r,y=s,w=t,h=u,o=w,active=v,p_click=false,hold_length=0}function x.proccess(y,z)c=x.p_click d=g(x,y)x.p_click=d if y[3]then if z==0 then if d and not c then e=not e x.active=e end end if d then x.hold_length=x.hold_length+1 else x.hold_length=0 end else x.hold_length=0 end end function x.draw()local y=x.active and"on"or"off"m(x.o,"fill_color",y)h(x)m(x.o,"outline_color",y)i(x)m(x.o,"label_color",y)j(x,l(x.o,"label",y,y))end p.widgets[q]=x end function p.addPush(q,r,s,t,u,v)local w={x=r,y=s,w=t,h=u,o=v,hold_length=0}function w.proccess(x,y)d=g(w,x)if d then w.hold_length=w.hold_length+1 else w.hold_length=0 end w.active=d end function w.draw()local x=w.active and"on"or"off"m(w.o,"fill_color",x)h(w)m(w.o,"outline_color",x)i(w)m(w.o,"label_color",x)j(w,l(w.o,"label",x,x))end p.widgets[q]=w end function p.addTextbox(q,r,s,t,u,v,w)local x={x=r,y=s,w=t,h=u,label=v,o=w}function x.proccess(y,z)end function x.draw()m(x.o,"fill_color")h(x)m(x.o,"outline_color")i(x)m(x.o,"label_color")j(x,x.label)end p.widgets[q]=x end function p.addLine(q,r,s,t,u,v)local w={x1=r,y1=s,x2=t,y2=u,color=v}function w.proccess(x,y)end function w.draw()StormUI.utils.setColorToList(w.color)a.drawLine(w.x1,w.y1,w.x2,w.y2)end p.widgets[q]=w end function p.addRect(q,r,s,t,u,v)local w={x=r,y=s,w=t,h=u,o=v}function w.proccess(x,y)end function w.draw()m(w.o,"fill_color")h(w)m(w.o,"outline_color")i(w)end p.widgets[q]=w end function p.addIndicatorRect(q,r,s,t,u,v)local w={x=r,y=s,w=t,h=u,o=v,active=false}function w.proccess(x,y)end function w.draw()m(w.o,"fill_color",w.active and"on"or"off")h(w)m(w.o,"outline_color")i(w)end p.widgets[q]=w end function p.addIndicatorCircle(q,r,s,t,u)local v={x=r,y=s,r=t,o=u,active=false}function v.proccess(w,x)end function v.draw()m(v.o,"fill_color",rectIndic.active and"on"or"off")a.drawCircleF(v.x,v.y,v.r)m(v.o,"outline_color")a.drawCircle(v.x,v.y,v.r)end p.widgets[q]=v end k.pages[n]=p end function k.setPage(n)if k.pages[n]then k.currentPage=n end end function k.process(n)k.pages[k.currentPage].proccess(n,k.t)if n[3]then k.t=k.t+1 else k.t=0 end end function k.draw()k.pages[k.currentPage].draw()end function k.getPage()return k.pages[k.currentPage]end k.addPage('default',f or{type="blank"})return k end StormUI.utils={setColorToList=function(f)a.setColor(f[1],f[2],f[3],f[4])end}StormUI.colors={Transparent={0,0,0,0},White={255,255,255,255},Black={0,0,0,255}}