示例#1
0
 void PublishNewThings()
 {
     UIManager.Instance.HideWindowByName("LevelUp");
     UIManager.Instance.HideWindowByName("FightScoreChange");
     ArkCrossEngine.RoleInfo role = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
     //ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("after_levelup", "ui_effect", role.Level);
 }
示例#2
0
 public void HasLevelUp()
 {
     ArkCrossEngine.RoleInfo role = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
     if (role.LevelUp)
     {
         if (!UIManager.Instance.IsWindowVisible("TaskAward"))
         {
             UserLevelUP(role.Level);
         }
     }
 }
示例#3
0
 private void UserLevelUP(int level)
 {
     ArkCrossEngine.RoleInfo role = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
     if (role.LevelUp)
     {
         role.LevelUp = false;
     }
     if (UIManager.Instance.IsWindowVisible("LevelUp"))
     {
         return;
     }
     if (UIManager.Instance.IsWindowVisible("GameTask"))
     {
         UIManager.Instance.HideWindowByName("GameTask");
     }
     UIManager.Instance.ShowWindowByName("LevelUp");
     NGUITools.PlaySound(GetComponent <AudioClip>(), 1f, 1f);
     ResetTweens();//必须先显示,才会执行
     Invoke("PublishNewThings", hideTime);
 }
示例#4
0
 void SetBuyStaminaInfo()
 {
     ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
     if (ri != null)
     {
         UnityEngine.Transform tf = transform.Find("tip");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ArkCrossEngine.VipConfig config_data = ArkCrossEngine.VipConfigProvider.Instance.GetDataById(ri.Vip);
                 ul.text = ArkCrossEngine.StrDictionaryProvider.Instance.Format(146, ri.BuyStaminaCount, null == config_data ? ri.Vip + 1 : config_data.m_Stamina);
             }
         }
         ArkCrossEngine.BuyStaminaConfig bsc = ArkCrossEngine.BuyStaminaConfigProvider.Instance.GetDataById(ri.BuyStaminaCount + 1);
         if (bsc != null)
         {
             tf = transform.Find("bk/zuan/mount");
             if (tf != null)
             {
                 UILabel ul = tf.gameObject.GetComponent <UILabel>();
                 if (ul != null)
                 {
                     ul.text = bsc.m_CostGold.ToString();
                 }
             }
             tf = transform.Find("bk/money/mount");
             if (tf != null)
             {
                 UILabel ul = tf.gameObject.GetComponent <UILabel>();
                 if (ul != null)
                 {
                     ul.text = bsc.m_GainStamina.ToString();
                 }
             }
         }
     }
 }
示例#5
0
 void Awake()
 {
     try
     {
         object eo;
         eo = ArkCrossEngine.LogicSystem.EventChannelForGfx.Subscribe("ge_ui_unsubscribe", "ui", UnSubscribe);
         if (eo != null)
         {
             eventlist.Add(eo);
         }
         eo = ArkCrossEngine.LogicSystem.EventChannelForGfx.Subscribe <int>("ge_user_levelup", "property", UserLevelUP);
         if (eo != null)
         {
             eventlist.Add(eo);
         }
         ArkCrossEngine.RoleInfo role = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
         Invoke("HasLevelUp", 1f);
     }
     catch (System.Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogErrorFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
示例#6
0
 public void SetAwardProperty(int id)
 {
     PlayEffectTitle();
     sign    = TaskAwardOpenForWindow.W_GameTask;
     awardid = id;
     ArkCrossEngine.MissionConfig missionconfig = ArkCrossEngine.LogicSystem.GetMissionDataById(id);
     if (missionconfig != null)
     {
         UnityEngine.Transform tf = transform.Find("Back/Type/TypeDescription");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = missionconfig.Name;
             }
         }
         tf = transform.Find("Back/Challenge/ChallengeDescription");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = missionconfig.Description;
             }
         }
     }
     ArkCrossEngine.Data_SceneDropOut dsdo = ArkCrossEngine.SceneConfigProvider.Instance.GetSceneDropOutById(missionconfig.DropId);
     if (dsdo != null)
     {
         ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
         if (ri != null && ri.GetMissionStateInfo() != null)
         {
             SetSomething(dsdo.m_GoldSum, dsdo.m_Diamond, ri.GetMissionStateInfo().GetMissionsExpReward(id, ri.Level), dsdo.GetRewardItemByHeroId(ri.HeroId), dsdo.m_ItemCountList);
         }
     }
 }
示例#7
0
        public void Init()
        {
            ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
            if (ri != null)
            {
                Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(ri.HeroId);
                if (cg != null)
                {
                    herostr = cg.m_Portrait;
                }
                heroname = ri.Nickname;
            }
            m_StoryInfos.Clear();
            DBC dlgCfg = new DBC();

            if (dlgCfg.Load(HomePath.GetAbsolutePath(FilePathDefine_Client.C_DialogConfig)))
            {
                for (int index = 0; index < dlgCfg.RowNum; index++)
                {
                    DBC_Row node = dlgCfg.GetRowByIndex(index);
                    if (null != node)
                    {
                        StoryDlgInfo info = new StoryDlgInfo();
                        info.ID           = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
                        info.StoryName    = DBCUtil.ExtractString(node, "StoryName", "", true);
                        info.DlgType      = (StoryDlgPanel.StoryDlgType)DBCUtil.ExtractNumeric <int>(node, "DlgType", 0, true);
                        info.IntervalTime = DBCUtil.ExtractNumeric <float>(node, "IntervalTime", 1.0f, true);
                        info.StoryItems   = BuildStoryItems(info.StoryName);
                        if (!m_StoryInfos.ContainsKey(info.ID))
                        {
                            m_StoryInfos.Add(info.ID, info);
                        }
                    }
                }
            }
        }
示例#8
0
 public void SetItemProperty(int itemid, int pos, int itemlevel, int propertyid, bool isUpgrade = false, bool hideBtnArea = false)
 {
     ShowActionButton(true);
     isCompareUI = false;
     ID          = itemid;
     property    = propertyid;
     position    = pos;
     level       = itemlevel;
     UnityEngine.Transform tfc = gameObject.transform.Find("SpriteBackLeft");
     if (tfc != null)
     {
         NGUITools.SetActive(tfc.gameObject, false);
     }
     tfc = transform.Find("SpriteBackRight");
     if (tfc != null)
     {
         tfc.localPosition = new UnityEngine.Vector3(0.0f, 0.0f, 0.0f);
         tfc = tfc.Find("line/Label");
         if (tfc != null)
         {
             UILabel ul = tfc.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text  = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(152);
                 ul.color = new UnityEngine.Color(1.0f, 0.52549f, 0.18039f);
             }
         }
     }
     tfc = transform.Find("SpriteBuy");
     if (tfc != null)
     {
         NGUITools.SetActive(tfc.gameObject, false);
     }
     tfc = transform.Find("SpriteSale");
     if (tfc != null)
     {
         NGUITools.SetActive(tfc.gameObject, false);
     }
     tfc = transform.Find("SpriteInlay");
     if (tfc != null)
     {
         //       UILabel ul = tfc.gameObject.GetComponent<UILabel>();
         //       if (ul != null) {
         //         ul.text = "镶嵌";
         //       }
         NGUITools.SetActive(tfc.gameObject, false);
     }
     tfc = transform.Find("SpriteUpdate/Label");
     if (tfc != null)
     {
         UILabel ul = tfc.gameObject.GetComponent <UILabel>();
         if (ul != null)
         {
             ul.text = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(121);
         }
     }
     tfc = transform.Find("SpriteUpdate/Up/money");
     if (tfc != null)
     {
         UILabel ul = tfc.gameObject.GetComponent <UILabel>();
         if (ul != null)
         {
             ArkCrossEngine.ItemLevelupConfig iluc = ArkCrossEngine.ItemLevelupConfigProvider.Instance.GetDataById(level);
             if (iluc != null)
             {
                 ul.text = (iluc.m_PartsList.Count > position ? iluc.m_PartsList[position] : 0).ToString();
             }
             else
             {
                 ul.text = "0";
             }
         }
     }
     tfc = transform.Find("SpriteUpdate");
     if (tfc != null)
     {
         UIButton ub = tfc.GetComponent <UIButton>();
         if (/*us != null &&*/ ub != null)
         {
             ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
             if (itemlevel >= ri.Level)
             {
                 ub.isEnabled = false;
                 if (spLevelUp != null)
                 {
                     spLevelUp.color = UnityEngine.Color.grey;
                 }
             }
             else
             {
                 ub.isEnabled = true;
                 if (spLevelUp != null)
                 {
                     spLevelUp.color = UnityEngine.Color.white;
                 }
             }
         }
     }
     ArkCrossEngine.ItemConfig ic = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(itemid);
     tfc = transform.Find("SpriteUpdate");
     if (tfc != null && ic != null)
     {
         if (!ic.m_CanUpgrade)
         {
             NGUITools.SetActive(tfc.gameObject, false);
             //hideBtnArea = true;
         }
         else
         {
             NGUITools.SetActive(tfc.gameObject, !hideBtnArea);
         }
     }
     tfc = transform.Find("SpriteBackRight/Sprite");
     if (tfc != null)
     {
         NGUITools.SetActive(tfc.gameObject, !hideBtnArea);
     }
     SetItemHeadProperty(itemid, itemlevel, propertyid, transform.Find("SpriteBackRight"), isUpgrade);
     CompareProperty(0, 0, 0, 0, 0, 0);
     CalculateUIPosition(transform.Find("SpriteBackRight"));
 }
示例#9
0
    private void GetTaskIdAndOperator(int id, ArkCrossEngine.MissionOperationType oper, string schedule)
    {
        try
        {
            ArkCrossEngine.MissionConfig missionconfig = ArkCrossEngine.LogicSystem.GetMissionDataById(id);
            ArkCrossEngine.RoleInfo      ri            = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
            if (missionconfig != null && ri != null && ri.Level < missionconfig.LevelLimit)
            {
                return;
            }
            switch (oper)
            {
            case ArkCrossEngine.MissionOperationType.ADD:
                AddTask(id, schedule);
                break;

            case ArkCrossEngine.MissionOperationType.FINISH:
                if (!finishtask.Contains(id))
                {
                    if (!taskDic.ContainsKey(id))
                    {
                        AddTask(id, schedule);
                    }
                    else
                    {
                        SetTaskInfo(taskDic[id], id, schedule);
                    }

                    UnityEngine.Transform tf = taskDic[id].transform.Find("New");
                    if (tf != null)
                    {
                        UISprite us = tf.gameObject.GetComponent <UISprite>();
                        if (us != null)
                        {
                            us.spriteName = "lingj";
                        }
                    }
                    tf = taskDic[id].transform.Find("Schedule");
                    if (tf != null)
                    {
                        NGUITools.SetActive(tf.gameObject, false);
                    }
                    finishtask.Add(id);
                }
                if (missionconfig.MissionType == 1)
                {
                    UIManager.Instance.ShowWindowByName("TaskAward");
                    UnityEngine.GameObject god = UIManager.Instance.GetWindowGoByName("TaskAward");
                    if (god != null)
                    {
                        TaskAward ta = god.GetComponent <TaskAward>();
                        if (ta != null)
                        {
                            ta.SetAwardProperty(id);
                            ta.InitTaskId(id, TaskCompleteType.T_common);
                        }
                    }
                }
                break;

            case ArkCrossEngine.MissionOperationType.DELETE:
                DeleteTask(id);
                if (missionconfig.MissionType == 1)
                {
                    UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("TaskAward");
                    if (!NGUITools.GetActive(go))
                    {
                        if (go != null)
                        {
                            TaskAward ta = go.GetComponent <TaskAward>();
                            if (ta != null && ta.TaskId != id)
                            {
                                ta.SetAwardProperty(id);
                                UIManager.Instance.HideWindowByName("GameTask");
                                UIManager.Instance.ShowWindowByName("TaskAward");
                            }
                        }
                    }
                    else
                    {
                        TaskAward ta = go.GetComponent <TaskAward>();
                        if (ta.TaskId != id)
                        {
                            awardtask.Add(id);
                        }
                    }
                }
                break;

            case ArkCrossEngine.MissionOperationType.UPDATA:
                break;

            default:
                break;
            }
            CheckHasFinish();
        }
        catch (Exception ex)
        {
            ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
        }
    }
示例#10
0
    protected virtual void OnDragDropRelease(UnityEngine.GameObject surface)
    {
        ChangeSlotState(false);
        UIDragDropContainer container = surface ? NGUITools.FindInParents <UIDragDropContainer>(surface) : null;

        if (container != null)
        {
            if (container.reparentTarget.name == "Equipment")
            {
                ItemClick ic = mTrans.gameObject.GetComponent <ItemClick>();
                if (ic != null)
                {
                    if (surface != null)
                    {
                        ArkCrossEngine.RoleInfo roleInfo = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
                        if (roleInfo != null)
                        {
                            ArkCrossEngine.ItemConfig itemConfig = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(ic.ID);
                            if (itemConfig != null)
                            {
                                if (itemConfig.m_WearLevel > roleInfo.Level)
                                {
                                    string tip = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(46);
                                    ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_screen_tip", "ui", tip, UIScreenTipPosEnum.AlignCenter, new UnityEngine.Vector3(0f, 0f, 0f));
                                }
                                else
                                {
                                    int    slotid = 0;
                                    string str    = surface.transform.name;
                                    if (str != null)
                                    {
                                        char[] ch = str.ToCharArray();
                                        if (ch != null && ch.Length >= 5)
                                        {
                                            if (System.Int32.TryParse(ch[4].ToString(), out slotid))
                                            {
                                                EquipmentInfo ei = GamePokeyManager.GetEquipmentInfo(slotid);
                                                if (ei != null)
                                                {
                                                    ArkCrossEngine.GfxSystem.EventChannelForLogic.Publish("ge_mount_equipment", "lobby", ic.ID, ic.PropertyId, slotid);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        if (mDragScrollView != null)
        {
            mDragScrollView.enabled = true;
        }

        if (mCollider != null)
        {
            mCollider.enabled = true;
        }
    }