Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-11-24, 01:10 PM   #9
Carriola
A Murloc Raider
Join Date: Jan 2024
Posts: 4
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.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Put a clickable professoin link on a frame


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