Skip to content

Instantly share code, notes, and snippets.

@mwiemarc
Created November 5, 2019 22:12
Show Gist options
  • Save mwiemarc/f9b870030e2dd74870ff8194b4aa77ea to your computer and use it in GitHub Desktop.
Save mwiemarc/f9b870030e2dd74870ff8194b4aa77ea to your computer and use it in GitHub Desktop.
SAC = {}
SAC_AddonName = 'MyAddon'
local function ShowDialog()
local txt =
'Es ist kein Geheimnis, dass das Markenzeichen der Defiasbande ihre roten Kopftücher sind. Aber wir haben herausgefunden, dass das Material, aus dem diese Kopftücher gemacht sind, den Rang des Bandenmitglieds bezeichnet. Jetzt, wo wir das wissen, möchte ich, dass Ihr so viele hochrangige Mitglieder der Defias eliminiert, wie Ihr könnt. Die Bandenmitglieder mit der höchsten Position findet Ihr zweifellos in van Cleefs Geheimversteck. Wenn Ihr fertig seid, bringt mir 10 rote Seidenkopftücher zum Beweis, dass sie tot sind, dann werde ich Euch belohnen. Viel Glück, <Name>.'
local encoded = EncodeString(txt)
SAC.DialogFrame:Show()
SAC.DialogFrame.EditBox:SetText(encoded)
SAC.DialogFrame.EditBox:HighlightText(1, string.len(SAC.DialogFrame.EditBox:GetText()))
SAC.DialogFrame.EditBox:SetFocus(true)
end
local function CreateDialog()
SAC.DialogFrame = CreateFrame('Frame', SAC_AddonName .. 'DialogFrame')
SAC.DialogFrame:SetBackdrop(
{
bgFile = 'Interface\\DialogFrame\\UI-DialogBox-Background',
edgeFile = 'Interface\\DialogFrame\\UI-DialogBox-Border',
tile = 1,
tileSize = 32,
edgeSize = 32,
insets = {left = 11, right = 12, top = 12, bottom = 11}
}
)
SAC.DialogFrame:SetWidth(340)
SAC.DialogFrame:SetHeight(120)
SAC.DialogFrame:SetPoint('CENTER', UIParent)
SAC.DialogFrame:EnableMouse(true)
SAC.DialogFrame:SetFrameStrata('FULLSCREEN_DIALOG')
SAC.DialogFrame.EditBox = CreateFrame('EditBox', SAC.DialogFrame:GetName() .. 'InputEditBox', SAC.DialogFrame, 'InputBoxTemplate')
SAC.DialogFrame.EditBox:SetHeight(24)
SAC.DialogFrame.EditBox:SetWidth(SAC.DialogFrame:GetWidth() - 40)
SAC.DialogFrame.EditBox:SetPoint('TOP', SAC.DialogFrame, 'TOP', 2, -20)
SAC.DialogFrame.Button = CreateFrame('Button', SAC.DialogFrame:GetName() .. 'CloseButton', SAC.DialogFrame, 'UIPanelButtonTemplate')
SAC.DialogFrame.Button:SetHeight(24)
SAC.DialogFrame.Button:SetWidth(60)
SAC.DialogFrame.Button:SetPoint('BOTTOM', SAC.DialogFrame, 'BOTTOM', 0, 20)
SAC.DialogFrame.Button:SetText('Close')
SAC.DialogFrame.Button:SetScript(
'OnClick',
function(self)
self:GetParent():Hide()
end
)
SAC.DialogFrame:Hide()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment