deposit bugfix
This commit is contained in:
+1
-1
@@ -326,7 +326,7 @@ function update_item_configuration()
|
||||
stack_count_slider.editbox:SetNumber(stack_count_slider:GetValue())
|
||||
|
||||
do
|
||||
local deposit_factor = UnitFactionGroup'npc' and .25 or .05
|
||||
local deposit_factor = UnitFactionGroup'npc' and .05 or .25
|
||||
local stack_size, stack_count = stack_size_slider:GetValue(), stack_count_slider:GetValue()
|
||||
local amount = floor(selected_item.unit_vendor_price * deposit_factor * (selected_item.max_charges and 1 or stack_size)) * stack_count * UIDropDownMenu_GetSelectedValue(duration_dropdown) / 120
|
||||
deposit:SetText('Deposit: ' .. money.to_string(amount, nil, nil, nil, color.text.enabled))
|
||||
|
||||
+27
-23
@@ -10,31 +10,35 @@ _G.aux = {
|
||||
account = {},
|
||||
}
|
||||
|
||||
local cache = {account=aux.account}
|
||||
|
||||
function LOAD2()
|
||||
do
|
||||
local key = format('%s|%s', GetCVar'realmName', UnitName'player')
|
||||
aux.player[key] = aux.player[key] or {}
|
||||
cache.player = aux.player[key]
|
||||
do
|
||||
local cache = {}
|
||||
function LOAD()
|
||||
cache.account = aux.account
|
||||
do
|
||||
local key = format('%s|%s', GetCVar'realmName', UnitName'player')
|
||||
aux.player[key] = aux.player[key] or {}
|
||||
cache.player = aux.player[key]
|
||||
end
|
||||
do
|
||||
local key = GetCVar'realmName'
|
||||
aux.realm[key] = aux.realm[key] or {}
|
||||
cache.realm = aux.realm[key]
|
||||
end
|
||||
end
|
||||
do
|
||||
local key = format('%s|%s', GetCVar'realmName', UnitFactionGroup'player')
|
||||
aux.faction[key] = aux.faction[key] or {}
|
||||
cache.faction = aux.faction[key]
|
||||
function LOAD2()
|
||||
do
|
||||
local key = format('%s|%s', GetCVar'realmName', UnitFactionGroup'player')
|
||||
aux.faction[key] = aux.faction[key] or {}
|
||||
cache.faction = aux.faction[key]
|
||||
end
|
||||
end
|
||||
do
|
||||
local key = GetCVar'realmName'
|
||||
aux.realm[key] = aux.realm[key] or {}
|
||||
cache.realm = aux.realm[key]
|
||||
end
|
||||
end
|
||||
|
||||
for scope in temp-S('player', 'faction', 'realm', 'account') do
|
||||
local scope = scope
|
||||
M[scope] = function(k)
|
||||
cache[scope][k] = cache[scope][k]
|
||||
return cache[scope][k]
|
||||
for scope in temp-S('player', 'faction', 'realm', 'account') do
|
||||
local scope = scope
|
||||
M[scope] = function(k)
|
||||
if not cache[scope] then error('Cache not ready', 2) end
|
||||
cache[scope][k] = cache[scope][k] or {}
|
||||
return cache[scope][k]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user