-
Notifications
You must be signed in to change notification settings - Fork 0
/
Core.lua
52 lines (44 loc) · 1.34 KB
/
Core.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
local addonName = ... ---@type string
---@class Addon
local addon = LibStub("AceAddon-3.0"):GetAddon(addonName)
local DLT_Parent_Frame = _G["DLT_Parent_"]
local DLT_RecButton = _G["DLT_Parent_ToggleRecordingBtn"]
function addon:toggleWindow()
if DLT_Parent_Frame:IsShown() == true then
DLT_Parent_Frame:Hide()
else
DLT_Parent_Frame:Show()
end
end
function addon:ResetAllInstances()
addon:Print("Resetting all instances")
end
-- Functions to deal with starting and stopping recordings
function addon:ToggleRecording_OnClick(s)
addon:Print(s.recording)
if (s.recording) then
addon:Record_Stop()
PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF)
else
addon:Record_Start()
PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON)
end
end
function addon:IsRecording()
return DLT_RecButton.recording
end
function addon:Record_Start()
if (DLT_RecButton.recording) then
return
end
DLT_RecButton.recording = true
DLT_RecButton:SetNormalTexture("Interface\\Addons\\DungeonLootTracker\\Images\\UI-Stop-Up")
DLT_RecButton:SetPushedTexture("Interface\\Addons\\DungeonLootTracker\\Images\\UI-Stop-Up")
end
function addon:Record_Stop()
if (not DLT_RecButton.recording) then
return
end
DLT_RecButton.recording = false
DLT_RecButton:SetNormalTexture("Interface\\Addons\\DungeonLootTracker\\Images\\UI-Record-Up")
end