Initial version - 1.2.0.60
EN: 1.2.0.60 CN: 1.2.0.61 JP: 1.2.0.63 KR: 1.2.0.67
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
local TemplateCoinCtrl = class("TemplateCoinCtrl", BaseCtrl)
|
||||
TemplateCoinCtrl._mapNodeConfig = {
|
||||
imgIcon = {sComponentName = "Image"},
|
||||
txtCount = {sComponentName = "TMP_Text"}
|
||||
}
|
||||
TemplateCoinCtrl._mapEventConfig = {}
|
||||
function TemplateCoinCtrl:SetCoin(nTid, nCount, bThousands, nMaxCount)
|
||||
if nTid then
|
||||
self:SetSprite_Coin(self._mapNode.imgIcon, nTid)
|
||||
end
|
||||
if nCount then
|
||||
if bThousands then
|
||||
if nMaxCount < nCount then
|
||||
NovaAPI.SetTMPText(self._mapNode.txtCount, self:ThousandsNumber(nMaxCount) .. "+")
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.txtCount, self:ThousandsNumber(nCount))
|
||||
end
|
||||
else
|
||||
NovaAPI.SetTMPText(self._mapNode.txtCount, nCount)
|
||||
end
|
||||
end
|
||||
end
|
||||
function TemplateCoinCtrl:SetCoinWithColor(nTid, nCount, bThousands, bEnough)
|
||||
if nTid then
|
||||
self:SetSprite_Coin(self._mapNode.imgIcon, nTid)
|
||||
end
|
||||
if nCount then
|
||||
local txt = bThousands and self:ThousandsNumber(nCount) or nCount
|
||||
NovaAPI.SetTMPText(self._mapNode.txtCount, txt)
|
||||
if not bEnough then
|
||||
NovaAPI.SetTMPColor(self._mapNode.txtCount, Red_Unable)
|
||||
end
|
||||
end
|
||||
end
|
||||
return TemplateCoinCtrl
|
||||
Reference in New Issue
Block a user