vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | |
2 | local custom = SupplyAndDemand:GetModule("Misc") |
||
3 | |||
4 | local always = SupplyAndDemand:NewModule("Always") |
||
5 | always.metadataheader = "X-S&D-Always" |
||
6 | always.loadcondition = function() return true end |
||
7 | |||
8 | |||
9 | local inparty = SupplyAndDemand:NewModule("In Party") |
||
10 | inparty.metadataheader = "X-S&D-InParty" |
||
11 | inparty.loadcondition = function() return GetNumPartyMembers() > 0 or GetNumRaidMembers() > 0 end |
||
12 | inparty.event = "PARTY_MEMBERS_CHANGED" |
||
13 | |||
14 | |||
15 | local inraid = SupplyAndDemand:NewModule("In Raid") |
||
16 | inraid.metadataheader = "X-S&D-InRaid" |
||
17 | inraid.loadcondition = function() return GetNumRaidMembers() > 0 end |
||
18 | inraid.event = "RAID_ROSTER_UPDATE" |
||
19 | |||
20 | |||
21 | local resting = SupplyAndDemand:NewModule("Resting") |
||
22 | resting.metadataheader = "X-S&D-Resting" |
||
23 | resting.loadcondition = function() return IsResting() end |
||
24 | resting.event = "PLAYER_UPDATE_RESTING" |
||
25 | |||
26 | |||
27 | local notresting = SupplyAndDemand:NewModule("Not Resting") |
||
28 | notresting.metadataheader = "X-S&D-NotResting" |
||
29 | notresting.loadcondition = function() return not IsResting() end |
||
30 | notresting.event = "PLAYER_UPDATE_RESTING" |
||
31 | |||
32 | |||
33 | local mail = SupplyAndDemand:NewModule("At Mailbox") |
||
34 | mail.metadataheader = "X-S&D-AtMail" |
||
35 | mail.loadcondition = function() return MailFrame:IsVisible() end |
||
36 | mail.event = "MAIL_SHOW" |
||
37 | |||
38 | |||
39 | local merchant = SupplyAndDemand:NewModule("At Merchant") |
||
40 | merchant.metadataheader = "X-S&D-AtMerchant" |
||
41 | merchant.loadcondition = function() return MerchantFrame:IsVisible() end |
||
42 | merchant.event = "MERCHANT_SHOW" |
||
43 | |||
44 | local crafting = SupplyAndDemand:NewModule("Crafting") |
||
45 | crafting.metadataheader = "X-S&D-Crafting" |
||
46 | crafting.loadcondition = function() return (CraftFrame and CraftFrame:IsVisible()) or (TradeSkillFrame and TradeSkillFrame:IsVisible()) end |
||
47 | crafting.event = { |
||
48 | "MERCHANT_SHOW", |
||
49 | "CRAFT_SHOW" |
||
50 | } |
||
51 | |||
52 | local pvp = SupplyAndDemand:NewModule("PvP Flagged") |
||
53 | pvp.metadataheader = "X-S&D-PvPFlagged" |
||
54 | pvp.loadcondition = function() return UnitIsPVP("player") end |
||
55 | pvp.event = "UNIT_FACTION" |
||
56 | |||
57 | |||
58 | local truefunc = function() return true end |
||
59 | local lclass, class = UnitClass("player") |
||
60 | local byclass = SupplyAndDemand:NewModule("By Class") |
||
61 | byclass.nomenu = true |
||
62 | byclass.nodb = true |
||
63 | |||
64 | function byclass:OnInitialize() |
||
65 | for name,mod in pairs(self.lodmods) do |
||
66 | local classes = GetAddOnMetadata(name, "X-S&D-Class") |
||
67 | if classes and string.find(string.upper(classes), class) then |
||
68 | custom:RegisterMod(name, lclass, nil, truefunc) |
||
69 | end |
||
70 | end |
||
71 | end |
||
72 | |||
73 | function byclass:OnEnable() |
||
74 | end |
||
75 | |||
76 | -- level, zone |