PageRenderTime 39ms CodeModel.GetById 31ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 1ms

/Tukui/modules/blizzard/kill.lua

http://github.com/Asphyxia/Tukui
Lua | 79 lines | 66 code | 11 blank | 2 comment | 15 complexity | 26d0a71d40a47a51728fff7cd448df0b MD5 | raw file
 1local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2-- here we kill all shit stuff on default UI that we don't need!
 3
 4local Kill = CreateFrame("Frame")
 5Kill:RegisterEvent("ADDON_LOADED")
 6Kill:RegisterEvent("PLAYER_LOGIN")
 7Kill:SetScript("OnEvent", function(self, event, addon)
 8	if event == "PLAYER_LOGIN" then
 9		if IsAddOnLoaded("Tukui_Raid") or IsAddOnLoaded("Tukui_Raid_Healing") then
10			InterfaceOptionsFrameCategoriesButton10:SetScale(0.00001)
11			InterfaceOptionsFrameCategoriesButton10:SetAlpha(0)		
12			InterfaceOptionsFrameCategoriesButton11:SetScale(0.00001)
13			InterfaceOptionsFrameCategoriesButton11:SetAlpha(0)
14			CompactRaidFrameManager:Kill()
15			CompactRaidFrameContainer:Kill()
16			CompactUnitFrame_UpateVisible = T.dummy
17			CompactUnitFrame_UpdateAll = T.dummy
18		end	
19	else
20		if addon == "Blizzard_AchievementUI" then
21			if C.tooltip.enable then
22				hooksecurefunc("AchievementFrameCategories_DisplayButton", function(button) button.showTooltipFunc = nil end)
23			end
24		end
25		
26		if addon ~= "Tukui" then return end
27		
28		StreamingIcon:Kill()
29		Advanced_UseUIScale:Kill()
30		Advanced_UIScaleSlider:Kill()
31		PartyMemberBackground:Kill()
32		TutorialFrameAlertButton:Kill()
33		
34		if C.auras.player or C.unitframes.playerauras then
35			BuffFrame:Kill()
36			TemporaryEnchantFrame:Kill()
37			ConsolidatedBuffs:Kill()
38			InterfaceOptionsBuffsPanelConsolidateBuffs:Kill()
39		end
40		
41		InterfaceOptionsUnitFramePanelPartyBackground:Kill()
42
43		-- make sure boss or arena frame is always disabled when running tukui
44		SetCVar("showArenaEnemyFrames", 0)
45		
46		if C.arena.unitframes then
47			InterfaceOptionsUnitFramePanelArenaEnemyFrames:Kill()
48			InterfaceOptionsUnitFramePanelArenaEnemyCastBar:Kill()
49			InterfaceOptionsUnitFramePanelArenaEnemyPets:Kill()
50		end
51		
52		if C.chat.enable then
53			SetCVar("WholeChatWindowClickable", 0)
54			SetCVar("ConversationMode", "inline")
55			InterfaceOptionsSocialPanelWholeChatWindowClickable:Kill()
56			InterfaceOptionsSocialPanelConversationMode:Kill()
57		end
58		
59		if C.unitframes.enable then
60			PlayerFrame:Kill() -- Just to be sure we are safe
61			InterfaceOptionsFrameCategoriesButton9:SetScale(0.00001)
62			InterfaceOptionsFrameCategoriesButton9:SetAlpha(0)	
63			InterfaceOptionsFrameCategoriesButton9:SetScale(0.00001)
64			InterfaceOptionsFrameCategoriesButton9:SetAlpha(0)
65		end
66		
67		if C.actionbar.enable then
68			InterfaceOptionsActionBarsPanelBottomLeft:Kill()
69			InterfaceOptionsActionBarsPanelBottomRight:Kill()
70			InterfaceOptionsActionBarsPanelRight:Kill()
71			InterfaceOptionsActionBarsPanelRightTwo:Kill()
72			InterfaceOptionsActionBarsPanelAlwaysShowActionBars:Kill()
73		end
74		
75		if C["nameplate"].enable == true and C["nameplate"].enhancethreat == true then
76			InterfaceOptionsDisplayPanelAggroWarningDisplay:Kill()
77		end		
78	end
79end)