Shantalya
Welt-Boss
- Mitglied seit
- 18.07.2007
- Beiträge
- 1.781
- Reaktionspunkte
- 12
- Kommentare
- 93
- Buffs erhalten
- 29
Mein Vorschlag wäre:
Für Anfänger vielleicht etwas besser. :-o
Code:
local function OnClick(self)
DoEmote(self.emote);
end
local function OnEnter(self)
self:SetAlpha(0.5)
end
local function OnLeave(self)
self:SetAlpha(1)
end
local i = 0;
local function CreateEmoteButton(message, emote)
i = i+1;
local emoteButton = CreateFrame("Button", "EmoteBarButton"..i, Window);
emoteButton.emote = emote;
emoteButton:SetSize(40, 20);
emoteButton:SetBackdrop({ bgFile = "Interface\\Buttons\\WHITE8x8", edgeFile = "Interface\\Buttons\\WHITE8x8", edgeSize = 2 });
emoteButton:SetBackdropColor(0.54, 0, 0, 1);
emoteButton:SetBackdropBorderColor(0, 0, 0, 1);
emoteButton:SetFrameStrata("LOW");
emoteButton:EnableMouse(true);
emoteButton:SetScript("OnClick", OnClick);
emoteButton:SetScript("OnEnter", OnEnter);
emoteButton:SetScript("OnLeave", OnLeave);
local text = emoteButton:CreateFontString("$parentText", "ARTWORK");
emoteButton.text = text;
text:SetFont("Interface\\AddOns\\EmoteBar\\28 Days Later.ttf", 12, "OUTLINE");
text:SetPoint("CENTER");
text:SetText(message);
text:SetTextColor(1, 0.87, 0);
return emoteButton;
end
local emoteButton1 = CreateEmoteButton("/hi", "HELLO");
emoteButton1:SetPoint("CENTER", -50, 15);
local emoteButton2 = CreateEmoteButton("/ty", "THANK");
emoteButton2:SetPoint(... -- ect...
Zuletzt bearbeitet von einem Moderator: