Skip to content

Commit e66f768

Browse files
committed
Fix Auto-style condition
Condition 1) Currency has maximum amount 2) Earnable <= 1600 3) Total earned < 9000 or Max < 10000 then Type-2, else Type-0. Valor max. grows 1600 per week Conqeust max. grows 4000 per week
1 parent 619ae46 commit e66f768

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Core.lua

+14-4
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,20 @@ local _TranslationTable = {
6565
saved_currency.quantity = saved_currency.quantity or saved_currency.total -- For compatibility
6666
saved_currency.total = nil
6767
if not currency_type or currency_type == "" then
68-
-- Earnable amount is shown when total earned amount is under 8000
69-
if saved_currency.totalEarned and saved_currency.totalEarned < 8000 then
70-
currency_type = "2"
71-
else currency_type = "0"
68+
-- Auto-style : Condition for display earnable amount(maximum - earned)
69+
-- 1) Currency has maximum amount
70+
-- 2) Earnable <= 1600
71+
-- 3) Total earned < 9000 or Max < 10000
72+
-- then Type-2 else Type-0
73+
currency_type = "0"
74+
if saved_currency.maxQuantity and saved_currency.maxQuantity > 0 then
75+
local earnable = (saved_currency.maxQuantity or 0) - (saved_currency.totalEarned or 0)
76+
if (earnable <= 1600 and earnable >= 0) then
77+
if (saved_currency.totalEarned or 0) < 9000
78+
or (saved_currency.maxQuantity or 0) > 9999 then
79+
currency_type = "2"
80+
end
81+
end
7282
end
7383
end
7484
if currency_type == "0" then -- Type-0: [Icon][Quantity]

0 commit comments

Comments
 (0)