2 Комити 8a8f38d5c8 ... 276e5f1f51

Аутор SHA1 Порука Датум
  杜哥很忙 276e5f1f51 修改:删除无用类文件 пре 9 месеци
  杜哥很忙 74eb411379 修改:删除无用函数 пре 9 месеци

+ 0 - 5
Classes/IAP/IAPCtlShop.cpp

@@ -101,11 +101,6 @@ void IAPCtlShop::showInNode(cocos2d::Node *pParent, ShopRequirement &requirement
     IAPCtlShopUI::getInstance()->create(pParent, _conf, requirement);
 }
 
-void IAPCtlShop::showSlideCardsByCoinsIn(cocos2d::Node* pParent, int stillNeedCoins){
-    IAPCtlShopUI::getInstance()->showSlideCardsByCoinsIn(pParent, stillNeedCoins);
-}
-
-
 void IAPCtlShop::addUserBuyInfo(std::string commodityID){
     iapshop::IAPUserData::getInstance()->addBuyInfo(commodityID);
     if(_delegate){

+ 0 - 5
Classes/IAP/IAPCtlShop.hpp

@@ -73,11 +73,6 @@ public:
     // cardsName 内购卡片名称
     void displayFailureCardIn(cocos2d::Node*, std::vector<std::string> cardsName);
     
-    // 以滑动卡片的形式在某个节点中显示满足金币条件的所有 普通商店卡片(暂未使用)删除?
-    // pParent 父节点
-    // stillNeedCoins 距离所需要的金币数还差多少金币
-    void showSlideCardsByCoinsIn(cocos2d::Node* pParent, int stillNeedCoins);
-    
     // 添加用户购买信息 并 从delegate发送购买的道具信息
     // commodityID 购买的商店卡片ID
     void addUserBuyInfo(std::string commodityID);

+ 1 - 10
Classes/IAP/Shop/IAPCardView.cpp

@@ -8,12 +8,6 @@
 #include "IAPCardView.hpp"
 
 
-void IAPCardView::setDelegate(IAPCardViewDelegate *delegate){
-    if(delegate){
-        _delegate = delegate;
-    }
-}
-
 IAPCardView* IAPCardView::create(cocos2d::Size &viewSize, sDotCfg &dotCfg){
     // 创建 PageView 用于分页滑动卡片
     IAPCardView* ret = new IAPCardView();
@@ -117,10 +111,7 @@ bool IAPCardView::_init(Size &viewSize, sDotCfg &dotCfg){
                 indicator->setTexture(_dotCfg.normalSp); // 切换为未选中图片
             }
         }
-        // 如果delegate存在通知delegate卡片页数改变
-        if(_delegate){
-            _delegate->onCardChanged(currentPageIndex);
-        }
+
     });
     
     return true;

+ 0 - 9
Classes/IAP/Shop/IAPCardView.hpp

@@ -25,12 +25,6 @@
  
  */
 
-class IAPCardView;
-class IAPCardViewDelegate{
-public:
-    virtual void onCardChanged(int currentPageIndex) = 0; // 页面切换时调用
-};
-
 class IAPCardView : public Layer{
 public:
     struct sDotCfg{
@@ -42,8 +36,6 @@ public:
     
     static IAPCardView* create(cocos2d::Size& viewSize, sDotCfg& dotCfg);
     
-    void setDelegate(IAPCardViewDelegate* delegate);
-    
     void addCard(Node* card);
     
     void removeCard(int index);
@@ -53,7 +45,6 @@ private:
     bool _init(Size& viewSize, sDotCfg& dotCfg);
     
 private:
-    IAPCardViewDelegate* _delegate = nullptr;  // 委托对象
     
     sDotCfg _dotCfg;
     Size _viewSize;

+ 0 - 40
Classes/IAP/Shop/IAPCtlShopUI.cpp

@@ -16,10 +16,8 @@
 #include "IAPCtlShopUI.hpp"
 #include "IAPCtlShopItem.hpp"
 #include "IAPDefine.hpp"
-#include "IAPTestCard.hpp"
 
 #include "IAPCardView.hpp"
-#include "IAPTestCardViewDelegate.hpp"
 
 #include "IAPRunTimeData.hpp"
 
@@ -99,41 +97,6 @@ bool IAPCtlShopUI::create(Node* pNode, IAPConf* cfg, iapshop::ShopRequirement& r
     return true;
 }
 
-void IAPCtlShopUI::showSlideCardsByCoinsIn(cocos2d::Node *pNode, int stillNeedCoins){
-    clear();
-    
-    IAPCardView::sDotCfg cfg;
-    cfg.hightSp = "内购版位_通用_图标_滑动点_已选中.png";
-    cfg.normalSp = "内购版位_通用_图标_滑动点_未选中.png";
-    cfg.sepWidth = 30.0f;
-    cfg.yStart = 0;
-    
-    IAPConf::getInstance()->getAllGoods(_goodsInfo);
-    float h = 0.0;
-    for(const auto& goodInfo : _goodsInfo){
-        h = std::max(h, goodInfo.sz.height);
-    }
-    
-    auto visibleSize = Director::getInstance()->getVisibleSize();
-    float width = visibleSize.width;
-    cocos2d::Size sz = cocos2d::Size(width, h + 10);
-    
-    IAPCardView* cardView = IAPCardView::create(sz, cfg);
-    cardView->setPosition(Vec2(cardView->getPosition()) + Vec2(0, 20));
-    
-    IAPTestCardViewDelegate* cardViewDelegate = new IAPTestCardViewDelegate();
-    cardView->setDelegate(cardViewDelegate);
-
-    for (const auto& goodInfo : _goodsInfo) {
-        if(goodInfo.getCoinNumber() < stillNeedCoins)continue;
-        auto item = IAPCtlShopItem::create(goodInfo, 1);
-        _failItems.push_back(item);
-        cardView->addCard(item);
-    }
-
-    pNode->addChild(cardView);
-}
-
 bool IAPCtlShopUI::addAPlacement(const iapshop::IAPPlacement &plInfo){
     // 如果该活动ID存在,则添加失败
     if(_placements.count(plInfo.id) != 0)return false;
@@ -595,9 +558,6 @@ Node* IAPCtlShopUI::createPlacementUI(const iapshop::IAPPlacement& placement){
     cocos2d::Size sz = cocos2d::Size(584, 250);
     IAPCardView* cardView = IAPCardView::create(sz, cfg);
     
-    IAPTestCardViewDelegate* cardViewDelegate = new IAPTestCardViewDelegate();
-    cardView->setDelegate(cardViewDelegate);
-    
     // 遍历 placement 中的卡片,依次创建并添加到 PageView 中
     for (int i = 0; i < placement.cards.size(); i++) {
         cardView->addCard(placement.cards[i]->create());

+ 0 - 5
Classes/IAP/Shop/IAPCtlShopUI.hpp

@@ -26,11 +26,6 @@ public:
     // 在指定节点内创建
     bool create(cocos2d::Node* pNode, IAPConf* cfg, iapshop::ShopRequirement& requirement,int placementId = 1);
     
-    // 以滑动卡片的形式在某个节点中显示满足金币条件的所有商店卡片
-    // pParent 父节点
-    // stillNeedCoins 距离所需要的金币数还差多少金币
-    void showSlideCardsByCoinsIn(cocos2d::Node* pNode, int stillNeedCoins);
-    
     // 添加一个商店版位
     // id 卡片id(添加版位时的id)
     bool addAPlacement(const iapshop::IAPPlacement& plInfo);

+ 0 - 17
Classes/IAPTestCardViewDelegate.cpp

@@ -1,17 +0,0 @@
-//
-//  IAPTestCardViewDelegate.cpp
-//  demo
-//
-//  Created by Red_mini on 2024/10/25.
-//
-
-#include "IAPTestCardViewDelegate.hpp"
-#include "cocos2d.h"
-
-IAPTestCardViewDelegate::IAPTestCardViewDelegate(){
-    
-}
-
-void IAPTestCardViewDelegate::onCardChanged(int currentPageIndex){
-    log("页面切换到第%d页",currentPageIndex + 1);
-}

+ 0 - 23
Classes/IAPTestCardViewDelegate.hpp

@@ -1,23 +0,0 @@
-//
-//  IAPTestCardViewDelegate.hpp
-//  demo
-//
-//  Created by Red_mini on 2024/10/25.
-//
-
-#ifndef IAPTestCardViewDelegate_hpp
-#define IAPTestCardViewDelegate_hpp
-
-#include <stdio.h>
-#include "IAPCardView.hpp"
-
-
-class IAPTestCardViewDelegate : public IAPCardViewDelegate
-{
-public:
-    virtual void onCardChanged(int currentPageIndex) override;
-    
-    IAPTestCardViewDelegate();
-};
-
-#endif /* IAPTestCardViewDelegate_hpp */

+ 0 - 8
proj.ios_mac/demo.xcodeproj/project.pbxproj

@@ -56,8 +56,6 @@
 		C17ACCBD2CB903BA0072A711 /* TestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C17ACCBB2CB903BA0072A711 /* TestScene.cpp */; };
 		C18082282CCB3338009DE140 /* IAPCardView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C18082262CCB3338009DE140 /* IAPCardView.cpp */; };
 		C18082292CCB3338009DE140 /* IAPCardView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C18082262CCB3338009DE140 /* IAPCardView.cpp */; };
-		C18082332CCB71D3009DE140 /* IAPTestCardViewDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C18082312CCB71D3009DE140 /* IAPTestCardViewDelegate.cpp */; };
-		C18082342CCB71D3009DE140 /* IAPTestCardViewDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C18082312CCB71D3009DE140 /* IAPTestCardViewDelegate.cpp */; };
 		C180823B2CCB82BD009DE140 /* IAPRunTimeData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C18082382CCB82BD009DE140 /* IAPRunTimeData.cpp */; };
 		C19B68A42CD1E4C800536ED4 /* PBConfigData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C19B68A22CD1E4C800536ED4 /* PBConfigData.cpp */; };
 		C19B68A52CD1E4C800536ED4 /* PBConfigData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C19B68A22CD1E4C800536ED4 /* PBConfigData.cpp */; };
@@ -213,8 +211,6 @@
 		C17ACCC52CB904460072A711 /* TestScene.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestScene.h; sourceTree = "<group>"; };
 		C18082262CCB3338009DE140 /* IAPCardView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = IAPCardView.cpp; sourceTree = "<group>"; };
 		C18082272CCB3338009DE140 /* IAPCardView.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = IAPCardView.hpp; sourceTree = "<group>"; };
-		C18082312CCB71D3009DE140 /* IAPTestCardViewDelegate.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = IAPTestCardViewDelegate.cpp; sourceTree = "<group>"; };
-		C18082322CCB71D3009DE140 /* IAPTestCardViewDelegate.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = IAPTestCardViewDelegate.hpp; sourceTree = "<group>"; };
 		C18082382CCB82BD009DE140 /* IAPRunTimeData.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = IAPRunTimeData.cpp; sourceTree = "<group>"; };
 		C18082392CCB82BD009DE140 /* IAPRunTimeData.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = IAPRunTimeData.hpp; sourceTree = "<group>"; };
 		C19B68A22CD1E4C800536ED4 /* PBConfigData.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PBConfigData.cpp; sourceTree = "<group>"; };
@@ -491,8 +487,6 @@
 				C19B68BD2CD222A400536ED4 /* IAPDelegateImpl.cpp */,
 				C17946162CC7502600779B63 /* IAPTestCard.hpp */,
 				C17946152CC7502600779B63 /* IAPTestCard.cpp */,
-				C18082322CCB71D3009DE140 /* IAPTestCardViewDelegate.hpp */,
-				C18082312CCB71D3009DE140 /* IAPTestCardViewDelegate.cpp */,
 			);
 			name = Classes;
 			path = ../Classes;
@@ -796,7 +790,6 @@
 				C17ACCBC2CB903BA0072A711 /* TestScene.cpp in Sources */,
 				E4D223402BD667D4006F1F8D /* AdUtilsInterstitial.cpp in Sources */,
 				E4D2234F2BD66CDE006F1F8D /* RedWise.cpp in Sources */,
-				C18082332CCB71D3009DE140 /* IAPTestCardViewDelegate.cpp in Sources */,
 				C18082282CCB3338009DE140 /* IAPCardView.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -831,7 +824,6 @@
 				C19B68C02CD222A400536ED4 /* IAPDelegateImpl.cpp in Sources */,
 				C17ACCBD2CB903BA0072A711 /* TestScene.cpp in Sources */,
 				2F15C5F52CB8F65A0057855D /* IAPCtlArea23.cpp in Sources */,
-				C18082342CCB71D3009DE140 /* IAPTestCardViewDelegate.cpp in Sources */,
 				E4E7A1232BD75C3F00107AED /* RPRedAudio.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;