Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | private static Dictionary<StoreItem, StoreConfig> s_StoreItemDict = new Dictionary<StoreItem, StoreConfig>();
|
| | | private static Dictionary<int, List<StoreConfig>> storeConfigs = new Dictionary<int, List<StoreConfig>>();
|
| | |
|
| | | static readonly int[] shop1Types = new int[] { 2, 3 };
|
| | | static readonly int[] shop2Types = new int[] { 4 };
|
| | | static readonly int[] shop1Types = new int[] { 1, 2, 3 };
|
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | | if (ShopType == 0) return;
|
| | |
| | | item = _item,
|
| | | type = _moneyType,
|
| | | shopType = shop1Types[i],
|
| | | };
|
| | | if (s_StoreItemDict.ContainsKey(storeItem))
|
| | | {
|
| | | return s_StoreItemDict[storeItem];
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | case 2:
|
| | | {
|
| | | for (int i = 0; i < shop2Types.Length; i++)
|
| | | {
|
| | | var storeItem = new StoreItem()
|
| | | {
|
| | | item = _item,
|
| | | type = _moneyType,
|
| | | shopType = shop2Types[i],
|
| | | };
|
| | | if (s_StoreItemDict.ContainsKey(storeItem))
|
| | | {
|
| | |
| | | _dict = new Dictionary<int, StoreConfig>();
|
| | | liquidStoreDict.Add(liquidItems[i], _dict);
|
| | | }
|
| | | for (int k = 0; k < _moneyTypeList.Count; k++)
|
| | | for (int j = 0; j < _shopTypes.Count; j++)
|
| | | {
|
| | | var config = StoreConfig.GetStoreCfg(liquidItems[i], _moneyTypeList[k]);
|
| | | if (config != null && _shopTypes.Contains(config.ShopType))
|
| | | for (int k = 0; k < _moneyTypeList.Count; k++)
|
| | | {
|
| | | _dict.Add(_moneyTypeList[k], config);
|
| | | var config = StoreConfig.GetStoreCfg(liquidItems[i], _moneyTypeList[k], _shopTypes[j]);
|
| | | if (config != null)
|
| | | {
|
| | | if (!_dict.ContainsKey(_moneyTypeList[k]))
|
| | | {
|
| | | _dict.Add(_moneyTypeList[k], config);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | [SerializeField] Transform m_Container;
|
| | | [SerializeField] Text m_Title;
|
| | | [SerializeField] Text m_Count;
|
| | | [SerializeField] Transform m_ContainerItem;
|
| | | [SerializeField] Text m_ItemCount;
|
| | |
|
| | | HazyGrassModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); }
|
| | | }
|
| | |
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | | public void Display(int npcId, int count)
|
| | | {
|
| | |
| | | m_Title.text = Language.Get("HazyGrassCountTitle", npcConfig.charName);
|
| | | m_Count.text = count.ToString();
|
| | | m_Count.color = UIHelper.GetUIColor(count > 0 ? TextColType.Green : TextColType.Red);
|
| | |
|
| | | m_ContainerItem.gameObject.SetActive(PlayerDatas.Instance.baseData.MapID == HazyGrassModel.FAIRY_CLIENTDATAMAP
|
| | | || PlayerDatas.Instance.baseData.MapID == HazyGrassModel.FAIRY_DATAMAP);
|
| | |
|
| | | if (m_ContainerItem.gameObject.activeSelf)
|
| | | {
|
| | | var itemId = model.GetGrassNpcItemId(npcId);
|
| | | var itemCount = packModel.GetItemCountByID(PackType.Item, itemId);
|
| | | m_ItemCount.text = itemCount.ToString();
|
| | | m_ItemCount.color = UIHelper.GetUIColor(itemCount > 0 ? TextColType.Green : TextColType.Red);
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetActive(bool active)
|
| | |
| | | public class HazyGrassModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, int> m_MapNpcCount = new Dictionary<int, int>();
|
| | | Dictionary<int, int> m_NpcMapItems;
|
| | |
|
| | | public const int REIKI_DATAMAP = 32040;
|
| | | public const int FAIRY_DATAMAP = 32050;
|
| | |
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | var funcConfig = FuncConfigConfig.Get("HazyGrassNpcMapItem");
|
| | | m_NpcMapItems = ConfigParse.GetDic<int, int>(funcConfig.Numerical1);
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | |
| | | return 0;
|
| | | }
|
| | |
|
| | | public int GetGrassNpcItemId(int npcId)
|
| | | {
|
| | | if (m_NpcMapItems.ContainsKey(npcId))
|
| | | {
|
| | | return m_NpcMapItems[npcId];
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public string GetLocalSaveKey(int mapId)
|
| | | {
|
| | | return StringUtility.Contact("HazyGrassMap", mapId, "_", PlayerDatas.Instance.PlayerId);
|
| | |
| | | }
|
| | | }
|
| | | break;
|
| | | case 6:
|
| | | var isEmptyLabel = string.IsNullOrEmpty(label);
|
| | | m_NullSymbol.gameObject.SetActive(isEmptyLabel);
|
| | | m_Description.gameObject.SetActive(!isEmptyLabel);
|
| | | if (!isEmptyLabel)
|
| | | {
|
| | | m_Description.text = label;
|
| | | }
|
| | | break;
|
| | | case 1:
|
| | | default:
|
| | | m_Symbol.gameObject.SetActive(value > 0);
|