Advertisement
FFGFlash

apps/nekos/main.lua

Sep 29th, 2021 (edited)
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. local App = app()
  2.  
  3. function App:constructor(user)
  4.   self:disconnectAll("terminate")
  5.   self.Helper = { List = {}, Active = nil }
  6.   for i,f in ipairs(self:list("helpers")) do
  7.     local n=string.match(fs.getName(f),"([^\.]+)")
  8.     self.Helper.List[n]=self:require("helpers/"..n)(self,user)
  9.   end
  10.   self:activate(not user.Username and "setup" or "login")
  11. end
  12.  
  13. function App:activate(n)
  14.   if self.Helper.Active then self.Helper.Active:destroy() end
  15.   if self.Helper.List[n] then
  16.     self.Helper.Active=self.Helper.List[n]
  17.     self.Helper.Active:build()
  18.   end
  19. end
  20.  
  21. function App:draw()
  22.   if not self.Helper.Active then return end
  23.   self.Helper.Active:draw()
  24. end
  25.  
  26. return App
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement