少年修仙传客户端代码仓库
client_Wu Xijin
2018-09-03 274c4a7e5cc4a95d435b784bd4abb26167a6ad8f
3197 【前端】法宝快捷入口显示修改
4个文件已修改
72 ■■■■ 已修改文件
Core/GameEngine/Model/Config/TreasureUpConfig.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/TreasureUpConfig.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureCollectBriefInfoBehaviour.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureData.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/TreasureUpConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:            第二世界
//    [  Date ]:           Thursday, August 16, 2018
//    [  Date ]:           Monday, September 03, 2018
//--------------------------------------------------------
using UnityEngine;
@@ -20,6 +20,7 @@
        public int UnLockFuncID { get ; private set ; }
        public int ActiveMWID { get ; private set ; }
        public string ItemAward { get ; private set; } 
        public string DescriptionMainWin { get ; private set; }
        public override string getKey()
        {
@@ -51,6 +52,8 @@
                ActiveMWID=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; 
            
                ItemAward = rawContents[8].Trim();
                DescriptionMainWin = rawContents[9].Trim();
            }
            catch (Exception ex)
            {
Core/GameEngine/Model/Config/TreasureUpConfig.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 882666fd713678849aebb360643bfe19
timeCreated: 1534419056
timeCreated: 1535946483
licenseType: Pro
MonoImporter:
  serializedVersion: 2
System/Treasure/TreasureCollectBriefInfoBehaviour.cs
@@ -8,6 +8,7 @@
using TableConfig;
using System;
using System.Collections.Generic;
using LitJson;
namespace Snxxz.UI
{
@@ -28,9 +29,11 @@
        bool dirty = false;
        int m_DisplayTreasureId = 0;
        int displayTreasureId {
        int displayTreasureId
        {
            get { return m_DisplayTreasureId; }
            set {
            set
            {
                if (m_DisplayTreasureId != value)
                {
                    m_DisplayTreasureId = value;
@@ -40,9 +43,11 @@
        }
        DisplayState m_DisplayState = DisplayState.None;
        DisplayState displayState {
        DisplayState displayState
        {
            get { return m_DisplayState; }
            set {
            set
            {
                if (m_DisplayState != value)
                {
                    m_DisplayState = value;
@@ -52,9 +57,11 @@
        }
        int m_EffectState = 0;
        int effectState {
        int effectState
        {
            get { return m_EffectState; }
            set {
            set
            {
                if (m_EffectState != value)
                {
                    m_EffectState = value;
@@ -293,13 +300,7 @@
                        m_Description.text = Language.Get("FabaoState_Text_3");
                        break;
                    case DisplayState.AwakenUnderway:
                        var progress = 1f;
                        if (treasure != null && config.PreferredStage != 0)
                        {
                            progress = (float)treasure.stage / config.PreferredStage;
                        }
                        m_Description.text = Language.Get("FabaoState_Text_4", Mathf.RoundToInt(progress * 100f));
                        DisplayTreasureUpStage(treasure.GetStageId(treasure.stage + 1));
                        break;
                    case DisplayState.WaitUnLock:
                        Achievement achievement = null;
@@ -534,6 +535,25 @@
            }
        }
        private void DisplayTreasureUpStage(int _stage)
        {
            var config = Config.Instance.Get<TreasureUpConfig>(_stage);
            if (config != null)
            {
                var json = JsonMapper.ToObject(config.DescriptionMainWin);
                var job = PlayerDatas.Instance.baseData.Job;
                if (json.Keys.Contains(job.ToString()))
                {
                    m_Description.text = json[job.ToString()].ToString();
                }
                else
                {
                    m_Description.text = json["0"].ToString();
                }
            }
        }
        enum DisplayState
        {
            None,
System/Treasure/TreasureData.cs
@@ -239,6 +239,8 @@
            treasureStages.Add(_stage);
        }
        public void UpdateTreasureLevelExp(int _lv, int _exp, bool _hasClickChallenge)
        {
            stage = _lv;
@@ -272,6 +274,19 @@
                return false;
            }
            return stage >= _stage.stage;
        }
        public int GetStageId(int _stageIndex)
        {
            foreach (var item in treasureStages)
            {
                if (item.stage == _stageIndex)
                {
                    return item.id;
                }
            }
            return 0;
        }
        public int GetStageIndex(int _stage)
@@ -534,6 +549,8 @@
    public class TreasureStage
    {
        public int id { get; private set; }
        public int stage { get; set; }
        public TreasureStageUnlock unlockType { get; private set; }
        public Dictionary<int, int> propertyDict { get; private set; }
@@ -546,8 +563,10 @@
        public const int selectedSfxId = 5144;
        public string sfxGotState { get; private set; }
        public string sfxUnGotState { get; private set; }
        public TreasureStage(TreasureUpConfig _config)
        {
            id = _config.ID;
            unlockType = TreasureStageUnlock.None;
            if (_config.UnLockFuncID != 0)
            {