From 67d3492147ba04ff6df2982b2910b8b777fa4656 Mon Sep 17 00:00:00 2001 From: Henning Bock Date: Wed, 31 Dec 2025 10:14:28 +0100 Subject: [PATCH] Funktionen aus Classic wieder eingebaut --- MoanS.lua | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/MoanS.lua b/MoanS.lua index 6ad09a7..2d1f838 100644 --- a/MoanS.lua +++ b/MoanS.lua @@ -26,16 +26,12 @@ if not amount or type(amount) ~= "number" then return amount or "0" end end local CounterFrame = CreateFrame("Frame", "MoanSCounterFrame", UIParent, "BackdropTemplate") - CounterFrame:SetSize(130, 40) - CounterFrame:SetPoint("CENTER", 0, 0) - CounterFrame:SetMovable(true) - CounterFrame:EnableMouse(true) - CounterFrame:RegisterForDrag("LeftButton") - CounterFrame:SetClampedToScreen(true) + CounterFrame:SetSize(130, 40); CounterFrame:SetPoint("CENTER", 0, 0); CounterFrame:SetMovable(true) + CounterFrame:EnableMouse(true); CounterFrame:RegisterForDrag("LeftButton"); CounterFrame:SetClampedToScreen(true) CounterFrame.bg = CounterFrame:CreateTexture(nil, "BACKGROUND") CounterFrame.bg:SetAllPoints(); CounterFrame.bg:SetColorTexture(0, 0, 0, 0.6) CounterFrame.Cooldown = CreateFrame("Cooldown", nil, CounterFrame, "CooldownFrameTemplate") - CounterFrame.Cooldown:SetAllPoints() + CounterFrame.Cooldown:SetAllPoints(); CounterFrame.Cooldown:SetSwipeColor(1, 0.41, 0.7, 0.5) CounterFrame.text = CounterFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge") CounterFrame.text:SetPoint("CENTER") @@ -72,7 +68,6 @@ if not amount or type(amount) ~= "number" then return amount or "0" end if (currentTime - lastSoundTime) > timeout or comboCount >= MAX_SOUNDS then comboCount = 1 else comboCount = comboCount + 1 end lastSoundTime = currentTime CounterFrame.Cooldown:SetCooldown(currentTime, timeout) - -- PFAD GEƄNDERT AUF MEDIA UNTERORDNER return "Interface\\AddOns\\MoanS\\media\\" .. (comboCount == MAX_SOUNDS and "moan10" or (MoanSDB.soundBaseName or "moan") .. comboCount) .. ".ogg" end @@ -93,11 +88,30 @@ if not amount or type(amount) ~= "number" then return amount or "0" end for k, v in pairs(defaults) do if MoanSDB[k] == nil then MoanSDB[k] = v end end category = Settings.RegisterCanvasLayoutCategory(MoanSPanel, addonName) Settings.RegisterAddOnCategory(category) + local title = MoanSPanel:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge") title:SetPoint("TOPLEFT", 16, -16); title:SetText("|cffFF69B4MoanS|r - Retail") + CreateCB(MoanSPanel, "Addon Aktiviert", 16, -50, "active") CreateCB(MoanSPanel, "Fenster anzeigen", 16, -80, "showCounter") CreateCB(MoanSPanel, "Fenster fixieren (Lock)", 16, -110, "locked") + + local slider = CreateFrame("Slider", "MoanSTimeoutSlider", MoanSPanel, "OptionsSliderTemplate") + slider:SetPoint("TOPLEFT", 20, -160); 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") + local sliderVal = slider:CreateFontString(nil, "ARTWORK", "GameFontHighlight") + sliderVal:SetPoint("BOTTOM", slider, "TOP", 0, 5) + slider:SetScript("OnValueChanged", function(s, val) + val = math.floor(val * 2 + 0.5) / 2 + MoanSDB.comboTimeout = val + sliderVal:SetText("Combo-Zeit: "..val.."s") + end) + slider:SetValue(MoanSDB.comboTimeout) + + local btnTest = CreateFrame("Button", nil, MoanSPanel, "UIPanelButtonTemplate") + btnTest:SetPoint("TOPLEFT", 16, -210); btnTest:SetSize(160, 25); btnTest:SetText("Feuerwerk Testen") + btnTest:SetScript("OnClick", function() PlaySoundFile(TriggerCombo(), "Master"); ShowCritText(math.random(100, 5000)) end) + if MoanSDB.framePos then CounterFrame:ClearAllPoints() CounterFrame:SetPoint(MoanSDB.framePos[1], UIParent, MoanSDB.framePos[2], MoanSDB.framePos[3], MoanSDB.framePos[4]) @@ -105,19 +119,13 @@ if not amount or type(amount) ~= "number" then return amount or "0" end UpdateCounterDisplay() elseif event == "COMBAT_LOG_EVENT_UNFILTERED" then if not MoanSDB or not MoanSDB.active then return end - local info = {CombatLogGetCurrentEventInfo()} - local sub, sGUID = info[2], info[4] + local _, sub, _, sGUID, _, _, _, _, _, _, _, arg12, _, _, _, arg15, _, arg17, arg18, _, arg21 = CombatLogGetCurrentEventInfo() if sGUID == UnitGUID("player") or sGUID == UnitGUID("pet") then local isCrit, amount = false, 0 - if sub == "SWING_DAMAGE" then amount, isCrit = info[12], info[18] - elseif sub:find("_DAMAGE") then amount, isCrit = info[15], info[21] - elseif sub == "SPELL_HEAL" then amount, isCrit = info[15], info[18] end - if isCrit then - PlaySoundFile(TriggerCombo(), "Master") - ShowCritText(amount) - MoanSDB.totalMoans = MoanSDB.totalMoans + 1 - UpdateCounterDisplay() - end + if sub == "SWING_DAMAGE" then amount, isCrit = arg12, arg17 + elseif sub:find("_DAMAGE") then amount, isCrit = arg15, arg21 + elseif sub == "SPELL_HEAL" then amount, isCrit = arg15, arg18 end + if isCrit then PlaySoundFile(TriggerCombo(), "Master"); ShowCritText(amount); MoanSDB.totalMoans = MoanSDB.totalMoans + 1; UpdateCounterDisplay() end end end end)