Skip to content

Commit

Permalink
- colored mod name in chat messages
Browse files Browse the repository at this point in the history
  • Loading branch information
frozn committed May 25, 2024
1 parent 15b9d2a commit a95e299
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions TipTac/modules/ttBars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ function ttBars:OnApplyConfig(TT_CacheForFrames, cfg, TT_ExtendedConfig)
-- set default font if font in config is not valid
if (not LibFroznFunctions:FontExists(cfg.barFontFace)) then
cfg.barFontFace = nil;
tt:AddMessageToChatFrame(MOD_NAME .. ": {error:No valid Font set in option tab {highlight:Bars}. Switching to default Font.}");
tt:AddMessageToChatFrame("{caption:" .. MOD_NAME .. "}: {error:No valid Font set in option tab {highlight:Bars}. Switching to default Font.}");
end

-- set default texture if texture in config is not valid
if (not LibFroznFunctions:TextureExists(cfg.barTexture)) then
cfg.barTexture = nil;
tt:AddMessageToChatFrame(MOD_NAME .. ": {error:No valid texture set in option tab {highlight:Bars}. Switching to default texture.}");
tt:AddMessageToChatFrame("{caption:" .. MOD_NAME .. "}: {error:No valid texture set in option tab {highlight:Bars}. Switching to default texture.}");
end

-- set texture and height of GameTooltip's standard status bar
Expand Down
7 changes: 4 additions & 3 deletions TipTac/ttCore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ local TT_CurrentRegionID = GetCurrentRegion();

-- add message to (selected) chat frame
local replacementsForChatFrame = {
["{caption:"] = TT_COLOR.text.caption:GenerateHexColorMarkup(),
["{highlight:"] = TT_COLOR.text.highlight:GenerateHexColorMarkup(),
["{error:"] = TT_COLOR.text.error:GenerateHexColorMarkup(),
["}"] = FONT_COLOR_CODE_CLOSE
Expand Down Expand Up @@ -1060,7 +1061,7 @@ function tt:ToggleOptions()
local TipTacOptions = _G[addOnName];
TipTacOptions:SetShown(not TipTacOptions:IsShown());
else
tt:AddMessageToChatFrame(MOD_NAME .. ": {error:Couldn't open " .. MOD_NAME .. " Options: [{highlight:" .. _G["ADDON_" .. reason] .. "}]. Please make sure the addon is enabled in the character selection screen.}"); -- see UIParentLoadAddOn()
tt:AddMessageToChatFrame("{caption:" .. MOD_NAME .. "}: {error:Couldn't open " .. MOD_NAME .. " Options: [{highlight:" .. _G["ADDON_" .. reason] .. "}]. Please make sure the addon is enabled in the character selection screen.}"); -- see UIParentLoadAddOn()
end
end

Expand Down Expand Up @@ -1163,7 +1164,7 @@ LibFroznFunctions:RegisterNewSlashCommands(MOD_NAME, { "/tip", "/tiptac" }, func
if (parameters[1] == "reset") then
wipe(cfg);
tt:ApplyConfig();
tt:AddMessageToChatFrame(MOD_NAME .. ": All {highlight:" .. MOD_NAME .. "} settings has been reset to their default values.");
tt:AddMessageToChatFrame("{caption:" .. MOD_NAME .. "}: All {highlight:" .. MOD_NAME .. "} settings has been reset to their default values.");
return;
end

Expand Down Expand Up @@ -1463,7 +1464,7 @@ function tt:SetFontToGameTooltip()
-- set default font if font in config is not valid
if (not LibFroznFunctions:FontExists(cfg.fontFace)) then
cfg.fontFace = nil;
self:AddMessageToChatFrame(MOD_NAME .. ": {error:No valid Font set in option tab {highlight:Font}. Switching to default Font.}");
self:AddMessageToChatFrame("{caption:" .. MOD_NAME .. "}: {error:No valid Font set in option tab {highlight:Font}. Switching to default Font.}");
end

-- set font to GameTooltip
Expand Down

0 comments on commit a95e299

Please sign in to comment.