93 lines
2.9 KiB
Lua
93 lines
2.9 KiB
Lua
|
||
------------------------------------------------
|
||
--作者: 王圣
|
||
--日期: 2020-03-02
|
||
--文件: XmHelpSystem.lua
|
||
--模块: XmHelpSystem
|
||
--描述: 仙盟战帮助说明类
|
||
------------------------------------------------
|
||
--引用
|
||
local TimeUtils = CS.Thousandto.Core.Base.TimeUtils;
|
||
local XmHelpSystem = {
|
||
CurFunctionId = 0,
|
||
Show = -1,
|
||
PrevHour = 23,
|
||
--{key = 大菜单类型,List = {Id = 小菜单Id , cName = 小菜单名字}}
|
||
DicHelp = Dictionary:New(),
|
||
--欧阳翻那个逗比喊改成每次仙盟战第一次进入弹
|
||
IsLogicCanShow = true,
|
||
}
|
||
|
||
function XmHelpSystem:Initialize()
|
||
self.DicHelp:Clear()
|
||
DataConfig.DataGuideWarNewbie:Foreach(function(k, v)
|
||
local list = nil
|
||
local tab = {Id = v.Id, cName = v.Name}
|
||
if self.DicHelp:ContainsKey(v.Type) then
|
||
list = self.DicHelp[v.Type]
|
||
list:Add(tab)
|
||
else
|
||
list = List:New()
|
||
list:Add(tab)
|
||
self.DicHelp[v.Type] = list
|
||
end
|
||
end)
|
||
end
|
||
|
||
function XmHelpSystem:CanShow()
|
||
-- local lp = GameCenter.GameSceneSystem:GetLocalPlayer()
|
||
-- if lp == nil then
|
||
-- return
|
||
-- end
|
||
-- local week = TimeUtils.GetStampTimeWeekly(math.ceil( GameCenter.HeartSystem.ServerTime ))
|
||
-- local str = string.format( "XmHelp_{0}" ,lp.ID)
|
||
-- self.Show = PlayerPrefs.GetInt(str)
|
||
-- if self.Show == nil or self.Show == -1 then
|
||
-- PlayerPrefs.SetInt(str, week)
|
||
-- self.Show = week
|
||
-- PlayerPrefs.Save()
|
||
-- return true
|
||
-- else
|
||
-- self.Show = PlayerPrefs.GetInt(str)
|
||
-- if self.Show ~= week then
|
||
-- PlayerPrefs.SetInt(str, week)
|
||
-- self.Show = week
|
||
-- PlayerPrefs.Save()
|
||
-- return true
|
||
-- end
|
||
-- return false
|
||
-- end
|
||
if self.IsLogicCanShow then
|
||
self.IsLogicCanShow = false
|
||
return true
|
||
else
|
||
return false
|
||
end
|
||
end
|
||
|
||
function XmHelpSystem:Update(dt)
|
||
-- if self.Show == -1 then
|
||
-- local lp = GameCenter.GameSceneSystem:GetLocalPlayer()
|
||
-- if lp == nil then
|
||
-- return
|
||
-- end
|
||
-- local str = UIUtils.CSFormat("XmHelp_{0}",lp.ID)
|
||
-- self.Show = PlayerPrefs.GetInt(str)
|
||
-- end
|
||
-- if self.Show == local week = TimeUtils.GetStampTimeWeekly(math.ceil( GameCenter.HeartSystem.ServerTime )) then
|
||
-- local hour = TimeUtils.GetStampTimeHH(math.floor( GameCenter.HeartSystem.ServerTime ))
|
||
-- if self.PrevHour == 23 and hour == 0 then
|
||
-- self.Show = 0
|
||
-- local lp = GameCenter.GameSceneSystem:GetLocalPlayer()
|
||
-- if lp == nil then
|
||
-- return
|
||
-- end
|
||
-- local str = UIUtils.CSFormat("XmHelp_{0}",lp.ID)
|
||
-- PlayerPrefs.SetInt(str, 0)
|
||
-- PlayerPrefs.Save()
|
||
-- end
|
||
-- end
|
||
end
|
||
|
||
return XmHelpSystem
|