difenduandada
2024-12-31 34abe6963b344c882358274957f4b992456fee40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
"use strict";
cc._RF.push(module, '614d04ihr9CWoQAgqUAGkv7', 'source_item');
// Scripts/mod/tips/view/source_item.js
 
"use strict";
 
var PartnersSummonItem = cc.Class({
  "extends": ViewClass,
  ctor: function ctor() {
    this.parent = arguments[0];
    this.bid = arguments[1];
    this.need_item_list = arguments[2];
    this.prefabPath = PathTool.getPrefabPath("tips", "source_item");
    this.createRootWind();
  },
  createRootWind: function createRootWind() {
    LoaderManager.getInstance().loadRes(this.prefabPath, function (res_object) {
      this.root_wnd = res_object;
      this.root_wnd.parent = this.parent;
      this.initWidgets();
    }.bind(this));
  },
  initWidgets: function initWidgets() {
    this.recom_tag_nd = this.seekChild("recom_tag");
    this.desc_txt_lb = this.seekChild("desc_txt", cc.Label);
    this.goto_btn_nd = this.seekChild("goto_btn");
    this.btn_title_lb = this.seekChild("btn_title", cc.Label);
    this.unlock_txt_nd = this.seekChild("unlock_txt");
    this.unlock_txt_lb = this.seekChild("unlock_txt", cc.Label);
    this.goto_btn_nd.on(cc.Node.EventType.TOUCH_END, this.didClickGotoBtn, this);
    if (this.source_info) this.updagetWidgets();
  },
  setData: function setData(source_info) {
    this.source_info = source_info;
    if (this.root_wnd) this.updagetWidgets();
  },
  updagetWidgets: function updagetWidgets() {
    this.data = this.source_info.infon_data;
    this.desc_txt_lb.string = this.data.name;
 
    if (this.source_info[1] != null) {
      if (this.source_info[1] == 0) {
        //不推荐
        this.recom_tag_nd.active = false;
      } else {
        this.recom_tag_nd.active = true;
      }
    }
 
    this.btn_title_lb.string = Utils.TI18N(Lang.GOTO);
    this.unlock_txt_lb.string = Utils.TI18N(Lang.NO_OPEN);
 
    if (this.source_info.is_lock) {
      this.goto_btn_nd.active = false;
      this.unlock_txt_nd.active = true;
      this.unlock_txt_lb.string = this.source_info.des;
    } else {
      this.goto_btn_nd.active = true;
      this.unlock_txt_nd.active = false;
    }
 
    this.root_wnd.y = -this.root_wnd.height * this.source_info.index;
  },
  didClickGotoBtn: function didClickGotoBtn() {
    var BackPackCtrl = require("backpack_controller");
 
    if (this.close_callback) {
      this.close_callback();
    } else {
      BackPackCtrl.getInstance().openTipsSource(false);
    }
 
    BackPackCtrl.getInstance().gotoItemSources(this.data.evt_type, this.data.extend, this.bid, this.need_item_list);
 
    require("hero_controller").getInstance().openHeroBreakPanel(false); //特殊处理,如果进阶界面还存在,关闭它。
 
 
    require("hero_controller").getInstance().openArtifactListWindow(false); //特殊处理,如果符文列表还存在,关闭它。
 
  }
});
 
cc._RF.pop();