-
-
Save Industrial/6207684ea95b27ccbce4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local idTweaks = LibStub('AceAddon-3.0'):NewAddon('idTweaks', | |
'AceConsole-3.0' | |
) | |
function idTweaks:OnInitialize() | |
self.db = LibStub('AceDB-3.0'):New('idTweaksDB') | |
self.options = { | |
name = 'idTweaks', | |
handler = self, | |
type = 'group', | |
args = { | |
profile = LibStub('AceDBOptions-3.0'):GetOptionsTable(self.db) | |
} | |
} | |
end | |
function idTweaks:OnEnable() | |
LibStub('AceConfig-3.0'):RegisterOptionsTable('idTweaks', self.options, { 'idt', 'idtweaks' }) | |
LibStub('AceConfigDialog-3.0'):AddToBlizOptions('idTweaks') | |
end | |
local MaxCameraDistance = idTweaks:NewModule('MaxCameraDistance') | |
function MaxCameraDistance:OnInitialize() | |
-- TODO: make this static | |
self.defaultValue = GetCVar('cameraDistanceMax') | |
-- TODO: Make this an option | |
self.value = 30 | |
end | |
function MaxCameraDistance:OnEnable() | |
SetCVar('cameraDistanceMax', self.value) | |
end | |
function MaxCameraDistance:OnDisable() | |
SetCVar('cameraDistanceMax', self.defaultValue) | |
end | |
local ReplaceChatMessages = idTweaks:NewModule('ReplaceChatMessages') | |
function ReplaceChatMessages:OnInitialize() | |
self.filters = { | |
CHAT_MSG_AFK = { | |
}, | |
CHAT_MSG_COMBAT_FACTION_CHANGE = { | |
}, | |
CHAT_MSG_COMBAT_GUILD_XP_GAIN = { | |
}, | |
CHAT_MSG_COMBAT_HONOR_GAIN = { | |
}, | |
CHAT_MSG_COMBAT_XP_GAIN = { | |
['(.+) dies, you gain (.+) experience. %(%+(.+)exp Rested bonus%)'] = '+ %2 (+%3) xp: %1', | |
['(.+) dies, you gain (.+) experience.'] = '+ %2 xp: %1' | |
}, | |
CHAT_MSG_COMBAT_MISC_INFO = { | |
}, | |
CHAT_MSG_CURRENCY = { | |
}, | |
CHAT_MSG_DND = { | |
}, | |
CHAT_MSG_GUILD_ACHIEVEMENT = { | |
['%%s has earned the achievement (.+)!'] = '\124cff00ff00g %1 %%s\124hwat123' | |
}, | |
CHAT_MSG_IGNORED = { | |
}, | |
CHAT_MSG_LOOT = { | |
['You receive loot: (.+)%.'] = '+ %1' | |
}, | |
CHAT_MSG_MONEY = { | |
}, | |
CHAT_MSG_SKILL = { | |
}, | |
CHAT_MSG_SYSTEM = { | |
['You are now Busy: in combat'] = '+ Combat', | |
['You are no longer marked Busy.'] = '- Combat' | |
}, | |
CHAT_MSG_TARGETICONS = { | |
}, | |
CHAT_MSG_TRADESKILLS = { | |
} | |
} | |
end | |
function ReplaceChatMessages:OnEnable() | |
for event, eventFilters in pairs(self.filters) do | |
ChatFrame_AddMessageEventFilter(event, function(frame, event, message, ...) | |
if next(eventFilters) == nil then | |
ReplaceChatMessages:Print(event..' :'..message) | |
end | |
for k,v in pairs(eventFilters) do | |
message = message:gsub(k, v) | |
end | |
return nil, message, ... | |
end) | |
end | |
end | |
-- Make this a module to create new slash commands from the config/options. | |
local SlashCommands = idTweaks:NewModule('SlashCommands') | |
function SlashCommands:OnEnable() | |
SlashCmdList['IDTWEAKS_RELOAD'] = ReloadUI | |
SLASH_IDTWEAKS_RELOAD1 = '/rl' | |
SLASH_IDTWEAKS_RELOAD2 = '/reload' | |
end | |
function SlashCommands:OnDisable() | |
SlashCmdList['IDTWEAKS_RELOAD'] = nil | |
SLASH_IDTWEAKS_RELOAD1 = nil | |
SLASH_IDTWEAKS_RELOAD2 = nil | |
end | |
local AnchorMouse = idTweaks:NewModule('AnchorMouse', 'AceHook-3.0') | |
function AnchorMouse:GameTooltip_SetDefaultAnchor(tooltip, self) | |
tooltip:SetOwner(self, 'ANCHOR_CURSOR') | |
end | |
function AnchorMouse:OnEnable() | |
self:SecureHook('GameTooltip_SetDefaultAnchor') | |
end | |
function AnchorMouse:OnDisable() | |
self:Unhook('GameTooltip_SetDefaultAnchor') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment