public
Description: WoW Addon - Handles all your mount & travel-form needs
Homepage: http://www.tekkub.net/
Clone URL: git://github.com/tekkub/mountme.git
Click here to lend your support to: mountme and make a donation at www.pledgie.com !
tekkub (author)
Sun Jul 06 23:26:28 -0700 2008
commit  27f4cdd44a2f02c204862db67a6371770d02b35d
tree    ec2c89303b644f8fc89b1a5443c0184bf6d83fdf
parent  caaa9c063b639eab47c6b72fc59a7f480d134486
mountme / Config.lua
100644 68 lines (52 sloc) 2.335 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
67
68

local MountMe = MountMe
if not MountMe then return end
 
 
local GAP = 8
local tekcheck = LibStub("tekKonfig-Checkbox")
 
 
local frame = CreateFrame("Frame", nil, UIParent)
frame.name = "MountMe"
frame:Hide()
frame:SetScript("OnShow", function()
  local title, subtitle = LibStub("tekKonfig-Heading").new(frame, "MountMe", "These settings allow you to choose when to swap mount speed equipment.")
 
  local raidswap = tekcheck.new(frame, nil, "Swap when in a raid instance", "TOPLEFT", subtitle, "BOTTOMLEFT", -2, -GAP)
  raidswap.tiptext = "Enable equipment swapping when in a raid instance."
  raidswap:SetChecked(not MountMe.db.raidsuspend)
  local checksound = raidswap:GetScript("OnClick")
  raidswap:SetScript("OnClick", function(self) checksound(self); MountMe.db.raidsuspend = not MountMe.db.raidsuspend end)
 
  local pvpswap = tekcheck.new(frame, nil, "Swap when PvP flagged", "TOPLEFT", raidswap, "BOTTOMLEFT", 0, -GAP)
  pvpswap.tiptext = "Enable equipment swapping when PvP flagged."
  pvpswap:SetChecked(not MountMe.db.PvPsuspend)
 
  local bgswap, bgswaplabel = tekcheck.new(frame, nil, "Swap in Battlegrounds", "TOPLEFT", pvpswap, "BOTTOMLEFT", GAP*2, -GAP)
  bgswap.tiptext = "Enable equipment swapping when in a battleground."
  bgswap:SetChecked(not MountMe.db.BGsuspend)
  if MountMe.db.PvPsuspend then
    bgswap:Disable()
    bgswaplabel:SetFontObject(GameFontDisable)
  else
    bgswap:Enable()
    bgswaplabel:SetFontObject(GameFontHighlight)
  end
 
  pvpswap:SetScript("OnClick", function(self)
    checksound(self)
    MountMe.db.PvPsuspend = not MountMe.db.PvPsuspend
    if MountMe.db.PvPsuspend then
      bgswap:Disable()
      bgswaplabel:SetFontObject(GameFontDisable)
    else
      bgswap:Enable()
      bgswaplabel:SetFontObject(GameFontHighlight)
    end
  end)
  bgswap:SetScript("OnClick", function(self) checksound(self); MountMe.db.BGsuspend = not MountMe.db.BGsuspend end)
 
  frame:SetScript("OnShow", nil)
end)
 
InterfaceOptions_AddCategory(frame)
 
 
LibStub("tekKonfig-AboutPanel").new("MountMe", "MountMe")
 
 
----------------------------------------
-- Quicklaunch registration --
----------------------------------------
 
LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MountMe", {
  launcher = true,
  icon = "Interface\\Icons\\Ability_Mount_WhiteTiger",
  OnClick = function() InterfaceOptionsFrame_OpenToFrame(frame) end,
})