// // IAPCtlShopUI.hpp // TileManor // // Created by 徐炼新 on 2024/1/16. // #ifndef IAPCtlShopUI_hpp #define IAPCtlShopUI_hpp #include #include "cocos2d.h" #include "RUReboltLayer.h" #include "RUTableView.h" #include "IAPConf.hpp" class IAPCtlShopItem; class MapIGCoin; class IAPCtlShopUI : public cocos2d::Ref { public: static IAPCtlShopUI* getInstance(); // 在指定节点内创建 bool create(cocos2d::Node* pParent, IAPConf* cfg, int placementId = 1); // 设置退出时的回调 void setCBWhileQuit(std::function cb) { _cb = cb; } // 当前是否正在显示 bool isShowing(); // 退出当前界面 void quit(); private: IAPCtlShopUI(); ~IAPCtlShopUI(); void clear(); void _onNotifyDevelopment(const redutils::ReboltNotifyData& data); void constructShopItem(bool bShowAll = false); private: static IAPCtlShopUI* _instance; IAPConf* _cfg = nullptr; redutils::RUReboltLayer* _layer = nullptr; cocos2d::Node* _ndScrollArea = nullptr; redutils::RUTableView* _tableView = nullptr; redutils::RUTableDataModel _tableData; std::vector _goodsInfo; std::vector _goodsItems; redutils::RUReboltLayer* _btnShowAll = nullptr; std::vector _allSizes; MapIGCoin* _igCoin = nullptr; bool _bUIShowing = false; std::function _cb = nullptr; int _placementId = 0; }; #endif /* IAPCtlShopUI_hpp */