Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | |
| | | |
| | | { |
| | | int _atkSpeed = LuaAPI.xlua_tointeger(L, 2); |
| | | string _color; |
| | | |
| | | bool gen_ret = gen_to_be_invoked.TryGetAtkSpeedColor( _atkSpeed, out _color ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | LuaAPI.lua_pushstring(L, _color); |
| | | |
| | | |
| | | |
| | | |
| | | return 2; |
| | | } |
| | |
| | | |
| | | |
| | | { |
| | | Snxxz.UI.ItemModel _itemModel = (Snxxz.UI.ItemModel)translator.GetObject(L, 2, typeof(Snxxz.UI.ItemModel)); |
| | | bool _isCompare = LuaAPI.lua_toboolean(L, 3); |
| | | |
| | | gen_to_be_invoked.SetCurrentAttrData( _itemModel, _isCompare ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | |
| | | |
| | | |
| | | { |
| | | int _precentType = LuaAPI.xlua_tointeger(L, 2); |
| | | int _value = LuaAPI.xlua_tointeger(L, 3); |
| | | |
| | | int gen_ret = gen_to_be_invoked.GetProValueType( _precentType, _value ); |
| | | LuaAPI.xlua_pushinteger(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | { |
| | | int __itemId = LuaAPI.xlua_tointeger(L, 2); |
| | | int _count = LuaAPI.xlua_tointeger(L, 3); |
| | | int _isBind = LuaAPI.xlua_tointeger(L, 4); |
| | | |
| | | gen_to_be_invoked.ViewKingFairyChest( __itemId, _count, _isBind ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | |
| | | itemList[i].button.onClick.RemoveAllListeners();
|
| | | itemList[i].button.onClick.AddListener(() =>
|
| | | {
|
| | | model.ViewKingFairyChest(_itemArray[0], _itemArray[1], _itemArray[2]);
|
| | | //ItemAttrData itemAttrData = new ItemAttrData(_itemArray[0], false, (ulong)_itemArray[1], -1, _itemArray[2]);
|
| | | //ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | | model.ViewKingFairyChest(_itemArray[0], _itemArray[1]);
|
| | | });
|
| | | }
|
| | | else
|
| | |
| | | }
|
| | |
|
| | | public Item viewChestItem;
|
| | | public void ViewKingFairyChest(int _itemId, int count, int isBind)
|
| | | public void ViewKingFairyChest(int _itemId, int count)
|
| | | {
|
| | | viewChestItem = new Item()
|
| | | {
|
| | | id = _itemId,
|
| | | count = count,
|
| | | };
|
| | | WindowCenter.Instance.Open<KingFairyChestWin>();
|
| | | }
|
| | | #endregion
|
| | | #region 协议
|
| | |
| | | switch(itemData.itemId)
|
| | | {
|
| | | case 2278:
|
| | | kingFairyModel.ViewKingFairyChest(itemData.itemId,itemData.itemCount,itemData.isBind);
|
| | | kingFairyModel.ViewKingFairyChest(itemData.itemId,itemData.itemCount);
|
| | | break;
|
| | | default:
|
| | | ItemAttrData attrData = new ItemAttrData(itemData.itemId, true, (ulong)itemData.itemCount);
|
| | |
| | | skillInfo = GetSkillInfo(itemId), |
| | | suitInfo = GetSuitInfo(itemId), |
| | | gemInfo = GetGemInfo(itemId), |
| | | starInfo = GetStarInfo(itemId) |
| | | }; |
| | | } |
| | | |
| | |
| | | |
| | | private static GemInfo GetGemInfo(int itemId) |
| | | { |
| | | return default(GemInfo); |
| | | var config = ItemConfig.Get(itemId); |
| | | var level = config.LV; |
| | | var place = config.EquipPlace; |
| | | |
| | | var gemInfo = new GemInfo(); |
| | | var maxStar = EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV); |
| | | gemInfo.activeStates = new Dictionary<int, bool>(); |
| | | for (int i = 0; i < 4; i++) |
| | | { |
| | | gemInfo.activeStates[i] = IsEquipGemHoleOpen(new Int2(level, place), maxStar, i); |
| | | } |
| | | |
| | | return gemInfo; |
| | | } |
| | | |
| | | private static GemInfo GetGemInfo(string guid) |
| | |
| | | { |
| | | var behaviour = m_GemBehaviours[i]; |
| | | var active = gemInfo.activeStates.ContainsKey(i) ? gemInfo.activeStates[i] : false; |
| | | var gem = gemInfo.gems.ContainsKey(i) ? gemInfo.gems[i] : 0; |
| | | var gem = (gemInfo.gems != null && gemInfo.gems.ContainsKey(i)) ? gemInfo.gems[i] : 0; |
| | | behaviour.Display(active, gem); |
| | | } |
| | | } |
| | |
| | | for (int i = 0; i < properties.Count; i++) |
| | | { |
| | | var property = properties[i]; |
| | | lines[i] =PlayerPropertyConfig.GetFullDescription(property.x, property.y); |
| | | lines[i] = PlayerPropertyConfig.GetFullDescription(property.x, property.y); |
| | | } |
| | | |
| | | propertyBehaviour.text = string.Join("\r\n", lines); |
| | |
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetAtkSpeedColor(int atkSpeed, out string color)
|
| | | {
|
| | | color = string.Empty;
|
| | | foreach (var key in atkSpeedColorDict.Keys)
|
| | | {
|
| | | var rangelist = atkSpeedColorDict[key];
|
| | | if (rangelist.Count > 1)
|
| | | {
|
| | | if (atkSpeed >= rangelist[0] && atkSpeed <= rangelist[1])
|
| | | {
|
| | | color = key;
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | /// <summary>
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void SetCurrentAttrData(ItemModel itemModel, bool isCompare)
|
| | | {
|
| | | curAttrData = new ItemAttrData(itemModel.itemId, false, (ulong)itemModel.count
|
| | | , itemModel.gridIndex, isCompare
|
| | | , itemModel.packType, itemModel.guid, ConfigParse.Analysis(itemModel.itemInfo.userData), ItemTipChildType.Normal);
|
| | | }
|
| | |
|
| | |
|
| | | public void SetCompareAttrData(ItemModel itemModel)
|
| | | {
|
| | | compareAttrData = new ItemAttrData(itemModel.itemId, false, (ulong)itemModel.count
|
| | |
| | | {
|
| | | EquipTipUtility.Show(curAttrData.guid);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<EquipWin>();
|
| | | }
|
| | | break;
|
| | | case ItemWinType.wingsWin:
|
| | |
| | | return s;
|
| | | }
|
| | |
|
| | | private string SetAttrColor(string attrStr, int atkSpeed, int equipPlace)
|
| | | {
|
| | | string color = string.Empty;
|
| | | bool isColor = TryGetAtkSpeedColor(atkSpeed, out color);
|
| | | if (isColor)
|
| | | {
|
| | | return StringUtility.Contact("<color=#", color, ">", attrStr, "</color>");
|
| | | }
|
| | | return attrStr;
|
| | | }
|
| | |
|
| | | public int GetProValueType(int precentType, int value)
|
| | | {
|
| | | switch (precentType)
|
| | | {
|
| | | case 1:
|
| | | case 2:
|
| | | return Mathf.RoundToInt(value / 100);
|
| | | default:
|
| | | return value;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 设置传奇属性
|
| | |
| | | public ItemTipChildType ChildType { get; private set; } //决定当前面板打开哪个
|
| | | public Dictionary<int, List<int>> useDataDict { get; private set; }
|
| | | public Dictionary<int, int> strengthDataDict { get; private set; }
|
| | | public Dictionary<int, int> washDataDict { get; private set; }
|
| | | public Dictionary<int, int> legendDataDict { get; private set; }
|
| | | public Dictionary<int, int> exhaustedMaxDataDict { get; private set; }
|
| | | public Dictionary<int, int> wingsRefineMatDict { get; private set; }
|
| | |
| | |
|
| | | public void HideItemPopWin()
|
| | | {
|
| | | if (WindowCenter.Instance.IsOpen<EquipWin>())
|
| | | {
|
| | | HideEquipWin();
|
| | | }
|
| | | else if (WindowCenter.Instance.IsOpen<WingsWin>())
|
| | | if (WindowCenter.Instance.IsOpen<WingsWin>())
|
| | | {
|
| | | HideWingsWin();
|
| | | }
|
| | |
| | | else if (WindowCenter.Instance.IsOpen<GuardianWin>())
|
| | | {
|
| | | HideGuardWin();
|
| | | }
|
| | | else if (WindowCenter.Instance.IsOpen<KingFairyChestWin>())
|
| | | {
|
| | | WindowCenter.Instance.Close<KingFairyChestWin>();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | switch(itemData.itemId)
|
| | | {
|
| | | case 2278:
|
| | | kingFairyModel.ViewKingFairyChest(itemData.itemId,itemData.itemCount,itemData.isBind);
|
| | | kingFairyModel.ViewKingFairyChest(itemData.itemId,itemData.itemCount);
|
| | | break;
|
| | | default:
|
| | | ItemAttrData attrData = new ItemAttrData(itemData.itemId, true, (ulong)itemData.itemCount);
|