Thread Tools Display Modes
04/24/14, 01:10 PM   #1
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
Clickable item links in textbuffer

I made a textbuffer and i am sending messages to it with :AddMessage(some_msg) If there is an item link in the message, i can't click on it and get a tooltip. If i send the same message to the regular chat window like d(some_msg) then it works. What am i missing to make item links work in textbuffers ?
  Reply With Quote
04/24/14, 02:03 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
Is your textbuffer mouse enabled?
  Reply With Quote
04/24/14, 02:03 PM   #3
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
I had the same problem as well. Even having SetLinkEnabled(true) set for the textbuffer didn't make a difference. It wasn't an addon breaker for me so I just changed it from the link displaying to the name.
  Reply With Quote
04/24/14, 02:03 PM   #4
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Originally Posted by Seerah View Post
Is your textbuffer mouse enabled?
ooh, good point...

darn... yes mine is .. scratch that idea

Last edited by Xrystal : 04/24/14 at 02:06 PM.
  Reply With Quote
04/24/14, 02:51 PM   #5
BadVolt
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 74
Same for me doesn't work at all. May be we should use some SetTooltip method or sth like that.
  Reply With Quote
04/24/14, 02:53 PM   #6
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
Originally Posted by Seerah View Post
Is your textbuffer mouse enabled?
It wasn't, but making it mouse enabled didn't make a difference. Below the code that makes the textbuffer
Code:
	CDGLibGui.window.TEXTBUFFER = WINDOW_MANAGER:CreateControl("CDGLibGuiWindow_TB", CDGLibGui.window.ID, CT_TEXTBUFFER)	
 	CDGLibGui.window.TEXTBUFFER:SetLinkEnabled(true)
	CDGLibGui.window.TEXTBUFFER:SetMouseEnabled(true)
 	CDGLibGui.window.TEXTBUFFER:SetFont("ZoFontChat")
 	CDGLibGui.window.TEXTBUFFER:SetHidden(false)
	CDGLibGui.window.TEXTBUFFER:SetClearBufferAfterFadeout(false)
 	CDGLibGui.window.TEXTBUFFER:SetLineFade(10, 3)
 	CDGLibGui.window.TEXTBUFFER:SetMaxHistoryLines(100)
	CDGLibGui.window.TEXTBUFFER:SetDimensions(500-64, 264-64)
	CDGLibGui.window.TEXTBUFFER:SetAnchor(TOPLEFT,CDGLibGui.window.ID,TOPLEFT,32,32)
  Reply With Quote
04/25/14, 04:02 AM   #7
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Well, not sure about TESO, but TextBuffers are usually not used for display but used to edit the text over and over again until the code is finished and then copying the result to the real edit control for the display. That's why it's called "Buffer".
So it's likely that the TextBuffer just doesn't do a lot of stuff other controls for displaying stuff is doing.
  Reply With Quote
04/25/14, 04:28 AM   #8
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Originally Posted by Iyanga View Post
Well, not sure about TESO, but TextBuffers are usually not used for display but used to edit the text over and over again until the code is finished and then copying the result to the real edit control for the display. That's why it's called "Buffer".
So it's likely that the TextBuffer just doesn't do a lot of stuff other controls for displaying stuff is doing.
Makes sense. If that was what it was designed for. But some of the functionality that is listed for it clearly gives the impression that it is used for displaying information (AddMessage) including links (SetLinkEnabled) etc.
  Reply With Quote
04/25/14, 04:35 AM   #9
BadVolt
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 74
Originally Posted by Iyanga View Post
Well, not sure about TESO, but TextBuffers are usually not used for display but used to edit the text over and over again until the code is finished and then copying the result to the real edit control for the display. That's why it's called "Buffer".
So it's likely that the TextBuffer just doesn't do a lot of stuff other controls for displaying stuff is doing.
That's fine, but TextBuffer have method "SetLinkEnabled". And it do not work.
  Reply With Quote
04/25/14, 06:51 AM   #10
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
As far as i could dig into how the current chat tabs work and as far as i can remember at the moment (@work atm) is that the eso ChatTabs also use TEXTBUFFER to display text. I tried to see if there was a difference between the implementation of the eso chattabs and my own textbuffer, but i couldn't find any.

Could it be that some additional event handling needs to be done to make the tooltips work ?
  Reply With Quote
04/25/14, 07:26 AM   #11
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
I think it is a bug, experienced the same issue

To solve I set an handler like this

Code:
    buffer:SetHandler("OnLinkClicked", function(self, ...) return ZO_ChatSystem_OnLinkClicked(...) end) -- \esoui\ingame\chatsystem\chatsystem.lua, line 2540 -- linkData, linkText, button
  Reply With Quote
04/25/14, 10:20 AM   #12
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
hmm, maybe not a bug then.

Perhaps the chat frames use a virtual frame that already has that handler configured.

Thanks, will try and will confirm if it resolves my situation.

edit:
Nada. The handler didn't trigger at all. Investigating other settings that may be required on a simple text buffer.

edit2:
Nothing springs to mind that hasn't already been set up.

Last edited by Xrystal : 04/25/14 at 10:32 AM.
  Reply With Quote
04/25/14, 11:23 AM   #13
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
Originally Posted by Xrystal View Post
Nada. The handler didn't trigger at all
You should have a settings changing from me, in case it helps here is my buffer

Code:
    local frameLogBuffer  = CreateControl(nil, frameLog,       CT_TEXTBUFFER)
    frameLogBuffer:SetMouseEnabled(true)
    frameLogBuffer:SetLinkEnabled(true)
    frameLogBuffer:SetMaxHistoryLines(100000)
    frameLogBuffer:SetAnchor(TOPLEFT, frameLog, TOPLEFT, 8, 8)
    frameLogBuffer:SetAnchor(BOTTOMRIGHT, frameLog, BOTTOMRIGHT, -100, -8)
    frameLogBuffer:SetFont(font.."|12")
    frameLogBuffer:SetHandler("OnLinkClicked", function(self, ...) return ZO_ChatSystem_OnLinkClicked(...) end) -- \esoui\ingame\chatsystem\chatsystem.lua, line 2540 -- linkData, linkText, button
    frameLogBuffer:SetHandler("OnDragStart", dragStart)
    frameLogBuffer:SetHandler("OnDragStop", dragStop)    
    --frameLogBuffer:SetHandler("OnTextChanged", onToggleSlider)
    frameLogBuffer:SetHandler("OnMouseWheel", function(self, delta, ctrl, alt, shift) 
        if sliderFrameLog:GetAlpha() == 1 then
            if delta == 1 then
                sliderFrameLog:SetValue(sliderFrameLog:GetValue() - 1)
            else
                sliderFrameLog:SetValue(sliderFrameLog:GetValue() + 1)
            end
        end
double check that you have
:SetMouseEnabled(true)
:SetLinkEnabled(true)
  Reply With Quote
04/25/14, 01:38 PM   #14
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Yep I do.

However, because I had set up everything else up in XML the SetLinkEnabled setting didn't work. I had to change the xml tag to be linkEnabled="true". Until I made that change it didn't work.

Lua Code:
  1. <TextBuffer name="$(parent)_Info" font="ZoFontChat" maxHistoryLines="500" mouseEnabled="true" linkEnabled="true">
  2.                     <Anchor point="TOPLEFT" offsetX="8" offsetY="85" />
  3.                     <Anchor point="BOTTOMRIGHT" offsetX="-8" offsetY="-35" />
  4.                     <OnLinkClicked>
  5.                         CHAT_SYSTEM:AddMessage("Link Clicked")
  6.                         ZO_ChatSystem_OnLinkClicked(...)
  7.                     </OnLinkClicked>
  8.                     <OnMouseWheel>
  9.                         self:MoveScrollPosition(delta)
  10.                     </OnMouseWheel>
  11.                 </TextBuffer>
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Clickable item links in textbuffer


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