WoWInterface SVN MadeBy

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 3 to Rev 4
    Reverse comparison

Rev 3 → Rev 4

MadeBy/locale_deDE.lua New file
0,0 → 1,23
local name, tab = ...
local L = LibStub("AceLocale-3.0"):NewLocale(name, "deDE", false)
if L then
L['Alts'] = 'Alts'
L['Available alt chars'] = 'Available alt chars'
L['Link tradeskill'] = 'Link tradeskill'
L['Open tradeskill'] = 'Open tradeskill'
L['List of Tradeskills'] = 'List of Tradeskills'
L['Show all'] = 'Show all'
L['Say Hi'] = 'Say Hi'
L['Functions'] = 'Functions'
L['MadeBy Functions']='MadeBy Functions'
L["Signal other users to check your tradeskills after you login"]='Beim Login anderen Benutzern die Berufelinks anbieten'
L['Others']='Others'
L['Other chars']='Other chars'
L["Auto Hi"]='Auto Hi'
end
 
-- ö \195\182 ß \195\159
-- ü \195\188 ä \195\164
-- Ä \195\132
-- ö \195\182
-- Ü \195\156
\ No newline at end of file
MadeBy/icon2.tga Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes : Added: svn:mime-type + application/octet-stream
MadeBy/MadeBy.toc New file
0,0 → 1,14
## Interface: 40300
## Title: MadeBy
## Notes: Stores your Tradeskills
## Notes-deDE: Speichert Berufelinks
## Author: Rilgamon
## OptionalDeps: Ace3, BrokerPack
## X-WoWI-ID: 15994
## SavedVariables: MadeByDB
## LoadManagers: AddonLoader
## X-LoadOn-Always: delayed
Common\common.xml
locale_enUS.lua
locale_deDE.lua
core.lua
\ No newline at end of file
MadeBy/core.lua New file
0,0 → 1,346
local name, addon = ...
local parentName = addon['parentName'] or "BrokerPack"
local childName = "MadeBy"
 
local defaults = {
}
local options = {
}
local db, L = {}, LibStub("AceLocale-3.0"):GetLocale(childName, true)
addon['version'] = "40300.1"
local function OnText(message)
addon['OnText'](childName, message)
end
local function OnSlashCommand(command)
if( command == 'config') then
 
else
local charname = command:lower()
charname = charname:gsub("^%l",string.upper)
if(db[charname]) then
for k,v in pairs(db[charname]) do
addon['Print'](tostring(charname).."-"..tostring(db[charname][k]['link']))
end
else
addon['Print']("/madeby <CHAR> - Shows tradeskills of <CHAR>")
end
end
end
 
local function sendMessage(info)
local party,guild,whisper,dest
party = false
guild = false
whisper = false
local stm, ver, act, chr, lnk, tsn
stm = time()
ver = addon['version']
act = '-'
chr = UnitName('player')
lnk = '-'
tsn = '-'
-- addon:pinfo(info)
if(info[2]=='sayhi') then
act = 'hi'
party = true
guild = true
whisper = false
elseif(info[1]=='ver') then
act = 'ver'
chr = '-'
dest = info[2]
if(info[3]) then
ver = '-'
end
whisper = true
party = false
guild = false
elseif(info[1]=='get') then
act = 'get'
chr = info[2]
dest = info[3]
whisper = true
party = false
guild = false
elseif(info[1]=='set') then
act = 'set'
chr = info[2]
dest = info[6]
lnk = info[3]
tsn = info[4]
stm = info[5]
whisper = true
party = false
guild = false
end
-- addon:pdebug("MB "..act.." ".."G"..tostring(guild).."P"..tostring(party).."W"..tostring(whisper).."T"..tostring(dest))
-- addon:pdebug("In pref "..addon.commPrefix.." stm"..stm.." ver "..ver.." act "..act.." chr "..chr.." lnk "..lnk.." tsn "..tsn)
if(act ~= '-') then
message = strjoin("_",stm,ver,act,chr,lnk,tsn)
if(IsInGuild() and guild) then
addon:SendCommMessage(addon['commPrefix'], message, "GUILD")
end
if(party) then
addon:SendCommMessage(addon['commPrefix'], message, "PARTY")
end
if(whisper) then
addon:SendCommMessage(addon['commPrefix'], message, "WHISPER", dest)
end
end
end
 
local function sendQuery()
local chr = db['lastQuery']
local alt = db['lastAltQuery']
 
if(chr) then
if(not alt or alt == "" or alt == " ") then
alt = chr
end
-- addon:pdebug(tostring(chr) .. "-".. tostring(alt))
sendMessage(
{'get',alt,chr}
)
else
addon['Print'](L['No character to query'])
end
end
 
local function selectChar(info)
local chars = {}
for k,v in pairs (db) do
if(type(v) == 'table' and k ~= 'ldbicon') then
chars[k] = k
end
end
return chars
end
 
local function selectProf(info)
local profs = {}
local char = db['selectChar']
if(db[char]) then
for k,v in pairs(db[char]) do
print(k,v)
profs[k] = k
end
end
return profs
end
 
local function buildOptChars() end -- dummy
 
local function deleteProf(info)
local char = db['selectChar']
local prof = db['selectProf']
if(char and prof) then
db[char][prof] = nil
end
buildOptChars()
end
 
local function deleteChar(info)
local char = db['selectChar']
if(char) then
db[char] = nil
end
buildOptChars()
end
 
local function showTradeskill(info)
local tradeSkillName = info[#info-1]
local charName = info[#info-2]
local _,_,link,_ = strsplit("\|",db[charName][tradeSkillName]['link'])
link = string.sub(link,2)
SetItemRef(link,db[charName][tradeSkillName]['link'],"LeftButton")
ShowUIPanel(TradeSkillFrame)
end
 
local function openTradeskill(info)
local name = info[2]
local tradeskill = info[3]
local action = info[4]
if(tradeskill == 'showAll') then
OnSlashCommand(info[2])
else
if(action == 'showTradeskill') then
local peb = _G['ChatFrame1EditBox']
for i = 1, NUM_CHAT_WINDOWS do
local eb = _G['ChatFrame'..i..'EditBox']
if(eb:HasFocus()) then
peb = eb
end
end
if(peb:HasFocus()) then
local line = peb:GetText()
line = string.format("%s %s-%s",tostring(line), tostring(name),tostring(db[name][tradeskill]['link']))
peb:SetText(line)
else
addon['Print'](string.format("%s-%s",tostring(name),tostring(db[name][tradeskill]['link'])))
end
end
end
end
 
local function buildOptChars()
local tmp,tmp2
addon['menuAlts']['args'] = {}
addon['menuOthers']['args'] = {}
for k,v in pairs (db) do
if(type(v) == 'table' and k ~= 'ldbicon') then
tmp = addon['AddConfigMenu'](addon,{
['name'] = tostring(k),
['desc'] = L['List of Tradeskills'],
['order'] = 1,
},addon['IsTwink'](addon,k) and addon['menuAlts'] or addon['menuOthers'])
addon['AddConfigEntry'](addon,name,"execute","showAll",L['Show all'],nil,3,openTradeskill,nil,nil,nil,tmp)
for s,t in pairs(db[tostring(k)]) do
tmp2 = addon['AddConfigMenu'](addon,{
['name'] = tostring(s),
['desc'] = nil,
['order'] = 1,
},tmp)
addon['AddConfigEntry'](addon,name,"execute","showTradeskill",L['Link tradeskill'],nil,3,openTradeskill,nil,nil,nil,tmp2)
addon['AddConfigEntry'](addon,name,"execute","openTradeskill",L['Open tradeskill'],nil,3,showTradeskill,nil,nil,nil,tmp2)
end
end
end
end
 
buildPrefs = function() -- local, see dummy above
addon['menuAlts'] = addon['AddConfigMenu'](addon,{
['name'] = L['Alts'],
['desc'] = L['Available alt chars'],
['order'] = 2,
})
addon['menuOthers'] = addon['AddConfigMenu'](addon,{
['name'] = L['Others'],
['desc'] = L['Other chars'],
['order'] = 3,
})
local menuClean = addon['AddConfigMenu'](addon,{
['name'] = L['Commands'],
['desc'] = L['Availiable Utilities'],
['order'] = 4,
})
addon['AddConfigEntry'](addon,name,"select","selectChar",L['Select'],L['Select char.'],1,selectChar,nil,nil,nil,menuClean)
addon['AddConfigEntry'](addon,name,"select","selectProf",L['Profession'],L['Select profession.'],3,selectProf,nil,nil,nil,menuClean)
addon['AddConfigEntry'](addon,name,"execute","deleteChar",L['Delete'],L['Delete all informations stored for this char.'],2,deleteChar,nil,nil,nil,menuClean)
addon['AddConfigEntry'](addon,name,"execute","deleteProf",L['Delete'],L['Delete this profession for this char.'],4,deleteProf,nil,nil,nil,menuClean)
addon['AddConfigEntry'](addon,name,"input","lastQuery",L['Query Character'],L['Sets the character you want ask for his tradeskills'],1)
addon['AddConfigEntry'](addon,name,"input","lastAltQuery",L['Query Alt-Character'],L['Sets the alt character you want informations for'],2)
addon['AddConfigEntry'](addon,name,"execute","sendQuery",L['Send Query'],L["Sends a query to the character asking for his tradeskills or when alt-character is set for his alts tradeskills"],3,sendQuery)
addon['AddConfigEntry'](addon,name,"execute","sayhi",L['Say Hi'],nil,4,sendMessage)
addon['AddConfigEntry'](addon,name,"toggle","autohi",L["Auto Hi"],L["Signal other users to check your tradeskills after you login"],5)
addon['AddConfigEntry'](addon,name,"toggle","answerQuery",L["Answer Tradeskillrequests"],L["Allows MadeBy to send your tradeskills"],6)
buildOptChars()
end
 
function addon:OnCommReceived(prefix, message, distribution, sender)
local stm, ver, act, chr, lnk, tsn = strsplit("_",message)
local info = {}
if(ver ~= addon['version']) then
addon['Print'](format("Different version %s/%s",ver,sender))
end
if(act=='hi') then
info[1] = 'get'
info[2] = chr
info[3] = chr
if(chr ~= UnitName('player')) then
sendMessage(addon,info)
end
elseif(act=='ver') then
if(ver ~= '-') then
addon['Print'](tostring(sender).." "..tostring(ver))
else
info[1] = 'ver'
info[2] = sender
sendMessage(addon, info)
end
elseif(act=='set') then
db[chr] = db[chr] or {}
db[chr][tsn] = db[chr][tsn] or {}
if(db[chr][tsn]['link'] ~= lnk) then
db[chr][tsn]['changed'] = db[chr][tsn]['changed'] or 0
if(tonumber(db[chr][tsn]['changed']) < tonumber(stm)) then
addon['Print']("Tradeskill "..tostring(tsn).." stored for "..tostring(chr))
db[chr][tsn]['link'] = lnk
db[chr][tsn]['changed'] = stm
buildOptChars()
end
end
elseif(act=='get') then
if(db['answerQuery']) then
info[1] = 'set'
info[2] = chr
info[6] = sender
if(tsn ~= '-') then
info[3] = db[chr][tsn]['link']
info[4] = tsn
info[5] = db[chr][tsn]['changed'] or 0
sendMessage(addon, info)
else
if(db[chr]) then
for t,v in pairs(db[chr]) do
info[3] = db[chr][t]['link']
info[4] = t
info[5] = db[chr][t]['changed'] or 0
sendMessage(addon, info)
end
end
end
end
end
end
 
local function learnTradeSkill()
local char = UnitName('player')
local name,_,_ = GetTradeSkillLine()
local link = GetTradeSkillListLink()
if (link and name and char) then
db[char] = db[char] or {}
db[char][name] = db[char][name] or {}
if(db[char][name]['link'] ~= link) then
db[char][name]['link'] = link
db[char][name]['changed'] = time()
addon['Print']("Tradeskill "..tostring(name).." stored")
buildOptChars()
end
end
end
 
addon['TRADE_SKILL_SHOW'] = function()
if(TradeSkillLinkButton:IsVisible()) then
learnTradeSkill()
end
end
 
local function getPref(info)
return db[info[#info]]
end
 
local function setPref(info,value)
db[info[#info]] = value
buildOptChars()
end
local function init()
LibStub("AceComm-3.0"):Embed(addon)
options = addon['InitConfig'](addon, childName, true, {
['name'] = childName,
['type'] = "launcher",
},getPref,setPref)
db = addon['db']['profile']
addon['commPrefix'] = "madeby"
addon:RegisterComm(addon['commPrefix'])
if(db['autohi'] and UnitAffectingCombat("player") ~= 1) then
sendMessage({[2] = 'sayhi'})
end
buildPrefs()
addon['RegisterFunc']({"TRADE_SKILL_SHOW"},"OnEvent", function(self, event, ...)
if(type(addon[event]) == 'function') then
addon[event](self, event, ...)
end
end)
end
 
addon['startup'](addon, name, childName, init, GetRealmName(), nil, true)
\ No newline at end of file
MadeBy/locale_enUS.lua New file
0,0 → 1,33
local name, tab = ...
local L = LibStub("AceLocale-3.0"):NewLocale(name, "enUS", true)
if L then
L['Alts'] = true
L['Available alt chars'] = true
L['Others'] = true
L['Other chars'] = true
L['Query Character'] = true
L['Sets the character you want ask for his tradeskills'] = true
L['Query Alt-Character'] = true
L['Sets the alt character you want informations for'] = true
L['Send Query'] = true
L["Sends a query to the character asking for his tradeskills or when alt-character is set for his alts tradeskills"] = true
L['Say Hi'] = true
L["Auto Hi"] = true
L["Signal other users to check your tradeskills after you login"] = true
L["Answer Tradeskillrequests"] = true
L["Allows MadeBy to send your tradeskills"] = true
L['List of Tradeskills'] = true
L['Open tradeskill'] = true
L['Show all'] = true
L['Link tradeskill'] = true
L['No character to query'] = true
L['Select'] = true
L['Select char.'] = true
L['Profession'] = true
L['Select profession.'] = true
L['Delete'] = true
L['Delete all informations stored for this char.'] = true
L['Delete this profession for this char.'] = true
L['Commands'] = true
L['Availiable Utilities'] = true
end
\ No newline at end of file
MadeBy Property changes : Modified: svn:externals - svn://svn.wowinterface.com/zzcommon-841/trunk/LibCommon Common + svn://svn.wowinterface.com/zzcommon-841/trunk/LibCommon Common svn://svn.wowace.com/wow/ace3/mainline/trunk/AceComm-3.0 Libs/AceComm-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConsole-3.0 Libs/AceConsole-3.0