Bugfix
This commit is contained in:
61
MoanS.lua
61
MoanS.lua
@@ -24,18 +24,16 @@ frame:RegisterEvent("ADDON_LOADED")
|
|||||||
|
|
||||||
local lastSoundTime, comboCount = 0, 0
|
local lastSoundTime, comboCount = 0, 0
|
||||||
|
|
||||||
-- CHAOS-VISUAL FUNKTION (Zufällige Bilder)
|
-- CHAOS-VISUAL FUNKTION
|
||||||
local function TriggerComboVisual()
|
local function TriggerComboVisual()
|
||||||
if not MoanSDB or not MoanSDB.showImages then return end
|
if not MoanSDB or not MoanSDB.showImages then return end
|
||||||
|
|
||||||
local f = CreateFrame("Frame", nil, UIParent)
|
local f = CreateFrame("Frame", nil, UIParent)
|
||||||
|
local randomSize = math.random(300, 550)
|
||||||
-- Chaos-Faktor: Größe und Position
|
|
||||||
local randomSize = math.random(300, 500)
|
|
||||||
f:SetSize(randomSize, randomSize)
|
f:SetSize(randomSize, randomSize)
|
||||||
|
|
||||||
local randomX = math.random(-600, 600)
|
local randomX = math.random(-750, 750)
|
||||||
local randomY = math.random(-300, 400)
|
local randomY = math.random(-400, 500)
|
||||||
f:SetPoint("CENTER", randomX, randomY)
|
f:SetPoint("CENTER", randomX, randomY)
|
||||||
|
|
||||||
local tex = f:CreateTexture(nil, "OVERLAY")
|
local tex = f:CreateTexture(nil, "OVERLAY")
|
||||||
@@ -47,22 +45,15 @@ if not MoanSDB or not MoanSDB.showImages then return end
|
|||||||
|
|
||||||
local ag = f:CreateAnimationGroup()
|
local ag = f:CreateAnimationGroup()
|
||||||
local scale = ag:CreateAnimation("Scale")
|
local scale = ag:CreateAnimation("Scale")
|
||||||
scale:SetScale(1.4, 1.4)
|
scale:SetScale(1.4, 1.4); scale:SetDuration(0.15); scale:SetOrder(1)
|
||||||
scale:SetDuration(0.15)
|
|
||||||
scale:SetOrder(1)
|
|
||||||
|
|
||||||
local fade = ag:CreateAnimation("Alpha")
|
local fade = ag:CreateAnimation("Alpha")
|
||||||
fade:SetFromAlpha(1)
|
fade:SetFromAlpha(1); fade:SetToAlpha(0); fade:SetStartDelay(0.5); fade:SetDuration(0.6); fade:SetOrder(2)
|
||||||
fade:SetToAlpha(0)
|
|
||||||
fade:SetStartDelay(0.5)
|
|
||||||
fade:SetDuration(0.6)
|
|
||||||
fade:SetOrder(2)
|
|
||||||
|
|
||||||
ag:SetScript("OnFinished", function()
|
ag:SetScript("OnFinished", function()
|
||||||
f:Hide()
|
f:Hide()
|
||||||
f:SetParent(nil)
|
f:SetParent(nil)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
ag:Play()
|
ag:Play()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -90,10 +81,10 @@ if not MoanSDB or not MoanSDB.showImages then return end
|
|||||||
text:SetTextColor(isHighCombo and 0 or 1, isHighCombo and 1 or 0.41, isHighCombo and 0 or 0.7)
|
text:SetTextColor(isHighCombo and 0 or 1, isHighCombo and 1 or 0.41, isHighCombo and 0 or 0.7)
|
||||||
|
|
||||||
local ag = f:CreateAnimationGroup()
|
local ag = f:CreateAnimationGroup()
|
||||||
local tX, tY = math.random(-100, 100), math.random(60, 120)
|
local tX, tY = math.random(-120, 120), math.random(80, 150)
|
||||||
local s = ag:CreateAnimation("Scale"); s:SetScale(1.4, 1.4); s:SetDuration(0.1); s:SetOrder(1)
|
local s = ag:CreateAnimation("Scale"); s:SetScale(1.5, 1.5); s:SetDuration(0.15); s:SetOrder(1)
|
||||||
local t = ag:CreateAnimation("Translation"); t:SetOffset(tX, tY); t:SetDuration(1.2); t:SetSmoothing("OUT"); t:SetOrder(2)
|
local t = ag:CreateAnimation("Translation"); t:SetOffset(tX, tY); t:SetDuration(1.4); t:SetSmoothing("OUT"); t:SetOrder(2)
|
||||||
local a = ag:CreateAnimation("Alpha"); a:SetFromAlpha(1); a:SetToAlpha(0); a:SetStartDelay(0.6); a:SetDuration(0.6); a:SetOrder(2)
|
local a = ag:CreateAnimation("Alpha"); a:SetFromAlpha(1); a:SetToAlpha(0); a:SetStartDelay(0.7); a:SetDuration(0.7); a:SetOrder(2)
|
||||||
ag:SetScript("OnFinished", function() f:Hide() end); ag:Play()
|
ag:SetScript("OnFinished", function() f:Hide() end); ag:Play()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -119,18 +110,13 @@ if not MoanSDB or not MoanSDB.showImages then return end
|
|||||||
CounterFrame.Cooldown:SetCooldown(currentTime, timeout)
|
CounterFrame.Cooldown:SetCooldown(currentTime, timeout)
|
||||||
|
|
||||||
local soundIndex = comboCount % 10
|
local soundIndex = comboCount % 10
|
||||||
if soundIndex == 0 then
|
if soundIndex == 0 then soundIndex = 10; TriggerComboVisual() end
|
||||||
soundIndex = 10
|
|
||||||
TriggerComboVisual()
|
|
||||||
end
|
|
||||||
|
|
||||||
local sFile = (MoanSDB.soundBaseName or "moan") .. soundIndex .. ".ogg"
|
local sFile = (MoanSDB.soundBaseName or "moan") .. soundIndex .. ".ogg"
|
||||||
return "Interface\\AddOns\\MoanS\\media\\" .. sFile, comboCount, (comboCount >= 10)
|
return "Interface\\AddOns\\MoanS\\media\\" .. sFile, comboCount, (comboCount >= 10)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Menü-Panel für Classic
|
|
||||||
local MoanSPanel = CreateFrame("Frame", "MoanSConfigPanel", UIParent)
|
local MoanSPanel = CreateFrame("Frame", "MoanSConfigPanel", UIParent)
|
||||||
MoanSPanel.name = MOAN_NAME
|
local category
|
||||||
|
|
||||||
local function CreateCB(label, x, y, dbKey)
|
local function CreateCB(label, x, y, dbKey)
|
||||||
local cb = CreateFrame("CheckButton", nil, MoanSPanel, "InterfaceOptionsCheckButtonTemplate")
|
local cb = CreateFrame("CheckButton", nil, MoanSPanel, "InterfaceOptionsCheckButtonTemplate")
|
||||||
@@ -145,10 +131,11 @@ if not MoanSDB or not MoanSDB.showImages then return end
|
|||||||
if not MoanSDB then MoanSDB = CopyTable(defaults) end
|
if not MoanSDB then MoanSDB = CopyTable(defaults) end
|
||||||
for k, v in pairs(defaults) do if MoanSDB[k] == nil then MoanSDB[k] = v end end
|
for k, v in pairs(defaults) do if MoanSDB[k] == nil then MoanSDB[k] = v end end
|
||||||
|
|
||||||
InterfaceOptions_AddCategory(MoanSPanel)
|
category = Settings.RegisterCanvasLayoutCategory(MoanSPanel, MOAN_NAME)
|
||||||
|
Settings.RegisterAddOnCategory(category)
|
||||||
|
|
||||||
local title = MoanSPanel:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
|
local title = MoanSPanel:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
|
||||||
title:SetPoint("TOPLEFT", 16, -16); title:SetText(MOAN_NAME .. " - Classic")
|
title:SetPoint("TOPLEFT", 16, -16); title:SetText(MOAN_NAME .. " - Anniversary Edition")
|
||||||
|
|
||||||
CreateCB("Addon Aktiviert", 16, -50, "active")
|
CreateCB("Addon Aktiviert", 16, -50, "active")
|
||||||
CreateCB("Chat Nachrichten", 16, -80, "chat")
|
CreateCB("Chat Nachrichten", 16, -80, "chat")
|
||||||
@@ -158,6 +145,7 @@ if not MoanSDB or not MoanSDB.showImages then return end
|
|||||||
CreateCB("Pet Crits zählen", 16, -200, "petEnabled")
|
CreateCB("Pet Crits zählen", 16, -200, "petEnabled")
|
||||||
CreateCB("Heil-Crits zählen", 16, -230, "healEnabled")
|
CreateCB("Heil-Crits zählen", 16, -230, "healEnabled")
|
||||||
|
|
||||||
|
-- SLIDER HINZUGEFÜGT
|
||||||
local slider = CreateFrame("Slider", "MoanSTimeoutSlider", MoanSPanel, "OptionsSliderTemplate")
|
local slider = CreateFrame("Slider", "MoanSTimeoutSlider", MoanSPanel, "OptionsSliderTemplate")
|
||||||
slider:SetPoint("TOPLEFT", 20, -280); slider:SetMinMaxValues(0.5, 10.0); slider:SetValueStep(0.5); slider:SetWidth(180)
|
slider:SetPoint("TOPLEFT", 20, -280); slider:SetMinMaxValues(0.5, 10.0); slider:SetValueStep(0.5); slider:SetWidth(180)
|
||||||
_G[slider:GetName().."Low"]:SetText("0.5s"); _G[slider:GetName().."High"]:SetText("10s")
|
_G[slider:GetName().."Low"]:SetText("0.5s"); _G[slider:GetName().."High"]:SetText("10s")
|
||||||
@@ -170,6 +158,18 @@ if not MoanSDB or not MoanSDB.showImages then return end
|
|||||||
end)
|
end)
|
||||||
slider:SetValue(MoanSDB.comboTimeout)
|
slider:SetValue(MoanSDB.comboTimeout)
|
||||||
|
|
||||||
|
-- TEST-BUTTON HINZUGEFÜGT
|
||||||
|
local btnTest = CreateFrame("Button", nil, MoanSPanel, "UIPanelButtonTemplate")
|
||||||
|
btnTest:SetPoint("TOPLEFT", 16, -330); btnTest:SetSize(160, 25); btnTest:SetText("Combo Testen")
|
||||||
|
btnTest:SetScript("OnClick", function()
|
||||||
|
local sPath, cIdx, isHigh = GetNextSound()
|
||||||
|
PlaySoundFile(sPath, "Master"); ShowCritText(math.random(100,5000), isHigh)
|
||||||
|
if MoanSDB.chat then
|
||||||
|
local prefix = isHigh and (COMBO_COLOR .. "[ULTRA COMBO x" .. cIdx .. "]|r") or ("[Combo " .. cIdx .. "/9]")
|
||||||
|
print(MOAN_TEXT .. " " .. prefix)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
if MoanSDB.framePos then
|
if MoanSDB.framePos then
|
||||||
CounterFrame:ClearAllPoints(); CounterFrame:SetPoint(MoanSDB.framePos[1], UIParent, MoanSDB.framePos[2], MoanSDB.framePos[3], MoanSDB.framePos[4])
|
CounterFrame:ClearAllPoints(); CounterFrame:SetPoint(MoanSDB.framePos[1], UIParent, MoanSDB.framePos[2], MoanSDB.framePos[3], MoanSDB.framePos[4])
|
||||||
end
|
end
|
||||||
@@ -182,7 +182,6 @@ if not MoanSDB or not MoanSDB.showImages then return end
|
|||||||
if sub == "SWING_DAMAGE" then amount, isCrit = a12, a17
|
if sub == "SWING_DAMAGE" then amount, isCrit = a12, a17
|
||||||
elseif sub:find("_DAMAGE") then amount, isCrit = a15, a21
|
elseif sub:find("_DAMAGE") then amount, isCrit = a15, a21
|
||||||
elseif sub == "SPELL_HEAL" and MoanSDB.healEnabled then amount, isCrit = a15, a18 end
|
elseif sub == "SPELL_HEAL" and MoanSDB.healEnabled then amount, isCrit = a15, a18 end
|
||||||
|
|
||||||
if isCrit then
|
if isCrit then
|
||||||
local sPath, cIdx, isHigh = GetNextSound()
|
local sPath, cIdx, isHigh = GetNextSound()
|
||||||
PlaySoundFile(sPath, "Master"); ShowCritText(amount, isHigh)
|
PlaySoundFile(sPath, "Master"); ShowCritText(amount, isHigh)
|
||||||
@@ -197,4 +196,6 @@ if not MoanSDB or not MoanSDB.showImages then return end
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
SLASH_MOANS1 = "/moans"
|
SLASH_MOANS1 = "/moans"
|
||||||
SlashCmdList["MOANS"] = function() InterfaceOptionsFrame_OpenToCategory(MoanSPanel); InterfaceOptionsFrame_OpenToCategory(MoanSPanel) end
|
SlashCmdList["MOANS"] = function()
|
||||||
|
if category and category.GetID then Settings.OpenToCategory(category:GetID()) end
|
||||||
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user