Commit d733795c authored by 任建锋's avatar 任建锋

rjf

parent 9de15aad
{
"name": "sl",
"version": "1.0.3",
"description": "基于babylonjs的活动组件",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"scripts": {
},
"author": "",
"license": "ISC",
"dependencies": {
"duiba-yt": "git+ssh://git@gitlab2.dui88.com:renjianfeng/yt.git",
"duiba-tw": "git+ssh://git@gitlab2.dui88.com:clq/tw.git#1.0",
"duiba-tc": "git+ssh://git@gitlab2.dui88.com:clq/tc.git#1.0",
}
}
\ No newline at end of file
{
"name": "sl",
"version": "1.0.3",
"description": "基于babylonjs的活动组件",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"scripts": {
},
"author": "",
"license": "ISC",
"dependencies": {
"duiba-yt": "git+ssh://git@gitlab2.dui88.com:renjianfeng/yt.git",
"duiba-tw": "git+ssh://git@gitlab2.dui88.com:clq/tw.git#1.0",
"duiba-tc": "git+ssh://git@gitlab2.dui88.com:clq/tc.git#1.0"
}
}
\ No newline at end of file
{
"name": "sl",
"version": "1.0.4",
"description": "基于babylonjs的活动组件",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"scripts": {
},
"author": "",
"license": "ISC",
"dependencies": {
"duiba-yt": "git+ssh://git@gitlab2.dui88.com:renjianfeng/yt.git",
"duiba-tw": "git+ssh://git@gitlab2.dui88.com:clq/tw.git#1.0",
"duiba-tc": "git+ssh://git@gitlab2.dui88.com:clq/tc.git#1.0"
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/13
*/
export enum SlModuleName {
//游戏规则面板
RULE_PANEL = 'RulePanel',
//分享面板
SHARE_PANEL = 'SharePanel',
//未中奖面板
LOSE_PANEL = 'LosePanel',
//开始场景
GAME_START_GUI = 'GameStartScene',
//游戏玩法场景
GAME_PLAY_SCENE = 'GamePlayScene',
//游戏玩法场景GUI
GAME_PLAY_GUI = 'GamePlayGui',
//活动结束场景
GAME_END_GUI = 'GameEndScene',
//中奖信息场景
GAME_WINNER_GUI = 'GameWinnerScene',
//活动奖品面板
GAME_OPTION_PANEL = 'GameOptionPanel',
//游戏未中奖
GAME_LOSE_PANEL = 'GameLosePanel',
//游戏中奖面板
GAME_WIN_PANEL = 'GameWinPanel',
//排行榜面板
GAME_END_RANK_PANEL = 'GameEndRankPanel',
//实时排行榜面板
GAME_REAL_TIME_RANK_PANEL = 'GameRealTimeRankPanel',
//引导场景
GAME_GUIDE_GUI = 'GameGuideScene',
//自定义活动工具玩法场景
CUSTOM_PLAY_GUI = 'CustomPlayScene',
//自定义活动工具中奖面板
CUSTOM_WIN_PANEL = 'CustomWinPanel',
//自定义活动工具奖品详情面板
CUSTOM_OPTION_INFO_PANEL = 'CustomOptionInfoPanel',
//插件抽奖面板
PLUG_PANEL = 'PlugPanel',
//插件中奖面板
PLUG_WIN_PANEL = 'PlugWinPanel'
}
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/GameOptionModule"
import {RuleModule} from "./module/common/RuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/GameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule";
import {GameGuiModule} from "./module/game/GameGuiModule";
import {GameRealTimeRankModule} from "./module/game/GameRealTimeRankModule";
import {GameEndModule} from "./module/game/GameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/GameEndRankModule";
import {GameGuideModule} from "./module/game/GameGuideModule";
import {GameSceneModule} from "./module/game/GameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/GameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/GameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule";
import {GameGuiModule} from "./module/game/GameGuiModule";
import {GameRealTimeRankModule} from "./module/game/GameRealTimeRankModule";
import {GameEndModule} from "./module/game/GameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/GameEndRankModule";
import {GameGuideModule} from "./module/game/GameGuideModule";
import {GameSceneModule} from "./module/game/GameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/GameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/GameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule";
import {GameGuiModule} from "./module/game/GameGuiModule";
import {GameRealTimeRankModule} from "./module/game/GameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/GameEndRankModule";
import {GameGuideModule} from "./module/game/GameGuideModule";
import {GameSceneModule} from "./module/game/GameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/GameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/GameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule";
import {GameGuiModule} from "./module/game/GameGuiModule";
import {GameRealTimeRankModule} from "./module/game/GameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/GameGuideModule";
import {GameSceneModule} from "./module/game/GameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/GameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/GameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule";
import {GameGuiModule} from "./module/game/GameGuiModule";
import {GameRealTimeRankModule} from "./module/game/GameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/GameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/GameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/GameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/GameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/GameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/GameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/GameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/GameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/SlGameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/GameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/GameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/SlGameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/SlGameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/GameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/SlGameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/SlGameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/SlGameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/SlGameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule";
import {GameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/SlGameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/SlGameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/SlGameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/SlGameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/SlGameWinModule";
import {GameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/SlGameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/SlGameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/SlGameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/WxLang";
import {GameOptionModule} from "./module/game/SlGameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/SlGameWinModule";
import {GameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/SlGameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/SlGameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/SlGameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/SlGameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/ModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/SlLang";
import {GameOptionModule} from "./module/game/SlGameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/SlGameWinModule";
import {GameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/SlGameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/SlGameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/SlGameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/SlGameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {ModuleName} from "./enum/SlModuleName";
import {SysLang} from "./util/SysLang";
import {WxLang} from "./util/SlLang";
import {GameOptionModule} from "./module/game/SlGameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/SlGameWinModule";
import {GameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/SlGameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/SlGameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/SlGameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/SlGameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {SlModuleName} from "./enum/SlModuleName";
import {SlSysLang} from "./util/SlSysLang";
import {SlLang} from "./util/SlLang";
import {GameOptionModule} from "./module/game/SlGameOptionModule"
import {RuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/SlGameWinModule";
import {GameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/SlGameStartModule";
import {GameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/SlGameRealTimeRankModule";
import {GameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/SlGameWinnerModule";
import {GameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/SlGameSceneModule";
export {
//UI创建和scene创建
GameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule,
//枚举
ModuleName,
//工具
WxLang, SysLang,
}
\ No newline at end of file
import {SlModuleName} from "./enum/SlModuleName";
import {SlSysLang} from "./util/SlSysLang";
import {SlLang} from "./util/SlLang";
import {SlGameOptionModule} from "./module/game/SlGameOptionModule"
import {SlRuleModule} from "./module/common/SlRuleModule";
import {SlGameWinModule} from "./module/game/SlGameWinModule";
import {SlGameLoseModule} from "./module/game/SlGameLoseModule";
import {SlGameStartModule} from "./module/game/SlGameStartModule";
import {SlGameGuiModule} from "./module/game/SlGameGuiModule";
import {SlGameRealTimeRankModule} from "./module/game/SlGameRealTimeRankModule";
import {SlGameEndModule} from "./module/game/SlGameEndModule";
import {SlGameWinnerModule} from "./module/game/SlGameWinnerModule";
import {SlGameEndRankModule} from "./module/game/SlGameEndRankModule";
import {SlGameGuideModule} from "./module/game/SlGameGuideModule";
import {SlGameSceneModule} from "./module/game/SlGameSceneModule";
export {
//UI创建和scene创建
SlGameSceneModule,
SlGameOptionModule,SlRuleModule,SlGameWinModule,SlGameLoseModule,
SlGameStartModule,SlGameGuiModule,SlGameRealTimeRankModule,
SlGameEndModule,SlGameWinnerModule,SlGameEndRankModule,SlGameGuideModule,
//枚举
SlModuleName,
//工具
SlLang, SlSysLang,
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {SysLang} from "../../util/Syslang";
import { RuleModel, TwFun } from "tw";
import {YtGuiCreate} from "yt";
export class RuleModule extends YtPanelModule {
/**
* 数据
*/
protected model: RuleModel;
protected initModel(): void {
this.model = new RuleModel();
}
constructor(){
super()
}
protected config={
x:16,
y:47,
width:68,
height:60,
lineHeight:7,
fontSize:3,
color:"#000000"
}
protected initHtml(x,y,width,height,lineHeight,fontSize,color,val){
this.section = document.createElement('div');
this.section.id="section"
this.section.innerHTML=`
<div>
<style>
#section{position: fixed;overflow-x: hidden;overflow-y: auto;top: ${y}vw; left: ${x}vw;width: ${width}vw;height: ${height}vw;line-height: ${lineHeight}vw;font-family: ${SysLang.lang_015};font-size: ${fontSize}vw;color: ${color};}
</style>
<div>${val}</div>
</div>`;
YtGuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.RULE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
protected onOpened(){
this.initHtml(this.config.x,this.config.y,this.config.width,this.config.height,this.config.lineHeight,this.config.fontSize,this.config.color,this.model.ruleTxt)
this.appendHtml()
}
/**
* 关闭前
* */
protected onClose(){
this.removeHtml()
}
protected removeHtml(){
if(this.section){
document.body.removeChild(this.section);
}
}
}
\ No newline at end of file
import {GuiManager} from "yt"; import {YtGuiManager} from "yt";
import {PanelModule} from "yt"; import {YtPanelModule} from "yt";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName"; import {ModuleName} from "../../enum/ModuleName";
import {SysLang} from "../../util/Syslang"; import {SysLang} from "../../util/Syslang";
import { RuleModel, TwFun } from "tw"; import { RuleModel, TwFun } from "tw";
import {GuiCreate} from "yt"; import {YtGuiCreate} from "yt";
export class RuleModule extends PanelModule { export class RuleModule extends YtPanelModule {
/** /**
* 数据 * 数据
...@@ -44,7 +44,7 @@ export class RuleModule extends PanelModule { ...@@ -44,7 +44,7 @@ export class RuleModule extends PanelModule {
<div>${val}</div> <div>${val}</div>
</div>`; </div>`;
GuiCreate.ins.preventDefault(this.section) YtGuiCreate.ins.preventDefault(this.section)
} }
protected appendHtml(){ protected appendHtml(){
...@@ -53,7 +53,7 @@ export class RuleModule extends PanelModule { ...@@ -53,7 +53,7 @@ export class RuleModule extends PanelModule {
public init(){ public init(){
DisplayPool.ins.displayPool[ModuleName.RULE_PANEL]=this; YtDisplayPool.ins.displayPool[ModuleName.RULE_PANEL]=this;
} }
......
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {SysLang} from "../../util/Syslang";
import { RuleModel, TwFun } from "tw";
import {YtGuiCreate} from "yt";
export class RuleModule extends YtPanelModule {
/**
* 数据
*/
protected model: RuleModel;
protected initModel(): void {
this.model = new RuleModel();
}
constructor(){
super()
}
protected config={
x:16,
y:47,
width:68,
height:60,
lineHeight:7,
fontSize:3,
color:"#000000"
}
protected initHtml(x,y,width,height,lineHeight,fontSize,color,val){
this.section = document.createElement('div');
this.section.id="section"
this.section.innerHTML=`
<div>
<style>
#section{position: fixed;overflow-x: hidden;overflow-y: auto;top: ${y}vw; left: ${x}vw;width: ${width}vw;height: ${height}vw;line-height: ${lineHeight}vw;font-family: ${SysLang.lang_015};font-size: ${fontSize}vw;color: ${color};}
</style>
<div>${val}</div>
</div>`;
YtGuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.RULE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
protected onOpened(){
this.initHtml(this.config.x,this.config.y,this.config.width,this.config.height,this.config.lineHeight,this.config.fontSize,this.config.color,this.model.ruleTxt)
this.appendHtml()
}
/**
* 关闭前
* */
protected onClose(){
this.removeHtml()
}
protected removeHtml(){
if(this.section){
document.body.removeChild(this.section);
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {SysLang} from "../../util/Syslang";
import { RuleModel, TwFun } from "tw";
import {YtGuiCreate} from "yt";
export class SlRuleModule extends YtPanelModule {
/**
* 数据
*/
protected model: RuleModel;
protected initModel(): void {
this.model = new RuleModel();
}
constructor(){
super()
}
protected config={
x:16,
y:47,
width:68,
height:60,
lineHeight:7,
fontSize:3,
color:"#000000"
}
protected initHtml(x,y,width,height,lineHeight,fontSize,color,val){
this.section = document.createElement('div');
this.section.id="section"
this.section.innerHTML=`
<div>
<style>
#section{position: fixed;overflow-x: hidden;overflow-y: auto;top: ${y}vw; left: ${x}vw;width: ${width}vw;height: ${height}vw;line-height: ${lineHeight}vw;font-family: ${SysLang.lang_015};font-size: ${fontSize}vw;color: ${color};}
</style>
<div>${val}</div>
</div>`;
YtGuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.RULE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
protected onOpened(){
this.initHtml(this.config.x,this.config.y,this.config.width,this.config.height,this.config.lineHeight,this.config.fontSize,this.config.color,this.model.ruleTxt)
this.appendHtml()
}
/**
* 关闭前
* */
protected onClose(){
this.removeHtml()
}
protected removeHtml(){
if(this.section){
document.body.removeChild(this.section);
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {SysLang} from "../../util/SlSyslang";
import { RuleModel, TwFun } from "tw";
import {YtGuiCreate} from "yt";
export class SlRuleModule extends YtPanelModule {
/**
* 数据
*/
protected model: RuleModel;
protected initModel(): void {
this.model = new RuleModel();
}
constructor(){
super()
}
protected config={
x:16,
y:47,
width:68,
height:60,
lineHeight:7,
fontSize:3,
color:"#000000"
}
protected initHtml(x,y,width,height,lineHeight,fontSize,color,val){
this.section = document.createElement('div');
this.section.id="section"
this.section.innerHTML=`
<div>
<style>
#section{position: fixed;overflow-x: hidden;overflow-y: auto;top: ${y}vw; left: ${x}vw;width: ${width}vw;height: ${height}vw;line-height: ${lineHeight}vw;font-family: ${SysLang.lang_015};font-size: ${fontSize}vw;color: ${color};}
</style>
<div>${val}</div>
</div>`;
YtGuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.RULE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
protected onOpened(){
this.initHtml(this.config.x,this.config.y,this.config.width,this.config.height,this.config.lineHeight,this.config.fontSize,this.config.color,this.model.ruleTxt)
this.appendHtml()
}
/**
* 关闭前
* */
protected onClose(){
this.removeHtml()
}
protected removeHtml(){
if(this.section){
document.body.removeChild(this.section);
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {SysLang} from "../../util/SlSyslang";
import { RuleModel, TwFun } from "tw";
import {YtGuiCreate} from "yt";
export class SlRuleModule extends YtPanelModule {
/**
* 数据
*/
protected model: RuleModel;
protected initModel(): void {
this.model = new RuleModel();
}
constructor(){
super()
}
protected config={
x:16,
y:47,
width:68,
height:60,
lineHeight:7,
fontSize:3,
color:"#000000"
}
protected initHtml(x,y,width,height,lineHeight,fontSize,color,val){
this.section = document.createElement('div');
this.section.id="section"
this.section.innerHTML=`
<div>
<style>
#section{position: fixed;overflow-x: hidden;overflow-y: auto;top: ${y}vw; left: ${x}vw;width: ${width}vw;height: ${height}vw;line-height: ${lineHeight}vw;font-family: ${SysLang.lang_015};font-size: ${fontSize}vw;color: ${color};}
</style>
<div>${val}</div>
</div>`;
YtGuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.RULE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
protected onOpened(){
this.initHtml(this.config.x,this.config.y,this.config.width,this.config.height,this.config.lineHeight,this.config.fontSize,this.config.color,this.model.ruleTxt)
this.appendHtml()
}
/**
* 关闭前
* */
protected onClose(){
this.removeHtml()
}
protected removeHtml(){
if(this.section){
document.body.removeChild(this.section);
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {SlSysLang} from "../../util/SlSyslang";
import { RuleModel, TwFun } from "tw";
import {YtGuiCreate} from "yt";
export class SlRuleModule extends YtPanelModule {
/**
* 数据
*/
protected model: RuleModel;
protected initModel(): void {
this.model = new RuleModel();
}
constructor(){
super()
}
protected config={
x:16,
y:47,
width:68,
height:60,
lineHeight:7,
fontSize:3,
color:"#000000"
}
protected initHtml(x,y,width,height,lineHeight,fontSize,color,val){
this.section = document.createElement('div');
this.section.id="section"
this.section.innerHTML=`
<div>
<style>
#section{position: fixed;overflow-x: hidden;overflow-y: auto;top: ${y}vw; left: ${x}vw;width: ${width}vw;height: ${height}vw;line-height: ${lineHeight}vw;font-family: ${SysLang.lang_015};font-size: ${fontSize}vw;color: ${color};}
</style>
<div>${val}</div>
</div>`;
YtGuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.RULE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
protected onOpened(){
this.initHtml(this.config.x,this.config.y,this.config.width,this.config.height,this.config.lineHeight,this.config.fontSize,this.config.color,this.model.ruleTxt)
this.appendHtml()
}
/**
* 关闭前
* */
protected onClose(){
this.removeHtml()
}
protected removeHtml(){
if(this.section){
document.body.removeChild(this.section);
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {SlSysLang} from "../../util/SlSyslang";
import { RuleModel, TwFun } from "tw";
import {YtGuiCreate} from "yt";
export class SlRuleModule extends YtPanelModule {
/**
* 数据
*/
protected model: RuleModel;
protected initModel(): void {
this.model = new RuleModel();
}
constructor(){
super()
}
protected config={
x:16,
y:47,
width:68,
height:60,
lineHeight:7,
fontSize:3,
color:"#000000"
}
protected initHtml(x,y,width,height,lineHeight,fontSize,color,val){
this.section = document.createElement('div');
this.section.id="section"
this.section.innerHTML=`
<div>
<style>
#section{position: fixed;overflow-x: hidden;overflow-y: auto;top: ${y}vw; left: ${x}vw;width: ${width}vw;height: ${height}vw;line-height: ${lineHeight}vw;font-family: ${SlSysLang.lang_015};font-size: ${fontSize}vw;color: ${color};}
</style>
<div>${val}</div>
</div>`;
YtGuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.RULE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
protected onOpened(){
this.initHtml(this.config.x,this.config.y,this.config.width,this.config.height,this.config.lineHeight,this.config.fontSize,this.config.color,this.model.ruleTxt)
this.appendHtml()
}
/**
* 关闭前
* */
protected onClose(){
this.removeHtml()
}
protected removeHtml(){
if(this.section){
document.body.removeChild(this.section);
}
}
}
\ No newline at end of file
import {YtGuiManager} from "duiba-yt";
import {YtPanelModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {SlSysLang} from "../../util/SlSyslang";
import { RuleModel, TwFun } from "duiba-tw";
import {YtGuiCreate} from "duiba-yt";
export class SlRuleModule extends YtPanelModule {
/**
* 数据
*/
protected model: RuleModel;
protected initModel(): void {
this.model = new RuleModel();
}
constructor(){
super()
}
protected config={
x:16,
y:47,
width:68,
height:60,
lineHeight:7,
fontSize:3,
color:"#000000"
}
protected initHtml(x,y,width,height,lineHeight,fontSize,color,val){
this.section = document.createElement('div');
this.section.id="section"
this.section.innerHTML=`
<div>
<style>
#section{position: fixed;overflow-x: hidden;overflow-y: auto;top: ${y}vw; left: ${x}vw;width: ${width}vw;height: ${height}vw;line-height: ${lineHeight}vw;font-family: ${SlSysLang.lang_015};font-size: ${fontSize}vw;color: ${color};}
</style>
<div>${val}</div>
</div>`;
YtGuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.RULE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
protected onOpened(){
this.initHtml(this.config.x,this.config.y,this.config.width,this.config.height,this.config.lineHeight,this.config.fontSize,this.config.color,this.model.ruleTxt)
this.appendHtml()
}
/**
* 关闭前
* */
protected onClose(){
this.removeHtml()
}
protected removeHtml(){
if(this.section){
document.body.removeChild(this.section);
}
}
}
\ No newline at end of file
import {Module} from "yt"; import {YtModule} from "yt";
import {AnimationGui} from "yt"; import {YtAnimationGui} from "yt";
import {SceneManager} from "yt"; import {YtSceneManager} from "yt";
import {GuiManager} from "yt"; import {YtGuiManager} from "yt";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw"; import { GameEndModel, TwFun } from "tw";
import { ModuleName } from "../../enum/ModuleName"; import { ModuleName } from "../../enum/ModuleName";
import { WxLang } from "../../util/WxLang"; import { WxLang } from "../../util/WxLang";
import {ModuleManager} from "yt"; import {YtModuleManager} from "yt";
/** /**
*Created by cuiliqiang on 2018/3/16 *Created by cuiliqiang on 2018/3/16
* 游戏结束场景 * 游戏结束场景
*/ */
export class GameEndModule extends Module { export class GameEndModule extends YtModule {
//面板隐藏显示实例 //面板隐藏显示实例
protected panelsAn=new AnimationGui(SceneManager.ins.scene,GuiManager.ins.fullscreenUI) protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){ public init(){
DisplayPool.ins.displayPool[ModuleName.GAME_END_GUI]=this; YtDisplayPool.ins.displayPool[ModuleName.GAME_END_GUI]=this;
} }
/** /**
...@@ -88,7 +88,7 @@ export class GameEndModule extends Module { ...@@ -88,7 +88,7 @@ export class GameEndModule extends Module {
if(!success) { if(!success) {
return; return;
} }
ModuleManager.ins.openModule(ModuleName.RULE_PANEL); YtModuleManager.ins.openModule(ModuleName.RULE_PANEL);
} }
protected onClick_optionBtn(e): void { protected onClick_optionBtn(e): void {
...@@ -101,7 +101,7 @@ export class GameEndModule extends Module { ...@@ -101,7 +101,7 @@ export class GameEndModule extends Module {
if(!success) { if(!success) {
return; return;
} }
ModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL); YtModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL);
} }
protected removeEvent(): void { protected removeEvent(): void {
......
import {YtModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtDisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/ModuleName";
import { WxLang } from "../../util/WxLang";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameEndModule extends YtModule {
//面板隐藏显示实例
protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_END_GUI]=this;
}
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void {
this.model = new GameEndModel();
}
public updateData(...args): void {
this.updateStatusTxt();
this.updateScoreTxt();
}
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str: string = WxLang.lang_004): void {
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
}
/**
* 更新积分文案
*/
protected updateScoreTxt(): void {
if (this.view.scoreTxt) {
this.view.scoreTxt.text=this.model.getScoreTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn)
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn)
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtDisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/ModuleName";
import { WxLang } from "../../util/WxLang";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameEndModule extends YtModule {
//面板隐藏显示实例
protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_GUI]=this;
}
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void {
this.model = new GameEndModel();
}
public updateData(...args): void {
this.updateStatusTxt();
this.updateScoreTxt();
}
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str: string = WxLang.lang_004): void {
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
}
/**
* 更新积分文案
*/
protected updateScoreTxt(): void {
if (this.view.scoreTxt) {
this.view.scoreTxt.text=this.model.getScoreTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn)
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn)
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtDisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/ModuleName";
import { WxLang } from "../../util/WxLang";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameEndModule extends YtModule {
//面板隐藏显示实例
protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_GUI]=this;
}
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void {
this.model = new GameEndModel();
}
public updateData(...args): void {
this.updateStatusTxt();
this.updateScoreTxt();
}
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str: string = WxLang.lang_004): void {
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
}
/**
* 更新积分文案
*/
protected updateScoreTxt(): void {
if (this.view.scoreTxt) {
this.view.scoreTxt.text=this.model.getScoreTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn)
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn)
}
}
}
\ No newline at end of file
import {SceneManager} from "yt"; import {YtSceneManager} from "yt";
import {GuiManager} from "yt"; import {YtGuiManager} from "yt";
import {PanelModule} from "yt"; import {YtPanelModule} from "yt";
import {AnimationGui} from "yt"; import {YtAnimationGui} from "yt";
import {GuiCreate} from "yt"; import {YtGuiCreate} from "yt";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName"; import {ModuleName} from "../../enum/ModuleName";
import { GameEndRankModel, TwFun } from "tw"; import { GameEndRankModel, TwFun } from "tw";
export class GameEndRankModule extends PanelModule { export class GameEndRankModule extends YtPanelModule {
...@@ -48,7 +48,7 @@ export class GameEndRankModule extends PanelModule { ...@@ -48,7 +48,7 @@ export class GameEndRankModule extends PanelModule {
} }
public init(){ public init(){
DisplayPool.ins.displayPool[ModuleName.GAME_END_RANK_PANEL]=this; YtDisplayPool.ins.displayPool[ModuleName.GAME_END_RANK_PANEL]=this;
} }
/** /**
......
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameEndRankModel, TwFun } from "tw";
export class SlGameEndRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameEndRankModel;
protected initModel(): void {
this.model = new GameEndRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
//事件
protected doEvents=[];
constructor(){
super()
this.initUI();
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.rankList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
// this.viewHtml=this.listTemplateHtml(this.model.rankList,this.uiConfig)
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {Module} from "yt"; import {YtModule} from "yt";
import {ModuleName} from "../../enum/ModuleName"; import {ModuleName} from "../../enum/ModuleName";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
export class GameGuiModule extends Module { export class GameGuiModule extends YtModule {
constructor(){ constructor(){
super() super()
} }
public init(){ public init(){
DisplayPool.ins.displayPool[ModuleName.GAME_PLAY_GUI]=this; YtDisplayPool.ins.displayPool[ModuleName.GAME_PLAY_GUI]=this;
} }
/** /**
* 添加事件 * 添加事件
......
import {YtModule} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {YtDisplayPool} from "yt";
export class SlGameGuiModule extends YtModule {
constructor(){
super()
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_PLAY_GUI]=this;
}
/**
* 添加事件
* */
protected addEvent(){
}
protected removeEvent(){
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.removeEvent()
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
}
}
\ No newline at end of file
import {Module} from "yt"; import {YtModule} from "yt";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
import { ModuleName } from "../../enum/ModuleName"; import { ModuleName } from "../../enum/ModuleName";
import {ModuleManager} from "yt"; import {YtModuleManager} from "yt";
import { GCache } from 'tc'; import { GCache } from 'tc';
/** /**
......
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { ModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GCache } from 'tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameGuideModule extends YtModule {
protected totalFrames=1;
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_GUIDE_GUI]=this;
}
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
public updateData(): void {
super.updateData();
this.maxStep = this.totalFrames;
this.currStep = 1;
}
/**
* 引导是否完成
*/
public isComplete(): boolean {
if(this.currStep >= this.maxStep) {
GCache.writeCache('guide', 'true');
return true;
}
return false;
}
protected addEvent(): void {
super.addEvent();
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
}
protected onClick_sureBtn(): void {
this.currStep ++;
if (this.isComplete()) {
ModuleManager.ins.openModule(ModuleName.GAME_PLAY_SCENE);
} else {
// this.view.gotoAndStop(this.currStep);
}
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { ModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GCache } from 'tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameGuideModule extends YtModule {
protected totalFrames=1;
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_GUIDE_GUI]=this;
}
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
public updateData(): void {
super.updateData();
this.maxStep = this.totalFrames;
this.currStep = 1;
}
/**
* 引导是否完成
*/
public isComplete(): boolean {
if(this.currStep >= this.maxStep) {
GCache.writeCache('guide', 'true');
return true;
}
return false;
}
protected addEvent(): void {
super.addEvent();
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
}
protected onClick_sureBtn(): void {
this.currStep ++;
if (this.isComplete()) {
YtModuleManager.ins.openModule(ModuleName.GAME_PLAY_SCENE);
} else {
// this.view.gotoAndStop(this.currStep);
}
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { SlModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GCache } from 'tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameGuideModule extends YtModule {
protected totalFrames=1;
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_GUIDE_GUI]=this;
}
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
public updateData(): void {
super.updateData();
this.maxStep = this.totalFrames;
this.currStep = 1;
}
/**
* 引导是否完成
*/
public isComplete(): boolean {
if(this.currStep >= this.maxStep) {
GCache.writeCache('guide', 'true');
return true;
}
return false;
}
protected addEvent(): void {
super.addEvent();
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
}
protected onClick_sureBtn(): void {
this.currStep ++;
if (this.isComplete()) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
// this.view.gotoAndStop(this.currStep);
}
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { SlModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GCache } from 'tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameGuideModule extends YtModule {
protected totalFrames=1;
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_GUIDE_GUI]=this;
}
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
public updateData(): void {
super.updateData();
this.maxStep = this.totalFrames;
this.currStep = 1;
}
/**
* 引导是否完成
*/
public isComplete(): boolean {
if(this.currStep >= this.maxStep) {
GCache.writeCache('guide', 'true');
return true;
}
return false;
}
protected addEvent(): void {
super.addEvent();
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
}
protected onClick_sureBtn(): void {
this.currStep ++;
if (this.isComplete()) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
// this.view.gotoAndStop(this.currStep);
}
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
}
}
\ No newline at end of file
import {PanelModule} from "yt"; import {YtPanelModule} from "yt";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName"; import {ModuleName} from "../../enum/ModuleName";
import {ModuleManager} from "yt"; import {YtModuleManager} from "yt";
import { GameLoseModel } from 'tw'; import { GameLoseModel } from 'tw';
export class GameLoseModule extends PanelModule { export class GameLoseModule extends YtPanelModule {
constructor(){ constructor(){
super() super()
} }
......
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameLoseModel } from 'tw';
export class GameLoseModule extends YtPanelModule {
constructor(){
super()
}
/**
* 数据
*/
protected model: GameLoseModel;
protected initModel(): void {
this.model = new GameLoseModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_LOSE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
}
/**
* 关闭后
* */
protected onClosed(){
super.onClosed()
this.enableMouseEvt(true)
YtModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameLoseModel } from 'tw';
export class GameLoseModule extends YtPanelModule {
constructor(){
super()
}
/**
* 数据
*/
protected model: GameLoseModel;
protected initModel(): void {
this.model = new GameLoseModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_LOSE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
}
/**
* 关闭后
* */
protected onClosed(){
super.onClosed()
this.enableMouseEvt(true)
YtModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameLoseModel } from 'tw';
export class SlGameLoseModule extends YtPanelModule {
constructor(){
super()
}
/**
* 数据
*/
protected model: GameLoseModel;
protected initModel(): void {
this.model = new GameLoseModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_LOSE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
}
/**
* 关闭后
* */
protected onClosed(){
super.onClosed()
this.enableMouseEvt(true)
YtModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameLoseModel } from 'tw';
export class SlGameLoseModule extends YtPanelModule {
constructor(){
super()
}
/**
* 数据
*/
protected model: SlGameLoseModel;
protected initModel(): void {
this.model = new SlGameLoseModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_LOSE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
}
/**
* 关闭后
* */
protected onClosed(){
super.onClosed()
this.enableMouseEvt(true)
YtModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameLoseModel } from 'tw';
export class SlGameLoseModule extends YtPanelModule {
constructor(){
super()
}
/**
* 数据
*/
protected model: SlGameLoseModel;
protected initModel(): void {
this.model = new SlGameLoseModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_LOSE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
}
/**
* 关闭后
* */
protected onClosed(){
super.onClosed()
this.enableMouseEvt(true)
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {GuiManager} from "yt"; import {YtGuiManager} from "yt";
import {PanelModule} from "yt"; import {PanelModule} from "yt";
import {GuiCreate} from "yt"; import {YtGuiCreate} from "yt";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName"; import {ModuleName} from "../../enum/ModuleName";
import { GameOptionModel, TwFun } from "tw"; import { GameOptionModel, TwFun } from "tw";
......
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameOptionModel, TwFun } from "tw";
export class GameOptionModule extends PanelModule {
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.optionList)
}
public init(){
DisplayPool.ins.displayPool[ModuleName.GAME_OPTION_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameOptionModel, TwFun } from "tw";
export class GameOptionModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.optionList)
}
public init(){
DisplayPool.ins.displayPool[ModuleName.GAME_OPTION_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameOptionModel, TwFun } from "tw";
export class GameOptionModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.optionList)
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_OPTION_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameOptionModel, TwFun } from "tw";
export class SlGameOptionModule extends YtPanelModule {
/**
* 数据
*/
protected model: SlGameOptionModel;
protected initModel(): void {
this.model = new SlGameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.optionList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_OPTION_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {GuiManager} from "yt"; import {YtGuiManager} from "yt";
import {PanelModule} from "yt"; import {YtPanelModule} from "yt";
import {GuiCreate} from "yt"; import {YtGuiCreate} from "yt";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName"; import {ModuleName} from "../../enum/ModuleName";
import { GameRealTimeRankModel, TwFun } from "tw"; import { GameRealTimeRankModel, TwFun } from "tw";
export class GameRealTimeRankModule extends PanelModule { export class GameRealTimeRankModule extends YtPanelModule {
/** /**
* 数据 * 数据
......
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameRealTimeRankModel, TwFun } from "tw";
export class GameRealTimeRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameRealTimeRankModel;
protected initModel(): void {
this.model = new GameRealTimeRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
constructor(){
super()
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.userList)
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_REAL_TIME_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameRealTimeRankModel, TwFun } from "tw";
export class SlGameRealTimeRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: SlGameRealTimeRankModel;
protected initModel(): void {
this.model = new SlGameRealTimeRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
constructor(){
super()
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.userList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_REAL_TIME_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {Module} from "yt"; import {YtModule} from "yt";
import {SceneManager} from "yt"; import {YtSceneManager} from "yt";
import {ModuleManager} from "yt"; import {YtModuleManager} from "yt";
import {YtModuleName} from "yt"; import {YtModuleName} from "yt";
import {YtLang} from "yt"; import {YtLang} from "yt";
import {ModuleName} from "../../enum/ModuleName"; import {ModuleName} from "../../enum/ModuleName";
......
import {YtModule} from "yt";
import {YtSceneManager} from "yt";
import {YtModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class GameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void {
this.model = new GamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
SceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = ModuleName.GAME_WIN_PANEL;
} else {
moduleName = ModuleName.GAME_LOSE_PANEL;
}
ModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
ModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
SceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
ModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtSceneManager} from "yt";
import {YtModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class GameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void {
this.model = new GamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
YtSceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = ModuleName.GAME_WIN_PANEL;
} else {
moduleName = ModuleName.GAME_LOSE_PANEL;
}
ModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
ModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
SceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
ModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtSceneManager} from "yt";
import {YtModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class GameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void {
this.model = new GamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
YtSceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = ModuleName.GAME_WIN_PANEL;
} else {
moduleName = ModuleName.GAME_LOSE_PANEL;
}
YtModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
YtModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
YtSceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
YtModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtSceneManager} from "yt";
import {YtModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class GameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void {
this.model = new GamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
YtSceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = ModuleName.GAME_WIN_PANEL;
} else {
moduleName = ModuleName.GAME_LOSE_PANEL;
}
YtModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
YtModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
YtSceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
YtModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtSceneManager} from "yt";
import {YtModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class GameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void {
this.model = new GamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
YtSceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = SlModuleName.GAME_WIN_PANEL;
} else {
moduleName = SlModuleName.GAME_LOSE_PANEL;
}
YtModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
YtModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
YtSceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
YtModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtSceneManager} from "yt";
import {YtModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class SlGameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: SlGamePlayModel;
protected initModel(): void {
this.model = new SlGamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
YtSceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = SlModuleName.GAME_WIN_PANEL;
} else {
moduleName = SlModuleName.GAME_LOSE_PANEL;
}
YtModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
YtModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
YtSceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
YtModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtSceneManager} from "yt";
import {YtModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class SlGameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void {
this.model = new GamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
YtSceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = SlModuleName.GAME_WIN_PANEL;
} else {
moduleName = SlModuleName.GAME_LOSE_PANEL;
}
YtModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
YtModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
YtSceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
YtModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import {YtModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'tc';
export class GameStartModule extends YtModule {
/**
* 数据
*/
protected model: GameStartModel;
protected initModel(): void {
this.model = new GameStartModel();
}
//游戏场景对象
protected gameSceneObject:any;
constructor(){
super()
}
public init():void{
DisplayPool.ins.displayPool[ModuleName.GAME_START_GUI]=this;
}
/**
* 更新开始按钮状态
*/
protected updateStartBtnStatus(): void {
if (this.view.startBtn) {
const enable: boolean = this.model.startBtnEnable;
// this.view.startBtn.mouseEnable = enable;
this.enableMouseEvtView(this.view.startBtn,enable)
/* if (enable) {
this.view.startBtn.gotoAndStop(1);
} else {
this.view.startBtn.gotoAndStop(3);
} */
}
}
/**
* 更新次数文案
*/
protected updateCountTxt(): void {
if (this.view.countTxt) {
this.view.countTxt.text = ""+this.model.countTxt;
}
}
/**
* 添加事件
* */
protected addEvent(): void{
//开始游戏
if(this.view.startBtn){
this.addClick(this.view.startBtn,this.onClick_startBtn.bind(this))
}
//活动规则
if(this.view.ruleBtn){
this.addClick(this.view.ruleBtn,this.onClick_ruleBtn.bind(this))
}
//活动奖品
if(this.view.optionBtn){
this.addClick(this.view.optionBtn,this.onClick_optionBtn.bind(this))
}
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn,this.onClick_recordBtn.bind(this))
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.addClick(this.view.realTimeRankBtn,this.onClick_realTimeRankBtn.bind(this))
}
}
protected removeEvent(){
//开始游戏
if(this.view.startBtn){
this.removeClick(this.view.startBtn)
}
//活动规则
if(this.view.ruleBtn){
this.removeClick(this.view.ruleBtn)
}
//活动奖品
if(this.view.optionBtn){
this.removeClick(this.view.optionBtn)
}
//兑换记录
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.removeClick(this.view.realTimeRankBtn)
}
}
protected onClick_ruleBtn(): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected onClick_optionBtn(): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected onClick_startBtn(): void {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
}
protected onClick_recordBtn(): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_realTimeRankBtn(): void {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
}
protected doStart_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
const module = ModuleManager.ins.getModule(ModuleName.GAME_GUIDE_GUI);
if(GCache.readCache('guide') || !module) {
ModuleManager.ins.openModule(ModuleName.GAME_PLAY_SCENE);
} else {
ModuleManager.ins.openModule(ModuleName.GAME_GUIDE_GUI);
}
}
protected realtimerank_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
ModuleManager.ins.openModule(ModuleName.GAME_REAL_TIME_RANK_PANEL);
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
ModuleManager.ins.openModule(ModuleName.RULE_PANEL);
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
ModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible=true;
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.updateCountTxt();
this.updateStartBtnStatus();
}
}
\ No newline at end of file
import {Module} from "yt"; import {YtModule} from "yt";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName"; import {ModuleName} from "../../enum/ModuleName";
import {ModuleManager} from "yt"; import {YtModuleManager} from "yt";
import { GameStartModel, TwFun } from "tw"; import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'tc'; import { IModuleData, GCache, GFun, GDispatcher } from 'tc';
export class GameStartModule extends Module { export class GameStartModule extends YtModule {
/** /**
......
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'tc';
export class GameStartModule extends YtModule {
/**
* 数据
*/
protected model: GameStartModel;
protected initModel(): void {
this.model = new GameStartModel();
}
//游戏场景对象
protected gameSceneObject:any;
constructor(){
super()
}
public init():void{
YtDisplayPool.ins.displayPool[ModuleName.GAME_START_GUI]=this;
}
/**
* 更新开始按钮状态
*/
protected updateStartBtnStatus(): void {
if (this.view.startBtn) {
const enable: boolean = this.model.startBtnEnable;
// this.view.startBtn.mouseEnable = enable;
this.enableMouseEvtView(this.view.startBtn,enable)
/* if (enable) {
this.view.startBtn.gotoAndStop(1);
} else {
this.view.startBtn.gotoAndStop(3);
} */
}
}
/**
* 更新次数文案
*/
protected updateCountTxt(): void {
if (this.view.countTxt) {
this.view.countTxt.text = ""+this.model.countTxt;
}
}
/**
* 添加事件
* */
protected addEvent(): void{
//开始游戏
if(this.view.startBtn){
this.addClick(this.view.startBtn,this.onClick_startBtn.bind(this))
}
//活动规则
if(this.view.ruleBtn){
this.addClick(this.view.ruleBtn,this.onClick_ruleBtn.bind(this))
}
//活动奖品
if(this.view.optionBtn){
this.addClick(this.view.optionBtn,this.onClick_optionBtn.bind(this))
}
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn,this.onClick_recordBtn.bind(this))
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.addClick(this.view.realTimeRankBtn,this.onClick_realTimeRankBtn.bind(this))
}
}
protected removeEvent(){
//开始游戏
if(this.view.startBtn){
this.removeClick(this.view.startBtn)
}
//活动规则
if(this.view.ruleBtn){
this.removeClick(this.view.ruleBtn)
}
//活动奖品
if(this.view.optionBtn){
this.removeClick(this.view.optionBtn)
}
//兑换记录
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.removeClick(this.view.realTimeRankBtn)
}
}
protected onClick_ruleBtn(): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected onClick_optionBtn(): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected onClick_startBtn(): void {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
}
protected onClick_recordBtn(): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_realTimeRankBtn(): void {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
}
protected doStart_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
const module = ModuleManager.ins.getModule(ModuleName.GAME_GUIDE_GUI);
if(GCache.readCache('guide') || !module) {
ModuleManager.ins.openModule(ModuleName.GAME_PLAY_SCENE);
} else {
ModuleManager.ins.openModule(ModuleName.GAME_GUIDE_GUI);
}
}
protected realtimerank_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
ModuleManager.ins.openModule(ModuleName.GAME_REAL_TIME_RANK_PANEL);
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
ModuleManager.ins.openModule(ModuleName.RULE_PANEL);
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
ModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible=true;
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.updateCountTxt();
this.updateStartBtnStatus();
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'tc';
export class GameStartModule extends YtModule {
/**
* 数据
*/
protected model: GameStartModel;
protected initModel(): void {
this.model = new GameStartModel();
}
//游戏场景对象
protected gameSceneObject:any;
constructor(){
super()
}
public init():void{
YtDisplayPool.ins.displayPool[ModuleName.GAME_START_GUI]=this;
}
/**
* 更新开始按钮状态
*/
protected updateStartBtnStatus(): void {
if (this.view.startBtn) {
const enable: boolean = this.model.startBtnEnable;
// this.view.startBtn.mouseEnable = enable;
this.enableMouseEvtView(this.view.startBtn,enable)
/* if (enable) {
this.view.startBtn.gotoAndStop(1);
} else {
this.view.startBtn.gotoAndStop(3);
} */
}
}
/**
* 更新次数文案
*/
protected updateCountTxt(): void {
if (this.view.countTxt) {
this.view.countTxt.text = ""+this.model.countTxt;
}
}
/**
* 添加事件
* */
protected addEvent(): void{
//开始游戏
if(this.view.startBtn){
this.addClick(this.view.startBtn,this.onClick_startBtn.bind(this))
}
//活动规则
if(this.view.ruleBtn){
this.addClick(this.view.ruleBtn,this.onClick_ruleBtn.bind(this))
}
//活动奖品
if(this.view.optionBtn){
this.addClick(this.view.optionBtn,this.onClick_optionBtn.bind(this))
}
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn,this.onClick_recordBtn.bind(this))
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.addClick(this.view.realTimeRankBtn,this.onClick_realTimeRankBtn.bind(this))
}
}
protected removeEvent(){
//开始游戏
if(this.view.startBtn){
this.removeClick(this.view.startBtn)
}
//活动规则
if(this.view.ruleBtn){
this.removeClick(this.view.ruleBtn)
}
//活动奖品
if(this.view.optionBtn){
this.removeClick(this.view.optionBtn)
}
//兑换记录
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.removeClick(this.view.realTimeRankBtn)
}
}
protected onClick_ruleBtn(): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected onClick_optionBtn(): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected onClick_startBtn(): void {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
}
protected onClick_recordBtn(): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_realTimeRankBtn(): void {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
}
protected doStart_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
const module = YtModuleManager.ins.getModule(ModuleName.GAME_GUIDE_GUI);
if(GCache.readCache('guide') || !module) {
YtModuleManager.ins.openModule(ModuleName.GAME_PLAY_SCENE);
} else {
YtModuleManager.ins.openModule(ModuleName.GAME_GUIDE_GUI);
}
}
protected realtimerank_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.GAME_REAL_TIME_RANK_PANEL);
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.RULE_PANEL);
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible=true;
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.updateCountTxt();
this.updateStartBtnStatus();
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'tc';
export class SlGameStartModule extends YtModule {
/**
* 数据
*/
protected model: GameStartModel;
protected initModel(): void {
this.model = new GameStartModel();
}
//游戏场景对象
protected gameSceneObject:any;
constructor(){
super()
}
public init():void{
YtDisplayPool.ins.displayPool[SlModuleName.GAME_START_GUI]=this;
}
/**
* 更新开始按钮状态
*/
protected updateStartBtnStatus(): void {
if (this.view.startBtn) {
const enable: boolean = this.model.startBtnEnable;
// this.view.startBtn.mouseEnable = enable;
this.enableMouseEvtView(this.view.startBtn,enable)
/* if (enable) {
this.view.startBtn.gotoAndStop(1);
} else {
this.view.startBtn.gotoAndStop(3);
} */
}
}
/**
* 更新次数文案
*/
protected updateCountTxt(): void {
if (this.view.countTxt) {
this.view.countTxt.text = ""+this.model.countTxt;
}
}
/**
* 添加事件
* */
protected addEvent(): void{
//开始游戏
if(this.view.startBtn){
this.addClick(this.view.startBtn,this.onClick_startBtn.bind(this))
}
//活动规则
if(this.view.ruleBtn){
this.addClick(this.view.ruleBtn,this.onClick_ruleBtn.bind(this))
}
//活动奖品
if(this.view.optionBtn){
this.addClick(this.view.optionBtn,this.onClick_optionBtn.bind(this))
}
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn,this.onClick_recordBtn.bind(this))
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.addClick(this.view.realTimeRankBtn,this.onClick_realTimeRankBtn.bind(this))
}
}
protected removeEvent(){
//开始游戏
if(this.view.startBtn){
this.removeClick(this.view.startBtn)
}
//活动规则
if(this.view.ruleBtn){
this.removeClick(this.view.ruleBtn)
}
//活动奖品
if(this.view.optionBtn){
this.removeClick(this.view.optionBtn)
}
//兑换记录
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.removeClick(this.view.realTimeRankBtn)
}
}
protected onClick_ruleBtn(): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected onClick_optionBtn(): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected onClick_startBtn(): void {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
}
protected onClick_recordBtn(): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_realTimeRankBtn(): void {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
}
protected doStart_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
const module = YtModuleManager.ins.getModule(SlModuleName.GAME_GUIDE_GUI);
if(GCache.readCache('guide') || !module) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
YtModuleManager.ins.openModule(SlModuleName.GAME_GUIDE_GUI);
}
}
protected realtimerank_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_REAL_TIME_RANK_PANEL);
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible=true;
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.updateCountTxt();
this.updateStartBtnStatus();
}
}
\ No newline at end of file
import {PanelModule} from "yt"; import {YtPanelModule} from "yt";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
import {ModuleManager} from "yt"; import {YtModuleManager} from "yt";
import {ModuleName} from "../../enum/ModuleName"; import {ModuleName} from "../../enum/ModuleName";
import { GameWinModel } from 'tw'; import { GameWinModel } from 'tw';
export class GameWinModule extends PanelModule { export class GameWinModule extends PanelModule {
......
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {YtModuleManager} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameWinModel } from 'tw';
export class GameWinModule extends YtPanelModule {
//分数
protected score;
constructor(){
super()
}
/**
* 数据
*/
protected model: GameWinModel;
protected initModel(): void {
this.model = new GameWinModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
}
/**
* 更新奖品名字文案
*/
protected updateOptionNameTxt(): void {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
}
/**
* 更新图片
*/
protected updateOptionImg(): void {
if(this.view.optionImg){
this.view.optionImg.source=this.model.optionImg;
}
}
public init(){
DisplayPool.ins.displayPool[ModuleName.GAME_WIN_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
if(this.view.useBtn){
this.addClick(this.view.useBtn,this.onClick_useBtn.bind(this))
}
if(this.view.optionImg){
this.addClick(this.view.optionImg,this.onClick_useBtn.bind(this))
}
if(this.view.againBtn){
this.addClick(this.view.againBtn,this.onClick_againBtn.bind(this))
}
}
/**
* 移除事件
* */
protected removeEvent(){
if(this.view.closeBtn){
this.removeClick(this.view.closeBtn)
}
if(this.view.useBtn){
this.removeClick(this.view.useBtn)
}
if(this.view.optionImg){
this.removeClick(this.view.optionImg)
}
if(this.view.againBtn){
this.removeClick(this.view.againBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
this.updateOptionNameTxt();
this.updateOptionImg();
}
protected onClick_useBtn(e): void {
this.enableMouseEvt(false)
this.model.onUse();
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
}
protected getInfo_result(): void {
ModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
}
private onClick_againBtn(e): void {
this.enableMouseEvt(false)
this.model.doStart(this.doStart_result.bind(this));
}
protected doStart_result(e): void {
this.onClosed()
this.hide();
setTimeout(()=>{
ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
ModuleManager.ins.openModule(ModuleName.GAME_PLAY_SCENE);
},500)
this.enableMouseEvt(true);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {YtModuleManager} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameWinModel } from 'tw';
export class GameWinModule extends YtPanelModule {
//分数
protected score;
constructor(){
super()
}
/**
* 数据
*/
protected model: GameWinModel;
protected initModel(): void {
this.model = new GameWinModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
}
/**
* 更新奖品名字文案
*/
protected updateOptionNameTxt(): void {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
}
/**
* 更新图片
*/
protected updateOptionImg(): void {
if(this.view.optionImg){
this.view.optionImg.source=this.model.optionImg;
}
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_WIN_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
if(this.view.useBtn){
this.addClick(this.view.useBtn,this.onClick_useBtn.bind(this))
}
if(this.view.optionImg){
this.addClick(this.view.optionImg,this.onClick_useBtn.bind(this))
}
if(this.view.againBtn){
this.addClick(this.view.againBtn,this.onClick_againBtn.bind(this))
}
}
/**
* 移除事件
* */
protected removeEvent(){
if(this.view.closeBtn){
this.removeClick(this.view.closeBtn)
}
if(this.view.useBtn){
this.removeClick(this.view.useBtn)
}
if(this.view.optionImg){
this.removeClick(this.view.optionImg)
}
if(this.view.againBtn){
this.removeClick(this.view.againBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
this.updateOptionNameTxt();
this.updateOptionImg();
}
protected onClick_useBtn(e): void {
this.enableMouseEvt(false)
this.model.onUse();
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
}
protected getInfo_result(): void {
YtModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
}
private onClick_againBtn(e): void {
this.enableMouseEvt(false)
this.model.doStart(this.doStart_result.bind(this));
}
protected doStart_result(e): void {
this.onClosed()
this.hide();
setTimeout(()=>{
YtModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
YtModuleManager.ins.openModule(ModuleName.GAME_PLAY_SCENE);
},500)
this.enableMouseEvt(true);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {YtModuleManager} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameWinModel } from 'tw';
export class GameWinModule extends YtPanelModule {
//分数
protected score;
constructor(){
super()
}
/**
* 数据
*/
protected model: GameWinModel;
protected initModel(): void {
this.model = new GameWinModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
}
/**
* 更新奖品名字文案
*/
protected updateOptionNameTxt(): void {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
}
/**
* 更新图片
*/
protected updateOptionImg(): void {
if(this.view.optionImg){
this.view.optionImg.source=this.model.optionImg;
}
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_WIN_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
if(this.view.useBtn){
this.addClick(this.view.useBtn,this.onClick_useBtn.bind(this))
}
if(this.view.optionImg){
this.addClick(this.view.optionImg,this.onClick_useBtn.bind(this))
}
if(this.view.againBtn){
this.addClick(this.view.againBtn,this.onClick_againBtn.bind(this))
}
}
/**
* 移除事件
* */
protected removeEvent(){
if(this.view.closeBtn){
this.removeClick(this.view.closeBtn)
}
if(this.view.useBtn){
this.removeClick(this.view.useBtn)
}
if(this.view.optionImg){
this.removeClick(this.view.optionImg)
}
if(this.view.againBtn){
this.removeClick(this.view.againBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
this.updateOptionNameTxt();
this.updateOptionImg();
}
protected onClick_useBtn(e): void {
this.enableMouseEvt(false)
this.model.onUse();
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
}
protected getInfo_result(): void {
YtModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
}
private onClick_againBtn(e): void {
this.enableMouseEvt(false)
this.model.doStart(this.doStart_result.bind(this));
}
protected doStart_result(e): void {
this.onClosed()
this.hide();
setTimeout(()=>{
YtModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
YtModuleManager.ins.openModule(ModuleName.GAME_PLAY_SCENE);
},500)
this.enableMouseEvt(true);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {YtModuleManager} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameWinModel } from 'tw';
export class SlGameWinModule extends YtPanelModule {
//分数
protected score;
constructor(){
super()
}
/**
* 数据
*/
protected model: GameWinModel;
protected initModel(): void {
this.model = new GameWinModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
}
/**
* 更新奖品名字文案
*/
protected updateOptionNameTxt(): void {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
}
/**
* 更新图片
*/
protected updateOptionImg(): void {
if(this.view.optionImg){
this.view.optionImg.source=this.model.optionImg;
}
}
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_WIN_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
if(this.view.useBtn){
this.addClick(this.view.useBtn,this.onClick_useBtn.bind(this))
}
if(this.view.optionImg){
this.addClick(this.view.optionImg,this.onClick_useBtn.bind(this))
}
if(this.view.againBtn){
this.addClick(this.view.againBtn,this.onClick_againBtn.bind(this))
}
}
/**
* 移除事件
* */
protected removeEvent(){
if(this.view.closeBtn){
this.removeClick(this.view.closeBtn)
}
if(this.view.useBtn){
this.removeClick(this.view.useBtn)
}
if(this.view.optionImg){
this.removeClick(this.view.optionImg)
}
if(this.view.againBtn){
this.removeClick(this.view.againBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
this.updateOptionNameTxt();
this.updateOptionImg();
}
protected onClick_useBtn(e): void {
this.enableMouseEvt(false)
this.model.onUse();
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
}
protected getInfo_result(): void {
YtModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
}
private onClick_againBtn(e): void {
this.enableMouseEvt(false)
this.model.doStart(this.doStart_result.bind(this));
}
protected doStart_result(e): void {
this.onClosed()
this.hide();
setTimeout(()=>{
YtModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
YtModuleManager.ins.openModule(ModuleName.GAME_PLAY_SCENE);
},500)
this.enableMouseEvt(true);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {YtModuleManager} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameWinModel } from 'tw';
export class SlGameWinModule extends YtPanelModule {
//分数
protected score;
constructor(){
super()
}
/**
* 数据
*/
protected model: GameWinModel;
protected initModel(): void {
this.model = new GameWinModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
}
/**
* 更新奖品名字文案
*/
protected updateOptionNameTxt(): void {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
}
/**
* 更新图片
*/
protected updateOptionImg(): void {
if(this.view.optionImg){
this.view.optionImg.source=this.model.optionImg;
}
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WIN_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
if(this.view.useBtn){
this.addClick(this.view.useBtn,this.onClick_useBtn.bind(this))
}
if(this.view.optionImg){
this.addClick(this.view.optionImg,this.onClick_useBtn.bind(this))
}
if(this.view.againBtn){
this.addClick(this.view.againBtn,this.onClick_againBtn.bind(this))
}
}
/**
* 移除事件
* */
protected removeEvent(){
if(this.view.closeBtn){
this.removeClick(this.view.closeBtn)
}
if(this.view.useBtn){
this.removeClick(this.view.useBtn)
}
if(this.view.optionImg){
this.removeClick(this.view.optionImg)
}
if(this.view.againBtn){
this.removeClick(this.view.againBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
this.updateOptionNameTxt();
this.updateOptionImg();
}
protected onClick_useBtn(e): void {
this.enableMouseEvt(false)
this.model.onUse();
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
}
protected getInfo_result(): void {
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
}
private onClick_againBtn(e): void {
this.enableMouseEvt(false)
this.model.doStart(this.doStart_result.bind(this));
}
protected doStart_result(e): void {
this.onClosed()
this.hide();
setTimeout(()=>{
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_GUI);
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
},500)
this.enableMouseEvt(true);
}
}
\ No newline at end of file
import {Module} from "yt"; import {YtModule} from "yt";
import {DisplayPool} from "yt"; import {YtDisplayPool} from "yt";
import { GameWinnerModel, TwFun } from "tw"; import { GameWinnerModel, TwFun } from "tw";
import { ModuleName } from "../../enum/ModuleName"; import { ModuleName } from "../../enum/ModuleName";
import {ModuleManager} from "yt"; import {YtModuleManager} from "yt";
/** /**
*Created by cuiliqiang on 2018/3/16 *Created by cuiliqiang on 2018/3/16
......
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { GameWinnerModel, TwFun } from "tw";
import { ModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameWinnerModule extends YtModule {
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_WINNER_GUI]=this;
}
/**
* 数据
*/
protected model: GameWinnerModel;
protected initModel(): void {
this.model = new GameWinnerModel();
}
public updateData(...args): void {
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
}
/**
* 更新排行榜文案
*/
protected updateRankTxt(): void {
if(this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新奖品文案
*/
protected updateOptionTxt(): void {
if(this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
}
/**
* 更新用户ID文案
*/
protected updateCidTxt(): void {
if(this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//排行榜
if (this.view.rankBtn) {
this.addClick(this.view.rankBtn, this.onClick_rankBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
ModuleManager.ins.openModule(ModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
ModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL);
}
protected onClick_rankBtn(e): void {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
ModuleManager.ins.openModule(ModuleName.GAME_END_RANK_PANEL, this.model.rankList);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
if (this.view.rankBtn) {
this.removeClick(this.view.rankBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { GameWinnerModel, TwFun } from "tw";
import { ModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameWinnerModule extends YtModule {
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_WINNER_GUI]=this;
}
/**
* 数据
*/
protected model: GameWinnerModel;
protected initModel(): void {
this.model = new GameWinnerModel();
}
public updateData(...args): void {
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
}
/**
* 更新排行榜文案
*/
protected updateRankTxt(): void {
if(this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新奖品文案
*/
protected updateOptionTxt(): void {
if(this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
}
/**
* 更新用户ID文案
*/
protected updateCidTxt(): void {
if(this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//排行榜
if (this.view.rankBtn) {
this.addClick(this.view.rankBtn, this.onClick_rankBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL);
}
protected onClick_rankBtn(e): void {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
YtModuleManager.ins.openModule(ModuleName.GAME_END_RANK_PANEL, this.model.rankList);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
if (this.view.rankBtn) {
this.removeClick(this.view.rankBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { GameWinnerModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameWinnerModule extends YtModule {
public init(){
YtDisplayPool.ins.displayPool[ModuleName.GAME_WINNER_GUI]=this;
}
/**
* 数据
*/
protected model: GameWinnerModel;
protected initModel(): void {
this.model = new GameWinnerModel();
}
public updateData(...args): void {
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
}
/**
* 更新排行榜文案
*/
protected updateRankTxt(): void {
if(this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新奖品文案
*/
protected updateOptionTxt(): void {
if(this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
}
/**
* 更新用户ID文案
*/
protected updateCidTxt(): void {
if(this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//排行榜
if (this.view.rankBtn) {
this.addClick(this.view.rankBtn, this.onClick_rankBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL);
}
protected onClick_rankBtn(e): void {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
YtModuleManager.ins.openModule(ModuleName.GAME_END_RANK_PANEL, this.model.rankList);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
if (this.view.rankBtn) {
this.removeClick(this.view.rankBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { GameWinnerModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameWinnerModule extends YtModule {
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WINNER_GUI]=this;
}
/**
* 数据
*/
protected model: GameWinnerModel;
protected initModel(): void {
this.model = new GameWinnerModel();
}
public updateData(...args): void {
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
}
/**
* 更新排行榜文案
*/
protected updateRankTxt(): void {
if(this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新奖品文案
*/
protected updateOptionTxt(): void {
if(this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
}
/**
* 更新用户ID文案
*/
protected updateCidTxt(): void {
if(this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//排行榜
if (this.view.rankBtn) {
this.addClick(this.view.rankBtn, this.onClick_rankBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(ModuleName.GAME_OPTION_PANEL);
}
protected onClick_rankBtn(e): void {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
YtModuleManager.ins.openModule(ModuleName.GAME_END_RANK_PANEL, this.model.rankList);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
if (this.view.rankBtn) {
this.removeClick(this.view.rankBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { GameWinnerModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameWinnerModule extends YtModule {
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WINNER_GUI]=this;
}
/**
* 数据
*/
protected model: GameWinnerModel;
protected initModel(): void {
this.model = new GameWinnerModel();
}
public updateData(...args): void {
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
}
/**
* 更新排行榜文案
*/
protected updateRankTxt(): void {
if(this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新奖品文案
*/
protected updateOptionTxt(): void {
if(this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
}
/**
* 更新用户ID文案
*/
protected updateCidTxt(): void {
if(this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//排行榜
if (this.view.rankBtn) {
this.addClick(this.view.rankBtn, this.onClick_rankBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected onClick_rankBtn(e): void {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
YtModuleManager.ins.openModule(SlModuleName.GAME_END_RANK_PANEL, this.model.rankList);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
if (this.view.rankBtn) {
this.removeClick(this.view.rankBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtDisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/ModuleName";
import { WxLang } from "../../util/WxLang";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameEndModule extends YtModule {
//面板隐藏显示实例
protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_GUI]=this;
}
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void {
this.model = new GameEndModel();
}
public updateData(...args): void {
this.updateStatusTxt();
this.updateScoreTxt();
}
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str: string = WxLang.lang_004): void {
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
}
/**
* 更新积分文案
*/
protected updateScoreTxt(): void {
if (this.view.scoreTxt) {
this.view.scoreTxt.text=this.model.getScoreTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn)
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn)
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtDisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/ModuleName";
import { WxLang } from "../../util/SlLang";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameEndModule extends YtModule {
//面板隐藏显示实例
protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_GUI]=this;
}
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void {
this.model = new GameEndModel();
}
public updateData(...args): void {
this.updateStatusTxt();
this.updateScoreTxt();
}
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str: string = WxLang.lang_004): void {
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
}
/**
* 更新积分文案
*/
protected updateScoreTxt(): void {
if (this.view.scoreTxt) {
this.view.scoreTxt.text=this.model.getScoreTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn)
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn)
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtDisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/SlModuleName";
import { WxLang } from "../../util/SlLang";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameEndModule extends YtModule {
//面板隐藏显示实例
protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_GUI]=this;
}
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void {
this.model = new GameEndModel();
}
public updateData(...args): void {
this.updateStatusTxt();
this.updateScoreTxt();
}
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str: string = WxLang.lang_004): void {
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
}
/**
* 更新积分文案
*/
protected updateScoreTxt(): void {
if (this.view.scoreTxt) {
this.view.scoreTxt.text=this.model.getScoreTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn)
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn)
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtDisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/SlModuleName";
import { SlLang } from "../../util/SlLang";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameEndModule extends YtModule {
//面板隐藏显示实例
protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_GUI]=this;
}
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void {
this.model = new GameEndModel();
}
public updateData(...args): void {
this.updateStatusTxt();
this.updateScoreTxt();
}
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str: string = WxLang.lang_004): void {
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
}
/**
* 更新积分文案
*/
protected updateScoreTxt(): void {
if (this.view.scoreTxt) {
this.view.scoreTxt.text=this.model.getScoreTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn)
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn)
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtDisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/SlModuleName";
import { SlLang } from "../../util/SlLang";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameEndModule extends YtModule {
//面板隐藏显示实例
protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_GUI]=this;
}
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void {
this.model = new GameEndModel();
}
public updateData(...args): void {
this.updateStatusTxt();
this.updateScoreTxt();
}
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str: string = SlLang.lang_004): void {
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
}
/**
* 更新积分文案
*/
protected updateScoreTxt(): void {
if (this.view.scoreTxt) {
this.view.scoreTxt.text=this.model.getScoreTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn)
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn)
}
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtAnimationGui} from "duiba-yt";
import {YtSceneManager} from "duiba-yt";
import {YtGuiManager} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import { GameEndModel, TwFun } from "duiba-tw";
import { SlModuleName } from "../../enum/SlModuleName";
import { SlLang } from "../../util/SlLang";
import {YtModuleManager} from "duiba-yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameEndModule extends YtModule {
//面板隐藏显示实例
protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_GUI]=this;
}
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void {
this.model = new GameEndModel();
}
public updateData(...args): void {
this.updateStatusTxt();
this.updateScoreTxt();
}
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str: string = SlLang.lang_004): void {
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
}
/**
* 更新积分文案
*/
protected updateScoreTxt(): void {
if (this.view.scoreTxt) {
this.view.scoreTxt.text=this.model.getScoreTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn)
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn)
}
}
}
\ No newline at end of file
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameEndRankModel, TwFun } from "tw";
export class SlGameEndRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameEndRankModel;
protected initModel(): void {
this.model = new GameEndRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
//事件
protected doEvents=[];
constructor(){
super()
this.initUI();
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.rankList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
// this.viewHtml=this.listTemplateHtml(this.model.rankList,this.uiConfig)
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtSceneManager} from "yt";
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtAnimationGui} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameEndRankModel, TwFun } from "tw";
export class SlGameEndRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameEndRankModel;
protected initModel(): void {
this.model = new GameEndRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
//事件
protected doEvents=[];
constructor(){
super()
this.initUI();
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.rankList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
// this.viewHtml=this.listTemplateHtml(this.model.rankList,this.uiConfig)
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtSceneManager} from "duiba-yt";
import {YtGuiManager} from "duiba-yt";
import {YtPanelModule} from "duiba-yt";
import {YtAnimationGui} from "duiba-yt";
import {YtGuiCreate} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameEndRankModel, TwFun } from "duiba-tw";
export class SlGameEndRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameEndRankModel;
protected initModel(): void {
this.model = new GameEndRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
//事件
protected doEvents=[];
constructor(){
super()
this.initUI();
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.rankList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
// this.viewHtml=this.listTemplateHtml(this.model.rankList,this.uiConfig)
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {YtDisplayPool} from "yt";
export class SlGameGuiModule extends YtModule {
constructor(){
super()
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_PLAY_GUI]=this;
}
/**
* 添加事件
* */
protected addEvent(){
}
protected removeEvent(){
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.removeEvent()
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {YtDisplayPool} from "yt";
export class SlGameGuiModule extends YtModule {
constructor(){
super()
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_PLAY_GUI]=this;
}
/**
* 添加事件
* */
protected addEvent(){
}
protected removeEvent(){
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.removeEvent()
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {YtDisplayPool} from "duiba-yt";
export class SlGameGuiModule extends YtModule {
constructor(){
super()
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_PLAY_GUI]=this;
}
/**
* 添加事件
* */
protected addEvent(){
}
protected removeEvent(){
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.removeEvent()
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { SlModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GCache } from 'tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameGuideModule extends YtModule {
protected totalFrames=1;
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_GUIDE_GUI]=this;
}
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
public updateData(): void {
super.updateData();
this.maxStep = this.totalFrames;
this.currStep = 1;
}
/**
* 引导是否完成
*/
public isComplete(): boolean {
if(this.currStep >= this.maxStep) {
GCache.writeCache('guide', 'true');
return true;
}
return false;
}
protected addEvent(): void {
super.addEvent();
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
}
protected onClick_sureBtn(): void {
this.currStep ++;
if (this.isComplete()) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
// this.view.gotoAndStop(this.currStep);
}
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { SlModuleName } from "../../enum/SlModuleName";
import {YtModuleManager} from "yt";
import { GCache } from 'tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameGuideModule extends YtModule {
protected totalFrames=1;
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_GUIDE_GUI]=this;
}
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
public updateData(): void {
super.updateData();
this.maxStep = this.totalFrames;
this.currStep = 1;
}
/**
* 引导是否完成
*/
public isComplete(): boolean {
if(this.currStep >= this.maxStep) {
GCache.writeCache('guide', 'true');
return true;
}
return false;
}
protected addEvent(): void {
super.addEvent();
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
}
protected onClick_sureBtn(): void {
this.currStep ++;
if (this.isComplete()) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
// this.view.gotoAndStop(this.currStep);
}
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtDisplayPool} from "yt";
import { SlModuleName } from "../../enum/SlModuleName";
import {YtModuleManager} from "yt";
import { GCache } from 'tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameGuideModule extends YtModule {
protected totalFrames=1;
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_GUIDE_GUI]=this;
}
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
public updateData(): void {
super.updateData();
this.maxStep = this.totalFrames;
this.currStep = 1;
}
/**
* 引导是否完成
*/
public isComplete(): boolean {
if(this.currStep >= this.maxStep) {
GCache.writeCache('guide', 'true');
return true;
}
return false;
}
protected addEvent(): void {
super.addEvent();
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
}
protected onClick_sureBtn(): void {
this.currStep ++;
if (this.isComplete()) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
// this.view.gotoAndStop(this.currStep);
}
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import { SlModuleName } from "../../enum/SlModuleName";
import {YtModuleManager} from "duiba-yt";
import { GCache } from 'duiba-tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameGuideModule extends YtModule {
protected totalFrames=1;
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_GUIDE_GUI]=this;
}
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
public updateData(): void {
super.updateData();
this.maxStep = this.totalFrames;
this.currStep = 1;
}
/**
* 引导是否完成
*/
public isComplete(): boolean {
if(this.currStep >= this.maxStep) {
GCache.writeCache('guide', 'true');
return true;
}
return false;
}
protected addEvent(): void {
super.addEvent();
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
}
protected onClick_sureBtn(): void {
this.currStep ++;
if (this.isComplete()) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
// this.view.gotoAndStop(this.currStep);
}
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import { SlModuleName } from "../../enum/SlModuleName";
import {YtModuleManager} from "duiba-yt";
import { GCache } from 'duiba-tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameGuideModule extends YtModule {
protected totalFrames=1;
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_GUIDE_GUI]=this;
}
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
public updateData(): void {
super.updateData();
this.maxStep = this.totalFrames;
this.currStep = 1;
}
/**
* 引导是否完成
*/
public isComplete(): boolean {
if(this.currStep >= this.maxStep) {
GCache.writeCache('guide', 'true');
return true;
}
return false;
}
protected addEvent(): void {
super.addEvent();
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
}
protected onClick_sureBtn(): void {
this.currStep ++;
if (this.isComplete()) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
// this.view.gotoAndStop(this.currStep);
}
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameLoseModel } from 'tw';
export class SlGameLoseModule extends YtPanelModule {
constructor(){
super()
}
/**
* 数据
*/
protected model: SlGameLoseModel;
protected initModel(): void {
this.model = new SlGameLoseModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_LOSE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
}
/**
* 关闭后
* */
protected onClosed(){
super.onClosed()
this.enableMouseEvt(true)
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameLoseModel } from 'tw';
export class SlGameLoseModule extends YtPanelModule {
constructor(){
super()
}
/**
* 数据
*/
protected model: GameLoseModel;
protected initModel(): void {
this.model = new GameLoseModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_LOSE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
}
/**
* 关闭后
* */
protected onClosed(){
super.onClosed()
this.enableMouseEvt(true)
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {YtModuleManager} from "yt";
import { GameLoseModel } from 'tw';
export class SlGameLoseModule extends YtPanelModule {
constructor(){
super()
}
/**
* 数据
*/
protected model: GameLoseModel;
protected initModel(): void {
this.model = new GameLoseModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_LOSE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
}
/**
* 关闭后
* */
protected onClosed(){
super.onClosed()
this.enableMouseEvt(true)
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {YtPanelModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {YtModuleManager} from "duiba-yt";
import { GameLoseModel } from 'duiba-tw';
export class SlGameLoseModule extends YtPanelModule {
constructor(){
super()
}
/**
* 数据
*/
protected model: GameLoseModel;
protected initModel(): void {
this.model = new GameLoseModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_LOSE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
}
/**
* 关闭后
* */
protected onClosed(){
super.onClosed()
this.enableMouseEvt(true)
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameOptionModel, TwFun } from "tw";
export class SlGameOptionModule extends YtPanelModule {
/**
* 数据
*/
protected model: SlGameOptionModel;
protected initModel(): void {
this.model = new SlGameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.optionList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_OPTION_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameOptionModel, TwFun } from "tw";
export class SlGameOptionModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.optionList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_OPTION_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameOptionModel, TwFun } from "tw";
export class SlGameOptionModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.optionList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_OPTION_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "duiba-yt";
import {YtPanelModule} from "duiba-yt";
import {YtGuiCreate} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameOptionModel, TwFun } from "tw";
export class SlGameOptionModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.optionList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_OPTION_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "duiba-yt";
import {YtPanelModule} from "duiba-yt";
import {YtGuiCreate} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameOptionModel, TwFun } from "duiba-tw";
export class SlGameOptionModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.optionList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_OPTION_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameRealTimeRankModel, TwFun } from "tw";
export class SlGameRealTimeRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: SlGameRealTimeRankModel;
protected initModel(): void {
this.model = new SlGameRealTimeRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
constructor(){
super()
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.userList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_REAL_TIME_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameRealTimeRankModel, TwFun } from "tw";
export class SlGameRealTimeRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameRealTimeRankModel;
protected initModel(): void {
this.model = new GameRealTimeRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
constructor(){
super()
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.userList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_REAL_TIME_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "yt";
import {YtPanelModule} from "yt";
import {YtGuiCreate} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameRealTimeRankModel, TwFun } from "tw";
export class SlGameRealTimeRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameRealTimeRankModel;
protected initModel(): void {
this.model = new GameRealTimeRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
constructor(){
super()
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.userList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_REAL_TIME_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "duiba-yt";
import {YtPanelModule} from "duiba-yt";
import {YtGuiCreate} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameRealTimeRankModel, TwFun } from "duiba-tw";
export class SlGameRealTimeRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameRealTimeRankModel;
protected initModel(): void {
this.model = new GameRealTimeRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
constructor(){
super()
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.userList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_REAL_TIME_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtSceneManager} from "yt";
import {YtModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class SlGameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void {
this.model = new GamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
YtSceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = SlModuleName.GAME_WIN_PANEL;
} else {
moduleName = SlModuleName.GAME_LOSE_PANEL;
}
YtModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
YtModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
YtSceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
YtModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtSceneManager} from "yt";
import {YtModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GamePlayModel } from "tw";
export class SlGameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void {
this.model = new GamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
YtSceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = SlModuleName.GAME_WIN_PANEL;
} else {
moduleName = SlModuleName.GAME_LOSE_PANEL;
}
YtModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
YtModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
YtSceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
YtModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtSceneManager} from "duiba-yt";
import {YtModuleManager} from "duiba-yt";
import {YtModuleName} from "duiba-yt";
import {YtLang} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GamePlayModel } from "duiba-tw";
export class SlGameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void {
this.model = new GamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
YtSceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = SlModuleName.GAME_WIN_PANEL;
} else {
moduleName = SlModuleName.GAME_LOSE_PANEL;
}
YtModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
YtModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
YtSceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
YtModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'tc';
export class SlGameStartModule extends YtModule {
/**
* 数据
*/
protected model: GameStartModel;
protected initModel(): void {
this.model = new GameStartModel();
}
//游戏场景对象
protected gameSceneObject:any;
constructor(){
super()
}
public init():void{
YtDisplayPool.ins.displayPool[SlModuleName.GAME_START_GUI]=this;
}
/**
* 更新开始按钮状态
*/
protected updateStartBtnStatus(): void {
if (this.view.startBtn) {
const enable: boolean = this.model.startBtnEnable;
// this.view.startBtn.mouseEnable = enable;
this.enableMouseEvtView(this.view.startBtn,enable)
/* if (enable) {
this.view.startBtn.gotoAndStop(1);
} else {
this.view.startBtn.gotoAndStop(3);
} */
}
}
/**
* 更新次数文案
*/
protected updateCountTxt(): void {
if (this.view.countTxt) {
this.view.countTxt.text = ""+this.model.countTxt;
}
}
/**
* 添加事件
* */
protected addEvent(): void{
//开始游戏
if(this.view.startBtn){
this.addClick(this.view.startBtn,this.onClick_startBtn.bind(this))
}
//活动规则
if(this.view.ruleBtn){
this.addClick(this.view.ruleBtn,this.onClick_ruleBtn.bind(this))
}
//活动奖品
if(this.view.optionBtn){
this.addClick(this.view.optionBtn,this.onClick_optionBtn.bind(this))
}
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn,this.onClick_recordBtn.bind(this))
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.addClick(this.view.realTimeRankBtn,this.onClick_realTimeRankBtn.bind(this))
}
}
protected removeEvent(){
//开始游戏
if(this.view.startBtn){
this.removeClick(this.view.startBtn)
}
//活动规则
if(this.view.ruleBtn){
this.removeClick(this.view.ruleBtn)
}
//活动奖品
if(this.view.optionBtn){
this.removeClick(this.view.optionBtn)
}
//兑换记录
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.removeClick(this.view.realTimeRankBtn)
}
}
protected onClick_ruleBtn(): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected onClick_optionBtn(): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected onClick_startBtn(): void {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
}
protected onClick_recordBtn(): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_realTimeRankBtn(): void {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
}
protected doStart_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
const module = YtModuleManager.ins.getModule(SlModuleName.GAME_GUIDE_GUI);
if(GCache.readCache('guide') || !module) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
YtModuleManager.ins.openModule(SlModuleName.GAME_GUIDE_GUI);
}
}
protected realtimerank_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_REAL_TIME_RANK_PANEL);
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible=true;
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.updateCountTxt();
this.updateStartBtnStatus();
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {YtModuleManager} from "yt";
import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'tc';
export class SlGameStartModule extends YtModule {
/**
* 数据
*/
protected model: GameStartModel;
protected initModel(): void {
this.model = new GameStartModel();
}
//游戏场景对象
protected gameSceneObject:any;
constructor(){
super()
}
public init():void{
YtDisplayPool.ins.displayPool[SlModuleName.GAME_START_GUI]=this;
}
/**
* 更新开始按钮状态
*/
protected updateStartBtnStatus(): void {
if (this.view.startBtn) {
const enable: boolean = this.model.startBtnEnable;
// this.view.startBtn.mouseEnable = enable;
this.enableMouseEvtView(this.view.startBtn,enable)
/* if (enable) {
this.view.startBtn.gotoAndStop(1);
} else {
this.view.startBtn.gotoAndStop(3);
} */
}
}
/**
* 更新次数文案
*/
protected updateCountTxt(): void {
if (this.view.countTxt) {
this.view.countTxt.text = ""+this.model.countTxt;
}
}
/**
* 添加事件
* */
protected addEvent(): void{
//开始游戏
if(this.view.startBtn){
this.addClick(this.view.startBtn,this.onClick_startBtn.bind(this))
}
//活动规则
if(this.view.ruleBtn){
this.addClick(this.view.ruleBtn,this.onClick_ruleBtn.bind(this))
}
//活动奖品
if(this.view.optionBtn){
this.addClick(this.view.optionBtn,this.onClick_optionBtn.bind(this))
}
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn,this.onClick_recordBtn.bind(this))
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.addClick(this.view.realTimeRankBtn,this.onClick_realTimeRankBtn.bind(this))
}
}
protected removeEvent(){
//开始游戏
if(this.view.startBtn){
this.removeClick(this.view.startBtn)
}
//活动规则
if(this.view.ruleBtn){
this.removeClick(this.view.ruleBtn)
}
//活动奖品
if(this.view.optionBtn){
this.removeClick(this.view.optionBtn)
}
//兑换记录
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.removeClick(this.view.realTimeRankBtn)
}
}
protected onClick_ruleBtn(): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected onClick_optionBtn(): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected onClick_startBtn(): void {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
}
protected onClick_recordBtn(): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_realTimeRankBtn(): void {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
}
protected doStart_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
const module = YtModuleManager.ins.getModule(SlModuleName.GAME_GUIDE_GUI);
if(GCache.readCache('guide') || !module) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
YtModuleManager.ins.openModule(SlModuleName.GAME_GUIDE_GUI);
}
}
protected realtimerank_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_REAL_TIME_RANK_PANEL);
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible=true;
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.updateCountTxt();
this.updateStartBtnStatus();
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {YtModuleManager} from "duiba-yt";
import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'duiba-tc';
export class SlGameStartModule extends YtModule {
/**
* 数据
*/
protected model: GameStartModel;
protected initModel(): void {
this.model = new GameStartModel();
}
//游戏场景对象
protected gameSceneObject:any;
constructor(){
super()
}
public init():void{
YtDisplayPool.ins.displayPool[SlModuleName.GAME_START_GUI]=this;
}
/**
* 更新开始按钮状态
*/
protected updateStartBtnStatus(): void {
if (this.view.startBtn) {
const enable: boolean = this.model.startBtnEnable;
// this.view.startBtn.mouseEnable = enable;
this.enableMouseEvtView(this.view.startBtn,enable)
/* if (enable) {
this.view.startBtn.gotoAndStop(1);
} else {
this.view.startBtn.gotoAndStop(3);
} */
}
}
/**
* 更新次数文案
*/
protected updateCountTxt(): void {
if (this.view.countTxt) {
this.view.countTxt.text = ""+this.model.countTxt;
}
}
/**
* 添加事件
* */
protected addEvent(): void{
//开始游戏
if(this.view.startBtn){
this.addClick(this.view.startBtn,this.onClick_startBtn.bind(this))
}
//活动规则
if(this.view.ruleBtn){
this.addClick(this.view.ruleBtn,this.onClick_ruleBtn.bind(this))
}
//活动奖品
if(this.view.optionBtn){
this.addClick(this.view.optionBtn,this.onClick_optionBtn.bind(this))
}
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn,this.onClick_recordBtn.bind(this))
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.addClick(this.view.realTimeRankBtn,this.onClick_realTimeRankBtn.bind(this))
}
}
protected removeEvent(){
//开始游戏
if(this.view.startBtn){
this.removeClick(this.view.startBtn)
}
//活动规则
if(this.view.ruleBtn){
this.removeClick(this.view.ruleBtn)
}
//活动奖品
if(this.view.optionBtn){
this.removeClick(this.view.optionBtn)
}
//兑换记录
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.removeClick(this.view.realTimeRankBtn)
}
}
protected onClick_ruleBtn(): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected onClick_optionBtn(): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected onClick_startBtn(): void {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
}
protected onClick_recordBtn(): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_realTimeRankBtn(): void {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
}
protected doStart_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
const module = YtModuleManager.ins.getModule(SlModuleName.GAME_GUIDE_GUI);
if(GCache.readCache('guide') || !module) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
YtModuleManager.ins.openModule(SlModuleName.GAME_GUIDE_GUI);
}
}
protected realtimerank_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_REAL_TIME_RANK_PANEL);
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible=true;
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.updateCountTxt();
this.updateStartBtnStatus();
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {YtModuleManager} from "duiba-yt";
import { GameStartModel, TwFun } from "duiba-tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'duiba-tc';
export class SlGameStartModule extends YtModule {
/**
* 数据
*/
protected model: GameStartModel;
protected initModel(): void {
this.model = new GameStartModel();
}
//游戏场景对象
protected gameSceneObject:any;
constructor(){
super()
}
public init():void{
YtDisplayPool.ins.displayPool[SlModuleName.GAME_START_GUI]=this;
}
/**
* 更新开始按钮状态
*/
protected updateStartBtnStatus(): void {
if (this.view.startBtn) {
const enable: boolean = this.model.startBtnEnable;
// this.view.startBtn.mouseEnable = enable;
this.enableMouseEvtView(this.view.startBtn,enable)
/* if (enable) {
this.view.startBtn.gotoAndStop(1);
} else {
this.view.startBtn.gotoAndStop(3);
} */
}
}
/**
* 更新次数文案
*/
protected updateCountTxt(): void {
if (this.view.countTxt) {
this.view.countTxt.text = ""+this.model.countTxt;
}
}
/**
* 添加事件
* */
protected addEvent(): void{
//开始游戏
if(this.view.startBtn){
this.addClick(this.view.startBtn,this.onClick_startBtn.bind(this))
}
//活动规则
if(this.view.ruleBtn){
this.addClick(this.view.ruleBtn,this.onClick_ruleBtn.bind(this))
}
//活动奖品
if(this.view.optionBtn){
this.addClick(this.view.optionBtn,this.onClick_optionBtn.bind(this))
}
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn,this.onClick_recordBtn.bind(this))
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.addClick(this.view.realTimeRankBtn,this.onClick_realTimeRankBtn.bind(this))
}
}
protected removeEvent(){
//开始游戏
if(this.view.startBtn){
this.removeClick(this.view.startBtn)
}
//活动规则
if(this.view.ruleBtn){
this.removeClick(this.view.ruleBtn)
}
//活动奖品
if(this.view.optionBtn){
this.removeClick(this.view.optionBtn)
}
//兑换记录
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.removeClick(this.view.realTimeRankBtn)
}
}
protected onClick_ruleBtn(): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected onClick_optionBtn(): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected onClick_startBtn(): void {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
}
protected onClick_recordBtn(): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_realTimeRankBtn(): void {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
}
protected doStart_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
const module = YtModuleManager.ins.getModule(SlModuleName.GAME_GUIDE_GUI);
if(GCache.readCache('guide') || !module) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
YtModuleManager.ins.openModule(SlModuleName.GAME_GUIDE_GUI);
}
}
protected realtimerank_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_REAL_TIME_RANK_PANEL);
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible=true;
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.updateCountTxt();
this.updateStartBtnStatus();
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {YtModuleManager} from "yt";
import {SlModuleName} from "../../enum/ModuleName";
import { GameWinModel } from 'tw';
export class SlGameWinModule extends YtPanelModule {
//分数
protected score;
constructor(){
super()
}
/**
* 数据
*/
protected model: GameWinModel;
protected initModel(): void {
this.model = new GameWinModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
}
/**
* 更新奖品名字文案
*/
protected updateOptionNameTxt(): void {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
}
/**
* 更新图片
*/
protected updateOptionImg(): void {
if(this.view.optionImg){
this.view.optionImg.source=this.model.optionImg;
}
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WIN_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
if(this.view.useBtn){
this.addClick(this.view.useBtn,this.onClick_useBtn.bind(this))
}
if(this.view.optionImg){
this.addClick(this.view.optionImg,this.onClick_useBtn.bind(this))
}
if(this.view.againBtn){
this.addClick(this.view.againBtn,this.onClick_againBtn.bind(this))
}
}
/**
* 移除事件
* */
protected removeEvent(){
if(this.view.closeBtn){
this.removeClick(this.view.closeBtn)
}
if(this.view.useBtn){
this.removeClick(this.view.useBtn)
}
if(this.view.optionImg){
this.removeClick(this.view.optionImg)
}
if(this.view.againBtn){
this.removeClick(this.view.againBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
this.updateOptionNameTxt();
this.updateOptionImg();
}
protected onClick_useBtn(e): void {
this.enableMouseEvt(false)
this.model.onUse();
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
}
protected getInfo_result(): void {
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
}
private onClick_againBtn(e): void {
this.enableMouseEvt(false)
this.model.doStart(this.doStart_result.bind(this));
}
protected doStart_result(e): void {
this.onClosed()
this.hide();
setTimeout(()=>{
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_GUI);
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
},500)
this.enableMouseEvt(true);
}
}
\ No newline at end of file
import {YtPanelModule} from "yt";
import {YtDisplayPool} from "yt";
import {YtModuleManager} from "yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameWinModel } from 'tw';
export class SlGameWinModule extends YtPanelModule {
//分数
protected score;
constructor(){
super()
}
/**
* 数据
*/
protected model: GameWinModel;
protected initModel(): void {
this.model = new GameWinModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
}
/**
* 更新奖品名字文案
*/
protected updateOptionNameTxt(): void {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
}
/**
* 更新图片
*/
protected updateOptionImg(): void {
if(this.view.optionImg){
this.view.optionImg.source=this.model.optionImg;
}
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WIN_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
if(this.view.useBtn){
this.addClick(this.view.useBtn,this.onClick_useBtn.bind(this))
}
if(this.view.optionImg){
this.addClick(this.view.optionImg,this.onClick_useBtn.bind(this))
}
if(this.view.againBtn){
this.addClick(this.view.againBtn,this.onClick_againBtn.bind(this))
}
}
/**
* 移除事件
* */
protected removeEvent(){
if(this.view.closeBtn){
this.removeClick(this.view.closeBtn)
}
if(this.view.useBtn){
this.removeClick(this.view.useBtn)
}
if(this.view.optionImg){
this.removeClick(this.view.optionImg)
}
if(this.view.againBtn){
this.removeClick(this.view.againBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
this.updateOptionNameTxt();
this.updateOptionImg();
}
protected onClick_useBtn(e): void {
this.enableMouseEvt(false)
this.model.onUse();
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
}
protected getInfo_result(): void {
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
}
private onClick_againBtn(e): void {
this.enableMouseEvt(false)
this.model.doStart(this.doStart_result.bind(this));
}
protected doStart_result(e): void {
this.onClosed()
this.hide();
setTimeout(()=>{
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_GUI);
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
},500)
this.enableMouseEvt(true);
}
}
\ No newline at end of file
import {YtPanelModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {YtModuleManager} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameWinModel } from 'duiba-tw';
export class SlGameWinModule extends YtPanelModule {
//分数
protected score;
constructor(){
super()
}
/**
* 数据
*/
protected model: GameWinModel;
protected initModel(): void {
this.model = new GameWinModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
}
/**
* 更新奖品名字文案
*/
protected updateOptionNameTxt(): void {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
}
/**
* 更新图片
*/
protected updateOptionImg(): void {
if(this.view.optionImg){
this.view.optionImg.source=this.model.optionImg;
}
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WIN_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
if(this.view.useBtn){
this.addClick(this.view.useBtn,this.onClick_useBtn.bind(this))
}
if(this.view.optionImg){
this.addClick(this.view.optionImg,this.onClick_useBtn.bind(this))
}
if(this.view.againBtn){
this.addClick(this.view.againBtn,this.onClick_againBtn.bind(this))
}
}
/**
* 移除事件
* */
protected removeEvent(){
if(this.view.closeBtn){
this.removeClick(this.view.closeBtn)
}
if(this.view.useBtn){
this.removeClick(this.view.useBtn)
}
if(this.view.optionImg){
this.removeClick(this.view.optionImg)
}
if(this.view.againBtn){
this.removeClick(this.view.againBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
this.updateOptionNameTxt();
this.updateOptionImg();
}
protected onClick_useBtn(e): void {
this.enableMouseEvt(false)
this.model.onUse();
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
}
protected getInfo_result(): void {
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
}
private onClick_againBtn(e): void {
this.enableMouseEvt(false)
this.model.doStart(this.doStart_result.bind(this));
}
protected doStart_result(e): void {
this.onClosed()
this.hide();
setTimeout(()=>{
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_GUI);
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
},500)
this.enableMouseEvt(true);
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { GameWinnerModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/ModuleName";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameWinnerModule extends YtModule {
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WINNER_GUI]=this;
}
/**
* 数据
*/
protected model: GameWinnerModel;
protected initModel(): void {
this.model = new GameWinnerModel();
}
public updateData(...args): void {
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
}
/**
* 更新排行榜文案
*/
protected updateRankTxt(): void {
if(this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新奖品文案
*/
protected updateOptionTxt(): void {
if(this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
}
/**
* 更新用户ID文案
*/
protected updateCidTxt(): void {
if(this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//排行榜
if (this.view.rankBtn) {
this.addClick(this.view.rankBtn, this.onClick_rankBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected onClick_rankBtn(e): void {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
YtModuleManager.ins.openModule(SlModuleName.GAME_END_RANK_PANEL, this.model.rankList);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
if (this.view.rankBtn) {
this.removeClick(this.view.rankBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "yt";
import {YtDisplayPool} from "yt";
import { GameWinnerModel, TwFun } from "tw";
import { SlModuleName } from "../../enum/SlModuleName";
import {YtModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameWinnerModule extends YtModule {
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WINNER_GUI]=this;
}
/**
* 数据
*/
protected model: GameWinnerModel;
protected initModel(): void {
this.model = new GameWinnerModel();
}
public updateData(...args): void {
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
}
/**
* 更新排行榜文案
*/
protected updateRankTxt(): void {
if(this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新奖品文案
*/
protected updateOptionTxt(): void {
if(this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
}
/**
* 更新用户ID文案
*/
protected updateCidTxt(): void {
if(this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//排行榜
if (this.view.rankBtn) {
this.addClick(this.view.rankBtn, this.onClick_rankBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected onClick_rankBtn(e): void {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
YtModuleManager.ins.openModule(SlModuleName.GAME_END_RANK_PANEL, this.model.rankList);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
if (this.view.rankBtn) {
this.removeClick(this.view.rankBtn);
}
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import { GameWinnerModel, TwFun } from "duiba-tw";
import { SlModuleName } from "../../enum/SlModuleName";
import {YtModuleManager} from "duiba-yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameWinnerModule extends YtModule {
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WINNER_GUI]=this;
}
/**
* 数据
*/
protected model: GameWinnerModel;
protected initModel(): void {
this.model = new GameWinnerModel();
}
public updateData(...args): void {
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
}
/**
* 更新排行榜文案
*/
protected updateRankTxt(): void {
if(this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新奖品文案
*/
protected updateOptionTxt(): void {
if(this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
}
/**
* 更新用户ID文案
*/
protected updateCidTxt(): void {
if(this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//排行榜
if (this.view.rankBtn) {
this.addClick(this.view.rankBtn, this.onClick_rankBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected onClick_rankBtn(e): void {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
YtModuleManager.ins.openModule(SlModuleName.GAME_END_RANK_PANEL, this.model.rankList);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
if (this.view.rankBtn) {
this.removeClick(this.view.rankBtn);
}
}
}
\ No newline at end of file
export class SlSysLang {
public static lang_001 = 'container 不存在';
public static lang_002 = 'child 不存在';
public static lang_003 = '显示对象不存在';
public static lang_004 = 'parent不存在';
public static lang_005 = '对象创建失败,className不存在';
public static lang_006 = '此接口已请求过,请勿连续请求';
public static lang_007 = '已经有一个正在打开的模块';
public static lang_008 = '加载中';
public static lang_009 = '模块{0}未注册,无法访问方法:{1}';
public static lang_012 = 'webview不支持{0}';
public static lang_014 = '当前游戏需要消耗{0}才能开始哦~';
public static lang_015 = '微软雅黑';
public static lang_016 = '系统正在处理中奖名单';
public static lang_017 = '最佳成绩:{0}';
public static lang_018 = '累计总成绩:{0}';
public static lang_019 = '您成功击败了{0}的玩家';
public static lang_020 = '本次成绩:{0}';
public static lang_021 = '最佳成绩:{0}';
public static lang_022 = '累计总成绩:{0}';
public static lang_023 = '确定';
public static lang_024 = '阳光普照';
public static lang_025 = '系统正在处理中奖名单';
public static lang_026 = '游戏结束时间为:{0}';
public static lang_027 = '游戏结束一天内开奖';
public static lang_028 = '第{0}名';
public static lang_029 = '您的排名第{0}';
public static lang_030 = '恭喜您获得了:{0}';
public static lang_031 = '很遗憾,没有中奖哦!';
public static lang_032 = '您的用户ID是:{0}';
public static lang_033 = '您未参与游戏';
public static lang_034 = "对不起,你还未有通关成绩";
public static lang_035 = "你的最佳成绩为{0}s,排名第{1}名";
public static lang_036 = "优先资源加载完成";
public static lang_037 = "常规资源加载完成";
public static lang_038 = "延时资源加载完成";
public static lang_039 = "上一个切换场景未执行完毕";
public static lang_040 = "请您换个姿势再来一次!";
public static lang_041 = "可操作时间:{0}s";
public static lang_042 = "请勿重复对同一对象添加点击事件";
}
\ No newline at end of file
export class SlLang {
// public static lang_001 = '确定';
// public static lang_002 = '取消';
public static lang_003 = '微软雅黑';
public static lang_004 = '系统正在处理中奖名单';
public static lang_005 = '阳光普照';
public static lang_006 = '第{0}名';
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
*Created by cuiliqiang on 2018/3/13
*/
var SlModuleName;
(function (SlModuleName) {
//游戏规则面板
SlModuleName["RULE_PANEL"] = "RulePanel";
//分享面板
SlModuleName["SHARE_PANEL"] = "SharePanel";
//未中奖面板
SlModuleName["LOSE_PANEL"] = "LosePanel";
//开始场景
SlModuleName["GAME_START_GUI"] = "GameStartScene";
//游戏玩法场景
SlModuleName["GAME_PLAY_SCENE"] = "GamePlayScene";
//游戏玩法场景GUI
SlModuleName["GAME_PLAY_GUI"] = "GamePlayGui";
//活动结束场景
SlModuleName["GAME_END_GUI"] = "GameEndScene";
//中奖信息场景
SlModuleName["GAME_WINNER_GUI"] = "GameWinnerScene";
//活动奖品面板
SlModuleName["GAME_OPTION_PANEL"] = "GameOptionPanel";
//游戏未中奖
SlModuleName["GAME_LOSE_PANEL"] = "GameLosePanel";
//游戏中奖面板
SlModuleName["GAME_WIN_PANEL"] = "GameWinPanel";
//排行榜面板
SlModuleName["GAME_END_RANK_PANEL"] = "GameEndRankPanel";
//实时排行榜面板
SlModuleName["GAME_REAL_TIME_RANK_PANEL"] = "GameRealTimeRankPanel";
//引导场景
SlModuleName["GAME_GUIDE_GUI"] = "GameGuideScene";
//自定义活动工具玩法场景
SlModuleName["CUSTOM_PLAY_GUI"] = "CustomPlayScene";
//自定义活动工具中奖面板
SlModuleName["CUSTOM_WIN_PANEL"] = "CustomWinPanel";
//自定义活动工具奖品详情面板
SlModuleName["CUSTOM_OPTION_INFO_PANEL"] = "CustomOptionInfoPanel";
//插件抽奖面板
SlModuleName["PLUG_PANEL"] = "PlugPanel";
//插件中奖面板
SlModuleName["PLUG_WIN_PANEL"] = "PlugWinPanel";
})(SlModuleName = exports.SlModuleName || (exports.SlModuleName = {}));
//# sourceMappingURL=SlModuleName.js.map
\ No newline at end of file
{"version":3,"file":"SlModuleName.js","sourceRoot":"","sources":["../../src/enum/SlModuleName.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,IAAY,YAwCX;AAxCD,WAAY,YAAY;IACpB,QAAQ;IACR,wCAAwB,CAAA;IACxB,MAAM;IACN,0CAA0B,CAAA;IAC1B,OAAO;IACP,wCAAwB,CAAA;IACxB,MAAM;IACN,iDAAiC,CAAA;IACjC,QAAQ;IACR,iDAAiC,CAAA;IACjC,WAAW;IACX,6CAA6B,CAAA;IAC7B,QAAQ;IACR,6CAA6B,CAAA;IAC7B,QAAQ;IACR,mDAAmC,CAAA;IACnC,QAAQ;IACR,qDAAqC,CAAA;IACrC,OAAO;IACP,iDAAiC,CAAA;IACjC,QAAQ;IACR,+CAA+B,CAAA;IAC/B,OAAO;IACP,wDAAwC,CAAA;IACxC,SAAS;IACT,mEAAmD,CAAA;IACnD,MAAM;IACN,iDAAiC,CAAA;IACjC,aAAa;IACb,mDAAmC,CAAA;IACnC,aAAa;IACb,mDAAmC,CAAA;IACnC,eAAe;IACf,kEAAkD,CAAA;IAClD,QAAQ;IACR,wCAAwB,CAAA;IACxB,QAAQ;IACR,+CAA+B,CAAA;AAEnC,CAAC,EAxCW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAwCvB"}
\ No newline at end of file
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var ModuleName_1 = require("./enum/ModuleName"); var SlModuleName_1 = require("./enum/SlModuleName");
exports.ModuleName = ModuleName_1.ModuleName; exports.SlModuleName = SlModuleName_1.SlModuleName;
var SysLang_1 = require("./util/SysLang"); var SlSysLang_1 = require("./util/SlSysLang");
exports.SysLang = SysLang_1.SysLang; exports.SlSysLang = SlSysLang_1.SlSysLang;
var WxLang_1 = require("./util/WxLang"); var SlLang_1 = require("./util/SlLang");
exports.WxLang = WxLang_1.WxLang; exports.SlLang = SlLang_1.SlLang;
var GameOptionModule_1 = require("./module/game/GameOptionModule"); var SlGameOptionModule_1 = require("./module/game/SlGameOptionModule");
exports.GameOptionModule = GameOptionModule_1.GameOptionModule; exports.SlGameOptionModule = SlGameOptionModule_1.SlGameOptionModule;
var RuleModule_1 = require("./module/common/RuleModule"); var SlRuleModule_1 = require("./module/common/SlRuleModule");
exports.RuleModule = RuleModule_1.RuleModule; exports.SlRuleModule = SlRuleModule_1.SlRuleModule;
var GameWinModule_1 = require("./module/game/GameWinModule"); var SlGameWinModule_1 = require("./module/game/SlGameWinModule");
exports.GameWinModule = GameWinModule_1.GameWinModule; exports.SlGameWinModule = SlGameWinModule_1.SlGameWinModule;
var GameLoseModule_1 = require("./module/game/GameLoseModule"); var SlGameLoseModule_1 = require("./module/game/SlGameLoseModule");
exports.GameLoseModule = GameLoseModule_1.GameLoseModule; exports.SlGameLoseModule = SlGameLoseModule_1.SlGameLoseModule;
var GameStartModule_1 = require("./module/game/GameStartModule"); var SlGameStartModule_1 = require("./module/game/SlGameStartModule");
exports.GameStartModule = GameStartModule_1.GameStartModule; exports.SlGameStartModule = SlGameStartModule_1.SlGameStartModule;
var GameGuiModule_1 = require("./module/game/GameGuiModule"); var SlGameGuiModule_1 = require("./module/game/SlGameGuiModule");
exports.GameGuiModule = GameGuiModule_1.GameGuiModule; exports.SlGameGuiModule = SlGameGuiModule_1.SlGameGuiModule;
var GameRealTimeRankModule_1 = require("./module/game/GameRealTimeRankModule"); var SlGameRealTimeRankModule_1 = require("./module/game/SlGameRealTimeRankModule");
exports.GameRealTimeRankModule = GameRealTimeRankModule_1.GameRealTimeRankModule; exports.SlGameRealTimeRankModule = SlGameRealTimeRankModule_1.SlGameRealTimeRankModule;
var GameEndModule_1 = require("./module/game/GameEndModule"); var SlGameEndModule_1 = require("./module/game/SlGameEndModule");
exports.GameEndModule = GameEndModule_1.GameEndModule; exports.SlGameEndModule = SlGameEndModule_1.SlGameEndModule;
var GameWinnerModule_1 = require("./module/game/GameWinnerModule"); var SlGameWinnerModule_1 = require("./module/game/SlGameWinnerModule");
exports.GameWinnerModule = GameWinnerModule_1.GameWinnerModule; exports.SlGameWinnerModule = SlGameWinnerModule_1.SlGameWinnerModule;
var GameEndRankModule_1 = require("./module/game/GameEndRankModule"); var SlGameEndRankModule_1 = require("./module/game/SlGameEndRankModule");
exports.GameEndRankModule = GameEndRankModule_1.GameEndRankModule; exports.SlGameEndRankModule = SlGameEndRankModule_1.SlGameEndRankModule;
var GameGuideModule_1 = require("./module/game/GameGuideModule"); var SlGameGuideModule_1 = require("./module/game/SlGameGuideModule");
exports.GameGuideModule = GameGuideModule_1.GameGuideModule; exports.SlGameGuideModule = SlGameGuideModule_1.SlGameGuideModule;
var GameSceneModule_1 = require("./module/game/GameSceneModule"); var SlGameSceneModule_1 = require("./module/game/SlGameSceneModule");
exports.GameSceneModule = GameSceneModule_1.GameSceneModule; exports.SlGameSceneModule = SlGameSceneModule_1.SlGameSceneModule;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA,gDAA6C;AAwBzC,qBAxBI,uBAAU,CAwBJ;AAvBd,0CAAuC;AAyB3B,kBAzBJ,iBAAO,CAyBI;AAxBnB,wCAAqC;AAwBjC,iBAxBI,eAAM,CAwBJ;AAvBV,mEAA+D;AAgB3D,2BAhBI,mCAAgB,CAgBJ;AAfpB,yDAAsD;AAejC,qBAfb,uBAAU,CAea;AAd/B,6DAA0D;AAc1B,wBAdxB,6BAAa,CAcwB;AAb7C,+DAA4D;AAad,yBAbtC,+BAAc,CAasC;AAZ5D,iEAA8D;AAa1D,0BAbI,iCAAe,CAaJ;AAZnB,6DAA0D;AAYtC,wBAZZ,6BAAa,CAYY;AAXjC,+EAA4E;AAW1C,iCAX1B,+CAAsB,CAW0B;AAVxD,6DAA0D;AAWtD,wBAXI,6BAAa,CAWJ;AAVjB,mEAAgE;AAU9C,2BAVV,mCAAgB,CAUU;AATlC,qEAAkE;AAS/B,4BAT3B,qCAAiB,CAS2B;AARpD,iEAA8D;AAQT,0BAR7C,iCAAe,CAQ6C;AAPpE,iEAA8D;AAI1D,0BAJI,iCAAe,CAIJ"} {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA,oDAAiD;AAwB7C,uBAxBI,2BAAY,CAwBJ;AAvBhB,8CAA2C;AAyB/B,oBAzBJ,qBAAS,CAyBI;AAxBrB,wCAAqC;AAwBjC,iBAxBI,eAAM,CAwBJ;AAvBV,uEAAmE;AAgB/D,6BAhBI,uCAAkB,CAgBJ;AAftB,6DAA0D;AAenC,uBAff,2BAAY,CAee;AAdnC,iEAA8D;AAc1B,0BAd5B,iCAAe,CAc4B;AAbnD,mEAAgE;AAaZ,2BAb5C,mCAAgB,CAa4C;AAZpE,qEAAkE;AAa9D,4BAbI,qCAAiB,CAaJ;AAZrB,iEAA8D;AAYxC,0BAZd,iCAAe,CAYc;AAXrC,mFAAgF;AAW1C,mCAX9B,mDAAwB,CAW8B;AAV9D,iEAA8D;AAW1D,0BAXI,iCAAe,CAWJ;AAVnB,uEAAoE;AAUhD,6BAVZ,uCAAkB,CAUY;AATtC,yEAAsE;AAS/B,8BAT/B,yCAAmB,CAS+B;AAR1D,qEAAkE;AAQP,4BARnD,qCAAiB,CAQmD;AAP5E,qEAAkE;AAI9D,4BAJI,qCAAiB,CAIJ"}
\ No newline at end of file \ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var SlModuleName_1 = require("../../enum/SlModuleName");
var SlSyslang_1 = require("../../util/SlSyslang");
var duiba_tw_1 = require("duiba-tw");
var duiba_yt_3 = require("duiba-yt");
var SlRuleModule = /** @class */ (function (_super) {
__extends(SlRuleModule, _super);
function SlRuleModule() {
var _this = _super.call(this) || this;
_this.config = {
x: 16,
y: 47,
width: 68,
height: 60,
lineHeight: 7,
fontSize: 3,
color: "#000000"
};
return _this;
}
SlRuleModule.prototype.initModel = function () {
this.model = new duiba_tw_1.RuleModel();
};
SlRuleModule.prototype.initHtml = function (x, y, width, height, lineHeight, fontSize, color, val) {
this.section = document.createElement('div');
this.section.id = "section";
this.section.innerHTML = "\n <div>\n <style>\n #section{position: fixed;overflow-x: hidden;overflow-y: auto;top: " + y + "vw; left: " + x + "vw;width: " + width + "vw;height: " + height + "vw;line-height: " + lineHeight + "vw;font-family: " + SlSyslang_1.SlSysLang.lang_015 + ";font-size: " + fontSize + "vw;color: " + color + ";}\n </style>\n <div>" + val + "</div>\n </div>";
duiba_yt_3.YtGuiCreate.ins.preventDefault(this.section);
};
SlRuleModule.prototype.appendHtml = function () {
document.body.appendChild(this.section);
};
SlRuleModule.prototype.init = function () {
duiba_yt_2.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.RULE_PANEL] = this;
};
/**
* 添加事件
* */
SlRuleModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
SlRuleModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
this.hide();
};
SlRuleModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.enableMouseEvt(true);
this.removeClick(this.view.closeBtn);
}
};
/**
* 更新页面
* @param args
*/
SlRuleModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible = true;
};
SlRuleModule.prototype.onOpened = function () {
this.initHtml(this.config.x, this.config.y, this.config.width, this.config.height, this.config.lineHeight, this.config.fontSize, this.config.color, this.model.ruleTxt);
this.appendHtml();
};
/**
* 关闭前
* */
SlRuleModule.prototype.onClose = function () {
this.removeHtml();
};
SlRuleModule.prototype.removeHtml = function () {
if (this.section) {
document.body.removeChild(this.section);
}
};
return SlRuleModule;
}(duiba_yt_1.YtPanelModule));
exports.SlRuleModule = SlRuleModule;
//# sourceMappingURL=SlRuleModule.js.map
\ No newline at end of file
{"version":3,"file":"SlRuleModule.js","sourceRoot":"","sources":["../../../src/module/common/SlRuleModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qCAAuC;AACvC,qCAAuC;AACvC,wDAAqD;AACrD,kDAA+C;AAC/C,qCAA4C;AAC5C,qCAAqC;AAErC;IAAkC,gCAAa;IAY3C;QAAA,YACI,iBAAO,SACV;QAES,YAAM,GAAC;YACb,CAAC,EAAC,EAAE;YACJ,CAAC,EAAC,EAAE;YACJ,KAAK,EAAC,EAAE;YACR,MAAM,EAAC,EAAE;YACT,UAAU,EAAC,CAAC;YACZ,QAAQ,EAAC,CAAC;YACV,KAAK,EAAC,SAAS;SAClB,CAAA;;IAVD,CAAC;IAPS,gCAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,oBAAS,EAAE,CAAC;IACjC,CAAC;IAkBS,+BAAQ,GAAlB,UAAmB,CAAC,EAAC,CAAC,EAAC,KAAK,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,KAAK,EAAC,GAAG;QAC7D,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,EAAE,GAAC,SAAS,CAAA;QACzB,IAAI,CAAC,OAAO,CAAC,SAAS,GAAC,6HAGiD,CAAC,kBAAa,CAAC,kBAAa,KAAK,mBAAc,MAAM,wBAAmB,UAAU,wBAAmB,qBAAS,CAAC,QAAQ,oBAAe,QAAQ,kBAAa,KAAK,qDAE3N,GAAG,+BACL,CAAC;QAEZ,sBAAW,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;IAES,iCAAU,GAApB;QACI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAGM,2BAAI,GAAX;QACI,wBAAa,CAAC,GAAG,CAAC,WAAW,CAAC,2BAAY,CAAC,UAAU,CAAC,GAAC,IAAI,CAAC;IAChE,CAAC;IAGF;;UAEM;IACK,+BAAQ,GAAlB;QACI,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;SACrE;IACL,CAAC;IAGS,uCAAgB,GAA1B,UAA2B,CAAC;QACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAGS,kCAAW,GAArB;QACI,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YAClB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;YACzB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SACvC;IACL,CAAC;IAGD;;;OAGG;IACI,iCAAU,GAAjB;QAAkB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;SACtB;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAC,IAAI,CAAC;IAC7C,CAAC;IAES,+BAAQ,GAAlB;QACI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAChK,IAAI,CAAC,UAAU,EAAE,CAAA;IACrB,CAAC;IAED;;SAEK;IACK,8BAAO,GAAjB;QACI,IAAI,CAAC,UAAU,EAAE,CAAA;IACrB,CAAC;IAES,iCAAU,GAApB;QACI,IAAG,IAAI,CAAC,OAAO,EAAC;YACZ,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC3C;IACL,CAAC;IACL,mBAAC;AAAD,CAAC,AAxGD,CAAkC,wBAAa,GAwG9C;AAxGY,oCAAY"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var duiba_yt_3 = require("duiba-yt");
var duiba_yt_4 = require("duiba-yt");
var duiba_yt_5 = require("duiba-yt");
var duiba_tw_1 = require("duiba-tw");
var SlModuleName_1 = require("../../enum/SlModuleName");
var SlLang_1 = require("../../util/SlLang");
var duiba_yt_6 = require("duiba-yt");
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
var SlGameEndModule = /** @class */ (function (_super) {
__extends(SlGameEndModule, _super);
function SlGameEndModule() {
var _this = _super !== null && _super.apply(this, arguments) || this;
//面板隐藏显示实例
_this.panelsAn = new duiba_yt_2.YtAnimationGui(duiba_yt_3.YtSceneManager.ins.scene, duiba_yt_4.YtGuiManager.ins.fullscreenUI);
return _this;
}
SlGameEndModule.prototype.init = function () {
duiba_yt_5.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.GAME_END_GUI] = this;
};
SlGameEndModule.prototype.initModel = function () {
this.model = new duiba_tw_1.GameEndModel();
};
SlGameEndModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.updateStatusTxt();
this.updateScoreTxt();
};
/**
* 更新活动状态文案
* @param str
*/
SlGameEndModule.prototype.updateStatusTxt = function (str) {
if (str === void 0) { str = SlLang_1.SlLang.lang_004; }
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
};
/**
* 更新积分文案
*/
SlGameEndModule.prototype.updateScoreTxt = function () {
if (this.view.scoreTxt) {
this.view.scoreTxt.text = this.model.getScoreTxt();
}
};
SlGameEndModule.prototype.addEvent = function () {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
};
SlGameEndModule.prototype.onClick_recordBtn = function (e) {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = duiba_tw_1.TwFun.getRecordUrl('00');
};
SlGameEndModule.prototype.onClick_ruleBtn = function (e) {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
};
SlGameEndModule.prototype.getRule_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
duiba_yt_6.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.RULE_PANEL);
};
SlGameEndModule.prototype.onClick_optionBtn = function (e) {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
};
SlGameEndModule.prototype.getOptions_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
duiba_yt_6.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_OPTION_PANEL);
};
SlGameEndModule.prototype.removeEvent = function () {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn);
}
};
return SlGameEndModule;
}(duiba_yt_1.YtModule));
exports.SlGameEndModule = SlGameEndModule;
//# sourceMappingURL=SlGameEndModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameEndModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameEndModule.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var SlModuleName_1 = require("../../enum/SlModuleName");
var duiba_tw_1 = require("duiba-tw");
var SlGameEndRankModule = /** @class */ (function (_super) {
__extends(SlGameEndRankModule, _super);
function SlGameEndRankModule() {
var _this = _super.call(this) || this;
//UI配置
_this.uiConfig = {
bodyWidth: "440px",
bodyHeight: "680px",
bodyTop: "260px",
bodyLeft: "260px",
isVertical: true,
};
//事件
_this.doEvents = [];
_this.initUI();
return _this;
}
SlGameEndRankModule.prototype.initModel = function () {
this.model = new duiba_tw_1.GameEndRankModel();
};
/**
* 打开后
* */
SlGameEndRankModule.prototype.onOpened = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.htmlView = this.htmlCreate(this.uiConfig, this.model.rankList);
};
SlGameEndRankModule.prototype.init = function () {
duiba_yt_2.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.GAME_END_RANK_PANEL] = this;
};
/**
* 添加事件
* */
SlGameEndRankModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
SlGameEndRankModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
this.hide();
};
SlGameEndRankModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.enableMouseEvt(true);
this.removeClick(this.view.closeBtn);
}
};
/**
* 更新页面
* @param args
*/
SlGameEndRankModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
// this.viewHtml=this.listTemplateHtml(this.model.rankList,this.uiConfig)
this.view.closeBtn.isHitTestVisible = true;
};
/**
* 关闭前
* */
SlGameEndRankModule.prototype.onClose = function () {
if (document.getElementById("viewNode")) {
try {
document.body.removeChild(this.viewNode);
}
catch (e) {
console.log(e);
}
}
};
return SlGameEndRankModule;
}(duiba_yt_1.YtPanelModule));
exports.SlGameEndRankModule = SlGameEndRankModule;
//# sourceMappingURL=SlGameEndRankModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameEndRankModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameEndRankModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,qCAAuC;AAGvC,qCAAuC;AACvC,wDAAqD;AACrD,qCAAmD;AAEnD;IAAyC,uCAAa;IA4BlD;QAAA,YACI,iBAAO,SAEV;QAjBD,MAAM;QAEI,cAAQ,GAAC;YACf,SAAS,EAAC,OAAO;YACjB,UAAU,EAAC,OAAO;YAClB,OAAO,EAAC,OAAO;YACf,QAAQ,EAAC,OAAO;YAChB,UAAU,EAAC,IAAI;SAClB,CAAA;QAED,IAAI;QACM,cAAQ,GAAC,EAAE,CAAC;QAKlB,KAAI,CAAC,MAAM,EAAE,CAAC;;IAClB,CAAC;IArBS,uCAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,2BAAgB,EAAE,CAAC;IACxC,CAAC;IAqBD;;SAEK;IACK,sCAAQ,GAAlB;QAAmB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACtB,IAAI,CAAC,QAAQ,GAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IACpE,CAAC;IAEM,kCAAI,GAAX;QACI,wBAAa,CAAC,GAAG,CAAC,WAAW,CAAC,2BAAY,CAAC,mBAAmB,CAAC,GAAC,IAAI,CAAC;IACzE,CAAC;IAEF;;UAEM;IACK,sCAAQ,GAAlB;QACI,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;SACrE;IACL,CAAC;IAGS,8CAAgB,GAA1B,UAA2B,CAAC;QACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAGS,yCAAW,GAArB;QACI,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YAClB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;YACzB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SACvC;IACL,CAAC;IAGD;;;OAGG;IACI,wCAAU,GAAjB;QAAkB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;SACtB;QACF,yEAAyE;QACxE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAC,IAAI,CAAC;IAC7C,CAAC;IAED;;SAEK;IACK,qCAAO,GAAjB;QACI,IAAG,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,EAAC;YACnC,IAAI;gBACA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aAC3C;YAAA,OAAO,CAAC,EAAE;gBACP,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;aACjB;SACJ;IACL,CAAC;IACL,0BAAC;AAAD,CAAC,AA7FD,CAAyC,wBAAa,GA6FrD;AA7FY,kDAAmB"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var SlModuleName_1 = require("../../enum/SlModuleName");
var duiba_yt_2 = require("duiba-yt");
var SlGameGuiModule = /** @class */ (function (_super) {
__extends(SlGameGuiModule, _super);
function SlGameGuiModule() {
return _super.call(this) || this;
}
SlGameGuiModule.prototype.init = function () {
duiba_yt_2.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.GAME_PLAY_GUI] = this;
};
/**
* 添加事件
* */
SlGameGuiModule.prototype.addEvent = function () {
};
SlGameGuiModule.prototype.removeEvent = function () {
};
/**
* 更新页面
* @param args
*/
SlGameGuiModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.removeEvent();
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
};
return SlGameGuiModule;
}(duiba_yt_1.YtModule));
exports.SlGameGuiModule = SlGameGuiModule;
//# sourceMappingURL=SlGameGuiModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameGuiModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameGuiModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkC;AAClC,wDAAqD;AACrD,qCAAuC;AAGvC;IAAqC,mCAAQ;IACzC;eACI,iBAAO;IACX,CAAC;IACM,8BAAI,GAAX;QACI,wBAAa,CAAC,GAAG,CAAC,WAAW,CAAC,2BAAY,CAAC,aAAa,CAAC,GAAC,IAAI,CAAC;IACnE,CAAC;IACD;;SAEK;IACK,kCAAQ,GAAlB;IAEA,CAAC;IAGS,qCAAW,GAArB;IAEA,CAAC;IACD;;;OAGG;IACI,oCAAU,GAAjB;QAAkB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACrB,IAAI,CAAC,WAAW,EAAE,CAAA;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;SACtB;IACL,CAAC;IACL,sBAAC;AAAD,CAAC,AA7BD,CAAqC,mBAAQ,GA6B5C;AA7BY,0CAAe"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var SlModuleName_1 = require("../../enum/SlModuleName");
var duiba_yt_3 = require("duiba-yt");
var duiba_tc_1 = require("duiba-tc");
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
var SlGameGuideModule = /** @class */ (function (_super) {
__extends(SlGameGuideModule, _super);
function SlGameGuideModule() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.totalFrames = 1;
return _this;
}
SlGameGuideModule.prototype.init = function () {
duiba_yt_2.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.GAME_GUIDE_GUI] = this;
};
SlGameGuideModule.prototype.updateData = function () {
_super.prototype.updateData.call(this);
this.maxStep = this.totalFrames;
this.currStep = 1;
};
/**
* 引导是否完成
*/
SlGameGuideModule.prototype.isComplete = function () {
if (this.currStep >= this.maxStep) {
duiba_tc_1.GCache.writeCache('guide', 'true');
return true;
}
return false;
};
SlGameGuideModule.prototype.addEvent = function () {
_super.prototype.addEvent.call(this);
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
};
SlGameGuideModule.prototype.onClick_sureBtn = function () {
this.currStep++;
if (this.isComplete()) {
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_PLAY_SCENE);
}
else {
// this.view.gotoAndStop(this.currStep);
}
};
SlGameGuideModule.prototype.removeEvent = function () {
_super.prototype.removeEvent.call(this);
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
};
return SlGameGuideModule;
}(duiba_yt_1.YtModule));
exports.SlGameGuideModule = SlGameGuideModule;
//# sourceMappingURL=SlGameGuideModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameGuideModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameGuideModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkC;AAClC,qCAAuC;AACvC,wDAAuD;AACvD,qCAAyC;AACzC,qCAAkC;AAElC;;;GAGG;AACH;IAAuC,qCAAQ;IAA/C;QAAA,qEA4DC;QA3Da,iBAAW,GAAC,CAAC,CAAC;;IA2D5B,CAAC;IAzDU,gCAAI,GAAX;QACI,wBAAa,CAAC,GAAG,CAAC,WAAW,CAAC,2BAAY,CAAC,cAAc,CAAC,GAAC,IAAI,CAAC;IACpE,CAAC;IAYM,sCAAU,GAAjB;QACI,iBAAM,UAAU,WAAE,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACtB,CAAC;IAGA;;MAEE;IACI,sCAAU,GAAjB;QACI,IAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;YAC9B,iBAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAIS,oCAAQ,GAAlB;QACI,iBAAM,QAAQ,WAAE,CAAC;QACjB,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;SACrE;IACL,CAAC;IAES,2CAAe,GAAzB;QACI,IAAI,CAAC,QAAQ,EAAG,CAAC;QACjB,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE;YACnB,0BAAe,CAAC,GAAG,CAAC,UAAU,CAAC,2BAAY,CAAC,eAAe,CAAC,CAAC;SAChE;aAAM;YACJ,wCAAwC;SAC1C;IACL,CAAC;IAGS,uCAAW,GAArB;QACI,iBAAM,WAAW,WAAE,CAAC;QACpB,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACnB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACvC;IACL,CAAC;IACL,wBAAC;AAAD,CAAC,AA5DD,CAAuC,mBAAQ,GA4D9C;AA5DY,8CAAiB"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var SlModuleName_1 = require("../../enum/SlModuleName");
var duiba_yt_3 = require("duiba-yt");
var duiba_tw_1 = require("duiba-tw");
var SlGameLoseModule = /** @class */ (function (_super) {
__extends(SlGameLoseModule, _super);
function SlGameLoseModule() {
return _super.call(this) || this;
}
SlGameLoseModule.prototype.initModel = function () {
this.model = new duiba_tw_1.GameLoseModel();
};
/**
* 更新剩余次数文案
*/
SlGameLoseModule.prototype.updateCountTxt = function () {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
};
/**
* 更新排行文案
*/
SlGameLoseModule.prototype.updateRankTxt = function () {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
};
/**
* 更新当前积分文案
*/
SlGameLoseModule.prototype.updateCurrScoreTxt = function () {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
};
/**
* 更新最高积分文案
*/
SlGameLoseModule.prototype.updateMaxScoreTxt = function () {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
};
/**
* 隐藏
*/
SlGameLoseModule.prototype.hide = function () {
var _this = this;
this.removeEvent();
this.panelsAn.hide(this.view.view, function () {
_this.onClose();
}, function () {
_this.onClosed();
});
};
SlGameLoseModule.prototype.init = function () {
duiba_yt_2.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.GAME_LOSE_PANEL] = this;
};
/**
* 添加事件
* */
SlGameLoseModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
SlGameLoseModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
this.hide();
};
SlGameLoseModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.enableMouseEvt(true);
this.removeClick(this.view.closeBtn);
}
};
/**
* 更新页面
* @param args
*/
SlGameLoseModule.prototype.updateData = function () {
_super.prototype.updateData.call(this);
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
};
/**
* 关闭后
* */
SlGameLoseModule.prototype.onClosed = function () {
_super.prototype.onClosed.call(this);
this.enableMouseEvt(true);
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_START_GUI);
};
return SlGameLoseModule;
}(duiba_yt_1.YtPanelModule));
exports.SlGameLoseModule = SlGameLoseModule;
//# sourceMappingURL=SlGameLoseModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameLoseModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameLoseModule.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var SlModuleName_1 = require("../../enum/SlModuleName");
var duiba_tw_1 = require("duiba-tw");
var SlGameOptionModule = /** @class */ (function (_super) {
__extends(SlGameOptionModule, _super);
function SlGameOptionModule() {
var _this = _super !== null && _super.apply(this, arguments) || this;
//UI配置
_this.uiConfig = {
bodyWidth: "440px",
bodyHeight: "680px",
bodyTop: "260px",
bodyLeft: "260px",
isVertical: true,
};
return _this;
}
SlGameOptionModule.prototype.initModel = function () {
this.model = new duiba_tw_1.GameOptionModel();
};
/**
* 打开后
* */
SlGameOptionModule.prototype.onOpened = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.htmlView = this.htmlCreate(this.uiConfig, this.model.optionList);
};
SlGameOptionModule.prototype.init = function () {
duiba_yt_2.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.GAME_OPTION_PANEL] = this;
};
/**
* 添加事件
* */
SlGameOptionModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
SlGameOptionModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
this.hide();
};
SlGameOptionModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.enableMouseEvt(true);
this.removeClick(this.view.closeBtn);
}
};
/**
* 更新页面
* @param args
*/
SlGameOptionModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible = true;
};
/**
* 关闭前
* */
SlGameOptionModule.prototype.onClose = function () {
if (document.getElementById("viewNode")) {
try {
document.body.removeChild(this.viewNode);
}
catch (e) {
console.log(e);
}
}
};
return SlGameOptionModule;
}(duiba_yt_1.YtPanelModule));
exports.SlGameOptionModule = SlGameOptionModule;
//# sourceMappingURL=SlGameOptionModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameOptionModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameOptionModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,qCAAuC;AAGvC,qCAAuC;AACvC,wDAAqD;AACrD,qCAAkD;AAElD;IAAwC,sCAAa;IAArD;QAAA,qEAgFC;QArEG,MAAM;QAEI,cAAQ,GAAC;YACf,SAAS,EAAC,OAAO;YACjB,UAAU,EAAC,OAAO;YAClB,OAAO,EAAC,OAAO;YACf,QAAQ,EAAC,OAAO;YAChB,UAAU,EAAC,IAAI;SAClB,CAAA;;IA6DL,CAAC;IAzEa,sCAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,0BAAe,EAAE,CAAC;IACvC,CAAC;IAYC;;OAEG;IACK,qCAAQ,GAAlB;QAAmB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACtB,IAAI,CAAC,QAAQ,GAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IACtE,CAAC;IAEM,iCAAI,GAAX;QACI,wBAAa,CAAC,GAAG,CAAC,WAAW,CAAC,2BAAY,CAAC,iBAAiB,CAAC,GAAC,IAAI,CAAC;IACvE,CAAC;IAEF;;UAEM;IACK,qCAAQ,GAAlB;QACI,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;SACrE;IACL,CAAC;IAGS,6CAAgB,GAA1B,UAA2B,CAAC;QACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAGS,wCAAW,GAArB;QACI,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YAClB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;YACzB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SACvC;IACL,CAAC;IAGD;;;OAGG;IACI,uCAAU,GAAjB;QAAkB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;SACtB;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAC,IAAI,CAAC;IAC7C,CAAC;IAED;;SAEK;IACK,oCAAO,GAAjB;QACE,IAAG,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,EAAC;YACrC,IAAI;gBACA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aAC3C;YAAA,OAAO,CAAC,EAAE;gBACP,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;aACjB;SACA;IACL,CAAC;IACL,yBAAC;AAAD,CAAC,AAhFD,CAAwC,wBAAa,GAgFpD;AAhFY,gDAAkB"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var SlModuleName_1 = require("../../enum/SlModuleName");
var duiba_tw_1 = require("duiba-tw");
var SlGameRealTimeRankModule = /** @class */ (function (_super) {
__extends(SlGameRealTimeRankModule, _super);
function SlGameRealTimeRankModule() {
var _this = _super.call(this) || this;
//UI配置
_this.uiConfig = {
bodyWidth: "440px",
bodyHeight: "680px",
bodyTop: "260px",
bodyLeft: "260px",
isVertical: true,
};
return _this;
}
SlGameRealTimeRankModule.prototype.initModel = function () {
this.model = new duiba_tw_1.GameRealTimeRankModel();
};
/**
* 打开后
* */
SlGameRealTimeRankModule.prototype.onOpened = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.htmlView = this.htmlCreate(this.uiConfig, this.model.userList);
};
SlGameRealTimeRankModule.prototype.init = function () {
duiba_yt_2.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.GAME_REAL_TIME_RANK_PANEL] = this;
};
/**
* 添加事件
* */
SlGameRealTimeRankModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
SlGameRealTimeRankModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
this.hide();
};
SlGameRealTimeRankModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.enableMouseEvt(true);
this.removeClick(this.view.closeBtn);
}
};
/**
* 更新页面
* @param args
*/
SlGameRealTimeRankModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible = true;
};
/**
* 关闭前
* */
SlGameRealTimeRankModule.prototype.onClose = function () {
if (document.getElementById("viewNode")) {
try {
document.body.removeChild(this.viewNode);
}
catch (e) {
console.log(e);
}
}
};
return SlGameRealTimeRankModule;
}(duiba_yt_1.YtPanelModule));
exports.SlGameRealTimeRankModule = SlGameRealTimeRankModule;
//# sourceMappingURL=SlGameRealTimeRankModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameRealTimeRankModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameRealTimeRankModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qCAAuC;AAEvC,qCAAuC;AACvC,wDAAqD;AACrD,qCAAwD;AAExD;IAA8C,4CAAa;IAsBvD;QAAA,YACI,iBAAO,SACV;QAZD,MAAM;QAEI,cAAQ,GAAC;YACf,SAAS,EAAC,OAAO;YACjB,UAAU,EAAC,OAAO;YAClB,OAAO,EAAC,OAAO;YACf,QAAQ,EAAC,OAAO;YAChB,UAAU,EAAC,IAAI;SAClB,CAAA;;IAID,CAAC;IAjBS,4CAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,gCAAqB,EAAE,CAAC;IAC7C,CAAC;IAiBC;;OAEG;IACK,2CAAQ,GAAlB;QAAmB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACtB,IAAI,CAAC,QAAQ,GAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IACpE,CAAC;IAGM,uCAAI,GAAX;QACI,wBAAa,CAAC,GAAG,CAAC,WAAW,CAAC,2BAAY,CAAC,yBAAyB,CAAC,GAAC,IAAI,CAAC;IAC/E,CAAC;IAGD;;SAEK;IACK,2CAAQ,GAAlB;QACI,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;SACrE;IACL,CAAC;IAGS,mDAAgB,GAA1B,UAA2B,CAAC;QACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAGS,8CAAW,GAArB;QACI,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YAClB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;YACzB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SACvC;IACL,CAAC;IAGD;;;OAGG;IACI,6CAAU,GAAjB;QAAkB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;SACtB;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAC,IAAI,CAAC;IAC7C,CAAC;IAEC;;OAEG;IACK,0CAAO,GAAjB;QACI,IAAG,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,EAAC;YACrC,IAAI;gBACA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aAC3C;YAAA,OAAO,CAAC,EAAE;gBACP,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;aACjB;SACA;IACL,CAAC;IACP,+BAAC;AAAD,CAAC,AAvFD,CAA8C,wBAAa,GAuF1D;AAvFY,4DAAwB"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var duiba_yt_3 = require("duiba-yt");
var duiba_yt_4 = require("duiba-yt");
var duiba_yt_5 = require("duiba-yt");
var SlModuleName_1 = require("../../enum/SlModuleName");
var duiba_tw_1 = require("duiba-tw");
var SlGameSceneModule = /** @class */ (function (_super) {
__extends(SlGameSceneModule, _super);
function SlGameSceneModule() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.score = 0;
return _this;
}
SlGameSceneModule.prototype.initModel = function () {
this.model = new duiba_tw_1.GamePlayModel();
};
//销毁
SlGameSceneModule.prototype.dispose = function () {
var j;
for (j in this.display) {
console.log(this.display[j]);
if (this.display[j]) {
this.display[j].dispose();
}
}
};
SlGameSceneModule.prototype.show = function () {
this.resetGame();
duiba_yt_2.YtSceneManager.ins.change(this.display);
};
SlGameSceneModule.prototype.resetGame = function () {
this.model.update();
};
SlGameSceneModule.prototype.gameOver = function () {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
};
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
SlGameSceneModule.prototype.updateScore = function (type, score) {
if (type == 1) {
this.score += score;
}
else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
}
else {
this.score = score;
}
this.datapash();
};
/**
* 阶段性提交
*/
SlGameSceneModule.prototype.datapash = function () {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
};
SlGameSceneModule.prototype.submit_result = function () {
var moduleName;
if (this.model.gameIsWinning) {
moduleName = SlModuleName_1.SlModuleName.GAME_WIN_PANEL;
}
else {
moduleName = SlModuleName_1.SlModuleName.GAME_LOSE_PANEL;
}
duiba_yt_3.YtModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
};
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
SlGameSceneModule.prototype.ImportMeshes = function (importMeshes, onSuccess) {
duiba_yt_3.YtModuleManager.ins.openModule(duiba_yt_4.YtModuleName.WAITING_PANEL, duiba_yt_5.YtLang.lang_004);
var _length = importMeshes.length;
var _meshes = [];
var _skeletons = [];
var _loadCount = 0;
importMeshes.forEach(function (list) {
BABYLON.SceneLoader.ImportMesh("", list.rootUrl, list.sceneFilename, duiba_yt_2.YtSceneManager.ins.scene, function (_mesh, _skeleton) {
try {
_meshes.push(_mesh);
_skeletons.push(_skeleton);
_loadCount++;
if (_loadCount == _length) {
setTimeout(function () {
duiba_yt_3.YtModuleManager.ins.closeModule(duiba_yt_4.YtModuleName.WAITING_PANEL);
}, 100);
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes, _skeletons);
}
}
catch (e) {
console.error(e);
}
});
});
};
return SlGameSceneModule;
}(duiba_yt_1.YtModule));
exports.SlGameSceneModule = SlGameSceneModule;
//# sourceMappingURL=SlGameSceneModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameSceneModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameSceneModule.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var SlModuleName_1 = require("../../enum/SlModuleName");
var duiba_yt_3 = require("duiba-yt");
var duiba_tw_1 = require("duiba-tw");
var duiba_tc_1 = require("duiba-tc");
var SlGameStartModule = /** @class */ (function (_super) {
__extends(SlGameStartModule, _super);
function SlGameStartModule() {
return _super.call(this) || this;
}
SlGameStartModule.prototype.initModel = function () {
this.model = new duiba_tw_1.GameStartModel();
};
SlGameStartModule.prototype.init = function () {
duiba_yt_2.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.GAME_START_GUI] = this;
};
/**
* 更新开始按钮状态
*/
SlGameStartModule.prototype.updateStartBtnStatus = function () {
if (this.view.startBtn) {
var enable = this.model.startBtnEnable;
// this.view.startBtn.mouseEnable = enable;
this.enableMouseEvtView(this.view.startBtn, enable);
/* if (enable) {
this.view.startBtn.gotoAndStop(1);
} else {
this.view.startBtn.gotoAndStop(3);
} */
}
};
/**
* 更新次数文案
*/
SlGameStartModule.prototype.updateCountTxt = function () {
if (this.view.countTxt) {
this.view.countTxt.text = "" + this.model.countTxt;
}
};
/**
* 添加事件
* */
SlGameStartModule.prototype.addEvent = function () {
//开始游戏
if (this.view.startBtn) {
this.addClick(this.view.startBtn, this.onClick_startBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//实时排行榜
if (this.view.realTimeRankBtn) {
this.addClick(this.view.realTimeRankBtn, this.onClick_realTimeRankBtn.bind(this));
}
};
SlGameStartModule.prototype.removeEvent = function () {
//开始游戏
if (this.view.startBtn) {
this.removeClick(this.view.startBtn);
}
//活动规则
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
//活动奖品
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
//兑换记录
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
//实时排行榜
if (this.view.realTimeRankBtn) {
this.removeClick(this.view.realTimeRankBtn);
}
};
SlGameStartModule.prototype.onClick_ruleBtn = function () {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
};
SlGameStartModule.prototype.onClick_optionBtn = function () {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
};
SlGameStartModule.prototype.onClick_startBtn = function () {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
};
SlGameStartModule.prototype.onClick_recordBtn = function () {
this.enableMouseEvt(false);
window.location.href = duiba_tw_1.TwFun.getRecordUrl('00');
};
SlGameStartModule.prototype.onClick_realTimeRankBtn = function () {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
};
SlGameStartModule.prototype.doStart_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
var module = duiba_yt_3.YtModuleManager.ins.getModule(SlModuleName_1.SlModuleName.GAME_GUIDE_GUI);
if (duiba_tc_1.GCache.readCache('guide') || !module) {
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_PLAY_SCENE);
}
else {
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_GUIDE_GUI);
}
};
SlGameStartModule.prototype.realtimerank_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_REAL_TIME_RANK_PANEL);
};
SlGameStartModule.prototype.getRule_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.RULE_PANEL);
};
SlGameStartModule.prototype.getOptions_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible = true;
};
/**
* 更新页面
* @param args
*/
SlGameStartModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.updateCountTxt();
this.updateStartBtnStatus();
};
return SlGameStartModule;
}(duiba_yt_1.YtModule));
exports.SlGameStartModule = SlGameStartModule;
//# sourceMappingURL=SlGameStartModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameStartModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameStartModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkC;AAClC,qCAAuC;AACvC,wDAAqD;AACrD,qCAAyC;AACzC,qCAAiD;AACjD,qCAAkE;AAElE;IAAuC,qCAAQ;IAgB3C;eACI,iBAAO;IACX,CAAC;IAVS,qCAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,yBAAc,EAAE,CAAC;IACtC,CAAC;IAWM,gCAAI,GAAX;QACI,wBAAa,CAAC,GAAG,CAAC,WAAW,CAAC,2BAAY,CAAC,cAAc,CAAC,GAAC,IAAI,CAAC;IACpE,CAAC;IAGD;;OAEG;IACO,gDAAoB,GAA9B;QACI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACpB,IAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;YACpD,4CAA4C;YAC1C,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC,MAAM,CAAC,CAAA;YACnD;;;;iBAIK;SACP;IACL,CAAC;IAGC;;KAEC;IACO,0CAAc,GAAxB;QACI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,EAAE,GAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;SACpD;IACL,CAAC;IAGD;;SAEK;IACK,oCAAQ,GAAlB;QAEI,MAAM;QACN,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;SACrE;QAED,MAAM;QACN,IAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;SAClE;QAED,MAAM;QACN,IAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC;YACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;SACvE;QAED,MAAM;QACN,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACrB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;SACvE;QAEA,OAAO;QACP,IAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;SACnF;IAEL,CAAC;IAGS,uCAAW,GAArB;QACK,MAAM;QACN,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAC;YACnB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SACvC;QAED,MAAM;QACN,IAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAC;YACjB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;SACtC;QAED,MAAM;QACN,IAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC;YACnB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;SACxC;QAED,MAAM;QACN,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACrB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;SACxC;QAEA,OAAO;QACP,IAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YAC3B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;SAC9C;IACL,CAAC;IAGS,2CAAe,GAAzB;QACI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IAES,6CAAiB,GAA3B;QACI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,CAAC;IAES,4CAAgB,GAA1B;QACI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IAGS,6CAAiB,GAA3B;QACI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3B,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,gBAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IAGS,mDAAuB,GAAjC;QACI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC;IAES,0CAAc,GAAxB,UAAyB,OAAgB;QACrC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAG,CAAC,OAAO,EAAE;YACT,OAAO;SACV;QACD,IAAM,MAAM,GAAG,0BAAe,CAAC,GAAG,CAAC,SAAS,CAAC,2BAAY,CAAC,cAAc,CAAC,CAAC;QAC1E,IAAG,iBAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;YACrC,0BAAe,CAAC,GAAG,CAAC,UAAU,CAAC,2BAAY,CAAC,eAAe,CAAC,CAAC;SAChE;aAAM;YACH,0BAAe,CAAC,GAAG,CAAC,UAAU,CAAC,2BAAY,CAAC,cAAc,CAAC,CAAC;SAC/D;IACL,CAAC;IAES,+CAAmB,GAA7B,UAA8B,OAAgB;QAC1C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAG,CAAC,OAAO,EAAE;YACT,OAAO;SACV;QACD,0BAAe,CAAC,GAAG,CAAC,UAAU,CAAC,2BAAY,CAAC,yBAAyB,CAAC,CAAC;IAC3E,CAAC;IAES,0CAAc,GAAxB,UAAyB,OAAgB;QACrC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAG,CAAC,OAAO,EAAE;YACT,OAAO;SACV;QACD,0BAAe,CAAC,GAAG,CAAC,UAAU,CAAC,2BAAY,CAAC,UAAU,CAAC,CAAC;IAC5D,CAAC;IAES,6CAAiB,GAA3B,UAA4B,OAAgB;QACxC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAG,CAAC,OAAO,EAAE;YACT,OAAO;SACV;QACD,0BAAe,CAAC,GAAG,CAAC,UAAU,CAAC,2BAAY,CAAC,iBAAiB,CAAC,CAAC;QAC/D,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAC,IAAI,CAAC;IAC7C,CAAC;IAGD;;;OAGG;IACI,sCAAU,GAAjB;QAAkB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACrB,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IACL,wBAAC;AAAD,CAAC,AA5LD,CAAuC,mBAAQ,GA4L9C;AA5LY,8CAAiB"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var duiba_yt_3 = require("duiba-yt");
var SlModuleName_1 = require("../../enum/SlModuleName");
var duiba_tw_1 = require("duiba-tw");
var SlGameWinModule = /** @class */ (function (_super) {
__extends(SlGameWinModule, _super);
function SlGameWinModule() {
return _super.call(this) || this;
}
SlGameWinModule.prototype.initModel = function () {
this.model = new duiba_tw_1.GameWinModel();
};
/**
* 更新剩余次数文案
*/
SlGameWinModule.prototype.updateCountTxt = function () {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
};
/**
* 更新排行文案
*/
SlGameWinModule.prototype.updateRankTxt = function () {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
};
/**
* 更新当前积分文案
*/
SlGameWinModule.prototype.updateCurrScoreTxt = function () {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
};
/**
* 更新最高积分文案
*/
SlGameWinModule.prototype.updateMaxScoreTxt = function () {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
};
/**
* 更新奖品名字文案
*/
SlGameWinModule.prototype.updateOptionNameTxt = function () {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
};
/**
* 更新图片
*/
SlGameWinModule.prototype.updateOptionImg = function () {
if (this.view.optionImg) {
this.view.optionImg.source = this.model.optionImg;
}
};
SlGameWinModule.prototype.init = function () {
duiba_yt_2.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.GAME_WIN_PANEL] = this;
};
/**
* 添加事件
* */
SlGameWinModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
if (this.view.useBtn) {
this.addClick(this.view.useBtn, this.onClick_useBtn.bind(this));
}
if (this.view.optionImg) {
this.addClick(this.view.optionImg, this.onClick_useBtn.bind(this));
}
if (this.view.againBtn) {
this.addClick(this.view.againBtn, this.onClick_againBtn.bind(this));
}
};
/**
* 移除事件
* */
SlGameWinModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.removeClick(this.view.closeBtn);
}
if (this.view.useBtn) {
this.removeClick(this.view.useBtn);
}
if (this.view.optionImg) {
this.removeClick(this.view.optionImg);
}
if (this.view.againBtn) {
this.removeClick(this.view.againBtn);
}
};
/**
* 更新页面
* @param args
*/
SlGameWinModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
_super.prototype.updateData.call(this);
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
this.updateOptionNameTxt();
this.updateOptionImg();
};
SlGameWinModule.prototype.onClick_useBtn = function (e) {
this.enableMouseEvt(false);
this.model.onUse();
};
SlGameWinModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
};
SlGameWinModule.prototype.getInfo_result = function () {
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
};
SlGameWinModule.prototype.onClick_againBtn = function (e) {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
};
SlGameWinModule.prototype.doStart_result = function (e) {
this.onClosed();
this.hide();
setTimeout(function () {
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_PLAY_GUI);
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_PLAY_SCENE);
}, 500);
this.enableMouseEvt(true);
};
return SlGameWinModule;
}(duiba_yt_1.YtPanelModule));
exports.SlGameWinModule = SlGameWinModule;
//# sourceMappingURL=SlGameWinModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameWinModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameWinModule.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var duiba_yt_1 = require("duiba-yt");
var duiba_yt_2 = require("duiba-yt");
var duiba_tw_1 = require("duiba-tw");
var SlModuleName_1 = require("../../enum/SlModuleName");
var duiba_yt_3 = require("duiba-yt");
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
var SlGameWinnerModule = /** @class */ (function (_super) {
__extends(SlGameWinnerModule, _super);
function SlGameWinnerModule() {
return _super !== null && _super.apply(this, arguments) || this;
}
SlGameWinnerModule.prototype.init = function () {
duiba_yt_2.YtDisplayPool.ins.displayPool[SlModuleName_1.SlModuleName.GAME_WINNER_GUI] = this;
};
SlGameWinnerModule.prototype.initModel = function () {
this.model = new duiba_tw_1.GameWinnerModel();
};
SlGameWinnerModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
};
/**
* 更新排行榜文案
*/
SlGameWinnerModule.prototype.updateRankTxt = function () {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
};
/**
* 更新奖品文案
*/
SlGameWinnerModule.prototype.updateOptionTxt = function () {
if (this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
};
/**
* 更新用户ID文案
*/
SlGameWinnerModule.prototype.updateCidTxt = function () {
if (this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
};
SlGameWinnerModule.prototype.addEvent = function () {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//排行榜
if (this.view.rankBtn) {
this.addClick(this.view.rankBtn, this.onClick_rankBtn.bind(this));
}
};
SlGameWinnerModule.prototype.onClick_recordBtn = function (e) {
this.enableMouseEvt(false);
window.location.href = duiba_tw_1.TwFun.getRecordUrl('00');
};
SlGameWinnerModule.prototype.onClick_ruleBtn = function (e) {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
};
SlGameWinnerModule.prototype.getRule_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.RULE_PANEL);
};
SlGameWinnerModule.prototype.onClick_optionBtn = function (e) {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
};
SlGameWinnerModule.prototype.getOptions_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_OPTION_PANEL);
};
SlGameWinnerModule.prototype.onClick_rankBtn = function (e) {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
duiba_yt_3.YtModuleManager.ins.openModule(SlModuleName_1.SlModuleName.GAME_END_RANK_PANEL, this.model.rankList);
};
SlGameWinnerModule.prototype.removeEvent = function () {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
if (this.view.rankBtn) {
this.removeClick(this.view.rankBtn);
}
};
return SlGameWinnerModule;
}(duiba_yt_1.YtModule));
exports.SlGameWinnerModule = SlGameWinnerModule;
//# sourceMappingURL=SlGameWinnerModule.js.map
\ No newline at end of file
{"version":3,"file":"SlGameWinnerModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameWinnerModule.ts"],"names":[],"mappings":"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"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SlLang = /** @class */ (function () {
function SlLang() {
}
// public static lang_001 = '确定';
// public static lang_002 = '取消';
SlLang.lang_003 = '微软雅黑';
SlLang.lang_004 = '系统正在处理中奖名单';
SlLang.lang_005 = '阳光普照';
SlLang.lang_006 = '第{0}名';
return SlLang;
}());
exports.SlLang = SlLang;
//# sourceMappingURL=SlLang.js.map
\ No newline at end of file
{"version":3,"file":"SlLang.js","sourceRoot":"","sources":["../../src/util/SlLang.ts"],"names":[],"mappings":";;AAAA;IAAA;IAOA,CAAC;IANG,iCAAiC;IACjC,iCAAiC;IACnB,eAAQ,GAAG,MAAM,CAAC;IAClB,eAAQ,GAAG,YAAY,CAAC;IACxB,eAAQ,GAAG,MAAM,CAAC;IAClB,eAAQ,GAAG,OAAO,CAAC;IACrC,aAAC;CAAA,AAPD,IAOC;AAPY,wBAAM"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SlSysLang = /** @class */ (function () {
function SlSysLang() {
}
SlSysLang.lang_001 = 'container 不存在';
SlSysLang.lang_002 = 'child 不存在';
SlSysLang.lang_003 = '显示对象不存在';
SlSysLang.lang_004 = 'parent不存在';
SlSysLang.lang_005 = '对象创建失败,className不存在';
SlSysLang.lang_006 = '此接口已请求过,请勿连续请求';
SlSysLang.lang_007 = '已经有一个正在打开的模块';
SlSysLang.lang_008 = '加载中';
SlSysLang.lang_009 = '模块{0}未注册,无法访问方法:{1}';
SlSysLang.lang_012 = 'webview不支持{0}';
SlSysLang.lang_014 = '当前游戏需要消耗{0}才能开始哦~';
SlSysLang.lang_015 = '微软雅黑';
SlSysLang.lang_016 = '系统正在处理中奖名单';
SlSysLang.lang_017 = '最佳成绩:{0}';
SlSysLang.lang_018 = '累计总成绩:{0}';
SlSysLang.lang_019 = '您成功击败了{0}的玩家';
SlSysLang.lang_020 = '本次成绩:{0}';
SlSysLang.lang_021 = '最佳成绩:{0}';
SlSysLang.lang_022 = '累计总成绩:{0}';
SlSysLang.lang_023 = '确定';
SlSysLang.lang_024 = '阳光普照';
SlSysLang.lang_025 = '系统正在处理中奖名单';
SlSysLang.lang_026 = '游戏结束时间为:{0}';
SlSysLang.lang_027 = '游戏结束一天内开奖';
SlSysLang.lang_028 = '第{0}名';
SlSysLang.lang_029 = '您的排名第{0}';
SlSysLang.lang_030 = '恭喜您获得了:{0}';
SlSysLang.lang_031 = '很遗憾,没有中奖哦!';
SlSysLang.lang_032 = '您的用户ID是:{0}';
SlSysLang.lang_033 = '您未参与游戏';
SlSysLang.lang_034 = "对不起,你还未有通关成绩";
SlSysLang.lang_035 = "你的最佳成绩为{0}s,排名第{1}名";
SlSysLang.lang_036 = "优先资源加载完成";
SlSysLang.lang_037 = "常规资源加载完成";
SlSysLang.lang_038 = "延时资源加载完成";
SlSysLang.lang_039 = "上一个切换场景未执行完毕";
SlSysLang.lang_040 = "请您换个姿势再来一次!";
SlSysLang.lang_041 = "可操作时间:{0}s";
SlSysLang.lang_042 = "请勿重复对同一对象添加点击事件";
return SlSysLang;
}());
exports.SlSysLang = SlSysLang;
//# sourceMappingURL=SlSysLang.js.map
\ No newline at end of file
{"version":3,"file":"SlSysLang.js","sourceRoot":"","sources":["../../src/util/SlSysLang.ts"],"names":[],"mappings":";;AAAA;IAAA;IAwCA,CAAC;IAvCiB,kBAAQ,GAAG,eAAe,CAAC;IAC3B,kBAAQ,GAAG,WAAW,CAAC;IACvB,kBAAQ,GAAG,SAAS,CAAC;IACrB,kBAAQ,GAAG,WAAW,CAAC;IACvB,kBAAQ,GAAG,qBAAqB,CAAC;IACjC,kBAAQ,GAAG,gBAAgB,CAAC;IAC5B,kBAAQ,GAAG,cAAc,CAAC;IAC1B,kBAAQ,GAAG,KAAK,CAAC;IACjB,kBAAQ,GAAG,qBAAqB,CAAC;IACjC,kBAAQ,GAAG,eAAe,CAAC;IAC3B,kBAAQ,GAAG,mBAAmB,CAAC;IAC/B,kBAAQ,GAAG,MAAM,CAAC;IAClB,kBAAQ,GAAG,YAAY,CAAC;IACxB,kBAAQ,GAAG,UAAU,CAAC;IACtB,kBAAQ,GAAG,WAAW,CAAC;IACvB,kBAAQ,GAAG,cAAc,CAAC;IAC1B,kBAAQ,GAAG,UAAU,CAAC;IACtB,kBAAQ,GAAG,UAAU,CAAC;IACtB,kBAAQ,GAAG,WAAW,CAAC;IACvB,kBAAQ,GAAG,IAAI,CAAC;IAChB,kBAAQ,GAAG,MAAM,CAAC;IAClB,kBAAQ,GAAG,YAAY,CAAC;IACxB,kBAAQ,GAAG,aAAa,CAAC;IACzB,kBAAQ,GAAG,WAAW,CAAC;IACvB,kBAAQ,GAAG,OAAO,CAAC;IACnB,kBAAQ,GAAG,UAAU,CAAC;IACtB,kBAAQ,GAAG,YAAY,CAAC;IACxB,kBAAQ,GAAG,YAAY,CAAC;IACxB,kBAAQ,GAAG,aAAa,CAAC;IACzB,kBAAQ,GAAG,QAAQ,CAAC;IACpB,kBAAQ,GAAG,cAAc,CAAC;IAC1B,kBAAQ,GAAG,qBAAqB,CAAC;IACjC,kBAAQ,GAAG,UAAU,CAAC;IACtB,kBAAQ,GAAG,UAAU,CAAC;IACtB,kBAAQ,GAAG,UAAU,CAAC;IACtB,kBAAQ,GAAG,cAAc,CAAC;IAC1B,kBAAQ,GAAG,aAAa,CAAC;IACzB,kBAAQ,GAAG,YAAY,CAAC;IACxB,kBAAQ,GAAG,iBAAiB,CAAC;IAC/C,gBAAC;CAAA,AAxCD,IAwCC;AAxCY,8BAAS"}
\ No newline at end of file
{ {
"name": "sl", "name": "sl",
"version": "1.0.3", "version": "1.0.4",
"description": "基于babylonjs的活动组件", "description": "基于babylonjs的活动组件",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./types/index.d.ts", "types": "./types/index.d.ts",
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"yt": "git+ssh://git@gitlab2.dui88.com:renjianfeng/yt.git", "duiba-yt": "git+ssh://git@gitlab2.dui88.com:renjianfeng/yt.git",
"tw": "git+ssh://git@gitlab2.dui88.com:clq/tw.git#1.0" "duiba-tw": "git+ssh://git@gitlab2.dui88.com:clq/tw.git#1.0",
"duiba-tc": "git+ssh://git@gitlab2.dui88.com:clq/tc.git#1.0"
} }
} }
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/13
*/
export enum SlModuleName {
//游戏规则面板
RULE_PANEL = 'RulePanel',
//分享面板
SHARE_PANEL = 'SharePanel',
//未中奖面板
LOSE_PANEL = 'LosePanel',
//开始场景
GAME_START_GUI = 'GameStartScene',
//游戏玩法场景
GAME_PLAY_SCENE = 'GamePlayScene',
//游戏玩法场景GUI
GAME_PLAY_GUI = 'GamePlayGui',
//活动结束场景
GAME_END_GUI = 'GameEndScene',
//中奖信息场景
GAME_WINNER_GUI = 'GameWinnerScene',
//活动奖品面板
GAME_OPTION_PANEL = 'GameOptionPanel',
//游戏未中奖
GAME_LOSE_PANEL = 'GameLosePanel',
//游戏中奖面板
GAME_WIN_PANEL = 'GameWinPanel',
//排行榜面板
GAME_END_RANK_PANEL = 'GameEndRankPanel',
//实时排行榜面板
GAME_REAL_TIME_RANK_PANEL = 'GameRealTimeRankPanel',
//引导场景
GAME_GUIDE_GUI = 'GameGuideScene',
//自定义活动工具玩法场景
CUSTOM_PLAY_GUI = 'CustomPlayScene',
//自定义活动工具中奖面板
CUSTOM_WIN_PANEL = 'CustomWinPanel',
//自定义活动工具奖品详情面板
CUSTOM_OPTION_INFO_PANEL = 'CustomOptionInfoPanel',
//插件抽奖面板
PLUG_PANEL = 'PlugPanel',
//插件中奖面板
PLUG_WIN_PANEL = 'PlugWinPanel'
}
import {ModuleName} from "./enum/ModuleName"; import {SlModuleName} from "./enum/SlModuleName";
import {SysLang} from "./util/SysLang"; import {SlSysLang} from "./util/SlSysLang";
import {WxLang} from "./util/WxLang"; import {SlLang} from "./util/SlLang";
import {GameOptionModule} from "./module/game/GameOptionModule" import {SlGameOptionModule} from "./module/game/SlGameOptionModule"
import {RuleModule} from "./module/common/RuleModule"; import {SlRuleModule} from "./module/common/SlRuleModule";
import {GameWinModule} from "./module/game/GameWinModule"; import {SlGameWinModule} from "./module/game/SlGameWinModule";
import {GameLoseModule} from "./module/game/GameLoseModule"; import {SlGameLoseModule} from "./module/game/SlGameLoseModule";
import {GameStartModule} from "./module/game/GameStartModule"; import {SlGameStartModule} from "./module/game/SlGameStartModule";
import {GameGuiModule} from "./module/game/GameGuiModule"; import {SlGameGuiModule} from "./module/game/SlGameGuiModule";
import {GameRealTimeRankModule} from "./module/game/GameRealTimeRankModule"; import {SlGameRealTimeRankModule} from "./module/game/SlGameRealTimeRankModule";
import {GameEndModule} from "./module/game/GameEndModule"; import {SlGameEndModule} from "./module/game/SlGameEndModule";
import {GameWinnerModule} from "./module/game/GameWinnerModule"; import {SlGameWinnerModule} from "./module/game/SlGameWinnerModule";
import {GameEndRankModule} from "./module/game/GameEndRankModule"; import {SlGameEndRankModule} from "./module/game/SlGameEndRankModule";
import {GameGuideModule} from "./module/game/GameGuideModule"; import {SlGameGuideModule} from "./module/game/SlGameGuideModule";
import {GameSceneModule} from "./module/game/GameSceneModule"; import {SlGameSceneModule} from "./module/game/SlGameSceneModule";
export { export {
//UI创建和scene创建 //UI创建和scene创建
GameSceneModule, SlGameSceneModule,
GameOptionModule,RuleModule,GameWinModule,GameLoseModule, SlGameOptionModule,SlRuleModule,SlGameWinModule,SlGameLoseModule,
GameStartModule,GameGuiModule,GameRealTimeRankModule, SlGameStartModule,SlGameGuiModule,SlGameRealTimeRankModule,
GameEndModule,GameWinnerModule,GameEndRankModule,GameGuideModule, SlGameEndModule,SlGameWinnerModule,SlGameEndRankModule,SlGameGuideModule,
//枚举 //枚举
ModuleName, SlModuleName,
//工具 //工具
WxLang, SysLang, SlLang, SlSysLang,
} }
\ No newline at end of file
import {YtGuiManager} from "duiba-yt";
import {YtPanelModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {SlSysLang} from "../../util/SlSyslang";
import { RuleModel, TwFun } from "duiba-tw";
import {YtGuiCreate} from "duiba-yt";
export class SlRuleModule extends YtPanelModule {
/**
* 数据
*/
protected model: RuleModel;
protected initModel(): void {
this.model = new RuleModel();
}
constructor(){
super()
}
protected config={
x:16,
y:47,
width:68,
height:60,
lineHeight:7,
fontSize:3,
color:"#000000"
}
protected initHtml(x,y,width,height,lineHeight,fontSize,color,val){
this.section = document.createElement('div');
this.section.id="section"
this.section.innerHTML=`
<div>
<style>
#section{position: fixed;overflow-x: hidden;overflow-y: auto;top: ${y}vw; left: ${x}vw;width: ${width}vw;height: ${height}vw;line-height: ${lineHeight}vw;font-family: ${SlSysLang.lang_015};font-size: ${fontSize}vw;color: ${color};}
</style>
<div>${val}</div>
</div>`;
YtGuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.RULE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
protected onOpened(){
this.initHtml(this.config.x,this.config.y,this.config.width,this.config.height,this.config.lineHeight,this.config.fontSize,this.config.color,this.model.ruleTxt)
this.appendHtml()
}
/**
* 关闭前
* */
protected onClose(){
this.removeHtml()
}
protected removeHtml(){
if(this.section){
document.body.removeChild(this.section);
}
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtAnimationGui} from "duiba-yt";
import {YtSceneManager} from "duiba-yt";
import {YtGuiManager} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import { GameEndModel, TwFun } from "duiba-tw";
import { SlModuleName } from "../../enum/SlModuleName";
import { SlLang } from "../../util/SlLang";
import {YtModuleManager} from "duiba-yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameEndModule extends YtModule {
//面板隐藏显示实例
protected panelsAn=new YtAnimationGui(YtSceneManager.ins.scene,YtGuiManager.ins.fullscreenUI)
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_GUI]=this;
}
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void {
this.model = new GameEndModel();
}
public updateData(...args): void {
this.updateStatusTxt();
this.updateScoreTxt();
}
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str: string = SlLang.lang_004): void {
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
}
/**
* 更新积分文案
*/
protected updateScoreTxt(): void {
if (this.view.scoreTxt) {
this.view.scoreTxt.text=this.model.getScoreTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn)
}
if (this.view.prizeBtn) {
this.removeClick(this.view.prizeBtn)
}
}
}
\ No newline at end of file
import {YtSceneManager} from "duiba-yt";
import {YtGuiManager} from "duiba-yt";
import {YtPanelModule} from "duiba-yt";
import {YtAnimationGui} from "duiba-yt";
import {YtGuiCreate} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameEndRankModel, TwFun } from "duiba-tw";
export class SlGameEndRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameEndRankModel;
protected initModel(): void {
this.model = new GameEndRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
//事件
protected doEvents=[];
constructor(){
super()
this.initUI();
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.rankList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_END_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
// this.viewHtml=this.listTemplateHtml(this.model.rankList,this.uiConfig)
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {YtDisplayPool} from "duiba-yt";
export class SlGameGuiModule extends YtModule {
constructor(){
super()
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_PLAY_GUI]=this;
}
/**
* 添加事件
* */
protected addEvent(){
}
protected removeEvent(){
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.removeEvent()
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import { SlModuleName } from "../../enum/SlModuleName";
import {YtModuleManager} from "duiba-yt";
import { GCache } from 'duiba-tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameGuideModule extends YtModule {
protected totalFrames=1;
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_GUIDE_GUI]=this;
}
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
public updateData(): void {
super.updateData();
this.maxStep = this.totalFrames;
this.currStep = 1;
}
/**
* 引导是否完成
*/
public isComplete(): boolean {
if(this.currStep >= this.maxStep) {
GCache.writeCache('guide', 'true');
return true;
}
return false;
}
protected addEvent(): void {
super.addEvent();
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
}
protected onClick_sureBtn(): void {
this.currStep ++;
if (this.isComplete()) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
// this.view.gotoAndStop(this.currStep);
}
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
}
}
\ No newline at end of file
import {YtPanelModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {YtModuleManager} from "duiba-yt";
import { GameLoseModel } from 'duiba-tw';
export class SlGameLoseModule extends YtPanelModule {
constructor(){
super()
}
/**
* 数据
*/
protected model: GameLoseModel;
protected initModel(): void {
this.model = new GameLoseModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_LOSE_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
}
/**
* 关闭后
* */
protected onClosed(){
super.onClosed()
this.enableMouseEvt(true)
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {YtGuiManager} from "duiba-yt";
import {YtPanelModule} from "duiba-yt";
import {YtGuiCreate} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameOptionModel, TwFun } from "duiba-tw";
export class SlGameOptionModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.optionList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_OPTION_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtGuiManager} from "duiba-yt";
import {YtPanelModule} from "duiba-yt";
import {YtGuiCreate} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameRealTimeRankModel, TwFun } from "duiba-tw";
export class SlGameRealTimeRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameRealTimeRankModel;
protected initModel(): void {
this.model = new GameRealTimeRankModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
constructor(){
super()
}
/**
* 打开后
* */
protected onOpened(...args){
this.htmlView=this.htmlCreate(this.uiConfig,this.model.userList)
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_REAL_TIME_RANK_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
if(this.view.closeBtn){
this.enableMouseEvt(true)
this.removeClick(this.view.closeBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
this.view.closeBtn.isHitTestVisible=true;
}
/**
* 关闭前
* */
protected onClose(){
if(document.getElementById("viewNode")){
try {
document.body.removeChild(this.viewNode)
}catch (e) {
console.log(e)
}
}
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtSceneManager} from "duiba-yt";
import {YtModuleManager} from "duiba-yt";
import {YtModuleName} from "duiba-yt";
import {YtLang} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GamePlayModel } from "duiba-tw";
export class SlGameSceneModule extends YtModule{
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void {
this.model = new GamePlayModel();
}
/**
* 扩展数据
* */
protected other: any;
protected score=0;
//销毁
public dispose(){
var j;
for(j in this.display){
console.log(this.display[j])
if( this.display[j]){
this.display[j].dispose()
}
}
}
public show(){
this.resetGame()
YtSceneManager.ins.change(this.display);
}
protected resetGame(){
this.model.update();
}
protected gameOver(): void {
this.removeEvent();
//将最高纪录缓存
this.enableMouseEvt(false);
this.removeEvent();
this.model.cacheMaxScore(this.score);
this.model.submit(this.submit_result.bind(this), this.score);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void {
if (type == 1) {
this.score += score;
} else if (type == 2) {
this.score -= score;
this.score = Math.max(0, this.score);
} else {
this.score = score;
}
this.datapash();
}
/**
* 阶段性提交
*/
protected datapash(): void {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
}
protected submit_result(): void {
let moduleName: string;
if (this.model.gameIsWinning) {
moduleName = SlModuleName.GAME_WIN_PANEL;
} else {
moduleName = SlModuleName.GAME_LOSE_PANEL;
}
YtModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes,onSuccess){
YtModuleManager.ins.openModule(YtModuleName.WAITING_PANEL,YtLang.lang_004);
var _length=importMeshes.length;
var _meshes=[]
var _skeletons=[]
var _loadCount=0;
importMeshes.forEach((list)=>{
BABYLON.SceneLoader.ImportMesh(
"",
list.rootUrl,
list.sceneFilename,
YtSceneManager.ins.scene,
(_mesh,_skeleton)=> {
try {
_meshes.push(_mesh)
_skeletons.push(_skeleton)
_loadCount++
if(_loadCount==_length){
setTimeout(()=>{
YtModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
},100)
//ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import {YtModuleManager} from "duiba-yt";
import { GameStartModel, TwFun } from "duiba-tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'duiba-tc';
export class SlGameStartModule extends YtModule {
/**
* 数据
*/
protected model: GameStartModel;
protected initModel(): void {
this.model = new GameStartModel();
}
//游戏场景对象
protected gameSceneObject:any;
constructor(){
super()
}
public init():void{
YtDisplayPool.ins.displayPool[SlModuleName.GAME_START_GUI]=this;
}
/**
* 更新开始按钮状态
*/
protected updateStartBtnStatus(): void {
if (this.view.startBtn) {
const enable: boolean = this.model.startBtnEnable;
// this.view.startBtn.mouseEnable = enable;
this.enableMouseEvtView(this.view.startBtn,enable)
/* if (enable) {
this.view.startBtn.gotoAndStop(1);
} else {
this.view.startBtn.gotoAndStop(3);
} */
}
}
/**
* 更新次数文案
*/
protected updateCountTxt(): void {
if (this.view.countTxt) {
this.view.countTxt.text = ""+this.model.countTxt;
}
}
/**
* 添加事件
* */
protected addEvent(): void{
//开始游戏
if(this.view.startBtn){
this.addClick(this.view.startBtn,this.onClick_startBtn.bind(this))
}
//活动规则
if(this.view.ruleBtn){
this.addClick(this.view.ruleBtn,this.onClick_ruleBtn.bind(this))
}
//活动奖品
if(this.view.optionBtn){
this.addClick(this.view.optionBtn,this.onClick_optionBtn.bind(this))
}
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn,this.onClick_recordBtn.bind(this))
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.addClick(this.view.realTimeRankBtn,this.onClick_realTimeRankBtn.bind(this))
}
}
protected removeEvent(){
//开始游戏
if(this.view.startBtn){
this.removeClick(this.view.startBtn)
}
//活动规则
if(this.view.ruleBtn){
this.removeClick(this.view.ruleBtn)
}
//活动奖品
if(this.view.optionBtn){
this.removeClick(this.view.optionBtn)
}
//兑换记录
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn)
}
//实时排行榜
if(this.view.realTimeRankBtn) {
this.removeClick(this.view.realTimeRankBtn)
}
}
protected onClick_ruleBtn(): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected onClick_optionBtn(): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected onClick_startBtn(): void {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
}
protected onClick_recordBtn(): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_realTimeRankBtn(): void {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
}
protected doStart_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
const module = YtModuleManager.ins.getModule(SlModuleName.GAME_GUIDE_GUI);
if(GCache.readCache('guide') || !module) {
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
} else {
YtModuleManager.ins.openModule(SlModuleName.GAME_GUIDE_GUI);
}
}
protected realtimerank_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_REAL_TIME_RANK_PANEL);
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible=true;
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
this.updateCountTxt();
this.updateStartBtnStatus();
}
}
\ No newline at end of file
import {YtPanelModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import {YtModuleManager} from "duiba-yt";
import {SlModuleName} from "../../enum/SlModuleName";
import { GameWinModel } from 'duiba-tw';
export class SlGameWinModule extends YtPanelModule {
//分数
protected score;
constructor(){
super()
}
/**
* 数据
*/
protected model: GameWinModel;
protected initModel(): void {
this.model = new GameWinModel();
}
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
}
/**
* 更新排行文案
*/
protected updateRankTxt(): void {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
}
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
}
/**
* 更新奖品名字文案
*/
protected updateOptionNameTxt(): void {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
}
/**
* 更新图片
*/
protected updateOptionImg(): void {
if(this.view.optionImg){
this.view.optionImg.source=this.model.optionImg;
}
}
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WIN_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
if(this.view.useBtn){
this.addClick(this.view.useBtn,this.onClick_useBtn.bind(this))
}
if(this.view.optionImg){
this.addClick(this.view.optionImg,this.onClick_useBtn.bind(this))
}
if(this.view.againBtn){
this.addClick(this.view.againBtn,this.onClick_againBtn.bind(this))
}
}
/**
* 移除事件
* */
protected removeEvent(){
if(this.view.closeBtn){
this.removeClick(this.view.closeBtn)
}
if(this.view.useBtn){
this.removeClick(this.view.useBtn)
}
if(this.view.optionImg){
this.removeClick(this.view.optionImg)
}
if(this.view.againBtn){
this.removeClick(this.view.againBtn)
}
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
super.updateData();
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
this.updateOptionNameTxt();
this.updateOptionImg();
}
protected onClick_useBtn(e): void {
this.enableMouseEvt(false)
this.model.onUse();
}
protected onClick_closeBtn(e): void {
this.enableMouseEvt(false)
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
}
protected getInfo_result(): void {
YtModuleManager.ins.openModule(SlModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
}
private onClick_againBtn(e): void {
this.enableMouseEvt(false)
this.model.doStart(this.doStart_result.bind(this));
}
protected doStart_result(e): void {
this.onClosed()
this.hide();
setTimeout(()=>{
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_GUI);
YtModuleManager.ins.openModule(SlModuleName.GAME_PLAY_SCENE);
},500)
this.enableMouseEvt(true);
}
}
\ No newline at end of file
import {YtModule} from "duiba-yt";
import {YtDisplayPool} from "duiba-yt";
import { GameWinnerModel, TwFun } from "duiba-tw";
import { SlModuleName } from "../../enum/SlModuleName";
import {YtModuleManager} from "duiba-yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class SlGameWinnerModule extends YtModule {
public init(){
YtDisplayPool.ins.displayPool[SlModuleName.GAME_WINNER_GUI]=this;
}
/**
* 数据
*/
protected model: GameWinnerModel;
protected initModel(): void {
this.model = new GameWinnerModel();
}
public updateData(...args): void {
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
}
/**
* 更新排行榜文案
*/
protected updateRankTxt(): void {
if(this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
}
/**
* 更新奖品文案
*/
protected updateOptionTxt(): void {
if(this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
}
/**
* 更新用户ID文案
*/
protected updateCidTxt(): void {
if(this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
}
protected addEvent(): void {
//兑换记录
if (this.view.recordBtn) {
this.addClick(this.view.recordBtn, this.onClick_recordBtn.bind(this));
}
//活动规则
if (this.view.ruleBtn) {
this.addClick(this.view.ruleBtn, this.onClick_ruleBtn.bind(this));
}
//活动奖品
if (this.view.optionBtn) {
this.addClick(this.view.optionBtn, this.onClick_optionBtn.bind(this));
}
//排行榜
if (this.view.rankBtn) {
this.addClick(this.view.rankBtn, this.onClick_rankBtn.bind(this));
}
}
protected onClick_recordBtn(e): void {
this.enableMouseEvt(false);
window.location.href = TwFun.getRecordUrl('00');
}
protected onClick_ruleBtn(e): void {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
}
protected getRule_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.RULE_PANEL);
}
protected onClick_optionBtn(e): void {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
}
protected getOptions_result(success: boolean): void {
this.enableMouseEvt(true);
if(!success) {
return;
}
YtModuleManager.ins.openModule(SlModuleName.GAME_OPTION_PANEL);
}
protected onClick_rankBtn(e): void {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
YtModuleManager.ins.openModule(SlModuleName.GAME_END_RANK_PANEL, this.model.rankList);
}
protected removeEvent(): void {
if (this.view.recordBtn) {
this.removeClick(this.view.recordBtn);
}
if (this.view.ruleBtn) {
this.removeClick(this.view.ruleBtn);
}
if (this.view.optionBtn) {
this.removeClick(this.view.optionBtn);
}
if (this.view.rankBtn) {
this.removeClick(this.view.rankBtn);
}
}
}
\ No newline at end of file
export class SlLang {
// public static lang_001 = '确定';
// public static lang_002 = '取消';
public static lang_003 = '微软雅黑';
public static lang_004 = '系统正在处理中奖名单';
public static lang_005 = '阳光普照';
public static lang_006 = '第{0}名';
}
\ No newline at end of file
export class SlSysLang {
public static lang_001 = 'container 不存在';
public static lang_002 = 'child 不存在';
public static lang_003 = '显示对象不存在';
public static lang_004 = 'parent不存在';
public static lang_005 = '对象创建失败,className不存在';
public static lang_006 = '此接口已请求过,请勿连续请求';
public static lang_007 = '已经有一个正在打开的模块';
public static lang_008 = '加载中';
public static lang_009 = '模块{0}未注册,无法访问方法:{1}';
public static lang_012 = 'webview不支持{0}';
public static lang_014 = '当前游戏需要消耗{0}才能开始哦~';
public static lang_015 = '微软雅黑';
public static lang_016 = '系统正在处理中奖名单';
public static lang_017 = '最佳成绩:{0}';
public static lang_018 = '累计总成绩:{0}';
public static lang_019 = '您成功击败了{0}的玩家';
public static lang_020 = '本次成绩:{0}';
public static lang_021 = '最佳成绩:{0}';
public static lang_022 = '累计总成绩:{0}';
public static lang_023 = '确定';
public static lang_024 = '阳光普照';
public static lang_025 = '系统正在处理中奖名单';
public static lang_026 = '游戏结束时间为:{0}';
public static lang_027 = '游戏结束一天内开奖';
public static lang_028 = '第{0}名';
public static lang_029 = '您的排名第{0}';
public static lang_030 = '恭喜您获得了:{0}';
public static lang_031 = '很遗憾,没有中奖哦!';
public static lang_032 = '您的用户ID是:{0}';
public static lang_033 = '您未参与游戏';
public static lang_034 = "对不起,你还未有通关成绩";
public static lang_035 = "你的最佳成绩为{0}s,排名第{1}名";
public static lang_036 = "优先资源加载完成";
public static lang_037 = "常规资源加载完成";
public static lang_038 = "延时资源加载完成";
public static lang_039 = "上一个切换场景未执行完毕";
public static lang_040 = "请您换个姿势再来一次!";
public static lang_041 = "可操作时间:{0}s";
public static lang_042 = "请勿重复对同一对象添加点击事件";
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/13
*/
export declare enum SlModuleName {
RULE_PANEL = "RulePanel",
SHARE_PANEL = "SharePanel",
LOSE_PANEL = "LosePanel",
GAME_START_GUI = "GameStartScene",
GAME_PLAY_SCENE = "GamePlayScene",
GAME_PLAY_GUI = "GamePlayGui",
GAME_END_GUI = "GameEndScene",
GAME_WINNER_GUI = "GameWinnerScene",
GAME_OPTION_PANEL = "GameOptionPanel",
GAME_LOSE_PANEL = "GameLosePanel",
GAME_WIN_PANEL = "GameWinPanel",
GAME_END_RANK_PANEL = "GameEndRankPanel",
GAME_REAL_TIME_RANK_PANEL = "GameRealTimeRankPanel",
GAME_GUIDE_GUI = "GameGuideScene",
CUSTOM_PLAY_GUI = "CustomPlayScene",
CUSTOM_WIN_PANEL = "CustomWinPanel",
CUSTOM_OPTION_INFO_PANEL = "CustomOptionInfoPanel",
PLUG_PANEL = "PlugPanel",
PLUG_WIN_PANEL = "PlugWinPanel",
}
import { ModuleName } from "./enum/ModuleName"; import { SlModuleName } from "./enum/SlModuleName";
import { SysLang } from "./util/SysLang"; import { SlSysLang } from "./util/SlSysLang";
import { WxLang } from "./util/WxLang"; import { SlLang } from "./util/SlLang";
import { GameOptionModule } from "./module/game/GameOptionModule"; import { SlGameOptionModule } from "./module/game/SlGameOptionModule";
import { RuleModule } from "./module/common/RuleModule"; import { SlRuleModule } from "./module/common/SlRuleModule";
import { GameWinModule } from "./module/game/GameWinModule"; import { SlGameWinModule } from "./module/game/SlGameWinModule";
import { GameLoseModule } from "./module/game/GameLoseModule"; import { SlGameLoseModule } from "./module/game/SlGameLoseModule";
import { GameStartModule } from "./module/game/GameStartModule"; import { SlGameStartModule } from "./module/game/SlGameStartModule";
import { GameGuiModule } from "./module/game/GameGuiModule"; import { SlGameGuiModule } from "./module/game/SlGameGuiModule";
import { GameRealTimeRankModule } from "./module/game/GameRealTimeRankModule"; import { SlGameRealTimeRankModule } from "./module/game/SlGameRealTimeRankModule";
import { GameEndModule } from "./module/game/GameEndModule"; import { SlGameEndModule } from "./module/game/SlGameEndModule";
import { GameWinnerModule } from "./module/game/GameWinnerModule"; import { SlGameWinnerModule } from "./module/game/SlGameWinnerModule";
import { GameEndRankModule } from "./module/game/GameEndRankModule"; import { SlGameEndRankModule } from "./module/game/SlGameEndRankModule";
import { GameGuideModule } from "./module/game/GameGuideModule"; import { SlGameGuideModule } from "./module/game/SlGameGuideModule";
import { GameSceneModule } from "./module/game/GameSceneModule"; import { SlGameSceneModule } from "./module/game/SlGameSceneModule";
export { GameSceneModule, GameOptionModule, RuleModule, GameWinModule, GameLoseModule, GameStartModule, GameGuiModule, GameRealTimeRankModule, GameEndModule, GameWinnerModule, GameEndRankModule, GameGuideModule, ModuleName, WxLang, SysLang }; export { SlGameSceneModule, SlGameOptionModule, SlRuleModule, SlGameWinModule, SlGameLoseModule, SlGameStartModule, SlGameGuiModule, SlGameRealTimeRankModule, SlGameEndModule, SlGameWinnerModule, SlGameEndRankModule, SlGameGuideModule, SlModuleName, SlLang, SlSysLang };
import { YtPanelModule } from "duiba-yt";
import { RuleModel } from "duiba-tw";
export declare class SlRuleModule extends YtPanelModule {
/**
* 数据
*/
protected model: RuleModel;
protected initModel(): void;
constructor();
protected config: {
x: number;
y: number;
width: number;
height: number;
lineHeight: number;
fontSize: number;
color: string;
};
protected initHtml(x: any, y: any, width: any, height: any, lineHeight: any, fontSize: any, color: any, val: any): void;
protected appendHtml(): void;
init(): void;
/**
* 添加事件
* */
protected addEvent(): void;
protected onClick_closeBtn(e: any): void;
protected removeEvent(): void;
/**
* 更新页面
* @param args
*/
updateData(...args: any[]): void;
protected onOpened(): void;
/**
* 关闭前
* */
protected onClose(): void;
protected removeHtml(): void;
}
import { YtModule } from "duiba-yt";
import { YtAnimationGui } from "duiba-yt";
import { GameEndModel } from "duiba-tw";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export declare class SlGameEndModule extends YtModule {
protected panelsAn: YtAnimationGui;
init(): void;
/**
* 数据
*/
protected model: GameEndModel;
protected initModel(): void;
updateData(...args: any[]): void;
/**
* 更新活动状态文案
* @param str
*/
protected updateStatusTxt(str?: string): void;
/**
* 更新积分文案
*/
protected updateScoreTxt(): void;
protected addEvent(): void;
protected onClick_recordBtn(e: any): void;
protected onClick_ruleBtn(e: any): void;
protected getRule_result(success: boolean): void;
protected onClick_optionBtn(e: any): void;
protected getOptions_result(success: boolean): void;
protected removeEvent(): void;
}
import { YtPanelModule } from "duiba-yt";
import { GameEndRankModel } from "duiba-tw";
export declare class SlGameEndRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameEndRankModel;
protected initModel(): void;
protected uiConfig: {
bodyWidth: string;
bodyHeight: string;
bodyTop: string;
bodyLeft: string;
isVertical: boolean;
};
protected doEvents: any[];
constructor();
/**
* 打开后
* */
protected onOpened(...args: any[]): void;
init(): void;
/**
* 添加事件
* */
protected addEvent(): void;
protected onClick_closeBtn(e: any): void;
protected removeEvent(): void;
/**
* 更新页面
* @param args
*/
updateData(...args: any[]): void;
/**
* 关闭前
* */
protected onClose(): void;
}
import { YtModule } from "duiba-yt";
export declare class SlGameGuiModule extends YtModule {
constructor();
init(): void;
/**
* 添加事件
* */
protected addEvent(): void;
protected removeEvent(): void;
/**
* 更新页面
* @param args
*/
updateData(...args: any[]): void;
}
import { YtModule } from "duiba-yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export declare class SlGameGuideModule extends YtModule {
protected totalFrames: number;
init(): void;
/**
* 当前步骤
*/
protected currStep: number;
/**
* 最大步骤
*/
protected maxStep: number;
updateData(): void;
/**
* 引导是否完成
*/
isComplete(): boolean;
protected addEvent(): void;
protected onClick_sureBtn(): void;
protected removeEvent(): void;
}
import { YtPanelModule } from "duiba-yt";
import { GameLoseModel } from 'duiba-tw';
export declare class SlGameLoseModule extends YtPanelModule {
constructor();
/**
* 数据
*/
protected model: GameLoseModel;
protected initModel(): void;
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void;
/**
* 更新排行文案
*/
protected updateRankTxt(): void;
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void;
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void;
/**
* 隐藏
*/
protected hide(): void;
init(): void;
/**
* 添加事件
* */
protected addEvent(): void;
protected onClick_closeBtn(e: any): void;
protected removeEvent(): void;
/**
* 更新页面
* @param args
*/
updateData(): void;
/**
* 关闭后
* */
protected onClosed(): void;
}
import { YtPanelModule } from "duiba-yt";
import { GameOptionModel } from "duiba-tw";
export declare class SlGameOptionModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void;
protected uiConfig: {
bodyWidth: string;
bodyHeight: string;
bodyTop: string;
bodyLeft: string;
isVertical: boolean;
};
/**
* 打开后
* */
protected onOpened(...args: any[]): void;
init(): void;
/**
* 添加事件
* */
protected addEvent(): void;
protected onClick_closeBtn(e: any): void;
protected removeEvent(): void;
/**
* 更新页面
* @param args
*/
updateData(...args: any[]): void;
/**
* 关闭前
* */
protected onClose(): void;
}
import { YtPanelModule } from "duiba-yt";
import { GameRealTimeRankModel } from "duiba-tw";
export declare class SlGameRealTimeRankModule extends YtPanelModule {
/**
* 数据
*/
protected model: GameRealTimeRankModel;
protected initModel(): void;
protected uiConfig: {
bodyWidth: string;
bodyHeight: string;
bodyTop: string;
bodyLeft: string;
isVertical: boolean;
};
constructor();
/**
* 打开后
* */
protected onOpened(...args: any[]): void;
init(): void;
/**
* 添加事件
* */
protected addEvent(): void;
protected onClick_closeBtn(e: any): void;
protected removeEvent(): void;
/**
* 更新页面
* @param args
*/
updateData(...args: any[]): void;
/**
* 关闭前
* */
protected onClose(): void;
}
import { YtModule } from "duiba-yt";
import { GamePlayModel } from "duiba-tw";
export declare class SlGameSceneModule extends YtModule {
/**
* 是否校验积分
*/
protected checkScore: boolean;
/**
* 数据
*/
protected model: GamePlayModel;
protected initModel(): void;
/**
* 扩展数据
* */
protected other: any;
protected score: number;
dispose(): void;
show(): void;
protected resetGame(): void;
protected gameOver(): void;
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected updateScore(type: number, score: number): void;
/**
* 阶段性提交
*/
protected datapash(): void;
protected submit_result(): void;
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected ImportMeshes(importMeshes: any, onSuccess: any): void;
}
import { YtModule } from "duiba-yt";
import { GameStartModel } from "duiba-tw";
export declare class SlGameStartModule extends YtModule {
/**
* 数据
*/
protected model: GameStartModel;
protected initModel(): void;
protected gameSceneObject: any;
constructor();
init(): void;
/**
* 更新开始按钮状态
*/
protected updateStartBtnStatus(): void;
/**
* 更新次数文案
*/
protected updateCountTxt(): void;
/**
* 添加事件
* */
protected addEvent(): void;
protected removeEvent(): void;
protected onClick_ruleBtn(): void;
protected onClick_optionBtn(): void;
protected onClick_startBtn(): void;
protected onClick_recordBtn(): void;
protected onClick_realTimeRankBtn(): void;
protected doStart_result(success: boolean): void;
protected realtimerank_result(success: boolean): void;
protected getRule_result(success: boolean): void;
protected getOptions_result(success: boolean): void;
/**
* 更新页面
* @param args
*/
updateData(...args: any[]): void;
}
import { YtPanelModule } from "duiba-yt";
import { GameWinModel } from 'duiba-tw';
export declare class SlGameWinModule extends YtPanelModule {
protected score: any;
constructor();
/**
* 数据
*/
protected model: GameWinModel;
protected initModel(): void;
/**
* 更新剩余次数文案
*/
protected updateCountTxt(): void;
/**
* 更新排行文案
*/
protected updateRankTxt(): void;
/**
* 更新当前积分文案
*/
protected updateCurrScoreTxt(): void;
/**
* 更新最高积分文案
*/
protected updateMaxScoreTxt(): void;
/**
* 更新奖品名字文案
*/
protected updateOptionNameTxt(): void;
/**
* 更新图片
*/
protected updateOptionImg(): void;
init(): void;
/**
* 添加事件
* */
protected addEvent(): void;
/**
* 移除事件
* */
protected removeEvent(): void;
/**
* 更新页面
* @param args
*/
updateData(...args: any[]): void;
protected onClick_useBtn(e: any): void;
protected onClick_closeBtn(e: any): void;
protected getInfo_result(): void;
private onClick_againBtn(e);
protected doStart_result(e: any): void;
}
import { YtModule } from "duiba-yt";
import { GameWinnerModel } from "duiba-tw";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export declare class SlGameWinnerModule extends YtModule {
init(): void;
/**
* 数据
*/
protected model: GameWinnerModel;
protected initModel(): void;
updateData(...args: any[]): void;
/**
* 更新排行榜文案
*/
protected updateRankTxt(): void;
/**
* 更新奖品文案
*/
protected updateOptionTxt(): void;
/**
* 更新用户ID文案
*/
protected updateCidTxt(): void;
protected addEvent(): void;
protected onClick_recordBtn(e: any): void;
protected onClick_ruleBtn(e: any): void;
protected getRule_result(success: boolean): void;
protected onClick_optionBtn(e: any): void;
protected getOptions_result(success: boolean): void;
protected onClick_rankBtn(e: any): void;
protected removeEvent(): void;
}
export declare class SlLang {
static lang_003: string;
static lang_004: string;
static lang_005: string;
static lang_006: string;
}
export declare class SlSysLang {
static lang_001: string;
static lang_002: string;
static lang_003: string;
static lang_004: string;
static lang_005: string;
static lang_006: string;
static lang_007: string;
static lang_008: string;
static lang_009: string;
static lang_012: string;
static lang_014: string;
static lang_015: string;
static lang_016: string;
static lang_017: string;
static lang_018: string;
static lang_019: string;
static lang_020: string;
static lang_021: string;
static lang_022: string;
static lang_023: string;
static lang_024: string;
static lang_025: string;
static lang_026: string;
static lang_027: string;
static lang_028: string;
static lang_029: string;
static lang_030: string;
static lang_031: string;
static lang_032: string;
static lang_033: string;
static lang_034: string;
static lang_035: string;
static lang_036: string;
static lang_037: string;
static lang_038: string;
static lang_039: string;
static lang_040: string;
static lang_041: string;
static lang_042: string;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment