Beispiel #1
0
    /// <summary>
    /// 更新镶嵌信息
    /// </summary>
    private void UpdateInlayInfo()
    {
        UIGemInLayGrid inLayGrid   = null;
        int            index       = 0;
        StringBuilder  builder     = new StringBuilder();
        uint           inlayBaseId = 0;
        Gem            gem         = null;

        for (EquipManager.EquipGridIndexType i = EquipManager.EquipGridIndexType.First; i < EquipManager.EquipGridIndexType.Max; i++)
        {
            index = (int)i - 1;
            if (i < 0)
            {
                continue;
            }
            if (null != m_dic_inLayGrids && m_dic_inLayGrids.TryGetValue(i, out inLayGrid))
            {
                inLayGrid.UpdateGridData(m_emSelectInlayPos);
            }

            if (emgr.TryGetEquipGridInlayGem(m_emSelectInlayPos, i, out inlayBaseId))
            {
                gem = DataManager.Manager <ItemManager>()
                      .GetTempBaseItemByBaseID <Gem>(inlayBaseId, ItemDefine.ItemDataType.Gem);
                builder.Append(DataManager.Manager <TextManager>().GetLocalFormatText(GetEquipGridIndexTextType(i), gem.AttrDes) + "\n");
            }
        }

        if (null != m_label_InlayGemAttrDes)
        {
            m_label_InlayGemAttrDes.text = builder.ToString();
        }
    }
Beispiel #2
0
 /// <summary>
 /// 镶嵌格子数据UI事件回调
 /// </summary>
 /// <param name="eventType"></param>
 /// <param name="data"></param>
 /// <param name="param"></param>
 private void OnInlayGridUIEventDlg(UIEventType eventType, object data, object param)
 {
     switch (eventType)
     {
     case UIEventType.Click:
     {
         if (data is UICtrTypeGrid)
         {
             UICtrTypeGrid ctg = data as UICtrTypeGrid;
             SetActiveGemType((GameCmd.GemType)ctg.ID);
         }
         else if (data is UIGemGrid)
         {
             UIGemGrid gGRid = data as UIGemGrid;
             //镶嵌
             DoInlay(gGRid.Data);
         }
         else if (data is UIEquipPosStatusGrid)
         {
             UIEquipPosStatusGrid epsGrid = data as UIEquipPosStatusGrid;
             SetSelectPart(epsGrid.Data);
         }
         else if (data is UIGemInLayGrid)
         {
             UIGemInLayGrid gInlayGrid = data as UIGemInLayGrid;
             DoUnload(gInlayGrid.Data);
         }
     }
     break;
     }
 }
Beispiel #3
0
    /// <summary>
    /// 设置选中镶嵌格子
    /// </summary>
    /// <param name="type"></param>
    private void SelectInlayGridIndexType(EquipManager.EquipGridIndexType type, bool force = false)
    {
        if (type == selectEquipGridType && !force)
        {
            return;
        }
        UIGemInLayGrid grid = null;

        if (null != m_dic_inLayGrids && m_dic_inLayGrids.TryGetValue(selectEquipGridType, out grid))
        {
            grid.SetHightLight(false);
        }
        selectEquipGridType = type;
        if (null != m_dic_inLayGrids && m_dic_inLayGrids.TryGetValue(selectEquipGridType, out grid))
        {
            grid.SetHightLight(true);
        }
    }
Beispiel #4
0
    private void InitInlayWidgets()
    {
        if (IsInitStatus(ForgingPanelMode.Inlay))
        {
            return;
        }
        SetInitStatus(ForgingPanelMode.Inlay, true);

        //初始化镶嵌格子
        if (null != m_trans_EquipGridInLayContent)
        {
            if (null == m_dic_inLayGrids)
            {
                m_dic_inLayGrids = new Dictionary <EquipManager.EquipGridIndexType, UIGemInLayGrid>();
            }
            m_dic_inLayGrids.Clear();
            Transform      inLayTs = null;
            UIGemInLayGrid gemGrid = null;
            for (EquipManager.EquipGridIndexType i = EquipManager.EquipGridIndexType.First
                 ; i < EquipManager.EquipGridIndexType.Max; i++)
            {
                inLayTs = Util.findTransform(m_trans_EquipGridInLayContent, i.ToString() + "InlayBox");
                if (null == inLayTs)
                {
                    continue;
                }
                gemGrid = inLayTs.GetComponent <UIGemInLayGrid>();
                if (null == gemGrid)
                {
                    gemGrid = inLayTs.gameObject.AddComponent <UIGemInLayGrid>();
                }
                gemGrid.SetGridData(i);
                gemGrid.RegisterUIEventDelegate(OnInlayGridUIEventDlg);
                if (!m_dic_inLayGrids.ContainsKey(i))
                {
                    m_dic_inLayGrids.Add(i, gemGrid);
                }
            }
        }

        InitCanInlayGemWidgets();
    }