WoWInterface SVN AKA

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 1 to Rev 2
    Reverse comparison

Rev 1 → Rev 2

trunk/aka.lua New file
0,0 → 1,2201
-- AKA
-- Author: Lon Koenig
-- License: Creative Commons Attribution-Noncommercial 3.0 Unported License (see Readme.txt)
 
-- Globals:
-- ========
-- AKASavedVars = {};
 
AKA_Version=2.11;
AKA_HighestSeenVersion=0;
AKA_FormatVersion=1.1;
AKA_variablesLoaded = false;
 
 
local VISIBLE_MAX=17; -- for scrolling menu
AKA_DEBUG=false;
AKA_TRAFFICMONITOR=false;
 
AKA_LinkedName=nil; -- keep this global for testing
AKA_LinkedName="";
AKA_USERID=nil;
AKA_LastSeen={};
 
 
AKAPrefs_PanelFrames ={"AKAUsersPanel","AKAOptionsPanel"};
AKAPrefs_CurrentPanel=0;
AKA_ToonListDirty=true; -- whether we need to redraw the scrolling character list
 
AKA_SessionList={};
AKA_PendingWhispers={};
 
 
AKA_GuildNotes={};
-- data structures
--
-- AKASavedVars={
-- AKA_Defaults["MyToons"]={
-- ToonID -- toon Name + "**" + Realm name
-- {"name"=name, etc. -- list below in messageFields
-- };
-- AKA_Defaults["FriendToons"] ={ -- same format as MyToons
--
 
 
 
 
-- Locals:
-- =======
 
-- constants:
local MYADDON_NAME = "AKA";
local MYADDON_VERSION = "2.0";
local MYADDON_AUTHOR = "Schnoggo";
local MYADDON_EMAIL = "schnoggo@gmail.com";
local MYADDON_WEBSITE = "http://war-monkey.com/files/";
local OPTIONS_FRAME = "AKA_PrefsFrame";
local MSG_DELIMITER="`";
local REQ_TOKEN="R3Q";
local HEARTBEAT_INTERVAL = 3.0; -- how many seconds per heartbeat of our internal timer
local NOISE_THRESHHOLD = 2.5; -- how many seconds must pass before we consider the channel clear
local TRANSMIT_INTERVAL = .5; -- how many seconds between our own messages
local MSG_PREFIX = "AKAT2_";
local CHANNEL_PREFIX="<AKA_";
local GUILD_NOTE_STRINGS={};
GUILD_NOTE_STRINGS[0]=""; -- none,
GUILD_NOTE_STRINGS[1]='%s-(%a-)%A+.*$'; -- 1st word
GUILD_NOTE_STRINGS[2]='.*%((.*)%).-$'; -- parenthese
GUILD_NOTE_STRINGS[3]='.*%[(.*)%].-$'; --brackets
local BASE64={
"0","1","2","3","4","5",
"6","7","8","9","A","B",
"C","D","E","F","G","H",
"I","J","K","L","M","N",
"O","P","Q","R","S","T",
"U","V","W","X","Y","Z",
"a","b","c","d","e","f",
"g","h","i","j","k","l",
"m","n","o","p","q","r",
"s","t","u","v","w","x",
"y","z","+","/"};
local BASE10={};
 
 
-- build reverse table for professions: (For compressing Profession skill names
AKA_ProfessionIndex = {};
for k, v in pairs (AKA_ProfessionList) do
AKA_ProfessionIndex[v] = k;
end
 
-- build reverse table for races: (For compressing race names)
AKA_RaceIndex = {};
for k, v in pairs (AKA_RaceList) do
AKA_RaceIndex[v] = k;
end
 
 
 
local MESSAGE_FORMAT=BASE64[1]; -- version 1
 
local messageFields={
"name",
"userid",
"nickname",
"class",
"race",
"guild",
"level",
"profession1",
"profession2",
"realm",
"zone",
"note"};
 
 
local displayFields={
"name","nickname","level","gender","race","class","prof1name", "prof1skill","prof2name","prof2skill", "zone"};
 
local tooltipFields={
"name","level","gender","race","class","prof1name", "prof1skill","prof2name","prof2skill", "zone"};
local tooltipDelimiters={
": ", " ", " ", " ", " ", " ", " ", " ", " ", ""};
 
local daysAtyear={};
daysAtyear[2004]=-364;
daysAtyear[2005]=0;
daysAtyear[2006]=365;
daysAtyear[2007]=730;
daysAtyear[2008]=1095;
daysAtyear[2009]=1460;
daysAtyear[2010]=1824;
-- date stuff:
local wowEpoch=38; -- Nove 23, was 38 days from end of year 2004
local todayTable=date("*t");
local TODAY=daysAtyear[todayTable["year"]]+todayTable["yday"]+wowEpoch; -- days at year start + day-of-year
-- TODAY is an integer of days since game launch
-- if the user never logs out, calculating this only here could be a problem
local myPlayerRealm=GetCVar("realmName");
local myPlayerName=UnitName("player");
local myPlayerClassText, myPlayerClassType = UnitClass("player");
local myPlayerID=myPlayerName.."**"..myPlayerRealm;
local myPlayerZone="";
local myPlayerFaction, myLocalizedFaction=UnitFactionGroup("player");
 
 
local DEFAULT_COM_CHANNELS={};
DEFAULT_COM_CHANNELS["Guild"]={};
DEFAULT_COM_CHANNELS["Guild"]["active"]="yes";
DEFAULT_COM_CHANNELS["Raid"]={};
DEFAULT_COM_CHANNELS["Raid"]["active"]="no";
DEFAULT_COM_CHANNELS["Chat"]={};
DEFAULT_COM_CHANNELS["Chat"]["active"]="no";
 
 
local guildieNames={};
local guildiePlayers={};
-- default config settings
local AKA_Defaults={};
AKA_Defaults["MyToons"]={};
AKA_Defaults["FriendToons"]={};
AKA_Defaults["AKA_PrefsShowMeCheck"]=false;
AKA_Defaults["realmchannels"]={};
-- AKA_Defaults["MyNickname"]="*pending*";
AKA_Defaults["MyNickname"]=UnitName("player"); -- just to get them started
 
 
-- scoped vars:
local secondsSinceUpdate = 0;
local pendingSingleAnnounce=false;
local secondsUntilMyRequest = 0;
local secondsSinceLastMsg = 0;
local secondsSinceLastScreenDraw = 0;
local needHello=true;
local hasHookedChat=false;
local originalChatFrame_OnEvent = nil;
local hasHookedGatherer=false;
local originalGathererChat=nil;
 
-- gatherer chat function is Gatherer.Util.ChatPrint in GatherUtil.lua
 
 
local hasHookedChatLink=false;
local originalSetItemRef = nil;
local MessagesSentPerChannel={};
MessagesSentPerChannel["GUILD"]=0;
MessagesSentPerChannel["RAID"]=0;
MessagesSentPerChannel["PARTY"]=0;
MessagesSentPerChannel["WHISPER"]=0;
 
local MessagesRxPerChannel={};
MessagesRxPerChannel["GUILD"]=0;
MessagesRxPerChannel["RAID"]=0;
MessagesRxPerChannel["PARTY"]=0;
MessagesRxPerChannel["WHISPER"]=0;
 
local pendingRequests={};
 
 
local k,v;
 
 
-- My local functions:
-- ====================
 
 
 
local function UnpackProfession(packedProf)
 
-- AKA_ProfessionList
 
end
 
local function UpdateRadios()
local guildNoteOption=AKA_SavedVars["MyToons"][myPlayerID]["guildnotes"];
if (guildNoteOption==nil) then
guildNoteOption=0;
end
for i = 0, 3 do
if (i==guildNoteOption) then
getglobal("AKA_Prefs_RB"..i):SetChecked(true);
else
getglobal("AKA_Prefs_RB"..i):SetChecked(false);
end
i=i+1;
end
end
 
 
function tcount(tab)
local n=0;
local k,v;
for k,v in pairs(tab) do
n=n+1;
end
return n;
end
 
 
local function Dec2BASE64(inDec)
-- Convert numeric value into Base64 string
-- Inputs:
-- inDec - INT *NOTE* This MUST be an integer in this implementation
-- Outputs:
-- return numeric value
local outStr="";
local tDec = inDec; -- make a copy to destroy
local rem,dig;
while (tDec>63) do
rem=mod(tDec, 64);
dig=BASE64[rem+1];
outStr=dig..outStr;
tDec=tDec-rem;
tDec=tDec/64;
end
 
dig=BASE64[tDec+1];
outStr=dig..outStr;
return outStr;
 
end
 
local function BASE642Dec(in64)
-- Convert Base64 string into decimal number
-- Inputs:
-- in64 - STR
-- Outputs:
-- return numeric value
 
local res=0;
local len=strlen(in64);
 
for i=1, len do
res=res+BASE10[strsub(in64, i, i)];
if (i ~= len) then
res=res*64;
end
end
 
return res;
end
 
local function InitMath()
-- Creates reverse lookup table for Base64 routines
-- BASE64 must be created and populated
-- BASE10 must be declared and scoped
-- populates BASE10
BASE10={};
for i=1, 64 do
BASE10[BASE64[i]]=i-1;
end
end
 
local function GenerateUSERID()
-- UserId format is
-- char 1 - flags (None defined, current value must be 0)
-- chars 2-6 Base64 digits (this yields slightly over 1 billion possibilities. Close enough to unique for our purposes)
local outStr="0"; -- noflags currently defined
for i = 1, 5 do
outStr=outStr..BASE64[random(64)];
end
return outStr;
end
 
 
 
 
 
local function ShowSpells()
AKA_SpellBookList={};
local i = 1
while true do
local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL)
if not spellName then
do break end
end
table.insert(AKA_SpellBookList,"'"..spellName .."'".. "(" .. spellRank .. ")");
DEFAULT_CHAT_FRAME:AddMessage( "'"..spellName .."'".. "(" .. spellRank .. ")" );
i = i + 1
end
end
 
 
 
local function GetNickname(visibleName, noColor)
-- Return a nickname string in parenthesis if one should be displayed
-- nickame contains color codes from CleanChat if available
-- the optional {noColor} parameter will return the nickname without color codes if present
-- This function is global in case other mods want to call it
 
local speakerID=visibleName.."**"..myPlayerRealm;
local speakerNick="";
if ((speakerID ~= myPlayerID) or (AKA_SavedVars["AKA_PrefsShowMe"]) ) then -- Only show our own name if set in preferences
if (AKA_SavedVars["FriendToons"] == nil) then
FixDefaults(); -- needs to be an array
end
if (AKA_SavedVars["FriendToons"][speakerID]) then -- if there is an entry for this person
local speakerRec=AKA_SavedVars["FriendToons"][speakerID];
speakerNick=speakerRec["nickname"];
else -- no FriendToons entry for this player, try the guild notes
if (guildieNames[visibleName]) then -- if there is an entry for this person
speakerNick=guildieNames[visibleName];
end
end -- was an entry for this speaker
end -- skip our own name?
 
 
if ((speakerNick ~= "") and (speakerNick~=visibleName) and (noColor==nil)) then
if (CleanChat_GetColorFor) then -- if cleanchat colors are available then use those
speakerNick=CleanChat_GetColorFor(visibleName) .."("..speakerNick..")|r";
else
speakerNick="|c909090FF("..speakerNick..")|r ";
end
end -- something we want to change for speakerNick
return speakerNick;
end
 
 
 
 
-- function AKA_AddMessage(this, msg, r, g, b, id) -- this, msg, r, g, b, id
-- -- arg[1]=arg[1].."!!";
-- if (msg ~= nil) then
-- msg=msg.."!!";
-- end
-- this:AKA_AddMessage_Orig(this, msg, r, g, b, id)
 
-- local rettab = { this:AKA_AddMessage_Orig(unpack(arg)) }
-- return unpack(rettab);
 
-- end
 
 
 
 
 
local function ParseMessage(msg, whoSent, whichChannel)
 
-- whichChannel = "PARTY", "RAID", "GUILD", "BATTLEGROUND", "WHISPER" or chat channel name
-- Split each comma separated element into individual Tokens
-- so that they can be handled properly
 
-- local messageFields={
-- "name", "class", "race", "guild", "level", "prof1name", "prof1skill",
-- "prof2name", "prof2skill", "note"};
 
-- update the list of speakers to mark that this person has AKA:
if (AKA_SessionList[whoSent] ~= nil) then
AKA_SessionList[whoSent]['status']='available';
AKA_SessionList[whoSent]['lastcontact']=GetTime(); -- seconds
AKA_SessionList[whoSent]['channelList'][whichChannel]=true;
else
AKA_SessionList[whoSent]={};
AKA_SessionList[whoSent]['status']='available'; -- 'unknown' when first seen, 'na' if request has timed out, 'available' if AKA request has been answered
AKA_SessionList[whoSent]['lastcontact']=GetTime(); -- seconds
AKA_SessionList[whoSent]['channelList']={};
AKA_SessionList[whoSent]['channelList'][whichChannel]=true;
AKA_SessionList[whoSent]['bestchannel']=whichChannel;
end
 
 
AKA_ErrorMsg("ParseMessage("..msg..","..whoSent..", "..whichChannel..")");
local pString =msg; -- make a copy to take apart
-- pString="hoser`dude`hooman`flying monkeys`2`sproting`1`dancing`300`the coolist dud in the wowerzerverserse.";
local commaIndex;
local senderID=whoSent.."**"..myPlayerRealm
AKA_ParsedMsg={};
 
for count = 1, table.getn(messageFields) do
commaIndex = string.find(pString, MSG_DELIMITER);
local thisFieldName=messageFields[count];
if (commaIndex) then
AKA_ParsedMsg[thisFieldName] = strsub(pString, 1, commaIndex - 1);
pString = strsub(pString, commaIndex + 1);
AKA_ErrorMsg("parsed: "..thisFieldName.."->"..AKA_ParsedMsg[messageFields[count]]);
else -- last entry
AKA_ParsedMsg[thisFieldName] = pString;
-- AKA_ErrorMsg(AKA_ParsedMsg[messageFields[count]]);
break;
end
end
if (AKA_SavedVars["FriendToons"] == nil) then
AKA_SavedVars["FriendToons"]={};
end
local altID="";
if ((AKA_ParsedMsg["realm"] == nil) or (AKA_ParsedMsg["realm"] == "")) then
altID=AKA_ParsedMsg["name"].."**"..myPlayerRealm;
else
altID=AKA_ParsedMsg["name"].."**"..AKA_ParsedMsg["realm"];
end
 
 
 
-- AKA_SavedVars["FriendToons"][whoSent.."**"..myPlayerRealm]=AKA_ParsedMsg; -- save the parsed table in FriendToons
if (altID == senderID) then
AKA_ParsedMsg["firsthand"]=true;
else
AKA_ParsedMsg["firsthand"]=false;
end
if (AKA_ParsedMsg["profession1"] ~= nil) then
AKA_ParsedMsg["prof1name"]=AKA_ProfessionList[strsub(AKA_ParsedMsg["profession1"], 1, 1)];
AKA_ParsedMsg["prof1skill"]=BASE642Dec(strsub(AKA_ParsedMsg["profession1"], 2, 3));
end
if (AKA_ParsedMsg["profession1"] ~= nil) then
AKA_ParsedMsg["prof2name"]=AKA_ProfessionList[strsub(AKA_ParsedMsg["profession2"], 1, 1)];
AKA_ParsedMsg["prof2skill"]=BASE642Dec(strsub(AKA_ParsedMsg["profession2"], 2, 3));
end
 
if (AKA_ParsedMsg["race"] ~= nil) then
if (strlen(AKA_ParsedMsg["race"])>1) then -- upacked version of race
else
-- needs unpacking
local raceSexValue=BASE642Dec(AKA_ParsedMsg["race"]);
-- thisToon["race_sex"]=((gender-1)*16)+raceValue;
local raceValue = mod(raceSexValue, 16);
local sexValue= (raceSexValue-raceValue)/16;
AKA_ParsedMsg["race"]=AKA_RaceList[raceValue];
if (sexValue == 0) then -- "unknown"
AKA_ParsedMsg["gender"]="";
else
AKA_ParsedMsg["gender"]=AKA_GenderList[sexValue+1];
end
end -- race is packed
end -- race not nil
 
 
-- altID=AKA_ParsedMsg["userid"];
AKA_ParsedMsg["lastupdate"]=TODAY;
AKA_SavedVars["FriendToons"][altID]=AKA_ParsedMsg; -- save the parsed table in FriendToons
AKA_ErrorMsg("from:"..whoSent..msg);
if (AKA_ParsedMsg["userid"] ~= nil) then
AKA_LastSeen[AKA_ParsedMsg["userid"]]={["name"]=whoSent,["time"]=GetTime()};
end
AKA_ToonListDirty=true; -- we have new data to display
end
 
 
 
 
 
 
 
-- local minimapzonetext = GetMinimapZoneText();
-- if GetNumRaidMembers()>0 then
 
 
local function UpdateMyData()
local guildName, guildRankName, guildRankIndex = GetGuildInfo("player");
local level= UnitLevel("player");
local race = UnitRace("player");
local raceNum=AKA_RaceIndex[race];
local raceValue=BASE642Dec(raceNum);
local gender=UnitSex("player"); -- 1=unknown,2=male,3=female as of 1.10
local genderText=AKA_GenderList[gender];
local englishFaction, toss =UnitFactionGroup("player"); -- we are just comparing, so English will be used
local thisToon={};
thisToon["name"]=myPlayerName;
thisToon["realm"]=myPlayerRealm;
thisToon["class"]=myPlayerClassText;
thisToon["race"]=race;
thisToon["guild"]=guildName;
thisToon["level"]=level;
thisToon["race"]=race;
thisToon["raceNum"]=raceNum;
thisToon["faction"]=englishFaction;
thisToon["gender"]=genderText;
thisToon["race_sex"]=Dec2BASE64(((gender-1)*16)+raceValue);
 
if (AKA_SavedVars["MyToons"]) then
if (AKA_SavedVars["MyToons"][myPlayerID]) then
 
-- copy over per-toon preferences:
if (AKA_SavedVars["MyToons"][myPlayerID]["guildnotes"]) then
thisToon["guildnotes"]=AKA_SavedVars["MyToons"][myPlayerID]["guildnotes"];
else
thisToon["guildnotes"]=0;
end
 
if (AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]) then
thisToon["com_channels"]=AKA_SavedVars["MyToons"][myPlayerID]["com_channels"];
else
thisToon["com_channels"]=DEFAULT_COM_CHANNELS;
end
else
thisToon["guildnotes"]=0;
thisToon["com_channels"]=DEFAULT_COM_CHANNELS;
end
 
else
thisToon["guildnotes"]=0;
thisToon["com_channels"]=DEFAULT_COM_CHANNELS;
end
 
 
 
 
if (myPlayerZone=="") then
myPlayerZone=GetRealZoneText(); -- GetMinimapZoneText();
end
 
thisToon["zone"]=myPlayerZone;
 
-- Get trade skill information:
local professionCount=1;
local skillCategory="";
for i=1, GetNumSkillLines() do
 
local skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier, skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType, skillDescription = GetSkillLineInfo(i);
if (skillName) then
-- DEFAULT_CHAT_FRAME:AddMessage("skill:"..skillName.." "..skillRank.."type:"..skillCostType, 0.5, 1.0, 0.5, 3);
if (isHeader) then
skillCategory=skillName;
else
if (skillCategory == "Professions") then
thisToon["prof"..professionCount.."name"]=skillName;
thisToon["prof"..professionCount.."num"]=AKA_ProfessionIndex[skillName];
thisToon["prof"..professionCount.."skill"]=skillRank;
-- DEFAULT_CHAT_FRAME:AddMessage("skill:"..skillName.." "..skillRank, 0.5, 1.0, 0.5, 3);
professionCount=professionCount+1;
 
end
 
end
 
end -- testing for nil skill
end -- for loop
 
-- Now step through spell book and check for trade skill specializations:
local p1=thisToon["prof1num"];
if (p1 == nil) then
p1="";
end
local p2=thisToon["prof2num"];
if (p2 == nil) then
p2="";
end
local pRank1=0;
local pRank2=0;
local thisSpellNumber="";
if ((p1 ~= "") or (p2 ~= "")) then -- only test specialization if necessary
 
local i = 1
while true do
local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL)
if not spellName then
do break end
end
thisSpellNumber=AKA_ProfessionIndex[spellName];
if (( thisSpellNumber ~= nil) and (AKA_ProfSpecialMap[thisSpellNumber] ~= nil)) then
-- DEFAULT_CHAT_FRAME:AddMessage( "thisSpellNumber="..thisSpellNumber.." Special= "..AKA_ProfessionList[thisSpellNumber]);
 
local tList=AKA_ProfSpecialMap[thisSpellNumber];
 
if ((tList[1]==p1) and (tList[2]>pRank1)) then
thisToon["prof1num"]=thisSpellNumber;
pRank1=tList[2];
-- DEFAULT_CHAT_FRAME:AddMessage( "upgrading skill "..thisToon["prof1name"].." to "..AKA_ProfessionList[thisSpellNumber]);
 
end
if ((tList[1]==p2) and (tList[2]>pRank2)) then
thisToon["prof2num"]=thisSpellNumber;
pRank2=tList[2];
-- DEFAULT_CHAT_FRAME:AddMessage( "upgrading skill "..thisToon["prof2name"].." to "..AKA_ProfessionList[thisSpellNumber]);
end
 
end
 
 
i = i + 1
end
end -- p1,p1 ~= nil
 
 
 
 
if (AKA_SavedVars["MyToons"] == nil) then
AKA_SavedVars["MyToons"]={};
end
 
AKA_SavedVars["MyToons"][myPlayerID]=thisToon;
 
 
-- local myPlayerRealm=GetCVar("realmName");
-- local myPlayerName=UnitName("player");
-- local myPlayerClassText, myPlayerClassType = UnitClass("player");
-- local myPlayerID=myPlayerName.."**"..myPlayerRealm;
 
end
 
 
 
 
 
local function TransmitMyData(destToon)
-- transmit the data for this toon?
local myNickname=AKA_SavedVars["MyNickname"];
if ((myNickname=="*pending*") or (myNickname ==nil)) then
-- they have not set up the system yet - we should warn them.
else
local toonIndex=0;
local fieldCount=0;
local thisID="";
local thisRecord={};
local myToonList=AKA_SavedVars["MyToons"];
local k,v;
 
AKA_SuperToonList=AKA_SavedVars["MyToons"];
if (myToonList == nil) then
-- something is wrong. we should have at least the current toon on file
AKA_ErrorMsg("No toons on file.");
 
else
-- AKA_ErrorMsg("Toon count = "..table.getn(myToonList));
-- if (table.getn(myToonList)>0) then -- make sure somethign is in the table before iterating
-- for toonIndex = 1, table.getn(myToonList) do
 
 
for k,v in pairs(myToonList) do
local outStr,fieldValue;
if ((v["faction"] == myPlayerFaction) and (v["realm"]==myPlayerRealm)) then
outStr="";
AKA_ErrorMsg(k..":"..v["name"]);
 
for fieldCount = 1, table.getn(messageFields) do
-- AKA_ErrorMsg(fieldCount.."->"..messageFields[fieldCount]);
fieldName=messageFields[fieldCount];
fieldValue=v[fieldName];
if (fieldName == "nickname") then
fieldValue=myNickname;
end
 
if (fieldName == "race") then
if (v["race_sex"] ~= nil) then
fieldValue=v["race_sex"];
end
end
 
if (fieldName == "profession1") then
if (v["prof1num"] ~= nil) then
fieldValue=v["prof1num"]..Dec2BASE64(v["prof1skill"]);
else
if (v["prof1name"] == nil) then
fieldValue="";
else
fieldValue=AKA_ProfessionIndex[v["prof1name"]]..Dec2BASE64(v["prof1skill"]);
end
end -- prof1num
end -- profession1
 
if (fieldName == "profession2") then
if (v["prof2num"] ~= nil) then
fieldValue=v["prof2num"]..Dec2BASE64(v["prof2skill"]);
else
if (v["prof2name"] == nil) then
fieldValue="";
else
fieldValue=AKA_ProfessionIndex[v["prof2name"]]..Dec2BASE64(v["prof2skill"]);
end
end -- prof2num
end -- profession2
 
if (fieldName == "userid") then
fieldValue=AKA_USERID;
end
 
if (fieldValue==nil) then
outStr=outStr..MSG_DELIMITER;
else
outStr=outStr.. fieldValue..MSG_DELIMITER;
end
 
end -- for fieldCount
AKA_SendMsg(outStr,destToon);
end -- faction & realm match
end -- pairs
 
 
 
-- end -- if >0 toons
end -- if (myToonList == nil)
end
AKA_SendVersion();
end
 
 
 
 
 
 
 
 
 
local function DrawScrollContents(topline)
-- Doesn't actually DRAW the contents?
-- Just returns a table items to be placed the buttons used for the Faux Scroller
-- Inputs: AKA_SavedVars["FriendToons"]
-- outputs:
-- AKA_BIGLIST -- linnear list of content lines for the scroller
-- AKA_BIGKEY -- list of toonIDs being displayed in the scroller, indexed by toonID
-- AKA_BIGIDS -- list of friend ID in {name}**{realm} format
 
local lineCount = 1;
local toonList = AKA_SavedVars["FriendToons"];
local toonKey={};
local toonAlts={};
local filtered;
local k,v;
if (topline == nil) then
topline=1;
end
-- step one: build a key of known toons:
 
 
 
AKA_BIGLIST={};
AKA_BIGKEY={};
AKA_BIGIDS={};
 
 
 
if (toonList == nil) then
-- AKA_PrefsNickList:SetText("No nicknames known.");=
else
local listText="";
-- table.foreach(toonList, function(k,v)
for k,v in pairs(toonList) do
-- if (v["userid"] ~= nil) then
-- DEFAULT_CHAT_FRAME:AddMessage( v["name"].." "..v["userid"].." "..v["realm"]);
-- else
-- DEFAULT_CHAT_FRAME:AddMessage( v["name"].." "..v["realm"]);
-- end
-- if ((v["realm"] == myPlayerRealm) and (v["faction"] == myFaction)) then -- displayable for this toon
if ((v["realm"] == myPlayerRealm) ) then
local thisToonID=v["userid"];
if (thisToonID ~= nil) then
if (lineCount>= topline) then
if (AKA_BIGKEY[thisToonID] == nil) then -- create an index:
local nick=v["nickname"];
if (nick == nil) then
nick="NO NICKNAME";
end
table.insert(AKA_BIGLIST,"|cFF8080FF"..nick.."|r: ");
AKA_BIGKEY[thisToonID]=table.getn(AKA_BIGLIST);
table.insert(AKA_BIGIDS,v["name"].."**"..v["realm"])
 
end
local thisToonName=v["name"];
if (thisToonName == nil) then
thisToonName="NO NAME";
end
-- if (UnitIsConnected(thisToonName)) then
-- thisToonName
-- else
local thisToonNameText=thisToonName;
if (AKA_LastSeen[thisToonID] ~= nil) then
if (AKA_LastSeen[thisToonID]["name"]==thisToonName) then
thisToonNameText="|cFFFFCC00["..thisToonNameText.."]|r";
end
end
local oStr=AKA_BIGLIST[AKA_BIGKEY[thisToonID]];
if (strsub(oStr,-1) ~= " ") then
oStr=oStr..", ";
end
AKA_BIGLIST[AKA_BIGKEY[thisToonID]]=oStr..thisToonNameText;
-- end
end -- toonID not nil
end -- within the display range? (topline)
end -- realm/action filter
lineCount = lineCount+1;
end -- pairs (toonList)
 
end -- toonlist == nil
 
-- at this point AKA_BIGLIST is a linear array of toons info strings
end
 
 
 
local function FixDefaults()
-- inputs:
-- AKA_SavedVars
-- ouputs:
-- AKA_SavedVars
 
if not (AKA_SavedVars) then
AKA_SavedVars = {};
AKA_SavedVars=AKA_Defaults;
AKA_SavedVars["Version"]=AKA_SavedVars;
AKA_SavedVars["FormatVersion"]=AKA_FormatVersion;
DEFAULT_CHAT_FRAME:AddMessage("AKA loading defaults.", 0.5, 1.0, 0.5, 3);
 
end
 
if (AKA_SavedVars["FormatVersion"] == nil) then
AKA_SavedVars["FormatVersion"]=AKA_FormatVersion;
end
 
if (AKA_SavedVars["FormatVersion"] < AKA_FormatVersion) then
-- convert from ealier format
-- 1st version so nothing to do here yet
 
DEFAULT_CHAT_FRAME:AddMessage("AKA version change. Updating data.", 0.5, 1.0, 0.5, 3);
 
if (AKA_SavedVars["FormatVersion"] < 1.01) then
DEFAULT_CHAT_FRAME:AddMessage("AKA database change from 1.0. Erasing old data. Sorry for the inconvenience.", 0.5, 1.0, 0.5, 3);
local tempNick=AKA_SavedVars["myNickName"]
AKA_SavedVars = {};
AKA_SavedVars=AKA_Defaults;
AKA_SavedVars["Version"]=AKA_Version;
AKA_SavedVars["myNickName"]=tempNick;
UpdateMyData();
end
AKA_SavedVars["FormatVersion"]=AKA_FormatVersion;
end
 
 
if ((AKA_SavedVars["FriendToons"] == nil) or (AKA_SavedVars["FriendToons"] == {})) then
local fToons={};
AKA_SavedVars["FriendToons"] =fToons;
end
 
if ((AKA_SavedVars["MyNickname"] == nil) or (AKA_SavedVars["MyNickname"] == "")) then
AKA_SavedVars["MyNickname"] =myPlayerName;
end
 
 
-- updateMyData must be last since it actually uses some of the above fields
if (AKA_SavedVars["MyToons"][myPlayerID] == nil) then
UpdateMyData();
end
 
if (AKA_SavedVars["MyToons"][myPlayerID]["guildnotes"] == nil) then
AKA_SavedVars["MyToons"][myPlayerID]["guildnotes"]=0;
end
 
 
if (AKA_SavedVars["MyToons"][myPlayerID]["com_channels"] == nil) then
DEFAULT_CHAT_FRAME:AddMessage("AKA Communications preferences set to defaults.", 0.5, 1.0, 0.5, 3);
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]=DEFAULT_COM_CHANNELS;
end
if (AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Raid"] == nil) then
DEFAULT_CHAT_FRAME:AddMessage("AKA Communications preferences set to defaults.", 0.5, 1.0, 0.5, 3);
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]=DEFAULT_COM_CHANNELS;
end
 
 
end
 
 
-- Guild Functions:
local function UpdateGuildNotes()
-- AKA_SavedVars["MyToons"][myPlayerID]["guildnotes"]=arg1; -- 0=no, 1=1st word, 2=(), 3=[]
local guildNoteExp="";
local guildNoteOption=AKA_SavedVars["MyToons"][myPlayerID]["guildnotes"];
if (guildNoteOption ==nil) then
guildNoteOption=0;
end
guildNoteExp=GUILD_NOTE_STRINGS[guildNoteOption];
guildieNames={};
guildiePlayers={};
if (guildNoteOption>0) then
local name, rank, rankIndex, level, class, zone, note, officernote, online, status;
local guildNick, matchcount;
local numGuildMembers = GetNumGuildMembers();
for i=1, numGuildMembers do
note = "";
officernote = "";
name, rank, rankIndex, level, class, zone, note, officernote, online, status = GetGuildRosterInfo(i);
 
guildNick, matchcount=string.gsub(note, guildNoteExp, "%1");
if (matchcount>0)then
-- DEFAULT_CHAT_FRAME:AddMessage(name..","..guildNick, 0.5, 1.0, 0.5, 3);
guildieNames[name]=guildNick;
end
end
end -- guildNoteOption>0
 
end
 
 
 
 
-- Tooltip (Chat):
-- ---------------
 
 
local function ShowWhoTooltip2()
 
 
 
end
local function ShowWhoTooltip()
local numWhos, totalCount = GetNumWhoResults(); -- numWhos is # of results returned (max 49). totalCount is matches on server
local name, guild, level, race, class, zone, group;
local foundAWho=false;
local outStr="";
local speakerRec=nil;
local linkedNickname=nil;
local altTable={};
local toonAlts={};
local fieldCount
 
if (numWhos > 0) then
for i=1, numWhos do
name, guild, level, race, class, zone, group = GetWhoInfo(i);
if (name == AKA_LinkedName) then
foundAWho=true;
break;
end
end
-- if (follow_mouse) then
-- GameTooltip:SetOwner(UIParent, "ANCHOR_CURSOR");
-- else
GameTooltip_SetDefaultAnchor(GameTooltip, UIParent);
-- end
 
-- at this point:
-- name, guild, et al = the info for the clicked-on player
 
local speakerID=name.."**"..myPlayerRealm;
 
if (AKA_SavedVars["FriendToons"] == nil) then -- repair FriendToons if necessary
AKA_FixDefaults();
end
if (AKA_SavedVars["FriendToons"][speakerID]) then -- if there is an entry for this person
speakerRec=AKA_SavedVars["FriendToons"][speakerID];
if ((speakerRec["nickname"] ~= "") and (speakerRec["nickname"] ~= nil)) then -- there is a nickname
linkedNickname=speakerRec["nickname"] ;
end -- there is a nickname
 
-- build a structure of alts
 
 
 
 
local toonList = AKA_SavedVars["FriendToons"];
local toonKey={};
 
if (toonList == nil) then
-- we are done
 
else
table.insert(toonAlts,"AKA:\"|c9090FFFF"..linkedNickname.."\"|r");
for k,v in pairs(toonList) do
if (((v["faction"] == myPlayerFaction) and (v["realm"]==myPlayerRealm)) or (v["faction"] == nil) or (v["realm"] == nil)) then
 
AKA_ErrorMsg(k..":"..v["name"]);
if (v["nickname"] == linkedNickname) then
local thisToonText = "";
for fieldCount = 1, table.getn(tooltipFields) do -- tooltipDelimiters
local fieldName=tooltipFields[fieldCount];
local fieldValue=v[fieldName];
if ((fieldValue ~= nil) and (fieldValue ~= "")) then -- if no value, skip
thisToonText=thisToonText.. fieldValue..tooltipDelimiters[fieldCount];
end
end -- for fieldCount
table.insert(toonAlts,thisToonText);
end -- nickname matches
end -- meets factio/realm criteria
end -- pairs (toonList)
 
end -- toonlist == nil
 
end -- there are alts to check
 
 
AKA_TAL=toonAlts; -- debugging
 
 
 
 
 
GameTooltip:AddLine(name, .6,1.0,.8); -- GameTooltip:AddLine(name, GameTooltip_UnitColor("player"));
if (guild == "") then
outStr=outStr.."Level "..level.." "..race.." "..class.." - "..zone;
 
else
outStr=outStr.."Level "..level.." "..race.." "..class.." <"..guild.."> - "..zone;
-- GameTooltip:AddLine("<"..guild..">", 1, .8, 0);
end
GameTooltip:AddLine(outStr, 1, 1, 1);
 
-- GameTooltip:AddLine(zone, 1, 1, 1);
-- WHO_LIST_FORMAT %s : Level %d %s %s - %s "Lonk: Level 21 Troll Hunter - Undercity"
-- WHO_LIST_GUILD_FORMAT %s : Level %d %s %s <%s> - %s "Rumplestump: Level 60 Gnome Rogue - Iron Forge"
 
if (table.getn(toonAlts))>0 then
for fieldCount = 1, table.getn(toonAlts) do
GameTooltip:AddLine(toonAlts[fieldCount], .8, .8, 1.8);
end -- for fieldCount
end
 
GameTooltip:Show();
-- GameTooltip:FadeOut();
end -- there was a /who response to show
 
end
 
 
function AKA_SetItemRef (link, text, button)
-- Get hooked into chat links
-- keeping it global on purpose....
 
AKA_LinkedName="";
if (strsub(link, 1, 6) == "player") then -- "player:{plaeryname}"
local name = strsub(link, 8);
if ( name and (strlen(name) > 0) ) then
if ( IsShiftKeyDown() ) then
AKA_LinkedName = name;
end
end
end
-- if (AKA_LinkedName=="") then
originalSetItemRef(link, text, button);
-- end
 
end
 
 
 
 
 
 
-- GLOBAL FUNCTIONS
-- __ _ _ _ _ ___ ___ _ __
-- /__ | / \ |_) /\ | |_ | | |\ | / | | / \ |\ | (_
-- \_| |_ \_/ |_) /--\ |_ | |_| | \| \_ | _|_ \_/ | \| __)
--
 
function AKA_ChatModder(this, event, ...)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11 = ...;
 
-- Hook AddMessage
-- if not this.AKA_AddMessage_Orig then
-- this.AKA_AddMessage_Orig = this.AddMessage;
-- this.AddMessage = AKA_AddMessage;
-- end
local killEvent=false;
AKA_LASTEVENT=event;
if ((event == "CHAT_MSG_CHANNEL") or (event == "CHAT_MSG_GUILD") or (event == "CHAT_MSG_RAID") or (event == "CHAT_MSG_PARTY")) then
if ((arg1 ~= nil) and (arg2 ~= nil))then
if (strsub(arg1, 1, 5) == CHANNEL_PREFIX) then
killEvent=true; -- toss it
else
if (strsub(arg1, 1, 4) ~= "<GEM") then -- test for non-chat stuff
arg1=GetNickname(arg2)..' '..arg1;
end -- not GEM
end -- toss <AKA messages
end -- event args not nil
end -- event
if (killEvent == true) then
-- don't pass it along the chain
else
originalChatFrame_OnEvent(this, event, ...);
end
end
 
 
 
 
function AKA_GathererModder(msg)
--[[
--"Received gather of %1 in %2 from %3 (%4)"
function Gatherer.Util.ChatPrint(str)
if ( DEFAULT_CHAT_FRAME ) then
DEFAULT_CHAT_FRAME:AddMessage(str, 1.0, 0.5, 0.25)
end
end
]]--
local pName=string.gsub(msg,".* from (.-) .*","%1");
local nickName=GetNickname(pName)
if (nickName ~= '') then
local repstring=' from '..pName..' '..nickName..' ';
local str=string.gsub(msg," from %a+ ",repstring);
if ( DEFAULT_CHAT_FRAME ) then
DEFAULT_CHAT_FRAME:AddMessage(str, 1.0, 0.5, 0.25)
end
end
end
 
 
 
-- TIMERS
-- ===================
function AKA_OnUpdate(elapsed)
secondsSinceLastMsg = secondsSinceLastMsg + elapsed;
secondsSinceUpdate = secondsSinceUpdate + elapsed;
secondsSinceLastScreenDraw = secondsSinceLastScreenDraw + elapsed;
if (secondsSinceUpdate > HEARTBEAT_INTERVAL) then -- time to do stuff!
 
 
-- local p=" ("..secondsSinceLastMsg..")";
-- if (tcount(pendingRequests)>0) then -- there are any elements in the pendingRequests array
-- DEFAULT_CHAT_FRAME:AddMessage("pending requests: "..tcount(pendingRequests), 1, .2, .2, 1);
-- p=p.." pendingRequests ";
-- end
-- if (pendingSingleAnnounce) then
-- p=p.." pendingSingleAnnounce ";
-- end
 
 
-- DEFAULT_CHAT_FRAME:AddMessage("pending requests: "..p, 1, .2, .2, 1);
-- local pendingRequests = false;
-- local secondsUntilMyRequest = 0;
local k,v;
for k,v in pairs(pendingRequests) do
-- DEFAULT_CHAT_FRAME:AddMessage("AKA_OnUpdate sending to: "..k, 1, .2, .2, 1);
if (v==true) then
if ((k=="GUILD") or (k=="PARTY") or (k=="RAID")) then
local chanType=k;
if ((k=="PARTY") and (UnitInRaid("player")==1)) then
chanType="RAID";
end
if (secondsSinceLastMsg>NOISE_THRESHHOLD) then
-- channel is clear
TransmitMyData(chanType);
-- pendingRequests{k}=false; -- no longer needede since we now wipe the queue whe we're done
end
else
-- whisper
if (secondsSinceLastMsg>NOISE_THRESHHOLD) then
-- channel is clear
TransmitMyData(k);
-- pendingRequests{k}=false; -- no longer needede since we now wipe the queue whe we're done
end
end -- whisper
end
 
 
 
end -- loop through pending requests
pendingRequests={}; -- assume all requests have been handled
 
-- if (secondsSinceLastMsg>NOISE_THRESHHOLD) then
-- -- channel is clear
-- TransmitMyData();
-- end
 
 
if (needHello) then
UpdateMyData();
AKA_RequestSync();
needHello=false;
end
 
if ((pendingSingleAnnounce==true) and (secondsSinceLastMsg>NOISE_THRESHHOLD)) then
AKA_TransmitOneToon(myPlayerID);
pendingSingleAnnounce=false;
end
 
 
 
-- test to see if we have hooked the chat window yet.
if (hasHookedChat == false) then
if (ChatFrame_OnEvent ~= AKA_ChatModder) then
originalChatFrame_OnEvent = ChatFrame_OnEvent; --hooked
ChatFrame_OnEvent=AKA_ChatModder;
end
hasHookedChat=true;
end
 
 
-- test to see if we have hooked the chat link yet.
if (hasHookedChatLink == false) then
if (SetItemRef ~= AKA_SetItemRef) then
originalSetItemRef = SetItemRef; --hooked
SetItemRef=AKA_SetItemRef;
end
hasHookedChatLink=true;
end
secondsSinceUpdate = 0;
 
 
 
-- test to see if we have hooked Gatherer yet.
if (hasHookedGatherer == false) then -- add preference check here eventually
if (Gatherer) then
-- check for older Gatherer:
if (Gatherer.Util ~= nil) then
if (Gatherer.Util.ChatPrint ~= AKA_GathererModder) then
 
originalGathererChat = Gatherer.Util.ChatPrint; --hooked
Gatherer.Util.ChatPrint=AKA_GathererModder;
end
end -- Gatherer.Util
end -- is Gatherer installed?
hasHookedGatherer=true;
end
 
 
 
 
 
 
-- check if we need to whisper anyone
-- AKA_SessionList[arg2]['status']='unknown';
local now = GetTime();
for k, v in pairs (AKA_SessionList) do
local thisStatus=v['status'];
if (thisStatus == 'na') then
-- short circuit out. maybe put in an hourly test eventually
elseif (thisStatus == 'unknown') then
-- send a whisper to this person
AKA_SendMsg(REQ_TOKEN,k);
AKA_SessionList[k]['status']='pending';
AKA_SessionList[k]['lastcontact']=GetTime(); -- mark when we sent the whisper
elseif (thisStatus == 'pending') then
-- check for the timeout
if (now-v['lastcontact']>45) then
AKA_SessionList[k]['status']='na';
end
end
 
-- AKA_ProfessionIndex[v] = k;
--[[AKA_SessionList[arg2]['status']='unknown'; -- 'unknown' when first seen, 'pending' if request has been sent, 'na' if request has timed out, 'available' if AKA request has been answered
AKA_SessionList[arg2]['lastcontact']=GetTime(); -- seconds
AKA_SessionList[arg2]['channelList']={};
AKA_SessionList[arg2]['bestchannel']='';
]]--
 
 
end -- loop through AKA_SessionList
 
 
 
 
 
 
 
 
end -- heartbeat
 
if (secondsSinceLastScreenDraw > 10.0) then
if ((AKA_ToonListDirty == true) and (getglobal("AKAUsersPanel"):IsVisible())) then
AKA_ScrollBar_Update(); -- redraw scoll list contents
end
end
 
end -- function
 
 
 
function AKA_TransmitOneToon(toonName)
 
local fieldCount=0;
local myNickname=AKA_SavedVars["MyNickname"];
local outStr="";
v=AKA_SavedVars["MyToons"][toonName]
 
 
AKA_ErrorMsg("AKA_TransmitOneToon("..toonName..") myNickname="..myNickname);
for fieldCount = 1, table.getn(messageFields) do
-- AKA_ErrorMsg(fieldCount.."->"..messageFields[fieldCount]);
fieldName=messageFields[fieldCount];
local fieldValue=v[fieldName];
if (fieldName == "nickname") then
fieldValue=myNickname;
end
if (fieldName == "race") then
if (v["race_sex"] ~= nil) then
fieldValue=v["race_sex"];
end
end
if (fieldName == "profession1") then
if (v["prof1num"] ~= nil) then
fieldValue=v["prof1num"]..Dec2BASE64(v["prof1skill"]);
else
if (v["prof1name"] == nil) then
fieldValue="";
else
fieldValue=AKA_ProfessionIndex[v["prof1name"]]..Dec2BASE64(v["prof1skill"]);
AKA_ErrorMsg("profession1->"..fieldValue);
end
end
end
if (fieldName == "profession2") then
if (v["prof2num"] ~= nil) then
fieldValue=v["prof2num"]..Dec2BASE64(v["prof2skill"]);
else
if (v["prof2name"] == nil) then
fieldValue="";
else
fieldValue=AKA_ProfessionIndex[v["prof2name"]]..Dec2BASE64(v["prof2skill"]);
AKA_ErrorMsg("profession2->"..fieldValue);
end
end
end
if (fieldName == "userid") then
fieldValue=AKA_USERID;
end
 
if (fieldValue==nil) then
outStr=outStr..MSG_DELIMITER;
else
outStr=outStr.. fieldValue..MSG_DELIMITER;
end
end -- for fieldCount
AKA_SendMsg(outStr);
AKA_SendVersion();
end
 
 
 
function AKA_EnterNewNickname()
local newNickname=getglobal("AKA_PrefsMyNickname"):GetText();
 
if (newNickname ~= "" and newNickname ~= nil) then
AKA_SavedVars["MyNickname"]=newNickname;
end
if (AKA_SavedVars["MyNickname"]=="") then
AKA_SavedVars["MyNickname"]=myPlayerName; -- use current name if no default
end
AKA_CurrentNickname:SetText("Current nickname: "..AKA_SavedVars["MyNickname"]);
UpdateMyData();
pendingSingleAnnounce=true;
end
 
 
 
 
 
 
 
 
function AKA_RequestSync()
 
AKA_SendMsg(REQ_TOKEN);
 
-- DEFAULT_CHAT_FRAME:AddMessage("AKA-REQUESTING SYNC:", 0.5, 1.0, 0.5, 3);
 
needHello=false; -- we wil be responding to a sync request anyway
 
end
 
 
function AKA_SendMsg(msg, targetPlayer)
-- send a message using the appropriate channel
local rChanNum,rChanName, r2, channelInfo;
channelInfo=AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]; -- make a shorter reference
if ((targetPlayer == nil) or (targetPlayer == "")) then
-- regular broadcasts:
 
if (channelInfo == nil) then
UpdateMyData();
channelInfo=AKA_SavedVars["MyToons"][myPlayerID]["com_channels"];
end
AKAg=channelInfo; -- make a global for testing dbc
 
-- guild traffic:
if (IsInGuild() and (channelInfo["Guild"]["active"] == "yes")) then -- only send on guild channel if in a guild
SendAddonMessage(MSG_PREFIX, MESSAGE_FORMAT..msg, "GUILD");
MessagesSentPerChannel["GUILD"]=MessagesSentPerChannel["GUILD"]+1;
if (AKA_TRAFFICMONITOR) then
DEFAULT_CHAT_FRAME:AddMessage("AKA_TX(Guild):"..MESSAGE_FORMAT..msg, 0.5, 1.0, 0.5, 3);
end
end
 
elseif ( targetPlayer == "GUILD") then
if (IsInGuild() and (channelInfo["Guild"]["active"] == "yes")) then -- only send on guild channel if in a guild
SendAddonMessage(MSG_PREFIX, MESSAGE_FORMAT..msg, "GUILD");
MessagesSentPerChannel["GUILD"]=MessagesSentPerChannel["GUILD"]+1;
if (AKA_TRAFFICMONITOR) then
DEFAULT_CHAT_FRAME:AddMessage("AKA_TX(Guild):"..MESSAGE_FORMAT..msg, 0.5, 1.0, 0.5, 3);
end
end
 
 
elseif (targetPlayer == "RAID") then
if ( (channelInfo["Raid"]["active"] == "yes")) then -- put in test for in-raid eventually
SendAddonMessage(MSG_PREFIX, MESSAGE_FORMAT..msg, "RAID");
MessagesSentPerChannel["RAID"]=MessagesSentPerChannel["RAID"]+1;
if (AKA_TRAFFICMONITOR) then
DEFAULT_CHAT_FRAME:AddMessage("AKA_TX(RAID):"..MESSAGE_FORMAT..msg, 0.5, 1.0, 0.5, 3);
end
end
 
elseif (targetPlayer == "PARTY") then
if ( (channelInfo["Raid"]["active"] == "yes")) then -- put in test for in-raid eventually
SendAddonMessage(MSG_PREFIX, MESSAGE_FORMAT..msg, "PARTY");
MessagesSentPerChannel["PARTY"]=MessagesSentPerChannel["PARTY"]+1;
if (AKA_TRAFFICMONITOR) then
DEFAULT_CHAT_FRAME:AddMessage("AKA_TX(PARTY):"..MESSAGE_FORMAT..msg, 0.5, 1.0, 0.5, 3);
end
end
 
else
 
--whispers:
if (AKA_TRAFFICMONITOR) then
DEFAULT_CHAT_FRAME:AddMessage("AKA_TX(WHISPER:"..targetPlayer.."):"..MESSAGE_FORMAT..msg, 0.5, 1.0, 0.5, 3);
end
SendAddonMessage(MSG_PREFIX, MESSAGE_FORMAT..msg, "WHISPER", targetPlayer);
MessagesSentPerChannel["WHISPER"]=MessagesSentPerChannel["WHISPER"]+1;
 
end
 
 
 
 
 
end
 
 
function AKA_ErrorMsg(msg)
-- send a message using the appropriate channel
if (AKA_DEBUG) then
DEFAULT_CHAT_FRAME:AddMessage("AKA-DEBUG:"..msg, 0.5, 1.0, 0.5, 3);
end
end
 
 
 
function AKA_TestVersionMsg(msg)
-- Input: is the regular string from the addon channel
-- Returns: true if this is a version test. false is some other sort of message
-- AKA_VersionNote will be the note for the version we don't have
if (strsub(msg, 1, 2) == "V:") then -- this is a version message
local toss, prefix,version,note = string.find(msg,"V:(.*)`(.*)");
local parsedVersion=tonumber(version)
if (parsedVersion>AKA_HighestSeenVersion) then
AKA_HighestSeenVersion=parsedVersion;
if (AKA_HighestSeenVersion>AKA_Version) then
DEFAULT_CHAT_FRAME:AddMessage(AKA_TEXT["VERSION_UPDATE"].."(old:"..AKA_Version.." new:"..parsedVersion..") "..note, 0.5, 1.0, 0.5, 3);
end
end
 
return true;
else
return false;
end
 
end
 
 
function AKA_SendVersion()
if (AKA_Version>AKA_HighestSeenVersion) then
AKA_HighestSeenVersion=AKA_Version;
AKA_SendMsg("V:"..AKA_Version.."`"..AKA_TEXT["VERSION_NOTES"]);
end
 
 
end
 
-- GUI Handlers:
-- =============================
 
 
-- Prefs:
-- ------
-- Handle clicks for Prefs
function AKAOptions_OnClick()
local id = this:GetID()
local buttonName=this:GetName()
-- message("LookoutOptions_OnClick: OnClick: " .. buttonName .. " ,ID: " .. id);
AKA_Defaults[buttonName] =getglobal(buttonName):GetChecked();
AKA_SavedVars[buttonName] =getglobal(buttonName):GetChecked();
end
 
 
 
function AKAOptions_SharingOnClick()
if (getglobal("AKA_PrefsShareGuild"):GetChecked()) then
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Guild"]["active"] = "yes"
else
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Guild"]["active"] = "no"
end
 
if (getglobal("AKA_PrefsShareRaid"):GetChecked()) then
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Raid"]["active"] = "yes"
else
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Raid"]["active"] = "no"
end
 
 
if (getglobal("AKA_PrefsShareChat"):GetChecked()) then
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Chat"]["active"] = "yes"
else
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Chat"]["active"] = "no"
end
 
 
end
 
function AKAOptions_RadioClick(butNum)
AKA_SavedVars["MyToons"][myPlayerID]["guildnotes"]=butNum+0; -- 0=no, 1=1st word, 2=(), 3=[]
 
UpdateGuildNotes();
UpdateRadios();
 
end
 
 
 
 
 
 
function AKA_StringClick(passedFrame)
local level,race,class,guild,zone;
 
local x,y = GetCursorPosition();
local s = passedFrame:GetEffectiveScale();
x, y = x/s, y/s;
local top = passedFrame:GetTop();
local frameY=top-y;
-- f:
-- -90+(-16*i)
local yBar=(frameY-(90-22))/16;
local yAsText=tonumber(floor(yBar));
local topOffset=FauxScrollFrame_GetOffset(AKA_FrameScrollBar);
 
local thisToonID=AKA_BIGIDS[floor(yBar-topOffset)];
-- DEFAULT_CHAT_FRAME:AddMessage("Click!".." yAsText="..yAsText.." yOff="..yBar .. " top="..top , 0.5, 1.0, 0.5, 3);
-- DEFAULT_CHAT_FRAME:AddMessage(thisToonID , 0.5, 1.0, 0.5, 3);
-- tonumber()
-- math.floor
 
 
 
if (thisToonID ~= nil) then
if (AKA_SavedVars["FriendToons"] == nil) then -- repair FriendToons if necessary
AKA_FixDefaults();
end
if (AKA_SavedVars["FriendToons"][thisToonID]) then -- if there is an entry for this person
speakerRec=AKA_SavedVars["FriendToons"][thisToonID];
if ((speakerRec["nickname"] ~= "") and (speakerRec["nickname"] ~= nil)) then -- there is a nickname
linkedNickname=speakerRec["nickname"] ;
end -- there is a nickname
 
-- build a structure of alts
local toonList = AKA_SavedVars["FriendToons"];
 
if (toonList == nil) then
-- we are done
outStr=("No player selected");
else
 
outStr="AKA:\"|c9090FFFF"..linkedNickname.."\"|r\n";
-- table.foreach(toonList,function(k,v)
for k,v in pairs(toonList) do
if (((v["faction"] == myPlayerFaction) and (v["realm"]==myPlayerRealm)) or (v["faction"] == nil) or (v["realm"] == nil)) then
 
AKA_ErrorMsg(k..":"..v["name"]);
if (v["nickname"] == linkedNickname) then
local thisToonText = "";
for fieldCount = 1, table.getn(tooltipFields) do -- tooltipDelimiters
local fieldName=tooltipFields[fieldCount];
local fieldValue=v[fieldName];
if ((fieldValue ~= nil) and (fieldValue ~= "")) then -- if no value, skip
thisToonText=thisToonText.. fieldValue..tooltipDelimiters[fieldCount];
end
end -- for fieldCount
outStr=outStr..thisToonText.."\n";
end -- nickname matches
end -- meets factio/realm criteria
end -- pairs
 
end -- toonlist == nil
 
end -- there are alts to check
 
 
getglobal("AKA_DispPlayerNotes"):SetText(outStr);
 
 
end
 
end -- function
 
 
 
 
-- OnShow for prefs
function AKA_PrefsFrameOnShow()
-- read settings from profile, and change our checkbuttons and slider to represent them
local currentOptions = getglobal(this:GetName().."Options");
PlaySound("igCharacterInfoOpen");
if (not currentOptions) then
currentOptions=LookoutDefaults;
end
UpdateRadios();
-- draw the current settings:
 
if (AKA_SavedVars["AKA_PrefsShowMe"] == true) then
getglobal("AKA_PrefsShowMe"):SetChecked(true)
else
getglobal("AKA_PrefsShowMe"):SetChecked(false)
end
 
if (AKA_SavedVars["MyNickname"] ~= nil) then
AKA_CurrentNickname:SetText("Current nickname: "..AKA_SavedVars["MyNickname"]);
end
 
 
 
-- prefill nickname
local textValue=AKA_SavedVars["MyNickname"];
if (textValue == nil) then
textValue=""
end
getglobal("AKA_PrefsMyNickname"):SetText(textValue);
 
-- draw sharing preferences:
-- guild:
if (AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Guild"]["active"] == "yes") then
getglobal("AKA_PrefsShareGuild"):SetChecked(true)
else
getglobal("AKA_PrefsShareGuild"):SetChecked(false)
end
 
 
 
if ((AKAPrefs_CurrentPanel == nil) or (AKAPrefs_CurrentPanel == 0)) then
AKAPrefs_CurrentPanel=-1;
AKA_HidePanel(2);
-- PanelTemplates_Tab_OnClick(1);
AKA_ShowPanel(1); -- default to panel 1
end
end
 
 
 
 
 
function AKA_ShowPanel(whichPanel)
 
if (AKAPrefs_CurrentPanel > 0) then
AKA_HidePanel(AKAPrefs_CurrentPanel);
end
getglobal(AKAPrefs_PanelFrames[whichPanel]):Show();
AKAPrefs_CurrentPanel=whichPanel;
 
end
 
 
function AKA_HidePanel(whichPanel)
getglobal(AKAPrefs_PanelFrames[whichPanel]):Hide();
AKAPrefs_CurrentPanel = 0;
 
end
 
 
 
 
 
 
function AKA_ScrollBar_Update()
 
DrawScrollContents(FauxScrollFrame_GetOffset(AKA_FrameScrollBar));
-- local scrollTestData = {};
-- for i=1,50 do
-- scrollTestData[i] = "Test "..math.random(100);
-- end
local totalLines=table.getn(AKA_BIGLIST);
 
-- FauxScrollFrame_Update(AKA_FrameScrollBar,VISIBLE_MAX,5,16); -- function, max entries, # visible, pixel height of one
FauxScrollFrame_Update(AKA_FrameScrollBar,totalLines,VISIBLE_MAX,16);
-- DEFAULT_CHAT_FRAME:AddMessage("We're at "..FauxScrollFrame_GetOffset(AKA_FrameScrollBar));
 
if (AKA_ScrollItem1 == nil) then
AKA_CreateScrollItems();
end
 
local lineCounter, dataLine, buttonName;
local listText=""; -- temporary simple list version
DEFAULT_CHAT_FRAME:AddMessage("top="..FauxScrollFrame_GetOffset(AKA_FrameScrollBar));
 
for lineCounter=1,VISIBLE_MAX do
dataLine= lineCounter + FauxScrollFrame_GetOffset(AKA_FrameScrollBar);
buttonName="AKA_Entry"..lineCounter;
-- getglobal(buttonName):ClearAllPoints()
-- getglobal(buttonName):SetPoint("TOPLEFT",AKA_FrameScrollBar, "TOPLEFT", 8,-16*lineCounter); -- set the position
if (dataLine <= table.getn(AKA_BIGLIST)) then
-- DEFAULT_CHAT_FRAME:AddMessage("lineCounter="..lineCounter.." dataLine="..dataLine.." "..AKA_BIGLIST[dataLine]);
 
-- listText=listText.."|n"..AKA_BIGLIST[dataLine];
getglobal("AKA_Entry"..lineCounter.."_col1"):SetText(AKA_BIGLIST[dataLine]);
getglobal("AKA_Entry"..lineCounter.."_col1"):Show();
else
getglobal("AKA_Entry"..lineCounter.."_col1"):Hide();
end
end -- for
AKA_ToonListDirty=false;
 
end
 
 
function AKA_CreateScrollItems()
 
-- Frame:CreateFontString(["name"] [,"layer"]) -- Create a new FontString object as a child of a frame.
-- local f = CreateFrame("Frame",nil,AKA_PrefsFrame)
-- local frame=getglobal("AKA_PrefsFrame");
local frame=getglobal("UIParent");
local prototype=getglobal("AKAUserLineProto");
-- local deFont1,deFont2,deFont3,deFont4=GameFontNormal:GetFont();
local i, f, entryName;
for i = 1, VISIBLE_MAX do
entryName="AKA_Entry"..i.."_col1";
-- DEFAULT_CHAT_FRAME:AddMessage(entryName);
 
f = CreateFrame("Button", entryName, getglobal("AKAUsersPanel"), prototype);
-- CreateFrame("frameType", "frameName", parentFrame[, "inheritsFrame"]);
 
f:SetID(i);
-- f:SetFont(deFont1,deFont2,deFont3,deFont4);
-- f:SetTextColor(.8,.8,.8);
f:ClearAllPoints();
f:SetPoint("TOPLEFT", "AKA_PrefsTitle", "TOPLEFT", 0, -90+(-16*i));
f:SetText("Test #"..i);
end
 
end
 
 
 
 
 
 
-- text changed on prefs panel:
function AKA_PrefsTextChanged()
-- eventually only show change button if something changes
end
 
 
 
function AKA_EnterNewChannelName(whichChannel)
-- attempt to leave the old channel is available
-- save the data, but don't try to join right away - leave that for the transmit fuction
local oldChanName = AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Chan"..whichChannel]["name"];
if (oldChanName == nil) or (oldChanName == "") then
-- no old channel to leave
else
LeaveChannelByName(oldChanName);
DEFAULT_CHAT_FRAME:AddMessage("Leaving Channel:"..oldChanName, 1, .2, .2, 1);
end
 
 
local chanName=getglobal("AKA_PrefsChannel"..whichChannel.."Name"):GetText();
local chanPW=getglobal("AKA_PrefsChannel"..whichChannel.."PW"):GetText();
 
if (AKA_SavedVars["MyToons"][myPlayerID]["com_channels"] == nil) then
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]=DEFAULT_COM_CHANNELS;
end
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Chan"..whichChannel]["name"]=chanName;
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]["Chan"..whichChannel]["pw"]=chanPW;
ALA_DrawChannelPrefsValues(whichChannel); -- update the name in the head if needed
pendingSingleAnnounce=true; -- announce our presence in the channel
AKA_RequestSync(); -- ask users in the new channels for information
 
end
 
 
 
 
 
 
 
 
 
 
 
-- CheckButton:GetChecked() - Get the status of the checkbox.
-- CheckButton:SetChecked([state]) - Set the status of the checkbox.
-- CheckButton:SetCheckedTexture("texture") - Set the texture to use for a checked box.
-- CheckButton:SetDisabledCheckedTexture("texture") - Set the texture to use for an unchecked box.
 
 
 
 
 
 
 
-- math lib:
 
function AKA_TestBase()
local orig=0;
local t64=Dec2BASE64(orig);
local res=BASE642Dec(t64);
 
DEFAULT_CHAT_FRAME:AddMessage("orig:"..orig, 0.5, 1.0, 0.5, 3);
DEFAULT_CHAT_FRAME:AddMessage("b64 :"..t64, 0.5, 1.0, 0.5, 3);
DEFAULT_CHAT_FRAME:AddMessage("dec :"..res, 0.5, 1.0, 0.5, 3);
local orig=math.random(1,1000);
local t64=Dec2BASE64(orig);
local res=BASE642Dec(t64);
 
DEFAULT_CHAT_FRAME:AddMessage("orig:"..orig, 0.5, 1.0, 0.5, 3);
DEFAULT_CHAT_FRAME:AddMessage("b64 :"..t64, 0.5, 1.0, 0.5, 3);
DEFAULT_CHAT_FRAME:AddMessage("dec :"..res, 0.5, 1.0, 0.5, 3);
 
 
 
end
 
-- Event functions
-- Onload:
function AKA_OnLoad()
-- this:RegisterEvent("ADDON_LOADED");
 
-- Register the slash command
-- --------------------------
SLASH_AKA1 = "/aka";
SlashCmdList["AKA"] = AKA_ParseCommandLine; -- trying this global - didn't kick in with local
InitMath();
 
 
-- Register the event handlers:
-- =============================
-- this:RegisterEvent("VARIABLES_LOADED"); -- eventually will call OnEvent
this:RegisterEvent("CHAT_MSG");
 
this:RegisterEvent("CHAT_MSG_ADDON");
this:RegisterEvent("CHAT_MSG_SYSTEM"); -- for the /who
 
 
-- raid command stuff:
-- this:RegisterEvent("CHAT_MSG_RAID");
-- this:RegisterEvent("CHAT_MSG_PARTY");
 
-- Party/Roster stuff:
this:RegisterEvent("RAID_ROSTER_UPDATE");
this:RegisterEvent("CHAT_MSG_CHANNEL"); -- will update with alias names, will watch for potential peers
this:RegisterEvent("CHAT_MSG_GUILD"); -- will update with alias names
this:RegisterEvent("CHAT_MSG_RAID"); -- will update with alias names
this:RegisterEvent("CHAT_MSG_PARTY"); -- will update with alias names
this:RegisterEvent("VARIABLES_LOADED");
this:RegisterEvent("PLAYER_ENTERING_WORLD"); -- will start a timer for initial syncs
this:RegisterEvent("MINIMAP_ZONE_CHANGED"); -- Update our last known location
 
this:RegisterEvent("CHAT_MSG_CHANNEL_JOIN"); -- watch for potential peers joining the channel
this:RegisterEvent("GUILD_ROSTER_UPDATE"); -- watch for potential peers joining the channel
 
 
if (not myPlayerName) then
myPlayerName = UnitName("player");
end
 
 
DEFAULT_CHAT_FRAME:AddMessage(AKA_TITLE.." loaded. Type /aka to change settings.", 0.5, 1.0, 0.5, 1);
tinsert(UISpecialFrames,'AKA_PrefsFrame');
 
end -- OnLoad
 
 
 
 
 
 
function AKA_Event(self, event, ...)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11 = ...;
if (event==nil) then
 
 
-- DEFAULT_CHAT_FRAME:AddMessage("AKA: event="..event .. " arg1="..arg1.." arg2="..arg2, 0.5, 1.0, 0.5, 1);
end
 
local eventHandled = false;
local msgText = "";
-- oh to have a case statement!
 
-- debug
if (AKA_ShowEvent) then
DEFAULT_CHAT_FRAME:AddMessage("AKA: event "..event, 0.5, 1.0, 0.5, 1);
end
 
 
 
if (event == "GUILD_ROSTER_UPDATE") then
-- if (arg1 ~= nil) then
UpdateGuildNotes();
eventHandled = true;
-- end
end
 
 
-- VARIABLES_LOADED
-- ================
 
if ( event == "VARIABLES_LOADED" ) then
 
-- Reseed the random # generator
math.randomseed(math.random(0,2147483647)+(GetTime()*1000));
if (not AKA_USERID) then
AKA_USERID=GenerateUSERID();
-- this will be expanded into a larger version to handle
-- people playing on multiple machines.
-- we will implment a "who am I?" function to try to determine if there is an existing ID.
end
-- DEFAULT_CHAT_FRAME:AddMessage("AKA: realm="..myPlayerRealm.. "("..AKA_USERID..") today="..TODAY, 0.5, 1.0, 0.5, 1);
 
 
FixDefaults();
 
-- Delete old entries:
for k,v in pairs(AKA_SavedVars["FriendToons"]) do
if ((TODAY-v["lastupdate"])>100) then
-- table.remove(AKA_SavedVars["FriendToons"],k);
AKA_SavedVars["FriendToons"][k]=nil;
end
end
 
 
-- record that we have been loaded
AKA_variablesLoaded = true;
eventHandled = true;
 
 
end -- ( event == "VARIABLES_LOADED" )
 
 
 
 
-- Raid update event
-- ===========================
if (eventHandled == false) then
if ((event == "RAID_ROSTER_UPDATE") or (event == "PARTY_MEMBERS_CHANGED")) then
-- Lookout_UpdateRaidtable();
eventHandled = true;
end
 
end
if (eventHandled == false) then
if ((event == "ZONE_CHANGED") or (event == "MINIMAP_ZONE_CHANGED") ) then
if (myPlayerZone ~= GetRealZoneText()) then -- GetMinimapZoneText() had too much detail
myPlayerZone=GetRealZoneText();
UpdateMyData();
pendingSingleAnnounce=true;
end
eventHandled = true;
end
end
 
 
if (eventHandled == false) then
if (event == "CHAT_MSG_ADDON") then
-- process incoming messages
-- AKA2 supports WHISPER, PARTY and RAID messages as well
--[[
Fired when the client receives a message from SendAddonMessage
 
arg1
prefix
arg2
message
arg3
distribution type ("PARTY", "RAID", "GUILD", "BATTLEGROUND" or "WHISPER")
arg4
sender
]]--
 
 
 
if (arg1 == MSG_PREFIX) then
--if (arg3 == "GUILD") then -- Only use ADDON channel for guild
local chanInfo = AKA_SavedVars["MyToons"][myPlayerID]["com_channels"]; -- create a shorter reference
if ((arg3=="GUILD") and (chanInfo["Guild"]["active"] =="yes"))
or ((arg3=="RAID") and (chanInfo["Raid"]["active"] =="yes"))
or ((arg3=="PARTY") and (chanInfo["Raid"]["active"] =="yes"))
or (arg3=="WHISPER")
then
if (arg2 ~= nil) then
secondsSinceLastMsg=0; -- reset the message timer
if (AKA_TRAFFICMONITOR) then
DEFAULT_CHAT_FRAME:AddMessage("AKA_RX:("..arg3.."):"..arg2, 0.5, 1.0, 0.5, 1);
end
 
 
local msgText=strsub(arg2,2); -- strip off version byte
-- char 1 is the version which we can test later...
if (msgText== REQ_TOKEN)then
-- DEFAULT_CHAT_FRAME:AddMessage("AKA token recieved:("..msgText.."):"..arg2, 1.0, .6, 0.6, 1);
-- determined we're getting at least this far...
if( arg3=="WHISPER") then
pendingRequests[arg4]=true;
else -- GUILD, PARTY, RAID
pendingRequests[arg3]=true;
end
-- pendingRequests is an associative array of player names who have requested data.
-- It will also contain the names of channels in which requests have arrived.
-- i.e. PARTY, RAID, or GUILD
else
if (AKA_TestVersionMsg(msgText)) then
-- version test packet
else
ParseMessage(msgText,arg4, arg3); -- this is a data packet
-- arg2 = message text, arg4=sender name
end
end -- REQ_TOKEN
end
end -- checks for preferences
 
 
 
end
-- Lookout_UpdateRaidtable();
 
 
-- Fired when the client receives a message from SendAddonMessage
--
-- arg1 prefix
-- arg2 message
-- arg3 distribution type ("PARTY","RAID","GUILD" or "BATTLEGROUND")
-- arg4 sender
 
 
eventHandled = true;
end
 
end
 
 
 
 
 
 
 
 
 
 
 
-- Raid chat events (incoming)
-- ===========================
if (event == "CHAT_MSG_RAID" or event == "CHAT_MSG_PARTY" or event =="CHAT_MSG_CHANNEL") then
-- arg1 = messsage text
-- arg2 = message sender
local sendingMember = nil;
local inStr;
local msgStr;
local cmdStr;
local toss;
local toss2;
-- General, Trade, and LocalDefense
 
-- end -- (string.find( arg1, "::")
-- put in logic here to determine which channels to monitor:
-- record everyone we've seen speak:
if (AKA_SessionList[arg2]) then
-- we've seen this person before
else
-- add this speaker to our list and check if they are running AKA
AKA_SessionList[arg2]={};
AKA_SessionList[arg2]['status']='unknown'; -- 'unknown' when first seen, 'pending' if request has been sent, 'na' if request has timed out, 'available' if AKA request has been answered
AKA_SessionList[arg2]['lastcontact']=GetTime(); -- seconds
AKA_SessionList[arg2]['channelList']={};
AKA_SessionList[arg2]['bestchannel']='';
end
end -- event=CHAT_MSG_RAID et. al.
-- channel monitor end
 
 
 
 
if (eventHandled == false) then
if (event == "CHAT_MSG_SYSTEM") then -- looking for the "who" event set earlier by the linky
if ((AKA_LinkedName~="") and (AKA_LinkedName~=nil)) then
ShowWhoTooltip();
AKA_LinkedName=""; -- tip has been shown. move along
eventHandled = true;
end
end -- CHAT_MSG_SYSTEM
end -- eventHandled
 
 
 
 
 
 
if (eventHandled == false) then
-- msgText = string.lower(arg1);
end
 
 
end -- end of function
 
 
 
-- command line parameters: (slash command handler)
function AKA_ParseCommandLine(msg)
cmd=string.lower(msg);
 
if ( ( msg=="1") or (msg=="")) then
AKA_PrefsFrame:Show();
end
 
 
 
 
if ( cmd =="t") then
AKA_TestBase();
end
 
if ( cmd =="help") then
DEFAULT_CHAT_FRAME:AddMessage("/aka reset - restore default values", 0.5, 1.0, 0.5, 1);
DEFAULT_CHAT_FRAME:AddMessage("/aka debug - toggle display of debug messages", 0.5, 1.0, 0.5, 1);
DEFAULT_CHAT_FRAME:AddMessage("/aka messages - toggle display of netowork traffic", 0.5, 1.0, 0.5, 1);
DEFAULT_CHAT_FRAME:AddMessage("/aka updateme - send your data to other AKA clients", 0.5, 1.0, 0.5, 1);
 
end
 
if ( cmd =="reset") then
DEFAULT_CHAT_FRAME:AddMessage("Setting AKA variables to default values.", 0.5, 1.0, 0.5, 1);
 
AKA_SavedVars = {};
AKA_SavedVars=AKA_Defaults;
AKA_SavedVars["Version"]=AKA_Version;
UpdateMyData();
-- LookoutAlertHandler(" Variables reset ");
end
 
if ( cmd =="messages") then
AKA_TRAFFICMONITOR= not AKA_TRAFFICMONITOR;
if (AKA_TRAFFICMONITOR) then
DEFAULT_CHAT_FRAME:AddMessage("AKA now diplaying communications traffic", 0.5, 1.0, 0.5, 1);
else
DEFAULT_CHAT_FRAME:AddMessage("AKA message display off", 0.5, 1.0, 0.5, 1);
end
 
 
 
end
 
if ( cmd =="debug") then
AKA_DEBUG = not AKA_DEBUG;
if (AKA_DEBUG) then
DEFAULT_CHAT_FRAME:AddMessage("AKA Debug messages enabled.", 0.5, 1.0, 0.5, 1);
else
DEFAULT_CHAT_FRAME:AddMessage("AKA Debug messages off.", 0.5, 1.0, 0.5, 1);
end
 
end
if ( cmd =="updateme") then
DEFAULT_CHAT_FRAME:AddMessage("Sending update to other AKA clients.", 0.5, 1.0, 0.5, 1);
 
UpdateMyData();
pendingSingleAnnounce=true;
end
 
 
if ( cmd =="sync") then
DEFAULT_CHAT_FRAME:AddMessage("Request sync from other AKA clients.", 0.5, 1.0, 0.5, 1);
 
AKA_RequestSync();
--pendingSingleAnnounce=true;
end
 
if ( cmd =="spells") then
DEFAULT_CHAT_FRAME:AddMessage("Displaying Spellbook...", 0.5, 1.0, 0.5, 1);
 
ShowSpells();
pendingSingleAnnounce=true;
end
 
 
if( string.sub(cmd,1,5)=="name ") then
AKA_LookupName(string.sub(msg,6));
pendingSingleAnnounce=true;
end
end
 
function AKA_LookupName(whatname)
local str="";
DEFAULT_CHAT_FRAME:AddMessage(GetNickname(whatname));
 
end
Property changes : Added: svn:executable + *
trunk/aka.toc New file
0,0 → 1,10
## Interface: 30000
## Title: AKA
## Notes: Publishes player alts to guild members
## Version: 2.2
## Author: Schnoggo
## OptionalDeps: CleanChat,Gatherer,GuildEventManager2
## SavedVariables: AKA_SavedVars, AKA_USERID, AKA_DEBUG, AKA_TRAFFICMONITOR
localization.lua
aka.lua
aka.xml
Property changes : Added: svn:executable + *
trunk/devnotes.txt New file
0,0 → 1,29
To Do:
Change character menu to faux scroller
Test integration with WotLK versions of other addons
Show nicknames in Guild tab of Social panel
 
Limit visible info to this realm
support guild info panels
add (!) tab and display
Show AKA notes in guild notes
show guild notes in AKA tooltip if available
 
Make player ID visible so multi-boxers can sync
 
 
* Remove ALL debugging tracers :)
* Make load-on-demand
* Make /aka {toonName} command line
* Add command line options to turn on/off
* Add Actual Help. :)
* Localizations
* Need to double-check default channel options
* Convert Tooltip and PLAYERS to group players by ID, not Nickname. (Current version is backwards compatible, so I'm waiting for a forced upgrade)
* Compress faction information
* Add player notes
* Make a "map button"
* Warn about too many channels
* Automatically update the player ID if you log in from more than one computer
* Option to show only online players
*
Property changes : Added: svn:executable + *
trunk/localization.lua New file
0,0 → 1,78
AKA_TITLE="A.K.A. Version 2.11";
 
 
AKA_TEXT = {};
AKA_TEXT["WELCOME"]="A.K.A. Loaded. Type /aka to change settings.";
AKA_TEXT["PREF_HELP"]="A.K.A. publishes your alt names to other guild members running the addon.\n\n Current version can be found at |c00FF80FF http://ui.worldofwar.net/ui.php?id=3747|r";
AKA_TEXT["CHANNEL_HEAD_GUILD"]="Currently using guild channel.";
AKA_TEXT["CHANNEL_HEAD_OTHER"]="Currently using channel";
AKA_TEXT["CHANNEL_BLOCK"]="Channel ";
AKA_TEXT["VERSION_UPDATE"]="A new version of AKA is available. http://www.wowinterface.com/downloads/info7813-AKA.html";
AKA_TEXT["VERSION_NOTES"]="This is a recommended upgrade. Fixed a number of synchronization bugs.";
 
AKA_ProfessionList={};
AKA_ProfessionList["1"]="Alchemy";
AKA_ProfessionList["2"]="Blacksmithing";
AKA_ProfessionList["3"]="Enchanting";
AKA_ProfessionList["4"]="Engineering";
AKA_ProfessionList["5"]="Herbalism";
AKA_ProfessionList["6"]="Jewelcrafting";
AKA_ProfessionList["7"]="Leatherworking";
AKA_ProfessionList["8"]="Mining";
AKA_ProfessionList["9"]="Skinning";
AKA_ProfessionList["A"]="Tailoring";
AKA_ProfessionList["B"]="UNDEFINED";
AKA_ProfessionList["C"]="UNDEFINED";
AKA_ProfessionList["D"]="UNDEFINED";
AKA_ProfessionList["E"]="UNDEFINED";
AKA_ProfessionList["F"]="UNDEFINED";
 
AKA_ProfessionList["G"]="Elemental Leatherworking";
AKA_ProfessionList["H"]="Tribal Leatherworking";
AKA_ProfessionList["I"]="Dragonscale Leatherworking";
AKA_ProfessionList["J"]="Gnomish Engineer";
AKA_ProfessionList["K"]="Goblin Engineer";
AKA_ProfessionList["L"]="Armorsmith";
AKA_ProfessionList["M"]="Weaponsmith";
AKA_ProfessionList["N"]="Master Swordsmith";
AKA_ProfessionList["O"]="Master Hammersmith";
AKA_ProfessionList["P"]="Master Axesmith";
 
 
AKA_ProfSpecialMap={};
-- specializations: [1]=principal profession, [2]= sub-level (3 is more specialized than 2)
AKA_ProfSpecialMap["G"]={"7",2}; -- Leatherworking
AKA_ProfSpecialMap["H"]={"7",2}; -- Leatherworking
AKA_ProfSpecialMap["I"]={"7",2}; -- Leatherworking
AKA_ProfSpecialMap["J"]={"4",2}; -- Engineering
AKA_ProfSpecialMap["K"]={"4",2}; -- Engineering
AKA_ProfSpecialMap["L"]={"2",2}; -- Blacksmithing
AKA_ProfSpecialMap["M"]={"2",2}; -- Blacksmithing
AKA_ProfSpecialMap["N"]={"2",3}; -- Blacksmithing
AKA_ProfSpecialMap["O"]={"2",3}; -- Blacksmithing
AKA_ProfSpecialMap["P"]={"2",3}; -- Blacksmithing
 
 
AKA_RaceList={};
AKA_RaceList["1"]="Human";
AKA_RaceList["2"]="Dwarf";
AKA_RaceList["3"]="Night Elf";
AKA_RaceList["4"]="Gnome";
AKA_RaceList["5"]="Draenei";
AKA_RaceList["6"]="al1";
AKA_RaceList["7"]="al2";
AKA_RaceList["8"]="al3";
AKA_RaceList["9"]="Orc";
AKA_RaceList["A"]="Troll";
AKA_RaceList["B"]="Tauren";
AKA_RaceList["C"]="Undead";
AKA_RaceList["D"]="Blood Elf";
AKA_RaceList["E"]="ho1";
AKA_RaceList["F"]="ho2";
AKA_RaceList["G"]="ho3";
 
AKA_GenderList={};
table.insert(AKA_GenderList,"Unknown");
table.insert(AKA_GenderList,"Male");
table.insert(AKA_GenderList,"Female");
 
Property changes : Added: svn:executable + *
trunk/Readme.txt New file
0,0 → 1,188
AKA v2.1
 
Description
===========
 
AKA is a World of Warcraft AddOn.
It allows players to specify a nickname that will be seen in chat by other users of the addon regardless of which character the player is currently logged in as.
It tracks the multiple characters in a given account and provides mechanisms
for sharing character information with other players running the addon.
 
Because the nickname is added to the chat by the addon, and not actually sent in chat, it will not conflict with addons which watch chat such a DKP or Suicide Kings mods.
 
Character data is transmitted using the "addon" guild channel if you are just using it for your guild.
You can turn on additional channels if you want to share information across guilds. This feature is still somewhat experimental.
Some guilds use player notes for nicknames or player names. This is also supported in AKA2: See the Configuration section below.
 
Installation
============
 
Extract the files into your World of Warcraft Interfaces/AddOns directory.
In WoW, type /aka and set your nickname. That's all you have to do!
 
Configuration
=============
Type /aka in WoW.
The Options tab will display available configuration options
 
 
Features
========
* Compatibility with World of Warcraft v2.4x
* Skill information is recorded (and optionally shared) as well as race, level, class and name.
* Show nicknames in Gatherer player updates
 
Use
===
"/aka" to bring up options.
"/aka help" will show command line options
 
 
 
 
License
=======
This work is licensed under the Creative Commons Attribution-Noncommercial 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
 
The author of this work is Lon Koenig, who reserves all commercial rights.
Contact information is at the end of this document.
 
 
 
 
 
 
Known Issues
============
* Guild checkboxes should be ON by default for toons in guilds
* Hasn't been tested with more than 17 friends
* May have to manually leave a chat channel if you changed while logged in on a different toon.
* Player ID needs to be manually set (copy the WTF folder) if you log in from more than one computer.
 
 
 
 
 
 
 
 
 
Version History
========
 
July 26, 2008 (version 2.11)
* Looks like wrong file uploaded to the Addon sites - this release is to ensure the correct files are being distributed.
* Changed the URL in the update message.
 
July 22, 2008 (version 2.1)
* Updated TOC for patch 2.4
* Fixed critical bugs with data synchronization
* Added license information
* Changed the "home" web site
* Removed the To-Do list from this document
 
 
Nov 13, 2007
* Upated TOC for patch 2.3. No other changes.
 
Oct 29, 2007
* Bug was discovered in housekeeping routines that delete users that haven't been seen in over 100 days. Hopefully fixed.
* Also disabled some debug code that would display guild roster updates if you were using the guild notes options.
 
Sep 25, 2007
* Updated TOC for patch 2.2.
* Made the beta versions the live version
* Updated message format version to force updates
 
Aug 4, 2007
* Added Preference options for the new sharing model.
* Added Preference options for guild note support.
* Finally implemented deleting of obsolete toon info!
 
 
Aug 3, 2007
* Removed the channel options. AKA now watches all chat channels and attempts to get nickname information through the guild, raid or whisper channels.
* Added support for player names in guild notes.
 
Aug 2, 2007
* Added ability to close AKA preferences with ESC
 
 
July 1, 2007
* Minor change to ensure that player information is updated when entering the world
 
May 21, 2007
* Updated TOC for WoW Client 2.1
* Updated version number to recommend upgrading
 
May 17, 2007
* Just updaed TOC # and refreshed files to get out of ui.worldofwar.net "archive" status
 
Jan 9, 2007
* Fixed the problem with non-guild communications!
* Updated for WoW client 2.03
 
 
Dec 26, 2006
* First login name now used as default nickname
* First general release
 
Dec 06, 2006
* Quick and dirty patch-up for 2.0 client
 
Nov 26, 2006
* Now updates the scrolling name list if needed (every 10 seconds)
* Battle with GEM appears to have ended in a truce. :) AKA now looks up channel numbers every time data is transmitted.
 
 
Nov 21, 2006
* "First run" bugs.
* Channel data was inadvertently being shared amongst realms
* Now transmits update when you change your nickname
* Now properly remembers setting of guild options
 
 
Nov 19, 2006
* Bug fixes when joining/leaving channels
 
 
Nov 18, 2006
* Complete redesign of the channel assignment screen
 
Nov 13, 2006
* Numerous small bug fixes
 
Nov 11, 2006 (1.08c)
* Interface "tabs" fixed
* The random checkbox issue has been resolved
* Now tries to leave the old channel when joining a new channel
* Initiates sync when you change channels or turn on a channel for your current toon
 
 
Nov 4, 2006 (build 2)
Hotfixes
* Now shows default values for channel names, passwords, and nickname
* Attempts to join channels if not logged into them
 
 
 
Nov 4, 2006
Another testing build. changes from last version:
* Main interface panel now has two tabs: one for "friend" info, one for "your" info
* Now supports 2 channels of communication per realm/faction
* Made non-guild channels realm/faction specific instead of realm specific
* Made friends list realm/faction specific
* Option to show your own nickname in chat (checkbox in OPTIONS)
* Made sharing optional on a per-toon basis
* The "sharing" toon lists are realm/specific (UI got too confusing with mixed factions)
* The PLAYERS tab (friends) now has a scrolling list (only scrolls if needed)
* Clicking a row in the PLAYERS tab now shows detailed info about that player (Similar to the tooltip)
 
 
 
Contact
=======
 
Author: Schnoggo (schnoggo {at} gmail.com)
Website: http://www.wowinterface.com/downloads/info7813-AKA.html
 
Property changes : Added: svn:executable + *
trunk/aka.xml New file
0,0 → 1,1086
<!-- "AKA" License information can be found in Readme.txt -->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\FrameXML\UI.xsd">
<Button name="AKATabTemplate"
inherits="CharacterFrameTabButtonTemplate"
virtual="true"
>
<Scripts>
<OnClick>
PlaySound("igMainMenuOpen");
PanelTemplates_Tab_OnClick(self,AKA_PrefsFrame);
AKA_ShowPanel(AKA_PrefsFrame.selectedTab);
</OnClick>
</Scripts>
</Button>
 
<Button
name="AKAUserLineProto"
text="is there anybody out there?"
virtual="true">
<Size>
<AbsDimension x="350" y="16" />
</Size>
</Button>
 
 
 
 
 
 
 
 
 
 
 
 
 
<CheckButton
name="AKA_ToonCheck"
inherits="UICheckButtonTemplate"
id="999"
virtual="true"
>
<Anchors>
<Anchor
point="RIGHT"
relativePoint="LEFT"
relativeTo="AKA_PrefsGuild_Toon1"
>
<Offset><AbsDimension x="2" y="0"/></Offset>
</Anchor>
</Anchors>
<Size><AbsDimension x="24" y="24"/></Size>
<Scripts>
<OnClick>AKA_Options_ToonClick(); </OnClick>
</Scripts>
</CheckButton>
 
 
<FontString
name="AKA_PrefsToonStringPrototype"
inherits="GameFontNormal"
justifyH="LEFT"
text=""
virtual="true"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsGuild_block"
>
</Anchor>
</Anchors>
<Scripts>
<OnClick>AKA_StringClick(); </OnClick>
</Scripts>
<Color r=".8" g=".8" b=".8" a="1.0" />
 
</FontString>
 
 
 
<Frame
name="AKAPrefsTemplate"
virtual="true"
parent="AKA_PrefsFrame"
>
<Size><AbsDimension x="770" y="540"/></Size>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsFrame"
>
<Offset><AbsDimension x="0" y="-40"/></Offset>
</Anchor>
</Anchors>
</Frame>
 
 
 
<Frame
name="AKA"
>
<Size>
<AbsDimension x="1" y="1"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="UIParent">
<Offset>
<AbsDimension x="1" y="1"/>
</Offset>
</Anchor>
</Anchors>
 
<Scripts>
<OnLoad>
AKA_OnLoad();
</OnLoad>
<OnEvent>
AKA_Event(event)
</OnEvent>
<OnUpdate>
AKA_OnUpdate(arg1);
</OnUpdate>
</Scripts>
</Frame>
 
 
 
 
 
 
 
<Frame name="AKA_PrefsFrame"
frameStrata="DIALOG"
toplevel="true"
parent="UIParent"
movable="true"
hidden="true"
enableMouse="true"
>
<Size>
<AbsDimension x="800" y="600"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop
bgFile="Interface\DialogFrame\UI-DialogBox-Background"
edgeFile="Interface\DialogFrame\UI-DialogBox-Border"
tile="true"
>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
</Backdrop>
 
 
 
 
 
<!-- set the parameters for the layers of the frame -->
<Layers>
<Layer level="ARTWORK">
<FontString
name="AKA_PrefsTitle"
inherits="GameFontNormalLarge"
justifyH="LEFT"
 
text="AKA_TITLE"
>
<Anchors>
<Anchor
point="LEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsFrame"
>
<Offset>
<AbsDimension x="20" y="-22"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".2" g="1" b=".2" a="1" />
</FontString>
 
</Layer>
</Layers>
 
<frames>
 
<Button name="AKA_PrefsCloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="AKA_PrefsFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="-5"/>
</Offset>
</Anchor>
</Anchors>
</Button>
 
 
 
 
 
 
 
 
<Button
name="AKA_PrefsFrameTab1"
inherits="AKATabTemplate"
id="1"
text="PLAYERS">
<Anchors>
<Anchor
point="BOTTOMLEFT"
relativePoint="BOTTOMLEFT"
relativeTo="AKA_PrefsFrame"
>
<Offset><AbsDimension x="11" y="-26"/></Offset>
</Anchor>
</Anchors>
</Button>
 
 
<Button
name="AKA_PrefsFrameTab2"
inherits="AKATabTemplate"
id="2"
text="OPTIONS">
<Anchors>
<Anchor
point="LEFT"
relativePoint="RIGHT"
relativeTo="AKA_PrefsFrameTab1"
>
<Offset><AbsDimension x="-14" y="0"/></Offset>
</Anchor>
</Anchors>
</Button>
 
 
</frames>
<Scripts>
 
<OnLoad>
PanelTemplates_SetNumTabs(this,2);
AKA_PrefsFrame.selectedTab=1;
PanelTemplates_UpdateTabs(this);
</OnLoad>
<OnMouseDown>this:StartMoving(); </OnMouseDown>
<OnMouseUp>this:StopMovingOrSizing(); </OnMouseUp>
<OnDragStop>this:StopMovingOrSizing(); </OnDragStop>
<OnShow>AKA_PrefsFrameOnShow();</OnShow>
<OnHide>PlaySound("igCharacterInfoClose");</OnHide>
</Scripts>
</Frame>
 
 
 
<!-- start of user frame-->
 
<frame
name="AKAUsersPanel"
inherits="AKAPrefsTemplate"
parent="AKA_PrefsFrame"
enableMouse="true"
 
>
 
<Layers>
<Layer level="ARTWORK">
 
<FontString
name="$parent_Users_Title"
inherits="GameFontNormal"
justifyH="LEFT"
text="Users"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="$parent"
>
<Offset>
<AbsDimension x="20" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Color r="1" g="1" b=".2" a="1" />
</FontString>
 
<FontString
name="$parent_Users_Text"
inherits="GameFontNormal"
justifyH="LEFT"
text="Click on an entry below to see more information about that player, |nand leave a second line:"
nonspacewrap="false"
maxLines="3"
>
<Anchors>
<Anchor
point="LEFT"
relativePoint="TOPLEFT"
relativeTo="$parent_Users_Title"
>
<Offset>
<AbsDimension x="0" y="-30"/>
</Offset>
</Anchor>
</Anchors>
<Color r="1" g="1" b="1" a="1" /> <!-- White Color -->
</FontString>
 
 
<FontString
name="AKA_TempScrollingCol0"
inherits="GameFontHighlight"
justifyH="LEFT"
wraponspaces="false"
justifyV="TOP"
text=""
virtual="true"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="BOTTOMLEFT"
relativeTo="AKA_PrefsTitle"
>
<Offset>
<AbsDimension x="0" y="-100"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".2" g="1" b="1" a="1" />
</FontString>
 
 
 
 
 
<FontString
name="AKA_AddNotes"
inherits="GameFontNormal"
justifyH="LEFT"
 
text="Click a line below to display details about that player. |n Shift-click [names] in chat window for alts tooltip."
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="BOTTOMLEFT"
relativeTo="AKA_PrefsTitle"
>
<Offset>
<AbsDimension x="0" y="-60"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".8" g="1" b=".8" a="1" />
</FontString>
 
<FontString
name="AKA_DispPlayerNotes"
inherits="GameFontNormal"
justifyH="LEFT"
 
text="Player notes go here."
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="BOTTOMLEFT"
relativeTo="AKA_PrefsTitle"
>
<Offset>
<AbsDimension x="0" y="-380"/>
</Offset>
</Anchor>
</Anchors>
<Color r="1" g="1" b=".8" a="1" />
</FontString>
 
 
 
</Layer>
</Layers>
 
<Scripts>
 
<OnMouseDown>
 
AKA_StringClick(this); -- Change 'this' to 'self' in 2.0
 
</OnMouseDown>
 
</Scripts>
 
<frames>
<ScrollFrame name="AKA_FrameScrollBar" inherits="FauxScrollFrameTemplate">
<Anchors>
<Anchor
point="TOPRIGHT"
relativePoint="TOPRIGHT"
relativeTo="AKAUsersPanel"
>
<Offset>
<AbsDimension x="00" y="-82"/>
</Offset>
</Anchor>
<Anchor
point="BOTTOMLEFT"
relativePoint="TOPRIGHT"
relativeTo="AKAUsersPanel"
>
<Offset>
<AbsDimension x="-20" y="-350"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnVerticalScroll>
FauxScrollFrame_OnVerticalScroll(16, AKA_ScrollBar_Update);
</OnVerticalScroll>
<OnShow>
AKA_ScrollBar_Update()
</OnShow>
</Scripts>
</ScrollFrame>
 
 
 
 
<Button name = "AKA_ScrollMenuEntryTemplate" virtual="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="AKA_FrameScrollBar" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="8" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Size>
<AbsDimension x="300" y="16" />
</Size>
<!--
<Layers><Layer level="BORDER"><FontString name="$parent_col1" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT" text=" "/></Layer></Layers>
-->
</Button>
</frames>
 
</frame>
 
 
 
<!-- start of options frame-->
 
<frame
name="AKAOptionsPanel"
inherits="AKAPrefsTemplate"
parent="AKA_PrefsFrame"
 
>
 
<Layers>
<Layer level="ARTWORK">
 
<FontString
name="$parent_Options_Title"
inherits="GameFontNormal"
justifyH="LEFT"
text="Global Options (Apply to all characters)"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="$parent"
>
<Offset>
<AbsDimension x="20" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Color r="1" g="1" b=".2" a="1" />
</FontString>
 
<FontString
name="$parent_Options_Text"
inherits="GameFontNormal"
justifyH="LEFT"
text="Enter your nickname below. This is the nickname that will appear in Chat to other users of AKA.|n"
nonspacewrap="false"
maxLines="3"
>
<Anchors>
<Anchor
point="LEFT"
relativePoint="TOPLEFT"
relativeTo="$parent_Options_Title"
>
<Offset>
<AbsDimension x="10" y="-26"/>
</Offset>
</Anchor>
</Anchors>
<Color r="1" g="1" b="1" a="1" /> <!-- White Color -->
</FontString>
 
 
 
 
 
<FontString
name="AKA_CurrentNickname"
inherits="GameFontNormal"
justifyH="LEFT"
 
text="Nickname not set."
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKAUsersPanel"
>
<Offset>
<AbsDimension x="30" y="-44"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".2" g="1" b="1" a="1" />
</FontString>
 
<FontString
name="AKA_ShowMyNickCaption"
inherits="GameFontNormal"
justifyH="LEFT"
 
text="Show my own nickname in chat."
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_CurrentNickname"
>
<Offset>
<AbsDimension x="330" y="-20"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".2" g="1" b="1" a="1" />
</FontString>
 
 
 
 
 
 
<FontString
name="AKA_PerToonTitle"
inherits="GameFontNormal"
justifyH="LEFT"
 
text=""
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKAUsersPanel"
>
<Offset>
<AbsDimension x="340" y="-40"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".8" g="1" b="8" a="8" />
</FontString>
 
 
 
 
<FontString
name="AKA_PrefsGuild_block"
inherits="GameFontNormal"
justifyH="LEFT"
text="Sharing Options (These can be different for every character)"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKAUsersPanel"
>
<Offset>
<AbsDimension x="20" y="-120"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".8" g="1" b="8" a="8" />
</FontString>
 
 
<FontString
name="AKA_PrefsUseGuildCaption"
inherits="GameFontNormal"
justifyH="LEFT"
text="Share information with GUILD members. (Only if in a guild.)"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsGuild_block"
>
<Offset>
<AbsDimension x="40" y="-30"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".6" g=".6" b=".6" a="1" />
</FontString>
 
 
 
<FontString
name="AKA_PrefsUseRaidCaption"
inherits="GameFontNormal"
justifyH="LEFT"
text="Share information with RAID/PARTY members."
>
 
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsGuild_block"
>
<Offset>
<AbsDimension x="40" y="-50"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".6" g=".6" b=".6" a="1" />
</FontString>
 
 
<FontString
name="AKA_PrefsUseChatCaption"
inherits="GameFontNormal"
justifyH="LEFT"
text="Share information other AKA users in private chat channels."
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsGuild_block"
>
<Offset>
<AbsDimension x="40" y="-70"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".6" g=".6" b=".6" a="1" />
</FontString>
 
 
 
 
<!-- guild notes options block: -->
 
<FontString
name="AKA_Prefs_block3"
inherits="AKA_PrefsToonStringPrototype"
text="Guild Note Options"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsGuild_block"
>
<Offset>
<AbsDimension x="0" y="-100"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
 
<FontString
name="AKA_PrefsGuildNotesCaption"
inherits="GameFontNormal"
justifyH="LEFT"
text="Some guilds keep nickname or player names in the guild notes. AKA can show this information for other guild members who are not running AKA. If AKA information is available for a particular character, it will will be displayed instead of the guild note."
>
<Size><AbsDimension x="460" /></Size>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_Prefs_block3"
>
<Offset>
<AbsDimension x="40" y="-30"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".6" g=".6" b=".6" a="1" />
</FontString>
 
 
 
<FontString
name="AKA_PrefsUseGNCaption0"
inherits="GameFontNormal"
justifyH="LEFT"
text="Don't use guild notes for nickname."
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_Prefs_block3"
>
<Offset>
<AbsDimension x="40" y="-90"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".6" g=".6" b=".6" a="1" />
</FontString>
 
 
<FontString
name="AKA_PrefsUseGNCaption1"
inherits="GameFontNormal"
justifyH="LEFT"
text="Use the first word of the guild note for player name/nickname."
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_Prefs_block3"
>
<Offset>
<AbsDimension x="40" y="-110"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".6" g=".6" b=".6" a="1" />
</FontString>
 
<FontString
name="AKA_PrefsUseGNCaption2"
inherits="GameFontNormal"
justifyH="LEFT"
text="Player name/nicknames are in parentheses () in the guild notes."
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_Prefs_block3"
>
<Offset>
<AbsDimension x="40" y="-130"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".6" g=".6" b=".6" a="1" />
</FontString>
 
 
<FontString
name="AKA_PrefsUseGNCaption3"
inherits="GameFontNormal"
justifyH="LEFT"
text="Player name/nicknames are in brackets [] in the guild notes."
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_Prefs_block3"
>
<Offset>
<AbsDimension x="40" y="-150"/>
</Offset>
</Anchor>
</Anchors>
<Color r=".6" g=".6" b=".6" a="1" />
</FontString>
 
 
 
 
 
 
 
 
 
 
</Layer>
</Layers>
 
 
<frames>
 
<EditBox name="AKA_PrefsMyNickname"
inherits="InputBoxTemplate"
>
<Size>
<AbsDimension x="140" y="26"/>
</Size>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_CurrentNickname"
>
<Offset>
<AbsDimension x="0" y="-12"/>
</Offset>
</Anchor>
</Anchors>
</EditBox>
 
 
 
 
 
 
<Button name="AKA_PrefsSetNickname"
inherits="UIPanelButtonTemplate"
text="Set Nickname"
id="102">
<Size>
<AbsDimension x="130" y="22"/>
</Size>
<Anchors>
<Anchor
point="LEFT"
relativePoint="RIGHT"
relativeTo="AKA_PrefsMyNickname"
/>
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchors>
<Scripts>
<OnClick>AKA_EnterNewNickname();</OnClick>
</Scripts>
</Button>
 
 
 
 
 
<CheckButton
name="AKA_PrefsShowMe"
inherits="UICheckButtonTemplate"
id="106"
>
 
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsMyNickname"
>
<Offset>
<AbsDimension x="300" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>AKAOptions_OnClick();</OnClick>
</Scripts>
</CheckButton>
 
 
 
<CheckButton
name="AKA_PrefsShareGuild"
inherits="UICheckButtonTemplate"
id="107"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsUseGuildCaption"
>
<Offset>
<AbsDimension x="-30" y="10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>AKAOptions_SharingOnClick(1);</OnClick>
</Scripts>
</CheckButton>
 
 
 
<CheckButton
name="AKA_PrefsShareRaid"
inherits="UICheckButtonTemplate"
id="108"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsUseRaidCaption"
>
<Offset>
<AbsDimension x="-30" y="10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>AKAOptions_SharingOnClick(2);</OnClick>
</Scripts>
</CheckButton>
 
 
<CheckButton
name="AKA_PrefsShareChat"
inherits="UICheckButtonTemplate"
id="108"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsUseChatCaption"
>
<Offset>
<AbsDimension x="-30" y="10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>AKAOptions_SharingOnClick(3);</OnClick>
</Scripts>
</CheckButton>
 
 
<CheckButton
name="AKA_Prefs_RB0"
inherits="SendMailRadioButtonTemplate"
>
<Anchors>
<Anchor point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsUseGNCaption0"
>
<Offset><AbsDimension x="-20" y="2"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
</OnLoad>
<OnClick>AKAOptions_RadioClick(0);
</OnClick>
</Scripts>
</CheckButton>
 
<CheckButton
name="AKA_Prefs_RB1"
inherits="SendMailRadioButtonTemplate"
>
<Anchors>
<Anchor point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsUseGNCaption1"
>
<Offset><AbsDimension x="-20" y="2"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
</OnLoad>
<OnClick>AKAOptions_RadioClick(1);
</OnClick>
</Scripts>
</CheckButton>
 
 
<CheckButton
name="AKA_Prefs_RB2"
inherits="SendMailRadioButtonTemplate"
>
<Anchors>
<Anchor point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsUseGNCaption2"
>
<Offset><AbsDimension x="-20" y="2"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
</OnLoad>
<OnClick>AKAOptions_RadioClick(2);
</OnClick>
</Scripts>
</CheckButton>
 
 
<CheckButton
name="AKA_Prefs_RB3"
inherits="SendMailRadioButtonTemplate"
>
<Anchors>
<Anchor point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsUseGNCaption3"
>
<Offset><AbsDimension x="-20" y="2"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
</OnLoad>
<OnClick>AKAOptions_RadioClick(3);
</OnClick>
</Scripts>
</CheckButton>
 
 
 
<!--
<CheckButton
name="AKA_PrefsUseChan2"
inherits="UICheckButtonTemplate"
id="108"
>
<Anchors>
<Anchor
point="TOPLEFT"
relativePoint="TOPLEFT"
relativeTo="AKA_PrefsUseChan2Caption"
>
<Offset>
<AbsDimension x="-30" y="10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>AKAOptions_OnChannelClick(2);</OnClick>
</Scripts>
</CheckButton>
-->
 
 
 
</frames>
 
</frame>
 
 
 
 
 
 
 
</Ui>
Property changes : Added: svn:executable + *