Commit 544fe28c by 张树文

删除不需要的打点功能

1 parent c4fbd649
Showing with 16 additions and 2183 deletions
{
"ver": "1.1.2",
"uuid": "f18ebba0-fb81-4e01-912c-fac1c0706b39",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
import { Emitter } from "./EventKit";
export namespace EventCenter {
let emitter = new Emitter();
/**发起从oss上获取游戏中心配置数据的请求 */
export const REQUEST_COOPERATION_DATA_FROM_OSS = emitter.createEvent<(release: boolean) => void>();
/**游戏中心配置数据下载成功 */
export const COOPERATION_DATA_DOWNLOAD_SUCCEED = emitter.createEvent<() => void>();
/**快速开始子游戏 */
export const QUICK_START_SUB_GAME = emitter.createEvent<(random: boolean) => void>();
/**控制游戏中心列表是否展示 */
export const SHOW_GAME_CENTER_LIST_VIEW = emitter.createEvent<(show: boolean) => void>();
/**刷新子游戏列表 */
export const REFRESH_SUB_GAME_LIST = emitter.createEvent<() => void>();
/**根据子游戏ID打开指定小游戏 */
export const OPEN_SUBGAME_BY_APPID = emitter.createEvent<(appId: string) => void>();
/**检查热更后游戏初始化事件 */
export const GameStart = emitter.createEvent<() => void>();
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "92f515a4-67b8-4bd1-bbb0-c3a631467166",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.2.7",
"uuid": "02e8108f-1cea-48c1-bf08-4de4d0954e51",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "GameCenterBtn",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 5
},
{
"__id__": 7
}
],
"_prefab": {
"__id__": 8
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "btnSpr",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 109,
"height": 76
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "bb81fccb-9f69-446b-a5a5-b27cb5f8b8b6"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "158b5172-0e33-413f-be98-075bc1de88ae"
},
"fileId": "30uG+TnOZHOqar37fQDO1m",
"sync": false
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 6
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": ""
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "c514d91aohJ97f4zAqMcsiN",
"handler": "onClick",
"customEventData": ""
},
{
"__type__": "c514d91aohJ97f4zAqMcsiN",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "158b5172-0e33-413f-be98-075bc1de88ae"
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.7",
"uuid": "2529f882-df6b-4cac-a25a-1ca4900ba066",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.2.7",
"uuid": "0564ee74-61c6-4db8-9589-b4486e1e56ae",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.2.7",
"uuid": "caaa16e1-77dc-46c0-bfa4-151e51e9919f",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "70256d30-ba69-4dd1-86de-eb0b0e08f489",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
import { ResUtils } from "simba-cc-resutils";
import { DummyColor, DummyLabel, DummySprite } from "../../common/CCDummyObjects";
import { EventCenter } from "../event/EventCenter";
import { CooperationClassBase, CooperationItemDataModel } from "./CooperationClassBase";
import CooperationDataCenter, { SubGameLocation } from "./CooperationDataCenter";
import CooperationDotMgr from "./CooperationDotMgr";
/**cocos合作item组件 */
const { ccclass, property } = cc._decorator;
@ccclass
export class CCCooperationItem extends cc.Component {
@property({ type: cc.Sprite, visible: true, displayName: "iconSprite", tooltip: "小游戏icon精灵" })
private iconSprite: cc.Sprite = DummySprite;
@property({ type: cc.Label, visible: true, displayName: "nameLabel", tooltip: "小游戏name标签" })
private nameLabel: cc.Label = DummyLabel;
@property({ type: cc.Label, visible: true, displayName: "playingUserLabel", tooltip: "小游戏多少人正在玩标签" })
private playingUserLabel: cc.Label = DummyLabel;
@property({ tooltip: "当前游戏所处的位置:主界面(mainUI)、游戏中心列表(gameCenter)、朋友圈列表(momentCenter)" })
location: SubGameLocation = SubGameLocation.GameCenter;
private dataModel: CooperationItemDataModel;
private ossPath: string = CooperationClassBase.COO_OSS_PATH_DEV;
@property({ type: cc.Color, tooltip: "个性化定制字体颜色", displayName: "diyLabelColor" })
diyColor: cc.Color = DummyColor;
@property
useDIYColor: boolean = false;
spr: cc.Sprite;
private _localSFPath: string = "textures/cooperationItems/";
private _localSFArr: string[] = [
"dlmhsj",
"fakeprince2",
"feidao",
"huanyuanshi",
"jiawangzi",
"jiujiu",
"lianaiyujing",
"mrqm",
"shanyoufusu",
"shenmiriji",
"sxjsl",
"wodedadao",
"wolianzeida",
"yybs"
];
/***设置release还是dev */
setRelease(release: boolean = false) {
this.ossPath = release ? CooperationClassBase.COO_OSS_PATH_RELEASE : CooperationClassBase.COO_OSS_PATH_DEV;
}
/**设置当前模型所处的位置标识 */
setLocation(location: SubGameLocation) {
this.location = location;
}
/**绑定数据 */
bindData(data: CooperationItemDataModel) {
if (!data) {
return;
}
this.dataModel = data;
this.refreshItem(data);
}
/**刷新模型 */
refreshItem(data?: CooperationItemDataModel) {
if (!data && !this.dataModel) {
return;
}
if (data) {
this.refreshIcon(data.icon);
this.refreshName(data.appName);
this.refreshPlayingUser();
this.refreshNameColor();
} else {
console.error('data is null');
}
}
/**刷新icon */
refreshIcon(icon: string): Promise<any> {
let spr: cc.Sprite = this.iconSprite;
let iconName: string = icon.split(".")[0];
let isLocal = this._localSFArr.findIndex((v) => v === iconName) !== (-1);
let loaclPath = this._localSFPath + iconName;
return new Promise<any>((resolve, reject) => {
if (isLocal) {
ResUtils.loadRes(loaclPath, cc.SpriteFrame).then((sf) => {
spr.spriteFrame = sf;
resolve(true);
});
} else {
let path: string = this.ossPath + CooperationDataCenter.getInstance().getCurGameID() + CooperationClassBase.IMG_PATH + icon;
cc.assetManager.loadRemote(path, (err, sprite) => {
if (err) {
reject(err)
} else {
spr.spriteFrame = new cc.SpriteFrame(sprite);
resolve(true)
}
});
}
})
}
/**刷新name */
refreshName(name: string) {
if (!name || !this.nameLabel) {
return;
}
this.nameLabel.node.active = !!this.dataModel.showAppName;
this.nameLabel.string = name;
}
/**设置name的字体颜色 */
refreshNameColor() {
if (!this.nameLabel) {
return;
}
let c: cc.Color = cc.color(255, 255, 255);
if (this.useDIYColor && this.diyColor) {
c = this.diyColor;
}
this.nameLabel.node.color = c;
if (!this.playingUserLabel) {
return;
}
this.playingUserLabel.node.color = c;
}
/**刷新正在玩的玩家数量 */
refreshPlayingUser() {
if (!this.playingUserLabel) {
return;
}
this.playingUserLabel.node.active = !!this.dataModel.showPlayingUser;
if (!this.dataModel.userMin) this.dataModel.userMin = 0;
let min = this.dataModel.userMin > 0 ? this.dataModel.userMin : 0;
if (!this.dataModel.userMax) this.dataModel.userMax = 0;
let max = this.dataModel.userMax > 0 && this.dataModel.userMax > min ? this.dataModel.userMax : min + 100;
let num = Math.ceil(Math.random() * (max - min) + min);
this.playingUserLabel.string = num.toString() + "在玩";
}
/**Item点击回调 */
onItemClick() {
CooperationDotMgr.getInstance().dotClickSubGame(this.dataModel.appId, this.dataModel.appName, this.dataModel.index, this.location);
EventCenter.OPEN_SUBGAME_BY_APPID.emit(this.dataModel.appId);
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "a7b633b7-40e9-44d5-a542-79cf1ff20fa7",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import { SDK } from "simba-sdk";
import MainViewPresenter from "../../game/ui/presenter/MainViewPresenter";
import { EventCenter } from "../event/EventCenter";
import CooperationDotMgr from "./CooperationDotMgr";
/**
* 游戏中心按钮脚本
*/
const { ccclass, property } = cc._decorator;
@ccclass
export default class CCGameCenterBtn extends cc.Component {
onLoad() {
}
onClick() {
CooperationDotMgr.getInstance().dotClickGameCenter();
EventCenter.SHOW_GAME_CENTER_LIST_VIEW.emit(true);
if (MainViewPresenter.tabIndex == 3) {
SDK.hideGameClubButton();
}
}
}
{
"ver": "1.0.8",
"uuid": "c514df75-6a88-49f7-b7f8-cc0a8c72c88d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import { EventCenter } from "../event/EventCenter";
import { CompositeDisposable } from "../event/EventKit";
import CooperationDataCenter from "./CooperationDataCenter";
import CCGameCenterNodeFactory from "./CCGameCenterNodeFactory";
import GameCenter from "./GameCenter";
import { DummyNode, DummyPrefab } from "../../common/CCDummyObjects";
/**
* 游戏盒子组件
*/
const { ccclass, property } = cc._decorator;
@ccclass
export default class CCGameCenterComponent extends cc.Component {
@property({ type: cc.Prefab, tooltip: "游戏盒子按钮prefab", displayName: "gameCenterBtnPrefab" })
gameCenterBtnPrefab: cc.Prefab = DummyPrefab;
@property({ type: cc.Prefab, tooltip: "游戏列表prefab", displayName: "gameCenterViewPrefab" })
gameCenterViewPrefab: cc.Prefab = DummyPrefab;
@property({ type: cc.Prefab, tooltip: "子游戏prefab", displayName: "gameCenterItemPrefab" })
gameCenterItemPrefab: cc.Prefab = DummyPrefab;
@property({ type: cc.Prefab, tooltip: "游戏朋友圈prefab", displayName: "gameCenterMomentPrefab" })
gameCenterMomentPrefab: cc.Prefab = DummyPrefab;
@property({ type: cc.Node, tooltip: "游戏中心列表的父节点" })
gameCenterParentNode: cc.Node = DummyNode;
@property({ type: cc.Node, tooltip: "在外面展示的子游戏" })
mainUISubGameNode: cc.Node = DummyNode;
@property({ tooltip: "是否是release环境" })
isRelease: boolean = false;
@property({ tooltip: "当前游戏的微信APPID" })
appID: string = "";
@property({ tooltip: "当前游戏的GameID:" })
gameID: string = "";
@property({ tooltip: "当前游戏的渠道" })
gameChannel: string = "wechat";
private _disposable: CompositeDisposable = new CompositeDisposable;
private _gameCenterViewNode: cc.Node = DummyNode;
onLoad() {
}
init() {
this.registerEventListener();
this.createNode();
this.onShowGameCenterListView(false);
CooperationDataCenter.getInstance().setCurGameID(this.gameID);
CooperationDataCenter.getInstance().setCurGameAppID(this.appID);
CooperationDataCenter.getInstance().setCurGameChannel(this.gameChannel);
GameCenter.getInstance().init();
CCGameCenterNodeFactory.getInstance().init();
CCGameCenterNodeFactory.getInstance().registerMomentPrefab(this.gameCenterMomentPrefab);
CCGameCenterNodeFactory.getInstance().registerSubGamePrefab(this.gameCenterItemPrefab);
CCGameCenterNodeFactory.getInstance().registerMainUISubGameNode(this.mainUISubGameNode);
EventCenter.REQUEST_COOPERATION_DATA_FROM_OSS.emit(this.isRelease);
}
registerEventListener() {
this._disposable.add(EventCenter.COOPERATION_DATA_DOWNLOAD_SUCCEED.on(this.onDownloadCooperationDataSucceed));
this._disposable.add(EventCenter.SHOW_GAME_CENTER_LIST_VIEW.on(this.onShowGameCenterListView));
}
private onDownloadCooperationDataSucceed = () => {
EventCenter.REFRESH_SUB_GAME_LIST.emit();
}
/**创建prefab对应的节点 */
createNode() {
if (!this.gameCenterViewPrefab) {
cc.error("gameCenterViewPrefab is not set , please check it over");
} else {
this._gameCenterViewNode = cc.instantiate(this.gameCenterViewPrefab);
}
let parentNode: cc.Node = cc.director.getScene();
if (this.gameCenterParentNode) {
parentNode = this.gameCenterParentNode;
}
this._gameCenterViewNode.parent = parentNode;
this._gameCenterViewNode.position = cc.v3(cc.winSize.width / 2, cc.winSize.height / 2, 0);
}
start() {
}
update(dt) {
}
/**控制游戏列表是否展示 */
onShowGameCenterListView = (isShow: boolean) => {
if (!this._gameCenterViewNode) {
return;
}
this._gameCenterViewNode.active = isShow;
}
}
{
"ver": "1.0.8",
"uuid": "e8915325-abf7-4a75-9269-20b0124131f3",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import { EventCenter } from "../event/EventCenter";
import { CompositeDisposable } from "../event/EventKit";
import { CCCooperationItem } from "./CCCooperationItem";
import CooperationDataCenter, { SubGameLocation } from "./CooperationDataCenter";
import GameCenter from "./GameCenter";
import CCGameCenterNodeFactory from "./CCGameCenterNodeFactory";
import { DummyNode } from "../../common/CCDummyObjects";
import { SDK } from "simba-sdk";
import MainViewPresenter from "../../game/ui/presenter/MainViewPresenter";
const { ccclass, property } = cc._decorator;
@ccclass
export default class CCGameCenterListView extends cc.Component {
@property({ type: cc.Node, visible: true, displayName: "scrollview内容节点", tooltip: "contentNode" })
private contentNode: cc.Node = DummyNode;
private _disposable: CompositeDisposable = new CompositeDisposable;
onLoad() {
this.registerEventListener();
}
registerEventListener() {
this._disposable.add(EventCenter.REFRESH_SUB_GAME_LIST.on(this.onRefreshContent));
}
start() {
}
onRefreshContent = () => {
if (!this.contentNode) {
return;
}
this.contentNode.removeAllChildren(true);
let isRelease: boolean = GameCenter.getInstance().getIsRelease();
let list = CooperationDataCenter.getInstance().getCooperationItemDataModelList();
for (let i = 0; i < list.length; i++) {
let node = CCGameCenterNodeFactory.getInstance().getSubGameNode();
if (!node) {
break;
}
let script: CCCooperationItem = node.getComponent(CCCooperationItem);
if (script) {
script.setRelease(isRelease);
script.bindData(list[i]);
script.setLocation(SubGameLocation.GameCenter);
}
this.contentNode.addChild(node);
}
}
update(dt) { }
onViewClick() {
EventCenter.SHOW_GAME_CENTER_LIST_VIEW.emit(false);
if (MainViewPresenter.tabIndex == 3) {
SDK.showGameClubButton();
}
}
}
{
"ver": "1.0.8",
"uuid": "1411de84-62aa-4c48-bf98-4cd4b23f63d7",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import { EventCenter } from "../event/EventCenter";
import { CompositeDisposable } from "../event/EventKit";
import { CCCooperationItem } from "./CCCooperationItem";
import CooperationDataCenter, { SubGameLocation } from "./CooperationDataCenter";
import GameCenter from "./GameCenter";
import CCGameCenterNodeFactory from "./CCGameCenterNodeFactory";
import { DummyNode } from "../../common/CCDummyObjects";
/**
* 朋友圈
*/
const { ccclass, property } = cc._decorator;
@ccclass
export default class CCGameCenterMomentItem extends cc.Component {
@property({ type: cc.Node, visible: true, displayName: "scrollview内容节点", tooltip: "contentNode" })
private contentNode: cc.Node = DummyNode;
private _disposable: CompositeDisposable = new CompositeDisposable;
onLoad() {
this.registerEventListener();
}
registerEventListener() {
this._disposable.add(EventCenter.REFRESH_SUB_GAME_LIST.on(this.onRefreshContent));
}
start() {
}
onRefreshContent = () => {
if (!this.contentNode) {
return;
}
let list = CooperationDataCenter.getInstance().getCooperationItemDataModelList();
this.contentNode.removeAllChildren(true);
let isRelease: boolean = GameCenter.getInstance().getIsRelease();
for (let i = 0; i < list.length; i++) {
let node = CCGameCenterNodeFactory.getInstance().getSubGameNode();
if (!node) {
break;
}
let script: CCCooperationItem = node.getComponent(CCCooperationItem);
if (script) {
script.setRelease(isRelease);
script.bindData(list[i]);
script.setLocation(SubGameLocation.MomentCenter);
}
this.contentNode.addChild(node);
}
}
onQuickPlayClick() {
EventCenter.QUICK_START_SUB_GAME.emit(true);
}
}
{
"ver": "1.0.8",
"uuid": "9b40902f-5328-4305-8500-bd60494a6de1",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import { DummyPrefab } from "../../common/CCDummyObjects";
import { EventCenter } from "../event/EventCenter";
import { CompositeDisposable } from "../event/EventKit";
import { CCCooperationItem } from "./CCCooperationItem";
import CCGameCenterMomentItem from "./CCGameCenterMomentItem";
import CooperationDataCenter, { SubGameLocation } from "./CooperationDataCenter";
import GameCenter from "./GameCenter";
/**
* 游戏中心Item项工厂
*/
export default class CCGameCenterNodeFactory {
/**单例对象 */
private static _instance: CCGameCenterNodeFactory = new CCGameCenterNodeFactory();
/**朋友圈prefab */
private _momentPrefab: cc.Prefab = DummyPrefab;
/**子游戏项prefab */
private _subGamePrefab: cc.Prefab = DummyPrefab;
/**单独展示的子游戏列表 */
private _mainUISubGameNodes: cc.Node[] = [];
private _disposable: CompositeDisposable = new CompositeDisposable;
/**朋友圈游戏中心工厂单例对象 */
public static getInstance(): CCGameCenterNodeFactory {
return CCGameCenterNodeFactory._instance;
}
/**初始化操作 */
public init() {
this._disposable.add(EventCenter.REFRESH_SUB_GAME_LIST.on(this.onRefreshMainUISubGames));
}
/**刷新主界面中的子游戏 */
onRefreshMainUISubGames = () => {
if (!this._mainUISubGameNodes || 0 === this._mainUISubGameNodes.length) {
return;
}
let models = CooperationDataCenter.getInstance().getMainUISubGameDataModelList();
let isShow = models && 0 !== models.length;
for (let i = 0; i < this._mainUISubGameNodes.length; i++) {
let node = this._mainUISubGameNodes[i];
node.active = isShow;
let script: CCCooperationItem = node.getComponent(CCCooperationItem);
if (script) {
script.setRelease(GameCenter.getInstance().getIsRelease());
script.bindData(models[Math.floor(Math.random() * models.length)]);
script.setLocation(SubGameLocation.MainUI);
}
}
}
/**注册子游戏节点到单独展示的游戏列表中 */
registerMainUISubGameNode(node: cc.Node) {
if (node) {
this._mainUISubGameNodes.push(node);
}
this.onRefreshMainUISubGames();
}
/**获取单独展示的游戏节点列表 */
getMainUISubGameNodes(): cc.Node[] {
return this._mainUISubGameNodes;
}
/**注入朋友圈prefab */
registerMomentPrefab(prefab: cc.Prefab) {
this._momentPrefab = prefab;
}
/**注入子游戏prefab */
registerSubGamePrefab(prefab: cc.Prefab) {
this._subGamePrefab = prefab;
}
/**获取朋友圈node */
getMomentNode(): cc.Node | undefined {
if (!this._momentPrefab) {
return undefined;
}
let node: cc.Node = cc.instantiate(this._momentPrefab);
let script: CCGameCenterMomentItem = node.getComponent(CCGameCenterMomentItem);
if (script) {
script.onRefreshContent();
}
return node;
}
/**获取子游戏node */
getSubGameNode(): cc.Node | undefined {
if (!this._subGamePrefab) {
return undefined;
}
let node: cc.Node = cc.instantiate(this._subGamePrefab);
return node;
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "bfc706e6-9761-4d64-bb7e-872135f73ff6",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
export namespace CooperationClassBase {
/**dev合作资源oss存放路径 */
export const COO_OSS_PATH_DEV = `https://weixingame.icesimba.com/weixingame/icesimba/dev/cooperation/wechat/games/`;
/**release合作资源oss存放路径 */
export const COO_OSS_PATH_RELEASE = `https://weixingame.icesimba.com/weixingame/icesimba/release/cooperation/wechat/games/`;
/**配置文件路径 */
export const CONFIG_PATH = "/config.json";
/**图片资源文件路径 */
export const IMG_PATH = "/img/";
}
/**合作小游戏数据模型 */
export interface CooperationItemDataModel {
/**小游戏AppID */
appId: string;
/**小游戏名称 */
appName: string;
/**小游戏图标 */
icon: string;
/**顺序 */
index:number;
/**是否展示小游戏名称 */
showAppName?: boolean;
/**是否展示多少玩家正在玩 */
showPlayingUser?: boolean;
/**正在玩的玩家数量随机值下限 */
userMin?: number;
/**正在玩的玩家数量随机值上限 */
userMax?: number;
/**Label的字体颜色 */
labelColor?: string;
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "bc38d36c-bbc1-4c51-908f-385c2d389d80",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import { HttpClient } from "../../network/HttpClient";
import { EventCenter } from "../event/EventCenter";
import { CooperationClassBase, CooperationItemDataModel } from "./CooperationClassBase";
export enum SubGameLocation {
MainUI = "mainUI",
GameCenter = "gameCenter",
MomentCenter = "momentCenter"
}
/**
* 数据中心
*/
export default class CooperationDataCenter {
/**单例对象 */
private static _instance: CooperationDataCenter = new CooperationDataCenter();
/**网络请求对象 */
private _httpObj: HttpClient = new HttpClient("");
/**oss配置文件缓存 */
private _cooperationDataModels: CooperationItemDataModel[] = [];
/**当前游戏的appid */
private _appID: string = "";
/**当前游戏的gameId */
private _gameID: string = "";
/**当前游戏的渠道 */
private _gameChannel: string = "";
/**当前游戏中MainUI中需要展示的游戏 */
private _mainUISubGameModels: CooperationItemDataModel[] = [];
/**获取数据中心单例对象 */
public static getInstance(): CooperationDataCenter {
return CooperationDataCenter._instance;
}
/**设置当前游戏的渠道 */
setCurGameChannel(channel: string) {
this._gameChannel = channel;
}
/**设置当前游戏的gameId */
setCurGameID(gameId: string) {
this._gameID = gameId;
}
/**获取当前游戏的渠道 */
getCurGameChannel(): string {
return this._gameChannel;
}
/**获取当前游戏的gameId */
getCurGameID(): string {
return this._gameID;
}
/**设置当前游戏的appid */
setCurGameAppID(appId: string) {
this._appID = appId;
}
/**获取当前游戏的appid */
getCurGameAppID(): string {
return this._appID;
}
/**获取oss配置列表 */
getCooperationItemDataModelList(): CooperationItemDataModel[] {
return this._cooperationDataModels;
}
/**获取在主UI中需要展示的游戏列表 */
getMainUISubGameDataModelList(): CooperationItemDataModel[] {
return this._mainUISubGameModels;
}
/**从oss上拉取配置文件 */
public async requestCooperationDataFromOSS(release: boolean) {
try {
this._cooperationDataModels = [];
this._mainUISubGameModels = [];
let ossPath = release ? CooperationClassBase.COO_OSS_PATH_RELEASE : CooperationClassBase.COO_OSS_PATH_DEV;
let configPath = ossPath + CooperationDataCenter.getInstance().getCurGameID() + CooperationClassBase.CONFIG_PATH;
let resStr = await this._httpObj.get(configPath) as string;
let res = JSON.parse(resStr);
if (res) {
let items = res.items as { appId: string, img: string, name: string, showName: number, showPlayingUser: number, userMin: number, userMax: number, labelColor: string, independentDisplay: number }[];
if (items) {
let serialNum: number = 1;
for (let i = 0; i < items.length; i++) {
let item = items[i];
if (item && item.appId && "" !== item.appId && item.img && "" !== item.img && this._appID !== item.appId) {
this._cooperationDataModels.push({
appId: item.appId,
appName: item.name,
icon: item.img,
showAppName: item.showName === 1,
showPlayingUser: item.showPlayingUser === 1,
userMin: item.userMin ? item.userMin : 0,
userMax: item.userMax ? item.userMax : 100,
labelColor: item.labelColor,
index: serialNum
});
if (item.independentDisplay === 1) {
this._mainUISubGameModels.push(
{
appId: item.appId,
appName: item.name,
icon: item.img,
showAppName: item.showName === 1,
showPlayingUser: item.showPlayingUser === 1,
userMin: item.userMin ? item.userMin : 0,
userMax: item.userMax ? item.userMax : 100,
labelColor: item.labelColor,
index: serialNum
}
);
}
serialNum += 1;
}
}
EventCenter.COOPERATION_DATA_DOWNLOAD_SUCCEED.emit();
}
}
} catch (e) {
console.error(e);
}
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "e660d58f-8b2b-4ef9-a537-c92cebe7d874",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import CooperationDataCenter, { SubGameLocation } from "./CooperationDataCenter";
import { CryptoJS } from "../script/CryptoJS";
interface BaseDotElements {
mainGameId: string;
mainAppId: string;
dotTime: string;
channel: string;
}
const SALT = "d0dd883ae80667d27b924d1e52b78b59";
/**打点服务 */
const DOT_SERVER = "/client/v1/event/log/put";
/**测试服打点地址 */
const DOT_URL_DEBUG = "https://eventstat-test.icesimba.com";
/**正式服打点地址 */
const DOT_URL_RELEASE = "https://eventstat.icesimba.com";
/**是否打点到测试服,否则打点到正式服 */
const DOT_DEBUG = false;
/**游戏id */
const GAME_ID = "cooperation";
export default class CooperationDotMgr {
private static readonly _instance: CooperationDotMgr = new CooperationDotMgr();
public static getInstance(): CooperationDotMgr {
return CooperationDotMgr._instance;
}
/**获取打点请求服务 */
getXHR(): XMLHttpRequest {
let url = DOT_DEBUG ? DOT_URL_DEBUG : DOT_URL_RELEASE;
url += DOT_SERVER;
let xmlHttp = new XMLHttpRequest();
xmlHttp.open('POST', url);
xmlHttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState === 4) {
if (xmlHttp.status === 200) {
console.log("dot succeed");
}
}
}
return xmlHttp;
}
private async dot(eventKey: string, gameData: any, category?: string) {
let channel: string = CooperationDataCenter.getInstance().getCurGameChannel();
if ("dummy" === channel || "" === channel) return;
let data = this.getBaseElements();
data["category"] = category ? category : "cooperation_event";
data["id"] = eventKey ? eventKey : "event";
data["game_data"] = gameData ? gameData : {};
data["game_id"] = GAME_ID;
let xhr = this.getXHR();
let stringfyData = JSON.stringify(data);
let upLoadData = {
event_type: category,
data: stringfyData,
sign: CryptoJS.MD5(stringfyData + SALT).toString()
};
let upLoadStringfy = JSON.stringify(upLoadData);
await xhr.send(upLoadStringfy);
}
private getBaseElements(): BaseDotElements {
let base: BaseDotElements = {
mainGameId: CooperationDataCenter.getInstance().getCurGameID(),
mainAppId: CooperationDataCenter.getInstance().getCurGameAppID(),
dotTime: (new Date()).toTimeString(),
channel: CooperationDataCenter.getInstance().getCurGameChannel()
};
return base;
}
/**点击子游戏打点 */
public dotClickSubGame(appId: string, appName: string, index: number, location: SubGameLocation) {
let eventKey = "clickSubGame";
this.dot(eventKey, { appId: appId, appName:appName, index: index, location: location }, eventKey);
}
/**点击游戏中心打点 */
public dotClickGameCenter() {
let eventKey = "clickGameCenter";
this.dot(eventKey, {}, eventKey);
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "f207f9a8-6ba3-4b60-aedd-2d49c3882381",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "e172e8d0-9453-4da7-80f2-8e0849fbe596",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
const { ccclass, property } = cc._decorator;
@ccclass
export default class FadeChangeAction extends cc.Component {
@property
loopTimes: number = -1;
@property
speed: number = 1;
@property
opacityMax: number = 255;
@property
opacityMin: number = 0;
@property
defaultOpacity: number = 255;
private readonly _baseTime: number = 1;
private _loopCount: number = 0;
onEnable() {
let actTime: number = this._baseTime / this.speed;
if ((-1) === this.loopTimes) {
cc.tween(this.node)
.to(actTime, { opacity: this.opacityMax })
.to(actTime, { opacity: this.opacityMin })
.union()
.repeatForever()
.start();
}
}
onDisable() {
this.resetToDefault();
}
resetToDefault() {
this._loopCount = 0;
this.node.stopAllActions();
this.node.opacity = this.defaultOpacity;
}
}
{
"ver": "1.0.8",
"uuid": "a095d804-e25b-4d2a-956a-45db623c9dfc",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import { SDK } from "simba-sdk";
import { channel } from "../../GameConfig";
import { EventCenter } from "../event/EventCenter";
import { CompositeDisposable } from "../event/EventKit";
import { CooperationItemDataModel } from "./CooperationClassBase";
import CooperationDataCenter from "./CooperationDataCenter";
/**游戏中心 */
export default class GameCenter {
/**单例对象 */
private static _instance: GameCenter = null;
/**是否处于正式环境[控制访问oss地址] */
private _isRelease: boolean = false;
private _disposable: CompositeDisposable = null;
private _quickStartGameAppID: string = "";
/**游戏中心单例对象 */
public static getInstance(): GameCenter {
if (!GameCenter._instance) {
GameCenter._instance = new GameCenter();
}
return GameCenter._instance;
}
/**初始化 */
public init() {
this.registerEventListener();
}
/**注册事件监听 */
private registerEventListener() {
if (this._disposable) {
this._disposable.dispose();
}
this._disposable = new CompositeDisposable;
this._disposable.add(EventCenter.REQUEST_COOPERATION_DATA_FROM_OSS.on(this.onRequestCooperationData));
this._disposable.add(EventCenter.QUICK_START_SUB_GAME.on(this.onQuickStartSubGame));
this._disposable.add(EventCenter.OPEN_SUBGAME_BY_APPID.on(this.onOpenSubGameByAppId));
}
/**响应拉取游戏中心配置文件事件监听 */
private onRequestCooperationData = (release: boolean) => {
this._isRelease = release;
CooperationDataCenter.getInstance().requestCooperationDataFromOSS(this._isRelease);
}
/**获取是否是正式环境 */
public getIsRelease(): boolean {
return this._isRelease;
}
/**快速开始小游戏 */
onQuickStartSubGame = (isRandom: boolean) => {
let list: CooperationItemDataModel[] = CooperationDataCenter.getInstance().getCooperationItemDataModelList();
if (!list || list.length === 0) {
return;
}
let appId: string = "";
if (isRandom) {
appId = list[Math.floor(Math.random() * list.length)].appId;
} else {
appId = "" === this._quickStartGameAppID ? list[0].appId : this._quickStartGameAppID;
}
this._quickStartGameAppID = appId;
this.openSubProgram(this._quickStartGameAppID);
}
onOpenSubGameByAppId = (appId: string) => {
this._quickStartGameAppID = appId;
// this.openSubProgram(appId);
SDK.openProgramV2(appId);
}
/**打开微信小游戏 */
openSubProgram(appId: string, extraData?: object): Promise<void> {
return new Promise((resolve, reject) => {
if (channel != "dummy") {
wx.navigateToMiniProgram({
appId, extraData,
envVersion: 'release',
success: () => {
resolve();
},
fail: (res) => {
reject(res);
}
})
} else {
console.log('Open other MiniProgram.');
}
});
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "2143bcf1-8f80-4035-a6ce-c3ec84d386bd",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.0",
"uuid": "3b3e434b-a376-4b8c-93e1-1d13d66788e8",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "b3e66dd8-08c2-4a90-a00c-4e1cc7b1961a",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "8d75e707-07e3-4f23-a65d-80181521e39e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 660,
"height": 426,
"platformSettings": {},
"subMetas": {
"bgSpr": {
"ver": "1.0.4",
"uuid": "19d57227-4055-4f2b-97fd-fed910ee38b0",
"rawTextureUuid": "8d75e707-07e3-4f23-a65d-80181521e39e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 1,
"trimX": 2,
"trimY": 0,
"width": 656,
"height": 424,
"rawWidth": 660,
"rawHeight": 426,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "53774e12-2454-487b-80ba-76135d7e384c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 96,
"height": 110,
"platformSettings": {},
"subMetas": {
"gameCenter": {
"ver": "1.0.4",
"uuid": "bb81fccb-9f69-446b-a5a5-b27cb5f8b8b6",
"rawTextureUuid": "53774e12-2454-487b-80ba-76135d7e384c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0.5,
"trimX": 0,
"trimY": 0,
"width": 96,
"height": 109,
"rawWidth": 96,
"rawHeight": 110,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "cb2d1ea8-5fdc-40c0-ae97-d3a7e539acde",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 93,
"height": 94,
"platformSettings": {},
"subMetas": {
"momentHeadIcon": {
"ver": "1.0.4",
"uuid": "29a53f11-18c5-4bf1-bfa7-c56460689712",
"rawTextureUuid": "cb2d1ea8-5fdc-40c0-ae97-d3a7e539acde",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 93,
"height": 94,
"rawWidth": 93,
"rawHeight": 94,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a4478494-5fd6-43e5-9b86-415d761d83cd",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 124,
"height": 51,
"platformSettings": {},
"subMetas": {
"quickPlaySpr": {
"ver": "1.0.4",
"uuid": "1a63445e-bacc-4f31-87e5-80f0f496be13",
"rawTextureUuid": "a4478494-5fd6-43e5-9b86-415d761d83cd",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 124,
"height": 51,
"rawWidth": 124,
"rawHeight": 51,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "db78533e-cd31-4d9e-96ea-f4a2d755ff59", "uuid": "6e9f83b4-7c1e-4905-85db-97211ba82643",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
import { Emitter } from "./EventKit";
export namespace EventCenter {
let emitter = new Emitter();
/**检查热更后游戏初始化事件 */
export const GameStart = emitter.createEvent<() => void>();
}
\ No newline at end of file
import { Emitter } from "simba-eventkit";
namespace GameEvents {
let emitter = new Emitter;
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "6715bf7e-4382-44c0-955d-eb81a746bb2d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -5,21 +5,16 @@ import { AudioManager } from "simba-cc-audio-manager"; ...@@ -5,21 +5,16 @@ import { AudioManager } from "simba-cc-audio-manager";
import { UIManager } from "../common/gameplay/managers/UIManager"; import { UIManager } from "../common/gameplay/managers/UIManager";
import { AnimationUtils } from "../common/utils/AnimationUtils"; import { AnimationUtils } from "../common/utils/AnimationUtils";
import { GameConfig } from "../GameConfig"; import { GameConfig } from "../GameConfig";
import { LoadingState } from "./Enums";
import GameDotMgr from "./GameDotMgr";
import { GameModelManager } from "./model/GameModelManager"; import { GameModelManager } from "./model/GameModelManager";
import AlertDialogViewPresenter from "./ui/presenter/AlertDialogViewPresenter"; import AlertDialogViewPresenter from "./ui/presenter/AlertDialogViewPresenter";
import MainViewPresenter from "./ui/presenter/MainViewPresenter"; import MainViewPresenter from "./ui/presenter/MainViewPresenter";
import { AlertDialogViewProps } from "./ui/view/type/AlertDialogView"; import { AlertDialogViewProps } from "./ui/view/type/AlertDialogView";
import PortraitFixComponent from "../common/components/PortraitFixComponent";
import { ResUtils } from "simba-cc-resutils"; import { ResUtils } from "simba-cc-resutils";
import CCGameCenterComponent from "../cooperation/script/CCGameCenterComponent";
import CCGameCenterNodeFactory from "../cooperation/script/CCGameCenterNodeFactory";
import CustomerServiceDataCenter from "../customerService/script/CustomerServiceDataCenter"; import CustomerServiceDataCenter from "../customerService/script/CustomerServiceDataCenter";
import { EventCenter } from "../cooperation/event/EventCenter";
import { CompositeDisposable } from "../cooperation/event/EventKit";
import UnlockSpecialPlotEventManager from "./model/UnlockSpecialPlotEventManager"; import UnlockSpecialPlotEventManager from "./model/UnlockSpecialPlotEventManager";
import { initExchangeCode } from "simba-sdk-exchangecode"; import { initExchangeCode } from "simba-sdk-exchangecode";
import { CompositeDisposable } from "../event/EventKit";
import { EventCenter } from "../event/EventCenter";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -88,30 +83,6 @@ export default class Launcher extends cc.Component { ...@@ -88,30 +83,6 @@ export default class Launcher extends cc.Component {
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }
if (!this.isLoadGameCenter) return;
//加载矩阵导量UI
try {
this._disposable.add(EventCenter.SHOW_GAME_CENTER_LIST_VIEW.on(this.onShowGameCenterListView));
let gameCenterMomentItem = await ResUtils.loadRes('prefab/cooperation/GameCenterMomentItem', cc.Prefab);
CCGameCenterNodeFactory.getInstance().registerMomentPrefab(gameCenterMomentItem);
let gameCenterBtn = await ResUtils.loadRes('prefab/cooperation/GameCenterBtn', cc.Prefab);
let gameCenterView = await ResUtils.loadRes('prefab/cooperation/GameCenterView', cc.Prefab);
let cooperationItem = await ResUtils.loadRes('prefab/cooperation/CooperationItem', cc.Prefab);
let cCGameCenterComponent = this.node.addComponent(CCGameCenterComponent);
cCGameCenterComponent.gameCenterBtnPrefab = gameCenterBtn;
cCGameCenterComponent.gameCenterViewPrefab = gameCenterView;
cCGameCenterComponent.gameCenterItemPrefab = cooperationItem;
cCGameCenterComponent.gameCenterMomentPrefab = gameCenterMomentItem;
cCGameCenterComponent.gameCenterParentNode = this.node;
cCGameCenterComponent.appID = "wx7a067b995e670485";
cCGameCenterComponent.gameID = "yybs";
cCGameCenterComponent.gameChannel = "wechat";
cCGameCenterComponent.isRelease = !GameConfig.debug;
cCGameCenterComponent.init();
} catch (error) {
console.error(error);
}
}); });
CustomerServiceDataCenter.getInstance().init(); CustomerServiceDataCenter.getInstance().init();
ResUtils.loadRes("audio/bgm/bayinhe", cc.AudioClip); ResUtils.loadRes("audio/bgm/bayinhe", cc.AudioClip);
...@@ -137,10 +108,6 @@ export default class Launcher extends cc.Component { ...@@ -137,10 +108,6 @@ export default class Launcher extends cc.Component {
this._gameCenterViewNode.active = isShow; this._gameCenterViewNode.active = isShow;
} }
fixScreenSize() { fixScreenSize() {
// let comp = this.loadingRoleNode.getComponent(PortraitFixComponent);
// if (comp) {
// comp.fixScreenSize(false);
// }
let sf = this.bgSpr.spriteFrame; let sf = this.bgSpr.spriteFrame;
this.node.getComponent(cc.Widget).updateAlignment(); this.node.getComponent(cc.Widget).updateAlignment();
let sizeSF = sf.getOriginalSize(); let sizeSF = sf.getOriginalSize();
...@@ -153,13 +120,6 @@ export default class Launcher extends cc.Component { ...@@ -153,13 +120,6 @@ export default class Launcher extends cc.Component {
} }
preloadView() { preloadView() {
// let viewList: string[] = [
// 'prefab/ui/MainView',
// 'prefab/ui/MessageView',
// 'prefab/ui/message/MessageEntryItem',
// 'prefab/ui/BedroomView',
// 'prefab/ui/discover/SettingView'
// ]
let viewList: string[] = [ let viewList: string[] = [
'prefab/ui/MainView', 'prefab/ui/MainView',
'prefab/ui/MessageView', 'prefab/ui/MessageView',
...@@ -245,12 +205,9 @@ export default class Launcher extends cc.Component { ...@@ -245,12 +205,9 @@ export default class Launcher extends cc.Component {
await GameModelManager.init((value: number) => { await GameModelManager.init((value: number) => {
AnimationUtils.animateProgress(this.progressBar, value, 1, this.progressLabel); AnimationUtils.animateProgress(this.progressBar, value, 1, this.progressLabel);
}); });
GameDotMgr.getInstance().dotLoading(LoadingState.LoadingStart);
AnimationUtils.animateProgress(this.progressBar, 0.95, 1, this.progressLabel); AnimationUtils.animateProgress(this.progressBar, 0.95, 1, this.progressLabel);
GameDotMgr.getInstance().dotLoading(LoadingState.LoadingEnd);
(await mainViewPromise).start(); (await mainViewPromise).start();
AnimationUtils.animateProgress(this.progressBar, 1.0, 1, this.progressLabel); AnimationUtils.animateProgress(this.progressBar, 1.0, 1, this.progressLabel);
// GameDotMgr.getInstance().dotLoading(LoadingState.EnterLobby);
this.loadingNode.active = false; this.loadingNode.active = false;
//检查是否解锁手表次留番外 //检查是否解锁手表次留番外
UnlockSpecialPlotEventManager.getInstance().nextDayUnlockedSpecialPlot(4); UnlockSpecialPlotEventManager.getInstance().nextDayUnlockedSpecialPlot(4);
......
...@@ -20,7 +20,6 @@ import { IRole, role } from "../../config/Role"; ...@@ -20,7 +20,6 @@ import { IRole, role } from "../../config/Role";
import { taoBaoShopUrlConfig } from "../../config/TaoBaoShopUrlConfig"; import { taoBaoShopUrlConfig } from "../../config/TaoBaoShopUrlConfig";
import { channel } from "../../GameConfig"; import { channel } from "../../GameConfig";
import { AutoPopViewType, DiscoverItemType, FreeState, GuideState, PlotSceneType, PlotSessionState, TutorialState, TutorialType, WorkSpaceTaskState } from "../Enums"; import { AutoPopViewType, DiscoverItemType, FreeState, GuideState, PlotSceneType, PlotSessionState, TutorialState, TutorialType, WorkSpaceTaskState } from "../Enums";
import GameDotMgr from "../GameDotMgr";
import { SpecialToastType } from "../ui/SpecialToast"; import { SpecialToastType } from "../ui/SpecialToast";
import { DatingEventSceneModel, DatingEventStatus } from "./DatingEventSceneModel"; import { DatingEventSceneModel, DatingEventStatus } from "./DatingEventSceneModel";
import GameRoleDataModel from "./GameRoleDataModel"; import GameRoleDataModel from "./GameRoleDataModel";
...@@ -809,7 +808,6 @@ export namespace GameModelManager { ...@@ -809,7 +808,6 @@ export namespace GameModelManager {
if (startedSession >= mainPlotLineSession) {//max is equal if (startedSession >= mainPlotLineSession) {//max is equal
return; return;
} }
GameDotMgr.getInstance().dotPlot(mainPlotLineSession, PlotSessionState.Start);
GameRecord.globalVariables["m_p_l_s"] = mainPlotLineSession; GameRecord.globalVariables["m_p_l_s"] = mainPlotLineSession;
let plotScenTypeSession = GameRecord.globalVariables["p_s_t_s" + plot.plotSceneType] as number; let plotScenTypeSession = GameRecord.globalVariables["p_s_t_s" + plot.plotSceneType] as number;
...@@ -829,39 +827,10 @@ export namespace GameModelManager { ...@@ -829,39 +827,10 @@ export namespace GameModelManager {
*/ */
export function dotMainLinePlotEnd() { export function dotMainLinePlotEnd() {
let mainPlotLineSession = GameRecord.globalVariables["m_p_l_s"] as number; let mainPlotLineSession = GameRecord.globalVariables["m_p_l_s"] as number;
GameDotMgr.getInstance().dotPlot(mainPlotLineSession, PlotSessionState.End);
GameRecord.globalVariables["m_p_l_s"] = mainPlotLineSession + 1; GameRecord.globalVariables["m_p_l_s"] = mainPlotLineSession + 1;
GameRecord.saveRecord(); GameRecord.saveRecord();
} }
/**剧情进度打点 */
export function dotPlotProgress() {
let plot = PlotManager.getCurrentPlots()[0];
let plotScenTypeSession = GameRecord.globalVariables["p_s_t_s" + plot.plotSceneType] as number;
let r = GameRecord.recordVariables["p_s_t_i_p"] as number;
let tt = TutorialType.Message;
switch (plot.plotSceneType) {
case PlotSceneType.Message:
{
tt = TutorialType.Message;
}
break;
case PlotSceneType.DatingEvent:
{
tt = TutorialType.Event;
}
break;
case PlotSceneType.PhoneCall:
{
tt = TutorialType.Phone;
}
break;
}
if (r % 5 === 0 || r < 5) {
GameDotMgr.getInstance().dotTutorial(tt, TutorialState.Progress, { session: plotScenTypeSession, progress: r });
}
}
export function checkFuncUnloced(key: string) { export function checkFuncUnloced(key: string) {
return GameRecord.recordVariables[key] === FuncStateEnum.locked ? false : true; return GameRecord.recordVariables[key] === FuncStateEnum.locked ? false : true;
} }
......
...@@ -7,8 +7,6 @@ import { UIManager } from "../../common/gameplay/managers/UIManager"; ...@@ -7,8 +7,6 @@ import { UIManager } from "../../common/gameplay/managers/UIManager";
import { StringUtils } from "../../common/utils/StringUtils"; import { StringUtils } from "../../common/utils/StringUtils";
import { relationLevelConfig } from "../../config/RelationLevelConfig"; import { relationLevelConfig } from "../../config/RelationLevelConfig";
import { IRole } from "../../config/Role"; import { IRole } from "../../config/Role";
import { CostType, GamePropType } from "../Enums";
import GameDotMgr from "../GameDotMgr";
import { GameModelManager } from "./GameModelManager"; import { GameModelManager } from "./GameModelManager";
export default class GameRoleDataModel { export default class GameRoleDataModel {
......
import { DeepReadonly } from "simba-utils";
import { DailyQuestType } from "../../avg/EditorEnums";
import { GameTextData } from "../../common/gameplay/gamedata/GameTextData";
import { UIManager } from "../../common/gameplay/managers/UIManager";
import { StringUtils } from "../../common/utils/StringUtils";
import { IItemConfig } from "../../config/ItemConfig";
import { CommonLocation, ExposureType, ShowLocationType, ShowType } from "../Enums";
import GameDotMgr from "../GameDotMgr";
import { GameModelManager } from "../model/GameModelManager";
import AlertDialogViewPresenter from "./presenter/AlertDialogViewPresenter";
import { AlertDialogViewProps } from "./view/type/AlertDialogView";
export namespace UIUtils {
// export function showAddEnergy(itemConfig: DeepReadonly<IItemConfig>, itemCount?: number) {
// return new Promise<boolean>((resolve) => {
// itemCount = itemCount === undefined ? 0 : itemCount;
// let isAd = itemCount <= 0;
// let txt = "";
// if (isAd) {
// txt = StringUtils.format(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_PLAYAD_VALUE));
// } else {
// txt = StringUtils.format(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_USEDRINKS_VALUE), itemConfig.energy_recover, itemCount);
// }
// let temp: AlertDialogViewProps =
// {
// dataptr: {},
// titlecontent: GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_NOTENOUGH_VALUE),
// content: txt,
// ishasad: isAd,
// istwobtn: true,
// adconfig: "inject_fruit",
// location: CommonLocation.Energy,
// hasBanner: !isAd,
// callback: (type, ret) => {
// if (ret && !isAd) {
// let player = GameModelManager.getPlayerData();
// player.addProps(itemConfig.id, -1);
// }
// if (ret && type === "video") {
// GameModelManager.addDailyTasks(DailyQuestType.Dq_AdsWatch, 1);
// }
// resolve(ret);
// }
// };
// UIManager.pushPresenter(AlertDialogViewPresenter, temp);
// GameDotMgr.getInstance().dotExposure(ExposureType.Energy);
// })
// };
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "1bb72ec7-33c2-4677-9c00-c7f25632e28b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -11,7 +11,6 @@ import { StringUtils } from "../../../common/utils/StringUtils"; ...@@ -11,7 +11,6 @@ import { StringUtils } from "../../../common/utils/StringUtils";
import { relationLevelConfig } from "../../../config/RelationLevelConfig"; import { relationLevelConfig } from "../../../config/RelationLevelConfig";
import { role } from "../../../config/Role"; import { role } from "../../../config/Role";
import { GuideLocation, GuideOperationType, GuideState, PlotSceneType, TutorialState, TutorialType } from "../../Enums"; import { GuideLocation, GuideOperationType, GuideState, PlotSceneType, TutorialState, TutorialType } from "../../Enums";
import GameDotMgr from "../../GameDotMgr";
import { GameModelManager } from "../../model/GameModelManager"; import { GameModelManager } from "../../model/GameModelManager";
import { MessageSceneModel } from "../../model/MessageSceneModel"; import { MessageSceneModel } from "../../model/MessageSceneModel";
import { RegPresenter } from "../PresenterCCViewFactory"; import { RegPresenter } from "../PresenterCCViewFactory";
...@@ -70,11 +69,6 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList ...@@ -70,11 +69,6 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList
onSelectIndexCallback: this.onSelectIndexCallback onSelectIndexCallback: this.onSelectIndexCallback
}; };
UIManager.pushPresenter(SentenceSelectorViewPresenter, props); UIManager.pushPresenter(SentenceSelectorViewPresenter, props);
let t = GameModelManager.checkIsDotTutorial();
if (t) {
let plotScenTypeSession = GameRecord.globalVariables["p_s_t_s" + PlotSceneType.Message] as number;
GameDotMgr.getInstance().dotTutorial(TutorialType.Message, TutorialState.SelectSentence, { session: plotScenTypeSession, plotId: this._currPlot!.id });
}
} }
} }
...@@ -288,7 +282,6 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList ...@@ -288,7 +282,6 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList
private nextPlot = async (index?: number) => { private nextPlot = async (index?: number) => {
if (this.isClosed()) return; if (this.isClosed()) return;
if (this._currPlot) { if (this._currPlot) {
GameModelManager.dotPlotProgress();
await PlotManager.completePlot(this._currPlot!, index, this._plotChangeLike ? { addlike: this._plotChangeLike } : undefined); await PlotManager.completePlot(this._currPlot!, index, this._plotChangeLike ? { addlike: this._plotChangeLike } : undefined);
} else { } else {
console.error("ChatList: Plot error! No current plot!"); console.error("ChatList: Plot error! No current plot!");
...@@ -401,10 +394,8 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList ...@@ -401,10 +394,8 @@ export class ChatListViewPresenter extends Presenter<MessageSceneModel, ChatList
GameRecord.globalVariables["guide_chat_back"] = GuideState.Complete; GameRecord.globalVariables["guide_chat_back"] = GuideState.Complete;
GameRecord.saveRecord(); GameRecord.saveRecord();
this.closeAction(); this.closeAction();
GameDotMgr.getInstance().dotGuide(GuideOperationType.Click, location);
} }
UIManager.pushPresenter(GuideViewPresenter, m); UIManager.pushPresenter(GuideViewPresenter, m);
GameDotMgr.getInstance().dotGuide(GuideOperationType.Show, location);
} }
} }
......
...@@ -394,7 +394,6 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> { ...@@ -394,7 +394,6 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> {
} }
} }
UIManager.pushPresenter(GuideViewPresenter, m); UIManager.pushPresenter(GuideViewPresenter, m);
GameDotMgr.getInstance().dotGuide(GuideOperationType.Show, GuideLocation.EventItem);
} }
} }
this.refreshArrowGuide(); this.refreshArrowGuide();
...@@ -425,7 +424,6 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> { ...@@ -425,7 +424,6 @@ export class DatingEventSubpresenter extends Subpresenter<DatingEventSubview> {
if (ret) { if (ret) {
let oprType = this.isReview ? EventOperationType.memory : EventOperationType.event; let oprType = this.isReview ? EventOperationType.memory : EventOperationType.event;
let location = EventLocation.ClickEnergyCost; let location = EventLocation.ClickEnergyCost;
GameDotMgr.getInstance().dotEvent(oprType, location);
let role = GameModelManager.getPlayerData(); let role = GameModelManager.getPlayerData();
let key = param["key"] as string; let key = param["key"] as string;
let m = this._modelMap[key]; let m = this._modelMap[key];
......
...@@ -221,9 +221,7 @@ export class DatingScenePresenter extends Presenter<DatingEventSceneModel, Datin ...@@ -221,9 +221,7 @@ export class DatingScenePresenter extends Presenter<DatingEventSceneModel, Datin
UIManager.pushPresenter(SentenceSelectorViewPresenter, props); UIManager.pushPresenter(SentenceSelectorViewPresenter, props);
// await this.view.setContent(true, "", roleData.getConfig().name, roleData.getPortrait(this._currPlot!.face), otherPortrait, isShowRouge); // await this.view.setContent(true, "", roleData.getConfig().name, roleData.getPortrait(this._currPlot!.face), otherPortrait, isShowRouge);
await this.view.setContent(true, "", roleData.getNameIcon(), roleData.getConfig().name, this.getPortraitByRole(roleData, this._currPlot!.face), otherPortrait, isShowRouge); await this.view.setContent(true, "", roleData.getNameIcon(), roleData.getConfig().name, this.getPortraitByRole(roleData, this._currPlot!.face), otherPortrait, isShowRouge);
if (this._isDotTutorial) {
// GameDotMgr.getInstance().dotTutorial(TutorialType.Event, TutorialState.SelectSentence, { session: this._model.config.id, plotId: this._currPlot.id });
}
} else { } else {
await setSelection(); await setSelection();
} }
...@@ -330,13 +328,6 @@ export class DatingScenePresenter extends Presenter<DatingEventSceneModel, Datin ...@@ -330,13 +328,6 @@ export class DatingScenePresenter extends Presenter<DatingEventSceneModel, Datin
} }
} else { } else {
this._model.status = DatingEventStatus.InProgress; this._model.status = DatingEventStatus.InProgress;
if (this._isDotTutorial) {
let session = this._model.config.id;
if (content && content.type === SentenceType.SELECT) {
// GameDotMgr.getInstance().dotTutorial(TutorialType.Event, TutorialState.SelectSentenceRet, { session: session, plotId: this._currPlot.id, select: this._currSelect })
}
GameModelManager.dotPlotProgress();
}
let nextPlots = await PlotManager.completePlot(this._currPlot, this._currSelect); let nextPlots = await PlotManager.completePlot(this._currPlot, this._currSelect);
this._currPlot = nextPlots[this._plotBranch] as DatingPlot; this._currPlot = nextPlots[this._plotBranch] as DatingPlot;
} }
......
...@@ -123,10 +123,6 @@ export default class ExchangeCodeViewPresenter extends Presenter<ExchangeCodePar ...@@ -123,10 +123,6 @@ export default class ExchangeCodeViewPresenter extends Presenter<ExchangeCodePar
UnlockSpecialPlotEventManager.getInstance().cdKeyUnlockSpecialPlot(specialPlotId, itemId); UnlockSpecialPlotEventManager.getInstance().cdKeyUnlockSpecialPlot(specialPlotId, itemId);
} else if (id === GameConstData.UNLOCK_PLOT_WITHOUT_AD) { } else if (id === GameConstData.UNLOCK_PLOT_WITHOUT_AD) {
CDKeyEventManager.getInstance().cdKeyRemovePlotAD(); CDKeyEventManager.getInstance().cdKeyRemovePlotAD();
//兑换码兑换成功打点
if (SDK.getLoginInfo()!.playerId) {
GameDotMgr.getInstance().dotExchangeCodeSuccess(SDK.getLoginInfo()!.playerId, GameConstData.UNLOCK_PLOT_WITHOUT_AD.toString());
}
} else if (id >= GameConstData.CHANGE_ROLE_LIKE && id < 3000) { } else if (id >= GameConstData.CHANGE_ROLE_LIKE && id < 3000) {
let roleId = id - GameConstData.CHANGE_ROLE_LIKE; let roleId = id - GameConstData.CHANGE_ROLE_LIKE;
CDKeyEventManager.getInstance().changeRoleLike(roleId, count); CDKeyEventManager.getInstance().changeRoleLike(roleId, count);
......
...@@ -304,7 +304,6 @@ export class ExtraPlotDatingEventSubViewPresenter extends Subpresenter<ExtraPlot ...@@ -304,7 +304,6 @@ export class ExtraPlotDatingEventSubViewPresenter extends Subpresenter<ExtraPlot
} }
} }
UIManager.pushPresenter(GuideViewPresenter, m); UIManager.pushPresenter(GuideViewPresenter, m);
GameDotMgr.getInstance().dotGuide(GuideOperationType.Show, GuideLocation.EventItem);
} }
} }
} }
......
...@@ -140,8 +140,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -140,8 +140,6 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
this._disposable.add(GameModelManager.RefreshDiscoverTabRed.on(this.onRefreshDiscoveryRedDot)); this._disposable.add(GameModelManager.RefreshDiscoverTabRed.on(this.onRefreshDiscoveryRedDot));
this._disposable.add(GameModelManager.ShowPlotBlocked.on(this.onShowPlotBlocked)); this._disposable.add(GameModelManager.ShowPlotBlocked.on(this.onShowPlotBlocked));
this._disposable.add(GameModelManager.MainTabForceClick.on(this.onMainTabForceClick));
// this._disposable.add(GameModelManager.CheckMainTabGuide.on(this.checkTabGuide));
this._disposable.add(GameModelManager.AutoPopView.on(this.onAutoPopView)); this._disposable.add(GameModelManager.AutoPopView.on(this.onAutoPopView));
this._disposable.add(GameModelManager.UnlockItem.on(this.onUnlockItem)); this._disposable.add(GameModelManager.UnlockItem.on(this.onUnlockItem));
...@@ -340,10 +338,8 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -340,10 +338,8 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
m.call = () => { m.call = () => {
this.onTabClick(index); this.onTabClick(index);
this.view.hideClickAniByIndex(index); this.view.hideClickAniByIndex(index);
GameDotMgr.getInstance().dotGuide(GuideOperationType.Click, location);
} }
UIManager.pushPresenter(GuideViewPresenter, m); UIManager.pushPresenter(GuideViewPresenter, m);
GameDotMgr.getInstance().dotGuide(GuideOperationType.Show, location);
} }
} }
} }
...@@ -380,10 +376,7 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> { ...@@ -380,10 +376,7 @@ export default class MainViewPresenter extends Presenter<undefined, MainView> {
} }
onShowPlotBlocked = () => { onShowPlotBlocked = () => {
let plotId: number = GameModelManager.getCurPlotBlockedId();
// GameDotMgr.getInstance().dotExposure(StringUtils.format(ExposureType.Plotblock, plotId));
GameModelManager.registerAutoPopView(AutoPopViewType.PlotStop); GameModelManager.registerAutoPopView(AutoPopViewType.PlotStop);
} }
onMainPlotChanged = async (pType: PlotSceneType, pId: number) => { onMainPlotChanged = async (pType: PlotSceneType, pId: number) => {
......
...@@ -222,7 +222,6 @@ export default class MessageViewPresenter extends Presenter<undefined, MessageVi ...@@ -222,7 +222,6 @@ export default class MessageViewPresenter extends Presenter<undefined, MessageVi
} }
addGraceClickCallBack = (roleId: number) => { addGraceClickCallBack = (roleId: number) => {
// GameDotMgr.getInstance().dotClickUI("click_grace");
let r = GameModelManager.getRoleData(roleId); let r = GameModelManager.getRoleData(roleId);
if (!r || r!.getConfig().RoleType !== RoleType.Role_Major) { if (!r || r!.getConfig().RoleType !== RoleType.Role_Major) {
return; return;
...@@ -300,7 +299,6 @@ export default class MessageViewPresenter extends Presenter<undefined, MessageVi ...@@ -300,7 +299,6 @@ export default class MessageViewPresenter extends Presenter<undefined, MessageVi
} }
} }
UIManager.pushPresenter(GuideViewPresenter, m); UIManager.pushPresenter(GuideViewPresenter, m);
GameDotMgr.getInstance().dotGuide(GuideOperationType.Show, GuideLocation.MsgItem);
} }
} }
} }
......
...@@ -4,8 +4,6 @@ import { Presenter } from "../../../common/classbase/PresenterBase"; ...@@ -4,8 +4,6 @@ import { Presenter } from "../../../common/classbase/PresenterBase";
import { GetRewardType } from "../../../common/gameplay/gamedata/GameEnumData"; import { GetRewardType } from "../../../common/gameplay/gamedata/GameEnumData";
import { GameTextData } from "../../../common/gameplay/gamedata/GameTextData"; import { GameTextData } from "../../../common/gameplay/gamedata/GameTextData";
import { UIManager } from "../../../common/gameplay/managers/UIManager"; import { UIManager } from "../../../common/gameplay/managers/UIManager";
import { CommonLocation, ShowLocationType, ShowType } from "../../Enums";
import GameDotMgr from "../../GameDotMgr";
import { GameModelManager } from "../../model/GameModelManager"; import { GameModelManager } from "../../model/GameModelManager";
import { RegPresenter } from "../PresenterCCViewFactory"; import { RegPresenter } from "../PresenterCCViewFactory";
import { PlotStopView, PlotStopViewProps, PlotStopViewType } from "../view/type/PlotStopView"; import { PlotStopView, PlotStopViewProps, PlotStopViewType } from "../view/type/PlotStopView";
...@@ -19,7 +17,6 @@ export default class PlotStopViewPresenter extends Presenter<undefined, PlotStop ...@@ -19,7 +17,6 @@ export default class PlotStopViewPresenter extends Presenter<undefined, PlotStop
initViewProps() { initViewProps() {
this._viewProps = { this._viewProps = {
unlockPlotCallbackFunc: this.unlockPlotCallbackFunc, unlockPlotCallbackFunc: this.unlockPlotCallbackFunc,
onAdBtnOption: this.onAdBtnOption,
onAddRes: this.onAddRes, onAddRes: this.onAddRes,
onCancelAdCallback: this.onCancelAdCallback, onCancelAdCallback: this.onCancelAdCallback,
} }
...@@ -33,11 +30,6 @@ export default class PlotStopViewPresenter extends Presenter<undefined, PlotStop ...@@ -33,11 +30,6 @@ export default class PlotStopViewPresenter extends Presenter<undefined, PlotStop
this.initViewProps(); this.initViewProps();
this._view.setProps(this._viewProps); this._view.setProps(this._viewProps);
this.view.adButton.loadSVConfig(); this.view.adButton.loadSVConfig();
let t = this.view.getSvBtnType();
if (t && t === "share" || t === "video") {
this.onAdBtnOption(ShowType.SHOW, t);
}
} }
onClose() { onClose() {
super.onClose(); super.onClose();
...@@ -55,19 +47,6 @@ export default class PlotStopViewPresenter extends Presenter<undefined, PlotStop ...@@ -55,19 +47,6 @@ export default class PlotStopViewPresenter extends Presenter<undefined, PlotStop
} }
onAdBtnOption = (optionType: ShowType, adType: "share" | "video", ret?: boolean) => {
let location = CommonLocation.Nextplot;
if (adType === "share") {
GameDotMgr.getInstance().dotShare(optionType, ShowLocationType.Share + location);
}
if (adType === "video") {
GameDotMgr.getInstance().dotVideo(optionType, ShowLocationType.Video + location);
}
if (optionType === ShowType.FINISH && ret && adType === "video") {
// GameModelManager.addDailyTasks(DailyQuestType.Dq_AdsWatch, 1);
}
}
onCancelAdCallback(type: GetRewardType) { onCancelAdCallback(type: GetRewardType) {
let content: string = ""; let content: string = "";
if (type == GetRewardType.Ad) { if (type == GetRewardType.Ad) {
......
...@@ -4,16 +4,13 @@ import { PageIndex } from "../../../../avg/EditorEnums"; ...@@ -4,16 +4,13 @@ import { PageIndex } from "../../../../avg/EditorEnums";
import { Presenter } from "../../../../common/classbase/PresenterBase"; import { Presenter } from "../../../../common/classbase/PresenterBase";
import { GameTextData } from "../../../../common/gameplay/gamedata/GameTextData"; import { GameTextData } from "../../../../common/gameplay/gamedata/GameTextData";
import { UIManager } from "../../../../common/gameplay/managers/UIManager"; import { UIManager } from "../../../../common/gameplay/managers/UIManager";
import { GameConfig } from "../../../../GameConfig";
import GameDotMgr from "../../../GameDotMgr"; import GameDotMgr from "../../../GameDotMgr";
import { GameModelManager } from "../../../model/GameModelManager"; import { GameModelManager } from "../../../model/GameModelManager";
import { HttpRequests } from "../../../network/HttpRequests";
import { RegPresenter } from "../../PresenterCCViewFactory"; import { RegPresenter } from "../../PresenterCCViewFactory";
import { DiscoverSettingView, DiscoverSettingViewType } from "../../view/type/discover/DiscoverSettingView"; import { DiscoverSettingView, DiscoverSettingViewType } from "../../view/type/discover/DiscoverSettingView";
import { SourceView } from "../../view/type/notice/NewNoticeView"; import { SourceView } from "../../view/type/notice/NewNoticeView";
import ExchangeCodeViewPresenter from "../ExchangeCodeViewPresenter"; import ExchangeCodeViewPresenter from "../ExchangeCodeViewPresenter";
import NewNoticeViewPresenter from "../notice/NewNoticeViewPresenter"; import NewNoticeViewPresenter from "../notice/NewNoticeViewPresenter";
import NoticeViewPresenter from "../NoticeViewPresenter";
@RegPresenter(DiscoverSettingViewType) @RegPresenter(DiscoverSettingViewType)
export class DiscoverSettingViewPresenter extends Presenter<undefined, DiscoverSettingView> { export class DiscoverSettingViewPresenter extends Presenter<undefined, DiscoverSettingView> {
...@@ -47,7 +44,6 @@ export class DiscoverSettingViewPresenter extends Presenter<undefined, DiscoverS ...@@ -47,7 +44,6 @@ export class DiscoverSettingViewPresenter extends Presenter<undefined, DiscoverS
} }
toggleNotice = () => {//公告 toggleNotice = () => {//公告
// GameDotMgr.getInstance().dotClickUI("click_notice");
UIManager.pushPresenter(NewNoticeViewPresenter, SourceView.SettingView); UIManager.pushPresenter(NewNoticeViewPresenter, SourceView.SettingView);
} }
......
...@@ -118,14 +118,6 @@ export default class AlertDialogViewImpl extends CCPureView<AlertDialogViewProps ...@@ -118,14 +118,6 @@ export default class AlertDialogViewImpl extends CCPureView<AlertDialogViewProps
this.adsvbtn.onResult = ((type, ret) => { this.adsvbtn.onResult = ((type, ret) => {
this._props.callback(type, ret, this._props.dataptr); this._props.callback(type, ret, this._props.dataptr);
if (ret && this._props.location) {
if (type === "share") {
GameDotMgr.getInstance().dotShare(ShowType.FINISH, ShowLocationType.Share + this._props.location);
}
if (type === "video") {
GameDotMgr.getInstance().dotVideo(ShowType.FINISH, ShowLocationType.Video + this._props.location);
}
}
this.closeView(); this.closeView();
}); });
...@@ -173,17 +165,6 @@ export default class AlertDialogViewImpl extends CCPureView<AlertDialogViewProps ...@@ -173,17 +165,6 @@ export default class AlertDialogViewImpl extends CCPureView<AlertDialogViewProps
} }
onADBtnClick() { onADBtnClick() {
let type = this.getSvBtnType();
if (type && "" !== type.trim()) {
if (this._props.location) {
if (type === "share") {
GameDotMgr.getInstance().dotShare(ShowType.CLICK, ShowLocationType.Share + this._props.location);
}
if (type === "video") {
GameDotMgr.getInstance().dotVideo(ShowType.CLICK, ShowLocationType.Video + this._props.location);
}
}
}
this.opacityBtn.active = true; this.opacityBtn.active = true;
} }
...@@ -206,15 +187,6 @@ export default class AlertDialogViewImpl extends CCPureView<AlertDialogViewProps ...@@ -206,15 +187,6 @@ export default class AlertDialogViewImpl extends CCPureView<AlertDialogViewProps
if (props.adconfig && "" !== props.adconfig.trim()) { if (props.adconfig && "" !== props.adconfig.trim()) {
this.adsvbtn.sharePointId = props.adconfig; this.adsvbtn.sharePointId = props.adconfig;
this.adsvbtn.loadSVConfig(); this.adsvbtn.loadSVConfig();
let svType = this.getSvBtnType();
if (svType && "" !== svType.trim() && props.location && props.ishasad) {
if (svType === "share") {
GameDotMgr.getInstance().dotShare(ShowType.SHOW, ShowLocationType.Share + props.location);
}
if (svType === "video") {
GameDotMgr.getInstance().dotVideo(ShowType.SHOW, ShowLocationType.Video + props.location);
}
}
} }
} }
} }
......
import { DummyNode } from "../../../../common/CCDummyObjects"; import { DummyNode } from "../../../../common/CCDummyObjects";
import { UIManager } from "../../../../common/gameplay/managers/UIManager"; import { UIManager } from "../../../../common/gameplay/managers/UIManager";
import { AnimationUtils } from "../../../../common/utils/AnimationUtils"; import { AnimationUtils } from "../../../../common/utils/AnimationUtils";
import CCGameCenterNodeFactory from "../../../../cooperation/script/CCGameCenterNodeFactory";
import { GameConfig } from "../../../../GameConfig"; import { GameConfig } from "../../../../GameConfig";
import { GameModelManager } from "../../../model/GameModelManager"; import { GameModelManager } from "../../../model/GameModelManager";
...@@ -11,10 +10,6 @@ const { ccclass, property } = cc._decorator ...@@ -11,10 +10,6 @@ const { ccclass, property } = cc._decorator
export class AlertToBeContinueImpl extends cc.Component { export class AlertToBeContinueImpl extends cc.Component {
@property(cc.Node) @property(cc.Node)
momentNode: cc.Node = DummyNode; momentNode: cc.Node = DummyNode;
onLoad() {
this.momentNode.addChild(CCGameCenterNodeFactory.getInstance().getMomentNode()!);
}
//#region editor bindings //#region editor bindings
closeAction() { closeAction() {
// this.node.destroy(); // this.node.destroy();
...@@ -32,6 +27,5 @@ export async function showToBeContinue() { ...@@ -32,6 +27,5 @@ export async function showToBeContinue() {
if (!GameConfig.showToBeContinue) { if (!GameConfig.showToBeContinue) {
GameConfig.showToBeContinue = true; GameConfig.showToBeContinue = true;
await UIManager.showAlert("prefab/ui/ToBeContinue"); await UIManager.showAlert("prefab/ui/ToBeContinue");
// GameDotMgr.getInstance().dotExposure(ExposureType.Continue);
} }
} }
\ No newline at end of file
...@@ -77,15 +77,12 @@ export class DiscoverViewImpl extends CCPureView<DiscoverViewProps> implements D ...@@ -77,15 +77,12 @@ export class DiscoverViewImpl extends CCPureView<DiscoverViewProps> implements D
onTabClick(target: cc.Button, data: string) { onTabClick(target: cc.Button, data: string) {
switch (parseInt(data)) { switch (parseInt(data)) {
case Tabs.forum: case Tabs.forum:
// GameDotMgr.getInstance().dotClickUI("click_forum");
this._props.onItemClick(DiscoverItemType.Forum); this._props.onItemClick(DiscoverItemType.Forum);
break; break;
case Tabs.edit: case Tabs.edit:
// GameDotMgr.getInstance().dotClickUI("click_setting");
this._props.onItemClick(DiscoverItemType.Settings); this._props.onItemClick(DiscoverItemType.Settings);
break; break;
case Tabs.customerService: case Tabs.customerService:
// GameDotMgr.getInstance().dotClickUI("click_customerService");
this._props.onItemClick(DiscoverItemType.CustomerService); this._props.onItemClick(DiscoverItemType.CustomerService);
break; break;
case Tabs.productionTeam: case Tabs.productionTeam:
......
...@@ -7,7 +7,6 @@ import { ResUtils } from "simba-cc-resutils"; ...@@ -7,7 +7,6 @@ import { ResUtils } from "simba-cc-resutils";
import { AudioManager } from "simba-cc-audio-manager"; import { AudioManager } from "simba-cc-audio-manager";
import { GameTextData } from "../../../../common/gameplay/gamedata/GameTextData"; import { GameTextData } from "../../../../common/gameplay/gamedata/GameTextData";
import { GameModelManager } from "../../../model/GameModelManager"; import { GameModelManager } from "../../../model/GameModelManager";
import GameDotMgr from "../../../GameDotMgr";
import Typewriter from "../../../../common/components/Typewriter"; import Typewriter from "../../../../common/components/Typewriter";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -64,7 +63,6 @@ export class PhoneCallViewImpl extends CCPureView<PhoneCallViewProps> implements ...@@ -64,7 +63,6 @@ export class PhoneCallViewImpl extends CCPureView<PhoneCallViewProps> implements
this._isPlayMusic = true; this._isPlayMusic = true;
}, 0.8); }, 0.8);
}))); })));
// GameDotMgr.getInstance().dotClickUI("click_phone_reject");
} }
playPhoneMusic = async () => { playPhoneMusic = async () => {
...@@ -94,7 +92,6 @@ export class PhoneCallViewImpl extends CCPureView<PhoneCallViewProps> implements ...@@ -94,7 +92,6 @@ export class PhoneCallViewImpl extends CCPureView<PhoneCallViewProps> implements
if (!PhoneCallListAutoNextPlot) { if (!PhoneCallListAutoNextPlot) {
if (!this._excuting) { if (!this._excuting) {
this._excuting = true; this._excuting = true;
GameModelManager.dotPlotProgress();
this._props.onCompletePlot(this._selectIndex); this._props.onCompletePlot(this._selectIndex);
this._selectIndex = undefined; this._selectIndex = undefined;
this.scheduleOnce(() => { this.scheduleOnce(() => {
......
...@@ -28,7 +28,6 @@ export default class PlotStopViewImpl extends CCPureView<PlotStopViewProps> impl ...@@ -28,7 +28,6 @@ export default class PlotStopViewImpl extends CCPureView<PlotStopViewProps> impl
} else { } else {
this._props.onCancelAdCallback(this.svType); this._props.onCancelAdCallback(this.svType);
} }
this._props.onAdBtnOption(ShowType.FINISH, type, ret);
} }
} }
...@@ -73,13 +72,6 @@ export default class PlotStopViewImpl extends CCPureView<PlotStopViewProps> impl ...@@ -73,13 +72,6 @@ export default class PlotStopViewImpl extends CCPureView<PlotStopViewProps> impl
this._props.unlockPlotCallbackFunc(); this._props.unlockPlotCallbackFunc();
} }
onAdClick() {
let t = this.getSvBtnType();
if (t && t === "share" || t === "video") {
this._props.onAdBtnOption(ShowType.CLICK, t);
}
}
getSvBtnType = (): string => { getSvBtnType = (): string => {
let ret = "share"; let ret = "share";
if (this.adButton.svPoint) { if (this.adButton.svPoint) {
......
...@@ -9,7 +9,6 @@ import { GameTextData } from "../../../../../common/gameplay/gamedata/GameTextDa ...@@ -9,7 +9,6 @@ import { GameTextData } from "../../../../../common/gameplay/gamedata/GameTextDa
import { UIManager } from "../../../../../common/gameplay/managers/UIManager"; import { UIManager } from "../../../../../common/gameplay/managers/UIManager";
import { characterVoiceConfig, ICharacterVoiceConfig } from "../../../../../config/CharacterVoiceConfig"; import { characterVoiceConfig, ICharacterVoiceConfig } from "../../../../../config/CharacterVoiceConfig";
import { CommonLocation, ExposureType } from "../../../../Enums"; import { CommonLocation, ExposureType } from "../../../../Enums";
import GameDotMgr from "../../../../GameDotMgr";
import { GameModelManager } from "../../../../model/GameModelManager"; import { GameModelManager } from "../../../../model/GameModelManager";
import AlertDialogViewPresenter from "../../../presenter/AlertDialogViewPresenter"; import AlertDialogViewPresenter from "../../../presenter/AlertDialogViewPresenter";
import { ImagePreviewPresenter } from "../../../presenter/message/ImagePreviewPresenter"; import { ImagePreviewPresenter } from "../../../presenter/message/ImagePreviewPresenter";
...@@ -127,7 +126,7 @@ export default class ChatBubbleView extends cc.Component { ...@@ -127,7 +126,7 @@ export default class ChatBubbleView extends cc.Component {
return new Promise((resolve) => { return new Promise((resolve) => {
this._timer = setTimeout(() => { this._timer = setTimeout(() => {
this._timer = undefined; this._timer = undefined;
resolve(); resolve(null);
}, time * 1000); }, time * 1000);
}); });
} }
...@@ -272,7 +271,6 @@ export default class ChatBubbleView extends cc.Component { ...@@ -272,7 +271,6 @@ export default class ChatBubbleView extends cc.Component {
let hasAd = cfg.ads === 1; let hasAd = cfg.ads === 1;
let needAd = GameModelManager.checkVoiceNeedShowAD(this._voiceCfg); let needAd = GameModelManager.checkVoiceNeedShowAD(this._voiceCfg);
if (hasAd && needAd) { if (hasAd && needAd) {
// GameDotMgr.getInstance().dotExposure(ExposureType.Audio);
let curMainLinePlotId: number = GameModelManager.getCurMainLinePlotId(); let curMainLinePlotId: number = GameModelManager.getCurMainLinePlotId();
if (curMainLinePlotId === pid) { if (curMainLinePlotId === pid) {
this.autoPopVoiceDialog(false); this.autoPopVoiceDialog(false);
......
...@@ -76,7 +76,6 @@ export class GiftListItemImpl extends CCPureView<GiftListItemProps & { onClick: ...@@ -76,7 +76,6 @@ export class GiftListItemImpl extends CCPureView<GiftListItemProps & { onClick:
} }
showEnterStoreAlert() { showEnterStoreAlert() {
// GameDotMgr.getInstance().dotShopTotal(DotShopTotalType.Popup, { popType: "nohave_show" });
let temp: AlertDialogViewProps = let temp: AlertDialogViewProps =
{ {
dataptr: {}, dataptr: {},
...@@ -89,13 +88,6 @@ export class GiftListItemImpl extends CCPureView<GiftListItemProps & { onClick: ...@@ -89,13 +88,6 @@ export class GiftListItemImpl extends CCPureView<GiftListItemProps & { onClick:
hasBanner: false, hasBanner: false,
callback: (type, ret: boolean, param: any) => { callback: (type, ret: boolean, param: any) => {
SDK.hideBannerAd(); SDK.hideBannerAd();
if (ret) {
GameModelManager.MainTabForceClick.emit({ index: MainTabs.bedroomTab, pureClick: false, propId: parseInt(this._props.key) });
// GameDotMgr.getInstance().dotShopTotal(DotShopTotalType.Popup, { popType: "click_popup" });
if (type === "video") {
// GameModelManager.addDailyTasks(DailyQuestType.Dq_AdsWatch, 1);
}
}
} }
}; };
UIManager.pushPresenter(AlertDialogViewPresenter, temp); UIManager.pushPresenter(AlertDialogViewPresenter, temp);
......
...@@ -7,7 +7,6 @@ import { GameTextData } from "../../../../../common/gameplay/gamedata/GameTextDa ...@@ -7,7 +7,6 @@ import { GameTextData } from "../../../../../common/gameplay/gamedata/GameTextDa
import { UIManager } from "../../../../../common/gameplay/managers/UIManager"; import { UIManager } from "../../../../../common/gameplay/managers/UIManager";
import { StringUtils } from "../../../../../common/utils/StringUtils"; import { StringUtils } from "../../../../../common/utils/StringUtils";
import { SpecialDateContentStatus, SpecialDateContentType } from "../../../../Enums"; import { SpecialDateContentStatus, SpecialDateContentType } from "../../../../Enums";
import GameDotMgr from "../../../../GameDotMgr";
import { GameModelManager } from "../../../../model/GameModelManager"; import { GameModelManager } from "../../../../model/GameModelManager";
import AlertDialogViewPresenter from "../../../presenter/AlertDialogViewPresenter"; import AlertDialogViewPresenter from "../../../presenter/AlertDialogViewPresenter";
import { RegView } from "../../../PresenterCCViewFactory"; import { RegView } from "../../../PresenterCCViewFactory";
...@@ -51,15 +50,6 @@ export default class SentenceSelectorViewImpl extends CCPureView<SentenceSelecto ...@@ -51,15 +50,6 @@ export default class SentenceSelectorViewImpl extends CCPureView<SentenceSelecto
onButtonClick = (index: number, hasSpecial: boolean, specialType: SpecialDateContentType, specialStatus: SpecialDateContentStatus) => { onButtonClick = (index: number, hasSpecial: boolean, specialType: SpecialDateContentType, specialStatus: SpecialDateContentStatus) => {
return () => { return () => {
if (this._props.isFromDate && hasSpecial && this._props.dateSceneId && this._props.plotId) {
GameDotMgr.getInstance().dotSpecialPlot(
this._props.dateSceneId,
this._props.plotId,
index,
specialType,
specialStatus
);
}
this._props.onSelectIndexCallback(index); this._props.onSelectIndexCallback(index);
} }
} }
...@@ -153,15 +143,6 @@ export default class SentenceSelectorViewImpl extends CCPureView<SentenceSelecto ...@@ -153,15 +143,6 @@ export default class SentenceSelectorViewImpl extends CCPureView<SentenceSelecto
node.on("click", () => { node.on("click", () => {
// UIManager.showToast(tipStr); // UIManager.showToast(tipStr);
this.showSpecialPlotTip(titleStr, tipStr); this.showSpecialPlotTip(titleStr, tipStr);
if (this._props.isFromDate && hasSpecial && this._props.dateSceneId && this._props.plotId) {
GameDotMgr.getInstance().dotSpecialPlot(
this._props.dateSceneId,
this._props.plotId,
index,
specialType,
specialStatus
);
}
}); });
} else { } else {
node.on("click", this.onButtonClick(index, hasSpecial, specialType, specialStatus)); node.on("click", this.onButtonClick(index, hasSpecial, specialType, specialStatus));
......
...@@ -7,7 +7,6 @@ type CancelAdCallback = (type: GetRewardType) => void; ...@@ -7,7 +7,6 @@ type CancelAdCallback = (type: GetRewardType) => void;
export interface PlotStopViewProps { export interface PlotStopViewProps {
unlockPlotCallbackFunc: Function; unlockPlotCallbackFunc: Function;
onAdBtnOption: OnAdBtnOption;
onCancelAdCallback: CancelAdCallback; onCancelAdCallback: CancelAdCallback;
onAddRes:OnAddRes; onAddRes:OnAddRes;
......
...@@ -65,7 +65,6 @@ let PhoneCallViewImpl = /** @class */ (() => { ...@@ -65,7 +65,6 @@ let PhoneCallViewImpl = /** @class */ (() => {
this._isPlayMusic = true; this._isPlayMusic = true;
}, 0.8); }, 0.8);
}))); })));
// GameDotMgr.getInstance().dotClickUI("click_phone_reject");
} }
onAcceptCall() { onAcceptCall() {
this.callingNode.active = false; this.callingNode.active = false;
...@@ -84,7 +83,6 @@ let PhoneCallViewImpl = /** @class */ (() => { ...@@ -84,7 +83,6 @@ let PhoneCallViewImpl = /** @class */ (() => {
if (!PhoneCallView_1.PhoneCallListAutoNextPlot) { if (!PhoneCallView_1.PhoneCallListAutoNextPlot) {
if (!this._excuting) { if (!this._excuting) {
this._excuting = true; this._excuting = true;
GameModelManager_1.GameModelManager.dotPlotProgress();
this._props.onCompletePlot(this._selectIndex); this._props.onCompletePlot(this._selectIndex);
this._selectIndex = undefined; this._selectIndex = undefined;
this.scheduleOnce(() => { this.scheduleOnce(() => {
......
...@@ -18,7 +18,6 @@ const CCDummyObjects_1 = require("../../../../../common/CCDummyObjects"); ...@@ -18,7 +18,6 @@ const CCDummyObjects_1 = require("../../../../../common/CCDummyObjects");
const CCViewBase_1 = require("../../../../../common/classbase/CCViewBase"); const CCViewBase_1 = require("../../../../../common/classbase/CCViewBase");
const GameTextData_1 = require("../../../../../common/gameplay/gamedata/GameTextData"); const GameTextData_1 = require("../../../../../common/gameplay/gamedata/GameTextData");
const UIManager_1 = require("../../../../../common/gameplay/managers/UIManager"); const UIManager_1 = require("../../../../../common/gameplay/managers/UIManager");
const Enums_1 = require("../../../../Enums");
const GameModelManager_1 = require("../../../../model/GameModelManager"); const GameModelManager_1 = require("../../../../model/GameModelManager");
const AlertDialogViewPresenter_1 = require("../../../presenter/AlertDialogViewPresenter"); const AlertDialogViewPresenter_1 = require("../../../presenter/AlertDialogViewPresenter");
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -76,7 +75,6 @@ let GiftListItemImpl = /** @class */ (() => { ...@@ -76,7 +75,6 @@ let GiftListItemImpl = /** @class */ (() => {
// this.node.on(cc.Node.EventType.) // this.node.on(cc.Node.EventType.)
} }
showEnterStoreAlert() { showEnterStoreAlert() {
// GameDotMgr.getInstance().dotShopTotal(DotShopTotalType.Popup, { popType: "nohave_show" });
let temp = { let temp = {
dataptr: {}, dataptr: {},
titlecontent: GameModelManager_1.GameModelManager.getLanguageTxt(GameTextData_1.GameTextData.GAME_TEXT_NO_THIS_PROP_TITLE_VALUE), titlecontent: GameModelManager_1.GameModelManager.getLanguageTxt(GameTextData_1.GameTextData.GAME_TEXT_NO_THIS_PROP_TITLE_VALUE),
...@@ -88,13 +86,6 @@ let GiftListItemImpl = /** @class */ (() => { ...@@ -88,13 +86,6 @@ let GiftListItemImpl = /** @class */ (() => {
hasBanner: false, hasBanner: false,
callback: (type, ret, param) => { callback: (type, ret, param) => {
simba_sdk_1.SDK.hideBannerAd(); simba_sdk_1.SDK.hideBannerAd();
if (ret) {
GameModelManager_1.GameModelManager.MainTabForceClick.emit({ index: Enums_1.MainTabs.bedroomTab, pureClick: false, propId: parseInt(this._props.key) });
// GameDotMgr.getInstance().dotShopTotal(DotShopTotalType.Popup, { popType: "click_popup" });
if (type === "video") {
// GameModelManager.addDailyTasks(DailyQuestType.Dq_AdsWatch, 1);
}
}
} }
}; };
UIManager_1.UIManager.pushPresenter(AlertDialogViewPresenter_1.default, temp); UIManager_1.UIManager.pushPresenter(AlertDialogViewPresenter_1.default, temp);
......
...@@ -25,7 +25,6 @@ const Role_1 = require("../../config/Role"); ...@@ -25,7 +25,6 @@ const Role_1 = require("../../config/Role");
const TaoBaoShopUrlConfig_1 = require("../../config/TaoBaoShopUrlConfig"); const TaoBaoShopUrlConfig_1 = require("../../config/TaoBaoShopUrlConfig");
const GameConfig_1 = require("../../GameConfig"); const GameConfig_1 = require("../../GameConfig");
const Enums_1 = require("../Enums"); const Enums_1 = require("../Enums");
const GameDotMgr_1 = require("../GameDotMgr");
const DatingEventSceneModel_1 = require("./DatingEventSceneModel"); const DatingEventSceneModel_1 = require("./DatingEventSceneModel");
const GameRoleDataModel_1 = require("./GameRoleDataModel"); const GameRoleDataModel_1 = require("./GameRoleDataModel");
const MessageSceneModel_1 = require("./MessageSceneModel"); const MessageSceneModel_1 = require("./MessageSceneModel");
...@@ -774,7 +773,6 @@ var GameModelManager; ...@@ -774,7 +773,6 @@ var GameModelManager;
if (startedSession >= mainPlotLineSession) { //max is equal if (startedSession >= mainPlotLineSession) { //max is equal
return; return;
} }
GameDotMgr_1.default.getInstance().dotPlot(mainPlotLineSession, Enums_1.PlotSessionState.Start);
AVG_1.GameRecord.globalVariables["m_p_l_s"] = mainPlotLineSession; AVG_1.GameRecord.globalVariables["m_p_l_s"] = mainPlotLineSession;
let plotScenTypeSession = AVG_1.GameRecord.globalVariables["p_s_t_s" + plot.plotSceneType]; let plotScenTypeSession = AVG_1.GameRecord.globalVariables["p_s_t_s" + plot.plotSceneType];
plotScenTypeSession = plotScenTypeSession ? plotScenTypeSession : 0; plotScenTypeSession = plotScenTypeSession ? plotScenTypeSession : 0;
...@@ -792,39 +790,10 @@ var GameModelManager; ...@@ -792,39 +790,10 @@ var GameModelManager;
*/ */
function dotMainLinePlotEnd() { function dotMainLinePlotEnd() {
let mainPlotLineSession = AVG_1.GameRecord.globalVariables["m_p_l_s"]; let mainPlotLineSession = AVG_1.GameRecord.globalVariables["m_p_l_s"];
GameDotMgr_1.default.getInstance().dotPlot(mainPlotLineSession, Enums_1.PlotSessionState.End);
AVG_1.GameRecord.globalVariables["m_p_l_s"] = mainPlotLineSession + 1; AVG_1.GameRecord.globalVariables["m_p_l_s"] = mainPlotLineSession + 1;
AVG_1.GameRecord.saveRecord(); AVG_1.GameRecord.saveRecord();
} }
GameModelManager.dotMainLinePlotEnd = dotMainLinePlotEnd; GameModelManager.dotMainLinePlotEnd = dotMainLinePlotEnd;
/**剧情进度打点 */
function dotPlotProgress() {
let plot = AVG_1.PlotManager.getCurrentPlots()[0];
let plotScenTypeSession = AVG_1.GameRecord.globalVariables["p_s_t_s" + plot.plotSceneType];
let r = AVG_1.GameRecord.recordVariables["p_s_t_i_p"];
let tt = Enums_1.TutorialType.Message;
switch (plot.plotSceneType) {
case Enums_1.PlotSceneType.Message:
{
tt = Enums_1.TutorialType.Message;
}
break;
case Enums_1.PlotSceneType.DatingEvent:
{
tt = Enums_1.TutorialType.Event;
}
break;
case Enums_1.PlotSceneType.PhoneCall:
{
tt = Enums_1.TutorialType.Phone;
}
break;
}
if (r % 5 === 0 || r < 5) {
GameDotMgr_1.default.getInstance().dotTutorial(tt, Enums_1.TutorialState.Progress, { session: plotScenTypeSession, progress: r });
}
}
GameModelManager.dotPlotProgress = dotPlotProgress;
function checkFuncUnloced(key) { function checkFuncUnloced(key) {
return AVG_1.GameRecord.recordVariables[key] === GameEnumData_1.FuncStateEnum.locked ? false : true; return AVG_1.GameRecord.recordVariables[key] === GameEnumData_1.FuncStateEnum.locked ? false : true;
} }
......
"use strict";
cc._RF.push(module, '1411d6EYqpMSL+YTNSyP2PX', 'CCGameCenterListView');
// script/cooperation/script/CCGameCenterListView.ts
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const EventCenter_1 = require("../event/EventCenter");
const EventKit_1 = require("../event/EventKit");
const CCCooperationItem_1 = require("./CCCooperationItem");
const CooperationDataCenter_1 = require("./CooperationDataCenter");
const GameCenter_1 = require("./GameCenter");
const CCGameCenterNodeFactory_1 = require("./CCGameCenterNodeFactory");
const CCDummyObjects_1 = require("../../common/CCDummyObjects");
const simba_sdk_1 = require("simba-sdk");
const MainViewPresenter_1 = require("../../game/ui/presenter/MainViewPresenter");
const { ccclass, property } = cc._decorator;
let CCGameCenterListView = /** @class */ (() => {
let CCGameCenterListView = class CCGameCenterListView extends cc.Component {
constructor() {
super(...arguments);
this.contentNode = CCDummyObjects_1.DummyNode;
this._disposable = new EventKit_1.CompositeDisposable;
this.onRefreshContent = () => {
if (!this.contentNode) {
return;
}
this.contentNode.removeAllChildren(true);
let isRelease = GameCenter_1.default.getInstance().getIsRelease();
let list = CooperationDataCenter_1.default.getInstance().getCooperationItemDataModelList();
for (let i = 0; i < list.length; i++) {
let node = CCGameCenterNodeFactory_1.default.getInstance().getSubGameNode();
if (!node) {
break;
}
let script = node.getComponent(CCCooperationItem_1.CCCooperationItem);
if (script) {
script.setRelease(isRelease);
script.bindData(list[i]);
script.setLocation(CooperationDataCenter_1.SubGameLocation.GameCenter);
}
this.contentNode.addChild(node);
}
};
}
onLoad() {
this.registerEventListener();
}
registerEventListener() {
this._disposable.add(EventCenter_1.EventCenter.REFRESH_SUB_GAME_LIST.on(this.onRefreshContent));
}
start() {
}
update(dt) { }
onViewClick() {
EventCenter_1.EventCenter.SHOW_GAME_CENTER_LIST_VIEW.emit(false);
if (MainViewPresenter_1.default.tabIndex == 3) {
simba_sdk_1.SDK.showGameClubButton();
}
}
};
__decorate([
property({ type: cc.Node, visible: true, displayName: "scrollview内容节点", tooltip: "contentNode" })
], CCGameCenterListView.prototype, "contentNode", void 0);
CCGameCenterListView = __decorate([
ccclass
], CCGameCenterListView);
return CCGameCenterListView;
})();
exports.default = CCGameCenterListView;
cc._RF.pop();
\ No newline at end of file
{"version":3,"sources":["assets/script/cooperation/script/CCGameCenterListView.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAmD;AACnD,gDAAwD;AACxD,2DAAwD;AACxD,mEAAiF;AACjF,6CAAsC;AACtC,uEAAgE;AAChE,gEAAwD;AACxD,yCAAgC;AAChC,iFAA0E;AAE1E,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC;AAG5C;IAAA,IAAqB,oBAAoB,GAAzC,MAAqB,oBAAqB,SAAQ,EAAE,CAAC,SAAS;QAA9D;;YAGY,gBAAW,GAAY,0BAAS,CAAC;YAEjC,gBAAW,GAAwB,IAAI,8BAAmB,CAAC;YAcnE,qBAAgB,GAAG,GAAG,EAAE;gBACpB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;oBACnB,OAAO;iBACV;gBACD,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;gBACzC,IAAI,SAAS,GAAY,oBAAU,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,CAAC;gBACjE,IAAI,IAAI,GAAG,+BAAqB,CAAC,WAAW,EAAE,CAAC,+BAA+B,EAAE,CAAC;gBACjF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBAClC,IAAI,IAAI,GAAG,iCAAuB,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE,CAAC;oBAClE,IAAI,CAAC,IAAI,EAAE;wBACP,MAAM;qBACT;oBACD,IAAI,MAAM,GAAsB,IAAI,CAAC,YAAY,CAAC,qCAAiB,CAAC,CAAC;oBACrE,IAAI,MAAM,EAAE;wBACR,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;wBAC7B,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;wBACzB,MAAM,CAAC,WAAW,CAAC,uCAAe,CAAC,UAAU,CAAC,CAAC;qBAClD;oBACD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;iBACnC;YACL,CAAC,CAAA;QAUL,CAAC;QA1CG,MAAM;YACF,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACjC,CAAC;QAED,qBAAqB;YACjB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,yBAAW,CAAC,qBAAqB,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACtF,CAAC;QAED,KAAK;QAEL,CAAC;QAwBD,MAAM,CAAC,EAAE,IAAI,CAAC;QAEd,WAAW;YACP,yBAAW,CAAC,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnD,IAAI,2BAAiB,CAAC,QAAQ,IAAI,CAAC,EAAE;gBACjC,eAAG,CAAC,kBAAkB,EAAE,CAAC;aAC5B;QACL,CAAC;KACJ,CAAA;IA9CG;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;6DACzD;IAHxB,oBAAoB;QADxC,OAAO;OACa,oBAAoB,CAiDxC;IAAD,2BAAC;KAAA;kBAjDoB,oBAAoB","file":"","sourceRoot":"/","sourcesContent":["import { EventCenter } from \"../event/EventCenter\";\nimport { CompositeDisposable } from \"../event/EventKit\";\nimport { CCCooperationItem } from \"./CCCooperationItem\";\nimport CooperationDataCenter, { SubGameLocation } from \"./CooperationDataCenter\";\nimport GameCenter from \"./GameCenter\";\nimport CCGameCenterNodeFactory from \"./CCGameCenterNodeFactory\";\nimport { DummyNode } from \"../../common/CCDummyObjects\";\nimport { SDK } from \"simba-sdk\";\nimport MainViewPresenter from \"../../game/ui/presenter/MainViewPresenter\";\n\nconst { ccclass, property } = cc._decorator;\n\n@ccclass\nexport default class CCGameCenterListView extends cc.Component {\n\n @property({ type: cc.Node, visible: true, displayName: \"scrollview内容节点\", tooltip: \"contentNode\" })\n private contentNode: cc.Node = DummyNode;\n\n private _disposable: CompositeDisposable = new CompositeDisposable;\n\n onLoad() {\n this.registerEventListener();\n }\n\n registerEventListener() {\n this._disposable.add(EventCenter.REFRESH_SUB_GAME_LIST.on(this.onRefreshContent));\n }\n\n start() {\n\n }\n\n onRefreshContent = () => {\n if (!this.contentNode) {\n return;\n }\n this.contentNode.removeAllChildren(true);\n let isRelease: boolean = GameCenter.getInstance().getIsRelease();\n let list = CooperationDataCenter.getInstance().getCooperationItemDataModelList();\n for (let i = 0; i < list.length; i++) {\n let node = CCGameCenterNodeFactory.getInstance().getSubGameNode();\n if (!node) {\n break;\n }\n let script: CCCooperationItem = node.getComponent(CCCooperationItem);\n if (script) {\n script.setRelease(isRelease);\n script.bindData(list[i]);\n script.setLocation(SubGameLocation.GameCenter);\n }\n this.contentNode.addChild(node);\n }\n }\n\n update(dt) { }\n\n onViewClick() {\n EventCenter.SHOW_GAME_CENTER_LIST_VIEW.emit(false);\n if (MainViewPresenter.tabIndex == 3) {\n SDK.showGameClubButton();\n }\n }\n}\n"]}
\ No newline at end of file
...@@ -83,15 +83,12 @@ let DiscoverViewImpl = /** @class */ (() => { ...@@ -83,15 +83,12 @@ let DiscoverViewImpl = /** @class */ (() => {
onTabClick(target, data) { onTabClick(target, data) {
switch (parseInt(data)) { switch (parseInt(data)) {
case Tabs.forum: case Tabs.forum:
// GameDotMgr.getInstance().dotClickUI("click_forum");
this._props.onItemClick(Enums_1.DiscoverItemType.Forum); this._props.onItemClick(Enums_1.DiscoverItemType.Forum);
break; break;
case Tabs.edit: case Tabs.edit:
// GameDotMgr.getInstance().dotClickUI("click_setting");
this._props.onItemClick(Enums_1.DiscoverItemType.Settings); this._props.onItemClick(Enums_1.DiscoverItemType.Settings);
break; break;
case Tabs.customerService: case Tabs.customerService:
// GameDotMgr.getInstance().dotClickUI("click_customerService");
this._props.onItemClick(Enums_1.DiscoverItemType.CustomerService); this._props.onItemClick(Enums_1.DiscoverItemType.CustomerService);
break; break;
case Tabs.productionTeam: case Tabs.productionTeam:
......
{
"__type__": "cc.SpriteFrame",
"content": {
"name": "bgSpr",
"texture": "8d75e707-07e3-4f23-a65d-80181521e39e",
"atlas": "",
"rect": [
2,
0,
656,
424
],
"offset": [
0,
1
],
"originalSize": [
660,
426
],
"capInsets": [
0,
0,
0,
0
]
}
}
\ No newline at end of file
{
"__type__": "cc.SpriteFrame",
"content": {
"name": "quickPlaySpr",
"texture": "a4478494-5fd6-43e5-9b86-415d761d83cd",
"atlas": "",
"rect": [
0,
0,
124,
51
],
"offset": [
0,
0
],
"originalSize": [
124,
51
],
"capInsets": [
0,
0,
0,
0
]
}
}
\ No newline at end of file
"use strict";
cc._RF.push(module, '1bb727HM8JGd5wAx/JWMuKL', 'UIUtils');
// script/game/ui/UIUtils.ts
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
cc._RF.pop();
\ No newline at end of file
{"version":3,"sources":["assets/script/game/ui/UIUtils.ts"],"names":[],"mappings":"","file":"","sourceRoot":"/","sourcesContent":["import { DeepReadonly } from \"simba-utils\";\nimport { DailyQuestType } from \"../../avg/EditorEnums\";\nimport { GameTextData } from \"../../common/gameplay/gamedata/GameTextData\";\nimport { UIManager } from \"../../common/gameplay/managers/UIManager\";\nimport { StringUtils } from \"../../common/utils/StringUtils\";\nimport { IItemConfig } from \"../../config/ItemConfig\";\nimport { CommonLocation, ExposureType, ShowLocationType, ShowType } from \"../Enums\";\nimport GameDotMgr from \"../GameDotMgr\";\nimport { GameModelManager } from \"../model/GameModelManager\";\nimport AlertDialogViewPresenter from \"./presenter/AlertDialogViewPresenter\";\nimport { AlertDialogViewProps } from \"./view/type/AlertDialogView\";\n\nexport namespace UIUtils {\n // export function showAddEnergy(itemConfig: DeepReadonly<IItemConfig>, itemCount?: number) {\n // return new Promise<boolean>((resolve) => {\n // itemCount = itemCount === undefined ? 0 : itemCount;\n // let isAd = itemCount <= 0;\n // let txt = \"\";\n // if (isAd) {\n // txt = StringUtils.format(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_PLAYAD_VALUE));\n // } else {\n // txt = StringUtils.format(GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_USEDRINKS_VALUE), itemConfig.energy_recover, itemCount);\n // }\n // let temp: AlertDialogViewProps =\n // {\n // dataptr: {},\n // titlecontent: GameModelManager.getLanguageTxt(GameTextData.GAME_TEXT_MAIN_ENERGY_NOTENOUGH_VALUE),\n // content: txt,\n // ishasad: isAd,\n // istwobtn: true,\n // adconfig: \"inject_fruit\",\n // location: CommonLocation.Energy,\n // hasBanner: !isAd,\n // callback: (type, ret) => {\n // if (ret && !isAd) {\n // let player = GameModelManager.getPlayerData();\n // player.addProps(itemConfig.id, -1);\n // }\n\n // if (ret && type === \"video\") {\n // GameModelManager.addDailyTasks(DailyQuestType.Dq_AdsWatch, 1);\n // }\n // resolve(ret);\n // }\n // };\n // UIManager.pushPresenter(AlertDialogViewPresenter, temp);\n // GameDotMgr.getInstance().dotExposure(ExposureType.Energy);\n // })\n // };\n}"]}
\ No newline at end of file
"use strict";
cc._RF.push(module, '2143bzxj4BANabOw+yE04a9', 'GameCenter');
// script/cooperation/script/GameCenter.ts
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const simba_sdk_1 = require("simba-sdk");
const GameConfig_1 = require("../../GameConfig");
const EventCenter_1 = require("../event/EventCenter");
const EventKit_1 = require("../event/EventKit");
const CooperationDataCenter_1 = require("./CooperationDataCenter");
/**游戏中心 */
let GameCenter = /** @class */ (() => {
class GameCenter {
constructor() {
/**是否处于正式环境[控制访问oss地址] */
this._isRelease = false;
this._disposable = null;
this._quickStartGameAppID = "";
/**响应拉取游戏中心配置文件事件监听 */
this.onRequestCooperationData = (release) => {
this._isRelease = release;
CooperationDataCenter_1.default.getInstance().requestCooperationDataFromOSS(this._isRelease);
};
/**快速开始小游戏 */
this.onQuickStartSubGame = (isRandom) => {
let list = CooperationDataCenter_1.default.getInstance().getCooperationItemDataModelList();
if (!list || list.length === 0) {
return;
}
let appId = "";
if (isRandom) {
appId = list[Math.floor(Math.random() * list.length)].appId;
}
else {
appId = "" === this._quickStartGameAppID ? list[0].appId : this._quickStartGameAppID;
}
this._quickStartGameAppID = appId;
this.openSubProgram(this._quickStartGameAppID);
};
this.onOpenSubGameByAppId = (appId) => {
this._quickStartGameAppID = appId;
// this.openSubProgram(appId);
simba_sdk_1.SDK.openProgramV2(appId);
};
}
/**游戏中心单例对象 */
static getInstance() {
if (!GameCenter._instance) {
GameCenter._instance = new GameCenter();
}
return GameCenter._instance;
}
/**初始化 */
init() {
this.registerEventListener();
}
/**注册事件监听 */
registerEventListener() {
if (this._disposable) {
this._disposable.dispose();
}
this._disposable = new EventKit_1.CompositeDisposable;
this._disposable.add(EventCenter_1.EventCenter.REQUEST_COOPERATION_DATA_FROM_OSS.on(this.onRequestCooperationData));
this._disposable.add(EventCenter_1.EventCenter.QUICK_START_SUB_GAME.on(this.onQuickStartSubGame));
this._disposable.add(EventCenter_1.EventCenter.OPEN_SUBGAME_BY_APPID.on(this.onOpenSubGameByAppId));
}
/**获取是否是正式环境 */
getIsRelease() {
return this._isRelease;
}
/**打开微信小游戏 */
openSubProgram(appId, extraData) {
return new Promise((resolve, reject) => {
if (GameConfig_1.channel != "dummy") {
wx.navigateToMiniProgram({
appId, extraData,
envVersion: 'release',
success: () => {
resolve();
},
fail: (res) => {
reject(res);
}
});
}
else {
console.log('Open other MiniProgram.');
}
});
}
}
/**单例对象 */
GameCenter._instance = null;
return GameCenter;
})();
exports.default = GameCenter;
cc._RF.pop();
\ No newline at end of file
{"version":3,"sources":["assets/script/cooperation/script/GameCenter.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAgC;AAChC,iDAA2C;AAC3C,sDAAmD;AACnD,gDAAwD;AAExD,mEAA4D;AAE5D,UAAU;AACV;IAAA,MAAqB,UAAU;QAA/B;YAGI,yBAAyB;YACjB,eAAU,GAAY,KAAK,CAAC;YAC5B,gBAAW,GAAwB,IAAI,CAAC;YACxC,yBAAoB,GAAW,EAAE,CAAC;YA0B1C,sBAAsB;YACd,6BAAwB,GAAG,CAAC,OAAgB,EAAE,EAAE;gBACpD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;gBAC1B,+BAAqB,CAAC,WAAW,EAAE,CAAC,6BAA6B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACvF,CAAC,CAAA;YAOD,aAAa;YACb,wBAAmB,GAAG,CAAC,QAAiB,EAAE,EAAE;gBACxC,IAAI,IAAI,GAA+B,+BAAqB,CAAC,WAAW,EAAE,CAAC,+BAA+B,EAAE,CAAC;gBAC7G,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;oBAC5B,OAAO;iBACV;gBACD,IAAI,KAAK,GAAW,EAAE,CAAC;gBACvB,IAAI,QAAQ,EAAE;oBACV,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;iBAC/D;qBAAM;oBACH,KAAK,GAAG,EAAE,KAAK,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC;iBACxF;gBACD,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;gBAClC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;YACnD,CAAC,CAAA;YAED,yBAAoB,GAAG,CAAC,KAAa,EAAE,EAAE;gBACrC,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;gBAClC,8BAA8B;gBAC9B,eAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC,CAAA;QAsBL,CAAC;QA7EG,cAAc;QACP,MAAM,CAAC,WAAW;YACrB,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE;gBACvB,UAAU,CAAC,SAAS,GAAG,IAAI,UAAU,EAAE,CAAC;aAC3C;YACD,OAAO,UAAU,CAAC,SAAS,CAAC;QAChC,CAAC;QAED,SAAS;QACF,IAAI;YACP,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACjC,CAAC;QAED,YAAY;QACJ,qBAAqB;YACzB,IAAI,IAAI,CAAC,WAAW,EAAE;gBAClB,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;aAC9B;YACD,IAAI,CAAC,WAAW,GAAG,IAAI,8BAAmB,CAAC;YAC3C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,yBAAW,CAAC,iCAAiC,CAAC,EAAE,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC;YACtG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,yBAAW,CAAC,oBAAoB,CAAC,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;YACpF,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,yBAAW,CAAC,qBAAqB,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAC1F,CAAC;QAQD,eAAe;QACR,YAAY;YACf,OAAO,IAAI,CAAC,UAAU,CAAC;QAC3B,CAAC;QAwBD,aAAa;QACb,cAAc,CAAC,KAAa,EAAE,SAAkB;YAC5C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBACnC,IAAI,oBAAO,IAAI,OAAO,EAAE;oBACpB,EAAE,CAAC,qBAAqB,CAAC;wBACrB,KAAK,EAAE,SAAS;wBAChB,UAAU,EAAE,SAAS;wBACrB,OAAO,EAAE,GAAG,EAAE;4BACV,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;4BACV,MAAM,CAAC,GAAG,CAAC,CAAC;wBAChB,CAAC;qBACJ,CAAC,CAAA;iBACL;qBAAM;oBACH,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;iBAC1C;YACL,CAAC,CAAC,CAAC;QACP,CAAC;;IAlFD,UAAU;IACK,oBAAS,GAAe,IAAI,CAAC;IAmFhD,iBAAC;KAAA;kBArFoB,UAAU","file":"","sourceRoot":"/","sourcesContent":["import { SDK } from \"simba-sdk\";\nimport { channel } from \"../../GameConfig\";\nimport { EventCenter } from \"../event/EventCenter\";\nimport { CompositeDisposable } from \"../event/EventKit\";\nimport { CooperationItemDataModel } from \"./CooperationClassBase\";\nimport CooperationDataCenter from \"./CooperationDataCenter\";\n\n/**游戏中心 */\nexport default class GameCenter {\n /**单例对象 */\n private static _instance: GameCenter = null;\n /**是否处于正式环境[控制访问oss地址] */\n private _isRelease: boolean = false;\n private _disposable: CompositeDisposable = null;\n private _quickStartGameAppID: string = \"\";\n\n /**游戏中心单例对象 */\n public static getInstance(): GameCenter {\n if (!GameCenter._instance) {\n GameCenter._instance = new GameCenter();\n }\n return GameCenter._instance;\n }\n\n /**初始化 */\n public init() {\n this.registerEventListener();\n }\n\n /**注册事件监听 */\n private registerEventListener() {\n if (this._disposable) {\n this._disposable.dispose();\n }\n this._disposable = new CompositeDisposable;\n this._disposable.add(EventCenter.REQUEST_COOPERATION_DATA_FROM_OSS.on(this.onRequestCooperationData));\n this._disposable.add(EventCenter.QUICK_START_SUB_GAME.on(this.onQuickStartSubGame));\n this._disposable.add(EventCenter.OPEN_SUBGAME_BY_APPID.on(this.onOpenSubGameByAppId));\n }\n\n /**响应拉取游戏中心配置文件事件监听 */\n private onRequestCooperationData = (release: boolean) => {\n this._isRelease = release;\n CooperationDataCenter.getInstance().requestCooperationDataFromOSS(this._isRelease);\n }\n\n /**获取是否是正式环境 */\n public getIsRelease(): boolean {\n return this._isRelease;\n }\n\n /**快速开始小游戏 */\n onQuickStartSubGame = (isRandom: boolean) => {\n let list: CooperationItemDataModel[] = CooperationDataCenter.getInstance().getCooperationItemDataModelList();\n if (!list || list.length === 0) {\n return;\n }\n let appId: string = \"\";\n if (isRandom) {\n appId = list[Math.floor(Math.random() * list.length)].appId;\n } else {\n appId = \"\" === this._quickStartGameAppID ? list[0].appId : this._quickStartGameAppID;\n }\n this._quickStartGameAppID = appId;\n this.openSubProgram(this._quickStartGameAppID);\n }\n\n onOpenSubGameByAppId = (appId: string) => {\n this._quickStartGameAppID = appId;\n // this.openSubProgram(appId);\n SDK.openProgramV2(appId);\n }\n\n /**打开微信小游戏 */\n openSubProgram(appId: string, extraData?: object): Promise<void> {\n return new Promise((resolve, reject) => {\n if (channel != \"dummy\") {\n wx.navigateToMiniProgram({\n appId, extraData,\n envVersion: 'release',\n success: () => {\n resolve();\n },\n fail: (res) => {\n reject(res);\n }\n })\n } else {\n console.log('Open other MiniProgram.');\n }\n });\n }\n\n}"]}
\ No newline at end of file
...@@ -106,7 +106,7 @@ let ChatBubbleView = /** @class */ (() => { ...@@ -106,7 +106,7 @@ let ChatBubbleView = /** @class */ (() => {
return new Promise((resolve) => { return new Promise((resolve) => {
this._timer = setTimeout(() => { this._timer = setTimeout(() => {
this._timer = undefined; this._timer = undefined;
resolve(); resolve(null);
}, time * 1000); }, time * 1000);
}); });
} }
...@@ -251,7 +251,6 @@ let ChatBubbleView = /** @class */ (() => { ...@@ -251,7 +251,6 @@ let ChatBubbleView = /** @class */ (() => {
let hasAd = cfg.ads === 1; let hasAd = cfg.ads === 1;
let needAd = GameModelManager_1.GameModelManager.checkVoiceNeedShowAD(this._voiceCfg); let needAd = GameModelManager_1.GameModelManager.checkVoiceNeedShowAD(this._voiceCfg);
if (hasAd && needAd) { if (hasAd && needAd) {
// GameDotMgr.getInstance().dotExposure(ExposureType.Audio);
let curMainLinePlotId = GameModelManager_1.GameModelManager.getCurMainLinePlotId(); let curMainLinePlotId = GameModelManager_1.GameModelManager.getCurMainLinePlotId();
if (curMainLinePlotId === pid) { if (curMainLinePlotId === pid) {
this.autoPopVoiceDialog(false); this.autoPopVoiceDialog(false);
......
"use strict"; "use strict";
cc._RF.push(module, '22988Ct3ZZK1rWR+8MnShiY', 'EventCenter'); cc._RF.push(module, '22988Ct3ZZK1rWR+8MnShiY', 'EventCenter');
// script/cooperation/event/EventCenter.ts // script/event/EventCenter.ts
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
...@@ -9,18 +9,6 @@ const EventKit_1 = require("./EventKit"); ...@@ -9,18 +9,6 @@ const EventKit_1 = require("./EventKit");
var EventCenter; var EventCenter;
(function (EventCenter) { (function (EventCenter) {
let emitter = new EventKit_1.Emitter(); let emitter = new EventKit_1.Emitter();
/**发起从oss上获取游戏中心配置数据的请求 */
EventCenter.REQUEST_COOPERATION_DATA_FROM_OSS = emitter.createEvent();
/**游戏中心配置数据下载成功 */
EventCenter.COOPERATION_DATA_DOWNLOAD_SUCCEED = emitter.createEvent();
/**快速开始子游戏 */
EventCenter.QUICK_START_SUB_GAME = emitter.createEvent();
/**控制游戏中心列表是否展示 */
EventCenter.SHOW_GAME_CENTER_LIST_VIEW = emitter.createEvent();
/**刷新子游戏列表 */
EventCenter.REFRESH_SUB_GAME_LIST = emitter.createEvent();
/**根据子游戏ID打开指定小游戏 */
EventCenter.OPEN_SUBGAME_BY_APPID = emitter.createEvent();
/**检查热更后游戏初始化事件 */ /**检查热更后游戏初始化事件 */
EventCenter.GameStart = emitter.createEvent(); EventCenter.GameStart = emitter.createEvent();
})(EventCenter = exports.EventCenter || (exports.EventCenter = {})); })(EventCenter = exports.EventCenter || (exports.EventCenter = {}));
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!