protected override void OnCellRenderer(int groupIndex, int cellIndex, object cellData, RectTransform cellView, bool selected)
    {
        Animator animator = cellView.GetComponent <Animator>();

        if (animator)
        {
            animator.SetBool("IsOn", selected);
        }

        ProduceDialogVO infoVO      = (ProduceDialogVO)cellData;
        OnClickTool     onClickTool = cellView.GetOrAddComponent <OnClickTool>();

        onClickTool.OnClickHandler = OnClick;
        onClickTool.OnEnterHandler = OnEnter;
        onClickTool.OnExitHandler  = OnExit;
        Transform childTf = cellView.transform;

        m_TextDescribe = childTf.Find("Move/Label_Des").GetComponent <TextMeshProUGUI>();
        m_TextDescribe.SetText(TableUtil.GetLanguageString(infoVO.TextDescribe));
        m_TypeName = childTf.Find("Move/Label_Name").GetComponent <TextMeshProUGUI>();
        m_TypeName.SetText(TableUtil.GetLanguageString(infoVO.TypeName));
        m_ImageIcon     = childTf.Find("Image_Icon").GetComponent <Image>();
        m_ImageBsseIcon = childTf.Find("ImageBase").GetComponent <Image>();
        UIUtil.SetIconImage(m_ImageIcon, (uint)infoVO.ImageIcon);
        UIUtil.SetIconImage(m_ImageBsseIcon, (uint)infoVO.ImageBaseIcon);
    }
    /// <summary>
    /// 进度条刷新
    /// </summary>
    private void UpdateTime()
    {
        if (IsUpdateTime)
        {
            if (m_Needtime <= 0)
            {
                IsUpdateTime = false;
            }
            IsUpdateTime = true;
            m_Needtime--;
            float prog = m_MaxTime <= 0 ? 0 : (m_MaxTime - m_Needtime) / (float)m_MaxTime;
            if (prog >= 1)
            {
                m_ProgressRootImage.fillAmount = 0;
            }
            m_Progress = prog;
            string str = TimeUtil.GetTimeStr((long)m_Needtime);
            m_BlueprintStateLabel.text     = string.Format(TableUtil.GetLanguageString("production_title_1058"), str);
            m_ProgressRootImage.fillAmount = m_Progress;
            ProduceInfoVO gird = null;
            if (m_FoundryProxy.GetBluePrintDic().TryGetValue(m_TID, out gird))
            {
                gird.BluePrintState = prog >= 1 ? ProduceState.Finsh : gird.BluePrintState;
                gird.Progress       = prog;

                if (gird.BluePrintState == ProduceState.Finsh)
                {
                    RefreshData(1f, ProduceState.Finsh);
                    GameFacade.Instance.SendNotification(NotificationName.MSG_PRODUT_UPDATE, gird.BluePrintState);
                }
            }
        }
    }
    /// <summary>
    /// 根据类型初始化面板内容
    /// </summary>
    private void SetContent()
    {
        m_Prime.gameObject.SetActive(false);
        m_BlueprintNameLabel.text   = TableUtil.GetItemName(m_CurrentProduce.Id);
        m_BlueprintQuality.color    = ColorUtil.GetColorByItemQuality(TableUtil.GetItemQuality(m_CurrentItem.Id));
        m_BlueprintNumberLabel.text = m_CurrentProduce.ProductNum.ToString();
        string iconName = "";

        if (m_Style == UIViewListLayout.Row)
        {
            iconName = TableUtil.GetItemIconImage(m_CurrentItem.Id);
        }
        else
        {
            iconName = TableUtil.GetItemSquareIconImage(m_CurrentItem.Id);
        }

        UIUtil.SetIconImage(m_IconImage, TableUtil.GetItemIconBundle(m_CurrentItem.Id), iconName);
        m_OverlyingIcon.sprite = m_IconImage.sprite;
        switch (m_ProduceType)
        {
        case ProduceType.HeavyWeapon:
        case ProduceType.LightWeapon:
            WeaponL2 weaponL2 = 0;
            ItemTypeUtil.SetSubType(ref weaponL2, ItemTypeUtil.GetItemType(m_CurrentItem.Type));
            m_Prime.text = TableUtil.GetLanguageString(weaponL2);
            m_Prime.gameObject.SetActive(true);
            break;
        }
    }
Beispiel #4
0
 /// <summary>
 /// 填充好友数据
 /// </summary>
 public void SetFriendData(FriendInfoVO infoVO, UISocialList.SocialType socialType)
 {
     if (infoVO.UID > 0)
     {
         m_NullElelment.gameObject.SetActive(false);
         m_Elelment.gameObject.SetActive(true);
         m_SocialType = socialType;
         SetContent();
         m_LevelText.text  = string.Format(TableUtil.GetLanguageString("character_text_1019"), infoVO.Level.ToString());
         m_PlayerName.text = infoVO.Name;
         if (infoVO.TID > 0)
         {
             if (m_CfgEternityProxy.GetPlayerByItemTId(infoVO.TID) != null)
             {
                 UIUtil.SetIconImage(m_HeardImage, (uint)m_CfgEternityProxy.GetPlayerByItemTId(infoVO.TID).Value.HeadPortrait);
             }
         }
         if (infoVO.Status == FriendInfoVO.FriendState.ONLINE)
         {
             m_OnLineImage.gameObject.SetActive(true);
         }
     }
     else
     {
         m_NullElelment.gameObject.SetActive(true);
         m_Elelment.gameObject.SetActive(false);
     }
 }
 public void Init()
 {
     if (m_CharacterModel == null)
     {
         m_CharacterModel = transform.Find("Content/NPC").GetComponent <RawImage>();
     }
     if (m_ServerListProxy == null)
     {
         m_ServerListProxy = (ServerListProxy)GameFacade.Instance.RetrieveProxy(ProxyName.ServerListProxy);
     }
     if (m_CfgEternityProxy == null)
     {
         m_CfgEternityProxy = (CfgEternityProxy)GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy);
     }
     if (m_UpaTips == null)
     {
         m_UpaTips = transform.Find("Content/Content/Message");
     }
     if (m_Label == null)
     {
         m_Label = transform.Find("Content/Content/Label_Name").GetComponent <TMP_Text>();
     }
     m_CharacterModel.gameObject.SetActive(true);
     m_Label.text = TableUtil.GetLanguageString("esc_title_1002");
     ShowUpaTips();
     ShowCharacter();
 }
Beispiel #6
0
 public void OnRefresh()
 {
     if (m_Data != null)
     {
         m_Title.text = TableUtil.GetLanguageString($"gamingmap_name_{m_Data.gamingmapId}");
         m_Starmap3DViewer.SetModel(m_Data.bgmapRes, Vector3.zero, Vector3.zero, Vector3.one);
         m_Starmap3DViewer.GetComponent <RectTransform>().sizeDelta = m_Data.bgmapScale.ToVector2();
         m_Starmap3DViewer.transform.localPosition = m_Data.bgmapPos.ToVector2();
         m_MissionTrackings = m_TaskTrackingProxy.GetAllTrackings();
         m_TeamMembers      = m_TeamProxy.GetMembersList();
         DrawMap(MapManager.GetInstance().GetCurrentAreaUid());
         DrawLine();
         m_AreaPointContainer.sizeDelta = new Vector2(m_Data.minimapSize, m_Data.minimapSize);
         if (!m_CurrentCell)
         {
             foreach (var item in m_PointDic)
             {
                 m_CurrentCell = item.Value as StarAreaElement;
                 break;
             }
         }
         if (m_CurrentCell)
         {
             OwnerView.FocusTo(m_CurrentCell.gameObject);
             m_StarAreaPanelLeftTips.SetData(m_Data.gamingmapId, m_CurrentCell.GetData(), m_MissionTrackings, m_TeamMembers);
             m_StarAreaPanelLeftTips.gameObject.SetActive(true);
         }
         else
         {
             m_StarAreaPanelLeftTips.gameObject.SetActive(false);
         }
         State.GetAction(UIAction.StarArea_TipsToggle).Enabled = m_StarAreaPanelLeftTips.HasToggle();
         m_AreaPointContainer.DOLocalMove(-m_CurrentCell.transform.localPosition, 0.5F).SetEase(Ease.OutExpo);
     }
 }
Beispiel #7
0
    /// <summary>
    /// 处理删除角色热键回调
    /// </summary>
    /// <param name="callbackContext"></param>
    private void OnDeleteHotkeyCallback(HotkeyCallback callbackContext)
    {
        if (callbackContext.performed)
        {
            WwiseUtil.PlaySound((int)WwiseMusic.Music_deleteRole_Over, false, null);
            OpenParameter openParameter = new OpenParameter();
            openParameter.Title   = TableUtil.GetLanguageString("common_text_id_1018");
            openParameter.Content = string.Format(TableUtil.GetLanguageString("common_text_id_1017"),
                                                  m_ServerListProxy.GetCurrentCharacterVO().Name, m_ServerListProxy.GetCurrentCharacterVO().Level);
            openParameter.backgroundColor = BackgroundColor.Error;

            HotKeyButton HotKeyQuit = new HotKeyButton();
            HotKeyQuit.actionName = HotKeyID.FuncX;
            HotKeyQuit.showText   = TableUtil.GetLanguageString("common_hotkey_id_1001");
            HotKeyQuit.onEvent    = OnSubmitDeleteCharacter;

            HotKeyButton HotKeyCancel = new HotKeyButton();
            HotKeyCancel.actionName = HotKeyID.FuncB;
            HotKeyCancel.showText   = TableUtil.GetLanguageString("common_hotkey_id_1002");
            HotKeyCancel.onEvent    = OnCancelDeleteCharacter;

            openParameter.HotkeyArray = new HotKeyButton[] { HotKeyQuit, HotKeyCancel };
            UIManager.Instance.OpenPanel(UIPanel.ConfirmPanel, openParameter);
            WwiseUtil.PlaySound((int)WwiseMusic.Music_Panel_PopupPanel_Open, false, null);
        }
    }
Beispiel #8
0
    /// <summary>
    /// 设置基本数据
    /// </summary>
    private void SetBaseData()
    {
        m_NameInput.transform.Find("Text Area/Placeholder").GetComponent <TMP_Text>().text = TableUtil.GetLanguageString("login_title_1001"); //帐户名称
        m_PassInput.transform.Find("Text Area/Placeholder").GetComponent <TMP_Text>().text = TableUtil.GetLanguageString("login_title_1002"); //输入密码
        m_BtnLogin.transform.Find("Label").GetComponent <TMP_Text>().text = TableUtil.GetLanguageString("login_btn_1003");                    //登录

        m_NameInput.text = PlayerPrefs.GetString(LAST_LOGIN_USER);
        if (SettingINI.Setting.GetBoolValue(SettingINI.Setting.CombineKey(SettingINI.Constants.GROUP_LOGIN
                                                                          , SettingINI.Constants.KEY_ENABLE_DEFAULT_USERNAME)
                                            , false) &&
            SettingINI.Setting.TryGetValue(SettingINI.Setting.CombineKey(SettingINI.Constants.GROUP_LOGIN
                                                                         , SettingINI.Constants.KEY_DEFAULT_USERNAME)
                                           , out string defaultUsername))
        {
            m_NameInput.text = defaultUsername;
        }

        if (SettingINI.Setting.GetBoolValue(SettingINI.Setting.CombineKey(SettingINI.Constants.GROUP_LOGIN
                                                                          , SettingINI.Constants.KEY_RANDOM_USERNAME)
                                            , false))
        {
            m_NameInput.text = Guid.NewGuid().ToString().Substring(4, 16);
        }

        EventSystemUtils.SetFocus(m_NameInput);
        m_NameInput.caretPosition = m_NameInput.text.Length;
    }
Beispiel #9
0
 public override void OnGotFocus()
 {
     AddHotKey("left", HotKeyID.NavLeft, Decrease);
     AddHotKey("Right", HotKeyID.NavRight, Add);
     AddHotKey("confirm", HotKeyID.FuncA, Confirm, m_HotKeyRoot, TableUtil.GetLanguageString("common_hotkey_id_1001"));
     AddHotKey(HotKeyID.FuncB, Close, m_HotKeyRoot, TableUtil.GetLanguageString("common_hotkey_id_1002"));
 }
Beispiel #10
0
    private void UpdateMissionRow(string targetFieldText, string numberFieldText, RectTransform view, bool isShowOr, bool isFirstInGroup)
    {
        RectTransform normalBox         = view.Find("TargetNormal").GetComponent <RectTransform>();
        TMP_Text      targetFieldNormal = view.Find("TargetNormal/Left/Label_Target").GetComponent <TMP_Text>();
        TMP_Text      numberFieldNormal = view.Find("TargetNormal/Label_Num").GetComponent <TMP_Text>();
        Transform     orBox             = view.Find("TargetNormal/Label_or");
        Transform     pointBox          = view.Find("TargetNormal/Left/Image_point/Image");
        RectTransform grayBox           = view.Find("TargetGray").GetComponent <RectTransform>();
        TMP_Text      targetFieldGray   = view.Find("TargetGray/Left/Label_Target").GetComponent <TMP_Text>();
        RectTransform pointBoxGray      = view.Find("TargetGray/Left/Image_point/Image").GetComponent <RectTransform>();
        TMP_Text      numberFieldGray   = view.Find("TargetGray/Label_Num").GetComponent <TMP_Text>();
        TMP_Text      orText            = orBox.GetComponent <TMP_Text>();
        string        orString          = TableUtil.GetLanguageString("mission_title_1010");

        orText.text = orString;
        orBox.gameObject.SetActive(isShowOr);
        pointBox.gameObject.SetActive(isFirstInGroup);
        pointBoxGray.gameObject.SetActive(isFirstInGroup);
        targetFieldNormal.gameObject.SetActive(!isShowOr);
        numberFieldNormal.gameObject.SetActive(!isShowOr);
        if (isShowOr)
        {
            normalBox.gameObject.SetActive(isShowOr);
            grayBox.gameObject.SetActive(!isShowOr);
            return;
        }

        targetFieldNormal.text = targetFieldGray.text = targetFieldText;
        numberFieldNormal.text = numberFieldText;
        normalBox.gameObject.SetActive(m_MissionVO.MissionState == MissionState.CanAccept);
        grayBox.gameObject.SetActive(m_MissionVO.MissionState != MissionState.CanAccept);
    }
    /// <summary>
    /// 初始化消息动画
    /// </summary>
    private void InitializeMessageAnimation()
    {
        switch (m_CurrentMessage.type)
        {
        case NotificationName.MSG_MISSION_ACCEPT:
        case NotificationName.MSG_MISSION_FAIL:
            break;

        case NotificationName.MSG_MISSION_COMMIT:
        {
            UIIconAndLabel label = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>();
            if (label && label.Label)
            {
                label.Label.text = TableUtil.GetLanguageString("mission_title_1005");
            }
        }
        break;

        case NotificationName.MSG_MISSION_STATE_CHANGE:
        {
            UIIconAndLabel label = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>();
            if (label && label.Label)
            {
                label.Label.text = TableUtil.GetLanguageString("mission_title_1015");
            }
        }
        break;

        case NotificationName.MSG_PLAYER_LEVEL_UP:
        {
            UIIconAndLabel label = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>();
            if (label && label.Label)
            {
                label.Label.text = m_CurrentMessage.argument != null ? "Lv." + m_CurrentMessage.argument.ToString() : string.Empty;
            }
        }
        break;

        case NotificationName.MSG_PLAYER_SHIP_LEVEL_UP:
        {
            MsgShipLevelUp msg       = (MsgShipLevelUp)m_CurrentMessage.argument;
            UIIconAndLabel shipLabel = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>();
            if (shipLabel && shipLabel.Label)
            {
                shipLabel.Label.text = m_CurrentMessage.argument != null ? "Lv." + msg.m_level : string.Empty;
            }
            if (shipLabel && shipLabel.Icon)
            {
                UIUtil.SetIconImage(shipLabel.Icon, TableUtil.GetItemIconTid(msg.m_Tid));
            }
            if (shipLabel && shipLabel.Info)
            {
                string name = TableUtil.GetItemName(msg.m_Tid);
                shipLabel.Info.text = string.Format(TableUtil.GetLanguageString("hud_text_id_1036"), name);
            }
        }
        break;
        }
    }
Beispiel #12
0
    /// <summary>
    /// 注册热键
    /// </summary>
    public override void OnGotFocus()
    {
        base.OnGotFocus();

        AddHotKey(HotKeyID.FuncA, OnLoginHotkeyCallback, m_HotKeyRoot, TableUtil.GetLanguageString("common_hotkey_id_1004"));
        AddHotKey("f", HotKeyID.FuncY, OnCreateHotkeyCallback, m_HotKeyRoot, TableUtil.GetLanguageString("character_hotkey_1001"));
        AddHotKey(HotKeyID.FuncR3, OnDeleteHotkeyCallback, HOLD_TIME, m_HotKeyRoot, TableUtil.GetLanguageString("character_hotkey_1002"));
    }
Beispiel #13
0
    public void ShowName()
    {
        Eternity.FlatBuffer.Map mapData = m_CfgEternityProxy.GetCurrentMapData();
        ulong area = Map.MapManager.GetInstance().GetCurrentAreaUid();

        m_MapName.text  = TableUtil.GetLanguageString($"gamingmap_name_{mapData.GamingmapId}");
        m_AreaName.text = "-- " + TableUtil.GetLanguageString($"area_name_{mapData.GamingmapId}_{area}");
    }
Beispiel #14
0
    /// <summary>
    /// 更新角色列表
    /// </summary>
    private void UpdateCharacterList(int selectIndex)
    {
        List <CharacterVO> datas = m_ServerListProxy.GetLastLoginServer().CharacterList;

        m_CharacterToggleList.Clear();
        //  m_CharacterItemRoot.GetComponent<ToggleGroup>().allowSwitchOff = true;
        //int index = 0;
        int count = datas != null ? datas.Count : 0;

        SetHotKeyEnabled("f", datas.Count < 5);
        m_Title.text = string.Format(TableUtil.GetLanguageString("mailbox_title_1004"), datas.Count, 5);
        for (int i = 0; i < count; i++)
        {
            int sign = i;

            CharacterVO data = datas[i];

            Transform item =
                sign < m_CharacterItemRoot.childCount ?
                m_CharacterItemRoot.GetChild(sign) :
                GameObject.Instantiate(m_CharacterItemPrefab, m_CharacterItemRoot).transform;
            item.gameObject.SetActive(true);

            Toggle toggle = null;
            if (m_EletmentDic.ContainsKey(sign))
            {
                toggle = m_EletmentDic[sign].m_Toggle;
                m_EletmentDic[sign].InitData(data);
            }
            else
            {
                Eletment eletment = new Eletment();
                eletment.InitEletment(item);
                eletment.InitData(data);
                m_EletmentDic.Add(sign, eletment);
                toggle = eletment.m_Toggle;
            }
            toggle.onValueChanged.RemoveAllListeners();
            toggle.group = m_CharacterItemRoot.GetComponent <ToggleGroup>();
            toggle.group.allowSwitchOff = true;
            m_CharacterToggleList.Add(toggle);
            //  toggle.isOn = false;
            m_LastSelectIndex = -1;
            toggle.onValueChanged.AddListener((select) => {
                toggle.group.allowSwitchOff = false;
                OnToggleClick(select, item.gameObject, sign);
            });
            toggle.isOn = false;
        }
        for (int i = count; i < m_CharacterItemRoot.childCount; i++)
        {
            m_CharacterItemRoot.GetChild(i).GetComponent <Toggle>().onValueChanged.RemoveAllListeners();
            m_CharacterItemRoot.GetChild(i).gameObject.SetActive(false);
        }
        m_CharacterToggleList[selectIndex].isOn = true;

        FocusTo(m_CharacterToggleList[selectIndex]);
    }
Beispiel #15
0
    /// <summary>
    /// 重建视图
    /// </summary>
    private void RebuildView(string describe = null)
    {
        DeleteHotKey("f");

        bool isBattle = IsBattling();

        HotKeyMapID   hotKeyMapID = IsInSpace() ? HotKeyMapID.SHIP : HotKeyMapID.HUMAN;
        string        hotKeyID    = m_MustUseHumanFBox ? HotKeyID.LeapStart : IsInSpace() ? HotKeyID.InteractiveForShip : HotKeyID.InteractiveForHuman;
        RectTransform box         = (!IsInSpace() || m_MustUseHumanFBox) ? m_HumanBox : m_ShipBox;
        string        text        = !string.IsNullOrEmpty(describe) ? TableUtil.GetLanguageString(describe) : "Interactoin";

        HotkeyManager.HotkeyStyle hotkeyStyle = (!IsInSpace() || m_MustUseHumanFBox) ? HotkeyManager.HotkeyStyle.HUMAN_INTERACTIVE : HotkeyManager.HotkeyStyle.SHIP_INTERACTIVE;

        if (m_FocusNpcTid != 0)
        {
            float time = 0;
            switch (m_FocusNpcVO.InteractionType)
            {
            case 0: time = 0.0f; break;

            case 1: time = 0.0f; break;

            case 2: time = 0.0f; break;

            case 3: time = 0.6f; break;
            }

            AddHotKey("f", hotKeyMapID, hotKeyID, OnHotKeyCallbackByHold, time, box, text, hotkeyStyle);
        }

        bool tipShowed = false;

        for (int i = 0; i < m_OtherTipBox.childCount; i++)
        {
            Transform          child   = m_OtherTipBox.GetChild(i);
            InteractiveTipType tipType = (InteractiveTipType)i;
            bool enabled = false;
            if (tipType == InteractiveTipType.LockChest)
            {
                enabled = /* m_FocusNpcTid == 0 &&*/ !tipShowed /*&& !isBattle*/ && m_CurrentTipTypes.ContainsKey(tipType) && m_CurrentTipTypes[tipType];
            }
            else
            {
                enabled = m_FocusNpcTid == 0 && !tipShowed && !isBattle && m_CurrentTipTypes.ContainsKey(tipType) && m_CurrentTipTypes[tipType];
            }

            child.gameObject.SetActive(enabled);
            if (enabled)
            {
                tipShowed = true;
                Transform hotkeyBox = child.Find("HotKey");
                if (hotkeyBox != null)
                {
                    AddHotKey("f", hotKeyMapID, HotKeyID.ShipSwitchMode, OnHotKeyCallbackByTip, hotkeyBox, string.Empty, HotkeyManager.HotkeyStyle.UI_SIMPLE);
                }
            }
        }
    }
 public override void OnGotFocus()
 {
     base.OnGotFocus();
     AddHotKey(HotKeyID.NavNegative, HotKeyQOnClick, m_HotKeyRootQ, "", HotkeyManager.HotkeyStyle.UI_SIMPLE);
     AddHotKey(HotKeyID.NavPositive, HotKeyEOnClick, m_HotKeyRootE, "", HotkeyManager.HotkeyStyle.UI_SIMPLE);
     AddHotKey(HotKeyID.FuncX, NameInputOnClick, m_HotKeyRoot, TableUtil.GetLanguageString("character_hotkey_1003"));
     AddHotKey("esc", HotKeyID.FuncB, BackOnClick, m_HotKeyRoot, TableUtil.GetLanguageString("gameset_hotkey_1002"));
     SetHotKeyEnabled("esc", HaveCharacter());
 }
Beispiel #17
0
    /// <summary>
    /// 解锁条件字符
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public string GetUnLockLabel(uint id)
    {
        StringBuilder str = new StringBuilder();

        if (id <= 0)
        {
            str.Append("Not");
        }
        if (id > 0)
        {
            EffectElement?[] effectElements = m_CfgEternityProxy.GetEffectElementsByKey(id);
            for (int i = 0; i < effectElements.Length; i++)
            {
                OperationType fun = (OperationType)effectElements[i].Value.Function;
                switch (fun)
                {
                case OperationType.kGreaterAndEqual:
                    if (effectElements[i].Value.Attribute == (int)AttributeName.kDuanLevel)
                    {
                        str.Append(
                            TableUtil.GetLanguageString(AttributeName.kDuanLevel) +
                            TableUtil.GetLanguageString(OperationType.kGreaterAndEqual) +
                            effectElements[i].Value.Value.ToString() + "\n");
                    }
                    if (effectElements[i].Value.Attribute == (int)AttributeName.kRoleLevel)
                    {
                        str.Append(
                            TableUtil.GetLanguageString(AttributeName.kRoleLevel) +
                            TableUtil.GetLanguageString(OperationType.kGreaterAndEqual) +
                            effectElements[i].Value.Value.ToString() + "\n");
                    }
                    break;

                case OperationType.kGreater:
                    if (effectElements[i].Value.Attribute == (int)AttributeName.kDuanLevel)
                    {
                        str.Append(
                            TableUtil.GetLanguageString(AttributeName.kDuanLevel) +
                            TableUtil.GetLanguageString(OperationType.kGreaterAndEqual) +
                            effectElements[i].Value.Value.ToString() + "\n");
                    }
                    if (effectElements[i].Value.Attribute == (int)AttributeName.kRoleLevel)
                    {
                        str.Append(
                            TableUtil.GetLanguageString(AttributeName.kRoleLevel) +
                            TableUtil.GetLanguageString(OperationType.kGreater) +
                            effectElements[i].Value.Value.ToString() + "\n");
                    }
                    break;

                default:
                    break;
                }
            }
        }
        return(str.ToString());
    }
    /// <summary>
    /// 设置名称
    /// </summary>
    /// <param name="name"></param>
    protected void SetName(string name)
    {
        m_NameLabel.text = TableUtil.GetLanguageString(name);

        if (string.IsNullOrEmpty(m_NameLabel.text))
        {
            m_NameLabel.text = name;
        }
    }
Beispiel #19
0
 public override void OnGotFocus()
 {
     base.OnGotFocus();
     m_FovOld = CameraManager.GetInstance().GetUICameraComponent().GetCamera().fieldOfView;
     CameraManager.GetInstance().GetUICameraComponent().GetCamera().fieldOfView = 30;
     AddHotKey(HotKeyID.NavLeft, OnLeftClick);
     AddHotKey(HotKeyID.NavRight, OnRightClick);
     AddHotKey(HotKeyID.FuncA, OpenPanel, m_HotkeyRoot, TableUtil.GetLanguageString("esc_hotkey_1002"));
     AddHotKey(HotKeyID.FuncB, ClosePanel, m_HotkeyRoot, TableUtil.GetLanguageString("esc_hotkey_1003"));
 }
Beispiel #20
0
 /// <summary>
 /// 界面添加好友数据
 /// </summary>
 /// <param name="title">标题</param>
 /// <param name="list">数据</param>
 /// <param name=""></param>
 public void AddFriendDataToView(List <FriendInfoVO> list, string title = null)
 {
     if (title == null)
     {
         AddDatas(null, list.ToArray());
     }
     else
     {
         AddDatas(TableUtil.GetLanguageString(title), list.ToArray());
     }
 }
Beispiel #21
0
    public override void OnShow(object msg)
    {
        base.OnShow(msg);

        Eternity.FlatBuffer.Map mapData = m_CfgEternityProxy.GetCurrentMapData();
        m_Text.text = TableUtil.GetLanguageString($"gamingmap_name_{mapData.GamingmapId}");
        m_Coroutine = UIManager.Instance.StartCoroutine(Excute(5.0f, () =>
        {
            UIManager.Instance.ClosePanel(this);
        }));
    }
Beispiel #22
0
 /// <summary>
 /// 填充队伍数据
 /// </summary>
 public void SetTeamData(TeamMemberVO infoVO, UISocialList.SocialType socialType, Vector2Int vector2Int)
 {
     UIUtil.SetIconImage(m_TeamPosImage, (uint)m_TeamPosIcons[vector2Int.y]);
     if (infoVO.UID > 0)
     {
         m_NullElelment.gameObject.SetActive(false);
         m_Elelment.gameObject.SetActive(true);
         m_SocialType = socialType;
         SetContent();
         m_LevelText.text  = string.Format(TableUtil.GetLanguageString("character_text_1019"), infoVO.Level.ToString());
         m_DanText.text    = string.Format(TableUtil.GetLanguageString("social_text_1004"), infoVO.DanLevel.ToString());
         m_PlayerName.text = infoVO.Name;
         if (infoVO.IsOnline)
         {
             m_TeamOnLineImage.gameObject.SetActive(true);
         }
         if (infoVO.TID > 0)
         {
             if (m_CfgEternityProxy.GetPlayerByItemTId(infoVO.TID) != null)
             {
                 UIUtil.SetIconImage(m_TeamHeardImage, (uint)m_CfgEternityProxy.GetPlayerByItemTId(infoVO.TID).Value.HeadPortrait);
             }
         }
         if (m_FriendProxy.GetFriend(infoVO.UID) != null)            //好友
         {
             m_TeamFriendImage.gameObject.SetActive(true);
         }
         else
         {
             m_TeamFriendImage.gameObject.SetActive(false);
         }
         if (m_TeamProxy.GetMember(infoVO.UID) == null)
         {
             m_TeamHeaderImage.gameObject.SetActive(false);
         }
         else
         {
             if (m_TeamProxy.GetMember(infoVO.UID).IsLeader)                //队长
             {
                 m_TeamHeaderImage.gameObject.SetActive(true);
             }
             else
             {
                 m_TeamHeaderImage.gameObject.SetActive(false);
             }
         }
     }
     else
     {
         m_NullElelment.gameObject.SetActive(true);
         m_Elelment.gameObject.SetActive(false);
     }
 }
Beispiel #23
0
    /// <summary>
    /// 打开确认面板
    /// </summary>
    /// <param name="type">操作类型</param>
    public void OpenConfim(MsgProduceConfim confim)//消耗数据
    {
        ProduceOrder type = confim.OrderType;

        m_SelectProduceTid = confim.Tid;
        switch (type)
        {
        case ProduceOrder.Produce:      //生产
            m_ReturnTitle.text = string.Format(TableUtil.GetLanguageString("production_text_1025"),
                                               TableUtil.GetItemName(m_FoundryProxy.GetItemByProduceKey(m_SelectProduceTid).Id));
            m_HintLabel.text = "";
            break;

        case ProduceOrder.Canel:      //取消生产
            m_ReturnTitle.text = TableUtil.GetLanguageString("production_text_1026");
            m_HintLabel.text   = TableUtil.GetLanguageString("production_text_1041");
            m_IconList.Clear();
            Item[]           items   = m_FoundryProxy.GetEffectItem(m_SelectProduceTid);
            EffectElement?[] effects = m_FoundryProxy.GetEffectElementsByProduceTid(m_SelectProduceTid);
            for (int i = 0; i < items.Length; i++)
            {
                IconManager.Instance.LoadItemIcon <IconCommon>(IconConstName.ICON_COMMON, m_ReturnItemRoot,
                                                               (icon) =>
                {
                    m_IconList.Add(icon);
                    icon.SetData(TableUtil.GetItemIconTid(items[i].Id), items[i].Quality, (int)effects[i].Value.Value);
                });
            }

            break;

        case ProduceOrder.Recevie:      //领取 不要图标
            m_ReturnTitle.text = TableUtil.GetLanguageString("production_text_1028");
            m_HintLabel.text   = "";
            break;

        case ProduceOrder.SpeedUp:      //加速
            m_ReturnTitle.text = TableUtil.GetLanguageString("production_text_1027");
            m_HintLabel.text   = TableUtil.GetLanguageString("production_text_1040");
            m_IconList.Clear();
            IconManager.Instance.LoadItemIcon <IconCommon>(IconConstName.ICON_COMMON, m_ReturnItemRoot,
                                                           (icon) =>
            {
                m_IconList.Add(icon);
                icon.SetData(TableUtil.GetItemIconTid(GameConstant.CurrencyConst.RECHARGE_CURRENCY_ITEM_TID),
                             TableUtil.GetItemQuality(GameConstant.CurrencyConst.RECHARGE_CURRENCY_ITEM_TID), (int)confim.ExpendNum);
            });
            break;

        default:
            break;
        }
    }
    /// <summary>
    /// 设置区域名
    /// </summary>
    public void SetAraeName()
    {
        Eternity.FlatBuffer.Map mapData = m_CfgEternityProxy.GetCurrentMapData();
        ulong area = Map.MapManager.GetInstance().GetCurrentAreaUid();

        m_Text.text = TableUtil.GetLanguageString($"area_name_{mapData.GamingmapId}_{area}");

        m_Coroutine = UIManager.Instance.StartCoroutine(Excute(5.0f, () =>
        {
            UIManager.Instance.ClosePanel(this);
        }));
    }
    /// <summary>
    ///加载数据
    /// </summary>
    public void SetContent(TalentTypeVO talentTypeVO)
    {
        PlayerInfoVo playerInfoVo = NetworkManager.Instance.GetPlayerController().GetPlayerInfo();

        m_NameLabel.text = TableUtil.GetTalentName(talentTypeVO.Id);
        //UIUtil.SetIconImageSquare(m_IconImage, talentTypeVO.IconId);
        m_CoinLabel.text   = CurrencyUtil.GetTalentCurrencyCount().ToString();
        m_LevelLabel.text  = string.Format(TableUtil.GetLanguageString("character_text_1019"), playerInfoVo.WatchLv);
        talentTypeVO.Level = (int)playerInfoVo.WatchLv;
        Vector3 vector3 = new Vector3((float)talentTypeVO.MTalent.Value.Position.Value.X, (float)talentTypeVO.MTalent.Value.Position.Value.Y, 0);

        SetPos(vector3);
    }
Beispiel #26
0
 public override void OnGotFocus()
 {
     base.OnGotFocus();
     if (m_MissionVO.MissionState == MissionState.CanAccept)
     {
         AddHotKey("f", HotKeyID.FuncA, F_OnClick, m_MissionHotKeyParent, TableUtil.GetLanguageString("mission_hotkey_id_1001"));
     }
     else
     {
         AddHotKey("f", HotKeyID.FuncA, F_OnClick, m_MissionHotKeyParent, TableUtil.GetLanguageString("mission_hotkey_id_1004"));
     }
     AddHotKey(HotKeyID.FuncB, OnEscClose, m_MissionHotKeyParent, TableUtil.GetLanguageString("common_hotkey_id_1002"));
 }
Beispiel #27
0
 public void OnRefresh()
 {
     if (m_PointDic.Count == 0)
     {
         Eternity.FlatBuffer.Map mapData = m_CfgEternityProxy.GetCurrentMapData();
         m_MissionTrackings = m_TaskTrackingProxy.GetAllTrackings();
         m_TeamMembers      = m_TeamProxy.GetMembersList();
         DrawMap(mapData.BelongFixedStar);
         OwnerView.FocusTo(m_CurrentCell.gameObject);
     }
     m_Title.text = TableUtil.GetLanguageString("mapstar_title_1001");
     m_AreaPointContainer.DOLocalMove(Vector3.zero, 0.5F).SetEase(Ease.OutExpo);
 }
Beispiel #28
0
 public void Init()
 {
     if (m_Model == null)
     {
         m_Model = transform.Find("Content/NPC").GetComponent <RawImage>();
     }
     if (m_Label == null)
     {
         m_Label = transform.Find("Content/Content/Label_Name").GetComponent <TMP_Text>();
     }
     m_Label.text = TableUtil.GetLanguageString("esc_title_1006");
     m_Model.gameObject.SetActive(true);
     ShowModel();
 }
 /// <summary>
 /// 加载好友数据
 /// </summary>
 /// <param name="tip">tip物体</param>
 /// <param name="data">数据</param>
 private void LayoutFriendTip(GameObject tip, FriendInfoVO data)
 {
     if (data.UID > 0)
     {
         SetEmptyRootActive(false);
         Initialize();
         m_PlayerName.text = data.Name;
         m_Level.text      = string.Format(TableUtil.GetLanguageString("character_text_1019"), data.Level.ToString());
     }
     else
     {
         //SetEmptyRootActive(true);
     }
 }
Beispiel #30
0
 /// <summary>
 /// 状态改变
 /// </summary>
 private void OnStateChanged(ChangeBattleStateNotify notice)
 {
     if (notice.NewMainState != notice.OldMainState && notice.IsSelf)
     {
         if (notice.NewMainState == EnumMainState.Fight && (notice.OldMainState == EnumMainState.Cruise || notice.OldMainState == EnumMainState.Born))
         {
             UIManager.Instance.StartCoroutine(DelayShow(TableUtil.GetLanguageString("hud_text_id_1001")));
         }
         else if (notice.NewMainState == EnumMainState.Cruise && notice.OldMainState == EnumMainState.Fight)
         {
             UIManager.Instance.StartCoroutine(DelayShow(TableUtil.GetLanguageString("hud_text_id_1002")));
         }
     }
 }