Thread Tools Display Modes
09-20-10, 03:07 PM   #1
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 127
Post HYPERLINKSTOP help

Hey all. i have done a few copy chat meathods and both find the same error. but not ingame. it crashed the clant.


(code == CODE_NEWLINE || code == CODE_PIPE || code == CODE_INVALIDCODE) || code == CODE_HYPERLINKSTOP || code == CODE_EMBEDDEDTEXTURESTOP
code

Code:
local frame = CreateFrame("Frame", "CopyFrame", UIParent)
frame:SetBackdrop({
	bgFile = "Interface\\AddOns\\wChat\\media\\UI-DialogBox-Background.blp",
	edgeFile = "Interface\\AddOns\\wChat\\media\\UI-DialogBox-Border.blp",
	tile = true, tileSize = 16, edgeSize = 16,
	insets = {left = 3, right = 3, top = 5, bottom = 3
}})

frame:SetBackdropColor(0, 0, 0, 1)
frame:SetWidth(500)
frame:SetHeight(400)
frame:SetPoint("LEFT", UIParent, "LEFT", 3, 10)
frame:SetFrameStrata("DIALOG")
frame:Hide()

local scrollArea = CreateFrame("ScrollFrame", "CopyFrameScroll", frame, "UIPanelScrollFrameTemplate")
scrollArea:SetPoint("TOPLEFT", frame, "TOPLEFT", 8, -30)
scrollArea:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -30, 8)

local editBox = CreateFrame("EditBox", "CopyBox", frame)
editBox:SetMultiLine(true)
editBox:SetMaxLetters(20000)
editBox:EnableMouse(true)
editBox:SetAutoFocus(true)
editBox:SetFontObject(ChatFontNormal)
editBox:SetWidth(450)
editBox:SetHeight(270)
editBox:SetScript("OnEscapePressed", function() frame:Hide() end)

scrollArea:SetScrollChild(editBox)

local close = CreateFrame("Button", "CopyClose", frame, "UIPanelCloseButton")
close:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, -1)

local lines = {}
local getLines = function(...)
	local count = 1

	for i = select("#", ...), 1, -1 do
		local region = select(i, ...)
		
		if region:GetObjectType() == "FontString" then
			lines[count] = tostring(region:GetText())
			count = count + 1
		end
	end

	return count - 1
end

local copyChat = function(self, chatTab)
	local chatFrame = _G["ChatFrame" .. chatTab:GetID()]
	local _, fontSize = chatFrame:GetFont()
	
	FCF_SetChatWindowFontSize(chatFrame, chatFrame, 0.01)
	
	local lineCount = getLines(chatFrame:GetRegions())
	
	FCF_SetChatWindowFontSize(chatFrame, chatFrame, fontSize)

	if lineCount > 0 then
		local text = table.concat(lines, "\n", 1, lineCount)

		frame:Show()
		editBox:SetText(text)
	end
end

local info = {
	text = "Copy Chat Contents",
	func = copyChat,
	notCheckable = 1	
}

local origFCF_Tab_OnClick = _G.FCF_Tab_OnClick
local FCF_Tab_OnClickHook = function(chatTab, ...)
	origFCF_Tab_OnClick(chatTab, ...)

	info.arg1 = chatTab
	
	UIDropDownMenu_AddButton(info)
end

FCF_Tab_OnClick = FCF_Tab_OnClickHook
i have two types of copy chat codes. this one i like more. so i would like to try to keep it for cata. mainly to have the open copy chat. when you right click on the chat tab. a great thing.

i guess i should say how the error happens. all is fine. even when that copy chat box is open. its when i click in the chat box. or try to copy. the chat.

help would be very very greatfull. or if i can have help on shorting this down

thanks again for your time.

edit.
after going though things. i think its to do with

if CHAT_TIMESTAMP_FORMAT and not text:find("^|r") then
text = BetterDate(CHAT_TIMESTAMP_FORMAT, _G.time())..text
of what is not in that part of the code i posted. but its in the script. it adds a timestamp to things that dont always have a timestamp. as when i remove it., it seems to be ok. and also if i dont remove this. and just remove

frame:SetBackdrop({
bgFile = "Interface\\AddOns\\wChat\\media\\UI-DialogBox-Background.blp",
edgeFile = "Interface\\AddOns\\wChat\\media\\UI-DialogBox-Border.blp",
tile = true, tileSize = 16, edgeSize = 16,
insets = {left = 3, right = 3, top = 5, bottom = 3
}})

frame:SetBackdropColor(0, 0, 0, 1)
frame:SetWidth(500)
frame:SetHeight(400)
frame:SetPoint("LEFT", UIParent, "LEFT", 3, 10)
frame:SetFrameStrata("DIALOG")
frame:Hide()
from the copy code. it is fine also. the background isnt there but is fine. very stange.
__________________
wMmap :: Is a lightweight Minimap, with a sleek look & custom imagery.
wIn1 :: In one addon. and is very lightweight & simple to use.
wChat :: Is a lightweight chat mod.
wBroker :: Is A simple broker add-on.
wPetXPBar :: Is A simple lightweight Pet XP Bar.
wBuffs :: Is A simple Buffs Bar.

Last edited by weasoug : 09-20-10 at 04:48 PM.
 
09-20-10, 05:07 PM   #2
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Here is a different approach:
Code:
local frame = CreateFrame('Frame', nil, UIParent)
frame:SetFrameStrata('DIALOG')
frame:SetPoint('LEFT', 3, 10)
frame:SetHeight(400)
frame:SetWidth(500)
frame:Hide()

frame:SetBackdrop({
	bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]],
	edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
	edgeSize = 16, tileSize = 16, tile = true,
	insets = { left = 3, right = 3, top = 5, bottom = 3 }
})
frame:SetBackdropColor(0, 0, 0, 1)

local scrollArea = CreateFrame('ScrollFrame', "wChatScrollFrame", frame, 'UIPanelScrollFrameTemplate')
scrollArea:SetPoint('TOPLEFT', 8, -30)
scrollArea:SetPoint('BOTTOMRIGHT', -30, 8)

local editBox = CreateFrame('EditBox', nil, frame)
editBox:SetMultiLine(true)
editBox:SetMaxLetters(20000)
editBox:EnableMouse(true)
editBox:SetAutoFocus(true)
editBox:SetFontObject(ChatFontNormal)
editBox:SetWidth(450)
editBox:SetHeight(270)
editBox:SetScript('OnEscapePressed', function() frame:Hide() end)

scrollArea:SetScrollChild(editBox)

local close = CreateFrame('Button', nil, frame, 'UIPanelCloseButton')
close:SetPoint('TOPRIGHT', 0, -1)

local CopyChat = function(self, chatTab)
	local chatFrame = _G['ChatFrame' .. chatTab:GetID()]
	local numMessages = chatFrame:GetNumMessages()
	if numMessages >= 1 then
		local GetMessageInfo = chatFrame.GetMessageInfo
		local text = GetMessageInfo(chatFrame, 1)
		for index = 2, numMessages do
			text = text .. "\n" .. GetMessageInfo(chatFrame, index)
		end
		frame:Show()
		editBox:SetText(text)
	end
end

hooksecurefunc('FCF_Tab_OnClick', function(self)
	local info = UIDropDownMenu_CreateInfo()
	info.text = "Copy Chat Contents"
	info.notCheckable = true
	info.func = CopyChat
	info.arg1 = self
	UIDropDownMenu_AddButton(info)
end)
I'm not sure if you changed those backdrop textures or not but I set them to the default UI's so I wouldn't have to download wChat. Also, without sounding to much like an ass I hope, is your primary language something other than english?
 
09-20-10, 05:23 PM   #3
weasoug
A Flamescale Wyrmkin
 
weasoug's Avatar
AddOn Author - Click to view addons
Join Date: May 2010
Posts: 127
Thumbs up

Originally Posted by Vrul View Post
Here is a different approach:
Code:
0-0
I'm not sure if you changed those backdrop textures or not but I set them to the default UI's so I wouldn't have to download wChat. Also, without sounding to much like an ass I hope, is your primary language something other than english?
Well i was born in England, and as we moved around Europe. when i was young. so my language got a bit messed up. also im not so good at spelling being dyslectic. and never went to school. well not long. as we never was in one place to long. due to my fathers job. im sorry. now im in the 30s. im learning. or trying.

i still get

Code:
(code == CODE_NEWLINE || code == CODE_PIPE || code == CODE_INVALIDCODE) || code == CODE_HYPERLINKSTOP || code == CODE_EMBEDDEDTEXTURESTOP
as i said it has to be todo with


if CHAT_TIMESTAMP_FORMAT and not text:find("^|r") then
text = BetterDate(CHAT_TIMESTAMP_FORMAT, time())..text
end
so maybe i need to take that out for now. and look into a new method of displaying a timestamp for things the chat misses
__________________
wMmap :: Is a lightweight Minimap, with a sleek look & custom imagery.
wIn1 :: In one addon. and is very lightweight & simple to use.
wChat :: Is a lightweight chat mod.
wBroker :: Is A simple broker add-on.
wPetXPBar :: Is A simple lightweight Pet XP Bar.
wBuffs :: Is A simple Buffs Bar.

Last edited by weasoug : 09-20-10 at 05:32 PM.
 
 

WoWInterface » AddOns, Compilations, Macros » Cataclysm Beta » HYPERLINKSTOP help

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off