Skip to content

Commit

Permalink
Repair non english clients
Browse files Browse the repository at this point in the history
  • Loading branch information
derfloh205 committed Dec 18, 2023
1 parent 9694085 commit a2f202b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 447 deletions.
2 changes: 1 addition & 1 deletion CraftSim.toc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Title: CraftSim
## Notes: Calculates the average profit based on your profession stats and other tools for dragonflight gold making
## Author: genju
## Version: 12.0.3
## Version: 12.0.5
## X-Curse-Project-ID: 705015
## X-Wago-ID: 0mNwaPKo
## X-WoWI-ID: 26519
Expand Down
2 changes: 2 additions & 0 deletions Data/Classes/ProfessionStats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function CraftSim.ProfessionStats:SetStatsByOperationInfo(recipeData, operationI
print("No Operation Info -> No Stats")
return
end
print("Parse Stats By OperationInfo", false, true)
self.skill.value = operationInfo.baseSkill + operationInfo.bonusSkill
self.recipeDifficulty.value = operationInfo.baseDifficulty
local bonusStats = operationInfo.bonusStats
Expand All @@ -43,6 +44,7 @@ function CraftSim.ProfessionStats:SetStatsByOperationInfo(recipeData, operationI
local multicraft = string.lower(CraftSim.LOCAL:GetText(CraftSim.CONST.TEXT.STAT_MULTICRAFT))
local resourcefulness = string.lower(CraftSim.LOCAL:GetText(CraftSim.CONST.TEXT.STAT_RESOURCEFULNESS))
local craftingspeed = string.lower(CraftSim.LOCAL:GetText(CraftSim.CONST.TEXT.STAT_CRAFTINGSPEED))
print(CraftSim.LOCAL)
if statName == craftingspeed then
self.craftingspeed:SetValueByPercent(statInfo.ratingPct / 100)
elseif statName == inspiration then
Expand Down
6 changes: 4 additions & 2 deletions Data/News.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local CraftSimAddonName, CraftSim = ...
local _, CraftSim = ...

CraftSim.NEWS = {}

Expand All @@ -9,9 +9,11 @@ function CraftSim.NEWS:GET_NEWS()
local news = {
f.bb(" Hello and thank you for using CraftSim!\n"),
f.bb(" ( You are awesome! )"),
newP("12.0.4"),
newP("12.0.5"),
f.p .. "Hotfixes regarding " ..f.bb("CustomerHistory") .. " Data Migration",
f.p .. "Added price source addons to optional deps......",
f.p .. "Fixed average profit not correctly calculated",
f.a .. "for non english clients",
newP("12.0.0"),
f.P .. "Reworked " .. f.bb("Customer History") .. ". Now includes:",
f.a .. "- " .. f.g("A Whisper Button"),
Expand Down
20 changes: 10 additions & 10 deletions Locals/Localization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ function CraftSim.LOCAL:Init()
if currentLocale == CraftSim.CONST.LOCALES.EN then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL.LOCAL_EN
elseif currentLocale == CraftSim.CONST.LOCALES.DE then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_DE
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_DE:GetData()
elseif currentLocale == CraftSim.CONST.LOCALES.IT then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_IT
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_IT:GetData()
elseif currentLocale == CraftSim.CONST.LOCALES.RU then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_RU
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_RU:GetData()
elseif currentLocale == CraftSim.CONST.LOCALES.PT then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_PT
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_PT:GetData()
elseif currentLocale == CraftSim.CONST.LOCALES.ES then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_ES
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_ES:GetData()
elseif currentLocale == CraftSim.CONST.LOCALES.FR then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_FR
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_FR:GetData()
elseif currentLocale == CraftSim.CONST.LOCALES.MX then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_ES
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_ES:GetData()
elseif currentLocale == CraftSim.CONST.LOCALES.KO then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_KO
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_KO:GetData()
elseif currentLocale == CraftSim.CONST.LOCALES.TW then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_TW
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_TW:GetData()
elseif currentLocale == CraftSim.CONST.LOCALES.CN then
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_CN
CraftSim.LOCAL.LOCAL_CLIENT = CraftSim.LOCAL_CN:GetData()
else
error("CraftSim Error: Client not supported: " .. tostring(currentLocale))
end
Expand Down
2 changes: 1 addition & 1 deletion Pricing/PriceData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ end
---@param idOrLink? number | string
---@return number? auctionAmount
function CraftSim.PRICEDATA:GetAuctionAmount(idOrLink)
if IsAddOnLoaded(CraftSimTSM.name) then
if C_AddOns.IsAddOnLoaded(CraftSimTSM.name) then
return CraftSimTSM:GetAuctionAmount(idOrLink)
else
return
Expand Down
Loading

0 comments on commit a2f202b

Please sign in to comment.