75 lines
1.6 KiB
Plaintext
75 lines
1.6 KiB
Plaintext
|
-- 成长基金(标签)
|
||
|
|
||
|
require("LuaUtil")
|
||
|
require("LuaItemBase")
|
||
|
|
||
|
InvestMenuItem = LuaItemBase:new()
|
||
|
|
||
|
_actID = -1
|
||
|
|
||
|
|
||
|
function InvestMenuItem.ShowWithTab(data)
|
||
|
InvestMenuItem.ShowActState(data)
|
||
|
|
||
|
end
|
||
|
|
||
|
-- 显示菜单信息
|
||
|
function InvestMenuItem.ShowActState(actState)
|
||
|
_actID = actState.actID
|
||
|
_state = actState.state
|
||
|
local actInfo = TabMan.GetActInfoClientByID(actState.actID, 0)
|
||
|
if _MenuText ~= nil then
|
||
|
_MenuText:GetComponent("Text").text = actInfo.Name
|
||
|
end
|
||
|
if _HLMenuText ~= nil then
|
||
|
_HLMenuText:GetComponent("Text").text = actInfo.Name
|
||
|
end
|
||
|
|
||
|
if _RedDot ~= nil then
|
||
|
_RedDot:SetActive(actState.state > 0)
|
||
|
end
|
||
|
if remainTimeText ~= nil then
|
||
|
if actState.state >= 99 then
|
||
|
remainTimeText:GetComponent("Text").text = 99
|
||
|
else
|
||
|
remainTimeText:GetComponent("Text").text = actState.state
|
||
|
end
|
||
|
end
|
||
|
--ELog('actState.state == '..actState.state)
|
||
|
|
||
|
-- 投资,未投资
|
||
|
if _NonInvestment ~= nil then
|
||
|
_NonInvestment:SetActive(actState.ispurchase < 1)
|
||
|
end
|
||
|
|
||
|
end
|
||
|
|
||
|
function InvestMenuItem.OnEnable()
|
||
|
|
||
|
end
|
||
|
|
||
|
--红点
|
||
|
function InvestMenuItem.RefreshActState(state)
|
||
|
_RedDot:SetActive(state > 0)
|
||
|
if state >= 99 then
|
||
|
remainTimeText:GetComponent("Text").text = 99
|
||
|
else
|
||
|
remainTimeText:GetComponent("Text").text = state
|
||
|
end
|
||
|
end
|
||
|
|
||
|
-- 选中
|
||
|
function InvestMenuItem.Select()
|
||
|
if selectGO ~= nil then
|
||
|
selectGO:SetActive(true)
|
||
|
end
|
||
|
end
|
||
|
--未选中
|
||
|
function InvestMenuItem.UnSelect()
|
||
|
if selectGO ~= nil then
|
||
|
selectGO:SetActive(false)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
|