Skip to content

Commit

Permalink
short killl message
Browse files Browse the repository at this point in the history
  • Loading branch information
Cjewett committed Dec 8, 2019
1 parent 6ef47bb commit 40d5a2a
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 4 deletions.
2 changes: 1 addition & 1 deletion HonorAssist.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: HonorAssist
## Author: Eulav, CptMerlot
## Version: 0.8
## SavedVariablesPerCharacter: HonorAssistData, HonorAssistLogging, HonorAssistTrackerFramePositionX, HonorAssistTrackerFramePositionY, HonorAssistShowTrackerUi, HonorAssistNameplateToggle
## SavedVariablesPerCharacter: HonorAssistData, HonorAssistLogging, HonorAssistTrackerFramePositionX, HonorAssistTrackerFramePositionY, HonorAssistShowTrackerUi, HonorAssistNameplateToggle, HonorAssistShortKillMessageToggle

# Localization
Localizations\enUS.lua
Expand Down
16 changes: 13 additions & 3 deletions HonorAssistChatMessage.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
local addonName, addonTable = ...
HonorAssist = addonTable

function HonorAssist:LoadChatMessageSettings()
if HonorAssistShortKillMessageToggle == nil then
HonorAssistShortKillMessageToggle = false
end
end

-- This runs after HonorAssistDailyCalculator. That means the kill is already added to that database, so we can use the times killed from that service.
-- When calculating realistic honor we need to decrease by 1 to get the real value of the kill.
ChatFrame_AddMessageEventFilter("CHAT_MSG_COMBAT_HONOR_GAIN", function(self, event, text, ...)
Expand Down Expand Up @@ -37,9 +43,13 @@ function HonorAssist:CreateHonorableKillMessage(estimatedHonorGained, playerKill

local chatInfo = ChatTypeInfo["COMBAT_HONOR_GAIN"]

text = HonorAssist:GetTranslation("YOU_HAVE_KILLED") .. ' ' .. playerKilled .. ' (' .. playerRank .. ') ' .. timesKilled .. ' ' .. HonorAssist:GetTranslation(timeText) .. '. '
.. HonorAssist:GetTranslation("THIS_KILL_GRANTED") .. ' ' .. percentage * 100 .. '% ' .. HonorAssist:GetTranslation("VALUE_FOR") .. ' |cFF00ccff' .. realisticHonor .. ' '
.. HonorAssist:GetTranslation("HONOR"):lower() .. '|cFF' .. HonorAssist:RGBPercToHex(chatInfo.r, chatInfo.g, chatInfo.b) .. ' ' .. string.match(text, "(%(.+)") .. '.'
if not HonorAssistShortKillMessageToggle then
text = HonorAssist:GetTranslation("YOU_HAVE_KILLED") .. ' ' .. playerKilled .. ' (' .. playerRank .. ') ' .. timesKilled .. ' ' .. HonorAssist:GetTranslation(timeText) .. '. '
.. HonorAssist:GetTranslation("THIS_KILL_GRANTED") .. ' ' .. percentage * 100 .. '% ' .. HonorAssist:GetTranslation("VALUE_FOR") .. ' |cFF00ccff' .. realisticHonor .. ' '
.. HonorAssist:GetTranslation("HONOR"):lower() .. '|cFF' .. HonorAssist:RGBPercToHex(chatInfo.r, chatInfo.g, chatInfo.b) .. ' ' .. string.match(text, "(%(.+)") .. '.'
else
text = playerKilled .. ' (' .. playerRank .. ') ' .. timesKilled .. 'x: |cFF00ccff' .. realisticHonor .. ' ' .. HonorAssist:GetTranslation("HONOR"):lower()
end

return text
end
18 changes: 18 additions & 0 deletions HonorAssistOptionsUi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local messageHeight = 10
function HonorAssist:LoadOptionsUi()
HonorAssist.OptionsUi.trackerUiEnable:SetChecked(HonorAssistShowTrackerUi)
HonorAssist.OptionsUi.nameplateEnable:SetChecked(HonorAssistNameplateToggle)
HonorAssist.OptionsUi.shortKillMsgEnable:SetChecked(HonorAssistShortKillMessageToggle)
end

HonorAssist.OptionsUi.optionsFrame = CreateFrame("Frame", addonName .. "Options", InterfaceOptionsFramePanelContainer)
Expand Down Expand Up @@ -70,6 +71,23 @@ HonorAssist.OptionsUi.nameplateEnableLabel:SetText(HonorAssist:GetTranslation("O

-- End Enable Nameplate CheckButton Section

-- Start Short Kill Message CheckButton Section

HonorAssist.OptionsUi.shortKillMsgEnable = CreateFrame("CheckButton", nil, HonorAssist.OptionsUi.optionsFrame, "ChatConfigCheckButtonTemplate")
HonorAssist.OptionsUi.shortKillMsgEnable:SetPoint("TOPLEFT", 16, -76)
HonorAssist.OptionsUi.shortKillMsgEnable:SetScript("OnClick",
function()
HonorAssistShortKillMessageToggle = not HonorAssistShortKillMessageToggle
HonorAssist.OptionsUi.shortKillMsgEnable:SetChecked(HonorAssistShortKillMessageToggle)
end
);

HonorAssist.OptionsUi.shortKillMsgEnableLabel = HonorAssist.OptionsUi.optionsFrame:CreateFontString(nil, "ARTWORK", "GameFontNormalSmall")
HonorAssist.OptionsUi.shortKillMsgEnableLabel:SetPoint("TOPLEFT", 42, -82)
HonorAssist.OptionsUi.shortKillMsgEnableLabel:SetText(HonorAssist:GetTranslation("OPTIONS_ENABLE_SHORT_KILL_MSG"))

-- End Short Kill Message CheckButton Section

-- Start History Section

-- History Title
Expand Down
1 change: 1 addition & 0 deletions Localizations/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "Tracker aktivieren";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "Aktivieren Sie die Ehre auf dem Typenschild";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "Kurze Ehrennachricht aktivieren";
}

HonorAssist.L = L
1 change: 1 addition & 0 deletions Localizations/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "Enable Tracker";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "Enable Honor on Nameplate";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "Enable Short Honor Message";
}

HonorAssist.L = L
1 change: 1 addition & 0 deletions Localizations/esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "Habilitar rastreador";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "Ativar honra na placa de identificação";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "Habilitar mensaje de honor corto";
}

HonorAssist.L = L
1 change: 1 addition & 0 deletions Localizations/esMX.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "Habilitar rastreador";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "Ativar honra na placa de identificação";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "Habilitar mensaje de honor corto";
}

HonorAssist.L = L
1 change: 1 addition & 0 deletions Localizations/frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "Activer le traqueur";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "Activer l'honneur sur la plaque signalétique";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "Activer le court message d'honneur";
}

HonorAssist.L = L
1 change: 1 addition & 0 deletions Localizations/itIT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "Abilita Tracker";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "Abilita Honor sulla targhetta";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "Abilita breve messaggio d'onore";
}

HonorAssist.L = L
1 change: 1 addition & 0 deletions Localizations/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "트래커 사용";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "명판에 명예 활성화";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "단명 메시지 사용";
}

HonorAssist.L = L
1 change: 1 addition & 0 deletions Localizations/ptBR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "Ativar rastreador";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "Ativar honra na placa de identificação";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "Ativar mensagem curta de honra";
}

HonorAssist.L = L
1 change: 1 addition & 0 deletions Localizations/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "Включить трекер";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "Включить честь на шильдике";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "Включить короткое сообщение чести";
}

HonorAssist.L = L
1 change: 1 addition & 0 deletions Localizations/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "启用追踪器";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "在铭牌上启用荣誉";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "启用荣誉短消息";
}

HonorAssist.L = L
1 change: 1 addition & 0 deletions Localizations/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local L = {
["FROM_KILLS"] = "From Kills";
["OPTIONS_ENABLE_TRACKER_LABEL"] = "啟用追踪器";
["OPTIONS_ENABLE_NAMEPLATE_LABEL"] = "在銘牌上啟用榮譽";
["OPTIONS_ENABLE_SHORT_KILL_MSG"] = "啟用榮譽短消息";
}

HonorAssist.L = L

0 comments on commit 40d5a2a

Please sign in to comment.