装备出售界面添加

dev_chengFeng
zhangqiang 2020-07-07 15:20:43 +08:00
parent bdc2c095a7
commit bff7df21e4
14 changed files with 8306 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 131510fb8ee4bc34c988357e59e4bdd9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1682,6 +1682,8 @@ GENERAL_POPUP_TYPE={
ExpeditionReply=13, --大闹天宫 回复 和 复活节点
TrialToNextFloor=14,--试炼副本进入下一层
ResolveEquipTreasure=15,--分解宝物
EquipBatchSell=16,--装备批量出售
EquipSingleSell=17,--装备单种出售 拉条
}
--抽卡类型

View File

@ -316,6 +316,7 @@ UIName = {
UpGradePackagePanel = 315,--升级限时礼包
TrialMiniGamePanel = 316,-- 试炼小游戏界面
ShowEnemyInfoPanel = 317,--森罗幻境遇敌信息界面
EquipSellSelectPopup = 318,--装备分解选择界面
}

View File

@ -79,6 +79,7 @@ function BagPanel:BindEvent()
Util.AddClick(this.fenJieBtn, function()
if sortIndex == ItemBaseType.Equip then
UIManager.OpenPanel(UIName.HeroAndEquipResolvePanel, 2)--装备
-- UIManager.OpenPanel(UIName.EquipSellSelectPopup)--装备
elseif sortIndex == ItemBaseType.EquipTreasure then
UIManager.OpenPanel(UIName.HeroAndEquipResolvePanel, 3)--宝器
elseif sortIndex == ItemBaseType.SoulPrint then

View File

@ -35,6 +35,10 @@ local contentScripts = {
[14]={view=require("Modules/Popup/View/GeneralPopup_TrialToNextFloor"),panelName="GeneralPopup_TrialToNextFloor",type=GENERAL_POPUP_TYPE.TrialToNextFloor},
--宝物分解
[15] = {view = require("Modules/Popup/View/GeneralPopup_ResolveEquipTreasure"), panelName = "GeneralPopup_ResolveEquipTreasure",type=GENERAL_POPUP_TYPE.ResolveEquipTreasure},
-- --装备批量出售
-- [16] = {view = require("Modules/Popup/View/GeneralPopup_EquipBatchSell"), panelName = "GeneralPopup_EquipBatchSell",type=GENERAL_POPUP_TYPE.EquipBatchSell},
-- --装备单种出售 拉条
-- [17] = {view = require("Modules/Popup/View/GeneralPopup_EquipSingleSell"), panelName = "GeneralPopup_EquipSingleSell",type=GENERAL_POPUP_TYPE.EquipSingleSell},
}
--子模块预设
local contentPrefabs={}

View File

@ -0,0 +1,78 @@
----- 装备批量出售 -----
local this = {}
--传入父脚本模块
local parent
--传入特效层级
local sortingOrder=0
local _args={}
--传入选择宝器计算返回奖励数据列表
local dropList = {}
--item容器
local itemList = {}
--传入选择英雄
local selectEquipTreasureData
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
function this:InitComponent(gameObject)
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
this.bodyText=Util.GetGameObject(gameObject,"BodyText"):GetComponent("Text")
this.cancelBtn=Util.GetGameObject(gameObject,"CancelBtn")
this.confirmBtn=Util.GetGameObject(gameObject,"ConfirmBtn")
--滚动条根节点
this.root = Util.GetGameObject(gameObject, "Root")
end
function this:BindEvent()
Util.AddClick(this.cancelBtn,function()
parent:ClosePanel()
end)
Util.AddClick(this.confirmBtn,function()
-- local data={}
-- for k,v in pairs(selectEquipTreasureData) do
-- table.insert(data,v.idDyn)
-- end
-- NetManager.UseAndPriceItemRequest(4, data, function(msg)
-- for i = 1, #data do
-- EquipTreasureManager.RemoveTreasureByIdDyn(data[i])
-- end
-- parent:ClosePanel()
-- UIManager.OpenPanel(UIName.RewardItemPopup,msg,1,function ()
-- ResolvePanel.SwitchView(3)
-- end)
-- end)
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
parent=_parent
sortingOrder =_parent.sortingOrder
local args = {...}
dropList = args[1]
selectEquipTreasureData=args[2]
this.titleText.text=Language[11643]
--返还比
local num = 100--tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,35).Value)/100
this.bodyText.text=string.format( Language[11644],num,"%")
local data={}
for i, v in pairs(dropList) do
data[i]={v.id,v.num}
end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,4,1,sortingOrder,false,data)
end
function this:OnClose()
end
function this:OnDestroy()
end
return this

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c58ac0b980c8192429240ba445c7ba07
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,78 @@
----- 宝器分解弹窗 -----
local this = {}
--传入父脚本模块
local parent
--传入特效层级
local sortingOrder=0
local _args={}
--传入选择宝器计算返回奖励数据列表
local dropList = {}
--item容器
local itemList = {}
--传入选择英雄
local selectEquipTreasureData
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
function this:InitComponent(gameObject)
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
this.bodyText=Util.GetGameObject(gameObject,"BodyText"):GetComponent("Text")
this.cancelBtn=Util.GetGameObject(gameObject,"CancelBtn")
this.confirmBtn=Util.GetGameObject(gameObject,"ConfirmBtn")
--滚动条根节点
this.root = Util.GetGameObject(gameObject, "Root")
end
function this:BindEvent()
Util.AddClick(this.cancelBtn,function()
parent:ClosePanel()
end)
Util.AddClick(this.confirmBtn,function()
-- local data={}
-- for k,v in pairs(selectEquipTreasureData) do
-- table.insert(data,v.idDyn)
-- end
-- NetManager.UseAndPriceItemRequest(4, data, function(msg)
-- for i = 1, #data do
-- EquipTreasureManager.RemoveTreasureByIdDyn(data[i])
-- end
-- parent:ClosePanel()
-- UIManager.OpenPanel(UIName.RewardItemPopup,msg,1,function ()
-- ResolvePanel.SwitchView(3)
-- end)
-- end)
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
parent=_parent
sortingOrder =_parent.sortingOrder
local args = {...}
dropList = args[1]
selectEquipTreasureData=args[2]
this.titleText.text=Language[11643]
--返还比
local num = 100--tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,35).Value)/100
this.bodyText.text=string.format( Language[11644],num,"%")
local data={}
for i, v in pairs(dropList) do
data[i]={v.id,v.num}
end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,4,1,sortingOrder,false,data)
end
function this:OnClose()
end
function this:OnDestroy()
end
return this

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8a7174cebe2fb2e4fb30e49a1fa7bc51
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,194 @@
require("Base/BasePanel")
EquipSellSelectPopup = Inherit(BasePanel)
local this = EquipSellSelectPopup
local isAllSelectState = false
local quaGrid = {}
local starGrid = {}
local quaStateTable = {}
--false 未选择 true 选择
local starStateTable = {}
--false 未选择 true 选择
local quaTextStringSeting = {
[1] = {name = "绿色", defaultState = true},
[2] = {name = "蓝色", defaultState = true},
[3] = {name = "紫色", defaultState = false},
[4] = {name = "金色", defaultState = false},
[5] = {name = "红色", defaultState = false}
}
local sartTextStringSeting = {
[1] = {name = "1星", defaultState = true},
[2] = {name = "2星", defaultState = true},
[3] = {name = "3星", defaultState = false},
[4] = {name = "4星", defaultState = false},
[5] = {name = "5星", defaultState = false}
}
--初始化组件(用于子类重写)
function EquipSellSelectPopup:InitComponent()
this.BtnBack = Util.GetGameObject(self.transform, "btnBack")
this.allSelectBtn = Util.GetGameObject(self.transform, "allSelectBtn/click")
this.allSelectBtnImage = Util.GetGameObject(self.transform, "allSelectBtn/allSelectBtnImage")
this.cancelBtn = Util.GetGameObject(self.transform, "cancelBtn")
this.sellBtn = Util.GetGameObject(self.transform, "sellBtn")
quaGrid = {}
for i = 1, 5 do
quaGrid[i] = Util.GetGameObject(self.transform, "quaGrid/quaSelectBtn (" .. i .. ")")
starGrid[i] = Util.GetGameObject(self.transform, "starGrid/starSelectBtn (" .. i .. ")")
end
end
--绑定事件(用于子类重写)
function EquipSellSelectPopup:BindEvent()
Util.AddClick(
this.BtnBack,
function()
self:ClosePanel()
end
)
Util.AddClick(
this.allSelectBtn,
function()
isAllSelectState = not isAllSelectState
this.allSelectBtnImage:SetActive(isAllSelectState)
if isAllSelectState then
this.AllSelectShow()
else
this.DefaultShow()
end
end
)
Util.AddClick(
this.cancelBtn,
function()
self:ClosePanel()
end
)
Util.AddClick(
this.sellBtn,
function()
self:ClosePanel()
end
)
for i = 1, #quaGrid do
Util.AddClick(
Util.GetGameObject(quaGrid[i], "click"),
function()
quaStateTable[i] = not quaStateTable[i]
Util.GetGameObject(quaGrid[i], "allSelectBtnImage"):SetActive(quaStateTable[i])
this.IsShowAllSelectImage()
end
)
end
for i = 1, #starGrid do
Util.AddClick(
Util.GetGameObject(starGrid[i], "click"),
function()
starStateTable[i] = not starStateTable[i]
Util.GetGameObject(starGrid[i], "allSelectBtnImage"):SetActive(starStateTable[i])
this.IsShowAllSelectImage()
end
)
end
end
--添加事件监听(用于子类重写)
function EquipSellSelectPopup:AddListener()
end
--移除事件监听(用于子类重写)
function EquipSellSelectPopup:RemoveListener()
end
--界面打开时调用(用于子类重写)
function EquipSellSelectPopup:OnOpen()
end
function EquipSellSelectPopup:OnShow()
this.DefaultShow()
end
function this.DefaultShow()
--初始选择
isAllSelectState = false
this.allSelectBtnImage:SetActive(isAllSelectState)
quaStateTable = {}
starStateTable = {}
for i = 1, #quaTextStringSeting do
table.insert(quaStateTable, quaTextStringSeting[i].defaultState)
if quaGrid[i] then
Util.GetGameObject(quaGrid[i], "Text"):GetComponent("Text").text = quaTextStringSeting[i].name
Util.GetGameObject(quaGrid[i], "allSelectBtnImage"):SetActive(quaTextStringSeting[i].defaultState)
end
end
for i = 1, #sartTextStringSeting do
table.insert(starStateTable, sartTextStringSeting[i].defaultState)
if starGrid[i] then
Util.GetGameObject(starGrid[i], "Text"):GetComponent("Text").text = sartTextStringSeting[i].name
Util.GetGameObject(starGrid[i], "allSelectBtnImage"):SetActive(sartTextStringSeting[i].defaultState)
end
end
end
function this.AllSelectShow()
--初始选择
quaStateTable = {}
starStateTable = {}
for i = 1, #quaTextStringSeting do
table.insert(quaStateTable, true)
if quaGrid[i] then
Util.GetGameObject(quaGrid[i], "allSelectBtnImage"):SetActive(true)
end
end
for i = 1, #sartTextStringSeting do
table.insert(starStateTable, true)
if starGrid[i] then
Util.GetGameObject(starGrid[i], "allSelectBtnImage"):SetActive(true)
end
end
end
--显示全部按钮
function this.IsShowAllSelectImage()
local quaIsAllTrue = true
for i = 1, #quaStateTable do
if not quaStateTable[i] then
quaIsAllTrue = false
end
end
local starIsAllTrue = true
for i = 1, #starStateTable do
if not starStateTable[i] then
starIsAllTrue = false
end
end
if quaIsAllTrue and starIsAllTrue then
isAllSelectState = true
else
isAllSelectState = false
end
this.allSelectBtnImage:SetActive(isAllSelectState)
end
--出售点击事件
function this.SellBtnClick()
local quaIsAllTrue = false
for i = 1, #quaStateTable do
if quaStateTable[i] then
quaIsAllTrue = true
end
end
local starIsAllTrue = false
for i = 1, #starStateTable do
if starStateTable[i] then
starIsAllTrue = true
end
end
if quaIsAllTrue and starIsAllTrue then
--出售
else
-- Language[12108]
end
end
--界面关闭时调用(用于子类重写)
function EquipSellSelectPopup:OnClose()
end
--界面销毁时调用(用于子类重写)
function EquipSellSelectPopup:OnDestroy()
end
return EquipSellSelectPopup

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0c9c983a0bb881542857005e2d3541de
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.