Skip to content

Commit

Permalink
v5.2.0-alpha.1
Browse files Browse the repository at this point in the history
- Fixed - Version numbers in all TOC files - [BLU.toc, BLU_Cata.toc, BLU_Vanilla.toc]
- Fixed - Debug output for missing localization - [localization.lua]
- Updated - Event registration for pet level-ups and shared events - [core.lua, initialization.lua]
- Updated - Delve Companion level-up detection using chat messages - [core.lua, initialization.lua]
- Updated - Removed redundant pet level-up logic - [core.lua, utils.lua]
- Removed - Disabled Battle Pet level-up sound options - [core.lua, options.lua, utils.lua]
- Removed - Sound throttling for reputation events - [core.lua]
- Added - New debug messages for reputation and Delve level-ups - [localization.lua]
  • Loading branch information
donniedice committed Oct 1, 2024
2 parents 61b63ad + d707c0b commit 5152810
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 41 deletions.
11 changes: 5 additions & 6 deletions data/initialization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function BLU:GetGameVersion()
elseif interfaceVersion >= 100000 then
return "retail"
else
self:PrintDebugMessage(BLU_L["ERROR_UNKNOWN_GAME_VERSION"])
self:PrintDebugMessage("ERROR_UNKNOWN_GAME_VERSION")
return "unknown"
end
end
Expand Down Expand Up @@ -120,7 +120,7 @@ function BLU:InitializeOptions()
local version = self:GetGameVersion()

if not self.options or not self.options.args then
self:PrintDebugMessage(BLU_L["ERROR_OPTIONS_NOT_INITIALIZED"])
self:PrintDebugMessage("ERROR_OPTIONS_NOT_INITIALIZED")
return
end

Expand All @@ -136,7 +136,7 @@ function BLU:InitializeOptions()
if self:IsGroupCompatibleWithVersion(group, version) then
table.insert(self.sortedOptions, group)
else
self:PrintDebugMessage(string.format(BLU_L["SKIPPING_GROUP_NOT_COMPATIBLE"], group.name or "Unnamed Group"))
self:PrintDebugMessage("SKIPPING_GROUP_NOT_COMPATIBLE")
end
end

Expand All @@ -151,16 +151,15 @@ function BLU:InitializeOptions()
ACD:AddToBlizOptions("BLU_Profiles", BLU_L["PROFILES_TITLE"], BLU_L["OPTIONS_LIST_MENU_TITLE"])

self.optionsRegistered = true
self:PrintDebugMessage(BLU_L["OPTIONS_REGISTERED"])
else
self:PrintDebugMessage(BLU_L["OPTIONS_ALREADY_REGISTERED"])
self:PrintDebugMessage("OPTIONS_ALREADY_REGISTERED")
end
end

function BLU:IsGroupCompatibleWithVersion(group, version)
if version == "retail" then
return true
elseif version == "cata" and (group.name:match("Honor Rank%-Up!") or group.name:match("Battle Pet Level%-Up!") or
elseif version == "cata" and (group.name:match("Honor Rank%-Up!") or --these have to match localization - this needs to be worked around
group.name:match("Delve Companion Level%-Up!") or group.name:match("Renown Rank%-Up!") or
group.name:match("Post%-Sound Select")) then
return false
Expand Down
70 changes: 35 additions & 35 deletions data/localization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ BLU_L = {

-- BLU:OnInitialize()
WELCOME_MESSAGE = string.format("Welcome! Use %s/blu|r to open the options panel or %s/blu help|r for more commands.", colors.prefix, colors.prefix),
VERSION = string.format("%sVersion: %%s|r", colors.info), -- %%s for placeholder
VERSION = string.format("%sVersion: %s|r", "|cffffff00", "|cff8080ff%s|r"),

-- BLU:InitializeOptions()
ERROR_OPTIONS_NOT_INITIALIZED = string.format("%sOptions not initialized properly.|r", colors.error),
SKIPPING_GROUP_NOT_COMPATIBLE = string.format("%sIncompatible or Unnamed Options Group|r", colors.error),
SKIPPING_GROUP_NOT_COMPATIBLE = string.format("Incompatible or Unnamed Options Group", colors.error),
OPTIONS_LIST_MENU_TITLE = string.format("|Tinterface/addons/blu/images/icon:16:16|t - %sB|r%setter %sL|r%sevel-%sU|r%sp!",
colors.prefix, colors.white, colors.prefix, colors.white, colors.prefix, colors.white),
OPTIONS_ALREADY_REGISTERED = string.format("%sOptions already registered.|r", colors.info),
OPTIONS_ALREADY_REGISTERED = "Options already registered.",

-- =====================================================================================
-- Localization for utils.lua
-- =====================================================================================

-- BLU:ProcessEventQueue()
ERROR_SOUND_NOT_FOUND = string.format("%sSound not found for sound ID: %%s.|r", colors.error),
INVALID_VOLUME_LEVEL = string.format("%sInvalid volume level: %%d.|r", colors.error),
ERROR_SOUND_NOT_FOUND = string.format("%sSound not found for sound ID: %%s.|r", colors.error, colors.highlight),
INVALID_VOLUME_LEVEL = string.format("%sInvalid volume level: %%d.|r", colors.error, colors.highlight),

-- BLU:HaltOperations()
COUNTDOWN_TICK = string.format("%sCountdown: %s%%d%s seconds remaining.|r", colors.info, colors.highlight, colors.info),
Expand All @@ -86,24 +86,24 @@ BLU_L = {
UNKNOWN_SLASH_COMMAND = string.format("Unknown slash command: %%s.|r", colors.highlight),

-- BLU:DisplayBLUHelp()
HELP_COMMAND = string.format("%sAvailable commands:|r", colors.info),
HELP_DEBUG = string.format(" %s/blu debug|r - Toggle debug mode.", colors.prefix),
HELP_WELCOME = string.format(" %s/blu welcome|r - Toggles the welcome message on/off.", colors.prefix),
HELP_PANEL = string.format(" %s/blu|r - Open the options panel.", colors.prefix),
HELP_COMMAND = string.format("%sAvailable commands:", "|cffffff00"),
HELP_DEBUG = " " .. colors.prefix .. "/blu debug|r - Toggle debug mode.",
HELP_WELCOME = " " .. colors.prefix .. "/blu welcome|r - Toggles the welcome message on/off.",
HELP_PANEL = " " .. colors.prefix .. "/blu|r - Open the options panel.",

-- BLU:ToggleDebugMode()
DEBUG_MODE_ENABLED = string.format("%sDebug Mode Enabled|r", colors.success),
DEBUG_MODE_DISABLED = string.format("%sDebug Mode Disabled|r", colors.error),
DEBUG_MODE_TOGGLED = string.format("Debug mode toggled: %s%%s|r.", colors.highlight),

-- BLU:ToggleWelcomeMessage()
WELCOME_MSG_ENABLED = string.format("Welcome message %senabled|r.", colors.success),
WELCOME_MSG_DISABLED = string.format("Welcome message %sdisabled|r.", colors.error),
SHOW_WELCOME_MESSAGE_TOGGLED = string.format("Welcome message toggled: %s%%s|r.", colors.highlight),
CURRENT_DB_SETTING = string.format("Current DB setting: %%s.|r", colors.info),

-- BLU:RandomSoundID()
SELECTING_RANDOM_SOUND = string.format("Selecting Random %sSoundID|r", colors.highlight),
SELECTING_RANDOM_SOUND = string.format("Selecting Random %sSoundID", colors.highlight),
NO_VALID_SOUND_IDS = string.format("%sNo valid sound IDs found.|r", colors.error),
RANDOM_SOUND_ID_SELECTED = string.format("Random sound ID selected: %%s.|r", colors.highlight),

Expand All @@ -113,76 +113,76 @@ BLU_L = {
USING_SPECIFIED_SOUND_ID = string.format("Using specified sound ID: %%s.|r", colors.highlight),

-- PlaySelectedSound()
PLAYING_SOUND = string.format("Playing sound with ID: %%s and volume level: %%d.|r", colors.highlight),
PLAYING_SOUND = string.format("Playing sound with ID: %%s and volume level: %%d.|r", colors.highlight, colors.highlight),
VOLUME_LEVEL_ZERO = string.format("%sVolume level is %s0|r, sound not played.|r", colors.error, colors.highlight),
SOUND_FILE_TO_PLAY = string.format("Sound file to play: %%s.|r", colors.sound),

-- =====================================================================================
-- Localization for core.lua
-- =====================================================================================

-- BLU:HandlePlayerLevelUp()
PLAYER_LEVEL_UP_TRIGGERED = string.format("%sPLAYER_LEVEL_UP|r triggered for PetID: %%s | Species: %%s | Level: %%s|r", colors.info),
PLAYER_LEVEL_UP_TRIGGERED = string.format("%sPLAYER_LEVEL_UP|r %striggered.|r", colors.info, colors.test),

-- BLU:HandleQuestAccepted()
QUEST_ACCEPTED_TRIGGERED = string.format("%sQUEST_ACCEPTED|r triggered for PetID: %%s | Species: %%s | Level: %%s|r", colors.info),
QUEST_ACCEPTED_TRIGGERED = string.format("%sQUEST_ACCEPTED|r %striggered.|r", colors.info, colors.test),

-- BLU:HandleQuestTurnedIn()
QUEST_TURNED_IN_TRIGGERED = string.format("%sQUEST_TURNED_IN|r triggered for PetID: %%s | Species: %%s | Level: %%s|r", colors.info),
QUEST_TURNED_IN_TRIGGERED = string.format("%sQUEST_TURNED_IN|r %striggered.|r", colors.info, colors.test),

-- BLU:HandleAchievementEarned()
ACHIEVEMENT_EARNED_TRIGGERED = string.format("%sACHIEVEMENT_EARNED|r triggered for PetID: %%s | Species: %%s | Level: %%s|r", colors.info),
ACHIEVEMENT_EARNED_TRIGGERED = string.format("%sACHIEVEMENT_EARNED|r %striggered.|r", colors.info, colors.test),

-- BLU:HandleHonorLevelUpdate()
HONOR_LEVEL_UPDATE_TRIGGERED = string.format("%sHONOR_LEVEL_UPDATE|r triggered for PetID: %%s | Species: %%s | Level: %%s|r", colors.info),
HONOR_LEVEL_UPDATE_TRIGGERED = string.format("%sHONOR_LEVEL_UPDATE|r %striggered.|r", colors.info, colors.test),

-- BLU:HandleRenownLevelChanged()
MAJOR_FACTION_RENOWN_LEVEL_CHANGED_TRIGGERED = string.format("%sMAJOR_FACTION_RENOWN_LEVEL_CHANGED|r triggered for PetID: %%s | Species: %%s | Level: %%s|r", colors.info),
MAJOR_FACTION_RENOWN_LEVEL_CHANGED_TRIGGERED = string.format("%sMAJOR_FACTION_RENOWN_LEVEL_CHANGED|r %striggered.|r", colors.info, colors.test),

-- BLU:HandlePerksActivityCompleted()
PERKS_ACTIVITY_COMPLETED_TRIGGERED = string.format("%sPERKS_ACTIVITY_COMPLETED|r triggered for PetID: %%s | Species: %%s | Level: %%s|r", colors.info),
PERKS_ACTIVITY_COMPLETED_TRIGGERED = string.format("%sPERKS_ACTIVITY_COMPLETED|r %striggered.|r", colors.info, colors.test),

-- =====================================================================================
-- =====================================================================================

-- BLU:TestAchievementSound()
TEST_ACHIEVEMENT_SOUND = string.format("%sTestAchievementSound|r triggered.|r", colors.info),
TEST_ACHIEVEMENT_SOUND = string.format("%sTestAchievementSound|r %striggered.|r", colors.info, colors.test),

-- BLU:TestBattlePetLevelSound()
--TEST_BATTLE_PET_LEVEL_SOUND = string.format("%sTestBattlePetLevelSound|r triggered.|r", colors.info),
--TEST_BATTLE_PET_LEVEL_SOUND = string.format("%sTestBattlePetLevelSound|r %striggered.|r", colors.info, colors.test),

-- BLU:TestDelveLevelUpSound()
TEST_DELVE_LEVEL_UP_SOUND = string.format("%sTestDelveLevelUpSound|r triggered.|r", colors.info),
TEST_DELVE_LEVEL_UP_SOUND = string.format("%sTestDelveLevelUpSound|r %striggered.|r", colors.info, colors.test),

-- BLU:TestHonorSound()
TEST_HONOR_SOUND = string.format("%sTestHonorSound|r triggered.|r", colors.info),
TEST_HONOR_SOUND = string.format("%sTestHonorSound|r %striggered.|r", colors.info, colors.test),

-- BLU:TestLevelSound()
TEST_LEVEL_SOUND = string.format("%sTestLevelSound|r triggered.|r", colors.info),
TEST_LEVEL_SOUND = string.format("%sTestLevelSound|r %striggered.|r", colors.info, colors.test),

-- BLU:TestPostSound()
TEST_POST_SOUND = string.format("%sTestPostSound|r triggered.|r", colors.info),
TEST_POST_SOUND = string.format("%sTestPostSound|r %striggered.|r", colors.info, colors.test),

-- BLU:TestQuestAcceptSound()
TEST_QUEST_ACCEPT_SOUND = string.format("%sTestQuestAcceptSound|r triggered.|r", colors.info),
TEST_QUEST_ACCEPT_SOUND = string.format("%sTestQuestAcceptSound|r %striggered.|r", colors.info, colors.test),

-- BLU:TestQuestSound()
TEST_QUEST_SOUND = string.format("%sTestQuestSound|r triggered.|r", colors.info),
TEST_QUEST_SOUND = string.format("%sTestQuestSound|r %striggered.|r", colors.info, colors.test),

-- BLU:TestRenownSound()
TEST_RENOWN_SOUND = string.format("%sTestRenownSound|r triggered.|r", colors.info),
TEST_RENOWN_SOUND = string.format("%sTestRenownSound|r %striggered.|r", colors.info, colors.test),

-- BLU:TestRepSound()
TEST_REP_SOUND = string.format("%sTestRepSound|r triggered.|r", colors.info),
TEST_REP_SOUND = string.format("%sTestRepSound|r %striggered.|r", colors.info, colors.test),

-- =====================================================================================

-- =====================================================================================

-- BLU:ReputationChatFrameHook()
INCOMING_CHAT_MESSAGE = string.format("%sIncoming chat message: %%s|r", colors.highlight),
NO_RANK_FOUND = string.format("%sNo reputation rank increase found in chat message.|r", colors.error),
FUNCTIONS_HALTED = string.format("%sFunctions halted. Event not processed.|r", colors.info),

-- BLU:ReputationRankIncrease()
REPUTATION_RANK_TRIGGERED = string.format("Reputation rank increase triggered for rank: %%s|r", colors.info),
REPUTATION_RANK_TRIGGERED = string.format("Reputation rank increase triggered for rank: ",colors.info),

-- BLU:OnDelveCompantionLevelUp(event, ...)
DELVE_LEVEL_UP = string.format("%sBrann Bronzebeard has reached Level %%s|r", colors.info),
Expand Down

0 comments on commit 5152810

Please sign in to comment.