源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

437 lines
14 KiB

пре 1 месец
  1. require("game.common.GoodsTooltips")
  2. require("game.common.NiceGoodsTips")
  3. require("game.common.EquipToolTips")
  4. require("game.common.EquipToolTipsAttr")--属性item
  5. require("game.common.EquipToolTipsBaseAttr")--基础属性item
  6. require("game.common.EquipToolTipsZhuoYueAttr")--高级属性item
  7. require("game.common.EquipToolTipsSuitAttr")--套装属性item
  8. require("game.common.EquipToolTipsGemstoneAttr")--宝石属性item
  9. require("game.common.EquipToolTipsDraconicAttr")--刻印属性item
  10. require("game.common.EquipToolTipsSkillAttr")--技能属性item
  11. require("game.common.EquipIdentifyTips")
  12. require("game.common.EquipStoneItem")
  13. require("game.common.EquipCompareTips")
  14. require("game.common.CommonTips")
  15. require("game.common.GoodsTreasureTips")
  16. require("game.common.EquipShowTips")
  17. require("game.common.SkillToolTips")
  18. require("game.common.GoodsUseToolTips")
  19. require("game.common.BeastToolTips")
  20. require("game.common.BeastShowTips")
  21. require("game.common.BeastCompareTips")
  22. require("game.common.DesignToolTips")
  23. require("game.common.SealToolTips")
  24. require("game.common.SealToolDecomItem")
  25. require("game.common.SealCompareTips")
  26. require("game.common.SealShowTips")
  27. require("game.common.SealProTips")
  28. require("game.common.MarriageToolTips")
  29. require("game.common.RewardLookView")
  30. require("game.common.GetGoodsTips")
  31. require("game.common.GetGoodsItem")
  32. require("game.common.DsgtToolTip")
  33. require("game.common.LuckyProbToolTips")
  34. require("game.common.LuckyProbItem")
  35. require("game.common.UISimpleToolTips")
  36. require("game.common.WingInfoTips")
  37. require("game.common.HorseEquipInfoTips")
  38. require("game.common.DeityEquipTips")
  39. require("game.common.HorseEquipCompareTips")
  40. require("game.common.GetGoodsJumpTips")
  41. require("game.common.GetPicTips")
  42. require("game.common.GetPicItem")
  43. require("game.common.ComposeShowTips")
  44. require("game.common.CommonInstructionView")
  45. require("game.common.CommonInstructionItem")
  46. require("game.common.GiftPreviewView")
  47. require("game.common.GiftPreviewItem")
  48. require("game.common.goodsTooltipsAttrItem")
  49. require("game.common.GoodsTooltipsTextItem")
  50. require("game.common.PsionicToolTips")--圣物装备展示tips
  51. require("game.common.PsionicToolTipsItem")--圣物装备展示tips描述节点
  52. require("game.common.PsionicToolTipsCompare")--圣物装备展示对比tips界面
  53. UIToolTipMgr = UIToolTipMgr or BaseClass(BaseController)
  54. function UIToolTipMgr:__init()
  55. UIToolTipMgr.Instance = self
  56. self.GoodsTooltips = nil
  57. end
  58. function UIToolTipMgr:getInstance()
  59. if UIToolTipMgr.Instance == nil then
  60. UIToolTipMgr.New()
  61. end
  62. return UIToolTipMgr.Instance
  63. end
  64. --物品tips
  65. --[[
  66. not_show_getway
  67. open_show_get_way
  68. hide_base_con (使)
  69. --]]
  70. function UIToolTipMgr:AppendGoodsTips(type_id, x, y, goods_vo, show_btn_list, parm_list, not_show_getway,open_show_get_way,force_open_show_get_way,hide_base_con)
  71. local goods_basic = GoodsModel:getInstance():GetGoodsBasicByTypeId(type_id)
  72. print("HWR:UIToolTipMgr [58]type_id: ",type_id)
  73. if goods_vo then
  74. local kind = GiftModel:getInstance():checkGiftKind(goods_vo.type_id)
  75. if kind == 1 or kind == 2 or kind == 3 or kind == 4 then --普通礼包
  76. GiftModel:getInstance():requestGetGiftUseTimes(goods_vo.type_id)
  77. end
  78. end
  79. -------------------------
  80. -- 进阶装备
  81. if FosterModel:GetInstance():GetEquipConf( type_id ) then
  82. FosterModel:GetInstance():ShowEquipComTip( type_id, open_show_get_way,hide_base_con )
  83. return
  84. end
  85. -------------------------
  86. -- local need_show_nice = true
  87. -- if parm_list and parm_list.not_nice_tip then
  88. -- need_show_nice = false
  89. -- end
  90. -- if (goods_basic.type == GoodsModel.TYPE.FASHION or goods_basic.type == GoodsModel.TYPE.DESIGNATION or (goods_basic.type == GoodsModel.TYPE.CHILDTOY and goods_basic.subtype == 4)) and need_show_nice then
  91. -- if self.NiceGoodsTips == nil then
  92. -- self.NiceGoodsTips = NiceGoodsTips.New()
  93. -- end
  94. -- self.NiceGoodsTips:Open(type_id, x, y, goods_vo, show_btn_list, parm_list)
  95. -- else
  96. if self.GoodsTooltips == nil then
  97. self.GoodsTooltips = GoodsTooltips.New()
  98. end
  99. self.GoodsTooltips:Open(type_id, x, y, goods_vo, show_btn_list, parm_list, not_show_getway,open_show_get_way,force_open_show_get_way)
  100. --end
  101. end
  102. -- 关闭当前打开的goodstips 有需要的后续补充
  103. function UIToolTipMgr:CloseGoodsTips()
  104. if self.NiceGoodsTips then
  105. self.NiceGoodsTips:Close()
  106. end
  107. if self.GoodsTooltips then
  108. self.GoodsTooltips:Close()
  109. end
  110. end
  111. --装备tips
  112. --show_btn_list:自定义需要显示的按钮 使用方法: show_btn_list = {"Button1","Button2",...}
  113. function UIToolTipMgr:AppendEquipTips(type_id, x, y, goods_vo,role_id,hide_btn,show_btn_list,key_value, extra_data, open_show_get_way,color_power_lv)
  114. if not type_id then
  115. print("没有传物品ID哦!!!!!!")
  116. return
  117. end
  118. local equip_cfg = EquipModel:GetEquipmentCfg(type_id)
  119. if not equip_cfg or not equip_cfg.equip_type then
  120. print("没有装备配置哦"..type_id)
  121. return
  122. end
  123. if self.EquipToolTips == nil then
  124. self.EquipToolTips = EquipToolTips.New(equip_cfg.equip_type)
  125. end
  126. local equip_data = {--重新构造一份
  127. type_id = type_id,
  128. x = x,
  129. y = y,
  130. goods_vo = goods_vo,
  131. role_id = role_id,
  132. hide_btn = hide_btn,
  133. show_btn_list = show_btn_list,
  134. key_value = key_value,
  135. open_show_get_way = open_show_get_way,
  136. color_power_lv = color_power_lv,
  137. }
  138. if key_value == "shop_buy" then
  139. equip_data.shop_data = extra_data
  140. elseif key_value == "market_bag" then
  141. equip_data.market_data = extra_data
  142. elseif key_value == "rank_equip" then
  143. equip_data.have_career = extra_data
  144. end
  145. if self.EquipToolTips and self.EquipToolTips:HasOpen() then
  146. else
  147. self.EquipToolTips:Open(equip_data)
  148. end
  149. end
  150. function UIToolTipMgr:AppendSkillTips(skill_id,skill_lv,x,y,conditionStr,is_rasto,is_mount,activeStr)
  151. if self.SkillToolTips == nil then
  152. self.SkillToolTips = SkillToolTips.New()
  153. end
  154. self.SkillToolTips:Open(skill_id, skill_lv, x, y,conditionStr,is_rasto,is_mount,activeStr)
  155. end
  156. --称号tips
  157. function UIToolTipMgr:AppendDesignTips(design_id,x,y,conditionStr)
  158. if self.DesignToolTips == nil then
  159. self.DesignToolTips = DesignToolTips.New()
  160. end
  161. self.DesignToolTips:Open(design_id, x, y,conditionStr)
  162. end
  163. -- 显示物品使用情况的tips
  164. function UIToolTipMgr:AppendGoodsUseInfoTips(goods_id,max_times,attr,use_times,x,y,module_id, combat)
  165. if self.GoodsUseToolTips == nil then
  166. self.GoodsUseToolTips = GoodsUseToolTips.New()
  167. end
  168. self.GoodsUseToolTips:Open(goods_id,max_times,attr,use_times,x,y,module_id, combat)
  169. end
  170. --装备鉴定tips
  171. function UIToolTipMgr:AppendEquipIdentifyTips(type_id, x, y, goods_vo)
  172. if self.EquipIdentifyTips == nil then
  173. self.EquipIdentifyTips = EquipIdentifyTips.New()
  174. end
  175. self.EquipIdentifyTips:Open(type_id, x, y, goods_vo)
  176. end
  177. --通用Tips
  178. function UIToolTipMgr:AppendCommonTips(goods_id , x , y , main_type)
  179. if self.CommonTips == nil then
  180. self.CommonTips = CommonTips.New()
  181. end
  182. self.CommonTips:Open(goods_id , x , y , main_type)
  183. end
  184. --显示装备信息tips
  185. function UIToolTipMgr:AppendEquipShowTips(goods_vo, x, y, type, callback)
  186. if self.EquipShowTips == nil then
  187. self.EquipShowTips = EquipShowTips.New()
  188. end
  189. self.EquipShowTips:Open(goods_vo, x, y, type, callback)
  190. end
  191. --翅膀装备tips
  192. function UIToolTipMgr:AppendWingTips(type_id, x, y, type, off_callback, replace_callback)
  193. if self.WingInfoTips == nil then
  194. self.WingInfoTips = WingInfoTips.New()
  195. end
  196. self.WingInfoTips:Open(type_id, x, y, type, off_callback, replace_callback)
  197. end
  198. --幻兽装备tips
  199. function UIToolTipMgr:AppendBeastTips(type_id, x, y, goods_vo, hide_btn)
  200. if self.BeastToolTips == nil then
  201. self.BeastToolTips = BeastToolTips.New()
  202. end
  203. self.BeastToolTips:Open(type_id, x, y, goods_vo, hide_btn)
  204. end
  205. --显示幻兽装备信息tips
  206. function UIToolTipMgr:AppendBeastShowTips(goods_vo, x, y, type)
  207. if self.BeastShowTips == nil then
  208. self.BeastShowTips = BeastShowTips.New()
  209. end
  210. self.BeastShowTips:Open(goods_vo, x, y, type)
  211. end
  212. --圣印装备tips
  213. --show_btn_list:自定义需要显示的按钮 使用方法: show_btn_list = {"Button1","Button2",...}
  214. function UIToolTipMgr:AppendSealTips(type_id, x, y, goods_vo,role_id,hide_btn,show_btn_list)
  215. if self.SealToolTips == nil then
  216. self.SealToolTips = SealToolTips.New()
  217. end
  218. self.SealToolTips:Open(type_id, x, y, goods_vo,role_id,hide_btn,show_btn_list)
  219. end
  220. --显示圣印装备信息tips
  221. function UIToolTipMgr:AppendSealShowTips(goods_vo, x, y, type)
  222. if self.SealShowTips == nil then
  223. self.SealShowTips = SealShowTips.New()
  224. end
  225. self.SealShowTips:Open(goods_vo, x, y, type)
  226. end
  227. --圣印属性加成tips
  228. function UIToolTipMgr:AppendSealProTips(x, y)
  229. if self.SealProTips == nil then
  230. self.SealProTips = SealProTips.New()
  231. end
  232. self.SealProTips:Open(x, y)
  233. end
  234. --显示婚姻装备tips
  235. function UIToolTipMgr:AppendMarriageTips(data, x, y)
  236. if self.MarriageTips == nil then
  237. self.MarriageTips = MarriageToolTips.New()
  238. end
  239. self.MarriageTips:Open(data, x, y)
  240. end
  241. --奖励查看tips
  242. function UIToolTipMgr:AppendRewardLookTips(data, kind, x, y)
  243. if self.RewardLookTips == nil then
  244. self.RewardLookTips = RewardLookView.New()
  245. end
  246. self.RewardLookTips:Open(data, kind, x, y)
  247. end
  248. --奖励查看tips
  249. function UIToolTipMgr:CloseRewardLookTips()
  250. if self.RewardLookTips and self.RewardLookTips:HasOpen() then
  251. self.RewardLookTips:Close()
  252. end
  253. end
  254. --获取途径tips
  255. function UIToolTipMgr:AppendGetGoodsTips(type_id, x, y)
  256. if self.GetGoodsTips == nil then
  257. self.GetGoodsTips = GetGoodsTips.New()
  258. end
  259. self.GetGoodsTips:Open(type_id, x, y)
  260. end
  261. --称号tips
  262. function UIToolTipMgr:AppendDsgtTips(dsgt_id, x, y)
  263. if self.dsgt_tips == nil then
  264. self.dsgt_tips = DsgtToolTip.New()
  265. end
  266. if not self.dsgt_tips:HasOpen() then
  267. self.dsgt_tips:Open(dsgt_id, x, y)
  268. end
  269. end
  270. --抽奖概率展示tips
  271. function UIToolTipMgr:AppendLuckyProbTips(module_id,sub_id,act_sub_type)--*act_sub_type活动子类型
  272. if self.lucky_prob_tips == nil then
  273. self.lucky_prob_tips = LuckyProbToolTips.New()
  274. end
  275. print("huangcong:UIToolTipMgr [start:300] :", module_id,sub_id,act_sub_type)
  276. self.lucky_prob_tips:Open(module_id,sub_id,act_sub_type)
  277. end
  278. --简单文本说明tips
  279. function UIToolTipMgr:AppendSimpleTips(desc, x, y, sx, sy)
  280. if not desc or desc == "" then
  281. return
  282. end
  283. if self.simple_tips == nil then
  284. self.simple_tips = UISimpleToolTips.New()
  285. end
  286. self.simple_tips:Open(desc, x, y, sx, sy)
  287. end
  288. function UIToolTipMgr:AppendOptionalItemTips(x, y, goods_type, goods_list, callback, item_type, grade)
  289. if self.optional_item_tips == nil then
  290. self.optional_item_tips = OptionalItemTips.New()
  291. end
  292. self.optional_item_tips:Open(x, y, goods_type, goods_list, callback, item_type, grade)
  293. end
  294. --显示坐骑装备tips
  295. function UIToolTipMgr:AppendHorseEquipInfoTips(type_id, x, y, goods_vo, type, basic_attr, attr_list, parm)
  296. if self.HorseEquipInfoTips == nil then
  297. self.HorseEquipInfoTips = HorseEquipInfoTips.New()
  298. end
  299. self.HorseEquipInfoTips:Open(type_id, x, y, goods_vo, type, basic_attr, attr_list, parm)
  300. end
  301. --神格装备tips
  302. function UIToolTipMgr:AppendDeityEquipTips(type_id, x, y, goods_id,goods_vo)
  303. if self.deity_equip_tips == nil then
  304. self.deity_equip_tips = DeityEquipTips.New()
  305. end
  306. self.deity_equip_tips:Open(type_id, x, y, goods_id,goods_vo)
  307. end
  308. --星痕装备tips
  309. function UIToolTipMgr:AppendStarShadowTips(type_id, goods_vo, x, y, is_from_bag, not_show_btn)
  310. if self.StarShadowTipView == nil then
  311. self.StarShadowTipView = StarShadowTipView.New()
  312. end
  313. self.StarShadowTipView:Open(type_id, goods_vo, x, y, is_from_bag, not_show_btn)
  314. end
  315. -- 与GetGoodsTips 差不多 但是是可以自己写想要的跳转界面的链接
  316. function UIToolTipMgr:AppendGetGoodsJumpTips(data, x, y, type_id)
  317. if self.GetGoodsJumpTips == nil then
  318. self.GetGoodsJumpTips = GetGoodsJumpTips.New()
  319. end
  320. self.GetGoodsJumpTips:Open(data, x, y, type_id)
  321. end
  322. --获取图鉴途径tips
  323. function UIToolTipMgr:AppendGetPicTips(pic_id, x, y)
  324. if self.GetPicTips == nil then
  325. self.GetPicTips = GetPicTips.New()
  326. end
  327. self.GetPicTips:Open(pic_id, x, y)
  328. end
  329. --合成装备信息tips
  330. function UIToolTipMgr:AppendComposeShowTips(goods_vo, x, y, off_callback, replace_callback)
  331. if self.ComposeShowTips == nil then
  332. self.ComposeShowTips = ComposeShowTips.New()
  333. end
  334. self.ComposeShowTips:Open(goods_vo, x, y, off_callback, replace_callback)
  335. end
  336. function UIToolTipMgr:OpenInstructionView(index)
  337. if self.CommonInstructionView == nil then
  338. self.CommonInstructionView = CommonInstructionView.New()
  339. end
  340. self.CommonInstructionView:Open(index)
  341. end
  342. function UIToolTipMgr:OpenDualGemstoneTips(type_id, x, y, goods_vo)
  343. if self.DualGemstoneTips == nil then
  344. self.DualGemstoneTips = DualGemstoneTips.New()
  345. end
  346. self.DualGemstoneTips:Open(type_id, x, y, goods_vo)
  347. end
  348. function UIToolTipMgr:OpenGiftPreviewView(data)
  349. if self.GiftPreviewView and self.GiftPreviewView:HasOpen() then
  350. self.GiftPreviewView:Close()
  351. self.GiftPreviewView = nil
  352. end
  353. if self.GiftPreviewView == nil then
  354. self.GiftPreviewView = GiftPreviewView.New()
  355. end
  356. self.GiftPreviewView:Open(data)
  357. end
  358. -- 圣物装备属性展示界面
  359. -- flag:展示时对应的目标按钮样式
  360. function UIToolTipMgr:AppendPsionicTips(data, x, y, flag, type_id)
  361. if not data and not type_id then
  362. return
  363. end
  364. flag = flag or PsionicConst.ArmorItemFlag.Bag
  365. if not self.PsionicToolTips then
  366. self.PsionicToolTips = PsionicToolTips.New()
  367. end
  368. -- 通过装备id构造装备数据
  369. if not data and type_id then
  370. data = {type_id = type_id}
  371. data = GoodsModel:getInstance():GetPsionicEquipNecessaryData(data)
  372. end
  373. if not self.PsionicToolTips:HasOpen() then
  374. self.PsionicToolTips:Open(data, flag, type_id and true or nil)
  375. end
  376. end
  377. --战魂tips
  378. function UIToolTipMgr:AppendWarSoulTips(type_id, x, y, goods_vo ,role_id, hide_btn,show_btn_list, key_value, extra_data)
  379. if not type_id then
  380. print("没有传物品ID哦!!!!!!")
  381. return
  382. end
  383. if self.WarSoulWearGoodsTipView == nil then
  384. self.WarSoulWearGoodsTipView = WarSoulWearGoodsTipView.New()
  385. end
  386. local warSoul_data = {--重新构造一份
  387. type_id = type_id,
  388. x = x,
  389. y = y,
  390. goods_vo = goods_vo,
  391. role_id = role_id,
  392. hide_btn = hide_btn,
  393. key_value = key_value,
  394. }
  395. self.WarSoulWearGoodsTipView:Open(warSoul_data)
  396. end