-
Notifications
You must be signed in to change notification settings - Fork 1
/
GraphicalReporter.lua
137 lines (96 loc) · 3.34 KB
/
GraphicalReporter.lua
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
--[=[
H.H.T.D. World of Warcraft Add-on
Copyright (c) 2009-2018 by John Wellesz (hhtd@2072productions.com)
All rights reserved
Version @project-version@
In World of Warcraft healers have to die. This is a cruel truth that you're
taught very early in the game. This add-on helps you influence this unfortunate
destiny in a way or another depending on the healer's side...
More information: https://www.wowace.com/projects/h-h-t-d
-----
GraphicalReporter.lua
-----
This component displays a list of known healers with a proximity sensor, the list is click-able and will run a targeting macro
- it may also focus them
- trigger a chosen spell
- should not ring when target through macro
--]=]
--@debug@
local ERROR = 1;
local WARNING = 2;
local INFO = 3;
local INFO2 = 4;
local ADDON_NAME, T = ...;
local HHTD = T.HHTD;
local L = HHTD.Localized_Text;
-- Create module
HHTD.Graphical_Reporter = HHTD:NewModule("GR")
local GR = HHTD.Graphical_Reporter;
function GR:CreateGRObjectsAnchor() -- {{{
self.Anchor = {};
self.Anchor.frame = CreateFrame ("Frame", nil, UIParent);
local frame = self.Anchor.frame;
frame:EnableMouse(true);
frame:RegisterForDrag("LeftButton");
frame:SetScript("OnDragStart", frame.StartMoving);
frame:SetScript("OnDragStop", frame.StopMovingOrSizing);
frame:SetPoint("CENTER"); frame:SetWidth(263); frame:SetHeight(33);
-- create a beautiful texture for the anchor.
local AnchorTexture = frame:CreateTexture("ARTWORK");
AnchorTexture:SetAllPoints();
AnchorTexture:SetTexture(0.275, 0.765, 0.222);
AnchorTexture:SetAlpha(0.85);
frame:Hide();
end -- }}}
function GR:OnEnable() -- {{{
self:Debug(INFO, "OnEnable");
-- start roaming updater code here
end -- }}}
function GR:OnDisable() -- {{{
self:Debug(INFO2, "OnDisable");
-- stop roaming update here and hide evrything
end -- }}}
-- Graphical Reporter Objects constructor
GR.GRObject = {};
local GRObject = GR.GRObject;
GRObject.Prototype = {};
GRObject.Metatable ={ __index = GRObject.Prototype };
GRObject.Count = 0;
GRObject.Initialized = false;
function GRObject:new(...)
local instance = setmetatable({}, self.Metatable);
instance:Init(...);
return instance;
end
function GRObject.Prototype:Init(healerName)
if not HHTD.initOK then
HHTD:Debug(INFO, "Initializing EH object for", healerName, "failed, initialization incomplete");
return;
end
HHTD:Debug(INFO, "Initializing EH object for", healerName);
GRObject.Count = GRObject.Count + 1;
self.Shown = false;
self.ProximitySensor = false;
-- create the frame
self.Frame = CreateFrame ("Button", nil, UIParent, "SecureUnitButtonTemplate");
-- global texture
self.Texture = self.Frame:CreateTexture(nil, "ARTWORK");
self.Texture:SetPoint("CENTER", self.Frame, "CENTER", 0, 0)
self.Texture:SetHeight(16);
self.Texture:SetWidth(160);
-- name (class colored)
-- proximity light
-- targetable indicator
end
--@end-debug@
-- === ROADMAP === --
-- name (class colored)
-- proximity light
-- targetable indicator
-- heal amount indicator
-- anchoring function
-- update mechanism
-- -- Roaming or not roaming?
-- -- -- needed for proximity light and macro update
-- -- -- needed for deletion (grey out unseen healers - make them disappear completely in some event)
-- -- -- leave combat trigger