Fix damage popup sequencing
This commit is contained in:
@@ -41,24 +41,36 @@ if lp ~= nil then
|
||||
end
|
||||
self:RenderSoulLabel()`, [{ Type: "number", DefaultValue: null, SyncDirection: 0, Attributes: [], Name: "n" }]),
|
||||
method('BuySoulUnlock', `local d = nil
|
||||
if self.SoulShopDef ~= nil then d = self.SoulShopDef[slot] end
|
||||
if d == nil then return end
|
||||
if self.SoulUnlocks ~= nil and self.SoulUnlocks[d.key] == true then
|
||||
self:Toast("이미 보유 중입니다")
|
||||
if self.SoulShopDef ~= nil then
|
||||
d = self.SoulShopDef[slot]
|
||||
end
|
||||
if d == nil then
|
||||
return
|
||||
end
|
||||
if (self.SoulPoints or 0) < d.cost then
|
||||
self:Toast("영혼이 부족합니다")
|
||||
local unlockKey = d.key
|
||||
local unlockCost = d.cost
|
||||
local unlockName = d.name or "Unlock"
|
||||
if unlockKey == nil or unlockCost == nil then
|
||||
return
|
||||
end
|
||||
self.SoulPoints = self.SoulPoints - d.cost
|
||||
if self.SoulUnlocks == nil then self.SoulUnlocks = {} end
|
||||
self.SoulUnlocks[d.key] = true
|
||||
if self.SoulUnlocks ~= nil and self.SoulUnlocks[unlockKey] == true then
|
||||
self:Toast("Already owned")
|
||||
return
|
||||
end
|
||||
if (self.SoulPoints or 0) < unlockCost then
|
||||
self:Toast("Not enough soul")
|
||||
return
|
||||
end
|
||||
self.SoulPoints = self.SoulPoints - unlockCost
|
||||
if self.SoulUnlocks == nil then
|
||||
self.SoulUnlocks = {}
|
||||
end
|
||||
self.SoulUnlocks[unlockKey] = true
|
||||
local lp = _UserService.LocalPlayer
|
||||
if lp ~= nil then
|
||||
self:SaveSouls(self.SoulPoints, self:SerializeUnlocks(), lp.PlayerComponent.UserId)
|
||||
end
|
||||
self:Toast(d.name .. " 해금!")
|
||||
self:Toast(unlockName .. " unlocked")
|
||||
self:RenderSoulLabel()
|
||||
self:RenderSoulShop()`, [{ Type: "number", DefaultValue: null, SyncDirection: 0, Attributes: [], Name: "slot" }]),
|
||||
method('RenderSoulShop', `local defs = self.SoulShopDef or {}
|
||||
@@ -68,16 +80,20 @@ for i = 1, 4 do
|
||||
if d == nil then
|
||||
self:SetEntityEnabled(base, false)
|
||||
else
|
||||
local itemName = d.name or "Unlock"
|
||||
local itemDesc = d.desc or ""
|
||||
local itemKey = d.key
|
||||
local itemCost = d.cost or 0
|
||||
self:SetEntityEnabled(base, true)
|
||||
self:SetText(base .. "/Name", d.name)
|
||||
self:SetText(base .. "/Desc", d.desc)
|
||||
local owned = self.SoulUnlocks ~= nil and self.SoulUnlocks[d.key] == true
|
||||
self:SetText(base .. "/Name", itemName)
|
||||
self:SetText(base .. "/Desc", itemDesc)
|
||||
local owned = itemKey ~= nil and self.SoulUnlocks ~= nil and self.SoulUnlocks[itemKey] == true
|
||||
if owned then
|
||||
self:SetText(base .. "/Status", "보유 중")
|
||||
elseif (self.SoulPoints or 0) >= d.cost then
|
||||
self:SetText(base .. "/Status", tostring(d.cost) .. " 영혼 · 구매")
|
||||
self:SetText(base .. "/Status", "Owned")
|
||||
elseif (self.SoulPoints or 0) >= itemCost then
|
||||
self:SetText(base .. "/Status", tostring(itemCost) .. " soul · buy")
|
||||
else
|
||||
self:SetText(base .. "/Status", tostring(d.cost) .. " 영혼 · 부족")
|
||||
self:SetText(base .. "/Status", tostring(itemCost) .. " soul · low")
|
||||
end
|
||||
end
|
||||
end`),
|
||||
|
||||
Reference in New Issue
Block a user