175 lines
7.8 KiB
TypeScript
175 lines
7.8 KiB
TypeScript
import { GameConfig } from "../Config/GameConfig";
|
|
import HttpUtil from "../Crypto/HttpUtil";
|
|
import AudioManager from "../Music/AudioManager";
|
|
import { Notifications } from "../Notification/Notification";
|
|
import { StorageMessage } from "../Storage/Storage";
|
|
import { GameTool } from "../Tool/GameTool";
|
|
|
|
|
|
export class Fx {
|
|
|
|
static GameConfig: typeof GameConfig;
|
|
static GameTool: any;
|
|
static HttpUtil: typeof HttpUtil;
|
|
static Notifications: { _eventMap: any[]; on: (masgId: any, callback: any, target: any) => void; emit: (masgId: any, parameter: any) => void; off: (masgId: any, callback: any) => void; offMasgId: (masgId: any) => void; removeAllMsg: () => void; };
|
|
static AudioManager: typeof AudioManager;
|
|
static StorageMessage: { getStorage: (key: any) => any; setStorage: (key: any, value: any) => void; removeStorage: (key: any) => void; };
|
|
StateInfo: {
|
|
debugMode: boolean; networkConnected: boolean; //网络状态
|
|
networkType: string; //网络类型
|
|
isOnForeground: boolean; //当前是否是在前台
|
|
};
|
|
static ShareInfo: {
|
|
queryId: number; //分享id
|
|
};
|
|
static BurialShareType: {
|
|
Default: string; //默认分享类型,分享到群
|
|
Invite: string; // 邀请好友
|
|
DailyInviteRoomJoin: string; //邀请好友加入
|
|
DailyInviteFriend: string; // 日常邀请好友
|
|
DailyInviteGroup: string; // 日常分享群
|
|
DailyInviteGroupAlive: string; //日常分享群复活
|
|
DailyInviteGroupReward: string; //分享奖励翻倍
|
|
DailyInviteGroupBox: string; //宝箱分享奖励
|
|
DailyInviteGroupBall: string; //分享领取球球
|
|
MatchResult: string; // 比赛结算分享
|
|
MatchFix5: string; // 5元红包赛
|
|
MatchFix20: string; // 20元红包赛
|
|
MatchFix100: string; // 100元红包赛
|
|
MatchFix500: string; // 500元红包赛
|
|
NewerRedEnvelope: string; // 新手红包
|
|
CoinRoomResult: string; // 金币桌结算
|
|
HighRate: string; //高倍分享
|
|
CoinRoomWinStreak: string; // 连胜
|
|
CoinRoomBankruptcy1: string; // 金币桌破产
|
|
CoinRoomBankruptcy2: string; // 金币桌破产
|
|
CoinRoomBankruptcy3: string;
|
|
};
|
|
static tipType: {
|
|
tipOne: string; tipTwo: string; //用于存储关卡等级
|
|
tipErrNew: string; tipErrOld: string; tipErrHear: string; tipErrSee: string; tipErrLast: string;
|
|
};
|
|
static storageType: { storageTypeCustom: number; };
|
|
static ShareWhereReward: {
|
|
Group: string; //微信群
|
|
Friend: string; //好友
|
|
All: string;
|
|
};
|
|
|
|
init(){
|
|
console.log("1初始化");
|
|
|
|
//基础状态信息
|
|
this.StateInfo = {
|
|
debugMode: true,
|
|
networkConnected: true, //网络状态
|
|
networkType: 'none', //网络类型
|
|
isOnForeground: true //当前是否是在前台
|
|
};
|
|
|
|
//应用系统信息
|
|
//配置文件
|
|
|
|
Fx.GameConfig = GameConfig;
|
|
Fx.HttpUtil = HttpUtil;
|
|
Fx.GameTool = GameTool;
|
|
Fx.AudioManager = AudioManager;
|
|
Fx.Notifications = Notifications;
|
|
Fx.StorageMessage = StorageMessage;
|
|
|
|
Fx.ShareInfo = {
|
|
queryId : -1 //分享id
|
|
};
|
|
|
|
/*
|
|
* 客户端埋点分享类型
|
|
*/
|
|
Fx.BurialShareType = {
|
|
Default : "default", //默认分享类型,分享到群
|
|
Invite : "invite", // 邀请好友
|
|
|
|
DailyInviteRoomJoin:'invite_join_room', //邀请好友加入
|
|
DailyInviteFriend : 'invite_friend', // 日常邀请好友
|
|
DailyInviteGroup : 'invate_group', // 日常分享群
|
|
DailyInviteGroupAlive: 'invate_alive', //日常分享群复活
|
|
DailyInviteGroupReward: 'invate_rewared',//分享奖励翻倍
|
|
DailyInviteGroupBox: 'invate_box', //宝箱分享奖励
|
|
DailyInviteGroupBall: 'invate_ball', //分享领取球球
|
|
|
|
MatchResult : 'matchResult', // 比赛结算分享
|
|
MatchFix5: 'MatchFix5', // 5元红包赛
|
|
MatchFix20: 'MatchFix20', // 20元红包赛
|
|
MatchFix100: 'MatchFix100', // 100元红包赛
|
|
MatchFix500: 'MatchFix500', // 500元红包赛
|
|
NewerRedEnvelope: 'newerRedEnvelope', // 新手红包
|
|
CoinRoomResult: 'coinRoomResult', // 金币桌结算
|
|
HighRate : "highRate",//高倍分享
|
|
CoinRoomWinStreak: 'coinRoomWinStreak', // 连胜
|
|
CoinRoomBankruptcy1: 'coinRoomBankruptcy1', // 金币桌破产
|
|
CoinRoomBankruptcy2: 'coinRoomBankruptcy2', // 金币桌破产
|
|
CoinRoomBankruptcy3: 'coinRoomBankruptcy3', // 金币桌破产
|
|
};
|
|
|
|
/*
|
|
* 分享到哪儿给奖励 group frined all
|
|
*/
|
|
Fx.ShareWhereReward = {
|
|
Group :"group", //微信群
|
|
Friend : "friend",//好友
|
|
All : "all", //不区分
|
|
};
|
|
|
|
//用于存储消息的ID
|
|
Fx.storageType = {
|
|
storageTypeCustom: 1000101, //用于存储关卡等级
|
|
};
|
|
|
|
//用于存储提示语 按照步骤提示
|
|
Fx.tipType = {
|
|
tipOne: '神农氏回到家中,开始整理今天收集来的物品。当他第一次拿出或说出一种植物时,请告诉他这是新植物。',
|
|
tipTwo: '如果他拿出或说出的植物你今天看到过,请告诉他上次是看到的;如果你听他说过,则请告诉他上次是听到的。', //用于存储关卡等级
|
|
tipErrNew: '这是这局游戏第一次出现{植物}',
|
|
tipErrOld: '{植物}刚才出现过呢',
|
|
tipErrHear: '上次遇到{植物}时,似乎不是听到的吧',
|
|
tipErrSee: '上次遇到{植物}时,似乎不是看到的吧',
|
|
tipErrLast: '之前确实看到过{植物},但最近一次似乎不是看到的呢',
|
|
|
|
};
|
|
|
|
|
|
//暂时不用
|
|
// fx.clickStatEventType = {
|
|
// clickStatEventTypeVideoAD : 20173201,//视频播放完成
|
|
// clickStatEventTypeClickAdVideo : 20173202,//视频播放为完成
|
|
// clickStatEventTypeBannerAD : 20173203,//banner播放为完成
|
|
// clickStatEventTypeUserFrom : 99990001,//用户来源
|
|
// clickStatEventTypeShare : 99990002,//用户分享
|
|
// clickStatEventTypeClickAdBtn : 99990007,//点击分流icon
|
|
// clickStatEventTypeBannerAD2 : 67890033, // banner广告干预
|
|
// clickStatEventTypeSubmitVersionInfo : 9999, //上报微信版本及基础库信息
|
|
// clickStatEventTypeClickFirstAd : 99990003, //分流icon显示
|
|
// clickStatEventTypeClickSecondAd : 99990004, //玩家点击分流按钮
|
|
// clickStatEventTypeWxLoginStart : 10001,//微信登录开始
|
|
// clickStatEventTypeWxLoginSuccess : 10002,//微信登录成功
|
|
// clickStatEventTypeWxLoginFailed : 10003,//微信登录失败
|
|
// clickStatEventTypeAuthorizationStart : 10003,//授权开始
|
|
// clickStatEventTypeAuthorizationSuccess : 10004,//授权成功
|
|
// clickStatEventTypeAuthorizationFailed : 10005,//授权失败
|
|
// clickStatEventTypeLoginSDKStart : 10007,//登录SDK开始
|
|
// clickStatEventTypeLoginSDKSuccess : 10008,//登录SDK成功
|
|
// clickStatEventTypeLoginSDKFailed : 10009,//登录SDK时失败
|
|
// clickStatEventTypeTCP_Start : 10009,//TCP连接开始
|
|
// clickStatEventTypeTCP_Success : 10010,//TCP连接成功
|
|
// clickStatEventTypeTCP_Failed : 10011,//TCP连接失败
|
|
// };
|
|
|
|
}
|
|
// if(fx)
|
|
// {
|
|
// return;
|
|
// }
|
|
// fx = {};
|
|
|
|
};
|
|
|