vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --[[
2 Auctioneer
3 Revision: $Id: Auctioneer.lua 998 2006-09-12 02:08:58Z mentalpower $
4 Version: 3.9.0.1000 (Kangaroo)
5 Original version written by Norganna.
6 Contributors: Araband
7  
8 This is an addon for World of Warcraft that adds statistical history to the auction data that is collected
9 when the auction is scanned, so that you can easily determine what price
10 you will be able to sell an item for at auction or at a vendor whenever you
11 mouse-over an item in the game
12  
13 License:
14 This program is free software; you can redistribute it and/or
15 modify it under the terms of the GNU General Public License
16 as published by the Free Software Foundation; either version 2
17 of the License, or (at your option) any later version.
18  
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
23  
24 You should have received a copy of the GNU General Public License
25 along with this program(see GPL.txt); if not, write to the Free Software
26 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 ]]
28  
29  
30 Auctioneer.Version="3.9.0.1000";
31 -- If you want to see debug messages, create a window called "Debug" within the client.
32 if (Auctioneer.Version == "<".."%version%>") then
33 Auctioneer.Version = "3.9.DEV";
34 end
35  
36 local function onLoad()
37 -- Unhook some boot triggers if necessary.
38 -- These might not exist on initial loading or if an addon depends on Auctioneer
39 if (Auctioneer_CheckLoad) then
40 Stubby.UnregisterFunctionHook("AuctionFrame_LoadUI", Auctioneer_CheckLoad);
41 end
42 if (Auctioneer_ShowNotLoaded) then
43 Stubby.UnregisterFunctionHook("AuctionFrame_Show", Auctioneer_ShowNotLoaded);
44 end
45  
46 -- Hook in new tooltip code
47 Stubby.RegisterFunctionHook("EnhTooltip.AddTooltip", 100, Auctioneer.Tooltip.HookTooltip);
48  
49 -- Register our temporary command hook with stubby
50 Stubby.RegisterBootCode("Auctioneer", "CommandHandler", [[
51 local function cmdHandler(msg)
52 local i,j, cmd, param = string.find(string.lower(msg), "^([^ ]+) (.+)$")
53 if (not cmd) then cmd = string.lower(msg) end
54 if (not cmd) then cmd = "" end
55 if (not param) then param = "" end
56 if (cmd == "load") then
57 if (param == "") then
58 Stubby.Print("Manually loading Auctioneer...")
59 LoadAddOn("Auctioneer")
60 elseif (param == "auctionhouse") then
61 Stubby.Print("Setting Auctioneer to load when this character visits the auction house")
62 Stubby.SetConfig("Auctioneer", "LoadType", param)
63 elseif (param == "always") then
64 Stubby.Print("Setting Auctioneer to always load for this character")
65 Stubby.SetConfig("Auctioneer", "LoadType", param)
66 LoadAddOn("Auctioneer")
67 elseif (param == "never") then
68 Stubby.Print("Setting Auctioneer to never load automatically for this character (you may still load manually)")
69 Stubby.SetConfig("Auctioneer", "LoadType", param)
70 else
71 Stubby.Print("Your command was not understood")
72 end
73 else
74 Stubby.Print("Auctioneer is currently not loaded.")
75 Stubby.Print(" You may load it now by typing |cffffffff/auctioneer load|r")
76 Stubby.Print(" You may also set your loading preferences for this character by using the following commands:")
77 Stubby.Print(" |cffffffff/auctioneer load auctionhouse|r - Auctioneer will load when you visit the auction house")
78 Stubby.Print(" |cffffffff/auctioneer load always|r - Auctioneer will always load for this character")
79 Stubby.Print(" |cffffffff/auctioneer load never|r - Auctioneer will never load automatically for this character (you may still load it manually)")
80 end
81 end
82 SLASH_AUCTIONEER1 = "/auctioneer"
83 SLASH_AUCTIONEER2 = "/auction"
84 SLASH_AUCTIONEER3 = "/auc"
85 SlashCmdList["AUCTIONEER"] = cmdHandler
86 ]]);
87 Stubby.RegisterBootCode("Auctioneer", "Triggers", [[
88 function Auctioneer_CheckLoad()
89 local loadType = Stubby.GetConfig("Auctioneer", "LoadType")
90 if (loadType == "auctionhouse" or not loadType) then
91 LoadAddOn("Auctioneer")
92 end
93 end
94 function Auctioneer_ShowNotLoaded()
95 BrowseNoResultsText:SetText("]].._AUCT('MesgNotLoaded')..[[");
96 end
97 local function onLoaded()
98 Stubby.UnregisterAddOnHook("Blizzard_AuctionUI", "Auctioneer")
99 if (not IsAddOnLoaded("Auctioneer")) then
100 Stubby.RegisterFunctionHook("AuctionFrame_Show", 100, Auctioneer_ShowNotLoaded)
101 end
102 end
103 Stubby.RegisterFunctionHook("AuctionFrame_LoadUI", 100, Auctioneer_CheckLoad)
104 Stubby.RegisterAddOnHook("Blizzard_AuctionUI", "Auctioneer", onLoaded)
105 local loadType = Stubby.GetConfig("Auctioneer", "LoadType")
106 if (loadType == "always") then
107 LoadAddOn("Auctioneer")
108 else
109 Stubby.Print("]].._AUCT('MesgNotLoaded')..[[");
110 end
111 ]]);
112 end
113  
114 Auctioneer.OnLoad = onLoad;
115