vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1  
2 local set = {name="ctmapmod"};
3  
4 function set.getpoints(name, map)
5 if(CT_UserMap_Notes) then
6 for zid,zonename in pairs(Yatlas_PaperZoneNames[map]) do
7 if(CT_UserMap_Notes[zonename]) then
8 local real_zid;
9 for h,v in pairs(Yatlas_areadb) do
10 if(v[2] == zonename) then
11 real_zid = h;
12 break;
13 end
14 end
15  
16 local x1,x2,y1,y2,x,y,ops;
17 x1 = Yatlas_mapareas[map][real_zid][1];
18 x2 = Yatlas_mapareas[map][real_zid][2];
19 y1 = Yatlas_mapareas[map][real_zid][3];
20 y2 = Yatlas_mapareas[map][real_zid][4];
21  
22 for id,dat in ipairs(CT_UserMap_Notes[zonename]) do
23 ops = {};
24  
25 x,y = Yatlas_Big2Mini_Coord(-dat.x*(x1-x2) + x1, -dat.y*(y1-y2) + y1);
26  
27 if(dat.set ~= 1 and dat.set ~= 6) then
28 ops = {commonpd="g"..dat.name};
29 end
30  
31 YAPoints_AddPoint(nil, "ctmapmod", dat.name, x, y, ops, dat);
32 end
33 end
34 end
35 end
36 end
37  
38 function set.setuppoint(point, env, dat)
39 local text, bg = point.Foreground, point.Icon;
40  
41 local iconname = "Interface\\AddOns\\Yatlas\\images\\Icons\\Icon-Square";
42 local iconszw = env.iconsize/2+2;
43  
44 -- ctmapmod knows best...
45 if ( dat.userdat.set == 7 or dat.userdat.set == 8 ) then
46 local offset = 0;
47 if ( dat.userdat.set == 8 ) then
48 offset = 29;
49 end
50 if ( CT_UserMap_HerbIcons[dat.userdat.icon+offset] ) then
51 iconname = "Interface\\AddOns\\CT_MapMod\\Resource\\" .. CT_UserMap_HerbIcons[dat.userdat.icon+offset];
52 else
53 iconname = "Interface\\AddOns\\CT_MapMod\\Resource\\Herb_Bruiseweed";
54 end
55 else
56 iconname = "Interface\\AddOns\\CT_MapMod\\Skin\\" .. CT_UserMap_Icons[dat.userdat.set];
57 end
58  
59 text:SetText("");
60 point:Show();
61 point:SetOffset(dat.x, dat.y);
62  
63 bg:Show();
64 bg:SetHeight(iconszw*2);
65 bg:SetWidth(iconszw*2);
66 bg:SetTexture(iconname);
67 bg:SetVertexColor(1,1,1,1);
68 end
69  
70 function set.setuplegend(point, env, dat)
71 env.iconsize = 15;
72 set.setuppoint(point, env, dat);
73  
74 point.Text:SetText(dat.name);
75 end
76  
77 function set.configmenu(name, lm)
78 if(CT_MapMod_AddNote) then
79 local info;
80 if(UIDROPDOWNMENU_MENU_LEVEL == 1) then
81 info = {};
82 info.text = YATLAS_POINTS_CTMAPMOD;
83 info.func = YFOODropDown_do_toggle_normal;
84 info.checked = YatlasOptions.Frames[lm].PointCfg
85 and not YatlasOptions.Frames[lm].PointCfg[name];
86 info.value = name;
87 info.keepShownOnClick = 1;
88 UIDropDownMenu_AddButton(info);
89 end
90 end
91 end
92  
93 YAPoints_RegisterSet(set);