Commit 4ba6c3be authored by 任建锋's avatar 任建锋

the first commit

parents
# 所有空行或者以注释符号 # 开头的行都会被 Git 忽略。
# 可以使用标准的 glob 模式匹配。
# 匹配模式最后跟反斜杠(/)说明要忽略的是目录。
# 要忽略指定模式以外的文件或目录,可以在模式前加上惊叹号(! )取反。
# 所谓的 glob 模式是指 shell 所使用的简化了的正则表达式。星号(*)匹配零个或多个任
# 意字符; [abc] 匹配任何一个列在方括号中的字符(这个例子要么匹配一个 a,要么匹配一
# 个 b,要么匹配一个 c);问号(?)只匹配一个任意字符;如果在方括号中使用短划线分
# 隔两个字符,表示所有在这两个字符范围内的都可以匹配(比如 [0-9] 表示匹配所有 0 到
# 9 的数字)。
# 书上的一个例子
# #此为注释 – 将被 Git 忽略
# *.a
# 忽略所有 .a 结尾的文件
# !lib.a
# 但 lib.a 除外
# /TODO
# 仅仅忽略项目根目录下的 TODO 文件,不包括 subdir/TODO
# build/
# 忽略 build/ 目录下的所有文件
# doc/*.txt
# 会忽略 doc/notes.txt 但不包括 doc/server/arch.txt
node_modules/
released/
.idea
.wing
bin-debug/
bin-release/
*.swf
.vscode
.DS_Store
coverage
\ No newline at end of file
{
"name": "wx",
"version": "1.0.7",
"description": "基于annieJs的兑吧活动组件库",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"scripts": {
},
"author": "",
"license": "ISC",
"dependencies": {
"tl": "git+ssh://git@gitlab2.dui88.com:clq/tl.git#1.0",
"tw": "git+ssh://git@gitlab2.dui88.com:clq/tw.git#1.0"
}
}
\ No newline at end of file
{
"name": "sl",
"version": "1.0.0",
"description": "基于babylonjs的活动组件",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"scripts": {
},
"author": "",
"license": "ISC",
"dependencies": {
"yt": "git+ssh://git@gitlab2.dui88.com:renjianfeng/yt.git",
"tw": "git+ssh://git@gitlab2.dui88.com:clq/tw.git#1.0"
}
}
\ No newline at end of file
import {GuiManager} from "./../../../yt/index";
import {PanelModule} from "./../../../yt/index";
import {DisplayPool} from "./../../../yt/index";
import {ModuleName} from "../../enum/ModuleName";
import {SysLang} from "../../util/Syslang";
import { RuleModel, TwFun } from "tw";
import {GuiCreate} from "./../../../yt/index";
export class RuleModule extends PanelModule {
/**
* 数据
*/
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>`;
GuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
DisplayPool.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 {PanelModule} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {SysLang} from "../../util/Syslang";
import { RuleModel, TwFun } from "tw";
import {GuiCreate} from "yt";
export class RuleModule extends PanelModule {
/**
* 数据
*/
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>`;
GuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
DisplayPool.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 {Module} from "./../../../yt/index";
import {AnimationGui} from "./../../../yt/index";
import {SceneManager} from "./../../../yt/index";
import {GuiManager} from "./../../../yt/index";
import {DisplayPool} from "./../../../yt/index";
import { GameEndModel, TwFun } from "tw";
import { ModuleName } from "../../enum/ModuleName";
import { WxLang } from "../../util/WxLang";
import {ModuleManager} from "./../../../yt/index";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameEndModule extends Module {
//面板隐藏显示实例
protected panelsAn=new AnimationGui(SceneManager.ins.scene,GuiManager.ins.fullscreenUI)
public init(){
DisplayPool.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;
}
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 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 {Module} from "yt";
import {AnimationGui} from "yt";
import {SceneManager} from "yt";
import {GuiManager} from "yt";
import {DisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw";
import { ModuleName } from "../../enum/ModuleName";
import { WxLang } from "../../util/WxLang";
import {ModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameEndModule extends Module {
//面板隐藏显示实例
protected panelsAn=new AnimationGui(SceneManager.ins.scene,GuiManager.ins.fullscreenUI)
public init(){
DisplayPool.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;
}
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 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/index";
import {GuiManager} from "./../../../yt/index";
import {PanelModule} from "./../../../yt/index";
import {AnimationGui} from "./../../../yt/index";
import {GuiCreate} from "./../../../yt/index";
import {DisplayPool} from "./../../../yt/index";
import {ModuleName} from "../../enum/ModuleName";
import { GameEndRankModel, TwFun } from "tw";
export class GameEndRankModule extends PanelModule {
//奖品列表
protected optionsList;
//dom模板
protected viewNode;
//页面模板
protected listTemplate(config,data){
var item=new BABYLON.GUI.Rectangle("sssd");
return item
};
//页面HTML模板
protected listTemplateHtml(data,config){
}
/**
* 数据
*/
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=[];
//面板隐藏显示实例
protected panelsAn=new AnimationGui(SceneManager.ins.scene,GuiManager.ins.fullscreenUI)
constructor(){
super()
this.initUI();
}
protected htmlCreate(config,data){
this.listTemplateHtml(this.model.rankList,this.uiConfig)
document.body.appendChild(this.viewNode);
GuiCreate.ins.preventDefault(this.viewNode)
}
/**
* 打开后
* */
protected onOpened(...args){
this.optionsList=this.htmlCreate(this.uiConfig,this.model.rankList)
}
public init(){
DisplayPool.ins.displayPool[ModuleName.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 {SceneManager} from "yt";
import {GuiManager} from "yt";
import {PanelModule} from "yt";
import {AnimationGui} from "yt";
import {GuiCreate} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameEndRankModel, TwFun } from "tw";
export class GameEndRankModule extends PanelModule {
//奖品列表
protected optionsList;
//dom模板
protected viewNode;
//页面模板
protected listTemplate(config,data){
var item=new BABYLON.GUI.Rectangle("sssd");
return item
};
//页面HTML模板
protected listTemplateHtml(data,config){
}
/**
* 数据
*/
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=[];
//面板隐藏显示实例
protected panelsAn=new AnimationGui(SceneManager.ins.scene,GuiManager.ins.fullscreenUI)
constructor(){
super()
this.initUI();
}
protected htmlCreate(config,data){
this.listTemplateHtml(this.model.rankList,this.uiConfig)
document.body.appendChild(this.viewNode);
GuiCreate.ins.preventDefault(this.viewNode)
}
/**
* 打开后
* */
protected onOpened(...args){
this.optionsList=this.htmlCreate(this.uiConfig,this.model.rankList)
}
public init(){
DisplayPool.ins.displayPool[ModuleName.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/index";
import {ModuleName} from "../../enum/ModuleName";
import {DisplayPool} from "./../../../yt/index";
export class GameGuiModule extends Module {
constructor(){
super()
}
public init(){
DisplayPool.ins.displayPool[ModuleName.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 {ModuleName} from "../../enum/ModuleName";
import {DisplayPool} from "yt";
export class GameGuiModule extends Module {
constructor(){
super()
}
public init(){
DisplayPool.ins.displayPool[ModuleName.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/index";
import {DisplayPool} from "./../../../yt/index";
import { ModuleName } from "../../enum/ModuleName";
import {ModuleManager} from "./../../../yt/index";
import { GCache } from 'tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameGuideModule extends Module {
protected totalFrames=1;
public init(){
DisplayPool.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 {Module} from "yt";
import {DisplayPool} from "yt";
import { ModuleName } from "../../enum/ModuleName";
import {ModuleManager} from "yt";
import { GCache } from 'tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameGuideModule extends Module {
protected totalFrames=1;
public init(){
DisplayPool.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 {PanelModule} from "./../../../yt/index";
import {DisplayPool} from "./../../../yt/index";
import {ModuleName} from "../../enum/ModuleName";
import {ModuleManager} from "./../../../yt/index";
import { GameLoseModel } from 'tw';
export class GameLoseModule extends PanelModule {
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(){
DisplayPool.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)
ModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {PanelModule} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {ModuleManager} from "yt";
import { GameLoseModel } from 'tw';
export class GameLoseModule extends PanelModule {
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(){
DisplayPool.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)
ModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {GuiManager} from "./../../../yt/index";
import {PanelModule} from "./../../../yt/index";
import {GuiCreate} from "./../../../yt/index";
import {DisplayPool} from "./../../../yt/index";
import {ModuleName} from "../../enum/ModuleName";
import { GameOptionModel, TwFun } from "tw";
export class GameOptionModule extends PanelModule {
//奖品列表
protected optionsList;
//页面模板
protected listTemplate(config,data){
var item=new BABYLON.GUI.Rectangle("item");
return item
};
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开前
* */
protected onOpen(...args){
this.optionsList=GuiCreate.ins.optionsListCon(this.uiConfig,this.model.optionList,this.listTemplate)
this.view.view.addControl(this.optionsList)
GuiManager.ins.appendGui(this.parent);
}
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(){
this.view.view.removeControl(this.optionsList)
}
}
\ No newline at end of file
import {GuiManager} from "yt";
import {PanelModule} from "yt";
import {GuiCreate} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameOptionModel, TwFun } from "tw";
export class GameOptionModule extends PanelModule {
//奖品列表
protected optionsList;
//页面模板
protected listTemplate(config,data){
var item=new BABYLON.GUI.Rectangle("item");
return item
};
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开前
* */
protected onOpen(...args){
this.optionsList=GuiCreate.ins.optionsListCon(this.uiConfig,this.model.optionList,this.listTemplate)
this.view.view.addControl(this.optionsList)
GuiManager.ins.appendGui(this.parent);
}
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(){
this.view.view.removeControl(this.optionsList)
}
}
\ No newline at end of file
import {GuiManager} from "./../../../yt/index";
import {PanelModule} from "./../../../yt/index";
import {GuiCreate} from "./../../../yt/index";
import {DisplayPool} from "./../../../yt/index";
import {ModuleName} from "../../enum/ModuleName";
import { GameRealTimeRankModel, TwFun } from "tw";
export class GameRealTimeRankModule extends PanelModule {
//排行榜
protected optionsList;
//页面模板
protected listTemplate(config,data){
var item=new BABYLON.GUI.Rectangle("item");
return item
};
/**
* 数据
*/
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()
this.initUI();
}
/**
* 打开前
* */
protected onOpen(...args){
super.onOpen(...args)
this.optionsList=GuiCreate.ins.optionsListCon(this.uiConfig,this.model.userList,this.listTemplate)
this.view.view.addControl(this.optionsList)
GuiManager.ins.appendGui(this.parent);
}
public init(){
DisplayPool.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;
}
}
\ No newline at end of file
import {GuiManager} from "yt";
import {PanelModule} from "yt";
import {GuiCreate} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameRealTimeRankModel, TwFun } from "tw";
export class GameRealTimeRankModule extends PanelModule {
//排行榜
protected optionsList;
//页面模板
protected listTemplate(config,data){
var item=new BABYLON.GUI.Rectangle("item");
return item
};
/**
* 数据
*/
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()
this.initUI();
}
/**
* 打开前
* */
protected onOpen(...args){
super.onOpen(...args)
this.optionsList=GuiCreate.ins.optionsListCon(this.uiConfig,this.model.userList,this.listTemplate)
this.view.view.addControl(this.optionsList)
GuiManager.ins.appendGui(this.parent);
}
public init(){
DisplayPool.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;
}
}
\ No newline at end of file
import {Module} from "./../../../yt/index";
import {SceneManager} from "./../../../yt/index";
import {ModuleManager} from "./../../../yt/index";
import {YtModuleName} from "./../../../yt/index";
import {YtLang} from "./../../../yt/index";
import {ModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class GameSceneModule extends Module{
/**
* 是否校验积分
*/
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){
ModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {Module} from "yt";
import {SceneManager} from "yt";
import {ModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class GameSceneModule extends Module{
/**
* 是否校验积分
*/
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){
ModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {Module} from "./../../../yt/index";
import {DisplayPool} from "./../../../yt/index";
import {ModuleName} from "../../enum/ModuleName";
import {ModuleManager} from "./../../../yt/index";
import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'tc';
export class GameStartModule extends Module {
/**
* 数据
*/
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();
//this.updateExemptionTxt();
}
}
/* GuiCreate.ins.optionsList({
bodyWidth:"520px",
bodyHeight:"170px",
bodyTop:"-100px",
itemWidth:"130px",
itemHeight:"170px",
itemPaddingRight:"30px",
logoWidth:"100px",
logoHeight:"100px",
logoTop:"0px",
logoLeft:"0px",
textWidth:"100px",
textHeight:"30px",
textTop:"140px",
textLeft:"0px",
textColor:"#ffffff",
isVertical:false,
},data,this.parent)*/
\ No newline at end of file
import {Module} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {ModuleManager} from "yt";
import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'tc';
export class GameStartModule extends Module {
/**
* 数据
*/
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();
//this.updateExemptionTxt();
}
}
/* GuiCreate.ins.optionsList({
bodyWidth:"520px",
bodyHeight:"170px",
bodyTop:"-100px",
itemWidth:"130px",
itemHeight:"170px",
itemPaddingRight:"30px",
logoWidth:"100px",
logoHeight:"100px",
logoTop:"0px",
logoLeft:"0px",
textWidth:"100px",
textHeight:"30px",
textTop:"140px",
textLeft:"0px",
textColor:"#ffffff",
isVertical:false,
},data,this.parent)*/
\ No newline at end of file
import {PanelModule} from "./../../../yt/index";
import {DisplayPool} from "./../../../yt/index";
import {ModuleManager} from "./../../../yt/index";
import {ModuleName} from "../../enum/ModuleName";
import { GameWinModel } from 'tw';
export class GameWinModule extends PanelModule {
//分数
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 {PanelModule} from "yt";
import {DisplayPool} from "yt";
import {ModuleManager} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameWinModel } from 'tw';
export class GameWinModule extends PanelModule {
//分数
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 {Module} from "./../../../yt/index";
import {DisplayPool} from "./../../../yt/index";
import { GameWinnerModel, TwFun } from "tw";
import { ModuleName } from "../../enum/ModuleName";
import {ModuleManager} from "./../../../yt/index";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameWinnerModule extends Module {
public init(){
DisplayPool.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 {Module} from "yt";
import {DisplayPool} from "yt";
import { GameWinnerModel, TwFun } from "tw";
import { ModuleName } from "../../enum/ModuleName";
import {ModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameWinnerModule extends Module {
public init(){
DisplayPool.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
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"noImplicitAny": false,
"noEmitOnError": true,
"declarationDir": "./types",
"declaration": true,
"outDir": "./dist"
},
"exclude": [
"node_modules",
"dist",
"types"
]
}
\ No newline at end of file
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"noImplicitAny": false,
"noEmitOnError": true,
"declarationDir": "./types",
"declaration": true,
"outDir": "./dist",
"skipLibCheck": true
},
"exclude": [
"node_modules",
"dist",
"types"
]
}
\ No newline at end of file
兑吧业务框架
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
*Created by cuiliqiang on 2018/3/13
*/
var ModuleName;
(function (ModuleName) {
//游戏规则面板
ModuleName["RULE_PANEL"] = "RulePanel";
//分享面板
ModuleName["SHARE_PANEL"] = "SharePanel";
//未中奖面板
ModuleName["LOSE_PANEL"] = "LosePanel";
//开始场景
ModuleName["GAME_START_GUI"] = "GameStartScene";
//游戏玩法场景
ModuleName["GAME_PLAY_SCENE"] = "GamePlayScene";
//游戏玩法场景GUI
ModuleName["GAME_PLAY_GUI"] = "GamePlayGui";
//活动结束场景
ModuleName["GAME_END_GUI"] = "GameEndScene";
//中奖信息场景
ModuleName["GAME_WINNER_GUI"] = "GameWinnerScene";
//活动奖品面板
ModuleName["GAME_OPTION_PANEL"] = "GameOptionPanel";
//游戏未中奖
ModuleName["GAME_LOSE_PANEL"] = "GameLosePanel";
//游戏中奖面板
ModuleName["GAME_WIN_PANEL"] = "GameWinPanel";
//排行榜面板
ModuleName["GAME_END_RANK_PANEL"] = "GameEndRankPanel";
//实时排行榜面板
ModuleName["GAME_REAL_TIME_RANK_PANEL"] = "GameRealTimeRankPanel";
//引导场景
ModuleName["GAME_GUIDE_GUI"] = "GameGuideScene";
//自定义活动工具玩法场景
ModuleName["CUSTOM_PLAY_GUI"] = "CustomPlayScene";
//自定义活动工具中奖面板
ModuleName["CUSTOM_WIN_PANEL"] = "CustomWinPanel";
//自定义活动工具奖品详情面板
ModuleName["CUSTOM_OPTION_INFO_PANEL"] = "CustomOptionInfoPanel";
//插件抽奖面板
ModuleName["PLUG_PANEL"] = "PlugPanel";
//插件中奖面板
ModuleName["PLUG_WIN_PANEL"] = "PlugWinPanel";
})(ModuleName = exports.ModuleName || (exports.ModuleName = {}));
//# sourceMappingURL=ModuleName.js.map
\ No newline at end of file
{"version":3,"file":"ModuleName.js","sourceRoot":"","sources":["../../src/enum/ModuleName.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,IAAY,UAwCX;AAxCD,WAAY,UAAU;IAClB,QAAQ;IACR,sCAAwB,CAAA;IACxB,MAAM;IACN,wCAA0B,CAAA;IAC1B,OAAO;IACP,sCAAwB,CAAA;IACxB,MAAM;IACN,+CAAiC,CAAA;IACjC,QAAQ;IACR,+CAAiC,CAAA;IACjC,WAAW;IACX,2CAA6B,CAAA;IAC7B,QAAQ;IACR,2CAA6B,CAAA;IAC7B,QAAQ;IACR,iDAAmC,CAAA;IACnC,QAAQ;IACR,mDAAqC,CAAA;IACrC,OAAO;IACP,+CAAiC,CAAA;IACjC,QAAQ;IACR,6CAA+B,CAAA;IAC/B,OAAO;IACP,sDAAwC,CAAA;IACxC,SAAS;IACT,iEAAmD,CAAA;IACnD,MAAM;IACN,+CAAiC,CAAA;IACjC,aAAa;IACb,iDAAmC,CAAA;IACnC,aAAa;IACb,iDAAmC,CAAA;IACnC,eAAe;IACf,gEAAkD,CAAA;IAClD,QAAQ;IACR,sCAAwB,CAAA;IACxB,QAAQ;IACR,6CAA+B,CAAA;AAEnC,CAAC,EAxCW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAwCrB"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ModuleName_1 = require("./enum/ModuleName");
exports.ModuleName = ModuleName_1.ModuleName;
var SysLang_1 = require("./util/SysLang");
exports.SysLang = SysLang_1.SysLang;
var WxLang_1 = require("./util/WxLang");
exports.WxLang = WxLang_1.WxLang;
var GameOptionModule_1 = require("./module/game/GameOptionModule");
exports.GameOptionModule = GameOptionModule_1.GameOptionModule;
var RuleModule_1 = require("./module/common/RuleModule");
exports.RuleModule = RuleModule_1.RuleModule;
var GameWinModule_1 = require("./module/game/GameWinModule");
exports.GameWinModule = GameWinModule_1.GameWinModule;
var GameLoseModule_1 = require("./module/game/GameLoseModule");
exports.GameLoseModule = GameLoseModule_1.GameLoseModule;
var GameStartModule_1 = require("./module/game/GameStartModule");
exports.GameStartModule = GameStartModule_1.GameStartModule;
var GameGuiModule_1 = require("./module/game/GameGuiModule");
exports.GameGuiModule = GameGuiModule_1.GameGuiModule;
var GameRealTimeRankModule_1 = require("./module/game/GameRealTimeRankModule");
exports.GameRealTimeRankModule = GameRealTimeRankModule_1.GameRealTimeRankModule;
var GameEndModule_1 = require("./module/game/GameEndModule");
exports.GameEndModule = GameEndModule_1.GameEndModule;
var GameWinnerModule_1 = require("./module/game/GameWinnerModule");
exports.GameWinnerModule = GameWinnerModule_1.GameWinnerModule;
var GameEndRankModule_1 = require("./module/game/GameEndRankModule");
exports.GameEndRankModule = GameEndRankModule_1.GameEndRankModule;
var GameGuideModule_1 = require("./module/game/GameGuideModule");
exports.GameGuideModule = GameGuideModule_1.GameGuideModule;
var GameSceneModule_1 = require("./module/game/GameSceneModule");
exports.GameSceneModule = GameSceneModule_1.GameSceneModule;
//# 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"}
\ 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 yt_1 = require("yt");
var yt_2 = require("yt");
var ModuleName_1 = require("../../enum/ModuleName");
var Syslang_1 = require("../../util/Syslang");
var tw_1 = require("tw");
var yt_3 = require("yt");
var RuleModule = /** @class */ (function (_super) {
__extends(RuleModule, _super);
function RuleModule() {
var _this = _super.call(this) || this;
_this.config = {
x: 16,
y: 47,
width: 68,
height: 60,
lineHeight: 7,
fontSize: 3,
color: "#000000"
};
return _this;
}
RuleModule.prototype.initModel = function () {
this.model = new tw_1.RuleModel();
};
RuleModule.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: " + Syslang_1.SysLang.lang_015 + ";font-size: " + fontSize + "vw;color: " + color + ";}\n </style>\n <div>" + val + "</div>\n </div>";
yt_3.GuiCreate.ins.preventDefault(this.section);
};
RuleModule.prototype.appendHtml = function () {
document.body.appendChild(this.section);
};
RuleModule.prototype.init = function () {
yt_2.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.RULE_PANEL] = this;
};
/**
* 添加事件
* */
RuleModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
RuleModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
this.hide();
};
RuleModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.enableMouseEvt(true);
this.removeClick(this.view.closeBtn);
}
};
/**
* 更新页面
* @param args
*/
RuleModule.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;
};
RuleModule.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();
};
/**
* 关闭前
* */
RuleModule.prototype.onClose = function () {
this.removeHtml();
};
RuleModule.prototype.removeHtml = function () {
if (this.section) {
document.body.removeChild(this.section);
}
};
return RuleModule;
}(yt_1.PanelModule));
exports.RuleModule = RuleModule;
//# sourceMappingURL=RuleModule.js.map
\ No newline at end of file
{"version":3,"file":"RuleModule.js","sourceRoot":"","sources":["../../../src/module/common/RuleModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yBAA+B;AAC/B,yBAA+B;AAC/B,oDAAiD;AACjD,8CAA2C;AAC3C,yBAAsC;AACtC,yBAA6B;AAE7B;IAAgC,8BAAW;IAYvC;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,8BAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,cAAS,EAAE,CAAC;IACjC,CAAC;IAkBS,6BAAQ,GAAlB,UAAmB,CAAC,EAAC,CAAC,EAAC,KAAK,EAAC,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CAAA;SACvC;IACL,CAAC;IAGD;;;OAGG;IACI,+BAAU,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,6BAAQ,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,4BAAO,GAAjB;QACI,IAAI,CAAC,UAAU,EAAE,CAAA;IACrB,CAAC;IAES,+BAAU,GAApB;QACI,IAAG,IAAI,CAAC,OAAO,EAAC;YACZ,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC3C;IACL,CAAC;IACL,iBAAC;AAAD,CAAC,AAxGD,CAAgC,gBAAW,GAwG1C;AAxGY,gCAAU"}
\ 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 yt_1 = require("yt");
var yt_2 = require("yt");
var yt_3 = require("yt");
var yt_4 = require("yt");
var yt_5 = require("yt");
var tw_1 = require("tw");
var ModuleName_1 = require("../../enum/ModuleName");
var WxLang_1 = require("../../util/WxLang");
var yt_6 = require("yt");
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
var GameEndModule = /** @class */ (function (_super) {
__extends(GameEndModule, _super);
function GameEndModule() {
var _this = _super !== null && _super.apply(this, arguments) || this;
//面板隐藏显示实例
_this.panelsAn = new yt_2.AnimationGui(yt_3.SceneManager.ins.scene, yt_4.GuiManager.ins.fullscreenUI);
return _this;
}
GameEndModule.prototype.init = function () {
yt_5.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.GAME_END_GUI] = this;
};
GameEndModule.prototype.initModel = function () {
this.model = new tw_1.GameEndModel();
};
GameEndModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.updateStatusTxt();
this.updateScoreTxt();
};
/**
* 更新活动状态文案
* @param str
*/
GameEndModule.prototype.updateStatusTxt = function (str) {
if (str === void 0) { str = WxLang_1.WxLang.lang_004; }
if (this.view.statusTxt) {
this.view.statusTxt.text = str;
}
};
/**
* 更新积分文案
*/
GameEndModule.prototype.updateScoreTxt = function () {
if (this.view.scoreTxt) {
this.view.scoreTxt.text = this.model.getScoreTxt();
}
};
GameEndModule.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));
}
};
GameEndModule.prototype.onClick_recordBtn = function (e) {
this.delayEnable(this.view.recordBtn, 5000);
window.location.href = tw_1.TwFun.getRecordUrl('00');
};
GameEndModule.prototype.onClick_ruleBtn = function (e) {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
};
GameEndModule.prototype.getRule_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
yt_6.ModuleManager.ins.openModule(ModuleName_1.ModuleName.RULE_PANEL);
};
GameEndModule.prototype.onClick_optionBtn = function (e) {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
};
GameEndModule.prototype.getOptions_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
yt_6.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_OPTION_PANEL);
};
GameEndModule.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 GameEndModule;
}(yt_1.Module));
exports.GameEndModule = GameEndModule;
//# sourceMappingURL=GameEndModule.js.map
\ No newline at end of file
{"version":3,"file":"GameEndModule.js","sourceRoot":"","sources":["../../../src/module/game/GameEndModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAA0B;AAC1B,yBAAgC;AAChC,yBAAgC;AAChC,yBAA8B;AAC9B,yBAA+B;AAC/B,yBAAyC;AACzC,oDAAmD;AACnD,4CAA2C;AAC3C,yBAAiC;AAEjC;;;GAGG;AACH;IAAmC,iCAAM;IAAzC;QAAA,qEAyGC;QArGG,UAAU;QACA,cAAQ,GAAC,IAAI,iBAAY,CAAC,iBAAY,CAAC,GAAG,CAAC,KAAK,EAAC,eAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;;IAoG3F,CAAC;IAlGU,4BAAI,GAAX;QACI,gBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,uBAAU,CAAC,YAAY,CAAC,GAAC,IAAI,CAAC;IAC9D,CAAC;IAOS,iCAAS,GAAnB;QACI,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I,CAAC,IAAI,CAAC,OAAO,EAAE;YACrB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;SACpC;QAED,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACpB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SACvC;IACL,CAAC;IACL,oBAAC;AAAD,CAAC,AAzGD,CAAmC,WAAM,GAyGxC;AAzGY,sCAAa"}
\ 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 yt_1 = require("yt");
var yt_2 = require("yt");
var yt_3 = require("yt");
var yt_4 = require("yt");
var yt_5 = require("yt");
var yt_6 = require("yt");
var ModuleName_1 = require("../../enum/ModuleName");
var tw_1 = require("tw");
var GameEndRankModule = /** @class */ (function (_super) {
__extends(GameEndRankModule, _super);
function GameEndRankModule() {
var _this = _super.call(this) || this;
//UI配置
_this.uiConfig = {
bodyWidth: "440px",
bodyHeight: "680px",
bodyTop: "260px",
bodyLeft: "260px",
isVertical: true,
};
//事件
_this.doEvents = [];
//面板隐藏显示实例
_this.panelsAn = new yt_4.AnimationGui(yt_1.SceneManager.ins.scene, yt_2.GuiManager.ins.fullscreenUI);
_this.initUI();
return _this;
}
//页面模板
GameEndRankModule.prototype.listTemplate = function (config, data) {
var item = new BABYLON.GUI.Rectangle("sssd");
return item;
};
;
//页面HTML模板
GameEndRankModule.prototype.listTemplateHtml = function (data, config) {
};
GameEndRankModule.prototype.initModel = function () {
this.model = new tw_1.GameEndRankModel();
};
GameEndRankModule.prototype.htmlCreate = function (config, data) {
this.listTemplateHtml(this.model.rankList, this.uiConfig);
document.body.appendChild(this.viewNode);
yt_5.GuiCreate.ins.preventDefault(this.viewNode);
};
/**
* 打开后
* */
GameEndRankModule.prototype.onOpened = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.optionsList = this.htmlCreate(this.uiConfig, this.model.rankList);
};
GameEndRankModule.prototype.init = function () {
yt_6.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.GAME_END_RANK_PANEL] = this;
};
/**
* 添加事件
* */
GameEndRankModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
GameEndRankModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
this.hide();
};
GameEndRankModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.enableMouseEvt(true);
this.removeClick(this.view.closeBtn);
}
};
/**
* 更新页面
* @param args
*/
GameEndRankModule.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;
};
/**
* 关闭前
* */
GameEndRankModule.prototype.onClose = function () {
if (document.getElementById("viewNode")) {
try {
document.body.removeChild(this.viewNode);
}
catch (e) {
console.log(e);
}
}
};
return GameEndRankModule;
}(yt_3.PanelModule));
exports.GameEndRankModule = GameEndRankModule;
//# sourceMappingURL=GameEndRankModule.js.map
\ No newline at end of file
{"version":3,"file":"GameEndRankModule.js","sourceRoot":"","sources":["../../../src/module/game/GameEndRankModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAAgC;AAChC,yBAA8B;AAC9B,yBAA+B;AAC/B,yBAAgC;AAChC,yBAA6B;AAC7B,yBAA+B;AAC/B,oDAAiD;AACjD,yBAA6C;AAE7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W,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aAC3C;YAAA,OAAO,CAAC,EAAE;gBACP,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;aACjB;SACJ;IACL,CAAC;IACL,wBAAC;AAAD,CAAC,AAtHD,CAAuC,gBAAW,GAsHjD;AAtHY,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 yt_1 = require("yt");
var ModuleName_1 = require("../../enum/ModuleName");
var yt_2 = require("yt");
var GameGuiModule = /** @class */ (function (_super) {
__extends(GameGuiModule, _super);
function GameGuiModule() {
return _super.call(this) || this;
}
GameGuiModule.prototype.init = function () {
yt_2.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.GAME_PLAY_GUI] = this;
};
/**
* 添加事件
* */
GameGuiModule.prototype.addEvent = function () {
};
GameGuiModule.prototype.removeEvent = function () {
};
/**
* 更新页面
* @param args
*/
GameGuiModule.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 GameGuiModule;
}(yt_1.Module));
exports.GameGuiModule = GameGuiModule;
//# sourceMappingURL=GameGuiModule.js.map
\ No newline at end of file
{"version":3,"file":"GameGuiModule.js","sourceRoot":"","sources":["../../../src/module/game/GameGuiModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAA0B;AAC1B,oDAAiD;AACjD,yBAA+B;AAG/B;IAAmC,iCAAM;IACrC;eACI,iBAAO;IACX,CAAC;IACM,4BAAI,GAAX;QACI,gBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,uBAAU,CAAC,aAAa,CAAC,GAAC,IAAI,CAAC;IAC/D,CAAC;IACD;;SAEK;IACK,gCAAQ,GAAlB;IAEA,CAAC;IAGS,mCAAW,GAArB;IAEA,CAAC;IACD;;;OAGG;IACI,kCAAU,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,oBAAC;AAAD,CAAC,AA7BD,CAAmC,WAAM,GA6BxC;AA7BY,sCAAa"}
\ 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 yt_1 = require("yt");
var yt_2 = require("yt");
var ModuleName_1 = require("../../enum/ModuleName");
var yt_3 = require("yt");
var tc_1 = require("tc");
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
var GameGuideModule = /** @class */ (function (_super) {
__extends(GameGuideModule, _super);
function GameGuideModule() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.totalFrames = 1;
return _this;
}
GameGuideModule.prototype.init = function () {
yt_2.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.GAME_GUIDE_GUI] = this;
};
GameGuideModule.prototype.updateData = function () {
_super.prototype.updateData.call(this);
this.maxStep = this.totalFrames;
this.currStep = 1;
};
/**
* 引导是否完成
*/
GameGuideModule.prototype.isComplete = function () {
if (this.currStep >= this.maxStep) {
tc_1.GCache.writeCache('guide', 'true');
return true;
}
return false;
};
GameGuideModule.prototype.addEvent = function () {
_super.prototype.addEvent.call(this);
if (this.view.sureBtn) {
this.addClick(this.view.sureBtn, this.onClick_sureBtn.bind(this));
}
};
GameGuideModule.prototype.onClick_sureBtn = function () {
this.currStep++;
if (this.isComplete()) {
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_PLAY_SCENE);
}
else {
// this.view.gotoAndStop(this.currStep);
}
};
GameGuideModule.prototype.removeEvent = function () {
_super.prototype.removeEvent.call(this);
if (this.view.sureBtn) {
this.removeClick(this.view.sureBtn);
}
};
return GameGuideModule;
}(yt_1.Module));
exports.GameGuideModule = GameGuideModule;
//# sourceMappingURL=GameGuideModule.js.map
\ No newline at end of file
{"version":3,"file":"GameGuideModule.js","sourceRoot":"","sources":["../../../src/module/game/GameGuideModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAA0B;AAC1B,yBAA+B;AAC/B,oDAAmD;AACnD,yBAAiC;AACjC,yBAA4B;AAE5B;;;GAGG;AACH;IAAqC,mCAAM;IAA3C;QAAA,qEA4DC;QA3Da,iBAAW,GAAC,CAAC,CAAC;;IA2D5B,CAAC;IAzDU,8BAAI,GAAX;QACI,gBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,uBAAU,CAAC,cAAc,CAAC,GAAC,IAAI,CAAC;IAChE,CAAC;IAYM,oCAAU,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,oCAAU,GAAjB;QACI,IAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;YAC9B,WAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAIS,kCAAQ,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,yCAAe,GAAzB;QACI,IAAI,CAAC,QAAQ,EAAG,CAAC;QACjB,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE;YACnB,kBAAa,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAU,CAAC,eAAe,CAAC,CAAC;SAC5D;aAAM;YACJ,wCAAwC;SAC1C;IACL,CAAC;IAGS,qCAAW,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,sBAAC;AAAD,CAAC,AA5DD,CAAqC,WAAM,GA4D1C;AA5DY,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 yt_1 = require("yt");
var yt_2 = require("yt");
var ModuleName_1 = require("../../enum/ModuleName");
var yt_3 = require("yt");
var tw_1 = require("tw");
var GameLoseModule = /** @class */ (function (_super) {
__extends(GameLoseModule, _super);
function GameLoseModule() {
return _super.call(this) || this;
}
GameLoseModule.prototype.initModel = function () {
this.model = new tw_1.GameLoseModel();
};
/**
* 更新剩余次数文案
*/
GameLoseModule.prototype.updateCountTxt = function () {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
};
/**
* 更新排行文案
*/
GameLoseModule.prototype.updateRankTxt = function () {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
};
/**
* 更新当前积分文案
*/
GameLoseModule.prototype.updateCurrScoreTxt = function () {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt();
}
};
/**
* 更新最高积分文案
*/
GameLoseModule.prototype.updateMaxScoreTxt = function () {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt();
}
};
/**
* 隐藏
*/
GameLoseModule.prototype.hide = function () {
var _this = this;
this.removeEvent();
this.panelsAn.hide(this.view.view, function () {
_this.onClose();
}, function () {
_this.onClosed();
});
};
GameLoseModule.prototype.init = function () {
yt_2.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.GAME_LOSE_PANEL] = this;
};
/**
* 添加事件
* */
GameLoseModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
GameLoseModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
this.hide();
};
GameLoseModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.enableMouseEvt(true);
this.removeClick(this.view.closeBtn);
}
};
/**
* 更新页面
* @param args
*/
GameLoseModule.prototype.updateData = function () {
_super.prototype.updateData.call(this);
this.updateCountTxt();
this.updateRankTxt();
this.updateCurrScoreTxt();
this.updateMaxScoreTxt();
};
/**
* 关闭后
* */
GameLoseModule.prototype.onClosed = function () {
_super.prototype.onClosed.call(this);
this.enableMouseEvt(true);
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_START_GUI);
};
return GameLoseModule;
}(yt_1.PanelModule));
exports.GameLoseModule = GameLoseModule;
//# sourceMappingURL=GameLoseModule.js.map
\ No newline at end of file
{"version":3,"file":"GameLoseModule.js","sourceRoot":"","sources":["../../../src/module/game/GameLoseModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAA+B;AAC/B,yBAA+B;AAC/B,oDAAiD;AACjD,yBAAiC;AACjC,yBAAmC;AAEnC;IAAoC,kCAAW;IAC3C;eACI,iBAAO;IACX,CAAC;IAQS,kCAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,kBAAa,EAAE,CAAC;IACrC,CAAC;IAGA;;MAEE;IACO,uCAAc,GAAxB;QACI,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACnB,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;SAC1C;IACL,CAAC;IAED;;OAEG;IACO,sCAAa,GAAvB;QACI,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACnB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;SACpD;IACL,CAAC;IAED;;OAEG;IACO,2CAAkB,GAA5B;QACI,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACxB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;SAC9D;IACL,CAAC;IAED;;OAEG;IACO,0CAAiB,GAA3B;QACI,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACvB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;SAC5D;IACL,CAAC;IAED;;OAEG;IACO,6BAAI,GAAd;QAAA,iBAOC;QANG,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,I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AU,CAAC,cAAc,CAAC,CAAC;IAC5D,CAAC;IACL,qBAAC;AAAD,CAAC,AAjHD,CAAoC,gBAAW,GAiH9C;AAjHY,wCAAc"}
\ 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 yt_1 = require("yt");
var yt_2 = require("yt");
var yt_3 = require("yt");
var yt_4 = require("yt");
var ModuleName_1 = require("../../enum/ModuleName");
var tw_1 = require("tw");
var GameOptionModule = /** @class */ (function (_super) {
__extends(GameOptionModule, _super);
function GameOptionModule() {
var _this = _super !== null && _super.apply(this, arguments) || this;
//UI配置
_this.uiConfig = {
bodyWidth: "440px",
bodyHeight: "680px",
bodyTop: "260px",
bodyLeft: "260px",
isVertical: true,
};
return _this;
}
//页面模板
GameOptionModule.prototype.listTemplate = function (config, data) {
var item = new BABYLON.GUI.Rectangle("item");
return item;
};
;
GameOptionModule.prototype.initModel = function () {
this.model = new tw_1.GameOptionModel();
};
/**
* 打开前
* */
GameOptionModule.prototype.onOpen = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.optionsList = yt_3.GuiCreate.ins.optionsListCon(this.uiConfig, this.model.optionList, this.listTemplate);
this.view.view.addControl(this.optionsList);
yt_1.GuiManager.ins.appendGui(this.parent);
};
GameOptionModule.prototype.init = function () {
yt_4.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.GAME_OPTION_PANEL] = this;
};
/**
* 添加事件
* */
GameOptionModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
GameOptionModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
this.hide();
};
GameOptionModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.enableMouseEvt(true);
this.removeClick(this.view.closeBtn);
}
};
/**
* 更新页面
* @param args
*/
GameOptionModule.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;
};
/**
* 关闭前
* */
GameOptionModule.prototype.onClose = function () {
this.view.view.removeControl(this.optionsList);
};
return GameOptionModule;
}(yt_2.PanelModule));
exports.GameOptionModule = GameOptionModule;
//# sourceMappingURL=GameOptionModule.js.map
\ No newline at end of file
{"version":3,"file":"GameOptionModule.js","sourceRoot":"","sources":["../../../src/module/game/GameOptionModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yBAA8B;AAC9B,yBAA+B;AAE/B,yBAA6B;AAC7B,yBAA+B;AAC/B,oDAAiD;AACjD,yBAA4C;AAE5C;IAAsC,oCAAW;IAAjD;QAAA,qEAsFC;QAjEG,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;;IAyDL,CAAC;IAhFG,MAAM;IACI,uCAAY,GAAtB,UAAuB,MAAM,EAAC,IAAI;QAC9B,IAAI,IAAI,GAAC,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAA;IACf,CAAC;IAAA,CAAC;IAOQ,oCAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,oBAAe,EAAE,CAAC;IACvC,CAAC;IAYD;;SAEK;IACK,iCAAM,GAAhB;QAAiB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,y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,CAAC;SACtB;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAC,IAAI,CAAC;IAC7C,CAAC;IAED;;SAEK;IACK,kCAAO,GAAjB;QACI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IAClD,CAAC;IACL,uBAAC;AAAD,CAAC,AAtFD,CAAsC,gBAAW,GAsFhD;AAtFY,4CAAgB"}
\ 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 yt_1 = require("yt");
var yt_2 = require("yt");
var yt_3 = require("yt");
var yt_4 = require("yt");
var ModuleName_1 = require("../../enum/ModuleName");
var tw_1 = require("tw");
var GameRealTimeRankModule = /** @class */ (function (_super) {
__extends(GameRealTimeRankModule, _super);
function GameRealTimeRankModule() {
var _this = _super.call(this) || this;
//UI配置
_this.uiConfig = {
bodyWidth: "440px",
bodyHeight: "680px",
bodyTop: "260px",
bodyLeft: "260px",
isVertical: true,
};
_this.initUI();
return _this;
}
//页面模板
GameRealTimeRankModule.prototype.listTemplate = function (config, data) {
var item = new BABYLON.GUI.Rectangle("item");
return item;
};
;
GameRealTimeRankModule.prototype.initModel = function () {
this.model = new tw_1.GameRealTimeRankModel();
};
/**
* 打开前
* */
GameRealTimeRankModule.prototype.onOpen = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
_super.prototype.onOpen.apply(this, args);
this.optionsList = yt_3.GuiCreate.ins.optionsListCon(this.uiConfig, this.model.userList, this.listTemplate);
this.view.view.addControl(this.optionsList);
yt_1.GuiManager.ins.appendGui(this.parent);
};
GameRealTimeRankModule.prototype.init = function () {
yt_4.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.GAME_REAL_TIME_RANK_PANEL] = this;
};
/**
* 添加事件
* */
GameRealTimeRankModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
GameRealTimeRankModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
this.hide();
};
GameRealTimeRankModule.prototype.removeEvent = function () {
if (this.view.closeBtn) {
this.enableMouseEvt(true);
this.removeClick(this.view.closeBtn);
}
};
/**
* 更新页面
* @param args
*/
GameRealTimeRankModule.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;
};
return GameRealTimeRankModule;
}(yt_2.PanelModule));
exports.GameRealTimeRankModule = GameRealTimeRankModule;
//# sourceMappingURL=GameRealTimeRankModule.js.map
\ No newline at end of file
{"version":3,"file":"GameRealTimeRankModule.js","sourceRoot":"","sources":["../../../src/module/game/GameRealTimeRankModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAA8B;AAC9B,yBAA+B;AAC/B,yBAA6B;AAC7B,yBAA+B;AAC/B,oDAAiD;AACjD,yBAAkD;AAElD;IAA4C,0CAAW;IA+BnD;QAAA,YACI,iBAAO,SAEV;QAbD,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;QAIG,KAAI,CAAC,MAAM,EAAE,CAAC;;IAClB,CAAC;IA7BD,MAAM;IACI,6CAAY,GAAtB,UAAuB,MAAM,EAAC,IAAI;QAC9B,IAAI,IAAI,GAAC,IAAI,OAAO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,IAAI,CAAC,CAAA;YACzB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SACvC;IACL,CAAC;IAGD;;;OAGG;IACI,2CAAU,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;IACL,6BAAC;AAAD,CAAC,AAxFD,CAA4C,gBAAW,GAwFtD;AAxFY,wDAAsB"}
\ 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 yt_1 = require("yt");
var yt_2 = require("yt");
var yt_3 = require("yt");
var yt_4 = require("yt");
var yt_5 = require("yt");
var ModuleName_1 = require("../../enum/ModuleName");
var tw_1 = require("tw");
var GameSceneModule = /** @class */ (function (_super) {
__extends(GameSceneModule, _super);
function GameSceneModule() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.score = 0;
return _this;
}
GameSceneModule.prototype.initModel = function () {
this.model = new tw_1.GamePlayModel();
};
//销毁
GameSceneModule.prototype.dispose = function () {
var j;
for (j in this.display) {
console.log(this.display[j]);
if (this.display[j]) {
this.display[j].dispose();
}
}
};
GameSceneModule.prototype.show = function () {
this.resetGame();
yt_2.SceneManager.ins.change(this.display);
};
GameSceneModule.prototype.resetGame = function () {
this.model.update();
};
GameSceneModule.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 分值
*/
GameSceneModule.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();
};
/**
* 阶段性提交
*/
GameSceneModule.prototype.datapash = function () {
if (this.model.checkDatapash(this.score)) {
this.model.datapash();
}
};
GameSceneModule.prototype.submit_result = function () {
var moduleName;
if (this.model.gameIsWinning) {
moduleName = ModuleName_1.ModuleName.GAME_WIN_PANEL;
}
else {
moduleName = ModuleName_1.ModuleName.GAME_LOSE_PANEL;
}
yt_3.ModuleManager.ins.openModule(moduleName);
this.enableMouseEvt(true);
};
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
GameSceneModule.prototype.ImportMeshes = function (importMeshes, onSuccess) {
yt_3.ModuleManager.ins.openModule(yt_4.YtModuleName.WAITING_PANEL, 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, yt_2.SceneManager.ins.scene, function (_mesh, _skeleton) {
try {
_meshes.push(_mesh);
_skeletons.push(_skeleton);
_loadCount++;
if (_loadCount == _length) {
yt_3.ModuleManager.ins.closeModule(yt_4.YtModuleName.WAITING_PANEL);
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes, _skeletons);
}
}
catch (e) {
console.error(e);
}
});
});
};
return GameSceneModule;
}(yt_1.Module));
exports.GameSceneModule = GameSceneModule;
//# sourceMappingURL=GameSceneModule.js.map
\ No newline at end of file
{"version":3,"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AAA;QACjB,IAAI,UAAU,GAAC,CAAC,CAAC;QACjB,YAAY,CAAC,OAAO,CAAC,UAAC,IAAI;YACtB,OAAO,CAAC,WAAW,CAAC,UAAU,CAC1B,EAAE,EACF,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,aAAa,EAClB,iBAAY,CAAC,GAAG,CAAC,KAAK,EACtB,UAAC,KAAK,EAAC,SAAS;gBACZ,IAAI;oBACA,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;oBACnB,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;oBAC1B,UAAU,EAAE,CAAA;oBACZ,IAAG,UAAU,IAAE,OAAO,EAAC;wBACnB,kBAAa,CAAC,GAAG,CAAC,WAAW,CAAC,iBAAY,CAAC,aAAa,CAAC,CAAC;wBAC1D,kBAAa,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAU,CAAC,aAAa,CAAC,CAAC;wBACvD,SAAS,CAAC,OAAO,EAAC,UAAU,CAAC,CAAA;qBAChC;iBACJ;gBAAC,OAAO,CAAC,EAAE;oBACR,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;iBACnB;YACL,CAAC,CACJ,CAAC;QACN,CAAC,CAAC,CAAA;IACN,CAAC;IAEL,sBAAC;AAAD,CAAC,AA7HD,CAAqC,WAAM,GA6H1C;AA7HY,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 yt_1 = require("yt");
var yt_2 = require("yt");
var ModuleName_1 = require("../../enum/ModuleName");
var yt_3 = require("yt");
var tw_1 = require("tw");
var tc_1 = require("tc");
var GameStartModule = /** @class */ (function (_super) {
__extends(GameStartModule, _super);
function GameStartModule() {
return _super.call(this) || this;
}
GameStartModule.prototype.initModel = function () {
this.model = new tw_1.GameStartModel();
};
GameStartModule.prototype.init = function () {
yt_2.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.GAME_START_GUI] = this;
};
/**
* 更新开始按钮状态
*/
GameStartModule.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);
} */
}
};
/**
* 更新次数文案
*/
GameStartModule.prototype.updateCountTxt = function () {
if (this.view.countTxt) {
this.view.countTxt.text = "" + this.model.countTxt;
}
};
/**
* 添加事件
* */
GameStartModule.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));
}
};
GameStartModule.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);
}
};
GameStartModule.prototype.onClick_ruleBtn = function () {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
};
GameStartModule.prototype.onClick_optionBtn = function () {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
};
GameStartModule.prototype.onClick_startBtn = function () {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
};
GameStartModule.prototype.onClick_recordBtn = function () {
this.enableMouseEvt(false);
window.location.href = tw_1.TwFun.getRecordUrl('00');
};
GameStartModule.prototype.onClick_realTimeRankBtn = function () {
this.enableMouseEvt(false);
this.model.realtimerank(this.realtimerank_result.bind(this));
};
GameStartModule.prototype.doStart_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
var module = yt_3.ModuleManager.ins.getModule(ModuleName_1.ModuleName.GAME_GUIDE_GUI);
if (tc_1.GCache.readCache('guide') || !module) {
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_PLAY_SCENE);
}
else {
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_GUIDE_GUI);
}
};
GameStartModule.prototype.realtimerank_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_REAL_TIME_RANK_PANEL);
};
GameStartModule.prototype.getRule_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.RULE_PANEL);
};
GameStartModule.prototype.getOptions_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_OPTION_PANEL);
this.view.startBtn.isHitTestVisible = true;
};
/**
* 更新页面
* @param args
*/
GameStartModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.updateCountTxt();
this.updateStartBtnStatus();
//this.updateExemptionTxt();
};
return GameStartModule;
}(yt_1.Module));
exports.GameStartModule = GameStartModule;
/* GuiCreate.ins.optionsList({
bodyWidth:"520px",
bodyHeight:"170px",
bodyTop:"-100px",
itemWidth:"130px",
itemHeight:"170px",
itemPaddingRight:"30px",
logoWidth:"100px",
logoHeight:"100px",
logoTop:"0px",
logoLeft:"0px",
textWidth:"100px",
textHeight:"30px",
textTop:"140px",
textLeft:"0px",
textColor:"#ffffff",
isVertical:false,
},data,this.parent)*/
//# sourceMappingURL=GameStartModule.js.map
\ No newline at end of file
{"version":3,"file":"GameStartModule.js","sourceRoot":"","sources":["../../../src/module/game/GameStartModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAA0B;AAC1B,yBAA+B;AAC/B,oDAAiD;AACjD,yBAAiC;AACjC,yBAA2C;AAC3C,yBAA4D;AAE5D;IAAqC,mCAAM;IAgBvC;eACI,iBAAO;IACX,CAAC;IAVS,mCAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,mBAAc,EAAE,CAAC;IACtC,CAAC;IAWM,8BAAI,GAAX;QACI,gBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,uBAAU,CAAC,cAAc,CAAC,GAAC,IAAI,CAAC;IAChE,CAAC;IAGD;;OAEG;IACO,8CAAoB,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,wCAAc,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,kCAAQ,GAAlB;QAEI,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B,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAC,IAAI,CAAC;IAC7C,CAAC;IAGD;;;OAGG;IACI,oCAAU,GAAjB;QAAkB,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QAErB,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,4BAA4B;IAChC,CAAC;IACL,sBAAC;AAAD,CAAC,AA9LD,CAAqC,WAAM,GA8L1C;AA9LY,0CAAe;AAiM3B;;;;;;;;;;;;;;;;;oCAiBoC"}
\ 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 yt_1 = require("yt");
var yt_2 = require("yt");
var yt_3 = require("yt");
var ModuleName_1 = require("../../enum/ModuleName");
var tw_1 = require("tw");
var GameWinModule = /** @class */ (function (_super) {
__extends(GameWinModule, _super);
function GameWinModule() {
return _super.call(this) || this;
}
GameWinModule.prototype.initModel = function () {
this.model = new tw_1.GameWinModel();
};
/**
* 更新剩余次数文案
*/
GameWinModule.prototype.updateCountTxt = function () {
if (this.view.costTxt) {
this.view.costTxt = this.model.costTxt;
}
};
/**
* 更新排行文案
*/
GameWinModule.prototype.updateRankTxt = function () {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
};
/**
* 更新当前积分文案
*/
GameWinModule.prototype.updateCurrScoreTxt = function () {
if (this.view.currScoreTxt) {
this.view.currScoreTxt.text = this.model.getCurrScoreTxt("{0}");
}
};
/**
* 更新最高积分文案
*/
GameWinModule.prototype.updateMaxScoreTxt = function () {
if (this.view.maxScoreTxt) {
this.view.maxScoreTxt.text = this.model.getMaxScoreTxt("{0}");
}
};
/**
* 更新奖品名字文案
*/
GameWinModule.prototype.updateOptionNameTxt = function () {
if (this.view.optionNameTxt) {
this.view.optionNameTxt.text = this.model.optionName;
}
};
/**
* 更新图片
*/
GameWinModule.prototype.updateOptionImg = function () {
if (this.view.optionImg) {
this.view.optionImg.source = this.model.optionImg;
}
};
GameWinModule.prototype.init = function () {
yt_2.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.GAME_WIN_PANEL] = this;
};
/**
* 添加事件
* */
GameWinModule.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));
}
};
/**
* 移除事件
* */
GameWinModule.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
*/
GameWinModule.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();
};
GameWinModule.prototype.onClick_useBtn = function (e) {
this.enableMouseEvt(false);
this.model.onUse();
};
GameWinModule.prototype.onClick_closeBtn = function (e) {
this.enableMouseEvt(false);
// this.hide();
this.model.getInfo(this.getInfo_result.bind(this));
};
GameWinModule.prototype.getInfo_result = function () {
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_START_GUI);
this.enableMouseEvt(true);
};
GameWinModule.prototype.onClick_againBtn = function (e) {
this.enableMouseEvt(false);
this.model.doStart(this.doStart_result.bind(this));
};
GameWinModule.prototype.doStart_result = function (e) {
this.onClosed();
this.hide();
setTimeout(function () {
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_PLAY_GUI);
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_PLAY_SCENE);
}, 500);
this.enableMouseEvt(true);
};
return GameWinModule;
}(yt_1.PanelModule));
exports.GameWinModule = GameWinModule;
//# sourceMappingURL=GameWinModule.js.map
\ No newline at end of file
{"version":3,"file":"GameWinModule.js","sourceRoot":"","sources":["../../../src/module/game/GameWinModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAA+B;AAC/B,yBAA+B;AAC/B,yBAAiC;AACjC,oDAAiD;AACjD,yBAAkC;AAClC;IAAmC,iCAAW;IAK1C;eACI,iBAAO;IACX,CAAC;IAMS,iCAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,iBAAY,EAAE,CAAC;IACpC,CAAC;IAEA;;MAEE;IACO,sCAAc,GAAxB;QACI,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACnB,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;SAC1C;IACL,CAAC;IAED;;OAEG;IACO,qCAAa,GAAvB;QACI,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACnB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;SACpD;IACL,CAAC;IAED;;OAEG;IACO,0CAAkB,GAA5B;QACI,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACxB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,I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C;IAES,sCAAc,GAAxB,UAAyB,CAAC;QACtB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAES,wCAAgB,GAA1B,UAA2B,CAAC;QACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC3B,eAAe;QACd,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IACS,sCAAc,GAAxB;QACI,kBAAa,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAU,CAAC,cAAc,CAAC,CAAC;QACxD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAEO,wCAAgB,GAAxB,UAAyB,CAAC;QACtB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IACS,sCAAc,GAAxB,UAAyB,CAAC;QACtB,IAAI,CAAC,QAAQ,EAAE,CAAA;QACf,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,UAAU,CAAC;YACP,kBAAa,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAU,CAAC,aAAa,CAAC,CAAC;YACvD,kBAAa,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAU,CAAC,eAAe,CAAC,CAAC;QAC7D,CAAC,EAAC,GAAG,CAAC,CAAA;QACN,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IACL,oBAAC;AAAD,CAAC,AA7JD,CAAmC,gBAAW,GA6J7C;AA7JY,sCAAa"}
\ 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 yt_1 = require("yt");
var yt_2 = require("yt");
var tw_1 = require("tw");
var ModuleName_1 = require("../../enum/ModuleName");
var yt_3 = require("yt");
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
var GameWinnerModule = /** @class */ (function (_super) {
__extends(GameWinnerModule, _super);
function GameWinnerModule() {
return _super !== null && _super.apply(this, arguments) || this;
}
GameWinnerModule.prototype.init = function () {
yt_2.DisplayPool.ins.displayPool[ModuleName_1.ModuleName.GAME_WINNER_GUI] = this;
};
GameWinnerModule.prototype.initModel = function () {
this.model = new tw_1.GameWinnerModel();
};
GameWinnerModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.updateRankTxt();
this.updateOptionTxt();
this.updateCidTxt();
};
/**
* 更新排行榜文案
*/
GameWinnerModule.prototype.updateRankTxt = function () {
if (this.view.rankTxt) {
this.view.rankTxt.text = this.model.getRankTxt();
}
};
/**
* 更新奖品文案
*/
GameWinnerModule.prototype.updateOptionTxt = function () {
if (this.view.optionTxt) {
this.view.optionTxt.text = this.model.getOptionTxt();
}
};
/**
* 更新用户ID文案
*/
GameWinnerModule.prototype.updateCidTxt = function () {
if (this.view.cidTxt) {
this.view.cidTxt.text = this.model.getConsumerTxt();
}
};
GameWinnerModule.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));
}
};
GameWinnerModule.prototype.onClick_recordBtn = function (e) {
this.enableMouseEvt(false);
window.location.href = tw_1.TwFun.getRecordUrl('00');
};
GameWinnerModule.prototype.onClick_ruleBtn = function (e) {
this.enableMouseEvt(false);
this.model.getRule(this.getRule_result.bind(this));
};
GameWinnerModule.prototype.getRule_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.RULE_PANEL);
};
GameWinnerModule.prototype.onClick_optionBtn = function (e) {
this.enableMouseEvt(false);
this.model.getOptions(this.getOptions_result.bind(this));
};
GameWinnerModule.prototype.getOptions_result = function (success) {
this.enableMouseEvt(true);
if (!success) {
return;
}
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_OPTION_PANEL);
};
GameWinnerModule.prototype.onClick_rankBtn = function (e) {
// this.delayEnable(this.view.rankBtn, 2000);
// this.enableMouseEvt(false);
yt_3.ModuleManager.ins.openModule(ModuleName_1.ModuleName.GAME_END_RANK_PANEL, this.model.rankList);
};
GameWinnerModule.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 GameWinnerModule;
}(yt_1.Module));
exports.GameWinnerModule = GameWinnerModule;
//# sourceMappingURL=GameWinnerModule.js.map
\ No newline at end of file
{"version":3,"file":"GameWinnerModule.js","sourceRoot":"","sources":["../../../src/module/game/GameWinnerModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAA0B;AAC1B,yBAA+B;AAC/B,yBAA4C;AAC5C,oDAAmD;AACnD,yBAAiC;AAEjC;;;GAGG;AACH;IAAsC,oCAAM;IAA5C;;IA4HA,CAAC;IA1HU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,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,CAAC;IAES,4CAAiB,GAA3B,UAA4B,OAAgB;QACxC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAG,CAAC,OAAO,EAAE;YACT,OAAO;SACV;QACD,kBAAa,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAU,CAAC,iBAAiB,CAAC,CAAC;IAC/D,CAAC;IAES,0CAAe,GAAzB,UAA0B,CAAC;QACxB,6CAA6C;QAC7C,8BAA8B;QAC7B,kBAAa,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAU,CAAC,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACtF,CAAC;IAES,sCAAW,GAArB;QACI,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACrB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACzC;QAED,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACnB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACvC;QAED,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACrB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACzC;QAED,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACnB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACvC;IACL,CAAC;IACL,uBAAC;AAAD,CAAC,AA5HD,CAAsC,WAAM,GA4H3C;AA5HY,4CAAgB"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SysLang = /** @class */ (function () {
function SysLang() {
}
SysLang.lang_001 = 'container 不存在';
SysLang.lang_002 = 'child 不存在';
SysLang.lang_003 = '显示对象不存在';
SysLang.lang_004 = 'parent不存在';
SysLang.lang_005 = '对象创建失败,className不存在';
SysLang.lang_006 = '此接口已请求过,请勿连续请求';
SysLang.lang_007 = '已经有一个正在打开的模块';
SysLang.lang_008 = '加载中';
SysLang.lang_009 = '模块{0}未注册,无法访问方法:{1}';
SysLang.lang_012 = 'webview不支持{0}';
SysLang.lang_014 = '当前游戏需要消耗{0}才能开始哦~';
SysLang.lang_015 = '微软雅黑';
SysLang.lang_016 = '系统正在处理中奖名单';
SysLang.lang_017 = '最佳成绩:{0}';
SysLang.lang_018 = '累计总成绩:{0}';
SysLang.lang_019 = '您成功击败了{0}的玩家';
SysLang.lang_020 = '本次成绩:{0}';
SysLang.lang_021 = '最佳成绩:{0}';
SysLang.lang_022 = '累计总成绩:{0}';
SysLang.lang_023 = '确定';
SysLang.lang_024 = '阳光普照';
SysLang.lang_025 = '系统正在处理中奖名单';
SysLang.lang_026 = '游戏结束时间为:{0}';
SysLang.lang_027 = '游戏结束一天内开奖';
SysLang.lang_028 = '第{0}名';
SysLang.lang_029 = '您的排名第{0}';
SysLang.lang_030 = '恭喜您获得了:{0}';
SysLang.lang_031 = '很遗憾,没有中奖哦!';
SysLang.lang_032 = '您的用户ID是:{0}';
SysLang.lang_033 = '您未参与游戏';
SysLang.lang_034 = "对不起,你还未有通关成绩";
SysLang.lang_035 = "你的最佳成绩为{0}s,排名第{1}名";
SysLang.lang_036 = "优先资源加载完成";
SysLang.lang_037 = "常规资源加载完成";
SysLang.lang_038 = "延时资源加载完成";
SysLang.lang_039 = "上一个切换场景未执行完毕";
SysLang.lang_040 = "请您换个姿势再来一次!";
SysLang.lang_041 = "可操作时间:{0}s";
SysLang.lang_042 = "请勿重复对同一对象添加点击事件";
return SysLang;
}());
exports.SysLang = SysLang;
//# sourceMappingURL=SysLang.js.map
\ No newline at end of file
{"version":3,"file":"SysLang.js","sourceRoot":"","sources":["../../src/util/SysLang.ts"],"names":[],"mapp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BAAQ,GAAG,aAAa,CAAC;IACzB,gBAAQ,GAAG,YAAY,CAAC;IACxB,gBAAQ,GAAG,iBAAiB,CAAC;IAC/C,cAAC;CAAA,AAxCD,IAwCC;AAxCY,0BAAO"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var WxLang = /** @class */ (function () {
function WxLang() {
}
// public static lang_001 = '确定';
// public static lang_002 = '取消';
WxLang.lang_003 = '微软雅黑';
WxLang.lang_004 = '系统正在处理中奖名单';
WxLang.lang_005 = '阳光普照';
WxLang.lang_006 = '第{0}名';
return WxLang;
}());
exports.WxLang = WxLang;
//# sourceMappingURL=WxLang.js.map
\ No newline at end of file
{"version":3,"file":"WxLang.js","sourceRoot":"","sources":["../../src/util/WxLang.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
This source diff could not be displayed because it is too large. You can view the blob instead.
declare module BABYLON.GUI {
interface IFocusableControl {
onFocus(): void;
onBlur(): void;
processKeyboard(evt: KeyboardEvent): void;
}
class AdvancedDynamicTexture extends DynamicTexture {
private _isDirty;
private _renderObserver;
private _resizeObserver;
private _preKeyboardObserver;
private _pointerMoveObserver;
private _pointerObserver;
private _canvasPointerOutObserver;
private _background;
_rootContainer: Container;
_lastPickedControl: Control;
_lastControlOver: Nullable<Control>;
_lastControlDown: Nullable<Control>;
_capturingControl: Nullable<Control>;
_shouldBlockPointer: boolean;
_layerToDispose: Nullable<Layer>;
_linkedControls: Control[];
private _isFullscreen;
private _fullscreenViewport;
private _idealWidth;
private _idealHeight;
private _renderAtIdealSize;
private _focusedControl;
private _blockNextFocusCheck;
private _renderScale;
renderScale: number;
background: string;
idealWidth: number;
idealHeight: number;
renderAtIdealSize: boolean;
readonly layer: Nullable<Layer>;
readonly rootContainer: Container;
focusedControl: Nullable<IFocusableControl>;
isForeground: boolean;
constructor(name: string, width: number | undefined, height: number | undefined, scene: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number);
executeOnAllControls(func: (control: Control) => void, container?: Container): void;
markAsDirty(): void;
addControl(control: Control): AdvancedDynamicTexture;
removeControl(control: Control): AdvancedDynamicTexture;
dispose(): void;
private _onResize();
_getGlobalViewport(scene: Scene): Viewport;
private _checkUpdate(camera);
private _render();
private _doPicking(x, y, type, buttonIndex);
attach(): void;
attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
moveFocusToControl(control: IFocusableControl): void;
private _manageFocus();
private _attachToOnPointerOut(scene);
static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean): AdvancedDynamicTexture;
static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number): AdvancedDynamicTexture;
}
}
declare module BABYLON.GUI {
class Measure {
left: number;
top: number;
width: number;
height: number;
constructor(left: number, top: number, width: number, height: number);
copyFrom(other: Measure): void;
isEqualsTo(other: Measure): boolean;
static Empty(): Measure;
}
}
declare module BABYLON.GUI {
class Vector2WithInfo extends Vector2 {
buttonIndex: number;
constructor(source: Vector2, buttonIndex?: number);
}
class Matrix2D {
m: Float32Array;
constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number);
fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D;
determinant(): number;
invertToRef(result: Matrix2D): Matrix2D;
multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D;
transformCoordinates(x: number, y: number, result: Vector2): Matrix2D;
static Identity(): Matrix2D;
static TranslationToRef(x: number, y: number, result: Matrix2D): void;
static ScalingToRef(x: number, y: number, result: Matrix2D): void;
static RotationToRef(angle: number, result: Matrix2D): void;
private static _TempPreTranslationMatrix;
private static _TempPostTranslationMatrix;
private static _TempRotationMatrix;
private static _TempScalingMatrix;
private static _TempCompose0;
private static _TempCompose1;
private static _TempCompose2;
static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>, result: Matrix2D): void;
}
}
declare module BABYLON.GUI {
class ValueAndUnit {
unit: number;
negativeValueAllowed: boolean;
private _value;
ignoreAdaptiveScaling: boolean;
constructor(value: number, unit?: number, negativeValueAllowed?: boolean);
readonly isPercentage: boolean;
readonly isPixel: boolean;
readonly internalValue: number;
getValueInPixel(host: AdvancedDynamicTexture, refValue: number): number;
getValue(host: AdvancedDynamicTexture): number;
toString(host: AdvancedDynamicTexture): string;
fromString(source: string | number): boolean;
private static _Regex;
private static _UNITMODE_PERCENTAGE;
private static _UNITMODE_PIXEL;
static readonly UNITMODE_PERCENTAGE: number;
static readonly UNITMODE_PIXEL: number;
}
}
declare module BABYLON.GUI {
class Control {
name: string | undefined;
private _alpha;
private _alphaSet;
private _zIndex;
_root: Nullable<Container>;
_host: AdvancedDynamicTexture;
parent: Nullable<Container>;
_currentMeasure: Measure;
private _fontFamily;
private _fontStyle;
private _fontSize;
private _font;
_width: ValueAndUnit;
_height: ValueAndUnit;
protected _fontOffset: {
ascent: number;
height: number;
descent: number;
};
private _color;
protected _horizontalAlignment: number;
protected _verticalAlignment: number;
private _isDirty;
protected _cachedParentMeasure: Measure;
private _paddingLeft;
private _paddingRight;
private _paddingTop;
private _paddingBottom;
_left: ValueAndUnit;
_top: ValueAndUnit;
private _scaleX;
private _scaleY;
private _rotation;
private _transformCenterX;
private _transformCenterY;
private _transformMatrix;
protected _invertTransformMatrix: Matrix2D;
protected _transformedPosition: Vector2;
private _isMatrixDirty;
private _cachedOffsetX;
private _cachedOffsetY;
private _isVisible;
_linkedMesh: Nullable<AbstractMesh>;
private _fontSet;
private _dummyVector2;
private _downCount;
private _enterCount;
private _doNotRender;
isHitTestVisible: boolean;
isPointerBlocker: boolean;
isFocusInvisible: boolean;
shadowOffsetX: number;
shadowOffsetY: number;
shadowBlur: number;
shadowColor: string;
protected _linkOffsetX: ValueAndUnit;
protected _linkOffsetY: ValueAndUnit;
readonly typeName: string;
/**
* An event triggered when the pointer move over the control.
* @type {BABYLON.Observable}
*/
onPointerMoveObservable: Observable<Vector2>;
/**
* An event triggered when the pointer move out of the control.
* @type {BABYLON.Observable}
*/
onPointerOutObservable: Observable<Control>;
/**
* An event triggered when the pointer taps the control
* @type {BABYLON.Observable}
*/
onPointerDownObservable: Observable<Vector2WithInfo>;
/**
* An event triggered when pointer up
* @type {BABYLON.Observable}
*/
onPointerUpObservable: Observable<Vector2WithInfo>;
/**
* An event triggered when pointer enters the control
* @type {BABYLON.Observable}
*/
onPointerEnterObservable: Observable<Control>;
/**
* An event triggered when the control is marked as dirty
* @type {BABYLON.Observable}
*/
onDirtyObservable: Observable<Control>;
/**
* An event triggered after the control is drawn
* @type {BABYLON.Observable}
*/
onAfterDrawObservable: Observable<Control>;
alpha: number;
scaleX: number;
scaleY: number;
rotation: number;
transformCenterY: number;
transformCenterX: number;
horizontalAlignment: number;
verticalAlignment: number;
width: string | number;
readonly widthInPixels: number;
height: string | number;
readonly heightInPixels: number;
fontFamily: string;
fontStyle: string;
readonly fontSizeInPixels: number;
fontSize: string | number;
color: string;
zIndex: number;
notRenderable: boolean;
isVisible: boolean;
readonly isDirty: boolean;
paddingLeft: string | number;
readonly paddingLeftInPixels: number;
paddingRight: string | number;
readonly paddingRightInPixels: number;
paddingTop: string | number;
readonly paddingTopInPixels: number;
paddingBottom: string | number;
readonly paddingBottomInPixels: number;
left: string | number;
readonly leftInPixels: number;
top: string | number;
readonly topInPixels: number;
linkOffsetX: string | number;
readonly linkOffsetXInPixels: number;
linkOffsetY: string | number;
readonly linkOffsetYInPixels: number;
readonly centerX: number;
readonly centerY: number;
constructor(name?: string | undefined);
protected _getTypeName(): string;
getLocalCoordinates(globalCoordinates: Vector2): Vector2;
getLocalCoordinatesToRef(globalCoordinates: Vector2, result: Vector2): Control;
getParentLocalCoordinates(globalCoordinates: Vector2): Vector2;
moveToVector3(position: Vector3, scene: Scene): void;
linkWithMesh(mesh: Nullable<AbstractMesh>): void;
_moveToProjectedPosition(projectedPosition: Vector3): void;
_markMatrixAsDirty(): void;
_markAsDirty(): void;
_markAllAsDirty(): void;
_link(root: Nullable<Container>, host: AdvancedDynamicTexture): void;
protected _transform(context: CanvasRenderingContext2D): void;
protected _applyStates(context: CanvasRenderingContext2D): void;
protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
protected _clip(context: CanvasRenderingContext2D): void;
_measure(): void;
protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
contains(x: number, y: number): boolean;
_processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
_onPointerMove(target: Control, coordinates: Vector2): void;
_onPointerEnter(target: Control): boolean;
_onPointerOut(target: Control): void;
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
_onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
forcePointerUp(): void;
_processObservables(type: number, x: number, y: number, buttonIndex: number): boolean;
private _prepareFont();
dispose(): void;
private static _HORIZONTAL_ALIGNMENT_LEFT;
private static _HORIZONTAL_ALIGNMENT_RIGHT;
private static _HORIZONTAL_ALIGNMENT_CENTER;
private static _VERTICAL_ALIGNMENT_TOP;
private static _VERTICAL_ALIGNMENT_BOTTOM;
private static _VERTICAL_ALIGNMENT_CENTER;
static readonly HORIZONTAL_ALIGNMENT_LEFT: number;
static readonly HORIZONTAL_ALIGNMENT_RIGHT: number;
static readonly HORIZONTAL_ALIGNMENT_CENTER: number;
static readonly VERTICAL_ALIGNMENT_TOP: number;
static readonly VERTICAL_ALIGNMENT_BOTTOM: number;
static readonly VERTICAL_ALIGNMENT_CENTER: number;
private static _FontHeightSizes;
static _GetFontOffset(font: string): {
ascent: number;
height: number;
descent: number;
};
static AddHeader(control: Control, text: string, size: string | number, options: {
isHorizontal: boolean;
controlFirst: boolean;
}): StackPanel;
protected static drawEllipse(x: number, y: number, width: number, height: number, context: CanvasRenderingContext2D): void;
}
}
declare module BABYLON.GUI {
class Container extends Control {
name: string | undefined;
protected _children: Control[];
protected _measureForChildren: Measure;
protected _background: string;
background: string;
readonly children: Control[];
constructor(name?: string | undefined);
protected _getTypeName(): string;
getChildByName(name: string): Nullable<Control>;
getChildByType(name: string, type: string): Nullable<Control>;
containsControl(control: Control): boolean;
addControl(control: Control): Container;
removeControl(control: Control): Container;
_reOrderControl(control: Control): void;
_markMatrixAsDirty(): void;
_markAllAsDirty(): void;
protected _localDraw(context: CanvasRenderingContext2D): void;
_link(root: Nullable<Container>, host: AdvancedDynamicTexture): void;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
protected _clipForChildren(context: CanvasRenderingContext2D): void;
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
dispose(): void;
}
}
declare module BABYLON.GUI {
class StackPanel extends Container {
name: string | undefined;
private _isVertical;
private _manualWidth;
private _manualHeight;
private _doNotTrackManualChanges;
private _tempMeasureStore;
isVertical: boolean;
width: string | number;
height: string | number;
constructor(name?: string | undefined);
protected _getTypeName(): string;
protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
}
}
declare module BABYLON.GUI {
class Rectangle extends Container {
name: string | undefined;
private _thickness;
private _cornerRadius;
thickness: number;
cornerRadius: number;
constructor(name?: string | undefined);
protected _getTypeName(): string;
protected _localDraw(context: CanvasRenderingContext2D): void;
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
private _drawRoundedRect(context, offset?);
protected _clipForChildren(context: CanvasRenderingContext2D): void;
}
}
declare module BABYLON.GUI {
class Ellipse extends Container {
name: string | undefined;
private _thickness;
thickness: number;
constructor(name?: string | undefined);
protected _getTypeName(): string;
protected _localDraw(context: CanvasRenderingContext2D): void;
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
protected _clipForChildren(context: CanvasRenderingContext2D): void;
}
}
declare module BABYLON.GUI {
class Line extends Control {
name: string | undefined;
private _lineWidth;
private _x1;
private _y1;
private _x2;
private _y2;
private _dash;
private _connectedControl;
private _connectedControlDirtyObserver;
dash: Array<number>;
connectedControl: Control;
x1: string | number;
y1: string | number;
x2: string | number;
y2: string | number;
lineWidth: number;
horizontalAlignment: number;
verticalAlignment: number;
private readonly _effectiveX2;
private readonly _effectiveY2;
constructor(name?: string | undefined);
protected _getTypeName(): string;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_measure(): void;
protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_moveToProjectedPosition(projectedPosition: Vector3): void;
}
}
declare module BABYLON.GUI {
class Slider extends Control {
name: string | undefined;
private _thumbWidth;
private _minimum;
private _maximum;
private _value;
private _background;
private _borderColor;
private _barOffset;
private _isThumbCircle;
onValueChangedObservable: Observable<number>;
borderColor: string;
background: string;
barOffset: string | number;
readonly barOffsetInPixels: number;
thumbWidth: string | number;
readonly thumbWidthInPixels: number;
minimum: number;
maximum: number;
value: number;
isThumbCircle: boolean;
constructor(name?: string | undefined);
protected _getTypeName(): string;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
private _pointerIsDown;
private _updateValueFromPointer(x, y);
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
_onPointerMove(target: Control, coordinates: Vector2): void;
_onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
}
}
declare module BABYLON.GUI {
class Checkbox extends Control {
name: string | undefined;
private _isChecked;
private _background;
private _checkSizeRatio;
private _thickness;
thickness: number;
onIsCheckedChangedObservable: Observable<boolean>;
checkSizeRatio: number;
background: string;
isChecked: boolean;
constructor(name?: string | undefined);
protected _getTypeName(): string;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
}
}
declare module BABYLON.GUI {
class RadioButton extends Control {
name: string | undefined;
private _isChecked;
private _background;
private _checkSizeRatio;
private _thickness;
thickness: number;
group: string;
onIsCheckedChangedObservable: Observable<boolean>;
checkSizeRatio: number;
background: string;
isChecked: boolean;
constructor(name?: string | undefined);
protected _getTypeName(): string;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
}
}
declare module BABYLON.GUI {
class TextBlock extends Control {
name: string | undefined;
private _text;
private _textWrapping;
private _textHorizontalAlignment;
private _textVerticalAlignment;
private _lines;
private _resizeToFit;
/**
* An event triggered after the text is changed
* @type {BABYLON.Observable}
*/
onTextChangedObservable: Observable<TextBlock>;
resizeToFit: boolean;
textWrapping: boolean;
text: string;
textHorizontalAlignment: number;
textVerticalAlignment: number;
constructor(name?: string | undefined, text?: string);
protected _getTypeName(): string;
private _drawText(text, textWidth, y, context);
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
protected _parseLine(line: string | undefined, context: CanvasRenderingContext2D): object;
protected _parseLineWithTextWrapping(line: string | undefined, context: CanvasRenderingContext2D): object;
protected _renderLines(context: CanvasRenderingContext2D): void;
dispose(): void;
}
}
declare var DOMImage: new (width?: number | undefined, height?: number | undefined) => HTMLImageElement;
declare module BABYLON.GUI {
class Image extends Control {
name: string | undefined;
private _domImage;
private _imageWidth;
private _imageHeight;
private _loaded;
private _stretch;
private _source;
private _autoScale;
private _sourceLeft;
private _sourceTop;
private _sourceWidth;
private _sourceHeight;
private _cellWidth;
private _cellHeight;
private _cellId;
sourceLeft: number;
sourceTop: number;
sourceWidth: number;
sourceHeight: number;
autoScale: boolean;
stretch: number;
domImage: HTMLImageElement;
private _onImageLoaded();
source: Nullable<string>;
cellWidth: number;
cellHeight: number;
cellId: number;
constructor(name?: string | undefined, url?: Nullable<string>);
protected _getTypeName(): string;
synchronizeSizeWithContent(): void;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
private static _STRETCH_NONE;
private static _STRETCH_FILL;
private static _STRETCH_UNIFORM;
private static _STRETCH_EXTEND;
static readonly STRETCH_NONE: number;
static readonly STRETCH_FILL: number;
static readonly STRETCH_UNIFORM: number;
static readonly STRETCH_EXTEND: number;
}
}
declare module BABYLON.GUI {
class Button extends Rectangle {
name: string | undefined;
pointerEnterAnimation: () => void;
pointerOutAnimation: () => void;
pointerDownAnimation: () => void;
pointerUpAnimation: () => void;
constructor(name?: string | undefined);
protected _getTypeName(): string;
_processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
_onPointerEnter(target: Control): boolean;
_onPointerOut(target: Control): void;
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
_onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
static CreateImageButton(name: string, text: string, imageUrl: string): Button;
static CreateImageOnlyButton(name: string, imageUrl: string): Button;
static CreateSimpleButton(name: string, text: string): Button;
static CreateImageWithCenterTextButton(name: string, text: string, imageUrl: string): Button;
}
}
declare module BABYLON.GUI {
class ColorPicker extends Control {
name: string | undefined;
private _colorWheelCanvas;
private _value;
private _tmpColor;
private _pointerStartedOnSquare;
private _pointerStartedOnWheel;
private _squareLeft;
private _squareTop;
private _squareSize;
private _h;
private _s;
private _v;
onValueChangedObservable: Observable<Color3>;
value: Color3;
width: string | number;
height: string | number;
size: string | number;
constructor(name?: string | undefined);
protected _getTypeName(): string;
private _updateSquareProps();
private _drawGradientSquare(hueValue, left, top, width, height, context);
private _drawCircle(centerX, centerY, radius, context);
private _createColorWheelCanvas(radius, thickness);
private _RGBtoHSV(color, result);
private _HSVtoRGB(hue, saturation, value, result);
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
private _pointerIsDown;
private _updateValueFromPointer(x, y);
private _isPointOnSquare(coordinates);
private _isPointOnWheel(coordinates);
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
_onPointerMove(target: Control, coordinates: Vector2): void;
_onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
}
}
declare module BABYLON.GUI {
class InputText extends Control implements IFocusableControl {
name: string | undefined;
private _text;
private _placeholderText;
private _background;
private _focusedBackground;
private _placeholderColor;
private _thickness;
private _margin;
private _autoStretchWidth;
private _maxWidth;
private _isFocused;
private _blinkTimeout;
private _blinkIsEven;
private _cursorOffset;
private _scrollLeft;
private _textWidth;
private _clickedCoordinate;
promptMessage: string;
onTextChangedObservable: Observable<InputText>;
onFocusObservable: Observable<InputText>;
onBlurObservable: Observable<InputText>;
maxWidth: string | number;
readonly maxWidthInPixels: number;
margin: string;
readonly marginInPixels: number;
autoStretchWidth: boolean;
thickness: number;
focusedBackground: string;
background: string;
placeholderColor: string;
placeholderText: string;
text: string;
width: string | number;
constructor(name?: string | undefined, text?: string);
onBlur(): void;
onFocus(): void;
protected _getTypeName(): string;
processKey(keyCode: number, key?: string): void;
processKeyboard(evt: KeyboardEvent): void;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
_onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
dispose(): void;
}
}
declare module BABYLON.GUI {
class KeyPropertySet {
width?: string;
height?: string;
paddingLeft?: string;
paddingRight?: string;
paddingTop?: string;
paddingBottom?: string;
color?: string;
background?: string;
}
class VirtualKeyboard extends StackPanel {
onKeyPressObservable: Observable<string>;
defaultButtonWidth: string;
defaultButtonHeight: string;
defaultButtonPaddingLeft: string;
defaultButtonPaddingRight: string;
defaultButtonPaddingTop: string;
defaultButtonPaddingBottom: string;
defaultButtonColor: string;
defaultButtonBackground: string;
shiftButtonColor: string;
selectedShiftThickness: number;
shiftState: number;
protected _getTypeName(): string;
private _createKey(key, propertySet);
addKeysRow(keys: Array<string>, propertySets?: Array<KeyPropertySet>): void;
applyShiftState(shiftState: number): void;
private _connectedInputText;
private _onFocusObserver;
private _onBlurObserver;
private _onKeyPressObserver;
readonly connectedInputText: Nullable<InputText>;
connect(input: InputText): void;
disconnect(): void;
static CreateDefaultLayout(): VirtualKeyboard;
}
}
/// <reference types="babylonjs"/>
declare module 'babylonjs-gui' {
export = BABYLON.GUI;
}
declare module BABYLON.GUI {
interface IFocusableControl {
onFocus(): void;
onBlur(): void;
processKeyboard(evt: KeyboardEvent): void;
}
class AdvancedDynamicTexture extends DynamicTexture {
private _isDirty;
private _renderObserver;
private _resizeObserver;
private _preKeyboardObserver;
private _pointerMoveObserver;
private _pointerObserver;
private _canvasPointerOutObserver;
private _background;
_rootContainer: Container;
_lastPickedControl: Control;
_lastControlOver: Nullable<Control>;
_lastControlDown: Nullable<Control>;
_capturingControl: Nullable<Control>;
_shouldBlockPointer: boolean;
_layerToDispose: Nullable<Layer>;
_linkedControls: Control[];
private _isFullscreen;
private _fullscreenViewport;
private _idealWidth;
private _idealHeight;
private _renderAtIdealSize;
private _focusedControl;
private _blockNextFocusCheck;
private _renderScale;
renderScale: number;
background: string;
idealWidth: number;
idealHeight: number;
renderAtIdealSize: boolean;
readonly layer: Nullable<Layer>;
readonly rootContainer: Container;
focusedControl: Nullable<IFocusableControl>;
isForeground: boolean;
constructor(name: string, width: number | undefined, height: number | undefined, scene: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number);
executeOnAllControls(func: (control: Control) => void, container?: Container): void;
markAsDirty(): void;
addControl(control: Control): AdvancedDynamicTexture;
removeControl(control: Control): AdvancedDynamicTexture;
dispose(): void;
private _onResize();
_getGlobalViewport(scene: Scene): Viewport;
private _checkUpdate(camera);
private _render();
private _doPicking(x, y, type, buttonIndex);
attach(): void;
attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
moveFocusToControl(control: IFocusableControl): void;
private _manageFocus();
private _attachToOnPointerOut(scene);
static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean): AdvancedDynamicTexture;
static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number): AdvancedDynamicTexture;
}
}
declare module BABYLON.GUI {
class Measure {
left: number;
top: number;
width: number;
height: number;
constructor(left: number, top: number, width: number, height: number);
copyFrom(other: Measure): void;
isEqualsTo(other: Measure): boolean;
static Empty(): Measure;
}
}
declare module BABYLON.GUI {
class Vector2WithInfo extends Vector2 {
buttonIndex: number;
constructor(source: Vector2, buttonIndex?: number);
}
class Matrix2D {
m: Float32Array;
constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number);
fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D;
determinant(): number;
invertToRef(result: Matrix2D): Matrix2D;
multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D;
transformCoordinates(x: number, y: number, result: Vector2): Matrix2D;
static Identity(): Matrix2D;
static TranslationToRef(x: number, y: number, result: Matrix2D): void;
static ScalingToRef(x: number, y: number, result: Matrix2D): void;
static RotationToRef(angle: number, result: Matrix2D): void;
private static _TempPreTranslationMatrix;
private static _TempPostTranslationMatrix;
private static _TempRotationMatrix;
private static _TempScalingMatrix;
private static _TempCompose0;
private static _TempCompose1;
private static _TempCompose2;
static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>, result: Matrix2D): void;
}
}
declare module BABYLON.GUI {
class ValueAndUnit {
unit: number;
negativeValueAllowed: boolean;
private _value;
ignoreAdaptiveScaling: boolean;
constructor(value: number, unit?: number, negativeValueAllowed?: boolean);
readonly isPercentage: boolean;
readonly isPixel: boolean;
readonly internalValue: number;
getValueInPixel(host: AdvancedDynamicTexture, refValue: number): number;
getValue(host: AdvancedDynamicTexture): number;
toString(host: AdvancedDynamicTexture): string;
fromString(source: string | number): boolean;
private static _Regex;
private static _UNITMODE_PERCENTAGE;
private static _UNITMODE_PIXEL;
static readonly UNITMODE_PERCENTAGE: number;
static readonly UNITMODE_PIXEL: number;
}
}
declare module BABYLON.GUI {
class Control {
name: string | undefined;
private _alpha;
private _alphaSet;
private _zIndex;
_root: Nullable<Container>;
_host: AdvancedDynamicTexture;
parent: Nullable<Container>;
_currentMeasure: Measure;
private _fontFamily;
private _fontStyle;
private _fontSize;
private _font;
_width: ValueAndUnit;
_height: ValueAndUnit;
protected _fontOffset: {
ascent: number;
height: number;
descent: number;
};
private _color;
protected _horizontalAlignment: number;
protected _verticalAlignment: number;
private _isDirty;
protected _cachedParentMeasure: Measure;
private _paddingLeft;
private _paddingRight;
private _paddingTop;
private _paddingBottom;
_left: ValueAndUnit;
_top: ValueAndUnit;
private _scaleX;
private _scaleY;
private _rotation;
private _transformCenterX;
private _transformCenterY;
private _transformMatrix;
protected _invertTransformMatrix: Matrix2D;
protected _transformedPosition: Vector2;
private _isMatrixDirty;
private _cachedOffsetX;
private _cachedOffsetY;
private _isVisible;
_linkedMesh: Nullable<AbstractMesh>;
private _fontSet;
private _dummyVector2;
private _downCount;
private _enterCount;
private _doNotRender;
isHitTestVisible: boolean;
isPointerBlocker: boolean;
isFocusInvisible: boolean;
shadowOffsetX: number;
shadowOffsetY: number;
shadowBlur: number;
shadowColor: string;
protected _linkOffsetX: ValueAndUnit;
protected _linkOffsetY: ValueAndUnit;
readonly typeName: string;
/**
* An event triggered when the pointer move over the control.
* @type {BABYLON.Observable}
*/
onPointerMoveObservable: Observable<Vector2>;
/**
* An event triggered when the pointer move out of the control.
* @type {BABYLON.Observable}
*/
onPointerOutObservable: Observable<Control>;
/**
* An event triggered when the pointer taps the control
* @type {BABYLON.Observable}
*/
onPointerDownObservable: Observable<Vector2WithInfo>;
/**
* An event triggered when pointer up
* @type {BABYLON.Observable}
*/
onPointerUpObservable: Observable<Vector2WithInfo>;
/**
* An event triggered when pointer enters the control
* @type {BABYLON.Observable}
*/
onPointerEnterObservable: Observable<Control>;
/**
* An event triggered when the control is marked as dirty
* @type {BABYLON.Observable}
*/
onDirtyObservable: Observable<Control>;
/**
* An event triggered after the control is drawn
* @type {BABYLON.Observable}
*/
onAfterDrawObservable: Observable<Control>;
alpha: number;
scaleX: number;
scaleY: number;
rotation: number;
transformCenterY: number;
transformCenterX: number;
horizontalAlignment: number;
verticalAlignment: number;
width: string | number;
readonly widthInPixels: number;
height: string | number;
readonly heightInPixels: number;
fontFamily: string;
fontStyle: string;
readonly fontSizeInPixels: number;
fontSize: string | number;
color: string;
zIndex: number;
notRenderable: boolean;
isVisible: boolean;
readonly isDirty: boolean;
paddingLeft: string | number;
readonly paddingLeftInPixels: number;
paddingRight: string | number;
readonly paddingRightInPixels: number;
paddingTop: string | number;
readonly paddingTopInPixels: number;
paddingBottom: string | number;
readonly paddingBottomInPixels: number;
left: string | number;
readonly leftInPixels: number;
top: string | number;
readonly topInPixels: number;
linkOffsetX: string | number;
readonly linkOffsetXInPixels: number;
linkOffsetY: string | number;
readonly linkOffsetYInPixels: number;
readonly centerX: number;
readonly centerY: number;
constructor(name?: string | undefined);
protected _getTypeName(): string;
getLocalCoordinates(globalCoordinates: Vector2): Vector2;
getLocalCoordinatesToRef(globalCoordinates: Vector2, result: Vector2): Control;
getParentLocalCoordinates(globalCoordinates: Vector2): Vector2;
moveToVector3(position: Vector3, scene: Scene): void;
linkWithMesh(mesh: Nullable<AbstractMesh>): void;
_moveToProjectedPosition(projectedPosition: Vector3): void;
_markMatrixAsDirty(): void;
_markAsDirty(): void;
_markAllAsDirty(): void;
_link(root: Nullable<Container>, host: AdvancedDynamicTexture): void;
protected _transform(context: CanvasRenderingContext2D): void;
protected _applyStates(context: CanvasRenderingContext2D): void;
protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
protected _clip(context: CanvasRenderingContext2D): void;
_measure(): void;
protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
contains(x: number, y: number): boolean;
_processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
_onPointerMove(target: Control, coordinates: Vector2): void;
_onPointerEnter(target: Control): boolean;
_onPointerOut(target: Control): void;
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
_onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
forcePointerUp(): void;
_processObservables(type: number, x: number, y: number, buttonIndex: number): boolean;
private _prepareFont();
dispose(): void;
private static _HORIZONTAL_ALIGNMENT_LEFT;
private static _HORIZONTAL_ALIGNMENT_RIGHT;
private static _HORIZONTAL_ALIGNMENT_CENTER;
private static _VERTICAL_ALIGNMENT_TOP;
private static _VERTICAL_ALIGNMENT_BOTTOM;
private static _VERTICAL_ALIGNMENT_CENTER;
static readonly HORIZONTAL_ALIGNMENT_LEFT: number;
static readonly HORIZONTAL_ALIGNMENT_RIGHT: number;
static readonly HORIZONTAL_ALIGNMENT_CENTER: number;
static readonly VERTICAL_ALIGNMENT_TOP: number;
static readonly VERTICAL_ALIGNMENT_BOTTOM: number;
static readonly VERTICAL_ALIGNMENT_CENTER: number;
private static _FontHeightSizes;
static _GetFontOffset(font: string): {
ascent: number;
height: number;
descent: number;
};
static AddHeader(control: Control, text: string, size: string | number, options: {
isHorizontal: boolean;
controlFirst: boolean;
}): StackPanel;
protected static drawEllipse(x: number, y: number, width: number, height: number, context: CanvasRenderingContext2D): void;
}
}
declare module BABYLON.GUI {
class Container extends Control {
name: string | undefined;
protected _children: Control[];
protected _measureForChildren: Measure;
protected _background: string;
background: string;
readonly children: Control[];
constructor(name?: string | undefined);
protected _getTypeName(): string;
getChildByName(name: string): Nullable<Control>;
getChildByType(name: string, type: string): Nullable<Control>;
containsControl(control: Control): boolean;
addControl(control: Control): Container;
removeControl(control: Control): Container;
_reOrderControl(control: Control): void;
_markMatrixAsDirty(): void;
_markAllAsDirty(): void;
protected _localDraw(context: CanvasRenderingContext2D): void;
_link(root: Nullable<Container>, host: AdvancedDynamicTexture): void;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
protected _clipForChildren(context: CanvasRenderingContext2D): void;
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
dispose(): void;
}
}
declare module BABYLON.GUI {
class StackPanel extends Container {
name: string | undefined;
private _isVertical;
private _manualWidth;
private _manualHeight;
private _doNotTrackManualChanges;
private _tempMeasureStore;
isVertical: boolean;
width: string | number;
height: string | number;
constructor(name?: string | undefined);
protected _getTypeName(): string;
protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
}
}
declare module BABYLON.GUI {
class Rectangle extends Container {
name: string | undefined;
private _thickness;
private _cornerRadius;
thickness: number;
cornerRadius: number;
constructor(name?: string | undefined);
protected _getTypeName(): string;
protected _localDraw(context: CanvasRenderingContext2D): void;
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
private _drawRoundedRect(context, offset?);
protected _clipForChildren(context: CanvasRenderingContext2D): void;
}
}
declare module BABYLON.GUI {
class Ellipse extends Container {
name: string | undefined;
private _thickness;
thickness: number;
constructor(name?: string | undefined);
protected _getTypeName(): string;
protected _localDraw(context: CanvasRenderingContext2D): void;
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
protected _clipForChildren(context: CanvasRenderingContext2D): void;
}
}
declare module BABYLON.GUI {
class Line extends Control {
name: string | undefined;
private _lineWidth;
private _x1;
private _y1;
private _x2;
private _y2;
private _dash;
private _connectedControl;
private _connectedControlDirtyObserver;
dash: Array<number>;
connectedControl: Control;
x1: string | number;
y1: string | number;
x2: string | number;
y2: string | number;
lineWidth: number;
horizontalAlignment: number;
verticalAlignment: number;
private readonly _effectiveX2;
private readonly _effectiveY2;
constructor(name?: string | undefined);
protected _getTypeName(): string;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_measure(): void;
protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_moveToProjectedPosition(projectedPosition: Vector3): void;
}
}
declare module BABYLON.GUI {
class Slider extends Control {
name: string | undefined;
private _thumbWidth;
private _minimum;
private _maximum;
private _value;
private _background;
private _borderColor;
private _barOffset;
private _isThumbCircle;
onValueChangedObservable: Observable<number>;
borderColor: string;
background: string;
barOffset: string | number;
readonly barOffsetInPixels: number;
thumbWidth: string | number;
readonly thumbWidthInPixels: number;
minimum: number;
maximum: number;
value: number;
isThumbCircle: boolean;
constructor(name?: string | undefined);
protected _getTypeName(): string;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
private _pointerIsDown;
private _updateValueFromPointer(x, y);
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
_onPointerMove(target: Control, coordinates: Vector2): void;
_onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
}
}
declare module BABYLON.GUI {
class Checkbox extends Control {
name: string | undefined;
private _isChecked;
private _background;
private _checkSizeRatio;
private _thickness;
thickness: number;
onIsCheckedChangedObservable: Observable<boolean>;
checkSizeRatio: number;
background: string;
isChecked: boolean;
constructor(name?: string | undefined);
protected _getTypeName(): string;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
}
}
declare module BABYLON.GUI {
class RadioButton extends Control {
name: string | undefined;
private _isChecked;
private _background;
private _checkSizeRatio;
private _thickness;
thickness: number;
group: string;
onIsCheckedChangedObservable: Observable<boolean>;
checkSizeRatio: number;
background: string;
isChecked: boolean;
constructor(name?: string | undefined);
protected _getTypeName(): string;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
}
}
declare module BABYLON.GUI {
class TextBlock extends Control {
name: string | undefined;
private _text;
private _textWrapping;
private _textHorizontalAlignment;
private _textVerticalAlignment;
private _lines;
private _resizeToFit;
/**
* An event triggered after the text is changed
* @type {BABYLON.Observable}
*/
onTextChangedObservable: Observable<TextBlock>;
resizeToFit: boolean;
textWrapping: boolean;
text: string;
textHorizontalAlignment: number;
textVerticalAlignment: number;
constructor(name?: string | undefined, text?: string);
protected _getTypeName(): string;
private _drawText(text, textWidth, y, context);
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
protected _parseLine(line: string | undefined, context: CanvasRenderingContext2D): object;
protected _parseLineWithTextWrapping(line: string | undefined, context: CanvasRenderingContext2D): object;
protected _renderLines(context: CanvasRenderingContext2D): void;
dispose(): void;
}
}
declare var DOMImage: new (width?: number | undefined, height?: number | undefined) => HTMLImageElement;
declare module BABYLON.GUI {
class Image extends Control {
name: string | undefined;
private _domImage;
private _imageWidth;
private _imageHeight;
private _loaded;
private _stretch;
private _source;
private _autoScale;
private _sourceLeft;
private _sourceTop;
private _sourceWidth;
private _sourceHeight;
private _cellWidth;
private _cellHeight;
private _cellId;
sourceLeft: number;
sourceTop: number;
sourceWidth: number;
sourceHeight: number;
autoScale: boolean;
stretch: number;
domImage: HTMLImageElement;
private _onImageLoaded();
source: Nullable<string>;
cellWidth: number;
cellHeight: number;
cellId: number;
constructor(name?: string | undefined, url?: Nullable<string>);
protected _getTypeName(): string;
synchronizeSizeWithContent(): void;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
private static _STRETCH_NONE;
private static _STRETCH_FILL;
private static _STRETCH_UNIFORM;
private static _STRETCH_EXTEND;
static readonly STRETCH_NONE: number;
static readonly STRETCH_FILL: number;
static readonly STRETCH_UNIFORM: number;
static readonly STRETCH_EXTEND: number;
}
}
declare module BABYLON.GUI {
class Button extends Rectangle {
name: string | undefined;
pointerEnterAnimation: () => void;
pointerOutAnimation: () => void;
pointerDownAnimation: () => void;
pointerUpAnimation: () => void;
constructor(name?: string | undefined);
protected _getTypeName(): string;
_processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
_onPointerEnter(target: Control): boolean;
_onPointerOut(target: Control): void;
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
_onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
static CreateImageButton(name: string, text: string, imageUrl: string): Button;
static CreateImageOnlyButton(name: string, imageUrl: string): Button;
static CreateSimpleButton(name: string, text: string): Button;
static CreateImageWithCenterTextButton(name: string, text: string, imageUrl: string): Button;
}
}
declare module BABYLON.GUI {
class ColorPicker extends Control {
name: string | undefined;
private _colorWheelCanvas;
private _value;
private _tmpColor;
private _pointerStartedOnSquare;
private _pointerStartedOnWheel;
private _squareLeft;
private _squareTop;
private _squareSize;
private _h;
private _s;
private _v;
onValueChangedObservable: Observable<Color3>;
value: Color3;
width: string | number;
height: string | number;
size: string | number;
constructor(name?: string | undefined);
protected _getTypeName(): string;
private _updateSquareProps();
private _drawGradientSquare(hueValue, left, top, width, height, context);
private _drawCircle(centerX, centerY, radius, context);
private _createColorWheelCanvas(radius, thickness);
private _RGBtoHSV(color, result);
private _HSVtoRGB(hue, saturation, value, result);
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
private _pointerIsDown;
private _updateValueFromPointer(x, y);
private _isPointOnSquare(coordinates);
private _isPointOnWheel(coordinates);
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
_onPointerMove(target: Control, coordinates: Vector2): void;
_onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
}
}
declare module BABYLON.GUI {
class InputText extends Control implements IFocusableControl {
name: string | undefined;
private _text;
private _placeholderText;
private _background;
private _focusedBackground;
private _placeholderColor;
private _thickness;
private _margin;
private _autoStretchWidth;
private _maxWidth;
private _isFocused;
private _blinkTimeout;
private _blinkIsEven;
private _cursorOffset;
private _scrollLeft;
private _textWidth;
private _clickedCoordinate;
promptMessage: string;
onTextChangedObservable: Observable<InputText>;
onFocusObservable: Observable<InputText>;
onBlurObservable: Observable<InputText>;
maxWidth: string | number;
readonly maxWidthInPixels: number;
margin: string;
readonly marginInPixels: number;
autoStretchWidth: boolean;
thickness: number;
focusedBackground: string;
background: string;
placeholderColor: string;
placeholderText: string;
text: string;
width: string | number;
constructor(name?: string | undefined, text?: string);
onBlur(): void;
onFocus(): void;
protected _getTypeName(): string;
processKey(keyCode: number, key?: string): void;
processKeyboard(evt: KeyboardEvent): void;
_draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
_onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
_onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
dispose(): void;
}
}
declare module BABYLON.GUI {
class KeyPropertySet {
width?: string;
height?: string;
paddingLeft?: string;
paddingRight?: string;
paddingTop?: string;
paddingBottom?: string;
color?: string;
background?: string;
}
class VirtualKeyboard extends StackPanel {
onKeyPressObservable: Observable<string>;
defaultButtonWidth: string;
defaultButtonHeight: string;
defaultButtonPaddingLeft: string;
defaultButtonPaddingRight: string;
defaultButtonPaddingTop: string;
defaultButtonPaddingBottom: string;
defaultButtonColor: string;
defaultButtonBackground: string;
shiftButtonColor: string;
selectedShiftThickness: number;
shiftState: number;
protected _getTypeName(): string;
private _createKey(key, propertySet);
addKeysRow(keys: Array<string>, propertySets?: Array<KeyPropertySet>): void;
applyShiftState(shiftState: number): void;
private _connectedInputText;
private _onFocusObserver;
private _onBlurObserver;
private _onKeyPressObserver;
readonly connectedInputText: Nullable<InputText>;
connect(input: InputText): void;
disconnect(): void;
static CreateDefaultLayout(): VirtualKeyboard;
}
}
// Type definitions for tween.js r12
// Project: https://github.com/sole/tween.js/
// Definitions by: sunetos <https://github.com/sunetos>, jzarnikov <https://github.com/jzarnikov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module TWEEN {
export var REVISION: string;
export function getAll(): Tween[];
export function removeAll(): void;
export function add(tween:Tween): void;
export function remove(tween:Tween): void;
export function update(time?:number): boolean;
export class Tween {
constructor(object?:any);
to(properties:any, duration:number): Tween;
start(time?:number): Tween;
stop(): Tween;
delay(amount:number): Tween;
easing(easing: (k: number) => number): Tween;
interpolation(interpolation: (v:number[], k:number) => number): Tween;
chain(...tweens:Tween[]): Tween;
onStart(callback: (object?: any) => void): Tween;
onUpdate(callback: (object?: any) => void): Tween;
onComplete(callback: (object?: any) => void): Tween;
update(time: number): boolean;
repeat(times: number): Tween;
yoyo(enable: boolean): Tween;
}
export var Easing: TweenEasing;
export var Interpolation: TweenInterpolation;
}
interface TweenEasing {
Linear: {
None(k:number): number;
};
Quadratic: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Cubic: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Quartic: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Quintic: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Sinusoidal: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Exponential: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Circular: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Elastic: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Back: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Bounce: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
}
interface TweenInterpolation {
Linear(v:number[], k:number): number;
Bezier(v:number[], k:number): number;
CatmullRom(v:number[], k:number): number;
Utils: {
Linear(p0:number, p1:number, t:number): number;
Bernstein(n:number, i:number): number;
Factorial(n): number;
};
}
{
"name": "sl",
"version": "1.0.0",
"description": "基于babylonjs的活动组件",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"scripts": {
},
"author": "",
"license": "ISC",
"dependencies": {
"yt": "git+ssh://git@gitlab2.dui88.com:renjianfeng/yt.git",
"tw": "git+ssh://git@gitlab2.dui88.com:clq/tw.git#1.0"
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/13
*/
export enum ModuleName {
//游戏规则面板
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 {GuiManager} from "yt";
import {PanelModule} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {SysLang} from "../../util/Syslang";
import { RuleModel, TwFun } from "tw";
import {GuiCreate} from "yt";
export class RuleModule extends PanelModule {
/**
* 数据
*/
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>`;
GuiCreate.ins.preventDefault(this.section)
}
protected appendHtml(){
document.body.appendChild(this.section);
}
public init(){
DisplayPool.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 {Module} from "yt";
import {AnimationGui} from "yt";
import {SceneManager} from "yt";
import {GuiManager} from "yt";
import {DisplayPool} from "yt";
import { GameEndModel, TwFun } from "tw";
import { ModuleName } from "../../enum/ModuleName";
import { WxLang } from "../../util/WxLang";
import {ModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameEndModule extends Module {
//面板隐藏显示实例
protected panelsAn=new AnimationGui(SceneManager.ins.scene,GuiManager.ins.fullscreenUI)
public init(){
DisplayPool.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;
}
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 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 {GuiManager} from "yt";
import {PanelModule} from "yt";
import {AnimationGui} from "yt";
import {GuiCreate} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameEndRankModel, TwFun } from "tw";
export class GameEndRankModule extends PanelModule {
//奖品列表
protected optionsList;
//dom模板
protected viewNode;
//页面模板
protected listTemplate(config,data){
var item=new BABYLON.GUI.Rectangle("sssd");
return item
};
//页面HTML模板
protected listTemplateHtml(data,config){
}
/**
* 数据
*/
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=[];
//面板隐藏显示实例
protected panelsAn=new AnimationGui(SceneManager.ins.scene,GuiManager.ins.fullscreenUI)
constructor(){
super()
this.initUI();
}
protected htmlCreate(config,data){
this.listTemplateHtml(this.model.rankList,this.uiConfig)
document.body.appendChild(this.viewNode);
GuiCreate.ins.preventDefault(this.viewNode)
}
/**
* 打开后
* */
protected onOpened(...args){
this.optionsList=this.htmlCreate(this.uiConfig,this.model.rankList)
}
public init(){
DisplayPool.ins.displayPool[ModuleName.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 {ModuleName} from "../../enum/ModuleName";
import {DisplayPool} from "yt";
export class GameGuiModule extends Module {
constructor(){
super()
}
public init(){
DisplayPool.ins.displayPool[ModuleName.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 {DisplayPool} from "yt";
import { ModuleName } from "../../enum/ModuleName";
import {ModuleManager} from "yt";
import { GCache } from 'tc';
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameGuideModule extends Module {
protected totalFrames=1;
public init(){
DisplayPool.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 {PanelModule} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {ModuleManager} from "yt";
import { GameLoseModel } from 'tw';
export class GameLoseModule extends PanelModule {
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(){
DisplayPool.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)
ModuleManager.ins.openModule(ModuleName.GAME_START_GUI);
}
}
\ No newline at end of file
import {GuiManager} from "yt";
import {PanelModule} from "yt";
import {GuiCreate} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameOptionModel, TwFun } from "tw";
export class GameOptionModule extends PanelModule {
//奖品列表
protected optionsList;
//页面模板
protected listTemplate(config,data){
var item=new BABYLON.GUI.Rectangle("item");
return item
};
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void {
this.model = new GameOptionModel();
}
//UI配置
protected uiConfig={
bodyWidth:"440px",
bodyHeight:"680px",
bodyTop:"260px",
bodyLeft:"260px",
isVertical:true,
}
/**
* 打开前
* */
protected onOpen(...args){
this.optionsList=GuiCreate.ins.optionsListCon(this.uiConfig,this.model.optionList,this.listTemplate)
this.view.view.addControl(this.optionsList)
GuiManager.ins.appendGui(this.parent);
}
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(){
this.view.view.removeControl(this.optionsList)
}
}
\ No newline at end of file
import {GuiManager} from "yt";
import {PanelModule} from "yt";
import {GuiCreate} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameRealTimeRankModel, TwFun } from "tw";
export class GameRealTimeRankModule extends PanelModule {
//排行榜
protected optionsList;
//页面模板
protected listTemplate(config,data){
var item=new BABYLON.GUI.Rectangle("item");
return item
};
/**
* 数据
*/
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()
this.initUI();
}
/**
* 打开前
* */
protected onOpen(...args){
super.onOpen(...args)
this.optionsList=GuiCreate.ins.optionsListCon(this.uiConfig,this.model.userList,this.listTemplate)
this.view.view.addControl(this.optionsList)
GuiManager.ins.appendGui(this.parent);
}
public init(){
DisplayPool.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;
}
}
\ No newline at end of file
import {Module} from "yt";
import {SceneManager} from "yt";
import {ModuleManager} from "yt";
import {YtModuleName} from "yt";
import {YtLang} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GamePlayModel } from "tw";
export class GameSceneModule extends Module{
/**
* 是否校验积分
*/
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){
ModuleManager.ins.closeModule(YtModuleName.WAITING_PANEL);
ModuleManager.ins.openModule(ModuleName.GAME_PLAY_GUI);
onSuccess(_meshes,_skeletons)
}
} catch (e) {
console.error(e)
}
}
);
})
}
}
\ No newline at end of file
import {Module} from "yt";
import {DisplayPool} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import {ModuleManager} from "yt";
import { GameStartModel, TwFun } from "tw";
import { IModuleData, GCache, GFun, GDispatcher } from 'tc';
export class GameStartModule extends Module {
/**
* 数据
*/
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();
//this.updateExemptionTxt();
}
}
/* GuiCreate.ins.optionsList({
bodyWidth:"520px",
bodyHeight:"170px",
bodyTop:"-100px",
itemWidth:"130px",
itemHeight:"170px",
itemPaddingRight:"30px",
logoWidth:"100px",
logoHeight:"100px",
logoTop:"0px",
logoLeft:"0px",
textWidth:"100px",
textHeight:"30px",
textTop:"140px",
textLeft:"0px",
textColor:"#ffffff",
isVertical:false,
},data,this.parent)*/
\ No newline at end of file
import {PanelModule} from "yt";
import {DisplayPool} from "yt";
import {ModuleManager} from "yt";
import {ModuleName} from "../../enum/ModuleName";
import { GameWinModel } from 'tw';
export class GameWinModule extends PanelModule {
//分数
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 {Module} from "yt";
import {DisplayPool} from "yt";
import { GameWinnerModel, TwFun } from "tw";
import { ModuleName } from "../../enum/ModuleName";
import {ModuleManager} from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export class GameWinnerModule extends Module {
public init(){
DisplayPool.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
export class SysLang {
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 WxLang {
// 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
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"noImplicitAny": false,
"noEmitOnError": true,
"declarationDir": "./types",
"declaration": true,
"outDir": "./dist",
"skipLibCheck": true
},
"exclude": [
"node_modules",
"dist",
"types"
]
}
\ No newline at end of file
exports.__esModule = true;
exports.rules = {
"only-arrow-functions": true,
"no-namespace": true,
"no-var-keyword": true,
"prefer-const": true,
"no-conditional-assignment": true,
"prefer-for-of": true,
"no-inferrable-types": true,
"cyclomatic-complexity": [true, 20],
"max-line-length": [true, 150],
"max-file-line-count": [true, 500],
"max-classes-per-file": [true, 6],
"adjacent-overload-signatures": true,
"member-access":true,
"no-non-null-assertion": true,
"no-consecutive-blank-lines": true,
"no-unused-expression": [true, "allow-fast-null-checks"],
"no-duplicate-super": true,
"no-import-side-effect": true
};
\ No newline at end of file
{
"defaultSeverity": "error",
"extends": [
// "tslint:recommended"
"./tslint-config"
],
"jsRules": {},
"rules": {},
"rulesDirectory": []
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/13
*/
export declare enum ModuleName {
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 { 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 { GameSceneModule, GameOptionModule, RuleModule, GameWinModule, GameLoseModule, GameStartModule, GameGuiModule, GameRealTimeRankModule, GameEndModule, GameWinnerModule, GameEndRankModule, GameGuideModule, ModuleName, WxLang, SysLang };
import { PanelModule } from "yt";
import { RuleModel } from "tw";
export declare class RuleModule extends PanelModule {
/**
* 数据
*/
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 { Module } from "yt";
import { AnimationGui } from "yt";
import { GameEndModel } from "tw";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export declare class GameEndModule extends Module {
protected panelsAn: AnimationGui;
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 { PanelModule } from "yt";
import { AnimationGui } from "yt";
import { GameEndRankModel } from "tw";
export declare class GameEndRankModule extends PanelModule {
protected optionsList: any;
protected viewNode: any;
protected listTemplate(config: any, data: any): BABYLON.GUI.Rectangle;
protected listTemplateHtml(data: any, config: any): void;
/**
* 数据
*/
protected model: GameEndRankModel;
protected initModel(): void;
protected uiConfig: {
bodyWidth: string;
bodyHeight: string;
bodyTop: string;
bodyLeft: string;
isVertical: boolean;
};
protected doEvents: any[];
protected panelsAn: AnimationGui;
constructor();
protected htmlCreate(config: any, data: any): void;
/**
* 打开后
* */
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 { Module } from "yt";
export declare class GameGuiModule extends Module {
constructor();
init(): void;
/**
* 添加事件
* */
protected addEvent(): void;
protected removeEvent(): void;
/**
* 更新页面
* @param args
*/
updateData(...args: any[]): void;
}
import { Module } from "yt";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export declare class GameGuideModule extends Module {
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 { PanelModule } from "yt";
import { GameLoseModel } from 'tw';
export declare class GameLoseModule extends PanelModule {
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 { PanelModule } from "yt";
import { GameOptionModel } from "tw";
export declare class GameOptionModule extends PanelModule {
protected optionsList: any;
protected listTemplate(config: any, data: any): BABYLON.GUI.Rectangle;
/**
* 数据
*/
protected model: GameOptionModel;
protected initModel(): void;
protected uiConfig: {
bodyWidth: string;
bodyHeight: string;
bodyTop: string;
bodyLeft: string;
isVertical: boolean;
};
/**
* 打开前
* */
protected onOpen(...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 { PanelModule } from "yt";
import { GameRealTimeRankModel } from "tw";
export declare class GameRealTimeRankModule extends PanelModule {
protected optionsList: any;
protected listTemplate(config: any, data: any): BABYLON.GUI.Rectangle;
/**
* 数据
*/
protected model: GameRealTimeRankModel;
protected initModel(): void;
protected uiConfig: {
bodyWidth: string;
bodyHeight: string;
bodyTop: string;
bodyLeft: string;
isVertical: boolean;
};
constructor();
/**
* 打开前
* */
protected onOpen(...args: any[]): void;
init(): void;
/**
* 添加事件
* */
protected addEvent(): void;
protected onClick_closeBtn(e: any): void;
protected removeEvent(): void;
/**
* 更新页面
* @param args
*/
updateData(...args: any[]): void;
}
import { Module } from "yt";
import { GamePlayModel } from "tw";
export declare class GameSceneModule extends Module {
/**
* 是否校验积分
*/
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 { Module } from "yt";
import { GameStartModel } from "tw";
export declare class GameStartModule extends Module {
/**
* 数据
*/
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 { PanelModule } from "yt";
import { GameWinModel } from 'tw';
export declare class GameWinModule extends PanelModule {
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 { Module } from "yt";
import { GameWinnerModel } from "tw";
/**
*Created by cuiliqiang on 2018/3/16
* 游戏结束场景
*/
export declare class GameWinnerModule extends Module {
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 SysLang {
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;
}
export declare class WxLang {
static lang_003: string;
static lang_004: string;
static lang_005: string;
static lang_006: 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