"Modified _bastion.lua: added file exclusions in Load function, removed OnTick function, updated GetMinimumTickRate and GetTickRate functions, and added tick rate printing and global variable assignments."

CiscOH Bellic 2 years ago
parent 2c4bfce097
commit b0793ddbe1
  1. 20
      src/_bastion.lua

@ -39,7 +39,10 @@ local function Load(dir)
for i = 1, #files do for i = 1, #files do
local file = files[i] local file = files[i]
if file:sub(-4) == ".lua" or file:sub(-5) == '.luac' then if (file == "ExampleDependency.lua") or (file == "ExampleDependencyError.lua") or (file == "ExampleLibrary.lua") or (file == "ExampleModule.lua")
then
-- Skip these files
elseif file:sub(-4) == ".lua" or file:sub(-5) == '.luac' then
Bastion:Require(dir .. file:sub(1, -5)) Bastion:Require(dir .. file:sub(1, -5))
end end
end end
@ -372,19 +375,14 @@ end
-- return -- return
-- end -- end
function Bastion:OnTick()
for i = 1, #MODULES do
MODULES[i]:OnTick()
end
end
local lastTick = 0 local lastTick = 0
local timeElapsed = 0 local timeElapsed = 0
local configTickRate = .01 local configTickRate = .01
Bastion.tickRate = 0
function Bastion:GetMinimumTickRate() function Bastion:GetMinimumTickRate()
local fr = GetFrameRate() local fr = GetFramerate()
local minTick = 1/fr local minTick = 1/fr
return minTick return minTick
end end
@ -394,6 +392,8 @@ function Bastion:GetTickRate()
return math.max(min, configTickRate) return math.max(min, configTickRate)
end end
Bastion.tickRate = Bastion:GetTickRate()
function Bastion:GetTick() function Bastion:GetTick()
return GetTime() return GetTime()
end end
@ -420,10 +420,14 @@ tickFrame:HookScript("OnUpdate", function(self, elapsed)
timeElapsed = timeElapsed - Bastion.tickRate timeElapsed = timeElapsed - Bastion.tickRate
Bastion:Ticker() Bastion:Ticker()
end end
Bastion:Print("TickRate: " .. Bastion.tickRate)
Bastion.tickRate = Bastion:GetTickRate() Bastion.tickRate = Bastion:GetTickRate()
end) end)
Bastion._Unlocker = Tinkr
_G.Bastion = Bastion
Load("@Libraries/") Load("@Libraries/")
Load("@Modules/") Load("@Modules/")
Load("@") Load("@")

Loading…
Cancel
Save