forked from gjpc/CombatAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
executable file
·99 lines (83 loc) · 3.75 KB
/
main.lua
File metadata and controls
executable file
·99 lines (83 loc) · 3.75 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
--[[ THIS CODE AND ALL OF ITS RESOURCES ARE IN THE PUBLIC DOMAIN ]]--
--[[ Plugin entry point ]]--
_G.printDebug = false;
-- Import Turbine Classes
import "Turbine";
import "Turbine.Gameplay";
import "Turbine.UI";
import "Turbine.UI.Lotro";
-- Determine Locale and load locale specific text information
-- convert from a Turbine language object to a supported locale value
local language = Turbine.Engine.GetLanguage();
_G.locale = (language == Turbine.Language.German and "de" or (language == Turbine.Language.French and "fr" or (language == Turbine.Language.Russian and "ru" or "en" )));
_G.L = {}
-- since English & German are supported at release, load their locale files directly
if (locale == "en" or locale == "de") then
import ("CombatAnalysis.Locale."..locale);
-- for all other languages, we now load the English locale file first, then load the language specific file (which may only override some values) only if it exists
else
import ("CombatAnalysis.Locale.en");
pcall(import, ("CombatAnalysis.Locale."..locale));
end
-- Import Utils & UI
import "CombatAnalysis.Utils";
import "CombatAnalysis.UI";
-- Import Other Helper Classes
import "CombatAnalysis.Data";
import "CombatAnalysis.Players";
import "CombatAnalysis.Parser";
-- Import the Main Menu (and Help Menu)
import "CombatAnalysis.Menu"; --- v4.1/4.2
import "CombatAnalysis.Help"; --- v4.2+
-- Import each individual Plugin package
import "CombatAnalysis.StatOverview"; --- v4.0
import "CombatAnalysis.Effects"; --- v4.1 (for BuffBars Debuff/CC tracking)
-- import "CombatAnalysis.StatAnalysis"; --- v4.3+
-- import "CombatAnalysis.FloatyInfo"; --- v4.3/4+
-- import "CombatAnalysis.ChatFiltering"; --- ? (possible future feature)
-- import "CombatAnalysis.HealingBars"; --- ? (possible future feature)
-- import "CombatAnalysis.GearScore"; --- ? (possible future feature)
--[[ Start up ]]--
-- Print the Welcome Message (the version number is extracted automatically)
Turbine.Shell.WriteLine("Combat Analysis by Evendale enhanced by Landal"..(locale ~= "en" and L.TranslatedBy ~= nil and L.TranslatedBy ~= "" and " ("..L.TranslatedBy..")" or ""));
Turbine.Shell.WriteLine("Combat Analysis v"..versionNo.." by Landal"..(locale ~= "en" and L.TranslatedBy ~= nil and L.TranslatedBy ~= "" and " ("..L.TranslatedBy..")" or ""));
-- Load the Data Files List to assist with loading/saving
LoadDataList();
-- Initialize the global combat data object (create "Totals" encounter with timestamp)
combatData:Initialize();
-- Set up a callback to load the user Settings which will create all relevant windows
local function LoadSettingsCallback()
if (not pcall(LoadSettings)) then
-- if there is an error loading the settings file, give the user the option to reset immediately
dialog:ShowConfirmDialog(L.FailedToLoadSettingsResetConfirmation,function(confirm)
if (confirm) then
RestoreDefaultSettings(true);
_G.combatAnalysisLoaded = true;
else
Turbine.Shell.WriteLine(L.FailedToLoadSettingsMessage);
menuPane:Destroy();
collectgarbage();
end
end);
else
_G.combatAnalysisLoaded = true;
end
end
-- Load Trait Configurations
if (not pcall(LoadTraits)) then
-- if there is an error loading the traits file, give the user the option to reset immediately
dialog:ShowConfirmDialog(L.FailedToLoadTraitsResetConfirmation,function(confirm)
if (confirm) then
RestoreDefaultTraits(true,true);
InitializeRunningBuffs();
LoadSettingsCallback();
else
Turbine.Shell.WriteLine(L.FailedToLoadTraitsMessage);
menuPane:Destroy();
collectgarbage();
end
end);
else
InitializeRunningBuffs();
LoadSettingsCallback();
end