BLU | Better Level Up!

BLU | Better Level Up!

23.7k Downloads

Reputation rank-up sound playing for every rep gain.. and not just for rep rank upgrade..

MelchiorGaspar opened this issue ยท 11 comments

commented

this is happening on CATA-classic so far. and maybe others too..
using BLU (v4.6.1) now.

commented

Thanks, I'm working to replicate and fix this as we speak.

commented

it seems to be happening when I use the Shining Force 2 sound.
so not sure why but its lv3 sound loudness.

commented

its not happening when I use the default sound I think...

commented

I just got a quest that gave me some rep and it may still have played the default sound too.. not sure..

commented

will not have time to fix this before work, but I'm very close.

commented

ooh ok np..
I will set it too default for now for that sound...
What kind of work do you do? :D ^_^
if its ok if I ask.

commented

ok have a good work shift.. ^_^

commented

I just pushed v4.6.2, with more extensive debugging and hopefully a fix for the reputation tracking issue.

Basically to eliminate any issues with loops, I've extrapolated and hard-coded the string parses.

I'm pretty sure I was just using the wrong register event though.. however, this is more solid code imo.

-- ChatFrame Hooks
--=====================================================================================
function BLU:ReputationChatFrameHook()
    if not chatFrameHooked then
        ChatFrame_AddMessageEventFilter("CHAT_MSG_COMBAT_FACTION_CHANGE", function(_, _, msg)
            -- Debugging: Print the incoming message for analysis
            BLU:DebugMessage("|cffffff00Incoming chat message:|r " .. msg)

            -- Check for rank in the message and trigger the appropriate sound
            local rankFound = false
            if string.match(msg, "You are now Exalted with") then
                BLU:DebugMessage("|cff00ff00Rank found: Exalted|r")
                BLU:ReputationRankIncrease("Exalted")
                rankFound = true
            elseif string.match(msg, "You are now Revered with") then
                BLU:DebugMessage("|cff00ff00Rank found: Revered|r")
                BLU:ReputationRankIncrease("Revered")
                rankFound = true
            elseif string.match(msg, "You are now Honored with") then
                BLU:DebugMessage("|cff00ff00Rank found: Honored|r")
                BLU:ReputationRankIncrease("Honored")
                rankFound = true
            elseif string.match(msg, "You are now Friendly with") then
                BLU:DebugMessage("|cff00ff00Rank found: Friendly|r")
                BLU:ReputationRankIncrease("Friendly")
                rankFound = true
            elseif string.match(msg, "You are now Neutral with") then
                BLU:DebugMessage("|cff00ff00Rank found: Neutral|r")
                BLU:ReputationRankIncrease("Neutral")
                rankFound = true
            elseif string.match(msg, "You are now Unfriendly with") then
                BLU:DebugMessage("|cff00ff00Rank found: Unfriendly|r")
                BLU:ReputationRankIncrease("Unfriendly")
                rankFound = true
            elseif string.match(msg, "You are now Hostile with") then
                BLU:DebugMessage("|cff00ff00Rank found: Hostile|r")
                BLU:ReputationRankIncrease("Hostile")
                rankFound = true
            elseif string.match(msg, "You are now Hated with") then
                BLU:DebugMessage("|cff00ff00Rank found: Hated|r")
                BLU:ReputationRankIncrease("Hated")
                rankFound = true
            end

            if not rankFound then
                -- If no rank is found, output a debug message
                BLU:PrintDebugMessage("NO_RANK_FOUND")
            end

            -- Ensure the original message is not blocked
            return false
        end)
        chatFrameHooked = true
    end
end```

commented

I got a bit of work to do.. adding debug mode really.... complicated things... but.. I'm having so much fun getting all the colors and text right... I'm probably going to move most localization for debug messages to its own lua file.

commented

ty so much.
I just grabbed the updates.. (classic, CATA-classic, retail)
I will give it a try now...
plus I have not been getting rep from every quest oddly enough.
possibly only at the end of a quest chain... what a bother.

commented

it seems to be working in CATA-classic correctly now.. ty.
I hope.. lol..