Пример #1
0
    /// <summary>
    /// 设置松开时的图片
    /// </summary>
    private void SetNormalIcon()
    {
        if (string.IsNullOrEmpty(m_builData.bigImage))
        {
            Logger.LogDetail("Dating::  表DatingMapBuildConfig id={0}的配置中 建筑物正常显示的图片名为空,请检查配置", m_builData.ID);
            return;
        }

        var mr = transform.GetComponent <MeshRenderer>();

        if (mr == null)
        {
            var spriteRen = transform.GetComponentDefault <SpriteRenderer>();
            UIDynamicImage.LoadImage(m_builData.bigImage, (t) =>
            {
                spriteRen.sprite = t.ToSprite();
            }, transform);
        }
        else
        {
            var mrMat = transform.GetComponent <MeshRenderer>().material;
            if (mrMat == null)
            {
                Logger.LogError("Dating::  levelHome约会节点名 = {0} 没有材质球,请检查", transform.name);
            }
            else
            {
                UIDynamicImage.LoadImage(m_builData.bigImage, (t) => { mrMat.mainTexture = t; }, transform);
            }
        }
    }
    public override bool Initialize(params object[] p)
    {
        if (!base.Initialize(p))
        {
            return(false);
        }
        var soulAttr = (PSoulAttr)p[0];

        Util.SetItemInfoSimple(itemRoot, moduleFurnace.currentSoulItem.GetPropItem());
        var soulInfo = ConfigManager.Get <SoulInfo>(soulAttr?.soulId ?? 0);

        if (null != soulInfo)
        {
            UIDynamicImage.LoadImage(portrait?.transform, soulInfo.portrait);
        }

        moduleGlobal.ShowGlobalLayerDefault(-1);

        closeButton?.onClick.AddListener(() =>
        {
            parentWindow.ShowTipWindow();
            UnInitialize();
        });
        return(true);
    }
Пример #3
0
 private void RefreshPet(Transform t, PetInfo rPetInfo)
 {
     if (!t)
     {
         return;
     }
     for (var i = 0; i < t.childCount; i++)
     {
         t.GetChild(i).SafeSetActive(rPetInfo != null);
     }
     if (rPetInfo != null)
     {
         if (rPetInfo.UpGradeInfo != null)
         {
             UIDynamicImage.LoadImage(t.GetComponent <Transform>("sprite"), rPetInfo.UpGradeInfo.halfIcon, null, false);
         }
         Util.SetText(t.GetComponent <Text>("level_img/level_txt"), rPetInfo.Level.ToString());
         var stars = t.GetComponent <Transform>("stars/count");
         if (stars == null)
         {
             return;
         }
         for (var i = 0; i < stars.childCount; i++)
         {
             stars.GetChild(i).SafeSetActive(i < rPetInfo.Star);
         }
     }
 }
Пример #4
0
    private void SetCumulative(PWeflareInfo info)
    {
        if (info == null)
        {
            return;
        }

        var dataProgress = moduleWelfare.GetProgress(info);

        if ((WelfareType)info.type == WelfareType.Continuous)
        {
            Util.SetText(m_twoExpend, ConfigText.GetDefalutString(700, 1), moduleWelfare.ShowTxt(dataProgress, 1));
        }
        else if ((WelfareType)info.type == WelfareType.DailyFlush)
        {
            Util.SetText(m_twoExpend, ConfigText.GetDefalutString(700, 2), moduleWelfare.ShowTxt(dataProgress, 2));
        }

        var icon = parentWindow.GetIconName(info.icon, 0);

        UIDynamicImage.LoadImage(m_cumlativeIcon.gameObject, icon, null, true);
        m_cunlativeTxt.text = info.introduce.Replace("\\n", "\n");
        parentWindow.RemainTime(m_cunlativeTime, info.closetime);
        m_cunlativeData.SetItems(info.rewardid);
    }
    private void OnSetRuneItem(RectTransform node, RuneData data)
    {
        Transform no = node.Find("noImage");
        Transform have = node.Find("haveImage");
        Transform select = node.Find("selectBox");
        if (!no || !have || !select) return;
        no.gameObject.SetActive(!data.isOwnItem);
        have.gameObject.SetActive(data.isOwnItem);
        int index = moduleCollection.GetUIRuneData().FindIndex((p) => p.itemtypeId == data.itemtypeId);
        //设置默认选中已有的 第一个符文
        if(m_CurClickIndex==-1&&data.isOwnItem)
        {
            m_CurClickIndex = index;
        }
        select.gameObject.SetActive(index == m_CurClickIndex);
        if(index == m_CurClickIndex)
        {
            UIDynamicImage.LoadImage(m_RuneFullImage.transform, data.fullImage, null, true);

            m_RuneName.text = data.itemName;
            AtlasHelper.SetRune(m_RuneIconImage, data.iconId);
            var configText = ConfigManager.Get<ConfigText>(data.descId);
            if (configText)
                m_RuneDescriptionText.text = configText.text[0].Replace("\\n", "\n");
            ShowSuiteWords(data.suite, m_TwoSuitDescriptionText, m_FourSuitDescriptionText, false, false, true);
        }
    }
Пример #6
0
    private void OnClickRune(RectTransform node, PItem data)
    {
        if (curItem != null && data.itemId == curItem.itemId)
        {
            return;
        }
        lastItem = curItem;
        curItem  = data;

        var index = currentList.FindIndex(p => p.itemId == data.itemId);

        dataSource.SetItem(data, index);

        if (lastItem != null)
        {
            index = currentList.FindIndex(p => p.itemId == lastItem.itemId);
            dataSource.SetItem(lastItem, index);
        }

        var prop = ConfigManager.Get <PropItemInfo>(data.itemTypeId);

        if (prop == null || prop.mesh == null || prop.mesh.Length < 2)
        {
            return;
        }
        UIDynamicImage.LoadImage(runeIcon?.transform, prop.mesh[1]);
    }
Пример #7
0
    /// <summary>
    /// 设置头像 avatar 到目标对象
    /// 目标对象应当是一个 UI 元素
    /// 注意:如果头像加载失败并且未指定性别,头像将显示空白
    /// </summary>
    /// <param name="o">要显示头像的目标对象</param>
    /// <param name="avatar">头像</param>
    /// <param name="useNativeSize">是否使用原始头像大小</param>
    /// <param name="gender">性别 可选,主要用于头像加载失败时确定男性还是女性默认头像</param>
    public static void SetAvatar(GameObject o, string avatar, bool useNativeSize = false, int gender = -1)
    {
        if (!o)
        {
            return;
        }

        if (string.IsNullOrEmpty(avatar))
        {
            var dt = gender < 0 ? null : gender == 0 ? defaultFemale : defaultMale;
            AtlasHelper.SetAvatar(o, dt);
            return;
        }

        var cached = m_cachedAvatars.Get(avatar);

        if (cached)
        {
            UIDynamicImage.LoadImageCreated(o, avatar, cached, useNativeSize);
            return;
        }

        var fp = LocalFilePath.AVATAR + "/" + avatar + ".avatar";

        cached = Util.LoadImage(fp);
        if (cached)
        {
            m_cachedAvatars.Set(avatar, cached);
            UIDynamicImage.LoadImageCreated(o, avatar, cached, useNativeSize);
            return;
        }

        var url = URLs.avatar + avatar + ".png";

        UIDynamicImage.LoadImage(o, url, (di, t) =>
        {
            if (!t)
            {
                if (di && gender > -1)
                {
                    AtlasHelper.SetAvatar(di.gameObject, gender == 0 ? defaultFemale : defaultMale);
                }
                return;
            }
            m_cachedAvatars.Set(avatar, t);

            var data = UIDynamicImage.RemoveCache(url, false);

            if (data != null)
            {
                var hash = data.GetMD5();
                if ((fp = Util.SaveFile(fp, data)) != null)
                {
                    HashListFile.ReplaceHashListFile(hashFileName, avatar, hash);
                }
            }
        }, useNativeSize);
    }
Пример #8
0
    private void SetActive(State type, OpenWhichPvP _type)
    {
        m_scoreleft.SafeSetActive(_type != OpenWhichPvP.FriendPvP);
        m_rankleft.SafeSetActive(_type != OpenWhichPvP.FriendPvP);
        //normal
        freeMatchPanel.SafeSetActive(type == State.Normal);
        fastMatchBtn.SafeSetActive(type == State.Normal);

        lolBtnPanel.SafeSetActive(type == State.Normal);
        rankingInMainBtn.SafeSetActive(type == State.Normal);
        danlvInMainBtn.SafeSetActive(type == State.Normal);
        decriptInMainBtn.SafeSetActive(type == State.Normal);
        customMatchBtn.SafeSetActive(type == State.Normal && _type != OpenWhichPvP.LolPvP);
        bool isMine = type == State.Normal || type == State.Matching || type == State.MatchSuccess;

        mainPanel.SafeSetActive(isMine);
        m_bgImage.SafeSetActive(isMine);
        if (isMine)
        {
            string bg = Util.Format(MINE_BG_IMAGE, modulePlayer.proto);
            UIDynamicImage.LoadImage(m_bgImage, bg);
        }
        e_bagImage.SafeSetActive(type == State.MatchSuccess);
        bool m_isTrue = type == State.Normal || type == State.MatchSuccess;

        m_totalMatchOrScore.transform.parent.SafeSetActive(m_isTrue);
        m_winMatchOrRank.transform.parent.SafeSetActive(m_isTrue);

        bool m_freeMatch = _type != OpenWhichPvP.LolPvP && m_isTrue;

        m_winRate.SafeSetActive(m_freeMatch);
        if (m_freeMatch)
        {
            for (int i = 0; i < logosInMainPanel.childCount; i++)
            {
                logosInMainPanel.GetChild(i).SafeSetActive(false);
            }

            for (int i = 0; i < logosEnemy.childCount; i++)
            {
                logosEnemy.GetChild(i).SafeSetActive(false);
            }

            Set_MineTextInfo();
        }

        //matching
        time_parent.SafeSetActive(type == State.Matching);

        settlementPanel.SafeSetActive(false);
        rankingPanel.SafeSetActive(false);

        //matchSuccess
        vsTran.SafeSetActive(type == State.MatchSuccess);
        cancleMatchBtn.SafeSetActive(modulePlayer.pvpTimes > 0 && type != State.MatchSuccess);
    }
Пример #9
0
            public void RefreshBossItem(MonsterInfo info)
            {
                SetPanelVisible(info != null);
                if (!info)
                {
                    return;
                }

                UIDynamicImage.LoadImage(icon.transform, info.montserLargeIcon);
                name.text = info.name;
            }
Пример #10
0
    private void SetRewardInfo(PItem2[] itemlist, List <Transform> tranList, bool first = false)
    {
        for (int i = 0; i < tranList.Count; i++)
        {
            tranList[i].SafeSetActive(false);
        }
        var index = 0;

        for (int i = 0; i < itemlist.Length; i++)
        {
            var info = itemlist[i];
            if (info == null || index >= tranList.Count)
            {
                continue;
            }
            var prop = ConfigManager.Get <PropItemInfo>(info.itemTypeId);
            if (!prop || !prop.IsValidVocation(modulePlayer.proto))
            {
                continue;
            }

            if (first && prop.itemType == PropType.WallPaper && prop.subType == 1)
            {
                if (prop == null || prop.mesh == null || prop.mesh.Length < 1)
                {
                    continue;
                }
                m_saveBtn.onClick.RemoveAllListeners();
                m_saveBtn.onClick.AddListener(delegate { TakePhoto(prop.mesh[0]); });
                UIDynamicImage.LoadImage(m_photo.transform, prop.mesh[0]);
                for (int j = 0; j < m_lockObj.Count; j++)
                {
                    if (j + 1 >= prop.mesh.Length)
                    {
                        continue;
                    }
                    AtlasHelper.SetPuzzle(m_lockObj[j].gameObject, prop.mesh[j + 1], null, true);
                }
                continue;
            }
            tranList[index].SafeSetActive(true);
            Util.SetItemInfo(tranList[index], prop, info.level, (int)info.num, false, info.star);
            if (!(prop.itemType == PropType.WallPaper && prop.subType == 1))
            {
                var btn = tranList[index].GetComponentDefault <Button>();
                btn.onClick.RemoveAllListeners();
                btn.onClick.AddListener(delegate
                {
                    moduleGlobal.UpdateGlobalTip(info, true, false);
                });
            }
            index++;
        }
    }
Пример #11
0
    private void RefreshItemSoulInfo()
    {
        var soulInfo = ConfigManager.Get <SoulInfo>(moduleFurnace.currentSoulItem?.growAttr.soulAttr?.attr?.soulId ?? 0);

        if (null != soulInfo)
        {
            UIDynamicImage.LoadImage(portrait?.transform, soulInfo.portrait);
        }
        portrait.SafeSetActive(null != soulInfo);

        soulEntry.Init(moduleFurnace.currentSoulItem?.growAttr.soulAttr?.attr);
    }
Пример #12
0
    private void SetLevelInfo(PWeflareInfo info)
    {
        SetTipTxt(info);
        var backImg = parentWindow.GetIconName(info.icon, 0);
        var txtImg  = parentWindow.GetIconName(info.icon, 1);

        UIDynamicImage.LoadImage(m_levelUpBgICon.gameObject, backImg, null, true);
        UIDynamicImage.LoadImage(m_levelUpICon.gameObject, txtImg, null, true);
        m_levleUpTxt.text = info.introduce.Replace("\\n", "\n");
        parentWindow.RemainTime(m_levelUpTime, info.closetime);
        m_levelUpData.SetItems(info.rewardid);
    }
Пример #13
0
 public void SetBannerInfo(BannerInfo info)
 {
     if (info == null)
     {
         return;
     }
     m_info = info;
     GetPath();
     UIDynamicImage.LoadImage(m_banImg, info.picture);
     m_banBtn.onClick.RemoveAllListeners();
     m_banBtn.onClick.AddListener(BtnOnClick);
 }
Пример #14
0
    private void MatchSuccessState(PMatchInfo[] info)
    {
        moduleGlobal.ShowGlobalLayerDefault(2, false);
        state = State.MatchSuccess;

        SetActive(state, modulePVP.opType);
        timeForCountDown = 7;
        Util.SetText(decriptionForTime, (int)TextForMatType.MatchUIText, 6);

        for (int i = 0; i < info.Length; i++)
        {
            if (modulePlayer.id_ != info[i].roleId)
            {
                e_roleName.text = info[i].roleName;
                e_level.text    = Util.Format("LV:{0}", info[i].level);
                string bg = Util.Format(ENEMY_BG_IMAGE, info[i].roleProto);
                UIDynamicImage.LoadImage(e_bagImage, bg);

                m_scoreleft.SafeSetActive(modulePVP.opType != OpenWhichPvP.FriendPvP);
                m_rankleft.SafeSetActive(modulePVP.opType != OpenWhichPvP.FriendPvP);
                if (modulePVP.opType == OpenWhichPvP.LolPvP)
                {
                    e_score.transform.parent.SafeSetActive(true);
                    e_rank.transform.parent.SafeSetActive(true);
                    Util.SetText(e_score, (int)TextForMatType.MatchUIText, 4, info[i].score);
                    SetTargetRank(e_rank, info[i].rank, true);
                    e_winRate.SafeSetActive(false);

                    RefreshEnemyLogo(info[i].score);
                }
                else if (modulePVP.opType == OpenWhichPvP.FreePvP)
                {
                    e_score.transform.parent.SafeSetActive(true);
                    e_rank.transform.parent.SafeSetActive(true);
                    Util.SetText(e_score, (int)TextForMatType.MatchUIText, 2, info[i].pvpTimes);
                    Util.SetText(e_rank, (int)TextForMatType.MatchUIText, 3, info[i].pvpWinTimes);
                    string percent = info[i].pvpTimes == 0 ? "0 %" : ((float)info[i].pvpWinTimes / (float)info[i].pvpTimes).ToString("P0");
                    Util.SetText(e_winRate, (int)TextForMatType.MatchUIText, 16, percent);
                    e_winRate.SafeSetActive(true);
                }
                else
                {
                    e_score.transform.parent.SafeSetActive(false);
                    e_rank.transform.parent.SafeSetActive(false);
                    e_winRate.SafeSetActive(false);
                }

                CreatEnemyCreature(info[i]);
                break;
            }
        }
    }
    private void SetContinuous(PWeflareInfo info)
    {
        var dataProgress = moduleWelfare.GetProgress(info);

        Util.SetText(m_threeExpend, ConfigText.GetDefalutString(700, 0), moduleWelfare.ShowTxt(dataProgress, 2));

        var icon = parentWindow.GetIconName(info.icon, 0);

        UIDynamicImage.LoadImage(m_continuousIcon.gameObject, icon, null, true);
        m_continousTxt.text = info.introduce.Replace("\\n", "\n");
        parentWindow.RemainTime(m_continousTime, info.closetime);
        m_continousData.SetItems(info.rewardid);
    }
Пример #16
0
    public void SetInfo(PropItemInfo Info, string weaponAttack, string eleAttck, string weaLevel, bool use)
    {
        if (Info == null)
        {
            Logger.LogError("info can not find in propitem " + Info.ID);
            return;
        }
        WeaponAttribute dInfo = ConfigManager.Get <WeaponAttribute>(Info.ID);

        Util.SetText(EleType, Show(dInfo.elementType));
        for (int i = 0; i < IConType.Count; i++)
        {
            IConType[i].gameObject.SetActive(false);
            if (i == (Info.subType - 1))
            {
                IConType[i].gameObject.SetActive(true);
            }
        }

        //拥有该武器
        m_id.text = Info.ID.ToString();

        PropItemInfo prpos = ConfigManager.Get <PropItemInfo>(Info.ID);

        if (prpos.mesh.Length <= 0)
        {
            Logger.LogError("can not find mesh name " + Info.ID);
            return;
        }
        string iconname = prpos.mesh[0];

        UIDynamicImage.LoadImage(Weapon_icon.transform, iconname, (d, t) => { Weapon_icon.gameObject.SetActive(true); }, false);

        Weaponname.text = Info.itemName;
        attacknum.text  = weaponAttack;
        elementnum.text = eleAttck;
        string format = weaLevel + Foring_Text[23];

        Util.SetText(WeaponLevel, format);

        Hight_back.gameObject.SetActive(false);
        Gary.gameObject.SetActive(true);
        if (use)
        {
            Gary.gameObject.SetActive(false);
            Hight_back.gameObject.SetActive(true);
        }

        Btn.onClick.RemoveListener(ObjClick);
        Btn.onClick.AddListener(ObjClick);
    }
Пример #17
0
    private void OnCameraShotUIState(Event_ e)
    {
        var asset    = (string)e.param2;
        var show     = !string.IsNullOrEmpty(asset);
        var duration = (float)e.param3;

        if (show && duration > 0)
        {
            UIDynamicImage.LoadImage(GetComponent <RectTransform>("Image"), asset);

            m_hideDelay = duration;
            Show();
        }
    }
Пример #18
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        UIDynamicImage myScript = (UIDynamicImage)target;

        GUILayout.Space(5);
        EditorGUILayout.LabelField("--------------------------------------------------------------------------------------------------------------------");
        GUILayout.Space(5);
        myScript.mGroup = (DynamicAtlasGroup)EditorGUILayout.EnumPopup("Group", myScript.mGroup);
        EditorGUILayout.LabelField("Texture Path", myScript.currentPath);

        GUILayout.Space(5);

        if (EditorApplication.isPlaying)
        {
            if (GUILayout.Button("Show DynamicAtlas"))
            {
                DynamicAtlasWindow.ShowWindow(myScript.mGroup);
            }
        }
        else
        {
            if (string.IsNullOrEmpty(myScript.currentPath) && myScript.sprite)
            {
                string path = AssetDatabase.GetAssetPath(myScript.sprite);
//                    Debug.Log($"myScript.currentPath:{myScript.currentPath}   path:{path}");
                myScript.currentPath = path;
            }
            else
            {
                if ((lastTexture != myScript.sprite) || (myScript.sprite != null && myScript.currentPath == null))
                {
                    lastTexture = myScript.sprite;
                    string path = AssetDatabase.GetAssetPath(myScript.sprite);
                    myScript.currentPath = path;
                }

                if (myScript.sprite == null)
                {
                    lastTexture          = null;
                    myScript.currentPath = null;
                }
            }
        }
        EditorGUILayout.LabelField("--------------------------------------------------------------------------------------------------------------------");

        EditorGUILayout.LabelField("--------------------------------------------------------------------------------------------------------------------");
    }
Пример #19
0
    void RefreshRune(PItem item)
    {
        runeIcon.SafeSetActive(item != null);
        if (item == null)
        {
            return;
        }
        var prop = ConfigManager.Get <PropItemInfo>(item.itemTypeId);

        if (prop == null || prop.mesh == null || prop.mesh.Length < 2)
        {
            return;
        }
        UIDynamicImage.LoadImage(runeIcon?.transform, prop.mesh[1]);
    }
Пример #20
0
    private void SetIcon(Transform node, DatingMapBuildConfig data)
    {
        if (string.IsNullOrEmpty(data.bigImage))
        {
            Logger.LogError("Dating::  表DatingMapBuildConfig id={0} 的 bigImage 字段为空,请检查配置", data.ID);
            return;
        }

        var mr = node.GetComponent <MeshRenderer>();

        if (mr == null)
        {
            var       spriteRen = node.GetComponentDefault <SpriteRenderer>();
            Texture2D t2d       = Level.GetPreloadObject <Texture2D>(data.bigImage, false);
            if (!t2d)
            {
                UIDynamicImage.LoadImage(data.bigImage, (t) =>
                {
                    spriteRen.sprite = t.ToSprite();
                }, node);
            }
            else
            {
                spriteRen.sprite = t2d.ToSprite();
            }
            //Logger.LogError("Dating::  levelHome约会节点名 = {0} 没有材质球,请检查", node.name);
            //return;
        }
        else
        {
            var       mrMat = node.GetComponent <MeshRenderer>().material;
            Texture2D t2d   = Level.GetPreloadObject <Texture2D>(data.bigImage, false);
            if (!t2d)
            {
                UIDynamicImage.LoadImage(data.bigImage, (t) =>
                {
                    mrMat.mainTexture = t;
                }, node);
            }
            else
            {
                mrMat.mainTexture = t2d;
            }
        }
    }
Пример #21
0
    private void RefreshInfo(PSoulAttr rAttr)
    {
        soulEntry.Init(rAttr);

        var soulInfo = ConfigManager.Get <SoulInfo>(rAttr.soulId);

        if (null == soulInfo)
        {
            return;
        }

        UIDynamicImage.LoadImage(soulInfo.portrait, t =>
        {
            sprite.SafeSetActive(t);
        }, false, sprite.transform);

        AtlasHelper.SetRune(spriteShadow, soulInfo.shodow);
    }
Пример #22
0
    private void RefreshWindow(Module_Npc.NpcMessage msg)
    {
        if (msg == null)
        {
            return;
        }

        if (msg.npcInfo != null)
        {
            AtlasHelper.SetNpcDateInfo(m_npcName, msg.npcInfo.artNameTwo);
            UIDynamicImage.LoadImage(m_npcIcon, msg.npcInfo.bigBodyIcon);
            Util.SetText(m_cvName, msg.npcInfo.voiceActor);
        }
        Util.SetText(m_curStage, msg.curStageName);

        //当前阶段刷新
        if (msg.belongStageName != null && msg.belongStageName.Length >= 3)
        {
            Util.SetText(m_lvName1, msg.belongStageName[0]);
            Util.SetText(m_lvName2, msg.belongStageName[1]);
            Util.SetText(m_lvName3, msg.belongStageName[2]);
        }

        int remainder = msg.fetterLv % 3;

        m_curImage1.SafeSetActive(remainder == 1);
        m_curImage2.SafeSetActive(remainder == 2);
        m_curImage3.SafeSetActive(remainder == 0);

        //下一阶段刷新
        m_nextStage.SafeSetActive(msg.fetterStage < msg.maxFetterStage);

        if (msg.fetterStage < msg.maxFetterStage)
        {
            Util.SetText(m_nextStage, msg.GetStageName(msg.fetterStage + 1));
        }

        //解锁系统刷新
        m_unlockSystem.SafeSetActive(msg.isUnlockEngagement);
        if (msg.isUnlockEngagement)
        {
            Util.SetText(m_unlockSystem, 177);
        }
    }
Пример #23
0
    private void SetPlaneInfo(PBulletin info)//获取所有信息 传进plane 显示具体信息
    {
        if (info == null)
        {
            return;
        }
        foreach (Transform item in Title_back_img.transform)
        {
            item.SafeSetActive(false);
        }
        UIDynamicImage.LoadImage(Title_back_img.transform, info.icon, null, true);

        conTmgTxt.SafeSetActive(!string.IsNullOrEmpty(info.icon));
        Util.SetText(Subtitle_txt, string.Format("  {0}", info.conTitle));
        Util.SetText(conTmgTxt, info.iconDesc);
        Contxt_one.text = info.content;
        Contxt_one.Set();
        RectTransform rt = conTmgTxt.GetComponentDefault <RectTransform>();

        rt.anchoredPosition = new Vector3(info.positionX, info.positionY, 0);

        var openWindow = -1;
        var openLable  = -1;

        if (!info.turnPage.Contains("-"))
        {
            var type = Util.Parse <int>(info.turnPage);
            Go_btn.gameObject.SetActive(type > 0);
            openWindow = Util.Parse <int>(info.turnPage);
        }
        else
        {
            Go_btn.SafeSetActive(true);
            string[] str = info.turnPage.Split('-');
            openWindow = Util.Parse <int>(str[0]);
            openLable  = Util.Parse <int>(str[1]);
        }
        Go_btn.onClick.RemoveAllListeners();
        Go_btn.onClick.AddListener(delegate
        {
            moduleAnnouncement.OpenWindow(openWindow, openLable);
        });
    }
Пример #24
0
    private void OpenSecondScenePanel(EnumNPCDatingSceneType t)
    {
        m_tfSecondScenePanel.SafeSetActive(true);

        var data = moduleNPCDating.GetDatingSceneData(t);

        if (data == null)
        {
            return;
        }
        m_curOpenSceneData = data;
        Util.SetText(m_textSceneName, data.nameID);
        Util.SetText(m_textSceneOpenTime, data.startTime + "-" + data.endTime);
        Util.SetText(m_textSceneDesc, data.sceneDescID);
        Util.SetText(m_textConsumePower, Util.Format(ConfigText.GetDefalutString(TextForMatType.NpcDating, 15), data.consumePower));
        UIDynamicImage.LoadImage(m_tfSceneImage, data.sceneIcon);
        UIDynamicImage.LoadImage(m_tfSceneBottomImage, data.strBottomMarkImage);
        AtlasHelper.SetNpcDateInfo(m_imgSceneTopImage, data.strTopMarkImage, null, true);

        int[] openEventNameIds = new int[] { };
        for (int i = 0; i < moduleNPCDating.openWindowData.sceneOpenEvent.Length; i++)
        {
            if (moduleNPCDating.openWindowData.sceneOpenEvent[i].datingScene == data.levelId)
            {
                openEventNameIds = moduleNPCDating.openWindowData.sceneOpenEvent[i].openEventIds;
                break;
            }
        }

        for (int i = 0; i < m_tfSceneOpenEvent.childCount; i++)
        {
            if (i <= openEventNameIds.Length - 1)
            {
                m_tfSceneOpenEvent.GetChild(i).SafeSetActive(true);
                Text eventText = m_tfSceneOpenEvent.GetChild(i).GetComponent <Text>();
                Util.SetText(eventText, openEventNameIds[i]);
            }
            else
            {
                m_tfSceneOpenEvent.GetChild(i).SafeSetActive(false);
            }
        }
    }
Пример #25
0
    //怪物出现的关卡
    private void SetMonShow(CooperationTask info)
    {
        m_monShowPlane.gameObject.SetActive(true);
        UIDynamicImage.LoadImage(m_monIcon, info.icon);
        Util.SetText(m_monDesc, info.desc);
        Util.SetText(m_monsterName, info.name);
        m_noApper.gameObject.SetActive(false);
        m_monsterView.gameObject.SetActive(false);

        if (moduleActive.CoopShowList.Count <= 0)
        {
            m_noApper.gameObject.SetActive(true);
        }
        else
        {
            m_monsterView.gameObject.SetActive(true);
            monsterData.SetItems(moduleActive.CoopShowList);
        }
    }
Пример #26
0
    private void SetFirstFlush(PWeflareInfo firstInfo)
    {
        if (firstInfo == null)
        {
            return;
        }
        var icon = parentWindow.GetIconName(firstInfo.icon, 0);

        UIDynamicImage.LoadImage(m_firstIcon.gameObject, icon, null, true);

        if (firstInfo.rewardid.Length <= 0)
        {
            return;
        }

        m_firstTxt.text = firstInfo.introduce.Replace("\\n", "\n");
        m_getBtn.SafeSetActive(false);
        m_getBtn.interactable = false;
        m_firstBtn.SafeSetActive(false);
        parentWindow.RemainTime(m_firstTime, firstInfo.closetime);

        var list = moduleWelfare.CheckProto(firstInfo.rewardid[0].reward);

        m_firstData.SetItems(list);

        var state = firstInfo.rewardid[0].state;

        if (state == 0)
        {
            m_firstBtn.SafeSetActive(true);
        }
        else if (state == 1)
        {
            m_getBtn.SafeSetActive(true);
            m_getBtn.interactable = true;
            Util.SetText(m_getBtnTxt, ConfigText.GetDefalutString(211, 3));
        }
        else if (state == 2)
        {
            m_getBtn.SafeSetActive(true);
            Util.SetText(m_getBtnTxt, ConfigText.GetDefalutString(211, 4));
        }
    }
Пример #27
0
    public override bool Initialize(params object[] p)
    {
        if (!base.Initialize(p))
        {
            return(false);
        }

        var item     = moduleFurnace.currentSoulItem;
        var soulAttr = item.growAttr.soulAttr?.activeAttr;

        var prevSoulAttr = item.growAttr.soulAttr?.attr;

        leftEntry.Init(prevSoulAttr);
        rightEntry.Init(soulAttr);

        var prevSoulInfo = ConfigManager.Get <SoulInfo>(prevSoulAttr?.soulId ?? 0);
        var soulInfo     = ConfigManager.Get <SoulInfo>(soulAttr?.soulId ?? 0);

        if (null != prevSoulInfo)
        {
            UIDynamicImage.LoadImage(leftPortrait?.transform, prevSoulInfo.portrait);
        }
        if (null != soulInfo)
        {
            UIDynamicImage.LoadImage(rightPortrait?.transform, soulInfo.portrait);
        }


        Util.SetItemInfo(itemRoot, item.GetPropItem());

        discardCost?.SafeSetActive(null != prevSoulAttr);
        discardButton?.SafeSetActive(null != prevSoulAttr);
        if (null != prevSoulAttr)
        {
            discardButton?.onClick.AddListener(OnDiscard);
            RefreshDiscardCost(prevSoulAttr);
        }
        applyButton?.onClick.AddListener(OnApply);

        moduleGlobal.ShowGlobalLayerDefault(-1);
        return(true);
    }
Пример #28
0
    private void AssertIndex()
    {
        RefreshButtonState();

        RefreshTimes();

        var task = moduleAwakeMatch.CurrentTask.taskConfigInfo;

        if (task != null)
        {
            var stageInfo = ConfigManager.Get <StageInfo>(task.stageId);
            var str       = stageInfo.icon.Split(';');
            if (str.Length >= 1)
            {
                UIDynamicImage.LoadImage(taskIcon.transform, str[0]);
            }
        }

        RefreshTaskDesc();
    }
Пример #29
0
    private void RefreshInfo()
    {
        if (m_chargeItem == null)
        {
            return;
        }

        var list = parentWindow.ItemList(m_chargeItem.info.reward);

        list.Sort((a, b) => a.itemId.CompareTo(b.itemId));
        m_data.SetItems(list);

        UIDynamicImage.LoadImage(m_icon.transform, m_chargeItem.info.icon);

        var old  = Util.GetChargeCurrencySymbol((ChargeCurrencyTypes)m_chargeItem.info.currencyType) + m_chargeItem.info.price.ToString();
        var sale = Util.GetChargeCurrencySymbol((ChargeCurrencyTypes)m_chargeItem.info.currencyType) + m_chargeItem.info.cost.ToString();

        Util.SetText(m_oldPrice, old);;
        Util.SetText(m_salePrice, sale);
        SetBtnState();
    }
Пример #30
0
    private void RefreshTaskInfo()
    {
        if (null == chaseTask)
        {
            return;
        }
        RefreshChallengeTimes();

        _chaseStar?.RefreshPanel(chaseTask);
        var task = chaseTask.taskConfigInfo;

        if (task != null)
        {
            Util.SetText(_stageName, task.name);
            Util.SetText(_stageDesc, task.desc);
            Util.SetText(_energyCost, $"(     ×{task.fatigueCount})");
            Util.SetText(_recommend, Util.Format(ConfigText.GetDefalutString(TextForMatType.AssistUI, 9), task.recommend));
            _recommend.color = ColorGroup.GetColor(ColorManagerType.Recommend, modulePlayer.roleInfo.fight >= task.recommend);
            _recommend?.transform.parent.SafeSetActive(task.recommend > 0);
            var stageInfo = ConfigManager.Get <StageInfo>(task.stageId);
            var str       = stageInfo.icon.Split(';');
            if (str.Length >= 1)
            {
                UIDynamicImage.LoadImage(_taskIcon.transform, str[0]);
            }
            List <int> reward = new List <int>(stageInfo.previewRewardItemId);
            reward.RemoveAll(item =>
            {
                var prop = ConfigManager.Get <PropItemInfo>(item);
                return(!(prop && prop.proto != null && (prop.proto.Contains(CreatureVocationType.All) || prop.proto.Contains((CreatureVocationType)modulePlayer.proto))));
            });
            new DataSource <int>(reward, _rewardScrollView, OnSetItem, OnItemClick);
        }

        for (var i = 0; i < _stars.Length; i++)
        {
            _stars[i].SafeSetActive(chaseTask.star >= i + 1);
        }
    }