public
Description: WoW Powerleveling addon
Homepage: http://www.tekkub.net/
Clone URL: git://github.com/tekkub/tourguide.git
Click here to lend your support to: tourguide and make a donation at www.pledgie.com !
tourguide / Help.lua
100644 66 lines (54 sloc) 1.986 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
local TourGuide = TourGuide
local GAP = 8
local tekcheck = LibStub("tekKonfig-Checkbox")
local ww = WidgetWarlock
 
 
local ROWHEIGHT, ROWOFFSET = 24, 3
local descriptions = {
  ACCEPT = "Accept quest",
  COMPLETE = "Complete quest",
  TURNIN = "Turn in quest",
  KILL = "Kill mob",
  RUN = "Run to",
  FLY = "Fly to",
  SETHEARTH = "Set hearth",
  HEARTH = "Use hearth",
  NOTE = "Note",
  USE = "Use item",
  BUY = "Buy item",
  BOAT = "Boat to",
  GETFLIGHTPOINT = "Get flight point",
}
local order = {"ACCEPT", "TURNIN", "COMPLETE", "KILL", "SETHEARTH", "HEARTH", "GETFLIGHTPOINT", "FLY", "BUY", "RUN", "USE", "BOAT", "NOTE"}
 
 
local frame = CreateFrame("Frame", nil, UIParent)
TourGuide.configpanel = frame
frame.name = "Help"
frame.parent = "Tour Guide"
frame:Hide()
frame:SetScript("OnShow", function()
  local title, subtitle = LibStub("tekKonfig-Heading").new(frame, "Tour Guide - Help", "Confused? GOOD! Okey, fine... here's a few hints.")
 
  local anchor
  for i,icontype in ipairs(order) do
--~     for icontype,desc in pairs(descriptions) do
    local f = CreateFrame("Frame", nil, frame)
    if not anchor then
      f:SetPoint("TOPLEFT", subtitle, "BOTTOMLEFT", -2, -GAP)
      anchor = f
    elseif i % 2 == 0 then
      f:SetPoint("TOP", anchor, "TOP")
      f:SetPoint("LEFT", frame, "CENTER", 2, 0)
--~     elseif i == math.ceil(#order/2) then
--~       f:SetPoint("TOP", subtitle, "BOTTOM", 0, -GAP)
--~       f:SetPoint("LEFT", frame, "CENTER", 2, 0)
    else
      f:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT")
      anchor = f
    end
    f:SetPoint("RIGHT", -16, 0)
    f:SetHeight(ROWHEIGHT)
 
    local icon = ww.SummonTexture(f, nil, ROWHEIGHT-ROWOFFSET, ROWHEIGHT-ROWOFFSET, TourGuide.icons[icontype], "LEFT")
    if icontype ~= "ACCEPT" and icontype ~= "TURNIN" then icon:SetTexCoord(4/48, 44/48, 4/48, 44/48) end
 
    local text = ww.SummonFontString(f, nil, "GameFontHighlight", descriptions[icontype], "LEFT", icon, "RIGHT", ROWOFFSET, 0)
  end
 
  frame:SetScript("OnShow", nil)
end)
 
InterfaceOptions_AddCategory(frame)