-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_dotenv.lua
More file actions
57 lines (50 loc) · 2.37 KB
/
_dotenv.lua
File metadata and controls
57 lines (50 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
if not C_BattleNet then
print("|cFFff0000" .. "C_BattleNet is not available, _dotenv.lua cannot load developer environment variables.")
return
end
---@class LibQuestieDB
local LibQuestieDB = select(2, ...)
local dat = BNGetInfo and C_BattleNet.GetAccountInfoByID(select(3, BNGetInfo()))
local battle_tags = {
-- Please do not add us to battle.net friends... contact us on Discord instead.
-- https://discord.gg/s33MAYKeZd
["Logon#1822"] = true,
}
---@class DotEnv
if dat then
local developer_account = battle_tags[dat.battleTag] and dat.battleTag or false
if developer_account then
print("|cFFffff00" .. "Developer account detected: " .. developer_account)
do
-- Variables to load before all files
print("|cB900FFFF" .. " _dotenv.lua is loading pre-files environment variables...")
-- A warning here is that files loaded after this point could overwrite these variables.
-- For example, do NOT put Database.debugEnabled here, as it will be overwritten by the database generator.
if developer_account == "Logon#1822" then
-- Set other developer-specific settings
elseif developer_account == "SomeOtherGuy#1337" then
-- Set other developer-specific settings
end
print("|cFF00ff00" .. " _dotenv.lua has finished loading pre-files environment variables.")
end
-- Variables to load after all files
C_Timer.After(0, function()
print("|cB900FFFF" .. " _dotenv.lua is loading post-files environment variables...")
-- This is where you can initialize any global variables or settings
-- For example, you might want to set debug mode or other configurations
-- e.g. LibQuestieDB.Database.debugEnabled = true
if developer_account == "Logon#1822" then
-- Set debug mode or any other developer-specific settings
LibQuestieDB.Database.debugEnabled = true
LibQuestieDB.Database.debugPrintEnabled = true
LibQuestieDB.Database.debugLoadStaticEnabled = true
LibQuestieDB.Database.debugPrintNewIdsEnabled = true
-- Override the locale to be german to be able to run the l10n tests.
LibQuestieDB.l10n.currentLocale = "deDE"
elseif developer_account == "SomeOtherGuy#1337" then
-- Set other developer-specific settings
end
print("|cFF00ff00" .. " _dotenv.lua has finished loading environment variables.")
end)
end
end