[gm]==============声望特权提交

dev_chengFeng
wangzhenxing 2022-10-20 17:48:00 +08:00
parent 65a79d27d4
commit 8d63d391a6
17 changed files with 3738 additions and 46 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: f6e8a04c5f2e9664d8793d06771d9e6c
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 56
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: af32c1a0549ca8742b2da83eace91f11
vertices: []
indices:
edges: []
weights: []
spritePackingTag: GMAltas
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: c4cc1bbe5717beb48b9074b9cb1a456d
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 65
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 56
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 1
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 01ea542f65c9b3f479dd7dc9192819d4
vertices: []
indices:
edges: []
weights: []
spritePackingTag: GMAltas
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -92475,7 +92475,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 6.1}
m_SizeDelta: {x: 200, y: 200}
m_SizeDelta: {x: 148, y: 149}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6988001231396661349
CanvasRenderer:
@ -92505,7 +92505,7 @@ MonoBehaviour:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: a2ea741f017c1a947b6bb9dc2b460bdc, type: 3}
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1

View File

@ -474,6 +474,7 @@ UIName = {
GMChangePanel=482,--gm修改器
GMCommonConfirmPanel=483,--gm确认弹窗
GMEspecially=484,--gm创角即送
GMMingWangPanel=485,--gm名望特权
}
SubUIConfig = {

View File

@ -1267,6 +1267,9 @@ function this.BagIndicationRefresh(msg)
CheckRedPointStatus(RedPointType.incarnation_demon)
CheckRedPointStatus(RedPointType.incarnation_taoist)
end
if v.itemId == 1351 then
DynamicActivityManager.ChangeMingWangLv()
end
end
end

View File

@ -8,6 +8,7 @@ local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local GlobalActivity = ConfigManager.GetConfig(ConfigName.GlobalActivity)
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
local artResConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local prestigeConfig=ConfigManager.GetConfig(ConfigName.PrestigeConfig)
this.curLevel = 0--社稷大典的等级
this.curActivityType = 0
this.OpenUIList = {}
@ -151,6 +152,47 @@ function this.SetCurLevel(level)--社稷大典的等级
this.curLevel = level
end
function this.GetMingWangLv(index)
if index==20 then
index=19
end
local config=ConfigManager.GetConfigDataByDoubleKey(ConfigName.PrestigeConfig,"Type",2,"Level",index)
if config then
if config.Experience~=nil then
return config.Experience[2]
else
return 0
end
else
-- LogError("prestigeConfig[i].id=="..prestigeConfig[i].Id)
end
return 0
end
function this.ChangeMingWangLv()
local growData = this.GetGiftDataByType({{2,95}})
local rechargeNum = BagManager.GetItemCountById(1351) --VipManager.GetChargedNum()--已经充值的金额
table.sort(growData,function (a,b)
return a.data.shopItemData.BuyRule[2] < b.data.shopItemData.BuyRule[2]
end)
--计算当前声望等级
for i = 1, #growData do
local lv=growData[i].data.shopItemData.BuyRule[2]
if rechargeNum < this.GetMingWangLv(lv) then
if rechargeNum ~= 0 then
this.curLevel = i
-- if this.Index == 0 then
this.Index = i
-- end
break
else
this.curLevel = 1
end
end
end
end
function this.SheJiCheckRedPoint()
local ActInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.Celebration)--活动数据
local canGetRewardList={}

View File

@ -166,7 +166,7 @@ function SheJiDaDian:BindEvent()
end)
Util.AddOnceClick(self.btnBox,function ()
DynamicActivityManager.SetCurLevel(math.floor(self.curScore/(self.actReward[1].Values[2][1])))
-- DynamicActivityManager.SetCurLevel(math.floor(self.curScore/(self.actReward[1].Values[2][1])))
UIManager.OpenPanel(UIName.GeneralRewardPopup,1,self.actType,self.actId)
end)
end

View File

@ -147,9 +147,9 @@ function this:InitComponent()
this.gmRedPoint:SetActive(false)
--名望系统
this.btnMingWang=Util.GetGameObject(self.gameObject,"RightDown/btnMingWang")
Util.GetGameObject(this.btnMingWang,"Image"):GetComponent("Image").sprite=this.spLoader:LoadSprite("gm_change_maincity_btn_zh")
this.gmRedPoint = Util.GetGameObject(this.btnMingWang,"redPoint")
this.btnMingWang:SetActive(false)
Util.GetGameObject(this.btnMingWang,"Image"):GetComponent("Image").sprite=this.spLoader:LoadSprite("gm_mingwang_icon")
this.mwRedPoint = Util.GetGameObject(this.btnMingWang,"redPoint")
this.mwRedPoint:SetActive(false)
--六星前往
this.btnSixStarGo=Util.GetGameObject(self.gameObject,"LeftUp/GameObject/GameObject/sixStarHero")
--15日登陆活动预告
@ -1033,7 +1033,6 @@ end
local ySet = {[1] = 361 ,[2] = 512,[3] = 663,[4] = 814,[5] = 965,[6] = 1116,[7] = 1267,[8] = 1418 }
--设置右侧条
function this.SetRightBarSize()
LogError("SERVER_VERSION=="..SERVER_VERSION)
this.RightUp2:SetActive(PlayerManager.level >= 5 and SERVER_VERSION == 0)
local str = PlayerPrefs.GetInt(PlayerManager.uid.."MainRightBarSetting")
if not str or str == 0 then
@ -1047,7 +1046,6 @@ function this.SetRightBarSize()
num = num + 1
end
end
LogError("num===="..num)
local y = ySet[num]
this.RightUp2bgSize.sizeDelta =Vector3.New(180,y,0)
this.RightUp2rectSize.sizeDelta = Vector3.New(180,y,0)

View File

@ -691,6 +691,7 @@ function this.ActivityUpdateProgressIndication(buffer)
local data = buffer:DataByte()
local message = PlayerInfoProto_pb.ActivityUpateProgressIndication()
message:ParseFromString(data)
LogError("刷新活动数据")
ActivityGiftManager.RefreshActivityProgressData(message)
end
function this.UpdateUserExp(buffer)
@ -767,8 +768,8 @@ function this.PaySuccess(buffer)
PopupTipPanel.ShowTip(tip)
--FirstRechargeManager.RefreshAccumRechargeValue(msg.goodsId)
-- 延时0.5秒刷新。避免sdk支付时商店次数未刷新界面刷新的问题
DynamicActivityManager.curLevel = 0
DynamicActivityManager.Index = 0
--DynamicActivityManager.curLevel = 0
--DynamicActivityManager.Index = 0
Timer.New(function()
Game.GlobalEvent:DispatchEvent(GameEvent.MoneyPay.OnPayResultSuccess, msg.goodsId)
end, 0.5):Start()

View File

@ -0,0 +1,328 @@
require("Base/BasePanel")
GMMingWangPanel = Inherit(BasePanel)
local this=GMMingWangPanel
local prestigeConfigList=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.PrestigeConfig,"Type",2)
local GameSetting = ConfigManager.GetConfig(ConfigName.GameSetting)
local curLv
local curSelectLv
local isEnough --道具是否足够
local isBuy --是否已购买
local storeConfig --商店数据
function this:InitComponent()
this.spLoader = SpriteLoader.New()
this.backBtn=Util.GetGameObject(self.gameObject, "backBtn")
this.grow = Util.GetGameObject(self.gameObject,"Content")
this.tip = Util.GetGameObject(self.grow,"Tip"):GetComponent("Text")
this.icon = Util.GetGameObject(self.grow,"Icon"):GetComponent("Image")
this.name = Util.GetGameObject(self.grow,"Name"):GetComponent("Image")
this.name.sprite=this.spLoader:LoadSprite("gm_mingwang_title")
this.progress = Util.GetGameObject(self.grow,"Progress/Image")
this.value = Util.GetGameObject(self.grow,"Progress/Text"):GetComponent("Text")
this.reward = Util.GetGameObject(self.grow,"Reward")
this.btnLeft = Util.GetGameObject(self.grow,"btnLeft")
this.btnRight = Util.GetGameObject(self.grow,"btnRight")
this.btnGet = Util.GetGameObject(self.grow,"btnGet")
this.price = Util.GetGameObject(self.btnGet,"cost/Text"):GetComponent("Text")
this.cost = Util.GetGameObject(self.btnGet,"cost")
this.btnText = Util.GetGameObject(self.btnGet,"Text")
this.btnRed = Util.GetGameObject(self.btnGet,"red")
this.leftRed = Util.GetGameObject(self.btnLeft,"Red")
this.rightRed = Util.GetGameObject(self.btnRight,"Red")
this.tabGrid=Util.GetGameObject(self.gameObject, "layout/tabScroll/grid")
this.tabBtnPre=Util.GetGameObject(self.gameObject, "layout/tabBtnPre")
this.selectBtn=Util.GetGameObject(self.gameObject, "layout/tabSelectBtn")
this.selectBtnText=Util.GetGameObject(self.gameObject, "layout/tabSelectBtn/Text"):GetComponent("Text")
this.privilegeAddText=Util.GetGameObject(self.gameObject, "layout/privilegeAddScroll/Text"):GetComponent("Text")
for i = 2, #prestigeConfigList do
local tabBtn = newObjToParent(this.tabBtnPre, this.tabGrid)
Util.GetGameObject(tabBtn, "Text"):GetComponent("Text").text=string.format("名望%s",prestigeConfigList[i].Level)
Util.AddClick(tabBtn,function ()
this.TabBtnOnClick(prestigeConfigList[i].Level)
end)
end
this.infoTxt=Util.GetGameObject(self.gameObject, "layout/infoTxt"):GetComponent("Text")
this.infoTxt.text="使用GM额度兑换GM修改器中的礼包、基金、神充等也可获得等额的名望经验兑换免费充值无法获得名望经验"
this.List1 = {}
-- 显示货币
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
end
function this:BindEvent()
Util.AddClick(this.backBtn,function ()
self:ClosePanel()
end)
Util.AddClick(this.exchangeBtn,function ()
UIManager.OpenPanel(UIName.NewShenZunExpExchangePopup)
end)
end
function this:OnOpen(data)
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.ShenZun})
--this.UpdateTopInfo()
end
function this:OnShow()
this.SetGrowGift()
this.TabBtnOnClick(curLv)
end
--添加事件监听(用于子类重写)
function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Activity.UpdateShenzunLv, this.UpdateTopInfo)
Game.GlobalEvent:AddEvent(GameEvent.MoneyPay.OnPayResultSuccess,self.SetGrowGift,self)
end
--移除事件监听(用于子类重写)
function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.UpdateShenzunLv, this.UpdateTopInfo)
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess,self.SetGrowGift,self)
end
function this.UpdateTopInfo()
end
function this.TabBtnOnClick(_privilegeLv)
local _level=_privilegeLv>0 and _privilegeLv or 1
local clickBtn=this.tabGrid.transform:GetChild(_level-1)
this.selectBtn.transform:SetParent(clickBtn)
this.selectBtn.transform.localScale = Vector3.one
this.selectBtn.transform.localPosition = Vector3.zero
this.selectBtnText.text=string.format("名望%s",_level)
this.UpdateLayout(_level)
end
function this.UpdateLayout(_privilegeLv)
curSelectLv=_privilegeLv
local curAddData= PrivilegeManager.GetMingWangAddByLv(_privilegeLv)
local privilegeAddText =""
for _, privilegeInfo in ipairs(curAddData) do
if privilegeInfo.value == ""
or (privilegeInfo.IfFloat == 1 and privilegeInfo.value > 0)
or (privilegeInfo.IfFloat == 2 and privilegeInfo.value ~= 0)
then
local colorStr = "<color=#f46363><size=35>%s</size></color>"
local formatStr
if privilegeInfo.IfFloat == 2 and privilegeInfo.value > 1 then --特权关卡挂机加成百分比
formatStr = string.format(colorStr, (privilegeInfo.value*100-100).."%")
elseif privilegeInfo.IfFloat == 2 and privilegeInfo.value <= 0 then
formatStr = string.format(colorStr, ((privilegeInfo.value+1)*10).."")
else
formatStr = string.format(colorStr, privilegeInfo.value)
end
if privilegeInfo.id == PRIVILEGE_TYPE.HANG_ON_TIME then
-- 挂机时长特权特殊显示处理
privilegeAddText = privilegeAddText.."\n·"..string.format(privilegeInfo.content, string.format(colorStr, privilegeInfo.value + GameSetting[1].AdventureOffline), formatStr)
else
privilegeAddText = privilegeAddText.."\n·"..string.format(privilegeInfo.content, formatStr)
end
end
end
this.privilegeAddText.text=privilegeAddText
end
local growData
--==============================成长礼包部分==========================(rechargeViewNew和EveryDayGiftNew中有完全相同的部分复制过去)
function this.SetGrowGift()
growData = DynamicActivityManager.GetGiftDataByType({{2,95}})
local rechargeNum = BagManager.GetItemCountById(1351) --VipManager.GetChargedNum()--已经充值的金额
table.sort(growData,function (a,b)
return a.data.shopItemData.BuyRule[2] < b.data.shopItemData.BuyRule[2]
end)
LogError("rechargenum=="..rechargeNum)
--计算当前声望等级
if DynamicActivityManager.curLevel == 0 then
for i = 1, #growData do
local lv=growData[i].data.shopItemData.BuyRule[2]
if rechargeNum < DynamicActivityManager.GetMingWangLv(lv) then
if rechargeNum ~= 0 then
LogError("lv======"..lv.." i=="..i)
DynamicActivityManager.curLevel = i
if DynamicActivityManager.Index == 0 then
DynamicActivityManager.Index = DynamicActivityManager.curLevel
end
break
else
DynamicActivityManager.curLevel = 1
DynamicActivityManager.Index = 1
end
end
end
end
--如果所有都没有,说明超范围了
if DynamicActivityManager.curLevel == 0 then
DynamicActivityManager.curLevel = #growData
if DynamicActivityManager.Index == 0 then
DynamicActivityManager.Index = DynamicActivityManager.curLevel
end
end
LogError("DynamicActivityManager.Index=="..DynamicActivityManager.Index)
--Log("当前声望Level:"..tostring(DynamicActivityManager.curLevel).." Index:"..tostring(DynamicActivityManager.Index))
--如果有当前声望数据,就显示,没有就显示上一档位
--local data = not not growData[DynamicActivityManager.Index] and growData[DynamicActivityManager.Index] or growData[DynamicActivityManager.Index-1]
local data=growData[DynamicActivityManager.Index]
curLv=DynamicActivityManager.Index
this.RefreshReward(data)
Util.AddOnceClick(this.btnLeft,function ()
if growData[DynamicActivityManager.Index - 1] then
DynamicActivityManager.Index = DynamicActivityManager.Index - 1
this.RefreshReward(growData[DynamicActivityManager.Index])
this.TabBtnOnClick(DynamicActivityManager.Index)
end
end)
Util.AddOnceClick(this.btnRight,function ()
if growData[DynamicActivityManager.Index + 1] then
DynamicActivityManager.Index = DynamicActivityManager.Index + 1
this.RefreshReward(growData[DynamicActivityManager.Index])
this.TabBtnOnClick(DynamicActivityManager.Index)
end
end)
end
--刷新奖励、按钮显示
function this.RefreshReward(Data)
local rechargeNum = BagManager.GetItemCountById(1351) --VipManager.GetChargedNum()--已经充值的金额
this.btnLeft:SetActive(not not growData[DynamicActivityManager.Index - 1])--左按钮显示
this.btnRight:SetActive(not not growData[DynamicActivityManager.Index + 1])--右按钮显示
-- LogPink(DynamicActivityManager.Index.." 金额:"..tostring(Data.data.shopItemData.BuyRule[2]).." 限购:"..tostring(Data.data.limitNum).." 已购:"..tostring(Data.data.boughtNum).." rechargeNum:"..tostring(rechargeNum))
local text = 1
local num = 0
LogError("#groupdata len=="..#growData)
if DynamicActivityManager.Index < 2 then
num = growData[2].data.shopItemData.BuyRule[2]
elseif DynamicActivityManager.Index + 1 > #growData then
text = #growData
num = growData[#growData].data.shopItemData.BuyRule[2]
else
text = DynamicActivityManager.Index
num = growData[DynamicActivityManager.Index].data.shopItemData.BuyRule[2]
end
num=DynamicActivityManager.GetMingWangLv(num)
local aaa=growData[DynamicActivityManager.curLevel].data.shopItemData.BuyRule[2]
if DynamicActivityManager.curLevel <= 2 then
this.tip.text = string.format("再充值%s元升至名望1",num - rechargeNum)
elseif DynamicActivityManager.curLevel >= #growData and rechargeNum >= DynamicActivityManager.GetMingWangLv(aaa) then
this.tip.text = ""
else
this.tip.text = string.format("再充值%s元升至名望%s",DynamicActivityManager.GetMingWangLv(aaa) - rechargeNum,DynamicActivityManager.curLevel+1)
end
local size = rechargeNum/num
size = size > 1 and 1 or size
-- LogRed(DynamicActivityManager.Index.." #growData:"..tostring(#growData).." text:"..tostring(text))
this.icon.sprite = this.spLoader:LoadSprite("t_tequan_vip"..text)
this.progress:GetComponent("RectTransform").sizeDelta = Vector3.New(483*size,12,0)
this.value.text = string.format("%s/%s",rechargeNum,num)
this.price.text = Data.data.price
this.btnRed:SetActive(false)
local needNum=DynamicActivityManager.GetMingWangLv(Data.data.shopItemData.BuyRule[2])
if Data.data.limitNum - Data.data.boughtNum > 0 then
this.btnText:SetActive(false)
this.cost:SetActive(true)
this.btnGet:GetComponent("Button").interactable = true
Util.SetGray(this.btnGet, false)
LogError("rechargenum=="..rechargeNum.." neednum=="..needNum)
if rechargeNum >= needNum then
this.btnGet:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_slbz_1anniuongse")
if BagManager.GetTotalItemNum(Data.data.costId) >= Data.data.price then
this.btnRed:SetActive(true)
end
else
this.btnGet:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_slbz_1anniuhuangse")
end
else
this.btnText:SetActive(true)
this.cost:SetActive(false)
this.btnGet:GetComponent("Button").interactable = false
Util.SetGray(this.btnGet, true)
end
Util.AddOnceClick(this.btnGet,function ()
-- LogGreen(tostring(Data.data.limitNum).." "..tostring(Data.data.boughtNum))
if Data.data.limitNum - Data.data.boughtNum > 0 then
-- LogYellow(tostring(rechargeNum).." "..tostring(Data.data.shopItemData.BuyRule[2]))
if rechargeNum >= needNum then
-- LogPink(tostring(BagManager.GetItemCountById(Data.data.costId)).." "..tostring(Data.data.price))
if BagManager.GetItemCountById(Data.data.costId) >= Data.data.price then
-- LogBlue(tostring(Data.data.shopItemData.buyType).." "..tostring(Data.data.shopData.id))
ShopManager.RequestBuyShopItem(Data.buyType, Data.data.shopData.id, 1, function()
this.SetGrowGift()
CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.GrowthPackage)
end)
else
NotEnoughPopup:Show(Data.data.costId)
end
else
PopupTipPanel.ShowTip(string.format("名望等级不足,请升至%s级后才可购买",DynamicActivityManager.Index))
end
end
end)
if not this.ItemList then
this.ItemList = {}
end
for i = 1, #this.ItemList do
this.ItemList[i].gameObject:SetActive(false)
end
for i = 1, #Data.data.shows do
if not this.ItemList[i] then
this.ItemList[i] = SubUIManager.Open(SubUIConfig.ItemView,this.reward.transform)
end
this.ItemList[i]:OnOpen(false, {Data.data.shows[i][1],Data.data.shows[i][2],Data.data.shows[i][3]}, 0.9,false,false,false,this.sortingOrder)
this.ItemList[i].gameObject:SetActive(true)
end
--左右按钮红点检测
if growData[DynamicActivityManager.Index - 1] then
for i = DynamicActivityManager.Index - 1, 1,-1 do
local curData = growData[i]
if curData.data.limitNum - curData.data.boughtNum > 0 and
BagManager.GetTotalItemNum(curData.data.costId) >= curData.data.price and
rechargeNum >=DynamicActivityManager.GetMingWangLv(curData.data.shopItemData.BuyRule[2]) then
this.leftRed:SetActive(true)
break
else
this.leftRed:SetActive(false)
end
end
end
if growData[DynamicActivityManager.Index + 1] then
for i = DynamicActivityManager.Index + 1, 20 do
local curData = growData[i]
if curData and curData.data.limitNum - curData.data.boughtNum > 0 and
BagManager.GetTotalItemNum(curData.data.costId) >= curData.data.price and
rechargeNum >= DynamicActivityManager.GetMingWangLv(curData.data.shopItemData.BuyRule[2]) then
this.rightRed:SetActive(true)
break
else
this.rightRed:SetActive(false)
end
end
end
end
--界面关闭时调用(用于子类重写)
function this:OnClose()
end
function this:OnDestroy()
this.spLoader:Destroy()
for k,v in pairs(self.ItemList) do
SubUIManager.Close(v)
end
self.ItemList = {}
end
return this

View File

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

View File

@ -34,6 +34,8 @@ function EveryDayGiftNew:InitComponent()
self.grow = Util.GetGameObject(self.newPage,"growPack/Content")
self.tip = Util.GetGameObject(self.grow,"Tip"):GetComponent("Text")
self.icon = Util.GetGameObject(self.grow,"Icon"):GetComponent("Image")
self.name = Util.GetGameObject(self.grow,"Name"):GetComponent("Image")
self.name.sprite=self.spLoader:LoadSprite("gm_mingwang_title")
self.progress = Util.GetGameObject(self.grow,"Progress/Image")
self.value = Util.GetGameObject(self.grow,"Progress/Text"):GetComponent("Text")
self.reward = Util.GetGameObject(self.grow,"Reward")
@ -179,15 +181,15 @@ end
--==============================成长礼包部分==========================(rechargeViewNew和EveryDayGiftNew中有完全相同的部分复制过去)
function EveryDayGiftNew:SetGrowGift()
growData = DynamicActivityManager.GetGiftDataByType({{2,20}})
local rechargeNum = VipManager.GetChargedNum()--已经充值的金额
growData = DynamicActivityManager.GetGiftDataByType({{2,95}})
local rechargeNum = BagManager.GetItemCountById(1351) --VipManager.GetChargedNum()--已经充值的金额
table.sort(growData,function (a,b)
return a.data.shopItemData.BuyRule[2] < b.data.shopItemData.BuyRule[2]
end)
--计算当前声望等级
if DynamicActivityManager.curLevel == 0 then
for i = 1, #growData do
if rechargeNum < growData[i].data.shopItemData.BuyRule[2] then
if rechargeNum < DynamicActivityManager.GetMingWangLv(growData[i].data.shopItemData.BuyRule[2]) then
if rechargeNum ~= 0 then
DynamicActivityManager.curLevel = i
if DynamicActivityManager.Index == 0 then
@ -211,7 +213,8 @@ function EveryDayGiftNew:SetGrowGift()
Log("当前声望Level:"..tostring(DynamicActivityManager.curLevel).." Index:"..tostring(DynamicActivityManager.Index))
--如果有当前声望数据,就显示,没有就显示上一档位
local data = not not growData[DynamicActivityManager.Index] and growData[DynamicActivityManager.Index] or growData[DynamicActivityManager.Index-1]
-- local data = not not growData[DynamicActivityManager.Index] and growData[DynamicActivityManager.Index] or growData[DynamicActivityManager.Index-1]
local data=growData[DynamicActivityManager.Index]
self:RefreshReward(data)
Util.AddOnceClick(self.btnLeft,function ()
@ -229,27 +232,29 @@ function EveryDayGiftNew:SetGrowGift()
end
--刷新奖励、按钮显示
function EveryDayGiftNew:RefreshReward(Data)
local rechargeNum = VipManager.GetChargedNum()--已经充值的金额
local rechargeNum =BagManager.GetItemCountById(1351) --VipManager.GetChargedNum()--已经充值的金额
self.btnLeft:SetActive(not not growData[DynamicActivityManager.Index - 1])--左按钮显示
self.btnRight:SetActive(not not growData[DynamicActivityManager.Index + 1])--右按钮显示
-- LogPink(DynamicActivityManager.Index.." 金额:"..tostring(Data.data.shopItemData.BuyRule[2]).." 限购:"..tostring(Data.data.limitNum).." 已购:"..tostring(Data.data.boughtNum).." rechargeNum:"..tostring(rechargeNum))
local text = 0
local text = 1
local num = 0
if DynamicActivityManager.Index < 2 then
num = growData[2].data.shopItemData.BuyRule[2]
elseif DynamicActivityManager.Index + 1 > #growData then
text = #growData-1
text = #growData
num = growData[#growData].data.shopItemData.BuyRule[2]
else
text = DynamicActivityManager.Index-1
text = DynamicActivityManager.Index
num = growData[DynamicActivityManager.Index].data.shopItemData.BuyRule[2]
end
num=DynamicActivityManager.GetMingWangLv(num)
local aaa=growData[DynamicActivityManager.curLevel].data.shopItemData.BuyRule[2]
if DynamicActivityManager.curLevel <= 2 then
self.tip.text = string.format("再充值%s元升至名望1",growData[2].data.shopItemData.BuyRule[2] - rechargeNum)
elseif DynamicActivityManager.curLevel >= #growData and rechargeNum >= growData[DynamicActivityManager.curLevel].data.shopItemData.BuyRule[2] then
self.tip.text = string.format("再充值%s元升至名望1",num - rechargeNum)
elseif DynamicActivityManager.curLevel >= #growData and rechargeNum >= DynamicActivityManager.GetMingWangLv(aaa) then
self.tip.text = ""
else
self.tip.text = string.format("再充值%s元升至名望%s",growData[DynamicActivityManager.curLevel].data.shopItemData.BuyRule[2] - rechargeNum,DynamicActivityManager.curLevel-1)
self.tip.text = string.format("再充值%s元升至名望%s",DynamicActivityManager.GetMingWangLv(aaa) - rechargeNum,DynamicActivityManager.curLevel+1)
end
local size = rechargeNum/num
@ -260,13 +265,13 @@ function EveryDayGiftNew:RefreshReward(Data)
self.value.text = string.format("%s/%s",rechargeNum,num)
self.price.text = Data.data.price
self.btnRed:SetActive(false)
local needNum=DynamicActivityManager.GetMingWangLv(Data.data.shopItemData.BuyRule[2])
if Data.data.limitNum - Data.data.boughtNum > 0 then
self.btnText:SetActive(false)
self.cost:SetActive(true)
self.btnGet:GetComponent("Button").interactable = true
Util.SetGray(self.btnGet, false)
if rechargeNum >= Data.data.shopItemData.BuyRule[2] then
if rechargeNum >= needNum then
self.btnGet:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_slbz_1anniuongse")
if BagManager.GetTotalItemNum(Data.data.costId) >= Data.data.price then
self.btnRed:SetActive(true)
@ -285,7 +290,7 @@ function EveryDayGiftNew:RefreshReward(Data)
-- LogGreen(tostring(Data.data.limitNum).." "..tostring(Data.data.boughtNum))
if Data.data.limitNum - Data.data.boughtNum > 0 then
-- LogYellow(tostring(rechargeNum).." "..tostring(Data.data.shopItemData.BuyRule[2]))
if rechargeNum >= Data.data.shopItemData.BuyRule[2] then
if rechargeNum >= needNum then
-- LogPink(tostring(BagManager.GetItemCountById(Data.data.costId)).." "..tostring(Data.data.price))
if BagManager.GetItemCountById(Data.data.costId) >= Data.data.price then
-- LogBlue(tostring(Data.data.shopItemData.buyType).." "..tostring(Data.data.shopData.id))
@ -298,7 +303,7 @@ function EveryDayGiftNew:RefreshReward(Data)
NotEnoughPopup:Show(Data.data.costId)
end
else
PopupTipPanel.ShowTip(string.format("名望等级不足,请升至%s级后才可购买",DynamicActivityManager.Index-1))
PopupTipPanel.ShowTip(string.format("名望等级不足,请升至%s级后才可购买",DynamicActivityManager.Index))
end
end
end)
@ -324,7 +329,7 @@ function EveryDayGiftNew:RefreshReward(Data)
local curData = growData[i]
if curData.data.limitNum - curData.data.boughtNum > 0 and
BagManager.GetTotalItemNum(curData.data.costId) >= curData.data.price and
rechargeNum >= curData.data.shopItemData.BuyRule[2] then
rechargeNum >=DynamicActivityManager.GetMingWangLv(curData.data.shopItemData.BuyRule[2]) then
self.leftRed:SetActive(true)
break
else
@ -333,11 +338,11 @@ function EveryDayGiftNew:RefreshReward(Data)
end
end
if growData[DynamicActivityManager.Index + 1] then
for i = DynamicActivityManager.Index + 1, 14 do
for i = DynamicActivityManager.Index + 1, 20 do
local curData = growData[i]
if curData and curData.data.limitNum - curData.data.boughtNum > 0 and
BagManager.GetTotalItemNum(curData.data.costId) >= curData.data.price and
rechargeNum >= curData.data.shopItemData.BuyRule[2] then
rechargeNum >=DynamicActivityManager.GetMingWangLv(curData.data.shopItemData.BuyRule[2]) then
self.rightRed:SetActive(true)
break
else

View File

@ -31,6 +31,8 @@ function RechargeViewNew:InitComponent()
self.grow = Util.GetGameObject(self.gameObject,"growPack/Content")
self.tip = Util.GetGameObject(self.grow,"Tip"):GetComponent("Text")
self.icon = Util.GetGameObject(self.grow,"Icon"):GetComponent("Image")
self.name = Util.GetGameObject(self.grow,"Name"):GetComponent("Image")
self.name.sprite=self.spLoader:LoadSprite("gm_mingwang_title")
self.progress = Util.GetGameObject(self.grow,"Progress/Image")
self.value = Util.GetGameObject(self.grow,"Progress/Text"):GetComponent("Text")
self.reward = Util.GetGameObject(self.grow,"Reward")
@ -70,15 +72,15 @@ end
--==============================成长礼包部分==========================(rechargeViewNew和EveryDayGiftNew中有完全相同的部分复制过去)
function RechargeViewNew:SetGrowGift()
growData = DynamicActivityManager.GetGiftDataByType({{2,20}})
local rechargeNum = VipManager.GetChargedNum()--已经充值的金额
growData = DynamicActivityManager.GetGiftDataByType({{2,95}})
local rechargeNum =BagManager.GetItemCountById(1351) --VipManager.GetChargedNum()--已经充值的金额
table.sort(growData,function (a,b)
return a.data.shopItemData.BuyRule[2] < b.data.shopItemData.BuyRule[2]
end)
--计算当前声望等级
if DynamicActivityManager.curLevel == 0 then
for i = 1, #growData do
if rechargeNum < growData[i].data.shopItemData.BuyRule[2] then
if rechargeNum < DynamicActivityManager.GetMingWangLv(growData[i].data.shopItemData.BuyRule[2]) then
if rechargeNum ~= 0 then
DynamicActivityManager.curLevel = i
if DynamicActivityManager.Index == 0 then
@ -102,7 +104,8 @@ function RechargeViewNew:SetGrowGift()
Log("当前声望Level:"..tostring(DynamicActivityManager.curLevel).." Index:"..tostring(DynamicActivityManager.Index))
--如果有当前声望数据,就显示,没有就显示上一档位
local data = not not growData[DynamicActivityManager.Index] and growData[DynamicActivityManager.Index] or growData[DynamicActivityManager.Index-1]
--local data = not not growData[DynamicActivityManager.Index] and growData[DynamicActivityManager.Index] or growData[DynamicActivityManager.Index-1]
local data=growData[DynamicActivityManager.Index]
self:RefreshReward(data)
Util.AddOnceClick(self.btnLeft,function ()
@ -120,27 +123,29 @@ function RechargeViewNew:SetGrowGift()
end
--刷新奖励、按钮显示
function RechargeViewNew:RefreshReward(Data)
local rechargeNum = VipManager.GetChargedNum()--已经充值的金额
local rechargeNum =BagManager.GetItemCountById(1351) --VipManager.GetChargedNum()--已经充值的金额
self.btnLeft:SetActive(not not growData[DynamicActivityManager.Index - 1])--左按钮显示
self.btnRight:SetActive(not not growData[DynamicActivityManager.Index + 1])--右按钮显示
-- LogPink(DynamicActivityManager.Index.." 金额:"..tostring(Data.data.shopItemData.BuyRule[2]).." 限购:"..tostring(Data.data.limitNum).." 已购:"..tostring(Data.data.boughtNum).." rechargeNum:"..tostring(rechargeNum))
local text = 0
local text = 1
local num = 0
if DynamicActivityManager.Index < 2 then
num = growData[2].data.shopItemData.BuyRule[2]
elseif DynamicActivityManager.Index + 1 > #growData then
text = #growData-1
text = #growData
num = growData[#growData].data.shopItemData.BuyRule[2]
else
text = DynamicActivityManager.Index-1
text = DynamicActivityManager.Index
num = growData[DynamicActivityManager.Index].data.shopItemData.BuyRule[2]
end
num=DynamicActivityManager.GetMingWangLv(num)
local aaa=growData[DynamicActivityManager.curLevel].data.shopItemData.BuyRule[2]
if DynamicActivityManager.curLevel <= 2 then
self.tip.text = string.format("再充值%s元升至名望1",growData[2].data.shopItemData.BuyRule[2] - rechargeNum)
elseif DynamicActivityManager.curLevel + 1 >= #growData and rechargeNum >= growData[DynamicActivityManager.curLevel].data.shopItemData.BuyRule[2] then
self.tip.text = string.format("再充值%s元升至名望1",num - rechargeNum)
elseif DynamicActivityManager.curLevel + 1 >= #growData and rechargeNum >= DynamicActivityManager.GetMingWangLv(aaa) then
self.tip.text = ""
else
self.tip.text = string.format("再充值%s元升至名望%s",growData[DynamicActivityManager.curLevel].data.shopItemData.BuyRule[2] - rechargeNum,DynamicActivityManager.curLevel-1)
self.tip.text = string.format("再充值%s元升至名望%s",DynamicActivityManager.GetMingWangLv(aaa) - rechargeNum,DynamicActivityManager.curLevel+1)
end
local size = rechargeNum/num
@ -150,13 +155,13 @@ function RechargeViewNew:RefreshReward(Data)
self.value.text = string.format("%s/%s",rechargeNum,num)
self.price.text = Data.data.price
self.btnRed:SetActive(false)
local needNum=DynamicActivityManager.GetMingWangLv(Data.data.shopItemData.BuyRule[2])
if Data.data.limitNum - Data.data.boughtNum > 0 then
self.btnText:SetActive(false)
self.cost:SetActive(true)
self.btnGet:GetComponent("Button").interactable = true
Util.SetGray(self.btnGet, false)
if rechargeNum >= Data.data.shopItemData.BuyRule[2] then
if rechargeNum >= needNum then
self.btnGet:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_slbz_1anniuongse")
if BagManager.GetTotalItemNum(Data.data.costId) >= Data.data.price then
self.btnRed:SetActive(true)
@ -175,7 +180,7 @@ function RechargeViewNew:RefreshReward(Data)
-- LogGreen(tostring(Data.data.limitNum).." "..tostring(Data.data.boughtNum))
if Data.data.limitNum - Data.data.boughtNum > 0 then
-- LogYellow(tostring(rechargeNum).." "..tostring(Data.data.shopItemData.BuyRule[2]))
if rechargeNum >= Data.data.shopItemData.BuyRule[2] then
if rechargeNum >= needNum then
-- LogPink(tostring(BagManager.GetItemCountById(Data.data.costId)).." "..tostring(Data.data.shopItemData.BuyRule[2]))
if BagManager.GetItemCountById(Data.data.costId) >= Data.data.price then
-- LogBlue(tostring(Data.data.shopItemData.buyType).." "..tostring(Data.data.shopData.id))
@ -188,7 +193,7 @@ function RechargeViewNew:RefreshReward(Data)
NotEnoughPopup:Show(Data.data.costId)
end
else
PopupTipPanel.ShowTip(string.format("名望等级不足,请升至%s级后才可购买",DynamicActivityManager.Index-1))
PopupTipPanel.ShowTip(string.format("名望等级不足,请升至%s级后才可购买",DynamicActivityManager.Index))
end
end
end)
@ -214,7 +219,7 @@ function RechargeViewNew:RefreshReward(Data)
local curData = growData[i]
if curData.data.limitNum - curData.data.boughtNum > 0 and
BagManager.GetTotalItemNum(curData.data.costId) >= curData.data.price and
rechargeNum >= curData.data.shopItemData.BuyRule[2] then
rechargeNum >=DynamicActivityManager.GetMingWangLv(curData.data.shopItemData.BuyRule[2]) then
self.leftRed:SetActive(true)
break
else
@ -223,11 +228,11 @@ function RechargeViewNew:RefreshReward(Data)
end
end
if growData[DynamicActivityManager.Index + 1] then
for i = DynamicActivityManager.Index + 1, 14 do
for i = DynamicActivityManager.Index + 1, 20 do
local curData = growData[i]
if curData and curData.data.limitNum - curData.data.boughtNum > 0 and
BagManager.GetTotalItemNum(curData.data.costId) >= curData.data.price and
rechargeNum >= curData.data.shopItemData.BuyRule[2] then
rechargeNum >= DynamicActivityManager.GetMingWangLv(curData.data.shopItemData.BuyRule[2]) then
self.rightRed:SetActive(true)
break
else