|
|
- GuideModel = GuideModel or BaseClass(BaseModel)
-
- --[[
- 引导说明, 现在用到支持同时存在多个
- 对于NEW_FUNC_OPEN之类这种不保存在cookie,可以取GetCurHelpVo获取当前触发的引导
- 对于HORSE_TYPE之类要保存在cookie的,用GetHelpVo获取该类型的引导
- ]]
-
- --引导触发类型
- GuideModel.LEVEL_TRIGGER_TYPE = 1
- GuideModel.TASK_TRIGGER_TYPE = 2
-
- GuideModel.WEAPON_TASK_ID = 10020 --采集武器任务id
- GuideModel.MONSTER_TASK_ID = 10000101 --三连打怪任务id
- GuideModel.MONSTER_ID = 1001000 --三连打怪怪物id
-
-
- GuideModel.VIP_EXPERIENCE_ID = 102008 --vip体验id
- GuideModel.VIP_EXPERIENCE_ID2 = 102036 --vip体验id2
-
-
- GuideModel.WeaponMonster = 10000020 --武器采集怪
- GuideModel.WingMonster = 1002302 --翅膀采集怪
-
- GuideModel.SpiritBgId = 501001 --星灵唤醒背景模型id
- GuideModel.SpiritId = 501002 --星灵唤醒模型id
-
- GuideModel.ExtendTaskId = 2080101 --装备精炼支线Id
-
-
- GuideModel.CHANGE_GOD_ID = 1001
- GuideModel.CHANGE_GOD_SCENE_ID = 10000 --变身降神场景
- GuideModel.CHANGE_GOD_ANGER_DOT = 3000 --变身降神最大怒气值
-
- GuideModel.STAR_HIT_SKILL_DUN_ID = 3002 --星灵羁绊技能引导副本Id
-
- GuideModel.GodUseMaxEffectLevel = 50 --将神使用大特效的等级
-
- GuideModel.MONSTER_COLLECT = { --因为只有一只,做成假采集,不然会和其他人抢
- [10000020] = 10020, --武器
- [10020023] = 10300, --坐骑
- }
-
- GuideModel.SCENE_ID = 1001
-
- GuideModel.MARRIAGE_ADVERTISE = 10050
-
- --直接执行引导
- GuideModel.DIRECT_EXECUTE_HELPER = "GuideModel.DIRECT_EXECUTE_HELPER"
- --社团引导
- GuideModel.NOT_PASS_APPLY_GUIDE = "GuideModel.NOT_PASS_APPLY_GUIDE"
- --执行终身引导
- GuideModel.EXECUTE_LIFELONG_HELPER = "GuideModel.EXECUTE_LIFELONG_HELPER"
- --终身引导事件变更
- GuideModel.REQ_LIFELONG_HELPER_CHANGE = "GuideModel.REQ_LIFELONG_HELPER_CHANGE"
-
-
- GuideModel.MONSTER_POS =
- {
- [1] = {x = 4767,y = 5550},
- [2] = {x = 5070,y = 5625},
- [3] = {x = 5375,y = 5648},
- }
-
- GuideModel.ICON_TYPE =
- {
- RIGHT_TOP = 1,
- SKILL = 2,
- BOTTOM = 3,
- }
-
- --自动待机一定时间,就要去做主线
- GuideModel.AUTO_DOTASK =
- {
- time = 600,
- level = 90,
- }
-
- --接了主线,一定时间提示手指
- GuideModel.DO_MAIN_TASK_TIPS =
- {
- time = 600,
- level = 90,
- }
-
- --缓存某些按钮世界坐标的类型
- GuideModel.CACHE_POS_TYPE =
- {
- TASK_PROGRESS = 1, --任务面板进度条的位置
- DIALOGUE_CLICK_BTN = 2, --对话界面 确定按钮 位置
- }
-
- --终身引导的类型
- GuideModel.LIFELONG_TYPE =
- {
- MARKET_OPEN = 1,
- MARKET_SELL = 2,
- EQUIP_EVOLVE = 3,
- ELITE_ASSESS = 4,
- SERVEN_TARGET = 5,
- STRENGTH_TIPS = 6,
-
- }
- GuideModel.LIFELONG_MARKET_OPEN_TYPE_LEVEL = 115
- GuideModel.LIFELONG_ELITE_ASSESS_TYPE_LEVEL = 108
- GuideModel.LIFELONG_SERVEN_TARGET_TYPE_LEVEL = 112
-
- function GuideModel:__init()
- GuideModel.Instance = self
-
- self.level_trigger_list = {} --等级触发的引导
- self.task_trigger_list = {} --任务触发的引导
- self.icon_guide_list = {} --触发引导的时候 这些已经激活的图标要先隐藏
-
- self.cookies_list = {}
- self.single_cookies_list = {} --针对只执行一次的引导
- self.is_load_data = false --是否已经加载过数据,只需要家再一次
-
- self.curr_trigger_type = nil --当前引导的触发类型 1 为等级 2 为 任务
- self.curr_help_type = nil --当前引导类型
- self.curr_help_step = nil --当前引导步骤
-
- self.curr_help_vo = nil -- 当期引导数据
-
- self.is_hide_small_ui = false --隐藏小界面
-
- self.scene_init_finish =false --场景初始化加载完成
- self.wait_level_up = false --等待升级再触发引导
- self.has_wait = false
- self.is_change_god_time = false --是否是降神变身期间
- self.need_finish_guide_first = false --是否要先完成引导在任务
- self.need_open_vip_view = false --是否需要打开续费界面
-
- self.is_prompt_view_open = false
- self.is_open_func_open = false
-
- self.need_excute_lottery = false --是否需要执行抽奖第二步引导
- self.show_item_use_after_close_view = false
-
- self.open_view_need_stop = false --打开某个界面是否需要暂停寻路
-
- self.need_delay_execute_guide = false --切场景的时候可能弹出副本界面结算所以要错开
-
- self.gem_mission_execute_task = false --魂珠副本优先做任务 不继续下一关
-
- self.need_force_do_task = false
-
-
- self.auto_task_stand_time = 0 --站街时多少秒时,自动做主线任务
-
- self.cache_guide_pos_list = {}
-
- self:LoadHelpDataFromConfig()
-
- self.lifelong_help_list = {}
-
- self.cache_show_guide = {} --缓存登陆只显示一次的引导
- end
-
- --清除缓存数据
- function GuideModel:ClearData()
- end
-
- function GuideModel:getInstance()
- if GuideModel.Instance == nil then
- GuideModel.New();
- end
- return GuideModel.Instance;
- end
-
- --从配置表读取数据到
- function GuideModel:LoadHelpDataFromConfig()
-
- if self.is_load_data then
- return
- end
-
- self.is_load_data = true
-
- for k,v in pairs(Config.ConfigHelper.Level) do
- local list = self.level_trigger_list[k]
- if list == nil then
- list = {}
- self.level_trigger_list[k] = list
- end
-
- for i,vo in ipairs(v) do
- vo.type = 1 --类型 1 属于等级 2 属于任务
- vo.lv = k
- vo.step = i
- table.insert(list,vo)
- end
- --图标创建出来要隐藏 除非v.ignore_fly
- local icon_cfg = stringtotable(v[1].param)
- if icon_cfg and icon_cfg[1] and not v.ignore_fly then
- local data = icon_cfg[1]
- if not self.icon_guide_list[data[1]] then
- self.icon_guide_list[data[1]] = {}
- end
- self.icon_guide_list[data[1]][data[2]] = v
- end
- end
-
- for k,v in pairs(Config.ConfigHelper.Task) do
- local list = self.task_trigger_list[k]
- if list == nil then
- list = {}
- self.task_trigger_list[k] = list
- end
-
- for i,vo in ipairs(v) do
- vo.type = 2 --类型 1 属于等级 2 属于任务
- vo.task_id = k
- vo.step = i
- table.insert(list,vo)
- end
-
- --图标创建出来要隐藏 除非v.ignore_fly
- local icon_cfg = stringtotable(v[1].param)
- if icon_cfg and icon_cfg[1] and not v.ignore_fly then
- local data = icon_cfg[1]
- if not self.icon_guide_list[data[1]] then
- self.icon_guide_list[data[1]] = {}
- end
- self.icon_guide_list[data[1]][data[2]] = v
- end
- end
-
- -- print("huangcong:GuideModel [start:185] :", self.icon_guide_list)
- -- PrintTable(self.task_trigger_list)
- -- print("huangcong:GuideModel [end]")
- end
-
- --type图标的类型 右上角图标 右下角图标 技能图标
- function GuideModel:GetIconIsGuild( type,index )
- if self.icon_guide_list[type] then
- return self.icon_guide_list[type][index]
- end
- end
-
- --获取等级配置
- function GuideModel:GetLevelConfig(lv)
- return self.level_trigger_list[lv]
- end
-
- --获取任务配置 -- 暂时先不加任务状态
- function GuideModel:GetTaskConfig(task_id)
- if self.task_trigger_list[task_id] and self.task_trigger_list[task_id] then
- return self.task_trigger_list[task_id]
- end
- return nil
- end
-
- function GuideModel:SetCurTriggerType(trigger_type)
- self.curr_trigger_type = trigger_type
- end
-
- function GuideModel:GetCurTriggerType()
- return self.curr_trigger_type
- end
-
- function GuideModel:SetCurHelpType(help_type)
- self.curr_help_type = help_type
- end
-
- function GuideModel:GetCurHelpType()
- return self.curr_help_type
- end
-
- function GuideModel:SetCurHelpStep(step)
- self.curr_help_step = step
- end
-
- function GuideModel:GetCurHelpStep()
- return self.curr_help_step
- end
-
- function GuideModel:SetCurHelpVo(vo)
- self.curr_help_vo = vo
- end
-
- function GuideModel:GetCurHelpVo()
- return self.curr_help_vo
- end
-
- function GuideModel:GetHelpCfg( helpVo )
- if helpVo.type == GuideModel.LEVEL_TRIGGER_TYPE then
- return Config.ConfigHelper.Level[helpVo.lv][helpVo.step]
- elseif helpVo.type == GuideModel.TASK_TRIGGER_TYPE then
- return Config.ConfigHelper.Task[helpVo.task_id][helpVo.step]
- end
- end
-
- --判断步骤值是否要执行
- function GuideModel:HasExecuteStep(helpVo)
- --如果没有数据,算他执行过
- if helpVo == nil then
- return true
- end
-
- local data = self.cookies_list[helpVo.type]
- if data then
- if helpVo.type == GuideModel.LEVEL_TRIGGER_TYPE then
- if helpVo.lv == 999991009 or helpVo.lv == 999991014 then ---将神\羁绊可以重复引导
- return false
- end
- local vo = data[helpVo.lv]
- if vo then
- return vo.step < helpVo.step
- end
- elseif helpVo.type == GuideModel.TASK_TRIGGER_TYPE then
- local vo = data[helpVo.task_id]
- if vo then
- return vo.step < helpVo.step
- end
- end
- end
- return false
- end
-
- --保存引导
- function GuideModel:SetHelperStep(helpVo)
-
- if helpVo == nil then
- return true
- end
-
- self.cookies_list[helpVo.type] = self.cookies_list[helpVo.type] or {}
-
- local type = helpVo.type
- local data = self.cookies_list[helpVo.type]
-
- if type == GuideModel.LEVEL_TRIGGER_TYPE then
- data[helpVo.lv] = data[helpVo.lv] or {}
- data[helpVo.lv].lv = helpVo.lv
- data[helpVo.lv].step = helpVo.step
- data[helpVo.lv].isEnd = helpVo.isEnd
- data[helpVo.lv].help_type = helpVo.help_type
- elseif type == GuideModel.TASK_TRIGGER_TYPE then
- data[helpVo.task_id] = data[helpVo.task_id] or {}
- data[helpVo.task_id].task_id = helpVo.task_id
- data[helpVo.task_id].step = helpVo.step
- data[helpVo.task_id].isEnd = helpVo.isEnd
- data[helpVo.task_id].help_type = helpVo.help_type
- end
-
- self:SaveHelpStepToCookies()
- end
-
-
- --只保存几个值 触发类型 触发id = 等级或者任务id 触发步骤
- function GuideModel:InitCookiesList()
- -- self.cookies_list = self:GetHelpStepFromCookies()
- self.cookies_list = self.cookies_list or {}
- local type = GuideModel.LEVEL_TRIGGER_TYPE
- self.cookies_list[type] = self.cookies_list[type] or {}
- type = GuideModel.TASK_TRIGGER_TYPE
- self.cookies_list[type] = self.cookies_list[type] or {}
-
-
- self.single_cookies_list = self:GetSingleHelpStepFromCookies() or {}
- end
-
- function GuideModel:GetLvCookieList( )
- return self.cookies_list[GuideModel.LEVEL_TRIGGER_TYPE] or {}
- end
-
- function GuideModel:GetTaskCookieList( )
- return self.cookies_list[GuideModel.TASK_TRIGGER_TYPE] or {}
- end
-
- function GuideModel:GetHelpStepFromCookies()
- return CookieWrapper.Instance:GetCookie(CookieLevelType.Account,CookieKey.HELPER_TIMES)
- end
-
- function GuideModel:GetSingleHelpStepFromCookies()
- return CookieWrapper.Instance:GetCookie(CookieLevelType.Account,CookieKey.SINGLE_HELPER_TIMES)
- end
-
- --操作cookies
- function GuideModel:SaveHelpStepToCookies()
- -- CookieWrapper.Instance:SaveCookie(CookieLevelType.Account,CookieTimeType.TYPE_ALWAYS,CookieKey.HELPER_TIMES,self.cookies_list)
- -- CookieWrapper.Instance:WriteAll()
- end
-
- --操作cookies
- function GuideModel:SaveSingleHelpStepToCookies(key)
- self.single_cookies_list[key] = true
- CookieWrapper.Instance:SaveCookie(CookieLevelType.Account,CookieTimeType.TYPE_ALWAYS,CookieKey.SINGLE_HELPER_TIMES,self.single_cookies_list)
- CookieWrapper.Instance:WriteAll()
- end
-
- function GuideModel:GetSingleTimesCookieList(key)
- return self.single_cookies_list[key]
- end
-
- --操作cookies
- function GuideModel:FinishCurrHelper(helpVo)
- helpVo.isEnd = true
- self:SetHelperStep(helpVo)
-
- self.curr_trigger_type = nil
- self.curr_help_type = nil
- self.curr_help_step = nil
- self.curr_help_vo = nil
- self:SaveHelpStepToCookies()
- end
-
- --只结束引导,不处理其他事情
- function GuideModel:OnlyFinishCurrHelper(helpVo)
-
- --如果当前保存的引导不清理掉 切场景的时候会重新引导
- if self.curr_help_vo and self.curr_help_vo.help_type == helpVo.help_type then
- self:SetCurHelpVo(nil)
- end
-
- helpVo.isEnd = true
- self:SetHelperStep(helpVo)
- self:SaveHelpStepToCookies()
- end
-
- --完成全部引导,避免触发下一步
- function GuideModel:FinishAll( helpVo )
- if helpVo == nil then
- return
- end
- GlobalEventSystem:Fire(EventName.CLOSE_GUIDE_PROMPT_VIEW)
- local voList
- local step = helpVo.step
- local type = helpVo.type
- if type == GuideModel.LEVEL_TRIGGER_TYPE then
- voList = self:GetLevelConfig(helpVo.lv)
- elseif type == GuideModel.TASK_TRIGGER_TYPE then
- voList = self:GetTaskConfig(helpVo.task_id)
- end
- for k,v in pairs(voList) do
- v.isEnd = true
- self:SetHelperStep(v)
- end
- self.curr_trigger_type = nil
- self.curr_help_type = nil
- self.curr_help_step = nil
- self.curr_help_vo = nil
-
- self:SaveHelpStepToCookies()
- end
-
- --获取下一个步骤引导数据
- function GuideModel:GetNextHelpVo(helpVo)
-
- if helpVo == nil then
- return
- end
-
- local voList
- local step = helpVo.step
- local type = helpVo.type
-
- if type == GuideModel.LEVEL_TRIGGER_TYPE then
- voList = self:GetLevelConfig(helpVo.lv)
- elseif type == GuideModel.TASK_TRIGGER_TYPE then
- voList = self:GetTaskConfig(helpVo.task_id)
- end
-
- if voList and #voList > step then
- return voList[step + 1]
- end
-
- return nil
- end
-
- --获取下一个步骤引导数据
- function GuideModel:HasHelperExetuteWhenChangeScene()
- if self.curr_help_type and self.curr_help_vo then
- return self.curr_help_vo
- end
- return false
- end
-
- --隐藏UI层的UI
- function GuideModel:HideUILayUI( )
- -- local go = panelMgr:GetParent("UI")
- -- if go then
- -- go.gameObject:SetActive(false)
- -- end
- -- go = panelMgr:GetParent("Top")
- -- if go then
- -- go.gameObject:SetActive(false)
- -- end
- end
-
- function GuideModel:ShowUILayUI( )
- -- local go = panelMgr:GetParent("UI")
- -- if go then
- -- go.gameObject:SetActive(true)
- -- end
- -- go = panelMgr:GetParent("Top")
- -- if go then
- -- go.gameObject:SetActive(true)
- -- end
- end
-
- --是否当前正在执行的引导
- function GuideModel:IsCurrHelper(help_type,step)
- if not self.scene_init_finish then
- return false
- end
-
- local vo = self:GetHelpVo(help_type,step)
- return vo
- end
-
- --不需要缓存了,直接拿当前触发的引导数据
- function GuideModel:GetCurHelpTypeAndStep(help_type, step)
- local help_vo = self:GetCurHelpVo()
- if help_vo then
- --指定类型跟步骤,就要匹配一下当前的引导是否是想要的
- if help_type and step then
- if help_type == help_vo.help_type and step == help_vo.step then
- return help_vo, help_vo.help_type, help_vo.step
- end
- else
- return help_vo, help_vo.help_type, help_vo.step
- end
- end
- end
-
-
- function GuideModel:GetHelpVo(help_type, step)
- if not self.scene_init_finish then
- return false
- end
-
- local help_vo = self:GetCurHelpTypeAndStep(help_type, step)
- local help_list = {}
- if help_vo and help_vo.task_id then
- help_list = self:GetTaskConfig(help_vo.task_id)
- end
- return help_vo, (step == #help_list and step > 0)
-
- --[[
- --需要走缓存的,基本不用了
- local lvList = self:GetLvCookieList()
- for k,v in pairs(lvList) do
- if not v.isEnd and v.step==step then
- local helpList = self:GetLevelConfig(v.lv)
- if helpList and helpList[v.step] then
- if helpList[v.step].help_type==help_type then
- return helpList[v.step], step == #helpList
- end
- end
- end
- end
- local taskList = self:GetTaskCookieList()
- for k,v in pairs(taskList) do
- if not v.isEnd and v.step==step then
- local helpList = self:GetTaskConfig(v.task_id)
- if helpList and helpList[v.step] then
- if helpList[v.step].help_type==help_type then
- return helpList[v.step], step == #helpList
- end
- end
- end
- end
- ]]
- end
-
- --创建客户端怪物
- function GuideModel:CreateClientMonster()
- self:CreateMonster(1,GuideModel.MONSTER_ID,GuideModel.MONSTER_POS[1])
- self:CreateMonster(2,GuideModel.MONSTER_ID,GuideModel.MONSTER_POS[2])
- self:CreateMonster(3,GuideModel.MONSTER_ID,GuideModel.MONSTER_POS[3])
- end
-
- --创建怪物
- function GuideModel:DeleteClientMonster()
- SceneManager.Instance:DeleteClientMonstersByInstanceId(1)
- SceneManager.Instance:DeleteClientMonstersByInstanceId(2)
- SceneManager.Instance:DeleteClientMonstersByInstanceId(3)
- end
-
- --创建怪物
- function GuideModel:CreateMonster(instance_id,mon_id,pos,assign_angle)
-
- local monsterVo = MonsterVo.New()
- monsterVo.instance_id = instance_id
- monsterVo.type_id = mon_id
-
- local cfg_data = ConfigItemMgr.Instance:GetMonsterDataItem(monsterVo.type_id)
-
- if cfg_data then
- monsterVo.monster_res = cfg_data.icon
- monsterVo.name = cfg_data.name
- monsterVo.type = 0
- monsterVo.move_speed = cfg_data.speed
- monsterVo.icon_scale = tonumber(cfg_data.icon_scale)
- end
-
- monsterVo:SetBasePropertyFromConfig()
-
- monsterVo.pos_x = pos.x
- monsterVo.pos_y = pos.y
-
- if monsterVo.monster_res == 0 then
- return --暂时没处理
- else
- monsterVo.guaji_flag = 1
- end
-
- monsterVo.level = 1
- monsterVo.hp=1
- monsterVo.mp=1
- monsterVo.maxHp=1
- monsterVo.maxMp=1
- monsterVo.is_story = true
- monsterVo.guaji_flag = 0
- monsterVo.hide_flag = false
- monsterVo.can_attack = 1
- monsterVo.assign_angle = assign_angle
- monsterVo.is_client_monster = true --是否是客户端怪物
- print("= = = = =创建怪物xxx:", monsterVo,monsterVo.name,monsterVo.instance_id, monsterVo.type)
- SceneManager.Instance:AddMonsterVo(monsterVo, false)
- end
-
- --是否是客户端怪物
- function GuideModel:IsClientMonster(instance_id)
- return instance_id == 1 or instance_id == 2 or instance_id == 3
- end
-
- --是否是ActivityIconView强制引导
- function GuideModel:IsTopForceMask( )
- local helpVo = self:GetCurHelpVo()
- if helpVo then
- local param = tonumber(helpVo.param)
- if param and param == 1 or param == 2 then
- return true
- end
- end
-
- return false
- end
-
- --是否是RightBottomView强制引导
- function GuideModel:IsBottomForceMask( )
- -- local helpVo = self:GetCurHelpVo()
- -- if helpVo then
- -- local param = tonumber(helpVo.param)
- -- if param and param == 1 or param == 4 or param == 5 or param == 6 or param == 10 or param == 12 then
- -- return true
- -- end
- -- end
-
- return false
- end
-
- --如果是第三步骤 删除
- function GuideModel:TryHideGuidePromptView()
- if self.curr_help_step == 3 then
- GlobalEventSystem:Fire(EventName.CLOSE_GUIDE_PROMPT_VIEW)
- end
- end
-
- --是否怪物在九宫格 而且判断是否做完打怪任务,做完就不创建了
- function GuideModel:IsMonsterNearPlayer()
- local role = Scene.Instance:GetMainRole()
- if role then
- local real_pos_x, real_pos_y = role:GetRealPos()
- local distance = GameMath.GetDistance(real_pos_x,real_pos_y,GuideModel.MONSTER_POS[2].x,GuideModel.MONSTER_POS[2].y)
-
- if distance < 4000000 then
- return true
- else
- return false
- end
- else
- return false
- end
- end
-
-
- --把断线不需要重新执行的引导设置为执行完
- function GuideModel:FinishOverHelp( )
-
- local lvList = self:GetLvCookieList()
- for k,v in pairs(lvList) do
- if not v.isEnd then
- local helpList = self:GetLevelConfig(v.lv)
- if helpList and helpList[v.step] and self:IsOverHelp(v.help_type) then
- v.isEnd = true
- end
- end
- end
-
- local taskList = self:GetTaskCookieList()
- for k,v in pairs(taskList) do
- if not v.isEnd then
- local helpList = self:GetTaskConfig(v.task_id)
- if helpList and helpList[v.step] and self:IsOverHelp(v.help_type) then
- v.isEnd = true
- end
- end
- end
-
- self:SaveHelpStepToCookies()
- end
-
- --重连不触发的引导类型
- function GuideModel:IsOverHelp( type )
- if type == HelpType.NEW_FUNC_OPEN or type == HelpType.OPEN_UI_VIEW
- or type == HelpType.ENTER_MISSION or type == HelpType.CAST_SKILL
- or type == HelpType.OPEN_LIST_SHOW_ICON
- or type == HelpType.DELAY_TIME
- or type == HelpType.CONTINUM_TASK or type == HelpType.CONTINUM_TASK
- or type == HelpType.HIDE_SMALL_UI or type == HelpType.SHOW_SMALL_UI
- or type == HelpType.SHOW_CHAPTER or type == HelpType.TASK_ITEM_SHOW then
- return true
- end
- end
-
-
- --是否有改变降神引导
- function GuideModel:IsChangeGodTime()
- return self.is_change_god_time
- end
-
-
- function GuideModel:IsSceneInitFinish()
- return self.scene_init_finish
- end
-
- function GuideModel:TriggerBreakGuide()
- if not self:IsSceneInitFinish() then
- return
- end
- if self.scene_init_finish and TaskModel:getInstance().notMain == true then
- TaskModel:getInstance():DefaultTaskShowArrow()
- end
- end
-
- function GuideModel:TriggerBreakLevelGuide()
- if not self:IsSceneInitFinish() then
- return
- end
-
- if not TaskModel:getInstance().showExtendTip then
- return
- end
-
- if self.scene_init_finish then
- GlobalEventSystem:Fire(EventName.TEST_HELP_STEP, 999991017)
- GlobalEventSystem:Fire(EventName.IS_SHOW_TRUN_MASK_HELPER)
- end
- end
-
- function GuideModel:SetNeedFinishGuideFirst(bool)
- self.need_finish_guide_first = bool
- if bool then
- setTimeout(function()
- GuideModel:getInstance():SetNeedFinishGuideFirst(false)
- end,3)
- end
- end
-
- function GuideModel:IsNeedFinishGuideFirst()
- return self.need_finish_guide_first
- end
-
- function GuideModel:StopTask()
- if SceneManager:getInstance():IsMainCityAndFieldScene() then
- GlobalEventSystem:Fire(EventName.STOP_AUTO_DO_TASK)
- end
- end
-
- function GuideModel:BeginTask(layout_file,need_do_task)
- need_do_task = need_do_task == nil and true or need_do_task
- if need_do_task and SceneManager:getInstance():IsMainCityAndFieldScene() then
- GlobalEventSystem:Fire(EventName.START_AUTO_DO_TASK)
- end
- GlobalEventSystem:Fire(EventName.CLOSE_GUIDE_PROMPT_VIEW,layout_file)
- end
-
- function GuideModel:SetHideSmallUI(bool)
- self.is_hide_small_ui = bool
-
- if bool then
- if self.hide_timer_id ~= nil then
- GlobalTimerQuest:CancelQuest(self.hide_timer_id)
- self.hide_timer_id = nil
- end
- --加入定时器保护 防止一直为true
- local function onTimer()
- self.is_hide_small_ui = false
- self.hide_timer_id = nil
- end
- self.hide_timer_id = GlobalTimerQuest:AddDelayQuest(onTimer, 5)
- end
- end
-
- function GuideModel:IsHideSmallUI()
- return self.is_hide_small_ui
- end
-
- function GuideModel:SetNeedOpenVipView(bool)
- self.need_open_vip_view = bool
- end
-
- function GuideModel:SetPromptViewOpenState(bool)
- self.is_prompt_view_open = bool
- end
-
- function GuideModel:IsPromptViewOpen()
- return self.is_prompt_view_open
- end
-
- function GuideModel:SetNeedExecuteLottery(bool)
- self.need_excute_lottery = bool
- end
-
- function GuideModel:IsNeedExecuteLottery()
- return self.need_excute_lottery
- end
-
- function GuideModel:IsPromptViewOpen()
- return self.is_prompt_view_open
- end
-
- function GuideModel:CanShowVipExperienceView()
- return SceneManager.Instance:IsMainCityorYieldScene() and not self:IsPromptViewOpen() and not self:IsHideSmallUI()
- end
-
- function GuideModel:SetShowItemUseAfterCloseView(bool)
- self.show_item_use_after_close_view = bool
- end
-
- function GuideModel:IsNeedhowItemUseAfterCloseView()
- return self.show_item_use_after_close_view
- end
-
- function GuideModel:IsOpenViewNeedStop()
- return self.open_view_need_stop
- end
-
- function GuideModel:SetOpenViewNeedStopFlag(bool)
- self.open_view_need_stop = bool
- end
-
- function GuideModel:IsNeedDelayExecuteGuide()
- return self.need_delay_execute_guide
- end
-
- function GuideModel:SetNeedDelayExecuteGuide(bool)
- self.need_delay_execute_guide = bool
- end
-
- function GuideModel:IsGemMissionExecuteTask()
- return self.gem_mission_execute_task
- end
-
- function GuideModel:SetGemMissionExecuteTask(bool)
- self.gem_mission_execute_task = bool
- end
-
- function GuideModel:SetGuideCachePos(btn_trans, pos_type)
- if not self.cache_guide_pos_list[pos_type] then
- if btn_trans then
- local root_wnd = GameObject()
- root_wnd.transform:SetParent(btn_trans)
- root_wnd.transform.localPosition = v or Vector3(0,0,0)
- root_wnd.transform.localScale = Vector3(1,1,1)
- root_wnd.transform:SetParent(panelMgr:GetParent("Main").transform)
- LuaViewManager.PuskMainCanvasCon(lua_viewM, root_wnd.transform)
- self.cache_guide_pos_list[pos_type] = root_wnd.transform.localPosition
- destroy(root_wnd)
- end
- end
- end
-
- function GuideModel:GetGuideCachePos(pos_type)
- return self.cache_guide_pos_list[pos_type] or Vector3(0,0,0)
- end
-
- --终身事件列表,只会保存已完成的
- function GuideModel:SetLifelongHelpList( list )
- for k,v in pairs(list or {}) do
- self.lifelong_help_list[v.id] = v.state
- end
- end
-
- --终身事件存储
- function GuideModel:SetLifelongHelp( vo )
- self.lifelong_help_list[vo.id] = vo.state
- end
-
- --终身事件查询
- function GuideModel:IsLifelongHelpFinish( id )
- if self.lifelong_help_list[id] then
- return self.lifelong_help_list[id] == 1
- end
- return false
- end
-
- --检测一代装备不满足全身紫色及以上品质(不包括守护和首饰),则触发市场引导
- function GuideModel:NeedTriggerMarketOpenType( )
- local suit_1_3_num = GoodsModel:getInstance():GetEquipCurSuitOrangeNum(1,1,3)
- return suit_1_3_num and suit_1_3_num < 7
- end
-
- --是否已经触发过引导
- function GuideModel:IsCheckedShowGuide(guide_id)
- return self.cache_show_guide[guide_id]
- end
-
- --是否已经触发过引导
- function GuideModel:SetShowedGuide(guide_id)
- if not guide_id then return end
- self.cache_show_guide[guide_id] = true
- end
-
-
-
|