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 diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// 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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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
This diff is collapsed.
This diff is collapsed.
{
"defaultSeverity": "error",
"extends": [
// "tslint:recommended"
"./tslint-config"
],
"jsRules": {},
"rules": {},
"rulesDirectory": []
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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