Пример #1
0
    protected override void OnShown()
    {
        _components.RemoveChildrenToPool();
        {
            AccesoryView obj = (AccesoryView)_components.AddItemFromPool();

            obj.setUneuip(nowComponent);

            obj.onClick.Set(delegate() {
                _components.ClearSelection();
                obj.selected = true;
                choose       = -1;
                changeDetailView();
            });
        }
        int idx = 0;

        foreach (TowerComponent tc in PlayerData.getInstance().bagComponents)
        {
            AccesoryView obj = (AccesoryView)_components.AddItemFromPool();
            obj.updateView(tc);
            int ii = idx;



            obj.onClick.Set(delegate() {
                _components.ClearSelection();
                obj.selected = true;
                choose       = ii;
                changeDetailView();
            });
            idx++;
        }
    }
Пример #2
0
    protected override void OnInit()
    {
        this.contentPane = UIPackage.CreateObject("UIMain", "TowerComponentPanel").asCom;
        this.Center();
        this.modal = true;

        _changes = this.contentPane.GetChild("changes").asList;

        _c_before = this.contentPane.GetChild("c_before").asTextField;
        _c_after  = this.contentPane.GetChild("c_after").asTextField;

        _components = this.contentPane.GetChild("components").asList;
        _confirm    = this.contentPane.GetChild("n2").asButton;
        _close      = this.contentPane.GetChild("close").asLoader;

        _switch = this.contentPane.GetChild("switch").asButton;
        _switch.onClick.Add(delegate() {
            isShownDetail = !isShownDetail;
            if (isShownDetail)
            {
                for (int i = 0; i < _components.numChildren; i++)
                {
                    AccesoryView v = (AccesoryView)_components.GetChildAt(i);
                    v.showDetail();
                }
            }
            else
            {
                for (int i = 0; i < _components.numChildren; i++)
                {
                    AccesoryView v = (AccesoryView)_components.GetChildAt(i);
                    v.hideDetail();
                }
            }
        });
        _switch.selected = true;

        _txt_now   = this.contentPane.GetChild("txt_now").asTextField;
        _txt_after = this.contentPane.GetChild("txt_after").asTextField;

        _close.onTouchEnd.Add(delegate() {
            Hide();
        });

        _confirm.onTouchEnd.Add(delegate() {
            if (choose == -1)
            {
                tp.unequip(idx);
            }
            else
            {
                tp.changeComponent(idx, choose);
            }
            Hide();
        });
    }
Пример #3
0
 protected override void OnShown()
 {
     _components.RemoveChildrenToPool();
     //_components.numItems = 3;
     for (int i = 0; i < componentsToSell.Count; i++)
     {
         AccesoryView obj = (AccesoryView)_components.AddItemFromPool();
         obj.updateView(componentsToSell[i]);
         int idx = i;
         obj.onClick.Set(delegate() {
             _components.ClearSelection();
             obj.selected    = true;
             componentChoice = idx;
             changeDetailView();
         });
     }
 }