Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local api = { LoadOrder = 0 }
- function api.Build()
- local System = { Data = data("/nekOS") }
- function System:getManifest() return self:load("main.manifest") end
- function System:save(p,d) return self.Data:save(p,d) end
- function System:load(p) return self.Data:load(p) end
- function System.getTextColor() return colors[settings.get("nekos.text_color")] or colors.white end
- function System.getBackgroundColor() return colors[settings.get("nekos.background_color")] or colors.gray end
- function System:install() local m = self:getManifest() for k,v in pairs(m.Files) do v.Version = 0 end m:save() os.reboot() end
- function System:getUpdate() local m=self:getManifest() pastebin:get(m.Code,"/nekOS/update.manifest",true) return self:load("update.manifest") end
- function System:update() local o = rawget(self:getManifest(),"Data") for k,v in self:gupdate(m) do local s,e=pastebin:get(v.Code,k,true) end for k in self:glegacy(o) do fs.delete(k) end end
- function System:getFileUpdates() local o,m=self:getManifest(),self:getUpdate() return table.filter(m.Files,function(v,k) return not o.Files[k] or v.Version ~= o.Files[k].Version end) end
- function System:getLegacyFiles() local o,m=self:getManifest(),self:getUpdate() return table.filter(o.Files,function(v,k) return not m.Files[k] end) end
- function System:gupdate() local e,i=self:getFileUpdates(),0 local k=table.keys(e) return function() i=i+1 if k[i] then return k[i],e[k[i]] end end end
- function System:glegacy() local k,i=table.keys(self:getLegacyFiles()),0 return function() i=i+1 if k[i] then return k[i] end end end
- function System:getMissingIcon() return settings.get("nekos.missing_icon") end
- function System:getUser() return data:load("data.user") end
- return System
- end
- return api
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement