/
AKA v2.4b |
AKA v2.5b |
Description |
=========== |
Version History |
======== |
Oct 13, 2008 (version 2.5b) |
* More code clean-up |
* Preferences are now being drawn correctly. (This was also causing the "losing my settings" problem.) |
* /who tooltips aren't working on test realms. |
*NOTE* files have changes from 2.2x versions - you will need to exit WoW for this update. |
Oct 12, 2008 (version 2.4b) |
* Scrolling toon list working |
* Lots of code clean-up |
</Anchors> |
<Scripts> |
<OnVerticalScroll> |
FauxScrollFrame_OnVerticalScroll(self, offset, 16, AKA_ScrollBar_Update); |
FauxScrollFrame_OnVerticalScroll(self, offset, 19, AKA_ScrollBar_Update); |
</OnVerticalScroll> |
<OnShow> |
AKA_ScrollBar_Update(self) |
</Anchor> |
</Anchors> |
<Scripts> |
<OnClick>AKAOptions_OnClick();</OnClick> |
<OnClick>AKAOptions_OnClick(self);</OnClick> |
</Scripts> |
</CheckButton> |
</Anchor> |
</Anchors> |
<Scripts> |
<OnClick>AKAOptions_SharingOnClick(1);</OnClick> |
<OnClick>AKAOptions_SharingOnClick("Guild");</OnClick> |
</Scripts> |
</CheckButton> |
</Anchor> |
</Anchors> |
<Scripts> |
<OnClick>AKAOptions_SharingOnClick(2);</OnClick> |
<OnClick>AKAOptions_SharingOnClick("Raid");</OnClick> |
</Scripts> |
</CheckButton> |
</Anchor> |
</Anchors> |
<Scripts> |
<OnClick>AKAOptions_SharingOnClick(3);</OnClick> |
<OnClick>AKAOptions_SharingOnClick("Chat");</OnClick> |
</Scripts> |
</CheckButton> |
-- ======== |
-- AKASavedVars = {}; |
AKA_Version=2.4; |
AKA_Version=2.5; |
AKA_HighestSeenVersion=0; |
AKA_FormatVersion=1.1; |
AKA_variablesLoaded = false; |
end |
local function NoNull(inString) |
if (inString == nil) then |
return "" |
else |
return inString |
end |
end |
local function UpdateRadios() |
local guildNoteOption=AKA_SavedVars["MyToons"][myPlayerID]["guildnotes"]; |
if (guildNoteOption==nil) then |
local function ShowWhoTooltip2() |
-- this will be the one called by the regular /who event |
--[[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; |
end |
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; |
function AKA_SetItemRef (link, text, button) |
-- Get hooked into chat links |
-- keeping it global on purpose.... |
-- keeping it global on purpose... |
AKA_LinkedName=""; |
if (strsub(link, 1, 6) == "player") then -- "player:{plaeryname}" |
local name = strsub(link, 8); |
local namelink = strsub(link, 8); |
local name, lineid = strsplit(":", namelink); |
-- local name = strsub(link, 8); |
if ( name and (strlen(name) > 0) ) then |
if ( IsShiftKeyDown() ) then |
AKA_LinkedName = name; |
--ShowWhoTooltip(name); |
--AKA_LinkedName=""; -- tip has been shown. move along |
end |
end |
end |
-- if (AKA_LinkedName=="") then |
originalSetItemRef(link, text, button); |
originalSetItemRef(link, text, button); -- always pass through |
-- end |
end |
-- GLOBAL FUNCTIONS |
-- __ _ _ _ _ ___ ___ _ __ |
-- /__ | / \ |_) /\ | |_ | | |\ | / | | / \ |\ | (_ |
-- \_| |_ \_/ |_) /--\ |_ | |_| | \| \_ | _|_ \_/ | \| __) |
-- |
function AKA_ChatModder(this, event, ...) |
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11 = ...; |
function AKA_ChatModder(this, event, arg1, arg2, ...) |
local 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 |
-- arg1 = event |
-- arg2 = speaker (usually) |
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 (killEvent == true) then |
-- don't pass it along the chain |
else |
originalChatFrame_OnEvent(this, event, ...); |
originalChatFrame_OnEvent(this, event, arg1, arg2, ...); |
end |
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; |
if (SetItemRef ~= nil) then |
if (SetItemRef ~= AKA_SetItemRef) then |
originalSetItemRef = SetItemRef; --hooked |
SetItemRef=AKA_SetItemRef; |
hasHookedChatLink=true; |
DEFAULT_CHAT_FRAME:AddMessage("who hooked", 1.0, 0.5, 0.25) |
else |
DEFAULT_CHAT_FRAME:AddMessage("who good", 1.0, 0.5, 0.25) |
end |
else |
DEFAULT_CHAT_FRAME:AddMessage("who not avail", 1.0, 0.5, 0.25) |
end |
hasHookedChatLink=true; |
end |
secondsSinceUpdate = 0; |
if (CalendarDayButton_OnEnter ~= AKA_CalendarDayButton_OnEnter) then |
original_CalendarDayButton_OnEnter = CalendarDayButton_OnEnter; --hooked |
CalendarDayButton_OnEnter=AKA_CalendarDayButton_OnEnter; |
DEFAULT_CHAT_FRAME:AddMessage("calendar hooked", 1.0, 0.5, 0.25) |
--DEFAULT_CHAT_FRAME:AddMessage("calendar hooked", 1.0, 0.5, 0.25) |
hasHookedCalendar=true; |
end |
hasHookedCalendar=true; |
end |
end |
-- Prefs: |
-- ------ |
-- Handle clicks for Prefs |
function AKAOptions_OnClick() |
local id = this:GetID() |
local buttonName=this:GetName() |
-- message("LookoutOptions_OnClick: OnClick: " .. buttonName .. " ,ID: " .. id); |
function AKAOptions_OnClick(self) |
local buttonName=self:GetName() |
--DEFAULT_CHAT_FRAME:AddMessage("LookoutOptions_OnClick: OnClick: " .. buttonName ); |
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" |
function AKAOptions_SharingOnClick(shareType) |
-- Called by checkbuttons in preferences frame |
-- sharetype = one of ["Guild" "Raid "Chat" |
local checkbuttonName = "AKA_PrefsShare"..shareType; |
local currentState=getglobal("AKA_PrefsShare"..shareType):GetChecked(); |
local newSetting="no"; |
if (currentState) then |
newSetting="yes"; |
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 |
AKA_SavedVars["MyToons"][myPlayerID]["com_channels"][shareType]["active"]=newSetting; |
end |
function AKAOptions_RadioClick(butNum) |
UpdateRadios(); |
-- draw the current settings: |
if (AKA_SavedVars["AKA_PrefsShowMe"] == true) then |
if (AKA_SavedVars["AKA_PrefsShowMe"]) then |
getglobal("AKA_PrefsShowMe"):SetChecked(true) |
else |
getglobal("AKA_PrefsShowMe"):SetChecked(false) |
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) |
for i,v in ipairs({"Guild","Raid","Chat"}) do |
if (AKA_SavedVars["MyToons"][myPlayerID]["com_channels"][v]["active"] == "yes") then |
getglobal("AKA_PrefsShare"..v):SetChecked(true) |
else |
getglobal("AKA_PrefsShareGuild"):SetChecked(false) |
getglobal("AKA_PrefsShare"..v):SetChecked(false) |
end |
end |
if ((AKAPrefs_CurrentPanel == nil) or (AKAPrefs_CurrentPanel == 0)) then |
AKAPrefs_CurrentPanel=-1; |
AKA_HidePanel(2); |
local lineCounter, dataLine, buttonName; |
local listText=""; -- temporary simple list version |
DEFAULT_CHAT_FRAME:AddMessage("top="..FauxScrollFrame_GetOffset(AKA_FrameScrollBar)); |
-- DEFAULT_CHAT_FRAME:AddMessage("top="..FauxScrollFrame_GetOffset(AKA_FrameScrollBar)); |
for lineCounter=1,VISIBLE_MAX do |
dataLine= lineCounter + FauxScrollFrame_GetOffset(AKA_FrameScrollBar); |
this:RegisterEvent("CHAT_MSG_ADDON"); |
this:RegisterEvent("CHAT_MSG_SYSTEM"); -- for the /who |
this:RegisterEvent("WHO_LIST_UPDATE"); -- for the /who |
-- raid command stuff: |
-- this:RegisterEvent("CHAT_MSG_RAID"); |
-- this:RegisterEvent("CHAT_MSG_PARTY"); |
end |
if (eventHandled == false) then |
if ((event == "CHAT_MSG_SYSTEM") or (event =="WHO_LIST_UPDATE")) then -- looking for the "who" event set earlier by the linky |
PlaySound("igCharacterInfoOpen"); |
DEFAULT_CHAT_FRAME:AddMessage(event) |
-- WHO_LIST_UPDATE |
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 |
-- VARIABLES_LOADED |
-- ================ |
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 |
## Interface: 30000 |
## Title: AKA |
## Notes: Publishes player alts to guild members |
## Version: 2.4 |
## Version: 2.5 |
## Author: Schnoggo |
## OptionalDeps: CleanChat,Gatherer,GuildEventManager2 |
## SavedVariables: AKA_SavedVars, AKA_USERID, AKA_DEBUG, AKA_TRAFFICMONITOR |