/
## Interface: 40200 |
## Interface: 40300 |
## Title: Cellular |
## Notes: Instant messenger for whispers |
## Author: TotalPackage |
## Version: 4.2.001 |
## Version: 4.3.001 |
## SavedVariables: CellularDB |
## SavedVariablesPerCharacter: CellularCharDB, Cellular_History |
local function AttachEditBox(id, skiptext, skipset) -- attach the main chat editbox to the current person you're whispering |
local tab = tabs[id] |
if not tab:IsShown() then return end |
ChatEdit_ActivateChat(cfeb) |
cfeb.setText = 1 |
cfeb.text = sw..tab.name.." " |
ChatEdit_UpdateHeader(cfeb) |
ChatEdit_ParseText(cfeb, 0) |
if not db.noattach then |
ChatEdit_ActivateChat(cfeb) |
cfeb.setText = 1 |
cfeb.text = sw..tab.name.." " |
ChatEdit_UpdateHeader(cfeb) |
ChatEdit_ParseText(cfeb, 0) |
if not attached then |
l_p, l_rt, l_rp, l_x, l_y = cfeb:GetPoint(1) |
r_p, r_rt, r_rp, r_x, r_y = cfeb:GetPoint(2) |
cfeb:SetPoint("TOPRIGHT", tab:GetParent(), "BOTTOMRIGHT", 0, 6) |
end |
attached = id |
cfeb:SetFocus() |
else |
if tab.name and tab.name ~= "" then |
local editBox = ChatEdit_ChooseBoxForSend() |
editBox:SetAttribute("chatType", "WHISPER") |
editBox:SetAttribute("tellTarget", tab.name) |
ChatEdit_UpdateHeader(editBox) |
if editBox ~= ChatEdit_GetActiveWindow() then |
ChatFrame_OpenChat("") |
end |
end |
end |
cfeb:SetFocus() |
end |
local function ToggleEditBox(id, hidediff) |
if attached == id or (attached and hidediff) then |
if not db.noattach and (attached == id or (attached and hidediff)) then |
ChatEdit_DeactivateChat(cfeb) |
elseif not hidediff and id then |
AttachEditBox(id) |