Ejemplo n.º 1
0
    private List <int> ListData(object[] obj, CardVo card)
    {
        List <int> re = new List <int> ();
        Dictionary <string, object> up;

        if (cardData.ContainsKey("up"))
        {
            up = (Dictionary <string, object>)cardData ["up"];
        }
        for (int i = 0; i < obj.Length; i++)
        {
            Dictionary <string, object> tipi = (Dictionary <string, object>)obj [i];
            int round = 0;
            if (((Dictionary <string, object>)sim [tipi ["type"].ToString()]).ContainsKey("round"))
            {
                round = Convert.ToInt32(((Dictionary <string, object>)sim [tipi ["type"].ToString()]) ["round"]);
            }
            Dictionary <string, object> monster = new Dictionary <string, object> ();
            string carr   = tipi.ContainsKey("call") ? tipi ["call"].ToString() : null;
            string callin = tipi.ContainsKey("callin") ? tipi ["callin"].ToString() : null;
            if (carr != null)
            {
                monster = (Dictionary <string, object>)DataManager.inst.beckon [carr];
            }
            if (tipi.ContainsKey("replace"))
            {
                object[] replace = (object[])tipi ["replace"];
                for (int j = 0; j < replace.Length; j++)
                {
                    string[] fafa;
                    if (carr != null)
                    {
                        fafa = MediatorItemShipInfo.suanShu((object[])replace [j], monster, card, round);
                    }
                    else
                    {
                        fafa = MediatorItemShipInfo.suanShu((object[])replace [j], cardData, card, round);
                    }
                    if (fafa.Length > 1)
                    {
                        re.Add(i);
                        break;
                    }
                }
            }
        }
        return(re);
    }
    public static string[] TextFild(int index, CardVo card, GButton n3 = null, GComponent _view = null, bool isUp = true, bool careExp = true)
    {
        string n1 = "";
        Dictionary <string, object> cardData = (Dictionary <string, object>)DataManager.inst.card [card.id];
        Dictionary <string, object> sim      = (Dictionary <string, object>)(DataManager.inst.systemSimple ["card_attr_info"]);

        object[] tips = (object[])cardData ["tips"];
        Dictionary <string, object> tipi = (Dictionary <string, object>)tips [index];
        Dictionary <string, object> up;

        if (cardData.ContainsKey("up"))
        {
            up = (Dictionary <string, object>)cardData ["up"];
        }
        if (n3 != null)
        {
            n3.visible = false;
        }
        bool bo = false;
        Dictionary <string, object> monster = new Dictionary <string, object> ();
        string carr   = tipi.ContainsKey("call") ? tipi ["call"].ToString() : null;
        string callin = tipi.ContainsKey("callin") ? tipi ["callin"].ToString() : null;

        if (carr != null)
        {
            monster = (Dictionary <string, object>)DataManager.inst.beckon [carr];
        }
        if (callin != null)
        {
            if (n3 != null)
            {
                n3.visible = true;
                n3.onClick.Add(() =>
                {
                    ModelManager.inst.cardModel.SetComShipInfoData(callin, tipi ["title"].ToString(), cardData, card);
                    Vector2 v2 = Stage.inst.touchPosition;

                    MediatorComShipInfo bbb = new MediatorComShipInfo();
                    ViewManager.inst.AddPView(bbb);
                    bbb.setSelectIndex(1);
                    v2          = _view.parent.GlobalToLocal(v2);
                    bbb.group.x = v2.x - bbb.group.width + 175;
                    bbb.group.y = v2.y - bbb.group.height - 20;
                });
            }
        }
        string fa1   = null;
        string fa2   = null;
        int    round = 0;

        if (((Dictionary <string, object>)sim [tipi ["type"].ToString()]).ContainsKey("round"))
        {
            round = Convert.ToInt32(((Dictionary <string, object>)sim [tipi ["type"].ToString()]) ["round"]);
        }
        if (tipi.ContainsKey("replace"))
        {
            object[] replace = (object[])tipi ["replace"];
            string[] strArr  = new string[replace.Length];
            string[] strArr2 = new string[replace.Length];
            for (int j = 0; j < replace.Length; j++)
            {
                string[] fafa;
                if (carr != null)
                {
                    fafa = MediatorItemShipInfo.suanShu((object[])replace [j], monster, card, round);
                }
                else
                {
                    fafa = MediatorItemShipInfo.suanShu((object[])replace [j], cardData, card, round);
                }
                strArr [j] = fafa [0];
                if (fafa.Length > 1)
                {
                    bo = true;
                    if (careExp)
                    {
                        if (card.exp < card.maxExp || card.lv == card.maxLv)
                        {
                            bo = false;
                        }
                    }
                    strArr2 [j] = fafa [1];
                }
            }
            n1  = Tools.GetMessageById(((Dictionary <string, object>)sim [tipi ["type"].ToString()]) ["info"].ToString(), strArr);
            fa1 = n1;
            if (false)
            {
                n1 = "";
//				n1 += "[color=#0cff00]";
                n1 += "+" + Tools.GetMessageById(((Dictionary <string, object>)sim [tipi ["type"].ToString()]) ["info"].ToString(), strArr2);
//				n1 += "[/color]";
                fa2 = n1;
            }
        }
        else
        {
            n1  = Tools.GetMessageById(((Dictionary <string, object>)sim [tipi ["type"].ToString()]) ["info"].ToString());
            fa1 = n1;
        }
        if (fa2 == null)
        {
            return(new string[] { fa1 });
        }
        else
        {
            return(new string[] { fa1, fa2 });
        }
    }
Ejemplo n.º 3
0
    private void onListRander(int index, GObject obj)
    {
        string n1 = "";
        Dictionary <string, object> monster = new Dictionary <string, object> ();
        Dictionary <string, object> tipi    = (Dictionary <string, object>)tips [index];
        string carr = tipi.ContainsKey("call") ? tipi ["call"].ToString() : null;

        if (carr != null)
        {
            monster = (Dictionary <string, object>)DataManager.inst.beckon [carr];
        }
        bool bo    = false;
        int  round = 0;

        if (((Dictionary <string, object>)sim [tipi ["type"].ToString()]).ContainsKey("round"))
        {
            round = (int)(((Dictionary <string, object>)sim [tipi ["type"].ToString()]) ["round"]);
        }
        if (tipi.ContainsKey("replace"))
        {
            object[] replace = (object[])tipi ["replace"];
            string[] strArr  = new string[replace.Length];
            string[] strArr2 = new string[replace.Length];
            for (int j = 0; j < replace.Length; j++)
            {
                string[] fafa;
                if (carr != null)
                {
                    fafa = MediatorItemShipInfo.suanShu((object[])replace [j], monster, card, round, true);
                }
                else
                {
                    fafa = MediatorItemShipInfo.suanShu((object[])replace [j], cardModel.shipinfo_cardData, card, round, true);
                }
                strArr [j] = fafa[0];
                if (fafa.Length > 1)
                {
                    bo = true;
                    if (card.exp < card.maxExp || card.lv == card.maxLv)
                    {
                        bo = false;
                    }
                    strArr2[j] = fafa [1];
                }
            }
            n1 = "" + Tools.GetMessageById(((Dictionary <string, object>)sim [tipi ["type"].ToString()]) ["info"].ToString(), strArr) + "";
            if (bo)
            {
//				n1 += "+";
//				n1 += Tools.GetMessageById (((Dictionary<string,object>)sim [tipi ["type"].ToString ()]) ["info"].ToString (), strArr2);
//				n1 += "";
            }
        }
        else
        {
            n1 = "" + Tools.GetMessageById(((Dictionary <string, object>)sim [tipi ["type"].ToString()]) ["info"].ToString()) + "";
        }
        GLoader    n0  = obj.asCom.GetChild("n0").asLoader;
        GTextField n1t = obj.asCom.GetChild("n1").asTextField;
        GTextField n2  = obj.asCom.GetChild("n2").asTextField;

        n1t.text = Tools.GetMessageById(((Dictionary <string, object>)sim[tipi ["type"].ToString()])["name"].ToString()) + ":";
        n2.text  = n1;
        n0.url   = Tools.GetResourceUrl("Icon:" + ((Dictionary <string, object>)sim[tipi ["type"].ToString()])["icon"].ToString());
    }