vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | |
2 | local landmarkaltinstance = {nil,nil,nil,nil,-1}; |
||
3 | local landmarkalttown = {nil,nil,nil,nil,-4}; |
||
4 | |||
5 | local set = {name="landmarks"}; |
||
6 | |||
7 | function set.getpoints(name, map) |
||
8 | -- we got these from map api. don't use if we see Megellan |
||
9 | if(type(Yatlas_Landmarks[map]) == "table" and Magellan_Init == nil) then |
||
10 | for h,v in ipairs(Yatlas_Landmarks[map]) do |
||
11 | local x,y = Yatlas_Big2Mini_Coord(v[1],v[2]); |
||
12 | |||
13 | YAPoints_AddPoint(nil, "landmarks", v[3], x, y, nil, Yatlas_Landmarks[map][h]); |
||
14 | end |
||
15 | end |
||
16 | |||
17 | -- we got these...from OURSELVES! |
||
18 | if(type(Yatlas_instances[map]) == "table") then |
||
19 | for h,v in ipairs(Yatlas_instances[map]) do |
||
20 | local x,y = Yatlas_Big2Mini_Coord(v[2],v[3]); |
||
21 | |||
22 | YAPoints_AddPoint(nil, "landmarks", v[1], x, y, nil, landmarkaltinstance); |
||
23 | end |
||
24 | end |
||
25 | |||
26 | -- 'other towns' ...we got these...from OURSELVES! |
||
27 | if(type(Yatlas_towns2[map]) == "table") then |
||
28 | for h,v in ipairs(Yatlas_towns2[map]) do |
||
29 | local x,y = Yatlas_Big2Mini_Coord(v[2],v[3]); |
||
30 | |||
31 | YAPoints_AddPoint(nil, "landmarks", v[1], x, y, nil, landmarkalttown); |
||
32 | end |
||
33 | end |
||
34 | end |
||
35 | |||
36 | function set.setuppoint(point, env, dat) |
||
37 | local text, bg = point.Foreground, point.Icon; |
||
38 | local x1, x2, y1, y2; |
||
39 | local r, g, b; |
||
40 | local bgtextname; |
||
41 | local iconsize = env.iconsize; |
||
42 | |||
43 | if(dat.userdat[5] == 4 or dat.userdat[5] == 5 or dat.userdat[5] < 0) then |
||
44 | x1 = 0; y1 = 0; |
||
45 | x2 = 1; y2 = 1; |
||
46 | |||
47 | r = 0.2; |
||
48 | g = 0.6; |
||
49 | b = 1; |
||
50 | bgtextname = "Interface\\AddOns\\Yatlas\\images\\Icons\\Icon-Circle"; |
||
51 | if(dat.userdat[5] == 5) then |
||
52 | bgtextname = "Interface\\AddOns\\Yatlas\\images\\Icons\\Icon-Star"; |
||
53 | iconsize = iconsize+2; |
||
54 | elseif(dat.userdat[5] == -1) then |
||
55 | r = 0.9; |
||
56 | g = 0.1; |
||
57 | b = 0.9; |
||
58 | bgtextname = "Interface\\AddOns\\Yatlas\\images\\Icons\\Icon-Cave"; |
||
59 | elseif(dat.userdat[5] == -4) then |
||
60 | r = 0.3; |
||
61 | g = 0.8; |
||
62 | b = 1; |
||
63 | bgtextname = "Interface\\AddOns\\Yatlas\\images\\Icons\\Icon-Exclaim"; |
||
64 | end |
||
65 | else |
||
66 | x1, x2, y1, y2 = WorldMap_GetPOITextureCoords(dat.userdat[5]); |
||
67 | r,g,b = 1,1,1; |
||
68 | bgtextname = "Interface\\Minimap\\POIIcons" |
||
69 | end |
||
70 | |||
71 | point:Show(); |
||
72 | point:SetOffset(dat.x, dat.y); |
||
73 | text:SetText(""); |
||
74 | |||
75 | bg:Show(); |
||
76 | bg:SetHeight(iconsize); |
||
77 | bg:SetWidth(iconsize); |
||
78 | bg:SetTexture(bgtextname); |
||
79 | bg:SetTexCoord(x1, x2, y1, y2); |
||
80 | bg:SetVertexColor(r, g, b, 1); |
||
81 | end |
||
82 | |||
83 | function set.setuplegend(point, env, dat) |
||
84 | env.iconsize = 16; |
||
85 | set.setuppoint(point, env, dat); |
||
86 | |||
87 | point.Text:SetText(dat.name); |
||
88 | end |
||
89 | |||
90 | function set.configmenu(name, lm) |
||
91 | if(UIDROPDOWNMENU_MENU_LEVEL == 1) then |
||
92 | local info = {}; |
||
93 | info.text = YATLAS_POINTS_LANDMARKS; |
||
94 | info.func = YFOODropDown_do_toggle_normal; |
||
95 | info.checked = YatlasOptions.Frames[lm].PointCfg and not YatlasOptions.Frames[lm].PointCfg[name]; |
||
96 | info.value = name; |
||
97 | info.keepShownOnClick = 1; |
||
98 | UIDropDownMenu_AddButton(info); |
||
99 | end |
||
100 | end |
||
101 | |||
102 | YAPoints_RegisterSet(set); |
||
103 |