|
01-11-24, 01:10 PM | #1 |
Thank you, you were very kind to answer me. Unfortunately, however, I don't think the solutions work. From the addon channel with SendAddonMessage(MyChannelAddon_channel, msg, "WHISPER", sender) I receive the profession link of the other guildmate For example [Tailoring]. I have to put this link on a frame that collects all the links that I receive from other guildmate.
For now the only way I've found is to put a chat frame on the frame (see screen): Code:
function LaFratellanza_Prof_ChatFrame_Init() local background = CreateFrame("Frame", "LaFratellanza_ChatFrame_Backgroud", LaFratellanza_main_frame); background:SetSize(256, 256); background:SetPoint("LEFT", LaFratellanza_main_frame, "TOPRIGHT", -15, -150); background:SetBackdrop({ bgFile = "Interface\\AddOns\\LaFratellanza\\texture\\frames\\finestra-laterale.tga", tile = false, insets = { left = 0, right = 0, top = 0, bottom = 0 } }); background:SetFrameLevel(LaFratellanza_main_frame:GetFrameLevel()-1); LaFratellanza_chatFrame = FCF_OpenNewWindow("LaFratellanzaProfessioni"); LaFratellanza_chatFrameTab = _G["ChatFrame" .. LaFratellanza_chatFrame:GetID() .. "Tab"]; LaFratellanza_chatFrameButtonFrame = _G["ChatFrame" .. LaFratellanza_chatFrame:GetID() .. "ButtonFrame"]; LaFratellanza_chatFrameEditBox = _G["ChatFrame" .. LaFratellanza_chatFrame:GetID() .. "EditBox"]; ChatFrame_RemoveAllMessageGroups(LaFratellanza_chatFrame); ChatFrame_AddMessageGroup(LaFratellanza_chatFrame, "ADDON"); LaFratellanza_chatFrame:SetScript("OnEvent", function(self, event, prefix, message) if event == "CHAT_MSG_ADDON" and prefix == LaFratellanza_channel then if string.sub(message, 1, 3) == "Res" then self:AddMessage(string.sub(message, 5)) end end end) LaFratellanza_chatFrame:RegisterEvent("CHAT_MSG_ADDON"); CURRENT_CHAT_FRAME_ID = LaFratellanza_chatFrame:GetID(); FCF_ToggleLock(); LaFratellanza_chatFrame:SetParent(_G["LaFratellanza_Main_Frame"]); LaFratellanza_chatFrameTab:SetParent(_G["LaFratellanza_Main_Frame"]); LaFratellanza_chatFrameButtonFrame:SetParent(_G["LaFratellanza_Main_Frame"]); LaFratellanza_chatFrameEditBox:SetParent(_G["LaFratellanza_Main_Frame"]); LaFratellanza_chatFrame:ClearAllPoints(); LaFratellanza_chatFrame:SetFrameLevel(_G["LaFratellanza_Main_Frame"]:GetFrameLevel()-1); LaFratellanza_chatFrame:SetWidth(220); LaFratellanza_chatFrame:SetHeight(180); LaFratellanza_chatFrame:SetPoint("TOPLEFT", _G["LaFratellanza_Main_Frame"],"TOPRIGHT", 10, -70); LaFratellanza_chatFrameButtonFrame:SetWidth(0); LaFratellanza_chatFrameButtonFrame:SetHeight(0); LaFratellanza_chatFrameButtonFrame:ClearAllPoints(); LaFratellanza_chatFrameButtonFrame:SetPoint("TOPRIGHT", UIParent,"TOPRIGHT", 0, 0); LaFratellanza_chatFrameButtonFrame:SetFrameLevel(_G["LaFratellanza_Main_Frame"]:GetFrameLevel()-1); LaFratellanza_chatFrameEditBox:ClearAllPoints(); LaFratellanza_chatFrameEditBox:SetWidth(20); LaFratellanza_chatFrameEditBox:SetHeight(20); LaFratellanza_chatFrameButtonFrame:SetPoint("TOPRIGHT", UIParent,"TOPRIGHT", 0, 0); FCF_SetLocked( LaFratellanza_chatFrame, 1 ); FCF_SetWindowAlpha( LaFratellanza_chatFrame, 0 ); LaFratellanza_chatFrame:SetMovable( false ); LaFratellanza_chatFrame:SetResizable( false ); local header = CreateFrame("Frame", "LaFratellanza_ChatFrame_Header", LaFratellanza_main_frame); header:SetSize(256, 64); header:SetPoint("LEFT", LaFratellanza_main_frame, "TOPRIGHT", -15, -55); header:SetBackdrop({ bgFile = "Interface\\AddOns\\LaFratellanza\\texture\\frames\\header-finestra-laterale.tga", tile = false, insets = { left = 0, right = 0, top = 0, bottom = 0 } }); header:SetFrameLevel(LaFratellanza_chatFrameTab:GetFrameLevel()+10); local headerTitle = header:CreateFontString(nil, "OVERLAY", "GameFontNormal"); headerTitle:SetPoint("TOPLEFT", header, "TOPLEFT", 30, -30); headerTitle:SetText("LINK PROFESSIONI"); end screen: https://ibb.co/GxWJcMb but unfortunately I find chat frames unpredictable. Sometimes it disappears for no reason and i can't really hide ButtonFrame, EditBox and tab of the chat. I will try to find another way, thank you very much! You have been very kind! Last edited by Carriola : 01-11-24 at 01:13 PM. |
|
01-11-24, 01:23 PM | #2 |
Ah, that's how you are receiving the link.
Your addon is being used by your friends and allows them to send an addon message to your addon regarding their tradeskill. Now I am assuming that if you then monitor the chat for those messages, you should be able to get the link you need to use. All you then need to do is put that link in your frame ( which I am assuming you have been doing, but are having a problem clicking on it ). The Hyperlink code we've been using should resolve that problem. I've never used the addon message system myself so unsure of exactly what its limits are and benefits etc. But if you have that part working as expected and have a link from that source. Then things should work with the examples we've provided. But, out of my working example the following code is what does the work Lua Code:
When you click the link it works just like the ChatFrame and opens the profession frame to the profession linked. I've never used these myself so was quite happy to see how easy it was to work with. So I am happy to say I learned something new.
__________________
Characters: Gwynedda - 70 - Demon Warlock Galaviel - 65 - Resto Druid Gamaliel - 61 - Disc Priest Gwynytha - 60 - Survival Hunter Lienae - 60 - Resto Shaman Plus several others below level 60 Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818 |
|
01-11-24, 01:25 PM | #3 |
No, it won't. You're apparently doing this for a private server and this site is only for people playing on official Blizzard servers.
__________________
Fizzlemizz Maintainer of Discord Unit Frames and Discord Art. Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus. |
|
01-11-24, 02:40 PM | #4 | |
This works in 10.2.5 so hopefully it will work for you How this example addon works is when you first log in / reload the ui you can open the tradeskill of your choice and it will automatically grab the skill link and send it via addonmessage to the chatframe. The addon then stops checking for the tradeskill frame being opened and closes the window. It then sees there is an addon message and grabs the link sent earlier and puts it into the fontstring set up for it. Clicking on that link will then bring up the trade skill window ( showing the name of the link sender - in my case me ). Looking at the tradeskill frame there is no option for WHISPERing the tradeskill link automatically as an addon message with a special prefix. So I had to use this roundabout route to get the tradeskill link and send it manually via addonmessage with the prefix. It adds a clickable profession link to a font string so does what you are asking, you might just have to do some additional work, to make it work in your addon. If my example doesn't work for you in 10.2.0 or 10.2.5 then mayhap something is not working right at your end and could explain the problems you are having. And as Fizzle says, we cannot help with addons not designed to work on official servers. Lua Code:
__________________
Characters: Gwynedda - 70 - Demon Warlock Galaviel - 65 - Resto Druid Gamaliel - 61 - Disc Priest Gwynytha - 60 - Survival Hunter Lienae - 60 - Resto Shaman Plus several others below level 60 Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818 |
||
01-11-24, 03:24 PM | #5 | |
Wow thanks Xrystal!! this solution works but I don't know why (I'm a beginner addon developer :P)! You are very kind! Thanks a lot Fizzlemizz too for time and advice! Good community |
||
WoWInterface » Developer Discussions » Lua/XML Help » Put a clickable professoin link on a frame |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Hybrid Mode |
Switch to Threaded Mode |
|
|