【家园】提交

dev_chengFeng
ZhangBiao 2022-01-05 17:06:34 +08:00
parent 6f4942e87e
commit b45f74781c
4 changed files with 48 additions and 25 deletions

View File

@ -2910,8 +2910,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -200, y: 18}
m_SizeDelta: {x: 100, y: 100}
m_AnchoredPosition: {x: -190, y: 10}
m_SizeDelta: {x: 75, y: 75}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7366271824309728645
CanvasRenderer:
@ -10252,8 +10252,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -197, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_AnchoredPosition: {x: -190, y: 10}
m_SizeDelta: {x: 75, y: 75}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6168014395681627711
CanvasRenderer:
@ -10754,7 +10754,7 @@ MonoBehaviour:
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
m_FontSize: 34
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
@ -13814,7 +13814,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: -228, y: -24.3}
m_AnchoredPosition: {x: -217, y: -30}
m_SizeDelta: {x: 100, y: 25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8785512128754516411
@ -13847,7 +13847,7 @@ MonoBehaviour:
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
m_FontSize: 50
m_FontSize: 40
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
@ -18510,7 +18510,7 @@ MonoBehaviour:
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 12800000, guid: 6fa15837529b0e640af6620b07d3207d, type: 3}
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
m_FontSize: 34
m_FontStyle: 0
m_BestFit: 0
@ -23575,7 +23575,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 872, y: 81}
m_AnchoredPosition: {x: 148, y: 81}
m_SizeDelta: {x: 650, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7396113761718134804

View File

@ -483,6 +483,7 @@ PanelType = {
LingMai = {14,16,1273},--御剑行
tiandihonglu = {16,1287,1289},
fagncunxunbao = {16,1288,1290},
HomeLand = {14,16,12061,12062},
}

View File

@ -23,6 +23,8 @@ function this:InitComponent(gameObject)
this.Obtain = Util.GetGameObject(this.Content,"Obtain")
this.Cost = Util.GetGameObject(this.Content,"Cost")
--Obtain
this.limit = Util.GetGameObject(this.Obtain,"limit")
this.gain = Util.GetGameObject(this.Obtain,"gain")
this.limitIcon = Util.GetGameObject(this.Obtain,"limit/Icon"):GetComponent("Image")
this.limitNum = Util.GetGameObject(this.Obtain,"limit/Num"):GetComponent("Text")
this.limitAdd = Util.GetGameObject(this.Obtain,"limit/Add"):GetComponent("Text")
@ -126,8 +128,26 @@ function this:OnShow(_parent,_args)
this.fastDoneIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(tonumber(str[2])))
this.fastDoneNum.text = math.ceil(curData.Time/tonumber(str[1]))*tonumber(str[3])
this.doneNum.text = string.format("耗时:%s",TimeToMS(curData.Time))
this.doneNum.text = string.format("耗时:%s",this:CulculateTime(curData.Time))
ForceRebuildLayout(this.limit.transform)
ForceRebuildLayout(this.gain.transform)
ForceRebuildLayout(this.Obtain.transform)
ForceRebuildLayout(this.Cost.transform)
ForceRebuildLayout(this.Open.transform)
ForceRebuildLayout(this.Content.transform)
end
function this:CulculateTime(time)
if time < 60 then
return time..""
elseif time >= 60 and time < 3600 then
return math.floor(time/60)..""..(time%60)..""
elseif time >= 3600 and time < 86400 then
return math.floor(time/3600)..""..(time%60)..""
elseif time >= 86400 then
return math.floor(time/86400)..""..(time%3600)..""
end
end
function this:OnClose()

View File

@ -59,7 +59,6 @@ function HomeLand:InitComponent()
self.mapData[i].Lock = Util.GetGameObject(self.mapData[i].Title,"lock")
self.mapData[i].RedPoint:SetActive(false)
self.mapData[i].CanGet = Util.GetGameObject(self.mapData[i].Obj,"CanGet")
-- self.mapData[i].Icon = Util.GetGameObject(self.mapData[i].Obj,"Title/Image"):GetComponent("Image")
self.mapData[i].Icon = Util.GetGameObject(self.mapData[i].Obj,"CanGet/Image"):GetComponent("Image")
self.mapData[i].Btns = Util.GetGameObject(self.mapData[i].Obj,"Btns")
self.mapData[i].OpenLimit = Util.GetGameObject(self.mapData[i].Title,"OpenLimit")
@ -73,6 +72,7 @@ function HomeLand:InitComponent()
self.mapData[i].btnUpgrade = Util.GetGameObject(self.mapData[i].Btns,"Upgrade")
self.mapData[i].upGradeRed = Util.GetGameObject(self.mapData[i].btnUpgrade,"upGradeRed")
self.mapData[i].btnCancel = Util.GetGameObject(self.mapData[i].Btns,"Cancel")
self.mapData[i].btnCancel:SetActive(false)
self.mapData[i].btnSpeedUp = Util.GetGameObject(self.mapData[i].Btns,"Speed")
self.mapData[i].btnUsePri = Util.GetGameObject(self.mapData[i].Btns,"UsePri")
self.mapData[i].leftTime = -1
@ -156,11 +156,11 @@ function HomeLand:BindEvent()
end)
end)
--取消
Util.AddOnceClick(self.mapData[i].btnCancel,function ()
NetManager.ArchitectureOperateRequest({HomeLandManager.BuildData[i].dataMain.Id},3,0,function ()
self:OnShow()
end)
end)
-- Util.AddOnceClick(self.mapData[i].btnCancel,function ()
-- NetManager.ArchitectureOperateRequest({HomeLandManager.BuildData[i].dataMain.Id},3,0,function ()
-- self:OnShow()
-- end)
-- end)
end
--建木神树
Util.AddOnceClick(self.mapData[7].Obj,function ()
@ -217,12 +217,14 @@ function HomeLand:BindEvent()
elseif count2 == 0 then
--全部都可以收取
else
for i = 1, 4 do
local curObjData = self.mapData[i].data
if curObjData.dataSingle.Storage and curObjData.dataSingle.Storage[2][1] ~= 14 and curObjData.dataSingle.Storage[2][2] <= BagManager.GetTotalItemNum(curObjData.dataSingle.Storage[2][1]) then
PopupTipPanel.ShowTip(string.format("%s已达储藏上限无法收获~",ItemConfig[curObjData.dataSingle.Storage[2][1]].Name))
local thread=coroutine.start(function()
for i = 1, 4 do
local curObjData = self.mapData[i].data
if curObjData.dataSingle.Storage and curObjData.dataSingle.Storage[2][1] ~= 14 and curObjData.dataSingle.Storage[2][2] <= BagManager.GetTotalItemNum(curObjData.dataSingle.Storage[2][1]) then
PopupTipPanel.ShowTip(string.format("%s已达储藏上限无法收获~",ItemConfig[curObjData.dataSingle.Storage[2][1]].Name))
end
end
end
end)
end
NetManager.HomeAllGainRequset(0,function ()
@ -260,7 +262,7 @@ end
--待功能扩展(试图打开某个状态)
function HomeLand:OnOpen()
self.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.XiuXing })
self.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.HomeLand })
end
@ -348,7 +350,7 @@ function HomeLand:SetBuildsState()
curObj.OpenLimit:SetActive(true)
curObj.Lock:SetActive(true)
curObj.btnUpgrade:SetActive(false)
curObj.btnCancel:SetActive(false)
-- curObj.btnCancel:SetActive(false)
curObj.btnSpeedUp:SetActive(false)
curObj.btnUsePri:SetActive(false)
curObj.levelImg:SetActive(false)
@ -384,7 +386,7 @@ function HomeLand:SetBuildsState()
end
end
if data.endTime > GetTimeStamp() then--如果有结束时间说明在升级,可以取消,可以加速
curObj.btnCancel:SetActive(true)
-- curObj.btnCancel:SetActive(true)
curObj.btnSpeedUp:SetActive(true)
curObj.btnUsePri:SetActive(PrivilegeManager.GetPrivilegeRemainValue(4021)>0)
-- curObj.upgradeImg:SetActive(true)
@ -405,7 +407,7 @@ function HomeLand:SetBuildsState()
Util.AddOnceClick(curObj.CanGet,function ()
if data.dataSingle.Storage[2][1] ~= 14 and data.dataSingle.Storage[2][2] <= BagManager.GetTotalItemNum(data.dataSingle.Storage[2][1]) then
PopupTipPanel.ShowTip("当前资源已达储藏上限,提升建筑等级可增加储藏上限!")
PopupTipPanel.ShowTip("当前资源已达储藏上限,提升建筑等级可增加储藏上限!")
return
end
NetManager.HomeAllGainRequset(data.dataMain.Id,function ()