コード例 #1
0
 private void Like(EventContext context)
 {
     if (otherInfo["uid"].ToString().Equals(userModel.uid))
     {
         ViewManager.inst.ShowText(Tools.GetMessageById("13055"));
     }
     else
     {
         SoundManager.inst.PlaySound(Config.SOUND_LIKE);
         if (i_like_num < need_coin.Length)
         {
             if (i_like_num == 0)
             {
                 SendLove();
             }
             else
             {
                 if (userModel.IsLove())
                 {
                     GuideManager.inst.Clear();
                 }
                 int coin_num = (int)need_coin[i_like_num - 1];
                 roleModel.like_Coin = coin_num;
                 expend_coin_type    = coin_num;
                 ViewManager.inst.ShowAlertLike(Config.ASSET_COIN, coin_num, Callback);
             }
         }
         else
         {
             int coin_max = (int)need_coin[need_coin.Length - 1];
             roleModel.like_Coin = coin_max;
             expend_coin_type    = coin_max;
             ViewManager.inst.ShowAlertLike(Config.ASSET_COIN, coin_max, Callback);
         }
     }
 }
コード例 #2
0
    public override void Init()
    {
        base.Init();
        this.Create(Config.VIEW_ROLEIDEX);
        userModel = ModelManager.inst.userModel;
        roleModel = ModelManager.inst.roleModel;



        photoCom  = GetChild("n112").asCom;
        photoHead = photoCom.GetChild("n0").asButton;
        lv        = photoCom.GetChild("n2").asTextField;
        sex       = this.GetChild("n26").asLoader;
        name      = this.GetChild("n10").asTextField;
        story     = this.GetChild("n12").asTextInput;
        //image_hurt_ = this.GetChild ("n103").asImage;

        story.promptText = Tools.GetMessageById("13107") + Tools.GetMessageById("13105");
        loveNum          = this.GetChild("n14").asTextField;
        fansNum          = this.GetChild("n16").asTextField;
        attenNum         = this.GetChild("n18").asTextField;
        //lv = this.GetChild ("n76").asTextField;
        like_list       = this.GetChild("n21").asList;
        like            = this.GetChild("n25").asButton;
        graph           = this.GetChild("n105").asGraph;
        like_bg         = like.asCom.GetChild("n2").asImage;
        like_bg.visible = false;
        like.onClick.Add(Like);
        more = this.GetChild("n20").asButton;
        more.onClick.Add(More);
        more.text        = Tools.GetMessageById("13081");
        attention        = this.GetChild("n22").asButton;
        attention.grayed = false;
        attention.onClick.Add(Attention);
        attentionAtr      = attention.GetController("c1");
        attention.visible = false;
        watch             = this.GetChild("n0").asButton;
        //watch.text = Tools.GetMessageById ("13014");
        watch.visible = false;
        watch.onClick.Add(Watch);
        shield = this.GetChild("n23").asButton;
        shield.onClick.Add(Shield);
        shield.visible = false;
        editImage      = GetChild("n110").asImage;
        btnMicro       = GetChild("n117").asButton;
        btnMicro.onClick.Add(BtnMicro);
        btnOpenMicro = GetChild("n121").asButton;
        btnOpenMicro.onClick.Add(BtnOpenMicro);

        isBtnMicro = userModel.GetUnlcok(Config.UNLOCK_PAY_MICRO, btnMicro);

        GetChild("n15").asTextField.text = Tools.GetMessageById("13011");
        GetChild("n17").asTextField.text = Tools.GetMessageById("13012");
        GetChild("n19").asTextField.text = Tools.GetMessageById("13013");
        uid = GetChild("n116").asTextField;


        //save_img = this.GetChild ("n30").asButton;
        //save_img.touchable = false;
        //save_img.visible = true;
        //save_btn = this.GetChild ("n31").asButton;
        //save_btn.visible = false;
        //save_btn.text = Tools.GetMessageById ("13017");
        //save_btn.RemoveEventListeners ();
        //save_btn.onClick.Add (() =>
        //{
        //	Save ();
        //});
        //guildName = this.GetChild ("n32").asTextField;
        //openGuild = this.GetChild ("n102").asButton;
        //openGuild.GetChild ("title").asTextField.textFormat.size = 28;
        //openGuild.text = Tools.GetMessageById ("13072");
        //openGuild.onClick.Add(OpenGuild);
        guild = this.GetChild("n111").asButton;
        guild.onClick.Add(Guild);
        guildAtr            = guild.GetController("c1");
        guild.visible       = false;
        btnBgUp             = "n_icon_guanzhu";
        btnBgDo             = "n_icon_guanzhu_";
        btnBgDo_            = "n_icon_guanzhu_2";
        textAttention       = "13013";
        textAttentiond      = "13018";
        textBtnColor        = "FFFFFF";
        textBtnStrokeColor  = "#38A9E3";
        textBtnStrokeColor1 = "#666666";
        textBtnStrokeColor2 = "#2FAC50";
        textShield          = "13016";
        textShieldd         = "13032";
        textGuild           = "19908";
        textGuildd          = "19955";
        fontSize            = "";
        InitDate();
        Tools.SetButtonBgAndColor(watch, btnBgUp, "13014", fontSize, textBtnColor, textBtnStrokeColor);
        this.AddGlobalListener(MainEvent.ROLE_UPDATE, viewUpdate);
        Log.debug(like.x + " - " + this.x);
        if (!userModel.IsLove())
        {
            if (roleModel.otherInfo["uid"].ToString() != userModel.uid)
            {
                if (GuideManager.inst.Check("101:0"))
                {
                    GuideManager.inst.Show(this);
                }
            }
        }
    }