diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ff51a8..a0da7f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The in-game **What's New** page (`/eui whatsnew`) shows the highlights of each v ## [Unreleased] +### General + +#### New + +- Fishing's Only the splash turns every other sound off while fishing: music, ambience, dialog, emote, pet and ping sounds. The sound effects with the splash stay on, and your own settings come back when fishing mode ends. + ## [0.7.3005] - 2026-11-18 ### Setup and profiles diff --git a/EldoUI/CHANGELOG.md b/EldoUI/CHANGELOG.md index 9ff51a8..a0da7f3 100644 --- a/EldoUI/CHANGELOG.md +++ b/EldoUI/CHANGELOG.md @@ -6,6 +6,12 @@ The in-game **What's New** page (`/eui whatsnew`) shows the highlights of each v ## [Unreleased] +### General + +#### New + +- Fishing's Only the splash turns every other sound off while fishing: music, ambience, dialog, emote, pet and ping sounds. The sound effects with the splash stay on, and your own settings come back when fishing mode ends. + ## [0.7.3005] - 2026-11-18 ### Setup and profiles diff --git a/EldoUI/Modules/Fishing.lua b/EldoUI/Modules/Fishing.lua index 10ff000..64ad94b 100644 --- a/EldoUI/Modules/Fishing.lua +++ b/EldoUI/Modules/Fishing.lua @@ -13,7 +13,8 @@ -- use your best lure, then the pole), Swap (equip your pole, or put your -- weapons back: one equip press) and the catch count. Optional: a double -- right-click casts (fishing mode only, out of combat), a louder splash --- (sound channels raised through E:SetCVar and put back after), and the +-- (sound channels raised through E:SetCVar and put back after), only the +-- splash (every sound channel but the effects off while fishing), and the -- catch log: fish and items per zone and spot, catches per hour, skill-ups. -- With "Start a Farming session" a Farming session runs while you fish -- (Farming counts the loot itself). @@ -52,6 +53,7 @@ local M = E:NewModule("Fishing", { soundBoost = true, boostLevel = 1, dimOthers = true, -- music and ambience down while fishing + onlySplash = false, -- every sound channel but the effects off while fishing bar = true, autoHide = true, -- the bar only shows in fishing mode catchLog = true, @@ -207,11 +209,19 @@ end -- keep: "up" never lowers the player's own value, "down" never raises it. -- The player's own value is the one saved before fishing changed it. +-- A setting that already has the value gets no record (nothing to put +-- back), and a secure one is left alone (the game refuses the write). +local function SameValue(a, b) + local x, y = tonumber(a), tonumber(b) + if x and y then return x == y end + return a == b +end + local function SetFishingCVar(name, value, keep) + if E:CVarSecure(name) then return end local saved = Saved() local current = C_CVar and C_CVar.GetCVar and Clean(Try(C_CVar.GetCVar, name)) if current == nil then return end - if saved and saved[name] == nil then saved[name] = current end local own = tonumber(saved and saved[name] or current) local want = tonumber(value) if own and want then @@ -219,6 +229,8 @@ local function SetFishingCVar(name, value, keep) if keep == "down" and own < want then want = own end value = tostring(want) end + if not (saved and saved[name] ~= nil) and SameValue(current, value) then return end + if saved and saved[name] == nil then saved[name] = current end E:SetCVar(name, value, CVAR_OWNER) end @@ -252,6 +264,28 @@ function M:RaiseSoftInteract() end end +-- "Only the splash": while fishing every sound channel but the effects goes +-- off. The splash is a sound effect, as are spells, creatures and +-- footsteps, and the game turns effects up or down only all together, so +-- the effects stay on: sound and effects even come on when the player had +-- them off, and sound in the background too, so the splash is heard with +-- the game window behind another. FishMate (WoW: Forever) quiets music, +-- ambience, dialog and pet sounds the same way and the splash still +-- plays. A setting this client lacks is skipped (ping sounds came with +-- the Mainline audio settings; a client without them has no such CVar). +M.ONLY_SPLASH = { + { name = "Sound_EnableAllSound", value = "1", keep = "up" }, + { name = "Sound_EnableSFX", value = "1", keep = "up" }, + { name = "Sound_EnableSoundWhenGameIsInBG", value = "1", keep = "up" }, + { name = "Sound_EnableMusic", value = "0", keep = "down" }, + { name = "Sound_EnableAmbience", value = "0", keep = "down" }, + { name = "Sound_EnableDialog", value = "0", keep = "down" }, + { name = "Sound_EnableErrorSpeech", value = "0", keep = "down" }, + { name = "Sound_EnableEmoteSounds", value = "0", keep = "down" }, + { name = "Sound_EnablePetSounds", value = "0", keep = "down" }, + { name = "Sound_EnablePingSounds", value = "0", keep = "down" }, +} + -- Before soft interact was raised here, a SoftTargetInteract record of -- fishing's came only from an older version's write the game refused: it -- holds nothing to put back, so it is dropped once. @@ -276,6 +310,9 @@ function M:ApplyCVars(on) SetFishingCVar("Sound_MusicVolume", "0.1", "down") SetFishingCVar("Sound_AmbienceVolume", "0.1", "down") end + if self.db.onlySplash then + for _, cvar in ipairs(self.ONLY_SPLASH) do SetFishingCVar(cvar.name, cvar.value, cvar.keep) end + end self.cvarsOn = true return end @@ -1003,6 +1040,7 @@ M.options = { { type = "toggle", key = "soundBoost", label = "Louder splash", desc = "Raises the sound effects and master volume while fishing, and puts your own values back when fishing mode ends." }, { type = "range", percent = true, key = "boostLevel", label = "Volume while fishing", min = 0.3, max = 1, step = 0.05, dependsOn = "soundBoost", desc = "Sound effects and master volume while fishing mode is on." }, { type = "toggle", key = "dimOthers", label = "Quieter music", dependsOn = "soundBoost", desc = "Turns music and ambience down while fishing, so the splash stands out." }, + { type = "toggle", key = "onlySplash", label = "Only the splash", desc = "Turns every other sound off while fishing: music, ambience, dialog, spoken errors, emote, pet and ping sounds. The sound effects stay on, since the splash is one of them; the game switches effects only all together, so spells, creatures and footsteps stay too. Sound in the background goes on, so you hear the splash with the game window behind another. Your own settings come back when fishing mode ends." }, { type = "header", label = "Bar and log" }, { type = "toggle", key = "bar", label = "Fishing bar", desc = "Cast, Lure and Swap buttons with the catch count. Move it in move mode (Fishing Bar)." }, { type = "toggle", key = "autoHide", label = "Only in fishing mode", dependsOn = "bar", desc = "The bar shows only while fishing mode is on." }, diff --git a/EldoUI_Locale_deDE/Fork.lua b/EldoUI_Locale_deDE/Fork.lua index 35d3d49..3efabb8 100644 --- a/EldoUI_Locale_deDE/Fork.lua +++ b/EldoUI_Locale_deDE/Fork.lua @@ -98,6 +98,7 @@ E:RegisterLocale("deDE", function() return { ["Nothing to offer: the rest is needed or kept, has no vendor price, or is food, a reagent, ammo or the like."] = "Nichts anzubieten: Der Rest wird gebraucht oder behalten, hat keinen Händlerpreis oder ist Essen, ein Reagenz, Munition oder Ähnliches.", ["Officer note"] = "Offiziersnotiz", ["One chat line, only for you, when one of your world buffs has this many minutes left."] = "Eine Chatzeile, nur für Euch, wenn einer Eurer Weltbuffs nur noch so viele Minuten hat.", + ["Only the splash"] = "Nur das Platschen", ["Opens keybind mode with every button of the bar shown: hover one, press a key, then click Save. The first button holds the first quest item in your bags, and so on."] = "Öffnet den Tastenbelegungsmodus mit allen Plätzen der Leiste: Zeigt auf einen, drückt eine Taste und klickt dann auf „Speichern“. Der erste Platz hält den ersten Questgegenstand in Euren Taschen, und so weiter.", ["Plays the signal now."] = "Spielt das Signal jetzt ab.", ["Profile %s switched off: %s. Blizzard's own versions come fully back after a reload."] = "Profil %s hat ausgeschaltet: %s. Blizzards eigene Versionen kehren nach einem Neuladen vollständig zurück.", @@ -146,6 +147,7 @@ E:RegisterLocale("deDE", function() return { ["Toy box"] = "Spielzeugkiste", ["Turn action bars 2 to 8 on or off as in the snapshot (Options > Action Bars). They show after a reload."] = "Die Aktionsleisten 2 bis 8 ein- oder ausschalten wie im Schnappschuss (Optionen > Aktionsleisten). Sie erscheinen nach einem Neuladen.", ["Turn on the Quest Item Bar first."] = "Schaltet zuerst die Questgegenstandsleiste ein.", + ["Turns every other sound off while fishing: music, ambience, dialog, spoken errors, emote, pet and ping sounds. The sound effects stay on, since the splash is one of them; the game switches effects only all together, so spells, creatures and footsteps stay too. Sound in the background goes on, so you hear the splash with the game window behind another. Your own settings come back when fishing mode ends."] = "Schaltet beim Angeln jeden anderen Ton aus: Musik, Umgebungsgeräusche, Dialoge, gesprochene Fehlermeldungen, Emote-, Haustier- und Ping-Geräusche. Die Soundeffekte bleiben an, denn das Platschen ist einer davon; das Spiel schaltet Effekte nur alle zusammen, also bleiben auch Zauber, Kreaturen und Schritte hörbar. Ton im Hintergrund wird eingeschaltet, damit Ihr das Platschen auch hört, wenn das Spielfenster hinter einem anderen liegt. Eure eigenen Einstellungen kommen zurück, wenn der Angelmodus endet.", ["Type a name first."] = "Gebt zuerst einen Namen ein.", ["Uses the game's equipment sets from the character window. Every swap happens out of combat."] = "Verwendet die Ausrüstungssets des Spiels aus dem Charakterfenster. Jeder Wechsel geschieht außerhalb des Kampfes.", ["Warn before one runs out"] = "Warnen, bevor einer ausläuft", diff --git a/tools/ci/check_all.sh b/tools/ci/check_all.sh index b98c3aa..e005080 100755 --- a/tools/ci/check_all.sh +++ b/tools/ci/check_all.sh @@ -92,7 +92,7 @@ check_tests() { lua5.1 tools/groupframes/test_cast.lua || bad+=("$name") name="World buffs"; step "$name" lua5.1 tools/worldbuffs/test_world_buffs.lua || bad+=("$name") - name="Fishing: soft interact reaches the bobber, catches from LOOT_READY"; step "$name" + name="Fishing: soft interact reaches the bobber, only the splash, catches from LOOT_READY"; step "$name" lua5.1 tools/fishing/test_fishing.lua || bad+=("$name") name="RestedXP on a client in another language: target names, guide chain, group names"; step "$name" lua5.1 tools/integrations/test_rxp_locale.lua || bad+=("$name") diff --git a/tools/fishing/test_fishing.lua b/tools/fishing/test_fishing.lua index 509b2c4..97fd634 100644 --- a/tools/fishing/test_fishing.lua +++ b/tools/fishing/test_fishing.lua @@ -1,5 +1,5 @@ --- Offline test for the Fishing module: soft interact while fishing and the --- catch log. +-- Offline test for the Fishing module: soft interact while fishing, Only +-- the splash and the catch log. -- Run from the repository root: -- lua5.1 tools/fishing/test_fishing.lua -- Seen in the game (15.11.2026, WoW: Forever 1.60.1): @@ -21,7 +21,12 @@ -- loots the bobber" off nothing changes; a secure SoftTargetInteract is left -- alone (the options then show the chat command), the other two still rise; -- an older version's stale record is dropped once, while a reload during --- fishing still puts the player's values back. Catches count from +-- fishing still puts the player's values back. Only the splash turns +-- music, ambience, dialog, emote and pet sounds off and sound in the +-- background on, keeps sound and effects on (and turns them on for a +-- player who keeps them off), skips a setting the client lacks or +-- protects, follows the option at once while fishing and puts every +-- switch back after (also after a reload). Catches count from -- LOOT_READY, once per loot (a second LOOT_READY and a LOOT_OPENED after it -- add nothing), from LOOT_OPENED alone too, not before the loot has a slot, -- never for loot that isn't fishing loot, and again after the next cast @@ -65,6 +70,10 @@ local function NewWorld(cvars, secure) cvars = { SoftTargetInteract = "1", SoftTargetInteractRange = "10", SoftTargetInteractArc = "0", Sound_SFXVolume = "0.6", Sound_MasterVolume = "0.8", Sound_MusicVolume = "0.4", Sound_AmbienceVolume = "0.5", + -- The sound switches (this client has no Sound_EnablePingSounds). + Sound_EnableAllSound = "1", Sound_EnableSFX = "1", Sound_EnableSoundWhenGameIsInBG = "0", + Sound_EnableMusic = "1", Sound_EnableAmbience = "1", Sound_EnableDialog = "1", + Sound_EnableErrorSpeech = "0", Sound_EnableEmoteSounds = "1", Sound_EnablePetSounds = "1", }, secure = secure or {}, loot = nil, -- { fishing = bool, links = { ... } } while a loot is open @@ -311,6 +320,95 @@ do Check(next(private.Fishing.cvars) == nil, "no record left after the reload") end +--------------------------------------------------------------------------- +-- Only the splash: every sound channel but the effects off while fishing +--------------------------------------------------------------------------- +local SWITCHES = { "Sound_EnableAllSound", "Sound_EnableSFX", "Sound_EnableSoundWhenGameIsInBG", "Sound_EnableMusic", + "Sound_EnableAmbience", "Sound_EnableDialog", "Sound_EnableErrorSpeech", "Sound_EnableEmoteSounds", "Sound_EnablePetSounds" } + +local function Switches() + local parts = {} + for _, name in ipairs(SWITCHES) do parts[#parts + 1] = world.cvars[name] end + return table.concat(parts) +end + +do + -- Off (the default): fishing leaves the switches alone. + NewWorld() + local _, M = Start() + FishingOn(M) + Check(Switches() == "110111011", "with the option off the switches stay: " .. Switches()) + FishingOff(M) +end + +do + -- On: music, ambience, dialog, emote and pet sounds off, sound in the + -- background on; sound and effects stay on and get no record. + NewWorld() + local _, M, private = Start({ onlySplash = true }) + FishingOn(M) + Check(Switches() == "111000000", "only the effects stay on while fishing: " .. Switches()) + local cvars = private.Fishing.cvars + Check(cvars.Sound_EnableAllSound == nil and cvars.Sound_EnableSFX == nil and cvars.Sound_EnableErrorSpeech == nil, + "no record for a switch that already had its value") + Check(world.cvars.Sound_EnablePingSounds == nil, "a setting this client lacks is not made up") + Check(world.cvars.Sound_SFXVolume == "1", "the louder splash still works with it") + Check(#world.warnings == 0, "no warning: " .. tostring(world.warnings[1])) + FishingOff(M) + Check(Switches() == "110111011", "fishing mode off: the player's own switches are back: " .. Switches()) + Check(next(private.Fishing.cvars) == nil, "no fishing record is left") + Check(next(EldoUIDB.cvarSnapshot or {}) == nil, "no snapshot entry is left") +end + +do + -- The player keeps all sound off: fishing turns sound and effects on + -- for the splash, and off again after. + NewWorld({ Sound_EnableAllSound = "0", Sound_EnableSFX = "0" }) + local _, M = Start({ onlySplash = true, soundBoost = false }) + FishingOn(M) + Check(Switches() == "111000000", "sound and effects come on for the splash: " .. Switches()) + Check(world.cvars.Sound_SFXVolume == "0.6", "without Louder splash the volume stays the player's") + FishingOff(M) + Check(Switches() == "000111011", "and go off again after: " .. Switches()) +end + +do + -- Turned on and off while fishing: at once, and back after. + NewWorld() + local _, M = Start() + FishingOn(M) + M.db.onlySplash = true + M:OnProfileChanged() + Check(Switches() == "111000000", "option on while fishing: the other sound goes off: " .. Switches()) + M.db.onlySplash = false + M:OnProfileChanged() + Check(Switches() == "110111011", "option off while fishing: the switches are back: " .. Switches()) + FishingOff(M) +end + +do + -- A reload while fishing: the player's switches come back. + NewWorld() + local _, M, private = Start({ onlySplash = true }) + FishingOn(M) + M.fishingMode, M.toggled = false, false + M:OnEnable() + Check(Switches() == "110111011", "after a reload during fishing the switches are back: " .. Switches()) + Check(next(private.Fishing.cvars) == nil, "no record left after the reload") +end + +do + -- A secure switch is left alone and gets no record. + NewWorld(nil, { Sound_EnableMusic = true }) + local _, M, private = Start({ onlySplash = true }) + FishingOn(M) + Check(world.cvars.Sound_EnableMusic == "1" and private.Fishing.cvars.Sound_EnableMusic == nil, "a secure switch stays") + Check(world.cvars.Sound_EnableAmbience == "0", "the others still go off") + Check(#world.warnings == 0, "fishing doesn't even try the secure switch: " .. tostring(world.warnings[1])) + FishingOff(M) + Check(Switches() == "110111011", "values back: " .. Switches()) +end + --------------------------------------------------------------------------- -- Catch log --------------------------------------------------------------------------- @@ -398,6 +496,7 @@ do end Check(DEFAULT_DB and DEFAULT_DB.interact == true, "the option is on by default") +Check(DEFAULT_DB and DEFAULT_DB.onlySplash == false, "Only the splash is off by default") print(("%d passed, %d failed"):format(passed, failures)) if failures > 0 then os.exit(1) end