源战役客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

486 行
20 KiB

  1. EquipTipView = EquipTipView or BaseClass(BaseView)
  2. function EquipTipView:__init()
  3. self.base_file = "common"
  4. self.layout_file = "EquipTipView"
  5. self.layer_name = "Top"
  6. self.close_mode = CloseMode.CloseDestroy
  7. self.change_scene_close = true
  8. self.use_background = true
  9. self.click_bg_toClose = true
  10. self.destroy_imm = true --是否一关闭就销毁
  11. self:AddPreLoadList("common",{"EquipStoneItem", "EquipFuMoItem"})
  12. self.model = EquipModel:getInstance()
  13. self.fumo_item_list = {}
  14. self.stone_item_list = {}
  15. self.shenwen_label_list = {}
  16. self.shenwen_value_list = {}
  17. self.load_callback = function ( )
  18. self:LoadSuccess()
  19. self:AddEvents()
  20. end
  21. self.open_callback = function ( )
  22. self:OpenCallBack()
  23. end
  24. self.destroy_callback = function ( )
  25. self:DestroyCallback()
  26. end
  27. end
  28. function EquipTipView:CenterView()
  29. -- local width,height = self.container:GetVectorValue(WidgetProperty.Size)
  30. -- self.is_show_soul = self.soul_con:GetBool(WidgetProperty.Visible)
  31. -- if not is_show_soul then
  32. -- width, _ = self.bg:GetVectorValue(WidgetProperty.Size)
  33. -- end
  34. -- local screen_view = Game.UI:GetScreenView()
  35. -- self.container:SetVectorValue(WidgetProperty.Position, screen_view.x/2 - width/2, screen_view.y/2 - height/2)
  36. -- self.mask:SetVectorValue(WidgetProperty.Size, screen_view.x, screen_view.y)
  37. -- self.mask:SetVectorValue(WidgetProperty.Position, 0, 0)
  38. end
  39. function EquipTipView:LoadSuccess()
  40. self.bg = self:GetChild("bg")
  41. self.icon_con = self:GetChild("icon_con")
  42. self.nameText = self:GetChild("nameText"):GetComponent("Text")
  43. self.step_num = self:GetChild("step_num"):GetComponent("Text")
  44. self.level = self:GetChild("level"):GetComponent("Text")
  45. self.equip_pos = self:GetChild("equip_pos"):GetComponent("Text")
  46. self.fight = self:GetChild("fight"):GetComponent("Text")
  47. self.star_conta = self:GetChild("star_conta")
  48. self.ScrollView = self:GetChild("ScrollView")
  49. self.ScrollViewContent = self:GetChild("ScrollView/Viewport/Content")
  50. self.ScrollViewViewport = self:GetChild("ScrollView/Viewport")
  51. self.line1 = self:GetChild("ScrollView/Viewport/Content/line1")
  52. self.line2 = self:GetChild("ScrollView/Viewport/Content/line2")
  53. self.line3 = self:GetChild("ScrollView/Viewport/Content/line3")
  54. self.line4 = self:GetChild("ScrollView/Viewport/Content/line4")
  55. self.line5 = self:GetChild("ScrollView/Viewport/Content/line5")
  56. self.basePro = self:GetChild("ScrollView/Viewport/Content/basePro"):GetComponent("Text")
  57. self.basePro_trams = self:GetChild("ScrollView/Viewport/Content/basePro")
  58. self.addPro = self:GetChild("ScrollView/Viewport/Content/addPro"):GetComponent("Text")
  59. self.addPro_trams = self:GetChild("ScrollView/Viewport/Content/addPro")
  60. self.stone_conta = self:GetChild("ScrollView/Viewport/Content/stone_conta")
  61. self.fumo_conta = self:GetChild("ScrollView/Viewport/Content/fumo_conta")
  62. self.shenwen_conta = self:GetChild("ScrollView/Viewport/Content/shenwen_conta").gameObject
  63. self.shenwen_fight = self:GetChild("ScrollView/Viewport/Content/shenwen_conta/shenwen_fight")
  64. self.btn_conta = self:GetChild("btn_conta")
  65. self.strengthBtn = self:GetChild("btn_conta/strengthBtn").gameObject
  66. self.strengthBtn_dot = self:GetChild("btn_conta/strengthBtn/dot").gameObject
  67. self.insertBtn = self:GetChild("btn_conta/insertBtn").gameObject
  68. self.insertBtn_dot = self:GetChild("btn_conta/insertBtn/dot").gameObject
  69. self.sell_conta = self:GetChild("sell_conta")
  70. self.sell_icon = self:GetChild("sell_conta/icon"):GetComponent("Image")
  71. self.price_label = self:GetChild("sell_conta/price_label"):GetComponent("Text")
  72. for i = 1, 3 do
  73. self.shenwen_label_list[i] = self:GetChild("ScrollView/Viewport/Content/shenwen_conta/txt_soul_attr_" .. i):GetComponent("Text")
  74. self.shenwen_value_list[i] = self:GetChild("ScrollView/Viewport/Content/shenwen_conta/txt_soul_lv_" .. i):GetComponent("Text")
  75. end
  76. self.txt_soul_suit_attr = self:GetChild("ScrollView/Viewport/Content/shenwen_conta/txt_soul_suit_attr"):GetComponent("Text")
  77. self.txt_soul_suit_lv = self:GetChild("ScrollView/Viewport/Content/shenwen_conta/txt_soul_suit_lv"):GetComponent("Text")
  78. self.shenwen_fight = self:GetChild("ScrollView/Viewport/Content/shenwen_conta/shenwen_fight"):GetComponent("Text")
  79. self.icon_item = AwardItem.New(self.icon_con, false)
  80. self.icon_item:ChangeCountVisible(false)
  81. -- self.nodes = {
  82. -- "txt_name","txt_type","txt_lv","txt_power","txt_base_attr","txt_strong_attr","spr_item","spr_chuang","container","mask","bg","txt_sten","soul_con","txt_soul_attr_1","txt_soul_attr_2","txt_soul_attr_3","txt_soul_suit_attr","soul_power_con","txt_soul_lv_1","txt_soul_lv_2","txt_soul_lv_3","txt_soul_suit_lv"
  83. -- }
  84. -- for k,v in pairs(self.nodes) do
  85. -- if v ~= "" then
  86. -- self[v] = assert(self:GetChild(v), v)
  87. -- end
  88. -- end
  89. -- self.spr_item = AwardItem.New(self.spr_item, false)
  90. -- self.spr_item:SetMinEffectColor(BuildModel.MinShowEffectColor)
  91. -- self.spr_item:setItemSize(90, 90)
  92. -- self.txt_sten = UINumber.New(self.txt_sten, UINumber.Style[4])
  93. -- self.txt_sten:setNumber("+0")
  94. -- self:CenterView()
  95. -- self.mask:SetBool(WidgetProperty.NeedMouse, true)
  96. -- self.bg:SetBool(WidgetProperty.NeedMouse, true)
  97. -- self.spr_star = {}
  98. -- for i=1,5 do
  99. -- self.spr_star[i] = self:GetChild("spr_star_"..i)
  100. -- end
  101. -- self.soul_power_con = PowerSubView.New(self.soul_power_con, PowerSubView.Type.Static)
  102. -- self.txt_gem_name = {}
  103. -- self.ep_lock_spr = {}
  104. -- self.txt_gem_attr = {}
  105. -- self.txt_refine = {}
  106. -- self.txt_refine_num = {}
  107. -- self.spr_refine = {}
  108. -- for i=1,3 do
  109. -- self.ep_lock_spr[i] = self:GetChild("ep_lock_spr"..i)
  110. -- self.txt_gem_name[i] = self:GetChild("txt_gem_name"..i)
  111. -- self.txt_gem_attr[i] = self:GetChild("txt_gem_attr"..i)
  112. -- self.txt_refine[i] = self:GetChild("txt_refine"..i)
  113. -- self.txt_refine_num[i] = self:GetChild("txt_refine_num"..i)
  114. -- self.spr_refine[i] = self:GetChild("spr_refine"..i)
  115. -- self.spr_refine[i]:SetString(ImageBoxProperty.Source, GameRes.PathTool.IconGoodsPic(103000+i-1))
  116. -- end
  117. end
  118. function EquipTipView:AddEvents()
  119. local function onClickBtnHandler(target)
  120. if target == self.strengthBtn then
  121. GlobalEventSystem:Fire(EventName.OPEN_BUILD_VIEW, 1)
  122. elseif target == self.insertBtn then
  123. GlobalEventSystem:Fire(EventName.OPEN_BUILD_VIEW, 2)
  124. end
  125. self:Close()
  126. end
  127. AddClickEvent(self.strengthBtn, onClickBtnHandler)
  128. AddClickEvent(self.insertBtn, onClickBtnHandler)
  129. end
  130. function EquipTipView:OpenCallBack()
  131. self.isLoaded = true
  132. self:UpdateView()
  133. end
  134. function EquipTipView:UpdateView( )
  135. if not self.data then return end
  136. local gvo=GoodsModel.Instance:GetGoodsBasicByTypeId(self.data.type_id)
  137. local name = EquipModel:getInstance():GetEquipName(self.data.type_id)
  138. -- self.txt_name:SetString(TextBoxProperty.Label, name)
  139. self.nameText.text = name .. " " .. HtmlColorTxt("+" .. self.data.stren, ColorUtil:GetColor(gvo.color))
  140. self.icon_item:SetData(self.data.type_id)
  141. local lv
  142. if self.is_other then
  143. lv = self.data.level
  144. else
  145. lv = RoleManager.Instance.mainRoleInfo.level
  146. end
  147. self.level.text = lv
  148. -- self.txt_lv:SetString(TextBoxProperty.Label, lv.." (随等级自动提升)")
  149. -- self.txt_type:SetString(TextBoxProperty.Label, EquipModel.Name[self.data.cell])
  150. self.equip_pos.text = EquipModel.Name[self.data.cell]
  151. -- self:UpdateStar(self.data.stren)
  152. local attr_info = Config.Equipconfig[self.data.type_id]
  153. local base_attr_info = ErlangParser:GetInstance():Parse(attr_info.attr)
  154. local attr_str = WordManager:GetAttributeStr(base_attr_info[1][1])
  155. local addition_info = ErlangParser:GetInstance():Parse(attr_info.lev_attr)
  156. local addition_value = addition_info[1][2]
  157. base_attr_info[1][2] = base_attr_info[1][2]+addition_value*(lv-1)
  158. local base_power_value = base_attr_info[1][2]
  159. local base_power = HtmlColorTxt("+"..base_power_value, ColorUtil:GetColor(ColorUtil.GREEN))
  160. -- self.txt_base_attr:SetString(TextBoxProperty.Label, attr_str..":"..base_power)
  161. self.basePro.text = attr_str..""..base_power
  162. local all_power = self.model:GetEquipPower(self.data.cell,self.is_other)
  163. self.fight.text = all_power
  164. -- self.txt_power:SetString(TextBoxProperty.Label, all_power)
  165. -- self.txt_power:SetString(TextBoxProperty.Label, self.data.fight)
  166. -- Config.Equipstrenconfig
  167. local attr_str2, attr_value, attr_power = BuildModel:getInstance():GetStrengthAttrPower(self.data.type_id, self.data.stren)
  168. attr_value = HtmlColorTxt("+"..attr_value, ColorUtil:GetColor(ColorUtil.GREEN))
  169. self.addPro.text = attr_str2..""..attr_value
  170. -- self.txt_strong_attr:SetString(TextBoxProperty.Label, attr_str2..":"..attr_value)
  171. -- self.txt_sten:setNumber("+"..self.data.stren)
  172. -- self.txt_strong_attr:SetString(TextBoxProperty.Label, "攻击:+0")
  173. self:UpdateGemstones(self.data)
  174. self:UpdateRefine(self.data)
  175. self:UpdateShenWen(self.data)
  176. self:CenterView()
  177. self:HideOpenrateBtn(self.hide_btn)
  178. end
  179. --神纹
  180. function EquipTipView:UpdateShenWen( data )
  181. local info = data.soul_info
  182. local is_zeror = true
  183. local min_lv = 999
  184. for k,v in pairs(info or {}) do
  185. if v > 0 then
  186. is_zeror = false
  187. end
  188. if v < min_lv then
  189. min_lv = v
  190. end
  191. end
  192. if info and not is_zeror then
  193. -- self.soul_con:SetBool(WidgetProperty.Visible, true)
  194. self.line5.gameObject:SetActive(true)
  195. self.shenwen_conta:SetActive(true)
  196. local attr_name_str_1 = HtmlColorTxt("攻击:", "#BDAA8E")
  197. local attr_name_str_2 = HtmlColorTxt("生命:", "#BDAA8E")
  198. local attr_name_str_3 = HtmlColorTxt("防御:", "#BDAA8E")
  199. local soul_suit_lv_str = ""
  200. local soul_attr_str_1 = ""
  201. local soul_attr_str_2 = ""
  202. local soul_attr_str_3 = ""
  203. local sum_power = 0
  204. local max_width = 0
  205. local attr_lv = info[BuildModel.GemstoneType.Attack]
  206. local attr_str, attr_value, power = BuildModel:getInstance():GetCastSoulAttrPower(self.data.cell, BuildModel.GemstoneType.Attack, attr_lv)
  207. sum_power = sum_power + power
  208. attr_value = HtmlColorTxt("+"..attr_value, ColorUtil.GREEN)
  209. attr_lv = HtmlColorTxt(attr_lv, ColorUtil.GREEN)
  210. soul_attr_str_1 = " (攻击神纹:"..attr_lv.."级)"
  211. local attr_str = attr_name_str_1..attr_value
  212. -- self.txt_soul_attr_1:SetString(TextBoxProperty.Label, attr_str)
  213. self.shenwen_label_list[1].text = attr_str
  214. -- local txt_width, _ = self.txt_soul_attr_1:GetVectorValue(TextBoxProperty.TextSize)
  215. -- if txt_width > max_width then
  216. -- max_width = txt_width
  217. -- end
  218. local attr_lv = info[BuildModel.GemstoneType.Life]
  219. local attr_str, attr_value, power = BuildModel:getInstance():GetCastSoulAttrPower(self.data.cell, BuildModel.GemstoneType.Life, attr_lv)
  220. sum_power = sum_power + power
  221. attr_value = HtmlColorTxt("+"..attr_value, ColorUtil.GREEN)
  222. attr_lv = HtmlColorTxt(attr_lv, ColorUtil.GREEN)
  223. soul_attr_str_2 = " (生命神纹:"..attr_lv.."级)"
  224. local attr_str = attr_name_str_2..attr_value
  225. -- self.txt_soul_attr_2:SetString(TextBoxProperty.Label, attr_str)
  226. self.shenwen_label_list[2].text = attr_str
  227. -- local txt_width, _ = self.txt_soul_attr_2:GetVectorValue(TextBoxProperty.TextSize)
  228. -- if txt_width > max_width then
  229. -- max_width = txt_width
  230. -- end
  231. local attr_lv = info[BuildModel.GemstoneType.Defend]
  232. local attr_str, attr_value, power = BuildModel:getInstance():GetCastSoulAttrPower(self.data.cell, BuildModel.GemstoneType.Defend, attr_lv)
  233. sum_power = sum_power + power
  234. attr_value = HtmlColorTxt("+"..attr_value, ColorUtil.GREEN)
  235. attr_lv = HtmlColorTxt(attr_lv, ColorUtil.GREEN)
  236. soul_attr_str_3 = " (防御神纹:"..attr_lv.."级)"
  237. local attr_str = attr_name_str_3..attr_value
  238. -- self.txt_soul_attr_3:SetString(TextBoxProperty.Label, attr_str)
  239. self.shenwen_label_list[3].text = attr_str
  240. -- local txt_width, _ = self.txt_soul_attr_3:GetVectorValue(TextBoxProperty.TextSize)
  241. -- if txt_width > max_width then
  242. -- max_width = txt_width
  243. -- end
  244. local cur_soul_suit_cfg = BuildModel:getInstance():GetCurSoulSuitCFG(self.data.type_id)
  245. if cur_soul_suit_cfg then
  246. local cur_attr_info = ErlangParser:GetInstance():Parse(cur_soul_suit_cfg.attr)
  247. if cur_attr_info and cur_attr_info[1] then
  248. cur_attr_info[1][2] = cur_attr_info[1][2]*min_lv
  249. end
  250. local cur_power = CalAttrPowerByBaseAttr(cur_attr_info)
  251. sum_power = sum_power + cur_power
  252. -- local attr_list = GetAttributeList(cur_attr_info)
  253. if cur_attr_info and #cur_attr_info > 0 then
  254. local attr_name_str_4 = HtmlColorTxt(WordManager:GetAttributeStr(tonumber(cur_attr_info[1][1])).."", "#BDAA8E")
  255. attr_value = HtmlColorTxt("+"..cur_attr_info[1][2], ColorUtil.GREEN)
  256. attr_lv = HtmlColorTxt(min_lv, ColorUtil.GREEN)
  257. soul_suit_lv_str = " (神纹等级:"..attr_lv.."级)"
  258. local attr_str = attr_name_str_4..attr_value
  259. -- self.txt_soul_suit_attr:SetString(TextBoxProperty.Label, attr_str)
  260. self.txt_soul_suit_attr.text = attr_str
  261. -- local txt_width, _ = self.txt_soul_suit_attr:GetVectorValue(TextBoxProperty.TextSize)
  262. -- if txt_width > max_width then
  263. -- max_width = txt_width
  264. -- end
  265. end
  266. end
  267. -- self.soul_power_con:SetPowerValue(sum_power)
  268. self.shenwen_fight.text = sum_power
  269. self.shenwen_value_list[1].text = soul_attr_str_1
  270. self.shenwen_value_list[2].text = soul_attr_str_2
  271. self.shenwen_value_list[3].text = soul_attr_str_3
  272. self.txt_soul_suit_lv.text = soul_suit_lv_str
  273. -- self.txt_soul_lv_1:SetVectorL(WidgetProperty.Position, 10+max_width)
  274. -- self.txt_soul_lv_1:SetString(TextBoxProperty.Label, soul_attr_str_1)
  275. -- self.txt_soul_lv_2:SetVectorL(WidgetProperty.Position, 10+max_width)
  276. -- self.txt_soul_lv_2:SetString(TextBoxProperty.Label, soul_attr_str_2)
  277. -- self.txt_soul_lv_3:SetVectorL(WidgetProperty.Position, 10+max_width)
  278. -- self.txt_soul_lv_3:SetString(TextBoxProperty.Label, soul_attr_str_3)
  279. -- self.txt_soul_suit_lv:SetVectorL(WidgetProperty.Position, 10+max_width)
  280. -- self.txt_soul_suit_lv:SetString(TextBoxProperty.Label, soul_suit_lv_str)
  281. else
  282. -- self.soul_con:SetBool(WidgetProperty.Visible, false)
  283. self.line5.gameObject:SetActive(false)
  284. self.shenwen_conta:SetActive(false)
  285. end
  286. end
  287. function EquipTipView:UpdateGemstones( data )
  288. -- local gem_info = data.gem_info
  289. -- print("++++++++++EquipTipView=--------------:", TableSize(gem_info))
  290. -- if not gem_info then return end
  291. -- for i=1,3 do
  292. -- local item = self.stone_item_list[i]
  293. -- if item == nil then
  294. -- item = EquipStoneItem.New(self.stone_conta)
  295. -- self.stone_item_list[i] = item
  296. -- end
  297. -- print("-----------------stone-------:", gem_info[i])
  298. -- item:SetData(gem_info[i], self.data.cell, i)
  299. -- item:SetPosition(0, -38 * (i - 1))
  300. -- local gem_type = Config.Equipgemconfig[self.data.cell.."@"..i].gem_type
  301. -- local gem_type_str = "气血宝石"
  302. -- if BuildModel.GemstoneTypeName[gem_type] then
  303. -- gem_type_str = BuildModel.GemstoneTypeName[gem_type]
  304. -- end
  305. -- if gem_info[i] == 1 then
  306. -- self.ep_lock_spr[i]:SetString(ImageBoxProperty.Source, "equip:ep_lock_spr")
  307. -- self.txt_gem_name[i]:SetString(TextBoxProperty.Label, gem_type_str)
  308. -- local need_strength = Config.Equipgemconfig[self.data.cell.."@"..i].need_stren
  309. -- local condition_str = HtmlColorTxt("强化"..need_strength.."级开启", ColorUtil:getColorByName(ColorUtil.RED))
  310. -- self.txt_gem_attr[i]:SetString(TextBoxProperty.Label, condition_str)
  311. -- elseif gem_info[i] == 2 then
  312. -- -- self.ep_lock_spr[i]:SetString(ImageBoxProperty.Source, "")
  313. -- self.ep_lock_spr[i]:SetString(ImageBoxProperty.Source, "build:bd_diamod_"..i)
  314. -- self.txt_gem_name[i]:SetString(TextBoxProperty.Label, gem_type_str)
  315. -- self.txt_gem_attr[i]:SetString(TextBoxProperty.Label, "未镶嵌")
  316. -- else
  317. -- local gvo=GoodsModel.Instance:GetGoodsBasicByTypeId(gem_info[i])
  318. -- local colorStr = ColorUtil:getGoodColor(gvo.color)
  319. -- local name = HtmlColorTxt(gvo.goods_name, colorStr)
  320. -- self.txt_gem_name[i]:SetString(TextBoxProperty.Label, name)
  321. -- self.ep_lock_spr[i]:SetString(ImageBoxProperty.Source, "build:bd_diamod_"..i)
  322. -- local attr_info = ErlangParser:GetInstance():Parse(Config.Gemcombineconfig[gem_info[i]].attr)
  323. -- local attr_name = WordManager:GetAttributeStr(attr_info[1][1])
  324. -- self.txt_gem_attr[i]:SetString(TextBoxProperty.Label, attr_name.."+"..attr_info[1][2])
  325. -- self.txt_gem_attr[i]:SetString(TextBoxProperty.ColorStr, colorStr)
  326. -- end
  327. -- end
  328. end
  329. function EquipTipView:UpdateRefine( data )
  330. local cost_info = Config.Equiprefineconfig[data.type_id]
  331. if cost_info then
  332. local cur_refine_info = data.refine_info
  333. cost_info = ErlangParser:GetInstance():Parse(cost_info.cost_config)
  334. for i=1,#cost_info do
  335. -- local goods_id = BuildModel.Instance.RefineGoodsID[cost_info[i][1]]
  336. -- -- print("EquipTipView 296 cost_info")
  337. -- -- PrintTable(cost_info)
  338. -- local cost_limit = cost_info[i][2]
  339. local item = self.fumo_item_list[i]
  340. if item == nil then
  341. item = EquipFuMoItem.New(self.fumo_conta)
  342. self.fumo_item_list[i] = item
  343. end
  344. item:SetData(cost_info[i], cur_refine_info, i)
  345. item:SetPosition(0, -36 * (i - 1))
  346. -- if cur_refine_info and cur_refine_info[i] then
  347. -- --显示当前已经加了的属性值
  348. -- local cur_cost_num = cur_refine_info[i].refine_num or 0
  349. -- local attr_str = Config.Equiprefinematerialconfig[goods_id].attr
  350. -- local attr_info = ErlangParser:GetInstance():Parse(attr_str)
  351. -- -- print("Cat:BuildRefineView.lua [173][start] attr_info", attr_info,attr_str)
  352. -- -- PrintTable(attr_info)
  353. -- -- print("Cat:BuildRefineView.lua [173][end]")
  354. -- -- self.txt_refine[i]:SetString(TextBoxProperty.Label, cur_cost_num)
  355. -- self.txt_refine_num[i]:SetString(TextBoxProperty.Label, cur_cost_num.."/"..cost_limit)
  356. -- else
  357. -- -- self.txt_refine[i]:SetString(TextBoxProperty.Label, "0")
  358. -- self.txt_refine_num[i]:SetString(TextBoxProperty.Label, "0/"..cost_limit)
  359. -- end
  360. end
  361. else
  362. -- print("Cat:EquipTipView.lua Error[UpdateRefine] equip_type,equip_type,:", equip_type,equip_type,cost_info,cur_refine_info)
  363. end
  364. -- local refine_info = data.refine_info
  365. -- if not refine_info then return end
  366. -- for i=1,3 do
  367. -- local cost_info = Config.Equiprefinematerialconfig[refine_info[i].cost_id]
  368. -- cost_info = ErlangParser:GetInstance():Parse(cost_info.attr)
  369. -- self.txt_refine[i]:SetString(TextBoxProperty.Label, cost_info[1][2]*refine_info[i].costed_num)
  370. -- cost_info = Config.Equiprefineconfig[data.type_id]
  371. -- cost_info = ErlangParser:GetInstance():Parse(cost_info.cost_config)
  372. -- local limit_num = cost_info[i][2]
  373. -- self.txt_refine_num[i]:SetString(TextBoxProperty.Label, "("..refine_info[i].costed_num.."/"..limit_num..")")
  374. -- end
  375. end
  376. function EquipTipView:UpdateStar( star_num )
  377. if star_num > 15 then
  378. star_num = 15
  379. end
  380. for i=1,5 do
  381. if star_num >= 10+i then
  382. self.spr_star[i]:SetString(ImageBoxProperty.Source, "equip:ep_star3")
  383. elseif star_num >= 5+i then
  384. self.spr_star[i]:SetString(ImageBoxProperty.Source, "equip:ep_star2")
  385. elseif star_num >= i then
  386. self.spr_star[i]:SetString(ImageBoxProperty.Source, "equip:ep_star1")
  387. else
  388. self.spr_star[i]:SetString(ImageBoxProperty.Source, "equip:ep_star_gray")
  389. -- self.spr_star[i]:SetBool(WidgetProperty.Gray, true)
  390. end
  391. end
  392. end
  393. -- function EquipTipView:SetData( data )
  394. -- self.data = data
  395. -- if self.isLoaded then
  396. -- self:UpdateView()
  397. -- end
  398. -- end
  399. function EquipTipView:Open(data,is_other,hide_btn)
  400. self.data = data
  401. self.is_other = is_other or false
  402. self.hide_btn = hide_btn or false
  403. BaseView.Open(self)
  404. end
  405. function EquipTipView:DestroyCallback( )
  406. if self.spr_item ~= nil then
  407. self.spr_item:DeleteMe()
  408. self.spr_item = nil
  409. end
  410. if self.icon_item ~= nil then
  411. self.icon_item:DeleteMe()
  412. self.icon_item = nil
  413. end
  414. if self.txt_sten ~= nil then
  415. self.txt_sten:DeleteMe()
  416. self.txt_sten = nil
  417. end
  418. if self.soul_power_con ~= nil then
  419. self.soul_power_con:DeleteMe()
  420. self.soul_power_con = nil
  421. end
  422. for i,v in ipairs(self.fumo_item_list) do
  423. v:DeleteMe()
  424. v = nil
  425. end
  426. self.fumo_item_list = {}
  427. for i,v in ipairs(self.stone_item_list) do
  428. v:DeleteMe()
  429. v = nil
  430. end
  431. self.stone_item_list = {}
  432. end
  433. function EquipTipView:HideOpenrateBtn(bool)
  434. self.btn_conta.gameObject:SetActive(not bool)
  435. end