-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPLDkpBidsNote.lua
More file actions
66 lines (54 loc) · 2.04 KB
/
PLDkpBidsNote.lua
File metadata and controls
66 lines (54 loc) · 2.04 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
-------------------------------------------------------------------------------
-- PL DKP Bids Note Frame
--
-- Author: Fuddler/Gimmeurgold - Primal Legion @ Destromath-EU
-- Version: 3.0
--
-------------------------------------------------------------------------------
local _, PLDKPBids = ...
---------------------------------------------------------------------
-- event handlersand hooks Options Frame
---------------------------------------------------------------------
---------------------------------------------------------------------
-- function PLDkpBidsNoteFrame_OnLoad()
--
-- Called when the Mod-Frame is loaded
--
-- Initializes the AddOn and registers for common events
---------------------------------------------------------------------
function PLDkpBidsNoteFrame_OnLoad()
PLDkpBidsNoteFrame:RegisterEvent("VARIABLES_LOADED");
end
---------------------------------------------------------------------
-- function PLDkpBidsNoteFrame_OnEvent(event)
--
-- Default eventhandler for the Frame
--
-- Handels events for all Mods
---------------------------------------------------------------------
function PLDkpBidsNoteFrame_OnEvent(event)
local playerName = UnitName("player");
if (event == "VARIABLES_LOADED") then
PLDkpBidsNoteFrameHeaderString:SetText( PLDKP_NOTE_UI_HEADER );
PLDkpBidsNoteFrameSaveButton:SetText( PLDKP_OPTIONS_SAVE );
PLDkpBidsNoteFrameCancelButton:SetText( PLDKP_OPTIONS_CANCEL );
PLDkpBidsNoteFrameNoteEdit:SetText(PLDKP_WinnerNote);
end
end
function PLDkpBidsNoteFrame_SetNote(note)
PLDkpBidsNoteFrameNoteEdit:SetText(PLDKP_WinnerNote);
end
function PLDkpBidsNoteFrame_NoteEditESC()
HideUIPanel(PLDkpBidsNoteFrame);
end
function PLDkpBidsNoteFrame_NoteEditENTER()
tmp = PLDkpBidsNoteFrameNoteEdit:GetText();
PLDKP_WinnerNote = tmp;
HideUIPanel(PLDkpBidsNoteFrame);
if ( (PLDKP_LastWinners[PLDKP_WinnerNoteKey] ~= nil) ) then
PLDKP_LastWinners[PLDKP_WinnerNoteKey].Note = PLDKP_WinnerNote;
PLDKP_println(string.format(PLDKP_NOTE_SAVED,PLDKP_WinnerNote));
else
PLDKP_println(PLDKP_NOTE_NOTSAVED);
end
end