Merge branch 'tcx_xiyou_yueNan' of http://192.168.1.21:3000/root/miduo_client into tcx_xiyou_yueNan

tcx_xiyou_yueNan
zhangjiannan 2025-06-23 10:22:34 +08:00
commit 240c6b6010
16 changed files with 459 additions and 91 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: c51f033d55f9baa44aa4611b996de03c
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: 56
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: bc12353e397b8b047af174e6dbb37599
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

View File

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 5a216be4cd1434942a0758ed45469ee1
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: 56
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: 279c2d8c92187e34d9b7badacb6542ad
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,85 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6200022057802975245
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2738833208873261131}
- component: {fileID: 6943811854337008305}
- component: {fileID: 4612572763175474038}
m_Layer: 0
m_Name: c_dj_0008_new
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2738833208873261131
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6200022057802975245}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
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: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6943811854337008305
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6200022057802975245}
m_CullTransparentMesh: 0
--- !u!114 &4612572763175474038
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6200022057802975245}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d85b887af7e6c3f45a2e2d2920d641bc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 2100000, guid: b66cf7a186d13054989b33a5c90044e4, type: 2}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
skeletonDataAsset: {fileID: 11400000, guid: f9ad97fc8479e2d4eba02aafe2ba6a69, type: 2}
initialSkinName: default
initialFlipX: 0
initialFlipY: 0
startingAnimation: idle
startingLoop: 0
timeScale: 1
freeze: 0
unscaledTime: 0
meshGenerator:
settings:
useClipping: 1
zSpacing: 0
pmaVertexColors: 1
tintBlack: 0
calculateTangents: 0
addNormals: 0
immutableTriangles: 0

View File

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

View File

@ -207,6 +207,7 @@ function this.PageTabAdapter(tab, index, status)
if not tabs[index].RpType or tabs[index].RpType < 1 then
redpot.gameObject:SetActive(false)
else
--LogError("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv================="..tostring(tabs[index].RpType))
BindRedPointObject(tabs[index].RpType, redpot)
redPointTypeList[tabs[index].RpType] = redpot
end

View File

@ -386,6 +386,7 @@ function this.RefreshUpdateIndication(buffer)
CheckRedPointStatus(RedPointType.LikeabilityRed)
CheckRedPointStatus(RedPointType.SecretTer_HaveFreeTime)
CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.Jiaozhufabao)
CheckRedPointStatus(RedPointType.GrowthPackage)
CheckRedPointStatus(RedPointType.Guild_Fete)

View File

@ -338,6 +338,7 @@ function GiftPackPage:RefreshFreeData(type)
local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FREE_GIFT, freeData[1].id, 1)
CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.Jiaozhufabao)
Util.AddOnceClick(self.freeBtn, function()
if isCanBuy then
self:BuyAction(costId, finalNum, SHOP_TYPE.FREE_GIFT, freeData[1].id, type)
@ -504,6 +505,7 @@ function GiftPackPage:RefreshShowData(item, data, type, DataTypeIndex)
OperatingManager.RefreshGiftGoodsBuyTimes(GoodsTypeDef.DirectPurchaseGift, data.goodsId)
self:RefreshGiftData(type)
CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.Jiaozhufabao)
end)
end
end

View File

@ -424,6 +424,8 @@ function this.RegisterRedCheckFunc()
RPData:AddCheckFunc(RedPointType.GrowthGift, OperatingManager.GetGrowthRedPointState)
RPData:AddCheckFunc(RedPointType.FirstRecharge, FirstRechargeManager.GetFirstRechargeRedPointStatus)
RPData:AddCheckFunc(RedPointType.DailyGift, ShopManager.HaveFreeBaby)
RPData:AddCheckFunc(RedPointType.Jiaozhufabao, ShopManager.CheckRedPointJiaozhufabao)
--RPData:AddCheckFunc(RedPointType.Jiaozhufabao, ShopManager.CheckRedPointMeiRiTeHui)
RPData:AddCheckFunc(RedPointType.GrowthPackage, VipManager.CheckGrowthPackagePointStatus)--成长礼包
--工坊

View File

@ -361,6 +361,7 @@ function EveryDayGift:RefreshFreeData()
ShopManager.RequestBuyShopItem(SHOP_TYPE.FREE_GIFT, freeData[1].id, 1, function()
self:RefreshFreeData()
CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.Jiaozhufabao)
CheckRedPointStatus(RedPointType.GrowthPackage)
end)
end

View File

@ -103,6 +103,7 @@ end
--界面打开时调用(用于子类重写)
function EveryDayGiftNew:OnOpen(_activityConfig, _index, parent)
self.actConfig = _activityConfig
--LogError("sdfasdfasdfasdfasdfasdf================================="..tostring(_activityConfig.Id))
self.pageIndex = _index
self.parent = parent
self.gameObject.name = "EveryDayGiftNew" .. self.actConfig.Id
@ -310,6 +311,7 @@ function EveryDayGiftNew:RefreshReward(Data)
ShopManager.RequestBuyShopItem(Data.buyType, Data.data.shopData.id, 1, function()
self:SetGrowGift()
CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.Jiaozhufabao)
CheckRedPointStatus(RedPointType.GrowthPackage)
end)
else

View File

@ -162,6 +162,7 @@ function GiftPre:BindEvent()
PayManager.Pay(self.data.data.shopData.goodsId, function(id)
FirstRechargeManager.RefreshAccumRechargeValue(self.data.data.shopData.goodsId)
CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.Jiaozhufabao)
CheckRedPointStatus(RedPointType.WeekGiftPage)
CheckRedPointStatus(RedPointType.MonthGiftPage)
CheckRedPointStatus(RedPointType.GrowthPackage)
@ -186,6 +187,7 @@ function GiftPre:BuyAction(costId, costNum, shopType, itemId)
self.isCanBuy = 0
self.parent:RefreshData(nil, false, false)
CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.Jiaozhufabao)
CheckRedPointStatus(RedPointType.GrowthPackage)
if shopType == 20 and (itemId == 1107 or itemId == 1110 or itemId == 1111 or itemId == 1108) then

View File

@ -197,6 +197,7 @@ function RechargeViewNew:RefreshReward(Data)
ShopManager.RequestBuyShopItem(Data.buyType, Data.data.shopData.id, 1, function()
self:SetGrowGift()
CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.Jiaozhufabao)
CheckRedPointStatus(RedPointType.GrowthPackage)
end)
else

View File

@ -12,9 +12,9 @@ this._CountDownTimer = nil
this._IsRefresh = 0
this._RefreshShopList = {}
this.selectIndex = {shopType = 0,storeId = {}} --跳转到哪个位置
this.selectIndex2 = {shopType = 0,storeId = {}} --哪个位置需要显示特效
function this.SetSelectIndex(shopType,storeId,b)
this.selectIndex = { shopType = 0, storeId = {} } --跳转到哪个位置
this.selectIndex2 = { shopType = 0, storeId = {} } --哪个位置需要显示特效
function this.SetSelectIndex(shopType, storeId, b)
this.selectIndex.shopType = shopType
this.selectIndex.storeId = storeId
if b and b == 1 then
@ -32,7 +32,7 @@ function this.Initialize()
this._CountDownTimer = Timer.New(this.TimeUpdate, 1, -1, true)
this._CountDownTimer:Start()
end
this.isOpenNoviceGift=false --默认第一次登陆未打开
this.isOpenNoviceGift = false --默认第一次登陆未打开
-- 公会数据改变刷新公会商店排序
Game.GlobalEvent:AddEvent(GameEvent.Guild.DataUpdate, function()
@ -55,7 +55,6 @@ function this.InitData(func)
this.RequestAllShopData(func)
end
--- 重新获取商店数据
function this.RequestAllShopData(func)
Log("重新获取商店数据")
@ -71,7 +70,7 @@ function this.ReceiveShopData(msg)
for _, data in ipairs(msg.storeInfo) do
local storeInfo = ConfigManager.TryGetConfigData(ConfigName.StoreTypeConfig, data.id)
if not storeInfo then
LogError("StoreTypeConfig not find Id:"..data.id)
LogError("StoreTypeConfig not find Id:" .. data.id)
else
table.insert(this.allShopData, data)
end
@ -108,12 +107,12 @@ function this.UpdateShopData(msg)
-- end
-- end
--else
for index, olddata in ipairs(this.allShopData) do
if olddata.id == newdata.id then
_index = index
break
end
for index, olddata in ipairs(this.allShopData) do
if olddata.id == newdata.id then
_index = index
break
end
end
--end
if _index then
@ -121,7 +120,7 @@ function this.UpdateShopData(msg)
else
local storeInfo = ConfigManager.TryGetConfigData(ConfigName.StoreTypeConfig, newdata.id)
if not storeInfo then
LogError("StoreTypeConfig not find Id:"..newdata.id)
LogError("StoreTypeConfig not find Id:" .. newdata.id)
else
table.insert(this.allShopData, newdata)
end
@ -139,14 +138,10 @@ function this.UpdateShopData(msg)
this.CheckShopRefreshTime()
-- 更新事件
Game.GlobalEvent:DispatchEvent(GameEvent.Shop.OnShopInfoChange)
end
--- 请求购买物品 isShowReward 没有弹恭喜获得 ,有 == 0 不弹
function this.RequestBuyShopItem(shopType, shopItemId, num, func,isShowReward)
function this.RequestBuyShopItem(shopType, shopItemId, num, func, isShowReward)
if not shopType or not shopItemId or not num then
return
end
@ -194,10 +189,10 @@ function this.RequestBuyShopItem(shopType, shopItemId, num, func,isShowReward)
NetManager.RequestBuyShopItem(shopId, shopItemId, num, function(msg)
-- 显示掉落
if msg.drop.itemlist and #msg.drop.itemlist > 0 or
msg.drop.equipId and #msg.drop.equipId > 0 or
msg.drop.Hero and #msg.drop.Hero > 0 or
msg.drop.soulEquip and #msg.drop.soulEquip > 0 or
msg.drop.pokemon ~= nil and #msg.drop.pokemon > 0 --msg.drop.especialEquipId and #msg.drop.especialEquipId > 0
msg.drop.equipId and #msg.drop.equipId > 0 or
msg.drop.Hero and #msg.drop.Hero > 0 or
msg.drop.soulEquip and #msg.drop.soulEquip > 0 or
msg.drop.pokemon ~= nil and #msg.drop.pokemon > 0 --msg.drop.especialEquipId and #msg.drop.especialEquipId > 0
then
if isShowReward and isShowReward == 0 then
else
@ -225,27 +220,25 @@ function this.RequestBuyShopItem(shopType, shopItemId, num, func,isShowReward)
this.SortItemList(shopType)
-- 更新事件
Game.GlobalEvent:DispatchEvent(GameEvent.Shop.OnShopInfoChange,false,false,false)
Game.GlobalEvent:DispatchEvent(GameEvent.Shop.OnShopInfoChange, false, false, false)
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnRefreshNextDayData)
end)
end
-- 通过商店ID购买商品
function this.RequestBuyItemByShopId(shopId, shopItemId, num, func)
if not shopId or not shopItemId or not num then
return
end
NetManager.RequestBuyShopItem(shopId, shopItemId, num, function(msg)
-- 显示掉落
if msg.drop.itemlist and #msg.drop.itemlist > 0 or
msg.drop.equipId and #msg.drop.equipId > 0 or
msg.drop.Hero and #msg.drop.Hero > 0 or
msg.drop.soulEquip and #msg.drop.soulEquip > 0-- or
-- msg.drop.especialEquipId and #msg.drop.especialEquipId > 0
msg.drop.equipId and #msg.drop.equipId > 0 or
msg.drop.Hero and #msg.drop.Hero > 0 or
msg.drop.soulEquip and #msg.drop.soulEquip > 0 -- or
-- msg.drop.especialEquipId and #msg.drop.especialEquipId > 0
then
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1)
end
@ -273,7 +266,6 @@ function this.RequestBuyItemByShopId(shopId, shopItemId, num, func)
end)
end
-- 请求刷新商店数据
function this.RequestRefreshShop(shopType, isAuto, func)
if not shopType or isAuto == nil then
@ -363,6 +355,7 @@ function ShopManager.GetMainShopPageList()
end)
return _MainShopPages
end
--- 获取商店主界面单个页签要显示的所有商店
function ShopManager.GetMainPageShopTypeList(page)
-- 去重
@ -389,11 +382,10 @@ end
function ShopManager.GetShopPageByShopType(shopType)
-- 去重
local shopTypeData = ConfigManager.GetConfigDataByKey(ConfigName.StoreTypeConfig, "StoreType", shopType)
assert(shopTypeData, Language[12860]..shopType)
assert(shopTypeData, Language[12860] .. shopType)
return shopTypeData.Pages
end
-- 刷新商店物品列表排序
function this.SortItemList(shopType)
-- 试炼副本商店不按sort字段排序
@ -403,7 +395,7 @@ function this.SortItemList(shopType)
for _, v in ipairs(this.allShopData) do
local storeInfo = ConfigManager.TryGetConfigData(ConfigName.StoreTypeConfig, v.id)
if not storeInfo then
LogError("StoreTypeConfig not find Id:"..v.id)
LogError("StoreTypeConfig not find Id:" .. v.id)
else
-- shopType不存在时全部刷新否则按shoptype刷新
if not shopType or storeInfo.StoreType == shopType then
@ -431,7 +423,7 @@ function this.SortItemList(shopType)
-- 按sort排序
return aInfo.Sort < bInfo.Sort
end)
else--是试炼商店
else --是试炼商店
table.sort(v.storeItem, function(a, b)
local aId = a.id % _StoreItemIdFilter
local bId = b.id % _StoreItemIdFilter
@ -466,12 +458,13 @@ function this.GetShopDataByType(shopType)
--LogError("shopData len================="..#shopData)
return shopData
end
-- 通过商店type获取商店数据
function this.GetShopDataByTypeAndFuncType(shopType,fType)
function this.GetShopDataByTypeAndFuncType(shopType, fType)
local shopData = nil
for _, v in ipairs(this.allShopData) do
local shopInfo = this.GetShopInfo(v.id)
if shopInfo and shopInfo.StoreType == shopType and shopInfo.FunctionType ==fType then
if shopInfo and shopInfo.StoreType == shopType and shopInfo.FunctionType == fType then
shopData = v
break
end
@ -479,6 +472,7 @@ function this.GetShopDataByTypeAndFuncType(shopType,fType)
--assert(shopData, "未找到商店数据,请检查数据表及后端数据,商店类型 == "..shopType)
return shopData
end
-- 通过商店id获取商店数据
function this.GetShopDataByShopId(shopId)
local shopData = nil
@ -504,8 +498,6 @@ function this.GetAllShopDataByShopType(shopType)
return list
end
-- 通过商店id获取商店静态表数据
function this.GetShopInfo(shopId)
return ConfigManager.GetConfigData(ConfigName.StoreTypeConfig, shopId)
@ -519,11 +511,11 @@ function this.GetShopInfoByType(shopType)
return ConfigManager.GetConfigDataByKey(ConfigName.StoreTypeConfig, "StoreType", shopType)
end
-- 获取商品信息
function this.GetShopItemInfo(id)
return ConfigManager.GetConfigData(ConfigName.StoreConfig, id % _StoreItemIdFilter)
end
-- 获取商品中包含的物品物品数量要判断是否有玩家等级和vip等级加成
function ShopManager.GetShopItemGoodsInfo(id)
local shopItemInfo = this.GetShopItemInfo(id)
@ -535,8 +527,9 @@ function ShopManager.GetShopItemGoodsInfo(id)
for _, exAdd in ipairs(shopItemInfo.ExtraAdd) do
local exType, exValue = exAdd[1], exAdd[2]
if exType == 1 then
local playerLevelExAdd = ConfigManager.GetConfigData(ConfigName.PlayerLevelConfig, PlayerManager.level).ExtraAdd
addValue = addValue + (playerLevelExAdd/10000)
local playerLevelExAdd = ConfigManager.GetConfigData(ConfigName.PlayerLevelConfig, PlayerManager.level)
.ExtraAdd
addValue = addValue + (playerLevelExAdd / 10000)
elseif exType == 2 then
vipAdd = PrivilegeManager.GetPrivilegeNumber(exValue)
addValue = addValue + vipAdd
@ -547,7 +540,7 @@ function ShopManager.GetShopItemGoodsInfo(id)
local id = g[1]
local num = g[2]
num = num * (1 + addValue)
table.insert(goods, {id, num})
table.insert(goods, { id, num })
end
return goods, addValue, vipAdd
end
@ -564,7 +557,7 @@ function this.GetShopItemData(shopType, itemId)
itemData = v
end
end
assert(itemData, Language[12861]..itemId)
assert(itemData, Language[12861] .. itemId)
return itemData
end
@ -583,12 +576,13 @@ function this.IsPageActive(page)
end
return false
end
-- 判断商店是否是激活状态
function ShopManager.IsActive(shopType)
-- 获取数据
local shopData = this.GetShopDataByType(shopType)
if not shopData then
return false
return false
end
-- 判断类型
local shopInfo = this.GetShopInfo(shopData.id)
@ -639,13 +633,13 @@ function ShopManager.IsActive(shopType)
return false
end
-- 获取最大刷新次数
-- -2 不支持手动刷新
-- 获取最大刷新次数
-- -2 不支持手动刷新
-- -1 无限制次数
function this.GetMaxRefreshCount(shopType)
-- 判断是否开启手动刷新
local shopInfo = this.GetShopInfoByType(shopType)
if shopInfo.IfManualRefresh[1] ~= 0 then -- 自动恢复次数的刷新类型
if shopInfo.IfManualRefresh[1] ~= 0 then -- 自动恢复次数的刷新类型
return shopInfo.IfManualRefresh[1]
elseif shopInfo.IfManualRefresh[1] == 0 and shopInfo.IfManualRefresh[2] == 0 then
return -2
@ -662,12 +656,11 @@ end
-- 获取商店剩余刷新次数 -2 不支持手动刷新 -1 无限制次数
function this.GetShopLeftRefreshCount(shopType)
local isAutoRecover, leftCount = this.IsAutoRecoverCount(shopType)
if isAutoRecover then
return leftCount
end
-- 获取最大刷新次数
local maxRefreshCount = this.GetMaxRefreshCount(shopType)
if maxRefreshCount < 0 then
@ -683,7 +676,7 @@ end
function this.IsAutoRecoverCount(shopType)
-- 判断是否是自动恢复免费次数的类型
local shopInfo = this.GetShopInfoByType(shopType)
if shopInfo.IfManualRefresh[1] == 0 then -- 自动恢复次数的刷新类型
if shopInfo.IfManualRefresh[1] == 0 then -- 自动恢复次数的刷新类型
return false
end
-- 计算剩余免费次数
@ -692,14 +685,14 @@ 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(math.ceil(curTimeStamp - lastRefreshTime)/refreshTime))
local leftCount = math.min(maxTime, math.floor(math.ceil(curTimeStamp - lastRefreshTime) / refreshTime))
-- 如果没有免费次数了,但是有特权刷新次数
if leftCount <= 0 and shopInfo.RefreshPrivilege ~= 0 then
return false
end
--
--
return true, leftCount
end
@ -761,11 +754,11 @@ function this.CountShopRefreshLeftTime(shopId)
--local shopData = this.GetShopDataByType(shopType)
if #shopInfo.RefreshType == 0 or shopInfo.RefreshType[1] == 1 then
return -1
--- 固定时间点刷新
--- 固定时间点刷新
elseif shopInfo.RefreshType[1] == 2 then
local shopData = this.GetShopDataByType(shopType)
local lastRefreshTime = shopData.lastRefreshTime / 1000
local N_TimeStamp = Today_N_OClockTimeStamp(shopInfo.RefreshType[2])
-- 距离上次刷新时间大于一天
if N_TimeStamp - lastRefreshTime > 86400 then
@ -794,26 +787,25 @@ function this.CountShopRefreshLeftTime(shopId)
-- 计算剩余时间
-- local lastTime = N_TimeStamp - curTimeStamp
-- return lastTime < 0 and 0 or lastTime
--- 按时间长度刷新
--- 按时间长度刷新
elseif shopInfo.RefreshType[1] == 3 then
local shopData = this.GetShopDataByType(shopType)
local shopData = this.GetShopDataByType(shopType)
if shopType == SHOP_TYPE.GUILD_SHOP or shopType == SHOP_TYPE.QIJIE_SHOP then
local lastRefreshTime = shopData.lastRefreshTime / 1000
local deltaSeconds = shopInfo.RefreshType[2] * 60 * 60
local lastTime = lastRefreshTime + deltaSeconds - GetTimeStamp()
return lastTime < 0 and 0 or lastTime
else
return shopData.endTime/1000 - GetTimeStamp()
return shopData.endTime / 1000 - GetTimeStamp()
end
end
end
--- 获取刷新剩余时间
function this.GetShopRefreshLeftTime(shopType)
return this._RefreshShopList[shopType] or -1
end
-- 获取商店剩余多少时间关闭 -1表示未开启/已关闭
function this.GetShopCloseTime(shopType)
-- 常驻商店没有关闭时间
@ -840,7 +832,7 @@ end
-- 获取商店自动恢复次数的刷新时间
function this.GetShopRefreshCountRecoverTime(shopType)
local shopInfo = this.GetShopInfoByType(shopType)
if shopInfo.IfManualRefresh[1] == 0 then -- 自动恢复次数的刷新类型
if shopInfo.IfManualRefresh[1] == 0 then -- 自动恢复次数的刷新类型
return -1
end
local maxTime = shopInfo.IfManualRefresh[1]
@ -848,8 +840,8 @@ function this.GetShopRefreshCountRecoverTime(shopType)
local curTimeStamp = GetTimeStamp()
local shopData = this.GetShopDataByType(shopType)
local lastRefreshTime = shopData.lastRefreshTime / 1000
local leftCount = math.min(maxTime, math.floor((curTimeStamp - lastRefreshTime)/refreshTime))
if leftCount == maxTime then
local leftCount = math.min(maxTime, math.floor((curTimeStamp - lastRefreshTime) / refreshTime))
if leftCount == maxTime then
return 0
end
-- 计算剩余时间
@ -857,7 +849,6 @@ function this.GetShopRefreshCountRecoverTime(shopType)
return refreshTime
end
-- 获取商品限制购买数量(返回-1 表示不限购)
function this.GetShopItemLimitBuyCount(itemId)
local itemInfo = this.GetShopItemInfo(itemId)
@ -894,7 +885,6 @@ function this.GetShopItemRemainBuyTimes(shopType, itemId)
if this.GetShopItemLimitBuyCount(itemId) == -1 then
return -1
else
return this.GetShopItemLimitBuyCount(itemId) - this.GetShopItemHadBuyTimes(shopType, itemId)
end
end
@ -922,7 +912,7 @@ function this.GetShopItemMaxBuy(shopType, itemId)
local oriCostNum = 0
if itemInfo.PremiumType == 1 then
-- 用公式计算
local abcd = itemInfo.Cost[2]-- 公式常数
local abcd = itemInfo.Cost[2] -- 公式常数
for i = 0, 999 do
oriCostNum = math.floor(oriCostNum + CalculateCostCount(startNum + i, abcd))
local finalNum = math.floor(oriCostNum * discount)
@ -932,7 +922,7 @@ function this.GetShopItemMaxBuy(shopType, itemId)
end
elseif itemInfo.PremiumType == 2 then
-- 数组数量相加
local ary = itemInfo.Cost[2]-- 组数
local ary = itemInfo.Cost[2] -- 组数
for i = 1, 999 do
local addValue = ary[startNum + i] or ary[#ary]
oriCostNum = math.floor(oriCostNum + addValue)
@ -951,6 +941,7 @@ function this.calculateBuyCost(shopType, itemId, count)
local shopData = this.GetShopDataByType(shopType)
return this.CalculateCostCountByShopId(shopData.id, itemId, count)
end
function this.CalculateCostCountByShopId(shopId, itemId, count)
local shopData = this.GetShopDataByShopId(shopId)
local startNum = nil
@ -971,13 +962,13 @@ function this.CalculateCostCountByShopId(shopId, itemId, count)
local oriCostNum = 0
if itemInfo.PremiumType == 1 then
-- 用公式计算
local abcd = itemInfo.Cost[2]-- 公式常数
local abcd = itemInfo.Cost[2] -- 公式常数
for i = 0, count - 1 do
oriCostNum = oriCostNum + CalculateCostCount(startNum + i, abcd)
end
elseif itemInfo.PremiumType == 2 then
-- 数组数量相加
local ary = itemInfo.Cost[2]-- 组数
local ary = itemInfo.Cost[2] -- 组数
for i = 1, count do
local addValue = ary[startNum + i] or ary[#ary]
oriCostNum = oriCostNum + addValue
@ -986,7 +977,7 @@ function this.CalculateCostCountByShopId(shopId, itemId, count)
-- 判断是否打折
local discount = itemInfo.IsDiscount == 1 and itemInfo.DiscountDegree * 0.1 or 1
local finalNum = oriCostNum * discount
return costId,finalNum, oriCostNum
return costId, finalNum, oriCostNum
end
-- 外部增加商品购买次数,别瞎用
@ -1064,7 +1055,7 @@ function this.ShopCheckRPIsShow(shopType)
if _LastCheckTime and _LastCheckTime ~= 0 then
-- 商店查看时间小于刷新时间,显示红点
--Log("商店红点检测: 上次查看时间 = ".._LastCheckTime..", 商店刷新时间 = "..shopData.lastRefreshTime/1000)
if _LastCheckTime < shopData.lastRefreshTime/1000 then
if _LastCheckTime < shopData.lastRefreshTime / 1000 then
return true
end
end
@ -1104,24 +1095,18 @@ function this.ShopRefreshRPIsShow(shopType)
-- return leftRefreshCount > 0
end
-- 向红点注册的检测方法
function this.ShopRedCheck(redType)
if redType == RedPointType.Guild_Shop or redType == RedPointType.Shop_Guild_Check then
return this.ShopCheckRPIsShow(SHOP_TYPE.GUILD_SHOP)
elseif redType == RedPointType.Arena_Shop or redType == RedPointType.Shop_Arena_Check then
return this.ShopCheckRPIsShow(SHOP_TYPE.ARENA_SHOP)
elseif redType == RedPointType.Shop_Roam_Check then
return this.ShopCheckRPIsShow(SHOP_TYPE.ROAM_SHOP)
elseif redType == RedPointType.Shop_Secret_Check then
return this.ShopCheckRPIsShow(SHOP_TYPE.SECRET_BOX_SHOP)
elseif redType == RedPointType.Shop_General_Check then
return this.ShopCheckRPIsShow(SHOP_TYPE.GENERAL_SHOP)
elseif redType == RedPointType.Shop_General_Refresh then
return this.ShopRefreshRPIsShow(SHOP_TYPE.GENERAL_SHOP)
elseif redType == RedPointType.Shop_Soul_Refresh then
@ -1155,13 +1140,11 @@ function this.CheckShopRedpot(shopType)
end
end
-- 从本地加载红点数据
function this.LoadRedpotDataFromLocal()
-- 检测所有商店
for _, type in pairs(SHOP_TYPE) do
_ShopCheckTime[type] = PlayerPrefs.GetInt(PlayerManager.uid.."_ShopRedPot_"..type)
_ShopCheckTime[type] = PlayerPrefs.GetInt(PlayerManager.uid .. "_ShopRedPot_" .. type)
-- _RefreshBtnIsClick[type] = PlayerPrefs.GetInt(PlayerManager.uid.."_ShopBtnStatus_"..type) == 1
end
end
@ -1172,7 +1155,7 @@ function this.RefreshShopCheckTime(shopType)
-- 保存查看的时间戳
local curTimeStamp = GetTimeStamp()
PlayerPrefs.SetInt(PlayerManager.uid.."_ShopRedPot_"..shopType, curTimeStamp)
PlayerPrefs.SetInt(PlayerManager.uid .. "_ShopRedPot_" .. shopType, curTimeStamp)
_ShopCheckTime[shopType] = curTimeStamp
this.CheckShopRedpot(shopType)
@ -1203,12 +1186,75 @@ function this.CheckGoldIsFree()
return true
end
-- 检查是否有免费的可购买的商品
function this.CheckRedPointJiaozhufabao()
local isCanBuy = 1
local actConfig = ConfigManager.GetConfigDataByKey(ConfigName.ActivityGroups, "Id", ActivityTypeDef.Jiaozhufabao)
if actConfig then
--LogError("cccccccccccccccccccccccccccccccccccccccccccccccccccc")
local shopData = DynamicActivityManager.GetGiftDataByType(actConfig.ShopData)
if shopData then
for i = 1, #shopData do
if shopData[i].data.limitNum == 0 then
isCanBuy = 0
else
isCanBuy = (shopData[i].data.limitNum - shopData[i].data.boughtNum > 0) and 0 or 2
if shopData[i].data.linkAct then
isCanBuy = shopData[i].data.state == 0 and 0 or 2
end
end
if (shopData[i].data.finalNum == 0 or shopData[i].data.linkAct) and isCanBuy == 0 then
--LogError("cccccccccccccccccccccccccccccccccccccccccccccccccccc")
return true
end
end
return this.CheckRedPointMeiRiTeHui()
else
return this.CheckRedPointMeiRiTeHui()
end
else
--LogError("cccccccccccccccccccccccccccccccccccccccccccccccccccc")
return this.CheckRedPointMeiRiTeHui()
end
end
function this.CheckRedPointMeiRiTeHui()
local isCanBuy = 1
local actConfig = ConfigManager.GetConfigDataByKey(ConfigName.ActivityGroups, "Id", ActivityTypeDef.MeiRiTeHui)
if actConfig then
--LogError("cccccccccccccccccccccccccccccccccccccccccccccccccccc")
local shopData = DynamicActivityManager.GetGiftDataByType(actConfig.ShopData)
if shopData then
for i = 1, #shopData do
if shopData[i].data.limitNum == 0 then
isCanBuy = 0
else
isCanBuy = (shopData[i].data.limitNum - shopData[i].data.boughtNum > 0) and 0 or 2
if shopData[i].data.linkAct then
isCanBuy = shopData[i].data.state == 0 and 0 or 2
end
end
if (shopData[i].data.finalNum == 0 or shopData[i].data.linkAct) and isCanBuy == 0 then
--LogError("cccccccccccccccccccccccccccccccccccccccccccccccccccc")
return true
end
end
return false
else
return false
end
else
--LogError("cccccccccccccccccccccccccccccccccccccccccccccccccccc")
return false
end
end
-- 检查是否有免费的可购买的商品
function this.HaveFreeBaby()
local haveFree = false
--新手礼包开启时 每天第一次登陆打开显示红点
if this.IsActive(SHOP_TYPE.NOVICE_GIFT_SHOP ) and this.CheckNoviceGiftData() then
if PatFaceManager.isFirstLog==0 and this.isOpenNoviceGift==false then
if this.IsActive(SHOP_TYPE.NOVICE_GIFT_SHOP) and this.CheckNoviceGiftData() then
if PatFaceManager.isFirstLog == 0 and this.isOpenNoviceGift == false then
haveFree = true
else
haveFree = false
@ -1244,27 +1290,25 @@ end
--检查是否有未购买的新手礼包
function this.CheckNoviceGiftData()
for i, v in ipairs(ShopManager.GetShopDataByType(SHOP_TYPE.NOVICE_GIFT_SHOP).storeItem) do
if v.buyNum==0 then
if v.buyNum == 0 then
return true
end
end
return false
end
-- 检测商店物品
function this.CheckShopItemList(list)
local itemList = {}
for _, item in ipairs(list) do
local info = this.GetShopItemInfo(item.id)
if info.OpenLv and
info.OpenLv[1] and info.OpenLv[1] <= PlayerManager.level then
-- info.OpenLv[2] and info.OpenLv[2] >= PlayerManager.level then
table.insert(itemList, item)
info.OpenLv[1] and info.OpenLv[1] <= PlayerManager.level then
-- info.OpenLv[2] and info.OpenLv[2] >= PlayerManager.level then
table.insert(itemList, item)
end
end
return itemList
end
return this
return this

View File

@ -60,7 +60,7 @@ end
function this.GetTaskPageRedPointStatus()
local redPoint = false
if this.currentLv < this.treasureMaxLv then
if this.treasureMaxLv and this.currentLv and this.currentLv < this.treasureMaxLv then
local taskList = TaskManager.GetTypeTaskList(TaskTypeDef.TreasureOfSomeBody)
for _, v in pairs(taskList) do
if v.state == VipTaskStatusDef.CanReceive then