svn逻辑tongbu

dev_chengFeng
JieLing 2020-07-01 18:14:03 +08:00
parent 956dcfbcd2
commit b3c70f66e4
21 changed files with 652 additions and 513 deletions

View File

@ -808,7 +808,7 @@ JumpType = {
DailyCarbon_Hero=69, --每日角色碎片副本
DailyCarbon_Transure=70, --每日法宝副本
DailyCarbon_SoulPrint=71, --每日魂印副本
DeathPos=71, --十绝阵
DeathPos=72, --十绝阵
GuildCarDelay=73 , --车迟斗法
BuyVigor = 10000, --体力购买
BuyGold = 10001, --金币购买

View File

@ -17,6 +17,7 @@ function CardRendererManager.Initialize()
this.indexFlag = 0
this.liveList = {}
this.usingList = {}
end
@ -52,7 +53,7 @@ function CardRendererManager.GetSpineTexture(liveName, scaleV3, posV3, isReuse,
node = liveNode
}
--
return this.textureList[this.indexFlag], this.liveList[this.indexFlag].node
return this.textureList[this.indexFlag], this.liveList[this.indexFlag].node, this.indexFlag
end
-- 判断是否存在
@ -65,6 +66,19 @@ function this.CheckIsExist(liveName)
end
-- 检测是否正在使用
function this.CheckIsUsing(index)
return this.usingList[index]
end
-- 设置是否正在使用
function this.SetUsing(index, isUsing)
this.usingList[index] = isUsing
end
-- 清除使用列表
function this.ClearUsing()
this.usingList = {}
end
function CardRendererManager.Dispose()
GameObject.DestroyImmediate(this.root)

View File

@ -31,6 +31,7 @@ function BattleBestPopup:BindEvent()
end
function this:OnOpen(heroTId, damageValue, allDamage, func,_func2)
func2 = _func2
-- 创建立绘
local heroTData = ConfigManager.GetConfigData(ConfigName.HeroConfig, heroTId)
this.liveName = GetResourcePath(heroTData.Live)
@ -58,7 +59,6 @@ function this:OnOpen(heroTId, damageValue, allDamage, func,_func2)
-- 结束回调
this._OverFunc = func
func2 = _func2
-- 开始播放动画
Timer.New(function()
if this._OverFunc then

View File

@ -521,23 +521,38 @@ function this.InitQuickFightData(monsterGroupId, eventId, msg)
battledHp = this.GetMapTotalBlood()
-- if this.difficulty == 1 or this.difficulty == 3 or this.difficulty == 4 then
-- PopupText(strShow, 0.5, 2)
-- elseif this.difficulty == 2 then
-- -- UIManager.OpenPanel(UIName.BattleEndPanel, nil, data.hpList, data.drop, func)
-- UIManager.OpenPanel(UIName.RewardItemPopup,data.drop,1,
-- -- Game.GlobalEvent:DispatchEvent(GameEvent.Event.PointTriggerEnd)
-- func
-- )
-- end
-- func = nil
-- LogPink(" MapManager.curTriggerPos ".. MapManager.curTriggerPos)
-- Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointRemove, MapManager.curTriggerPos)
-- -- 试炼副本不能直接结束事件点
-- if this.difficulty ~= 2 then
-- Game.GlobalEvent:DispatchEvent(GameEvent.Event.PointTriggerEnd)
-- end
if this.difficulty == 1 or this.difficulty == 3 or this.difficulty == 4 then
PopupText(strShow, 0.5, 2)
Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointRemove, MapManager.curTriggerPos)
elseif this.difficulty == 2 then
-- UIManager.OpenPanel(UIName.BattleEndPanel, nil, data.hpList, data.drop, func)
UIManager.OpenPanel(UIName.RewardItemPopup,data.drop,1,
-- Game.GlobalEvent:DispatchEvent(GameEvent.Event.PointTriggerEnd)
func
)
Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointRemove, MapManager.curTriggerPos)
UIManager.OpenPanel(UIName.RewardItemPopup,data.drop,1,func)
end
func = nil
LogPink(" MapManager.curTriggerPos ".. MapManager.curTriggerPos)
Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointRemove, MapManager.curTriggerPos)
-- 试炼副本不能直接结束事件点
if this.difficulty ~= 2 then
Game.GlobalEvent:DispatchEvent(GameEvent.Event.PointTriggerEnd)
end
end
Game.GlobalEvent:DispatchEvent(GameEvent.Formation.OnMapTeamHpReduce, oldHp - battledHp)

View File

@ -171,20 +171,34 @@ function this.SetData(root, data, ldata)
ResetItemView(root,reward.transform,itemList,3,0.9,orginLayer,false,data.RewardView)
--解锁状态
-- local _lv=0 --等级
-- local _point=0 --关卡
local _power = data.ForceShow--表战力
-- if data.OpenRules[2] ~= nil and data.OpenRules[1][1] == 1 then
-- _lv = data.OpenRules[1][2]
-- end
-- if data.OpenRules[1] ~= nil and data.OpenRules[1][1] == 2 then
-- _point= data.OpenRules[1][2]
-- end
-- if data.OpenRules[2][1]==3 then
-- _power= data.OpenRules[2][2]
-- end
local _lv=0 --等级
local _point=0 --关卡
local _power = 0 --data.ForceShow--表战力
local isOpen = not ldata or CarbonManager.IsDailyCarbonPass(ldata.Id)
for i = 1, #data.OpenRules do
if data.OpenRules[i][1] == 1 then
_lv = data.OpenRules[i][2]
elseif data.OpenRules[i][1] == 2 then
_point = data.OpenRules[i][2]
elseif data.OpenRules[i][1] == 3 then
_power = data.OpenRules[i][2]
end
end
if data.OpenRules[2] ~= nil and data.OpenRules[1][1] == 1 then
_lv = data.OpenRules[1][2]
end
if data.OpenRules[1] ~= nil and data.OpenRules[1][1] == 2 then
_point= data.OpenRules[1][2]
end
if data.OpenRules[2][1]==3 then
_power= data.OpenRules[2][2]
end
-- 判断每日副本是否解锁
local isOpen = (not ldata or CarbonManager.IsDailyCarbonPass(ldata.Id)) -- 上一个副本解锁
and PlayerManager.level >= _lv -- 等级
and (_point == 0 or FightPointPassManager.IsFightPointPass(_point))
and PlayerManager.maxForce >= _power -- 战斗力
--显示挑战或扫荡道具消耗
goIcon:SetActive(isOpen and freeTime<=0)
goIconNum:SetActive( isOpen and freeTime<=0)
@ -213,19 +227,26 @@ function this.SetData(root, data, ldata)
--点击事件
Util.AddOnceClick(goBtn,function()
if PlayerManager.level<_lv then
PopupTipPanel.ShowTip(string.format(Language[10340],_lv))
return
elseif PlayerManager.maxForce < _power then
PopupTipPanel.ShowTip(string.format("战斗力到达%s解锁", _power))
return
elseif _point ~= 0 and not FightPointPassManager.IsFightPointPass(_point) then
PopupTipPanel.ShowTip(string.format("通关%s解锁", mainLevelConfig[_point].Name))
return
elseif PlayerManager.curMapId ~= 0 and FightPointPassManager.IsFightPointPass(PlayerManager.curMapId)==false then
PopupTipPanel.ShowTip(string.format(Language[10341],mainLevelConfig[_point].Name))
return
end
if not isOpen then
PopupTipPanel.ShowTip(Language[12191])
return
end
-- if PlayerManager.level<_lv then
-- PopupTipPanel.ShowTip(string.format(Language[10340],_lv))
-- return
-- elseif PlayerManager.curMapId ~= 0 and FightPointPassManager.IsFightPointPass(PlayerManager.curMapId)==false then
-- PopupTipPanel.ShowTip(string.format(Language[10341],mainLevelConfig[_point].Name))
-- return
-- end
--检测剩余次数
if buyTime<=0 and freeTime<=0 then
PopupTipPanel.ShowTip(Language[10342])

View File

@ -280,6 +280,7 @@ function this.FormationAdapter(teamInfo)
local demonId = teamInfo.team[i].heroTid
local starGrid=Util.GetGameObject(demon, "starGrid")
local proImage=Util.GetGameObject(demon, "heroShow/proIcon"):GetComponent("Image")
Util.GetGameObject(demon, "heroShow/posIcon"):SetActive(false)
-- local posImage=Util.GetGameObject(demon, "heroShow/posIcon"):GetComponent("Image")
-- local heroStage = Util.GetGameObject(demon, "heroShow/heroStage"):GetComponent("Image")
local UI_Effect_Kuang_JinSe=Util.GetGameObject(demon, "effects/UI_Effect_Kuang_JinSe")

View File

@ -157,15 +157,12 @@ function LuckyTurnTablePanel:RemoveListener()
end
---界面打开时调用(用于子类重写)
function LuckyTurnTablePanel:OnOpen(...)
function LuckyTurnTablePanel:OnOpen(_TreasureType)
LuckyTurnTableManager.curTreasureType =_TreasureType and _TreasureType or TreasureType.Lucky
end
---界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function LuckyTurnTablePanel:OnShow(_TreasureType)--_upView,expertPanel,
--this.upView = _upView
LuckyTurnTableManager.curTreasureType =_TreasureType and _TreasureType or TreasureType.Lucky
function LuckyTurnTablePanel:OnShow()
if LuckyTurnTableManager.curTreasureType==TreasureType.Lucky then--防止当前为高级探宝时 按下探宝后跳转到幸运探宝
this.LuckyTurnOnShow(TreasureType.Lucky)
elseif LuckyTurnTableManager.curTreasureType==TreasureType.Advanced then

View File

@ -330,14 +330,14 @@ function this.OnSortingOrderChange()
orginLayer = MapPanel.sortingOrder
end
function this.InitBossInfo()
if powerValue ==-1 then
UIManager.OpenPanel(UIName.TrialOpPanel, 1)
-- 停止自动寻路
-- ctrlView.OnRoleDead()
-- function this.InitBossInfo()
-- if powerValue ==-1 then
-- UIManager.OpenPanel(UIName.TrialOpPanel, 1)
-- -- 停止自动寻路
-- -- ctrlView.OnRoleDead()
end
end
-- end
-- end
-- 初始化部buff显示

View File

@ -394,7 +394,7 @@ function this.CheckFieldOfView(u, v)
end
function this.OnAddPoint(pos, pointId)
LogPink("pointId "..pointId)
-- LogPink("pointId "..pointId)
if pos and not this.EventPoint[pos] then
local u, v = Map_Pos2UV(pos)
LogPink(u.." "..v)

View File

@ -283,16 +283,9 @@ local mapDialoguePanel = function(showType, eventId, showValues, options)
-- UIManager.OpenPanel(UIName.MapOptionPanel, showType, eventId, showValues, options)
-- LogPink("MissionManager showType"..showType.." eventId"..eventId)
-- end
if eventId == 2000001 or eventId == 2000002 then
-- 打开general界面
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.TrialToNextFloor,eventId)
elseif eventId == 2000005 then
-- 直接加buff走人
NetManager.EventUpdateRequest(2000005, 2000011, function ()
Game.GlobalEvent:DispatchEvent(GameEvent.Event.PointTriggerEnd)
Game.GlobalEvent:DispatchEvent(GameEvent.Map.ProgressChange, 1, 2000011)
end)
if not UIManager.IsOpen(UIName.GeneralPopup) then
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.TrialToNextFloor, showType, eventId, showValues, options)
end
end
@ -403,9 +396,13 @@ end
-- 试炼Buff界面
local trailBuffPanel = function(showType, eventId, showValues, options)
if not UIManager.IsOpen(UIName.BuffOptionPanel) then
UIManager.OpenPanel(UIName.BuffOptionPanel, eventId)
end
NetManager.EventUpdateRequest(eventId, options[1], function ()
Game.GlobalEvent:DispatchEvent(GameEvent.Event.PointTriggerEnd)
Game.GlobalEvent:DispatchEvent(GameEvent.Map.ProgressChange, 1, options[1])
end)
-- if not UIManager.IsOpen(UIName.BuffOptionPanel) then
-- UIManager.OpenPanel(UIName.BuffOptionPanel, eventId)
-- end
end
-- 无尽商店
@ -529,10 +526,13 @@ function this.GetAllRewardTrigger()
-- end)
Timer.New(function ()
for key, value in pairs(MapManager.mapPointList) do
-- LogPink("["..key.."] "..value)
LogPink("["..key.."] "..value)
if value==2000000 then
Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointRemove,key)--删除全部宝箱点
end
-- if EventPointConfig[value].ShowType == 17 then
-- Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointRemove,key)--删除所有的buff点
-- end
end
UIManager.OpenPanel(UIName.RewardItemPopup,msg.boxDrop,1,function()
Game.GlobalEvent:DispatchEvent(GameEvent.Event.PointTriggerEnd)

View File

@ -104,23 +104,7 @@ function BattleWinPopup:NextStep()
end
end
UIManager.OpenPanel(UIName.BattleBestPopup, bestData.roleId, bestData.damage, allDamage, function(_BattleBestPopup)
local keys = GameDataBase.SheetBase.GetKeys(ConfigManager.GetConfig(ConfigName.ExpeditionFloorConfig))
--Log("GetCurNodeInfo.lay == #keys "..GetCurNodeInfo.lay .." ".. #keys.." "..GetCurNodeInfo.state)
if GetCurNodeInfo.lay == #keys and GetCurNodeInfo.state == ExpeditionNodeState.Finish then--打完最后一层
UIManager.OpenPanel(UIName.RewardItemPopup,m_battleResult.drop, 1,function()
if m_battlePanel then
m_battlePanel:ClosePanel()
end
if _BattleBestPopup then
_BattleBestPopup:ClosePanel()
end
if UIManager.GetOpenPanel(UIName.ExpeditionMainPanel) then
UIManager.OpenPanel(UIName.ExpeditionMainPanel)
end
end, 0,true,true)
else
--贪婪节点不弹领取圣物
--LogError("GetCurNodeInfo.type "..GetCurNodeInfo.type)
if GetCurNodeInfo.type == ExpeditionNodeType.Greed then--贪婪节点
if m_battleResult.drop.itemlist and #m_battleResult.drop.itemlist > 0 then
LogGreen("m_battleResult.drop.itemlist "..#m_battleResult.drop.itemlist)
@ -146,10 +130,6 @@ function BattleWinPopup:NextStep()
m_battlePanel:ClosePanel()
end
PopupTipPanel.ShowTip(Language[12192])
--if _BattleBestPopup then
-- _BattleBestPopup:ClosePanel()
--end
--Game.GlobalEvent:DispatchEvent(GameEvent.Expedition.RefreshPlayAniMainPanel)
else
UIManager.OpenPanel(UIName.RewardItemPopup,m_battleResult.drop, 1,function()
if m_battlePanel then
@ -161,10 +141,12 @@ function BattleWinPopup:NextStep()
if GetCurNodeInfo.holyEquipID and #GetCurNodeInfo.holyEquipID > 0 then
UIManager.OpenPanel(UIName.ExpeditionSelectHalidomPanel,true,function ()
end)
else
--此时战斗了但没有圣物 所有直接刷新界面动画 后并刷新界面
Game.GlobalEvent:DispatchEvent(GameEvent.Expedition.RefreshPlayAniMainPanel)
end
end, 0,true,true)
end
end
end,func2)
end
elseif m_fightType==9 then

View File

@ -85,7 +85,7 @@ function RewardItemSingleShowPopup:BindEvent()
end)
Util.AddClick(this.btnJump, function()
if itemConfigData then
JumpManager.GoJump(itemConfigData.UseJump)
JumpManager.GoJump(itemConfigData.Jump)
end
end)
end

View File

@ -124,6 +124,7 @@ function RewardTalismanSingleShowPopup:OnShowPanelData()
else
self.powerNum1.text=EquipTreasureManager.CalculateWarForceBySid(sId,lv,refineLv)
itemConfig = ConfigManager.GetConfigData(ConfigName.ItemConfig,sId)
LogBlue("sId:"..sId)
curEquipTreasureFigData = ConfigManager.GetConfigData(ConfigName.JewelConfig, sId)
curEquipTreasureStrongFigData,curEquipTreasureSefineFigData = self:GetStrongAndRefineConFig(curEquipTreasureFigData,lv,refineLv)
end
@ -178,9 +179,13 @@ function RewardTalismanSingleShowPopup:OnShowPanelData()
local proConFig = ConfigManager.GetConfigData(ConfigName.PropertyConfig,curEquipTreasureSefineFigData.Property[i][1])
if proConFig then
Util.GetGameObject(go.transform, "proName"):GetComponent("Text").text =proConFig.Info
if curEquipTreasureSefineFigData.Property[i][2]==0 and proConFig.Style~=1 then
Util.GetGameObject(go.transform, "proVale"):GetComponent("Text").text = "+0%"
else
Util.GetGameObject(go.transform, "proVale"):GetComponent("Text").text = "+"..GetEquipPropertyFormatStr(proConFig.Style,curEquipTreasureSefineFigData.Property[i][2])
end
end
end
else
self.curotherProscroll:SetActive(false)
end

View File

@ -1,6 +1,10 @@
----- 试炼进入下一层 -----
local this = {}
local showType
local eventId
local showValues
local options
local eventConfig = ConfigManager.GetConfig(ConfigName.EventPointConfig)
function this:InitComponent(gameObject)
this.bodyText = Util.GetGameObject(gameObject,"BodyText"):GetComponent("Text")
@ -15,11 +19,8 @@ function this:BindEvent()
end)
Util.AddClick(this.btnSure,function()
if eventId==2000001 then
OptionBehaviourManager.JumpEventPoint(2000001, 2000001,UIManager.GetOpenPanel(UIName.GeneralPopup))
elseif eventId==2000002 then
OptionBehaviourManager.JumpEventPoint(2000002, 2000003,UIManager.GetOpenPanel(UIName.GeneralPopup))
end
local optionId = eventConfig[eventId].Option[1]
OptionBehaviourManager.JumpEventPoint(eventId, optionId,UIManager.GetOpenPanel(UIName.GeneralPopup))
end)
end
@ -29,8 +30,11 @@ end
function this:RemoveListener()
end
function this:OnShow(this,...)
eventId = ...
function this:OnShow(this,_showType, _eventId, _showValues, _options)
showType = _showType
eventId = _eventId
showValues = _showValues
options = _options
end
function this:OnClose()

View File

@ -802,7 +802,7 @@ function this.QuickSelectListData()
selectEquipTreasureData={}
for k,v in pairs(equipTreasureData) do
if LengthOfTable(selectEquipTreasureData)<30 then
selectEquipTreasureData[v.did]=v
selectEquipTreasureData[v.idDyn]=v
else
break
end
@ -1042,7 +1042,6 @@ function this.ResolveBtnClickEvent()
if #itemMaxList>0 then--是否分解物品有超过物品上限的
this.GetItemIsBeyondMaxNum(type,curResolveAllItemList)
else
LogError("type "..type.." "..LengthOfTable(curResolveAllItemList))
NetManager.UseAndPriceItemRequest(type,curResolveAllItemList,function (drop)
this.SendBackResolveReCallBack(drop)
end)

View File

@ -156,27 +156,16 @@ function EquipTreasureStrongPopup:BindEvent()
end)
end
--添加事件监听(用于子类重写)
function EquipTreasureStrongPopup:AddListener()
end
--移除事件监听(用于子类重写)
function EquipTreasureStrongPopup:RemoveListener()
end
--界面打开时调用(用于子类重写)
function EquipTreasureStrongPopup:OnOpen(...)
local datas={...}
curEquipData=datas[1]
type=datas[2]
this.SetWindShow(type)
end
function EquipTreasureStrongPopup:OnShow()
this.SetWindShow(type)
end
--设置界面显示 1.强化 2.精炼

View File

@ -6,13 +6,20 @@ RoleEquipPanel = Inherit(BasePanel)
-- Lv = 2
--}
local PosIdConst = {
All = 0,--全部
WuQi = 1,--武器
ZhanFu = 2,--战服
TouShi = 3,--头饰
ZhanXue = 4,--战靴
Hun = 5,--魂宝
Ling = 6,--灵宝
All = 0,
--全部
WuQi = 1,
--武器
ZhanFu = 2,
--战服
TouShi = 3,
--头饰
ZhanXue = 4,
--战靴
Hun = 5,
--魂宝
Ling = 6
--灵宝
}
local this = RoleEquipPanel
local curHeroEquipDatas = {}
@ -34,9 +41,9 @@ local jewerConfigs = ConfigManager.GetConfig(ConfigName.JewelConfig)
local currPageIndex = 0
local curEquipTreasureDatas = {}
local isCanUpEquipTreasure = false
local equiptip = ""
--初始化组件用于子类重写RoleEquipChangePopup
function RoleEquipPanel:InitComponent()
orginLayer = 10
orginLayer1 = {0, 0, 0, 0, 0, 0}
this.bg2 = Util.GetGameObject(self.transform, "bg2")
@ -87,8 +94,17 @@ function RoleEquipPanel:InitComponent()
this.ScrollBar = Util.GetGameObject(self.gameObject, "Scrollbar"):GetComponent("Scrollbar")
local v2 = Util.GetGameObject(self.gameObject, "scroll"):GetComponent("RectTransform").rect
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(self.transform, "scroll").transform,
this.equipPre, this.ScrollBar, Vector2.New(-v2.x*2, -v2.y*2), 1, 5, Vector2.New(50,15))
this.ScrollView =
SubUIManager.Open(
SubUIConfig.ScrollCycleView,
Util.GetGameObject(self.transform, "scroll").transform,
this.equipPre,
this.ScrollBar,
Vector2.New(-v2.x * 2, -v2.y * 2),
1,
5,
Vector2.New(50, 15)
)
this.ScrollView.moveTween.MomentumAmount = 1
this.ScrollView.moveTween.Strength = 1
@ -106,30 +122,46 @@ end
--绑定事件(用于子类重写)
function RoleEquipPanel:BindEvent()
Util.AddClick(this.btnBack, function()
Util.AddClick(
this.btnBack,
function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
if openThisPanel.RefreshHeroDatas then
openThisPanel:RefreshHeroDatas(curHeroData, HeroManager.GetAllHeroDatas())
end
self:ClosePanel()
end)
Util.AddClick(this.leftBtn, function()
end
)
Util.AddClick(
this.leftBtn,
function()
this:LeftBtnOnClick()
end)
end
)
Util.AddClick(this.rightBtn, function()
Util.AddClick(
this.rightBtn,
function()
this:RightBtnOnClick()
end)
Util.AddClick(this.allEquipUp, function()
end
)
Util.AddClick(
this.allEquipUp,
function()
this:AllEquipUpBtnOnClick()
end)
end
)
Util.AddClick(this.allEquipDown, function()
Util.AddClick(
this.allEquipDown,
function()
this:AllEquipDownBtnOnClick()
end)
end
)
for i = 0, 6 do
Util.AddClick(tabs[i], function()
Util.AddClick(
tabs[i],
function()
if i == indexBtnNum then
indexBtnNum = PosIdConst.All
this:OnClickAllBtn()
@ -137,15 +169,19 @@ function RoleEquipPanel:BindEvent()
indexBtnNum = i
this:OnClickTabBtn(indexBtnNum)
end
end)
end
Util.AddClick(this.equipTreasureBtn, function()
)
end
Util.AddClick(
this.equipTreasureBtn,
function()
if LengthOfTable(curEquipTreasureDatas) < 2 then
PopupTipPanel.ShowTip(Language[11825])
return
end
UIManager.OpenPanel(UIName.EquipTreasureResonancePanel, curHeroData)
end)
end
)
end
--添加事件监听(用于子类重写)
@ -168,7 +204,6 @@ function this.CurrEquipDataChange()
end
--界面打开时调用(用于子类重写)
function RoleEquipPanel:OnOpen(...)
local data = {...}
if data[1] then
curHeroData = data[1]
@ -184,7 +219,6 @@ function RoleEquipPanel:OnOpen(...)
end
openThisPanel = data[3]
isUpZhen = data[4]
end
function RoleEquipPanel:OnShow()
for i = 1, #heroListData do
@ -253,27 +287,38 @@ function this:AllEquipUpBtnOnClick()
local equipEffectPos = {}
local treasureEffectPos = {}
--如果身上的装备 带锁 则不替换
for i = 1, 6 do
--这个curHeroData职业妖人道佛可以穿的index对应位置武器战服头饰战靴魂宝灵宝所有装备包括这个英雄穿的
local curPosEquip = {}
local index = i
if curHeroEquipDatas[i] then
if curHeroEquipDatas[i].isLocked == 0 then
curPosEquip = EquipManager.GetEquipDataByEquipJobAndPos(i,curHeroData.heroConfig.Profession,curHeroData.dynamicId)
else
curPosEquip = {curHeroEquipDatas[i]}
end
else
if index==5 or index==6 and isCanUpEquipTreasure then
curPosEquip=EquipTreasureManager.GetTreasureDataByPos(index,curHeroData.dynamicId,curHeroData.heroConfig.PropertyName)
else
curPosEquip = EquipManager.GetEquipDataByEquipJobAndPos(i,curHeroData.heroConfig.Profession,curHeroData.dynamicId)
end
if index == 5 or index == 6 then
curPosEquip =
EquipTreasureManager.GetTreasureDataByPos(
index,
curHeroData.dynamicId,
curHeroData.heroConfig.PropertyName
)
elseif index < 5 then
curPosEquip =
EquipManager.GetEquipDataByEquipJobAndPos(i, curHeroData.heroConfig.Profession, curHeroData.dynamicId)
end
--curEquip.idDyn 存在 是宝物
--curEquip.did 存在 是装备
--计算每个位置可装备的装备战力 取战力最大的装备
if curPosEquip and #curPosEquip > 0 then
local equiData = {}
local indexMaxPower = 0
if curHeroEquipDatas[index] then
equiData = curHeroEquipDatas[index]
if equiData.idDyn then
indexMaxPower = EquipTreasureManager.CalculateWarForce(equiData.idDyn)
else
indexMaxPower = EquipManager.CalculateWarForce(equiData.did)
end
end
for i = 1, #curPosEquip do
local addPower = 0
local curEquip = curPosEquip[i]
@ -284,41 +329,48 @@ function this:AllEquipUpBtnOnClick()
addPower = EquipManager.CalculateWarForce(curEquip.did)
end
end
if addPower>=indexMaxPower then
if addPower > indexMaxPower then
indexMaxPower = addPower
equiData = curEquip
end
end
if equiData.idDyn and isCanUpEquipTreasure then
if equiData.idDyn then
--if (curHeroEquipDatas[index] and equiData.idDyn ~= curHeroEquipDatas[index].idDyn) or not curHeroEquipDatas[index] then
table.insert(allTreasureIds, equiData.idDyn)
--end
else
--if (curHeroEquipDatas[index] and equiData.did ~= curHeroEquipDatas[index].did) or not curHeroEquipDatas[index] then
table.insert(allEquipIds, equiData.did)
--end
end
--特效
if curHeroEquipDatas[equiData.position] then
if curHeroEquipDatas[index] then
if equiData.idDyn then
if equiData.idDyn ~= curHeroEquipDatas[equiData.position].idDyn then
if equiData.idDyn ~= curHeroEquipDatas[index].idDyn then
table.insert(treasureEffectPos, i)
end
else
if equiData.did ~= curHeroEquipDatas[equiData.position].did then
if equiData.did ~= curHeroEquipDatas[index].did then
table.insert(equipEffectPos, i)
end
end
else
--table.insert(showEffectPos,i)
end
end
end
--isCanUpEquipTreasure
if (allEquipIds and #allEquipIds > 0) or (allTreasureIds and #allTreasureIds > 0 and isCanUpEquipTreasure) then
if allEquipIds and #allEquipIds > 0 then
--for i = 1, #allEquipIds do
-- LogGreen(curHeroData.dynamicId.. " "..curHeroData.id .." "..curHeroData.lv.." 一键穿装备 "..i.." "..allEquipIds[i])
--end
--穿装备协议
NetManager.EquipWearRequest(curHeroData.dynamicId,allEquipIds ,1,function ()
NetManager.EquipWearRequest(
curHeroData.dynamicId,
allEquipIds,
1,
function()
this.UpdateEquipPosHeroData(1, 4, allEquipIds)
--特效播放
if equipEffectPos then
@ -327,57 +379,64 @@ function this:AllEquipUpBtnOnClick()
effectList[equipEffectPos[i]]:SetActive(true)
end
end
end)
else
PopupTipPanel.ShowTip(Language[11826])
end
if isCanUpEquipTreasure then
--if EquipTreasureManager.OpenTreasure(curHeroData.star) then
--穿戴宝物
)
end
if allTreasureIds and #allTreasureIds > 0 then
--for i = 1, #allEquipIds do
-- Log(curHeroData.dynamicId.. " "..curHeroData.id .." "..curHeroData.lv.." 一键宝物 "..i.." "..allEquipIds[i])
--end
--穿装备协议
NetManager.EquipWearRequest(curHeroData.dynamicId,allTreasureIds ,2,function ()
NetManager.EquipWearRequest(
curHeroData.dynamicId,
allTreasureIds,
2,
function()
this.UpdateEquipPosHeroData(2, 4, allTreasureIds)
--特效播放
for i, v in pairs(treasureEffectPos) do
effectList[v]:SetActive(false)
effectList[v]:SetActive(true)
end
end)
end
)
end
else
PopupTipPanel.ShowTip(Language[11827])
if allTreasureIds and #allTreasureIds > 0 and not isCanUpEquipTreasure then
PopupTipPanel.ShowTip(equiptip) --没有装备可装备!
else
PopupTipPanel.ShowTip(Language[11826]) --没有装备可装备!
end
--end
end
PlaySoundWithoutClick(SoundConfig.Sound_Wear)
this.ShowHeroEquip()
end
--一键卸下
function this:AllEquipDownBtnOnClick()
if curHeroData.equipIdList and #curHeroData.equipIdList > 0 then
NetManager.EquipUnLoadOptRequest(curHeroData.dynamicId,curHeroData.equipIdList,1 ,function ()
NetManager.EquipUnLoadOptRequest(
curHeroData.dynamicId,
curHeroData.equipIdList,
1,
function()
this.UpdateEquipPosHeroData(1, 5, curHeroData.equipIdList)
end)
end
)
else
PopupTipPanel.ShowTip(Language[11828])
end
--寶物
if curHeroData.jewels and #curHeroData.jewels > 0 then
NetManager.EquipUnLoadOptRequest(curHeroData.dynamicId,curHeroData.jewels,2 ,function ()
this.UpdateEquipPosHeroData(2,5,curHeroData.jewels)
end)
-- 一键卸下音效
NetManager.EquipUnLoadOptRequest(
curHeroData.dynamicId,
curHeroData.jewels,
2,
function()
this.UpdateEquipPosHeroData(2, 5, curHeroData.jewels)
end
)
else
PopupTipPanel.ShowTip(Language[11828])
end
@ -402,6 +461,11 @@ function this.ShowHeroEquip()
this.treasurePage1.gameObject:SetActive(true)
this.treasurePage2.gameObject:SetActive(true)
else
if PlayerManager.level < tonumber(lvs[2]) then
equiptip= PopupTipPanel.ShowTip(string.format(Language[11829],lvs[2]))
elseif curHeroData.star < tonumber(stars[2]) then
equiptip=PopupTipPanel.ShowTip(string.format(Language[11830],stars[2]))
end
isCanUpEquipTreasure = false
this.equipTreasureBtn.gameObject:SetActive(false)
this.treasure1.gameObject:SetActive(false)
@ -452,8 +516,10 @@ function this.ShowHeroEquip()
Util.GetGameObject(go.transform, "frame"):SetActive(true)
Util.GetGameObject(go.transform, "mask"):SetActive(false)
--Util.GetGameObject(go.transform,"proIcon"):SetActive(false)
Util.GetGameObject(go.transform,"frame/icon"):GetComponent("Image").sprite=Util.LoadSprite(curHeroEquipDatas[i].icon)
Util.GetGameObject(go.transform,"frame"):GetComponent("Image").sprite=Util.LoadSprite(curHeroEquipDatas[i].frame)
Util.GetGameObject(go.transform, "frame/icon"):GetComponent("Image").sprite =
Util.LoadSprite(curHeroEquipDatas[i].icon)
Util.GetGameObject(go.transform, "frame"):GetComponent("Image").sprite =
Util.LoadSprite(curHeroEquipDatas[i].frame)
--Util.GetGameObject(go.transform,"proIcon"):GetComponent("Image").sprite=Util.LoadSprite(curHeroEquipDatas[i].frame)
if lvObj then
lvObj:SetActive(false)
@ -461,13 +527,18 @@ function this.ShowHeroEquip()
if refineObj then
refineObj:SetActive(false)
end
EquipManager.SetEquipStarShow(Util.GetGameObject(go.transform,"frame/star"),curHeroEquipDatas[i].itemConfig.Id)
EquipManager.SetEquipStarShow(
Util.GetGameObject(go.transform, "frame/star"),
curHeroEquipDatas[i].itemConfig.Id
)
elseif curEquipTreasureDatas[i] then
Util.GetGameObject(go.transform, "frame"):SetActive(true)
Util.GetGameObject(go.transform, "mask"):SetActive(false)
--Util.GetGameObject(go.transform,"proIcon"):SetActive(true)
Util.GetGameObject(go.transform,"frame/icon"):GetComponent("Image").sprite=Util.LoadSprite(curEquipTreasureDatas[i].icon)
Util.GetGameObject(go.transform,"frame"):GetComponent("Image").sprite=Util.LoadSprite(curEquipTreasureDatas[i].frame)
Util.GetGameObject(go.transform, "frame/icon"):GetComponent("Image").sprite =
Util.LoadSprite(curEquipTreasureDatas[i].icon)
Util.GetGameObject(go.transform, "frame"):GetComponent("Image").sprite =
Util.LoadSprite(curEquipTreasureDatas[i].frame)
--Util.GetGameObject(go.transform,"proIcon"):GetComponent("Image").sprite=Util.LoadSprite(GetProStrImageByProNum(curEquipTreasureDatas[i].itemConfig.PropertyName))
Util.GetGameObject(go.transform, "frame/star"):SetActive(false)
Util.GetGameObject(go.transform, "num").gameObject:SetActive(false)
@ -483,7 +554,6 @@ function this.ShowHeroEquip()
else
refineObj:SetActive(false)
end
else
Util.GetGameObject(go.transform, "frame"):SetActive(false)
Util.GetGameObject(go.transform, "mask"):SetActive(true)
@ -496,28 +566,39 @@ function this.ShowHeroEquip()
if refineObj then
refineObj:SetActive(false)
end
end
local iconBtn = Util.GetGameObject(go.transform, "icon")
Util.AddOnceClick(iconBtn, function()
Util.AddOnceClick(
iconBtn,
function()
if curHeroEquipDatas[i] then
curSelectEquipData = curHeroEquipDatas[i]
UIManager.OpenPanel(UIName.RoleEquipChangePopup, this, 2, curHeroData, curHeroEquipDatas[i])
elseif curEquipTreasureDatas[i] then
if itemConfig[curEquipTreasureDatas[i].id].ItemType == ItemType.EquipTreasure then
local pos=0;
local jewerConfig=ConfigManager.TryGetConfigData(ConfigName.JewelConfig,curEquipTreasureDatas[i].id)
local pos = 0
local jewerConfig =
ConfigManager.TryGetConfigData(ConfigName.JewelConfig, curEquipTreasureDatas[i].id)
if jewerConfig then
if jewerConfig.Location == 1 then
pos = 5
elseif jewerConfig.Location == 2 then
pos = 6
end
UIManager.OpenPanel(UIName.RoleEquipTreasureChangePopup,this,2,curHeroData,curEquipTreasureDatas[i],nil,pos)
UIManager.OpenPanel(
UIName.RoleEquipTreasureChangePopup,
this,
2,
curHeroData,
curEquipTreasureDatas[i],
nil,
pos
)
end
end
end
end)
end
)
end
local allAddProVal = HeroManager.CalculateHeroAllProValList(1, curHeroData.dynamicId, false)
this.force.text = allAddProVal[HeroProType.WarPower]
@ -560,8 +641,11 @@ function this:OnClickTabBtn(_index)
this:SetItemData(allEquip)
else
local allEquipTreasure
allEquipTreasure = EquipTreasureManager.GetAllTreasuresByLocation(_index - 4,curHeroData.heroConfig.PropertyName)
table.sort(allEquipTreasure, function(a, b)
allEquipTreasure =
EquipTreasureManager.GetAllTreasuresByLocation(_index - 4, curHeroData.heroConfig.PropertyName)
table.sort(
allEquipTreasure,
function(a, b)
if a.refineLv == b.refineLv then
if a.lv == b.lv then
return a.id > b.id
@ -571,7 +655,8 @@ function this:OnClickTabBtn(_index)
else
return a.refineLv > b.refineLv
end
end)
end
)
this:SetItemData(allEquipTreasure)
end
end
@ -601,24 +686,29 @@ function this:SetItemData(_itemDatas)
-- for i, v in pairs(equips) do
-- table.insert(showList, v)
-- end
this.ScrollView:SetData(_itemDatas, function (index, go)
this.ScrollView:SetData(
_itemDatas,
function(index, go)
this.SingleItemDataShow(go, _itemDatas[index])
end)
end
)
end
function this.SingleItemDataShow(_go, _itemData)
if not itemConfig[_itemData.id] then return end
if not itemConfig[_itemData.id] then
return
end
local frame = Util.GetGameObject(_go.transform, "frame"):GetComponent("Image")
local icon = Util.GetGameObject(_go.transform, "icon"):GetComponent("Image")
local name = Util.GetGameObject(_go.transform, "name"):GetComponent("Text")
local star = Util.GetGameObject(_go.transform, "star")
local proIcon = Util.GetGameObject(_go.transform, "proIcon")
local jewerConfig = ConfigManager.TryGetConfigData(ConfigName.JewelConfig, _itemData.id)
local pos=0;
local pos = 0
if jewerConfig then
if jewerConfig.Location == 1 then
pos = 5
else if jewerConfig.Location==2 then
else
if jewerConfig.Location == 2 then
pos = 6
end
end
@ -629,7 +719,8 @@ function this.SingleItemDataShow(_go,_itemData)
icon.sprite = Util.LoadSprite(_itemData.icon)
frame.sprite = Util.LoadSprite(_itemData.frame)
proIcon:SetActive(true)
proIcon:GetComponent("Image").sprite=Util.LoadSprite(GetProStrImageByProNum(_itemData.itemConfig.PropertyName))
proIcon:GetComponent("Image").sprite =
Util.LoadSprite(GetProStrImageByProNum(_itemData.itemConfig.PropertyName))
name.text = itemConfig[_itemData.id].Name
star:SetActive(false)
Util.GetGameObject(_go.transform, "redPoint"):SetActive(false)
@ -648,13 +739,24 @@ function this.SingleItemDataShow(_go,_itemData)
Util.GetGameObject(_go.transform, "num").gameObject:SetActive(false)
-- 0.查看属性 1.穿戴 2.卸下 3.交换
--宝物界面
Util.AddOnceClick(Util.GetGameObject(_go.transform,"icon"), function()
Util.AddOnceClick(
Util.GetGameObject(_go.transform, "icon"),
function()
if curEquipTreasureDatas[pos] then
UIManager.OpenPanel(UIName.RoleEquipTreasureChangePopup,this,3,curHeroData,curEquipTreasureDatas[pos],_itemData,pos)
UIManager.OpenPanel(
UIName.RoleEquipTreasureChangePopup,
this,
3,
curHeroData,
curEquipTreasureDatas[pos],
_itemData,
pos
)
else
UIManager.OpenPanel(UIName.RoleEquipTreasureChangePopup, this, 1, curHeroData, _itemData, nil, pos)
end
end)
end
)
else
frame.sprite = Util.LoadSprite(_itemData.frame)
icon.sprite = Util.LoadSprite(_itemData.icon)
@ -681,13 +783,31 @@ function this.SingleItemDataShow(_go,_itemData)
redPoint:SetActive(false)
end
Util.GetGameObject(_go.transform, "num"):GetComponent("Text").text = _itemData.num
Util.AddOnceClick(Util.GetGameObject(_go.transform,"icon"), function()
Util.AddOnceClick(
Util.GetGameObject(_go.transform, "icon"),
function()
if curHeroEquipDatas[_itemData.equipConfig.Position] then
UIManager.OpenPanel(UIName.RoleEquipChangePopup,this,3,curHeroData,curHeroEquipDatas[_itemData.equipConfig.Position],_itemData,_itemData.equipConfig.Position)
UIManager.OpenPanel(
UIName.RoleEquipChangePopup,
this,
3,
curHeroData,
curHeroEquipDatas[_itemData.equipConfig.Position],
_itemData,
_itemData.equipConfig.Position
)
else
UIManager.OpenPanel(UIName.RoleEquipChangePopup,this,1,curHeroData,_itemData,_itemData.equipConfig.Position)
UIManager.OpenPanel(
UIName.RoleEquipChangePopup,
this,
1,
curHeroData,
_itemData,
_itemData.equipConfig.Position
)
end
end)
end
)
end
end
--刷新当前英雄装备坑位的信息
@ -738,7 +858,8 @@ function this.UpdateEquipPosHeroData(_equipOrTreasure,_type,_selectEquipDataList
if _equipOrTreasure == 1 then
curSelectEquipData = _selectEquipDataList[1]
--新装备绑英雄
EquipManager.SetEquipUpHeroDid(curSelectEquipData.did,curHeroData.dynamicId)--穿
EquipManager.SetEquipUpHeroDid(curSelectEquipData.did, curHeroData.dynamicId)
--穿
if _oldSelectEquip then
--被替换装备解绑英雄
EquipManager.SetEquipUpHeroDid(_oldSelectEquip.did, "0")
@ -769,17 +890,18 @@ function this.UpdateEquipPosHeroData(_equipOrTreasure,_type,_selectEquipDataList
elseif _type == 4 then
--一键穿 把身上装备解绑英雄id
if _equipOrTreasure == 1 then
--宝物
for k, v in ipairs(curHeroData.equipIdList) do
EquipManager.SetEquipUpHeroDid(v, "0")
end
curHeroData.equipIdList = {}
for i = 1, #_selectEquipDataList do
--把选择的装备绑上英雄
EquipManager.SetEquipUpHeroDid(_selectEquipDataList[i],curHeroData.dynamicId)--穿
EquipManager.SetEquipUpHeroDid(_selectEquipDataList[i], curHeroData.dynamicId)
--穿
--再把英雄装备list 清空并添加上新选择的装备
table.insert(curHeroData.equipIdList, _selectEquipDataList[i])
end
--宝物
else
for k, v in ipairs(curHeroData.jewels) do
EquipTreasureManager.SetTreasureUpOrDown(v, "0")
@ -787,12 +909,12 @@ function this.UpdateEquipPosHeroData(_equipOrTreasure,_type,_selectEquipDataList
curHeroData.jewels = {}
for i = 1, #_selectEquipDataList do
--把选择的装备绑上英雄
EquipTreasureManager.SetTreasureUpOrDown(_selectEquipDataList[i],curHeroData.dynamicId)--穿
EquipTreasureManager.SetTreasureUpOrDown(_selectEquipDataList[i], curHeroData.dynamicId)
--穿
--再把英雄装备list 清空并添加上新选择的装备
table.insert(curHeroData.jewels, _selectEquipDataList[i])
end
end
elseif _type == 5 then
--一键脱 把身上装备英雄id置为“0” 再把英雄装备list清空
if _equipOrTreasure == 1 then
@ -801,27 +923,15 @@ function this.UpdateEquipPosHeroData(_equipOrTreasure,_type,_selectEquipDataList
EquipManager.SetEquipUpHeroDid(_selectEquipDataList[i], "0")
end
end
--for i = 1, #_selectEquipDataList do
-- --把选择的装备绑上英雄
-- -- EquipTreasureManager.SetTreasureUpOrDown(_selectEquipDataList[i],curHeroData.dynamicId)--穿
-- --再把英雄装备list 清空并添加上新选择的装备
-- table.remove(curHeroData.equipIdList,i)
--end
curHeroData.equipIdList = {}
else
if _selectEquipDataList then
for i = 1, #_selectEquipDataList do
EquipTreasureManager.SetTreasureUpOrDown(_selectEquipDataList[i],"")
EquipTreasureManager.SetTreasureUpOrDown(_selectEquipDataList[i], "0")
end
--table.remove(curHeroData.jewels,i)
curHeroData.jewels = {}
end
--for i = 1, #_selectEquipDataList do
-- --把选择的装备绑上英雄
-- EquipTreasureManager.SetTreasureUpOrDown(_selectEquipDataList[i],curHeroData.dynamicId)--穿
-- --再把英雄装备list 清空并添加上新选择的装备
-- table.remove(curHeroData.equipIdList,_selectEquipDataList[i])
--end
end
--curHeroData.equipIdList={}
@ -862,7 +972,6 @@ function this.SelectImageSetParent(_objPoint)
end
--界面关闭时调用(用于子类重写)
function RoleEquipPanel:OnClose()
end
function this:AddRedPointVale(_equipDatas)
for j = 1, #_equipDatas do
@ -886,7 +995,9 @@ function this:SortEquipDatas(_equipDatas)
curHeroCanUpEquipTabs = {}
end
this:AddRedPointVale(_equipDatas)
table.sort(_equipDatas, function(a, b)
table.sort(
_equipDatas,
function(a, b)
if a.isRedPointShow == b.isRedPointShow then
if a.equipConfig.Quality == b.equipConfig.Quality then
if a.equipConfig.Position == b.equipConfig.Position then
@ -900,7 +1011,8 @@ function this:SortEquipDatas(_equipDatas)
else
return a.isRedPointShow > b.isRedPointShow
end
end)
end
)
end
--做装备叠加特殊组拼数据
@ -922,7 +1034,6 @@ function this:EquipDJDatas(_itemDatas)
end
--界面销毁时调用(用于子类重写)
function RoleEquipPanel:OnDestroy()
SubUIManager.Close(this.UpView)
this.ScrollView = nil
end

View File

@ -356,7 +356,7 @@ function this.SetPropertyShow(_infos,_preList,_grid)
if proper.Style==1 then
obj.transform:GetComponent("Text").text=" +".. value.currValue
else
obj.transform:GetComponent("Text").text=" +".. value.currValue/1000 .."%"
obj.transform:GetComponent("Text").text=" +".. value.currValue/100 .."%"
end
obj.gameObject:SetActive(true)
index=index+1

View File

@ -625,7 +625,7 @@ function this.IsAutoRecoverCount(shopType)
local curTimeStamp = GetTimeStamp()
local shopData = this.GetShopDataByType(shopType)
local lastRefreshTime = math.floor(shopData.lastRefreshTime / 1000)
local leftCount = math.min(maxTime, math.floor((curTimeStamp - lastRefreshTime)/refreshTime))
local leftCount = math.min(maxTime, math.floor(math.ceil(curTimeStamp - lastRefreshTime)/refreshTime))
-- 如果没有免费次数了,但是有特权刷新次数
if leftCount <= 0 and shopInfo.RefreshPrivilege ~= 0 then

View File

@ -338,6 +338,7 @@ function this:RefreshBase()
self.costIcon:SetActive(false)
self.costLab:SetActive(false)
self.countLabTip:GetComponent("Text").text = Language[12092]
self.isMaxTime = false
else
self.costIcon:SetActive(true)
self.costLab:SetActive(true)