Commit 9cabd2df authored by Edwise's avatar Edwise 🍷

1234

parent 11266a70
...@@ -2138,6 +2138,7 @@ var RES_1 = __webpack_require__(/*! ../module/RES */ "./module/RES.ts"); ...@@ -2138,6 +2138,7 @@ var RES_1 = __webpack_require__(/*! ../module/RES */ "./module/RES.ts");
var resCanvasList_1 = __webpack_require__(/*! ../resCanvasList */ "./resCanvasList.js"); var resCanvasList_1 = __webpack_require__(/*! ../resCanvasList */ "./resCanvasList.js");
var Main_1 = __webpack_require__(/*! ./Main */ "./src/Main.ts"); var Main_1 = __webpack_require__(/*! ./Main */ "./src/Main.ts");
var TaoBaoNet_1 = __webpack_require__(/*! ./TaoBaoNet */ "./src/TaoBaoNet.ts"); var TaoBaoNet_1 = __webpack_require__(/*! ./TaoBaoNet */ "./src/TaoBaoNet.ts");
var button_1 = __webpack_require__(/*! ./ui/button */ "./src/ui/button.ts");
var Ins = (function () { var Ins = (function () {
function Ins() { function Ins() {
} }
...@@ -2181,6 +2182,20 @@ var Ins = (function () { ...@@ -2181,6 +2182,20 @@ var Ins = (function () {
btn.y = y; btn.y = y;
return btn; return btn;
}; };
Ins.initButton = function (uuid, x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
var btn;
if (uuid) {
btn = new button_1.Button(this.getRes(uuid));
}
else {
btn = new button_1.Button();
}
btn.x = x;
btn.y = y;
return btn;
};
Ins.initLabel = function (data) { Ins.initLabel = function (data) {
var label = new FYGE.TextField(); var label = new FYGE.TextField();
label.fillColor = data.color ? data.color : "black"; label.fillColor = data.color ? data.color : "black";
...@@ -46935,6 +46950,16 @@ var MainScene = (function (_super) { ...@@ -46935,6 +46950,16 @@ var MainScene = (function (_super) {
that.letter.visible = true; that.letter.visible = true;
} }
}; };
MainScene.prototype.initRecallCatTimer = function () {
var that = this;
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
that.recallTimer = setTimeout(function () {
that.recallCat();
}, r.data.backTime - r.data.serverTime);
}
});
};
MainScene.prototype.initGuide = function (sence) { MainScene.prototype.initGuide = function (sence) {
var that = this; var that = this;
if (!Ins_1.Ins.senceInfo.senceGuide['' + sence]) { if (!Ins_1.Ins.senceInfo.senceGuide['' + sence]) {
...@@ -47303,6 +47328,72 @@ exports.setStage = function (stage) { ...@@ -47303,6 +47328,72 @@ exports.setStage = function (stage) {
}; };
/***/ }),
/***/ "./src/ui/button.ts":
/*!**************************!*\
!*** ./src/ui/button.ts ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
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 });
exports.Button = void 0;
var Button = (function (_super) {
__extends(Button, _super);
function Button(texture) {
var _this = _super.call(this, texture) || this;
_this.anchorX = texture.baseTexture.width / 2;
_this.anchorY = texture.baseTexture.width / 2;
_this.initButton();
_this.addEventListener(FYGE.Event.REMOVED_FROM_STAGE, _this.removeButton, _this);
return _this;
}
Button.prototype.initButton = function () {
console.log("初始化按钮");
this.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.touchEvent, this);
this.addEventListener(FYGE.MouseEvent.MOUSE_OUT, this.touchEvent, this);
this.addEventListener(FYGE.MouseEvent.MOUSE_UP, this.touchEvent, this);
};
Button.prototype.touchEvent = function (e) {
console.log("按钮事件");
var that = this;
if (!that)
return;
if (e.type == FYGE.MouseEvent.MOUSE_DOWN) {
FYGE.Tween.removeTweens(that);
FYGE.Tween.get(that).to({ scaleX: 0.9, scaleY: 0.9 }, 50);
}
else {
FYGE.Tween.removeTweens(that);
FYGE.Tween.get(that).to({ scaleX: 1, scaleY: 1 }, 50);
}
};
Button.prototype.removeButton = function () {
this.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.touchEvent, this);
this.removeEventListener(FYGE.MouseEvent.MOUSE_OVER, this.touchEvent, this);
this.removeEventListener(FYGE.MouseEvent.MOUSE_UP, this.touchEvent, this);
};
return Button;
}(FYGE.Sprite));
exports.Button = Button;
/***/ }), /***/ }),
/***/ "./src/ui/mainSceneBtnUi.ts": /***/ "./src/ui/mainSceneBtnUi.ts":
...@@ -47359,16 +47450,16 @@ var MainSceneBtnUi = (function (_super) { ...@@ -47359,16 +47450,16 @@ var MainSceneBtnUi = (function (_super) {
that.bottomBtnGroup.y = 1240; that.bottomBtnGroup.y = 1240;
that.bottomBtnGroup.mouseEnable = that.bottomBtnGroup.mouseChildren = true; that.bottomBtnGroup.mouseEnable = that.bottomBtnGroup.mouseChildren = true;
that.addChild(that.bottomBtnGroup); that.addChild(that.bottomBtnGroup);
that.strategyBtn = Ins_1.Ins.initSprite("e636bd22-361f-442a-8684-ccfe1141485a", 579, 112); that.strategyBtn = Ins_1.Ins.initButton("e636bd22-361f-442a-8684-ccfe1141485a", 579, 112);
that.topBtnGroup.addChild(that.strategyBtn); that.topBtnGroup.addChild(that.strategyBtn);
that.prizeBtn = Ins_1.Ins.initSprite("e8b083c7-307a-4446-9bc9-99f75c3573e5", 579, 237); that.prizeBtn = Ins_1.Ins.initButton("e8b083c7-307a-4446-9bc9-99f75c3573e5", 579, 237);
that.topBtnGroup.addChild(that.prizeBtn); that.topBtnGroup.addChild(that.prizeBtn);
that.energyBtn = Ins_1.Ins.initSprite("cdb8e186-9872-442e-b71e-bba0a9ce5846", 542, -7); that.energyBtn = Ins_1.Ins.initButton("cdb8e186-9872-442e-b71e-bba0a9ce5846", 542, -7);
that.bottomBtnGroup.addChild(that.energyBtn); that.bottomBtnGroup.addChild(that.energyBtn);
that.initActBtn(); that.initActBtn();
that.initCatInfoGroup(); that.initCatInfoGroup();
that.initFishPointGroup(); that.initFishPointGroup();
that.shapGoBtn = Ins_1.Ins.initSprite("dba58651-57a3-4b75-9447-0e4d498dd8cd"); that.shapGoBtn = Ins_1.Ins.initButton("dba58651-57a3-4b75-9447-0e4d498dd8cd");
that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137); that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137);
that.bottomBtnGroup.addChild(that.shapGoBtn); that.bottomBtnGroup.addChild(that.shapGoBtn);
that.updateUserInfo(); that.updateUserInfo();
...@@ -47415,17 +47506,17 @@ var MainSceneBtnUi = (function (_super) { ...@@ -47415,17 +47506,17 @@ var MainSceneBtnUi = (function (_super) {
}; };
MainSceneBtnUi.prototype.initActBtn = function () { MainSceneBtnUi.prototype.initActBtn = function () {
var that = this; var that = this;
that.combingBtn = Ins_1.Ins.initSprite("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8", 69); that.combingBtn = Ins_1.Ins.initButton("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8", 69);
that.bottomBtnGroup.addChild(that.combingBtn); that.bottomBtnGroup.addChild(that.combingBtn);
that.catBtn = Ins_1.Ins.initSprite("0b44efa9-1e8a-4c43-a2a5-93852d88918c", 214); that.catBtn = Ins_1.Ins.initButton("0b44efa9-1e8a-4c43-a2a5-93852d88918c", 214);
that.bottomBtnGroup.addChild(that.catBtn); that.bottomBtnGroup.addChild(that.catBtn);
that.returnBtn = Ins_1.Ins.initSprite("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb", 69); that.returnBtn = Ins_1.Ins.initButton("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb", 69);
that.bottomBtnGroup.addChild(that.returnBtn); that.bottomBtnGroup.addChild(that.returnBtn);
that.touchHeadBtn = Ins_1.Ins.initSprite("b7ec0f16-ea48-4e41-8def-7cc660fa93d7", 214); that.touchHeadBtn = Ins_1.Ins.initButton("b7ec0f16-ea48-4e41-8def-7cc660fa93d7", 214);
that.bottomBtnGroup.addChild(that.touchHeadBtn); that.bottomBtnGroup.addChild(that.touchHeadBtn);
that.playBtn = Ins_1.Ins.initSprite("922deced-62d2-4995-9dd6-82bc7913f362", 214); that.playBtn = Ins_1.Ins.initButton("922deced-62d2-4995-9dd6-82bc7913f362", 214);
that.bottomBtnGroup.addChild(that.playBtn); that.bottomBtnGroup.addChild(that.playBtn);
that.catRecall = Ins_1.Ins.initSprite("72345190-f95b-4152-bccf-393b8a5aa8d0", 69); that.catRecall = Ins_1.Ins.initButton("72345190-f95b-4152-bccf-393b8a5aa8d0", 69);
that.bottomBtnGroup.addChild(that.catRecall); that.bottomBtnGroup.addChild(that.catRecall);
that.hideAllActBtn(); that.hideAllActBtn();
that.changeBtnByUiType(that.uiType); that.changeBtnByUiType(that.uiType);
This diff is collapsed.
...@@ -2140,6 +2140,7 @@ var RES_1 = __webpack_require__(/*! ../module/RES */ "./module/RES.ts"); ...@@ -2140,6 +2140,7 @@ var RES_1 = __webpack_require__(/*! ../module/RES */ "./module/RES.ts");
var resCanvasList_1 = __webpack_require__(/*! ../resCanvasList */ "./resCanvasList.js"); var resCanvasList_1 = __webpack_require__(/*! ../resCanvasList */ "./resCanvasList.js");
var Main_1 = __webpack_require__(/*! ./Main */ "./src/Main.ts"); var Main_1 = __webpack_require__(/*! ./Main */ "./src/Main.ts");
var TaoBaoNet_1 = __webpack_require__(/*! ./TaoBaoNet */ "./src/TaoBaoNet.ts"); var TaoBaoNet_1 = __webpack_require__(/*! ./TaoBaoNet */ "./src/TaoBaoNet.ts");
var button_1 = __webpack_require__(/*! ./ui/button */ "./src/ui/button.ts");
var Ins = (function () { var Ins = (function () {
function Ins() { function Ins() {
} }
...@@ -2183,6 +2184,20 @@ var Ins = (function () { ...@@ -2183,6 +2184,20 @@ var Ins = (function () {
btn.y = y; btn.y = y;
return btn; return btn;
}; };
Ins.initButton = function (uuid, x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
var btn;
if (uuid) {
btn = new button_1.Button(this.getRes(uuid));
}
else {
btn = new button_1.Button();
}
btn.x = x;
btn.y = y;
return btn;
};
Ins.initLabel = function (data) { Ins.initLabel = function (data) {
var label = new FYGE.TextField(); var label = new FYGE.TextField();
label.fillColor = data.color ? data.color : "black"; label.fillColor = data.color ? data.color : "black";
...@@ -46937,6 +46952,16 @@ var MainScene = (function (_super) { ...@@ -46937,6 +46952,16 @@ var MainScene = (function (_super) {
that.letter.visible = true; that.letter.visible = true;
} }
}; };
MainScene.prototype.initRecallCatTimer = function () {
var that = this;
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
that.recallTimer = setTimeout(function () {
that.recallCat();
}, r.data.backTime - r.data.serverTime);
}
});
};
MainScene.prototype.initGuide = function (sence) { MainScene.prototype.initGuide = function (sence) {
var that = this; var that = this;
if (!Ins_1.Ins.senceInfo.senceGuide['' + sence]) { if (!Ins_1.Ins.senceInfo.senceGuide['' + sence]) {
...@@ -47305,6 +47330,72 @@ exports.setStage = function (stage) { ...@@ -47305,6 +47330,72 @@ exports.setStage = function (stage) {
}; };
/***/ }),
/***/ "./src/ui/button.ts":
/*!**************************!*\
!*** ./src/ui/button.ts ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
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 });
exports.Button = void 0;
var Button = (function (_super) {
__extends(Button, _super);
function Button(texture) {
var _this = _super.call(this, texture) || this;
_this.anchorX = texture.baseTexture.width / 2;
_this.anchorY = texture.baseTexture.width / 2;
_this.initButton();
_this.addEventListener(FYGE.Event.REMOVED_FROM_STAGE, _this.removeButton, _this);
return _this;
}
Button.prototype.initButton = function () {
console.log("初始化按钮");
this.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.touchEvent, this);
this.addEventListener(FYGE.MouseEvent.MOUSE_OUT, this.touchEvent, this);
this.addEventListener(FYGE.MouseEvent.MOUSE_UP, this.touchEvent, this);
};
Button.prototype.touchEvent = function (e) {
console.log("按钮事件");
var that = this;
if (!that)
return;
if (e.type == FYGE.MouseEvent.MOUSE_DOWN) {
FYGE.Tween.removeTweens(that);
FYGE.Tween.get(that).to({ scaleX: 0.9, scaleY: 0.9 }, 50);
}
else {
FYGE.Tween.removeTweens(that);
FYGE.Tween.get(that).to({ scaleX: 1, scaleY: 1 }, 50);
}
};
Button.prototype.removeButton = function () {
this.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.touchEvent, this);
this.removeEventListener(FYGE.MouseEvent.MOUSE_OVER, this.touchEvent, this);
this.removeEventListener(FYGE.MouseEvent.MOUSE_UP, this.touchEvent, this);
};
return Button;
}(FYGE.Sprite));
exports.Button = Button;
/***/ }), /***/ }),
/***/ "./src/ui/mainSceneBtnUi.ts": /***/ "./src/ui/mainSceneBtnUi.ts":
...@@ -47361,16 +47452,16 @@ var MainSceneBtnUi = (function (_super) { ...@@ -47361,16 +47452,16 @@ var MainSceneBtnUi = (function (_super) {
that.bottomBtnGroup.y = 1240; that.bottomBtnGroup.y = 1240;
that.bottomBtnGroup.mouseEnable = that.bottomBtnGroup.mouseChildren = true; that.bottomBtnGroup.mouseEnable = that.bottomBtnGroup.mouseChildren = true;
that.addChild(that.bottomBtnGroup); that.addChild(that.bottomBtnGroup);
that.strategyBtn = Ins_1.Ins.initSprite("e636bd22-361f-442a-8684-ccfe1141485a", 579, 112); that.strategyBtn = Ins_1.Ins.initButton("e636bd22-361f-442a-8684-ccfe1141485a", 579, 112);
that.topBtnGroup.addChild(that.strategyBtn); that.topBtnGroup.addChild(that.strategyBtn);
that.prizeBtn = Ins_1.Ins.initSprite("e8b083c7-307a-4446-9bc9-99f75c3573e5", 579, 237); that.prizeBtn = Ins_1.Ins.initButton("e8b083c7-307a-4446-9bc9-99f75c3573e5", 579, 237);
that.topBtnGroup.addChild(that.prizeBtn); that.topBtnGroup.addChild(that.prizeBtn);
that.energyBtn = Ins_1.Ins.initSprite("cdb8e186-9872-442e-b71e-bba0a9ce5846", 542, -7); that.energyBtn = Ins_1.Ins.initButton("cdb8e186-9872-442e-b71e-bba0a9ce5846", 542, -7);
that.bottomBtnGroup.addChild(that.energyBtn); that.bottomBtnGroup.addChild(that.energyBtn);
that.initActBtn(); that.initActBtn();
that.initCatInfoGroup(); that.initCatInfoGroup();
that.initFishPointGroup(); that.initFishPointGroup();
that.shapGoBtn = Ins_1.Ins.initSprite("dba58651-57a3-4b75-9447-0e4d498dd8cd"); that.shapGoBtn = Ins_1.Ins.initButton("dba58651-57a3-4b75-9447-0e4d498dd8cd");
that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137); that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137);
that.bottomBtnGroup.addChild(that.shapGoBtn); that.bottomBtnGroup.addChild(that.shapGoBtn);
that.updateUserInfo(); that.updateUserInfo();
...@@ -47417,17 +47508,17 @@ var MainSceneBtnUi = (function (_super) { ...@@ -47417,17 +47508,17 @@ var MainSceneBtnUi = (function (_super) {
}; };
MainSceneBtnUi.prototype.initActBtn = function () { MainSceneBtnUi.prototype.initActBtn = function () {
var that = this; var that = this;
that.combingBtn = Ins_1.Ins.initSprite("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8", 69); that.combingBtn = Ins_1.Ins.initButton("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8", 69);
that.bottomBtnGroup.addChild(that.combingBtn); that.bottomBtnGroup.addChild(that.combingBtn);
that.catBtn = Ins_1.Ins.initSprite("0b44efa9-1e8a-4c43-a2a5-93852d88918c", 214); that.catBtn = Ins_1.Ins.initButton("0b44efa9-1e8a-4c43-a2a5-93852d88918c", 214);
that.bottomBtnGroup.addChild(that.catBtn); that.bottomBtnGroup.addChild(that.catBtn);
that.returnBtn = Ins_1.Ins.initSprite("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb", 69); that.returnBtn = Ins_1.Ins.initButton("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb", 69);
that.bottomBtnGroup.addChild(that.returnBtn); that.bottomBtnGroup.addChild(that.returnBtn);
that.touchHeadBtn = Ins_1.Ins.initSprite("b7ec0f16-ea48-4e41-8def-7cc660fa93d7", 214); that.touchHeadBtn = Ins_1.Ins.initButton("b7ec0f16-ea48-4e41-8def-7cc660fa93d7", 214);
that.bottomBtnGroup.addChild(that.touchHeadBtn); that.bottomBtnGroup.addChild(that.touchHeadBtn);
that.playBtn = Ins_1.Ins.initSprite("922deced-62d2-4995-9dd6-82bc7913f362", 214); that.playBtn = Ins_1.Ins.initButton("922deced-62d2-4995-9dd6-82bc7913f362", 214);
that.bottomBtnGroup.addChild(that.playBtn); that.bottomBtnGroup.addChild(that.playBtn);
that.catRecall = Ins_1.Ins.initSprite("72345190-f95b-4152-bccf-393b8a5aa8d0", 69); that.catRecall = Ins_1.Ins.initButton("72345190-f95b-4152-bccf-393b8a5aa8d0", 69);
that.bottomBtnGroup.addChild(that.catRecall); that.bottomBtnGroup.addChild(that.catRecall);
that.hideAllActBtn(); that.hideAllActBtn();
that.changeBtnByUiType(that.uiType); that.changeBtnByUiType(that.uiType);
...@@ -4,6 +4,7 @@ import resCanvasList from "../resCanvasList" ...@@ -4,6 +4,7 @@ import resCanvasList from "../resCanvasList"
import { SCENETYPE } from "./Enum"; import { SCENETYPE } from "./Enum";
import { GDispatcher } from "./Main"; import { GDispatcher } from "./Main";
import { sendTbNet, TbNetName } from "./TaoBaoNet"; import { sendTbNet, TbNetName } from "./TaoBaoNet";
import { Button } from "./ui/button";
/**记录全局信息与全局方法 */ /**记录全局信息与全局方法 */
export class Ins { export class Ins {
/**舞台宽高 */ /**舞台宽高 */
...@@ -91,6 +92,20 @@ export class Ins { ...@@ -91,6 +92,20 @@ export class Ins {
return btn; return btn;
} }
/**生成一个按钮 */
public static initButton(uuid?: string, x = 0, y = 0){
let btn;
if (uuid) {
btn = new Button(this.getRes(uuid));
}else{
btn = new Button();
}
// btn.initButton();
btn.x = x;
btn.y = y;
return btn;
}
/**生成一个文本 /**生成一个文本
* data:{color?:string,size?:number,x?:number,y?:number,text?:string} * data:{color?:string,size?:number,x?:number,y?:number,text?:string}
*/ */
......
export class Button extends FYGE.Sprite{
constructor(texture?:FYGE.Texture){
super(texture)
this.anchorX = texture.baseTexture.width/2;
this.anchorY = texture.baseTexture.width/2;
this.initButton();
// this.addEventListener(FYGE.Event.ADDED_TO_STAGE,this.initButton,this);
this.addEventListener(FYGE.Event.REMOVED_FROM_STAGE,this.removeButton,this);
}
initButton(){
console.log("初始化按钮")
this.addEventListener(FYGE.MouseEvent.MOUSE_DOWN,this.touchEvent,this);
this.addEventListener(FYGE.MouseEvent.MOUSE_OUT,this.touchEvent,this);
this.addEventListener(FYGE.MouseEvent.MOUSE_UP,this.touchEvent,this)
}
touchEvent(e:FYGE.MouseEvent){
console.log("按钮事件")
var that = this;
if(!that) return;
if(e.type==FYGE.MouseEvent.MOUSE_DOWN){
FYGE.Tween.removeTweens(that);
FYGE.Tween.get(that).to({scaleX:0.9,scaleY:0.9},50)
}else{
FYGE.Tween.removeTweens(that);
FYGE.Tween.get(that).to({scaleX:1,scaleY:1},50)
}
}
removeButton(){
this.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN,this.touchEvent,this);
this.removeEventListener(FYGE.MouseEvent.MOUSE_OVER,this.touchEvent,this);
this.removeEventListener(FYGE.MouseEvent.MOUSE_UP,this.touchEvent,this)
}
}
\ No newline at end of file
...@@ -8,6 +8,8 @@ import { changeScene, showPanel } from "../../module/ctrls"; ...@@ -8,6 +8,8 @@ import { changeScene, showPanel } from "../../module/ctrls";
import { RulePanel } from "../panels/rulePanel"; import { RulePanel } from "../panels/rulePanel";
import { MyPrizeScene } from "../scenes/MyPrizeScene"; import { MyPrizeScene } from "../scenes/MyPrizeScene";
import { sendTbNet, TbNetName } from "../TaoBaoNet"; import { sendTbNet, TbNetName } from "../TaoBaoNet";
import { getStage } from "../scenes/stage";
import { Button } from "./button";
export class MainSceneBtnUi extends Module { export class MainSceneBtnUi extends Module {
/**主场景ui /**主场景ui
...@@ -26,7 +28,7 @@ export class MainSceneBtnUi extends Module { ...@@ -26,7 +28,7 @@ export class MainSceneBtnUi extends Module {
/**商城按钮 */ /**商城按钮 */
private shapGoBtn: FYGE.Sprite; private shapGoBtn: FYGE.Sprite;
/**返回按钮 */ /**返回按钮 */
private returnBtn: FYGE.Sprite; private returnBtn: Button;
/**攻略按钮 */ /**攻略按钮 */
private strategyBtn: FYGE.Sprite; private strategyBtn: FYGE.Sprite;
/**奖品按钮 */ /**奖品按钮 */
...@@ -60,6 +62,8 @@ export class MainSceneBtnUi extends Module { ...@@ -60,6 +62,8 @@ export class MainSceneBtnUi extends Module {
/**互动进行中,当互动进行中时,无法点击互动按钮进行互动 */ /**互动进行中,当互动进行中时,无法点击互动按钮进行互动 */
private actRunning: boolean = false; private actRunning: boolean = false;
// private btnArr:FYGE.Sprite[] = [];
initUi() { initUi() {
var that = this; var that = this;
that.initUniversalUi(); that.initUniversalUi();
...@@ -81,19 +85,19 @@ export class MainSceneBtnUi extends Module { ...@@ -81,19 +85,19 @@ export class MainSceneBtnUi extends Module {
that.bottomBtnGroup.mouseEnable = that.bottomBtnGroup.mouseChildren = true; that.bottomBtnGroup.mouseEnable = that.bottomBtnGroup.mouseChildren = true;
that.addChild(that.bottomBtnGroup); that.addChild(that.bottomBtnGroup);
that.strategyBtn = Ins.initSprite("e636bd22-361f-442a-8684-ccfe1141485a", 579, 112); that.strategyBtn = Ins.initButton("e636bd22-361f-442a-8684-ccfe1141485a", 579, 112);
that.topBtnGroup.addChild(that.strategyBtn); that.topBtnGroup.addChild(that.strategyBtn);
that.prizeBtn = Ins.initSprite("e8b083c7-307a-4446-9bc9-99f75c3573e5", 579, 237); that.prizeBtn = Ins.initButton("e8b083c7-307a-4446-9bc9-99f75c3573e5", 579, 237);
that.topBtnGroup.addChild(that.prizeBtn); that.topBtnGroup.addChild(that.prizeBtn);
that.energyBtn = Ins.initSprite("cdb8e186-9872-442e-b71e-bba0a9ce5846", 542, -7); that.energyBtn = Ins.initButton("cdb8e186-9872-442e-b71e-bba0a9ce5846", 542, -7);
that.bottomBtnGroup.addChild(that.energyBtn); that.bottomBtnGroup.addChild(that.energyBtn);
that.initActBtn(); that.initActBtn();
that.initCatInfoGroup(); that.initCatInfoGroup();
that.initFishPointGroup(); that.initFishPointGroup();
that.shapGoBtn = Ins.initSprite("dba58651-57a3-4b75-9447-0e4d498dd8cd") that.shapGoBtn = Ins.initButton("dba58651-57a3-4b75-9447-0e4d498dd8cd")
that.shapGoBtn.position.set((Ins.stageW - that.shapGoBtn.width) >> 1, 137); that.shapGoBtn.position.set((Ins.stageW - that.shapGoBtn.width) >> 1, 137);
that.bottomBtnGroup.addChild(that.shapGoBtn); that.bottomBtnGroup.addChild(that.shapGoBtn);
that.updateUserInfo(); that.updateUserInfo();
...@@ -154,17 +158,17 @@ export class MainSceneBtnUi extends Module { ...@@ -154,17 +158,17 @@ export class MainSceneBtnUi extends Module {
/**初始化互动按钮 */ /**初始化互动按钮 */
initActBtn() { initActBtn() {
var that = this; var that = this;
that.combingBtn = Ins.initSprite("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8", 69); that.combingBtn = Ins.initButton("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8", 69);
that.bottomBtnGroup.addChild(that.combingBtn); that.bottomBtnGroup.addChild(that.combingBtn);
that.catBtn = Ins.initSprite("0b44efa9-1e8a-4c43-a2a5-93852d88918c", 214); that.catBtn = Ins.initButton("0b44efa9-1e8a-4c43-a2a5-93852d88918c", 214);
that.bottomBtnGroup.addChild(that.catBtn); that.bottomBtnGroup.addChild(that.catBtn);
that.returnBtn = Ins.initSprite("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb", 69); that.returnBtn = Ins.initButton("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb", 69);
that.bottomBtnGroup.addChild(that.returnBtn); that.bottomBtnGroup.addChild(that.returnBtn);
that.touchHeadBtn = Ins.initSprite("b7ec0f16-ea48-4e41-8def-7cc660fa93d7", 214); that.touchHeadBtn = Ins.initButton("b7ec0f16-ea48-4e41-8def-7cc660fa93d7", 214);
that.bottomBtnGroup.addChild(that.touchHeadBtn); that.bottomBtnGroup.addChild(that.touchHeadBtn);
that.playBtn = Ins.initSprite("922deced-62d2-4995-9dd6-82bc7913f362", 214); that.playBtn = Ins.initButton("922deced-62d2-4995-9dd6-82bc7913f362", 214);
that.bottomBtnGroup.addChild(that.playBtn); that.bottomBtnGroup.addChild(that.playBtn);
that.catRecall = Ins.initSprite("72345190-f95b-4152-bccf-393b8a5aa8d0", 69) that.catRecall = Ins.initButton("72345190-f95b-4152-bccf-393b8a5aa8d0", 69)
that.bottomBtnGroup.addChild(that.catRecall); that.bottomBtnGroup.addChild(that.catRecall);
that.hideAllActBtn(); that.hideAllActBtn();
that.changeBtnByUiType(that.uiType) that.changeBtnByUiType(that.uiType)
......
...@@ -27,7 +27,7 @@ App({ ...@@ -27,7 +27,7 @@ App({
*/ */
handleQuery(query) { handleQuery(query) {
const { activityId } = query; const { activityId } = query;
this.activityId = activityId || '5f6b09b3c3ad342fed5a0b21'; this.activityId = activityId || '5f7183e852bbded304b27d71';
} }
}); });
...@@ -2,16 +2,19 @@ ...@@ -2,16 +2,19 @@
import API from '../../api'; import API from '../../api';
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
const app = getApp(); const app = getApp();
const { tbcc } = app; const {
tbcc
} = app;
const { const {
textRiskIdentification textRiskIdentification,
} = tbcc.tb; commonToast
} = tbcc.tb;
Component({ Component({
props: { props: {
catImgArr: ["90b114e6-83cb-46f1-b607-f88c50077b05", "4e471df6-01ab-421d-ba0b-084b2110dc6d" , "003e9904-aee4-4b8d-8d5d-fb4b1188bec1","90283bd3-4b18-4535-97a8-90318f068781"], catImgArr: ["90b114e6-83cb-46f1-b607-f88c50077b05", "4e471df6-01ab-421d-ba0b-084b2110dc6d", "003e9904-aee4-4b8d-8d5d-fb4b1188bec1", "90283bd3-4b18-4535-97a8-90318f068781"],
catName: "" catName: ""
}, },
data: { data: {
...@@ -23,8 +26,8 @@ Component({ ...@@ -23,8 +26,8 @@ Component({
/**获取字符串字符长度 */ /**获取字符串字符长度 */
getlen(str) { getlen(str) {
var strlen = 0; var strlen = 0;
console.log("名称长度",str.length) console.log("名称长度", str.length)
console.log("charChodeAt",str.charCodeAt) console.log("charChodeAt", str.charCodeAt)
for (var i = 0; i < str.length; i++) { for (var i = 0; i < str.length; i++) {
if (str.charCodeAt(i) > 255) //如果是汉字,则字符串长度加2 if (str.charCodeAt(i) > 255) //如果是汉字,则字符串长度加2
strlen += 2; strlen += 2;
...@@ -61,49 +64,58 @@ Component({ ...@@ -61,49 +64,58 @@ Component({
this.props.catName = e.detail.value; this.props.catName = e.detail.value;
// console.log(this.props.catName) // console.log(this.props.catName)
}, },
/**确认 */ /**确认领养 */
async catNameSure() { async catNameSure() {
let name = this.props.catName; let name = this.props.catName;
let len = this.getlen(name); let len = this.getlen(name);
console.log("名称字符长度",len)
if (len <= 0) { if (len <= 0) {
my.showToast({ my.showToast({
content: "名字不能为空哦", content: "名字不能为空哦",
}); });
}else if(len>12){ } else if (len > 6) {
my.showToast({ my.showToast({
content: "名字过长哦", content: "名字过长哦",
}); });
}else { } else {
/**检查敏感词 */ /**检查敏感词 */
console.log('检查敏感词',name) console.log('检查敏感词', name)
const success = await textRiskIdentification(name).catch(err => { const success = await textRiskIdentification(name).catch(err => {
console.log('textRiskIdentification error',err); commonToast(err)
}); console.log('textRiskIdentification error', err);
console.log('敏感词校验结果',success) });
if(success!== true) { console.log('敏感词校验结果', success)
if (!success) {
commonToast("非法名称")
console.log('敏感词校验失败.') console.log('敏感词校验失败.')
return;
} else {
my.showLoading();
/**调用领养接口 */
const adoptCat = await API.adoptCat({
catName: name,
catType: this.props.selectType,
// invitedId: 'openId:AAHVNvjuAMaJc3uyPjeHlCEF'//honingwon
invitedId: app.inviteId
});
console.log("aaaa", adoptCat)
if (adoptCat && adoptCat.success) {
// my.showToast({content:'邀请成功'+app.inviteId})
my.hideLoading();
this.onModalClose();
this.onSelectCatOk();
} else {
console.log("ergerg")
my.hideLoading();
my.showToast({
content: adoptCat.message || '网络异常,请稍后重试~'
})
}
} }
my.showLoading();
/**调用领养接口 */
const adoptCat = await API.adoptCat({
catName: name,
catType: this.props.selectType,
// invitedId: 'openId:AAHVNvjuAMaJc3uyPjeHlCEF'//honingwon
invitedId: app.inviteId
});
console.log("aaaa",adoptCat)
if (adoptCat && adoptCat.success) {
// my.showToast({content:'邀请成功'+app.inviteId})
my.hideLoading();
this.onModalClose();
this.onSelectCatOk();
} else {
console.log("ergerg")
my.hideLoading();
my.showToast({content:adoptCat.message||'网络异常,请稍后重试~'})
}
} }
console.log(this.props.catName) console.log(this.props.catName)
} }
......
...@@ -2140,6 +2140,7 @@ var RES_1 = __webpack_require__(/*! ../module/RES */ "./module/RES.ts"); ...@@ -2140,6 +2140,7 @@ var RES_1 = __webpack_require__(/*! ../module/RES */ "./module/RES.ts");
var resCanvasList_1 = __webpack_require__(/*! ../resCanvasList */ "./resCanvasList.js"); var resCanvasList_1 = __webpack_require__(/*! ../resCanvasList */ "./resCanvasList.js");
var Main_1 = __webpack_require__(/*! ./Main */ "./src/Main.ts"); var Main_1 = __webpack_require__(/*! ./Main */ "./src/Main.ts");
var TaoBaoNet_1 = __webpack_require__(/*! ./TaoBaoNet */ "./src/TaoBaoNet.ts"); var TaoBaoNet_1 = __webpack_require__(/*! ./TaoBaoNet */ "./src/TaoBaoNet.ts");
var button_1 = __webpack_require__(/*! ./ui/button */ "./src/ui/button.ts");
var Ins = (function () { var Ins = (function () {
function Ins() { function Ins() {
} }
...@@ -2183,6 +2184,20 @@ var Ins = (function () { ...@@ -2183,6 +2184,20 @@ var Ins = (function () {
btn.y = y; btn.y = y;
return btn; return btn;
}; };
Ins.initButton = function (uuid, x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
var btn;
if (uuid) {
btn = new button_1.Button(this.getRes(uuid));
}
else {
btn = new button_1.Button();
}
btn.x = x;
btn.y = y;
return btn;
};
Ins.initLabel = function (data) { Ins.initLabel = function (data) {
var label = new FYGE.TextField(); var label = new FYGE.TextField();
label.fillColor = data.color ? data.color : "black"; label.fillColor = data.color ? data.color : "black";
...@@ -46937,6 +46952,16 @@ var MainScene = (function (_super) { ...@@ -46937,6 +46952,16 @@ var MainScene = (function (_super) {
that.letter.visible = true; that.letter.visible = true;
} }
}; };
MainScene.prototype.initRecallCatTimer = function () {
var that = this;
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
that.recallTimer = setTimeout(function () {
that.recallCat();
}, r.data.backTime - r.data.serverTime);
}
});
};
MainScene.prototype.initGuide = function (sence) { MainScene.prototype.initGuide = function (sence) {
var that = this; var that = this;
if (!Ins_1.Ins.senceInfo.senceGuide['' + sence]) { if (!Ins_1.Ins.senceInfo.senceGuide['' + sence]) {
...@@ -47305,6 +47330,72 @@ exports.setStage = function (stage) { ...@@ -47305,6 +47330,72 @@ exports.setStage = function (stage) {
}; };
/***/ }),
/***/ "./src/ui/button.ts":
/*!**************************!*\
!*** ./src/ui/button.ts ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
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 });
exports.Button = void 0;
var Button = (function (_super) {
__extends(Button, _super);
function Button(texture) {
var _this = _super.call(this, texture) || this;
_this.anchorX = texture.baseTexture.width / 2;
_this.anchorY = texture.baseTexture.width / 2;
_this.initButton();
_this.addEventListener(FYGE.Event.REMOVED_FROM_STAGE, _this.removeButton, _this);
return _this;
}
Button.prototype.initButton = function () {
console.log("初始化按钮");
this.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.touchEvent, this);
this.addEventListener(FYGE.MouseEvent.MOUSE_OUT, this.touchEvent, this);
this.addEventListener(FYGE.MouseEvent.MOUSE_UP, this.touchEvent, this);
};
Button.prototype.touchEvent = function (e) {
console.log("按钮事件");
var that = this;
if (!that)
return;
if (e.type == FYGE.MouseEvent.MOUSE_DOWN) {
FYGE.Tween.removeTweens(that);
FYGE.Tween.get(that).to({ scaleX: 0.9, scaleY: 0.9 }, 50);
}
else {
FYGE.Tween.removeTweens(that);
FYGE.Tween.get(that).to({ scaleX: 1, scaleY: 1 }, 50);
}
};
Button.prototype.removeButton = function () {
this.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.touchEvent, this);
this.removeEventListener(FYGE.MouseEvent.MOUSE_OVER, this.touchEvent, this);
this.removeEventListener(FYGE.MouseEvent.MOUSE_UP, this.touchEvent, this);
};
return Button;
}(FYGE.Sprite));
exports.Button = Button;
/***/ }), /***/ }),
/***/ "./src/ui/mainSceneBtnUi.ts": /***/ "./src/ui/mainSceneBtnUi.ts":
...@@ -47361,16 +47452,16 @@ var MainSceneBtnUi = (function (_super) { ...@@ -47361,16 +47452,16 @@ var MainSceneBtnUi = (function (_super) {
that.bottomBtnGroup.y = 1240; that.bottomBtnGroup.y = 1240;
that.bottomBtnGroup.mouseEnable = that.bottomBtnGroup.mouseChildren = true; that.bottomBtnGroup.mouseEnable = that.bottomBtnGroup.mouseChildren = true;
that.addChild(that.bottomBtnGroup); that.addChild(that.bottomBtnGroup);
that.strategyBtn = Ins_1.Ins.initSprite("e636bd22-361f-442a-8684-ccfe1141485a", 579, 112); that.strategyBtn = Ins_1.Ins.initButton("e636bd22-361f-442a-8684-ccfe1141485a", 579, 112);
that.topBtnGroup.addChild(that.strategyBtn); that.topBtnGroup.addChild(that.strategyBtn);
that.prizeBtn = Ins_1.Ins.initSprite("e8b083c7-307a-4446-9bc9-99f75c3573e5", 579, 237); that.prizeBtn = Ins_1.Ins.initButton("e8b083c7-307a-4446-9bc9-99f75c3573e5", 579, 237);
that.topBtnGroup.addChild(that.prizeBtn); that.topBtnGroup.addChild(that.prizeBtn);
that.energyBtn = Ins_1.Ins.initSprite("cdb8e186-9872-442e-b71e-bba0a9ce5846", 542, -7); that.energyBtn = Ins_1.Ins.initButton("cdb8e186-9872-442e-b71e-bba0a9ce5846", 542, -7);
that.bottomBtnGroup.addChild(that.energyBtn); that.bottomBtnGroup.addChild(that.energyBtn);
that.initActBtn(); that.initActBtn();
that.initCatInfoGroup(); that.initCatInfoGroup();
that.initFishPointGroup(); that.initFishPointGroup();
that.shapGoBtn = Ins_1.Ins.initSprite("dba58651-57a3-4b75-9447-0e4d498dd8cd"); that.shapGoBtn = Ins_1.Ins.initButton("dba58651-57a3-4b75-9447-0e4d498dd8cd");
that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137); that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137);
that.bottomBtnGroup.addChild(that.shapGoBtn); that.bottomBtnGroup.addChild(that.shapGoBtn);
that.updateUserInfo(); that.updateUserInfo();
...@@ -47417,17 +47508,17 @@ var MainSceneBtnUi = (function (_super) { ...@@ -47417,17 +47508,17 @@ var MainSceneBtnUi = (function (_super) {
}; };
MainSceneBtnUi.prototype.initActBtn = function () { MainSceneBtnUi.prototype.initActBtn = function () {
var that = this; var that = this;
that.combingBtn = Ins_1.Ins.initSprite("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8", 69); that.combingBtn = Ins_1.Ins.initButton("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8", 69);
that.bottomBtnGroup.addChild(that.combingBtn); that.bottomBtnGroup.addChild(that.combingBtn);
that.catBtn = Ins_1.Ins.initSprite("0b44efa9-1e8a-4c43-a2a5-93852d88918c", 214); that.catBtn = Ins_1.Ins.initButton("0b44efa9-1e8a-4c43-a2a5-93852d88918c", 214);
that.bottomBtnGroup.addChild(that.catBtn); that.bottomBtnGroup.addChild(that.catBtn);
that.returnBtn = Ins_1.Ins.initSprite("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb", 69); that.returnBtn = Ins_1.Ins.initButton("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb", 69);
that.bottomBtnGroup.addChild(that.returnBtn); that.bottomBtnGroup.addChild(that.returnBtn);
that.touchHeadBtn = Ins_1.Ins.initSprite("b7ec0f16-ea48-4e41-8def-7cc660fa93d7", 214); that.touchHeadBtn = Ins_1.Ins.initButton("b7ec0f16-ea48-4e41-8def-7cc660fa93d7", 214);
that.bottomBtnGroup.addChild(that.touchHeadBtn); that.bottomBtnGroup.addChild(that.touchHeadBtn);
that.playBtn = Ins_1.Ins.initSprite("922deced-62d2-4995-9dd6-82bc7913f362", 214); that.playBtn = Ins_1.Ins.initButton("922deced-62d2-4995-9dd6-82bc7913f362", 214);
that.bottomBtnGroup.addChild(that.playBtn); that.bottomBtnGroup.addChild(that.playBtn);
that.catRecall = Ins_1.Ins.initSprite("72345190-f95b-4152-bccf-393b8a5aa8d0", 69); that.catRecall = Ins_1.Ins.initButton("72345190-f95b-4152-bccf-393b8a5aa8d0", 69);
that.bottomBtnGroup.addChild(that.catRecall); that.bottomBtnGroup.addChild(that.catRecall);
that.hideAllActBtn(); that.hideAllActBtn();
that.changeBtnByUiType(that.uiType); that.changeBtnByUiType(that.uiType);
...@@ -43,7 +43,7 @@ Page({ ...@@ -43,7 +43,7 @@ Page({
ruleModalVisible: false, ruleModalVisible: false,
levelupModalVisible: 0, levelupModalVisible: 0,
levelupModalData: null, levelupModalData: null,
selectcatModalVisible: true, selectcatModalVisible: false,
catnameModalVisible: false, catnameModalVisible: false,
recallcatModalVisible: false, recallcatModalVisible: false,
recallcatModalData: {}, recallcatModalData: {},
...@@ -95,7 +95,7 @@ Page({ ...@@ -95,7 +95,7 @@ Page({
console.log('on ready') console.log('on ready')
//授权和登录先搞 //授权和登录先搞
await this.getAuth(); // await this.getAuth();
// this.initCanvas(); // this.initCanvas();
my.__onMessage__ = (e) => { my.__onMessage__ = (e) => {
this.onMessage(e) this.onMessage(e)
...@@ -376,7 +376,7 @@ Page({ ...@@ -376,7 +376,7 @@ Page({
this.setData({ this.setData({
activityBaseInfo: data activityBaseInfo: data
}) })
// this.initCanvas(); this.initCanvas();
} }
}, },
/**刷新用户信息 */ /**刷新用户信息 */
......
...@@ -2140,6 +2140,7 @@ var RES_1 = __webpack_require__(/*! ../module/RES */ "./module/RES.ts"); ...@@ -2140,6 +2140,7 @@ var RES_1 = __webpack_require__(/*! ../module/RES */ "./module/RES.ts");
var resCanvasList_1 = __webpack_require__(/*! ../resCanvasList */ "./resCanvasList.js"); var resCanvasList_1 = __webpack_require__(/*! ../resCanvasList */ "./resCanvasList.js");
var Main_1 = __webpack_require__(/*! ./Main */ "./src/Main.ts"); var Main_1 = __webpack_require__(/*! ./Main */ "./src/Main.ts");
var TaoBaoNet_1 = __webpack_require__(/*! ./TaoBaoNet */ "./src/TaoBaoNet.ts"); var TaoBaoNet_1 = __webpack_require__(/*! ./TaoBaoNet */ "./src/TaoBaoNet.ts");
var button_1 = __webpack_require__(/*! ./ui/button */ "./src/ui/button.ts");
var Ins = (function () { var Ins = (function () {
function Ins() { function Ins() {
} }
...@@ -2183,6 +2184,20 @@ var Ins = (function () { ...@@ -2183,6 +2184,20 @@ var Ins = (function () {
btn.y = y; btn.y = y;
return btn; return btn;
}; };
Ins.initButton = function (uuid, x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
var btn;
if (uuid) {
btn = new button_1.Button(this.getRes(uuid));
}
else {
btn = new button_1.Button();
}
btn.x = x;
btn.y = y;
return btn;
};
Ins.initLabel = function (data) { Ins.initLabel = function (data) {
var label = new FYGE.TextField(); var label = new FYGE.TextField();
label.fillColor = data.color ? data.color : "black"; label.fillColor = data.color ? data.color : "black";
...@@ -46937,6 +46952,16 @@ var MainScene = (function (_super) { ...@@ -46937,6 +46952,16 @@ var MainScene = (function (_super) {
that.letter.visible = true; that.letter.visible = true;
} }
}; };
MainScene.prototype.initRecallCatTimer = function () {
var that = this;
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
that.recallTimer = setTimeout(function () {
that.recallCat();
}, r.data.backTime - r.data.serverTime);
}
});
};
MainScene.prototype.initGuide = function (sence) { MainScene.prototype.initGuide = function (sence) {
var that = this; var that = this;
if (!Ins_1.Ins.senceInfo.senceGuide['' + sence]) { if (!Ins_1.Ins.senceInfo.senceGuide['' + sence]) {
...@@ -47305,6 +47330,72 @@ exports.setStage = function (stage) { ...@@ -47305,6 +47330,72 @@ exports.setStage = function (stage) {
}; };
/***/ }),
/***/ "./src/ui/button.ts":
/*!**************************!*\
!*** ./src/ui/button.ts ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
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 });
exports.Button = void 0;
var Button = (function (_super) {
__extends(Button, _super);
function Button(texture) {
var _this = _super.call(this, texture) || this;
_this.anchorX = texture.baseTexture.width / 2;
_this.anchorY = texture.baseTexture.width / 2;
_this.initButton();
_this.addEventListener(FYGE.Event.REMOVED_FROM_STAGE, _this.removeButton, _this);
return _this;
}
Button.prototype.initButton = function () {
console.log("初始化按钮");
this.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.touchEvent, this);
this.addEventListener(FYGE.MouseEvent.MOUSE_OUT, this.touchEvent, this);
this.addEventListener(FYGE.MouseEvent.MOUSE_UP, this.touchEvent, this);
};
Button.prototype.touchEvent = function (e) {
console.log("按钮事件");
var that = this;
if (!that)
return;
if (e.type == FYGE.MouseEvent.MOUSE_DOWN) {
FYGE.Tween.removeTweens(that);
FYGE.Tween.get(that).to({ scaleX: 0.9, scaleY: 0.9 }, 50);
}
else {
FYGE.Tween.removeTweens(that);
FYGE.Tween.get(that).to({ scaleX: 1, scaleY: 1 }, 50);
}
};
Button.prototype.removeButton = function () {
this.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.touchEvent, this);
this.removeEventListener(FYGE.MouseEvent.MOUSE_OVER, this.touchEvent, this);
this.removeEventListener(FYGE.MouseEvent.MOUSE_UP, this.touchEvent, this);
};
return Button;
}(FYGE.Sprite));
exports.Button = Button;
/***/ }), /***/ }),
/***/ "./src/ui/mainSceneBtnUi.ts": /***/ "./src/ui/mainSceneBtnUi.ts":
...@@ -47361,16 +47452,16 @@ var MainSceneBtnUi = (function (_super) { ...@@ -47361,16 +47452,16 @@ var MainSceneBtnUi = (function (_super) {
that.bottomBtnGroup.y = 1240; that.bottomBtnGroup.y = 1240;
that.bottomBtnGroup.mouseEnable = that.bottomBtnGroup.mouseChildren = true; that.bottomBtnGroup.mouseEnable = that.bottomBtnGroup.mouseChildren = true;
that.addChild(that.bottomBtnGroup); that.addChild(that.bottomBtnGroup);
that.strategyBtn = Ins_1.Ins.initSprite("e636bd22-361f-442a-8684-ccfe1141485a", 579, 112); that.strategyBtn = Ins_1.Ins.initButton("e636bd22-361f-442a-8684-ccfe1141485a", 579, 112);
that.topBtnGroup.addChild(that.strategyBtn); that.topBtnGroup.addChild(that.strategyBtn);
that.prizeBtn = Ins_1.Ins.initSprite("e8b083c7-307a-4446-9bc9-99f75c3573e5", 579, 237); that.prizeBtn = Ins_1.Ins.initButton("e8b083c7-307a-4446-9bc9-99f75c3573e5", 579, 237);
that.topBtnGroup.addChild(that.prizeBtn); that.topBtnGroup.addChild(that.prizeBtn);
that.energyBtn = Ins_1.Ins.initSprite("cdb8e186-9872-442e-b71e-bba0a9ce5846", 542, -7); that.energyBtn = Ins_1.Ins.initButton("cdb8e186-9872-442e-b71e-bba0a9ce5846", 542, -7);
that.bottomBtnGroup.addChild(that.energyBtn); that.bottomBtnGroup.addChild(that.energyBtn);
that.initActBtn(); that.initActBtn();
that.initCatInfoGroup(); that.initCatInfoGroup();
that.initFishPointGroup(); that.initFishPointGroup();
that.shapGoBtn = Ins_1.Ins.initSprite("dba58651-57a3-4b75-9447-0e4d498dd8cd"); that.shapGoBtn = Ins_1.Ins.initButton("dba58651-57a3-4b75-9447-0e4d498dd8cd");
that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137); that.shapGoBtn.position.set((Ins_1.Ins.stageW - that.shapGoBtn.width) >> 1, 137);
that.bottomBtnGroup.addChild(that.shapGoBtn); that.bottomBtnGroup.addChild(that.shapGoBtn);
that.updateUserInfo(); that.updateUserInfo();
...@@ -47417,17 +47508,17 @@ var MainSceneBtnUi = (function (_super) { ...@@ -47417,17 +47508,17 @@ var MainSceneBtnUi = (function (_super) {
}; };
MainSceneBtnUi.prototype.initActBtn = function () { MainSceneBtnUi.prototype.initActBtn = function () {
var that = this; var that = this;
that.combingBtn = Ins_1.Ins.initSprite("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8", 69); that.combingBtn = Ins_1.Ins.initButton("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8", 69);
that.bottomBtnGroup.addChild(that.combingBtn); that.bottomBtnGroup.addChild(that.combingBtn);
that.catBtn = Ins_1.Ins.initSprite("0b44efa9-1e8a-4c43-a2a5-93852d88918c", 214); that.catBtn = Ins_1.Ins.initButton("0b44efa9-1e8a-4c43-a2a5-93852d88918c", 214);
that.bottomBtnGroup.addChild(that.catBtn); that.bottomBtnGroup.addChild(that.catBtn);
that.returnBtn = Ins_1.Ins.initSprite("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb", 69); that.returnBtn = Ins_1.Ins.initButton("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb", 69);
that.bottomBtnGroup.addChild(that.returnBtn); that.bottomBtnGroup.addChild(that.returnBtn);
that.touchHeadBtn = Ins_1.Ins.initSprite("b7ec0f16-ea48-4e41-8def-7cc660fa93d7", 214); that.touchHeadBtn = Ins_1.Ins.initButton("b7ec0f16-ea48-4e41-8def-7cc660fa93d7", 214);
that.bottomBtnGroup.addChild(that.touchHeadBtn); that.bottomBtnGroup.addChild(that.touchHeadBtn);
that.playBtn = Ins_1.Ins.initSprite("922deced-62d2-4995-9dd6-82bc7913f362", 214); that.playBtn = Ins_1.Ins.initButton("922deced-62d2-4995-9dd6-82bc7913f362", 214);
that.bottomBtnGroup.addChild(that.playBtn); that.bottomBtnGroup.addChild(that.playBtn);
that.catRecall = Ins_1.Ins.initSprite("72345190-f95b-4152-bccf-393b8a5aa8d0", 69); that.catRecall = Ins_1.Ins.initButton("72345190-f95b-4152-bccf-393b8a5aa8d0", 69);
that.bottomBtnGroup.addChild(that.catRecall); that.bottomBtnGroup.addChild(that.catRecall);
that.hideAllActBtn(); that.hideAllActBtn();
that.changeBtnByUiType(that.uiType); that.changeBtnByUiType(that.uiType);
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