Commit f832654d authored by AU-Pro-mac's avatar AU-Pro-mac

fixed conflect

parents b4b8bbd1 8e0b53c7
import resCanvasList from "./resCanvasList"; import resCanvasList from "./resCanvasList";
const BlueCatTexture = require("./src/lottieSrc/lottieTextureJson/BlueCatTexture.json")
const OrengeCatTexture = require("./src/lottieSrc/lottieTextureJson/OrengeCatTexture.json")
const SanhuaCatTexture = require("./src/lottieSrc/lottieTextureJson/SanhuaCatTexture.json")
const XianluoCatTexture = require("./src/lottieSrc/lottieTextureJson/XianluoCatTexture.json")
const resLottieList = { const resLottieList = {
// "blueCat":{ // "blueCat":{
// imgUrl:resCanvasList["a7dc39fa-5f6d-4e94-8979-81c4a4aa183f"].url, // imgUrl:resCanvasList["a7dc39fa-5f6d-4e94-8979-81c4a4aa183f"].url,
......
...@@ -11,8 +11,7 @@ import resCanvasListCsd from '../resCanvasListCsd' ...@@ -11,8 +11,7 @@ import resCanvasListCsd from '../resCanvasListCsd'
const lottieTexture = require('./openAnimation/Texture.json') const lottieTexture = require('./openAnimation/Texture.json')
import resloadingList from '../resloadingList'; import resloadingList from '../resloadingList';
import resLottieList from '../resLottieList'; import resLottieList from '../resLottieList';
import { setStage } from "./scenes/stage"; // import { setStage } from "./scenes/stage";
import { LoadingScene } from "./scenes/LoadingScene";
import { Ins } from "./Ins"; import { Ins } from "./Ins";
import { InitLottie } from "./initLottie"; import { InitLottie } from "./initLottie";
import { XxlScene } from "./xiaoxiaole/XxlScene"; import { XxlScene } from "./xiaoxiaole/XxlScene";
...@@ -60,7 +59,7 @@ export class Main { ...@@ -60,7 +59,7 @@ export class Main {
FYGE.RENDERER_TYPE.CANVAS FYGE.RENDERER_TYPE.CANVAS
); );
this.stage = stage; this.stage = stage;
setStage(stage); // setStage(stage);
//开始循环 //开始循环
// FYGE.Stage.flushAll(); // FYGE.Stage.flushAll();
//stage初始化 //stage初始化
......
import { Module } from "../../module/views/Module";
import { lanmao01shuijiao } from "../lottieSrc/lottieTs/blueCat/lanmao01shuijiao";
import { lanmao02shuohua } from "../lottieSrc/lottieTs/blueCat/lanmao02shuohua";
import { lanmao03shumao } from "../lottieSrc/lottieTs/blueCat/lanmao03shumao";
import { lanmaolumao } from "../lottieSrc/lottieTs/blueCat/lanmaolumao";
import { lanmao06motou } from "../lottieSrc/lottieTs/blueCat/lanmao06motou";
import { lanmao05wanqiu } from "../lottieSrc/lottieTs/blueCat/lanmao05wanqiu";
import { jumaolumao04 } from "../lottieSrc/lottieTs/orengeCat/jumaolumao04";
import { jumao01 } from "../lottieSrc/lottieTs/orengeCat/jumao01";
import { jumaomotoumao } from "../lottieSrc/lottieTs/orengeCat/jumaomotoumao";
import { jumaoshumao } from "../lottieSrc/lottieTs/orengeCat/jumaoshumao";
import { jumaoshuohua } from "../lottieSrc/lottieTs/orengeCat/jumaoshuohua";
import { jumaowanshua } from "../lottieSrc/lottieTs/orengeCat/jumaowanshua";
import { sanhua01shuijiao } from "../lottieSrc/lottieTs/sanhuaCat/sanhua01shuijiao";
import { sanhua02shuohua2 } from "../lottieSrc/lottieTs/sanhuaCat/sanhua02shuohua 2";
import { sanhua03shumao } from "../lottieSrc/lottieTs/sanhuaCat/sanhua03shumao";
import { sanhua05wanqiu } from "../lottieSrc/lottieTs/sanhuaCat/sanhua05wanqiu";
import { sanhua06motou } from "../lottieSrc/lottieTs/sanhuaCat/sanhua06motou";
import { sanhualumao } from "../lottieSrc/lottieTs/sanhuaCat/sanhualumao";
import { xianluo03shumao } from "../lottieSrc/lottieTs/xianluoCat/xianluo03shumao";
import { xianluo04wanqiu } from "../lottieSrc/lottieTs/xianluoCat/xianluo04wanqiu";
import { xianluo05motou } from "../lottieSrc/lottieTs/xianluoCat/xianluo05motou";
import { xianluolumao } from "../lottieSrc/lottieTs/xianluoCat/xianluolumao";
import { xianluomao01 } from "../lottieSrc/lottieTs/xianluoCat/xianluomao01";
import { xianluoshuohua } from "../lottieSrc/lottieTs/xianluoCat/xianluoshuohua";
import { CATTYPE, MSG, CAT_ACTTYPEP } from "../Enum";
import { Ins } from "../Ins";
export class Cat extends Module {
constructor(data?: any) {
super(data);
this.catType = data.type;
}
catType: any;
cat_sleep: FYGE.Lottie; //睡觉
cat_talk: FYGE.Lottie; //说话
cat_clear: FYGE.Lottie; //梳毛
cat_rua: FYGE.Lottie; //撸猫
cat_play: FYGE.Lottie; //玩球
cat_touch: FYGE.Lottie; //摸头
catAnimArr: FYGE.Lottie[] = []; //猫咪lottie实例组
catLottieArr: any //猫咪lottie数据组
actRunning:boolean = false; //动效是否进行中,如果动效进行中,无法进行其他动效
initUi() {
this.initCatLottieArr();
console.log(this.catLottieArr);
this.initCat();
this.setCatAnimShow(0);
this.initEvents();
}
/**初始化猫咪Lottie数据组 */
initCatLottieArr() {
this.catLottieArr = {
"blue": {
sleep: lanmao01shuijiao,
talk: lanmao02shuohua,
clear: lanmao03shumao,
rua: lanmaolumao,
play: lanmao05wanqiu,
touch: lanmao06motou
},
"orenge": {
sleep: jumao01,
talk: jumaoshumao,
clear: jumaoshumao,
rua: jumaolumao04,
play: jumaowanshua,
touch: jumaomotoumao
},
"sanhua": {
sleep: sanhua01shuijiao,
talk: sanhua02shuohua2,
clear: sanhua03shumao,
rua: sanhualumao,
play: sanhua05wanqiu,
touch: sanhua06motou
},
"xianluo": {
sleep: xianluomao01,
talk: xianluoshuohua,
clear: xianluo03shumao,
rua: xianluolumao,
play: xianluo04wanqiu,
touch: xianluo05motou
}
}
}
/**初始化猫咪动作 */
initCat() {
var that = this;
that.cat_sleep = new FYGE.Lottie(that.catLottieArr[that.catType].sleep);
that.addChild(that.cat_sleep);
that.catAnimArr.push(that.cat_sleep);
that.cat_talk = new FYGE.Lottie(that.catLottieArr[that.catType].talk);
that.addChild(that.cat_talk);
that.catAnimArr.push(that.cat_talk);
that.cat_clear = new FYGE.Lottie(that.catLottieArr[that.catType].clear);
that.addChild(that.cat_clear);
that.catAnimArr.push(that.cat_clear);
that.cat_rua = new FYGE.Lottie(that.catLottieArr[that.catType].rua);
that.addChild(that.cat_rua);
that.catAnimArr.push(that.cat_rua);
that.cat_play = new FYGE.Lottie(that.catLottieArr[that.catType].play);
that.addChild(that.cat_play);
that.catAnimArr.push(that.cat_play);
that.cat_touch = new FYGE.Lottie(that.catLottieArr[that.catType].touch);
that.addChild(that.cat_touch);
that.catAnimArr.push(that.cat_touch);
}
curAnim: number = 0;
/**根据index显示猫咪动画
* 0:睡觉,1:说话,2:梳毛,3:撸猫,4:玩球,5:摸头
*/
setCatAnimShow(index: number, callback?: () => void) {
if(index == 0||index==1){
this.actRunning = false;
}
for (let i = 0; i < this.catAnimArr.length; i++) {
if (i == index) {
this.catAnimArr[i].visible = true;
let loop = callback ? 1 : 0;
console.log("hahaha", loop);
Ins.stopLottieAnim(this.catAnimArr[i]);
this.catAnimArr[i].play(loop, callback);
console.log("播放", index);
} else {
this.catAnimArr[i].visible = false;
Ins.stopLottieAnim(this.catAnimArr[i]);
}
}
}
/**猫咪互动 */
catAct(e) {
if(this.actRunning) return;
var that = this;
let actType = e.data;
console.log(actType);
// switch(actType){
// case CAT_ACTTYPEP.SLEEP:
// break;
// case CAT_ACTTYPEP.TALK:
// break;
// case CAT_ACTTYPEP.CLEAR:
// break;
// case CAT_ACTTYPEP.RUA:
// break;
// case CAT_ACTTYPEP.PLAY:
// break;
// case CAT_ACTTYPEP.TOUCH:
// break;
// }
this.actRunning = true;
switch (actType) {
case CAT_ACTTYPEP.SLEEP:
break;
default:
that.setCatAnimShow(actType, () => { that.setCatAnimShow(0, null) });
break;
}
}
initEvents() {
FYGE.GDispatcher.addEventListener(MSG.CAT_ACT, this.catAct, this);
}
removeEvents() {
FYGE.GDispatcher.removeEventListener(MSG.CAT_ACT, this.catAct, this);
}
}
\ No newline at end of file
import { Panel } from "../../module/views/Panel";
import { Ins } from "../Ins";
export class RulePanel extends Panel{
constructor(data?:any){
super(data)
}
initUi(){
var bg = Ins.initSprite("41365963-7e27-42a2-963d-157d40b0fb6d");
this.addChild(bg);
this.x = (Ins.stageW - bg.width)>>1;
this.y = (Ins.stageH - bg.height)>>1;
var ruleLabel = Ins.initLabel({size:24,text:"规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则"})
var ruleView = new FYGE.ScrollPage(574,279,ruleLabel.textHeight)
ruleView.isSpringBack = false;
ruleView.x = 76;
ruleView.y = 167;
this.addChild(ruleView);
ruleView.view.addChild(ruleLabel);
// ruleLabel.text.replace("规则","aa")
}
}
\ No newline at end of file
import { Panel } from "../../module/views/Panel";
export class SetCatNamePanel extends Panel{
constructor(data?:any){
super(data);
}
/**名字输入框 */
nameInput:FYGE.TextField;
initUi(){
// FYGE.inputFeildIosEnable
this.nameInput = new FYGE.TextField();
// this.nameInput.lineType
}
}
\ No newline at end of file
import { Module } from "../../../module/views/Module";
import { MSG } from "../../Enum";
import { Ins } from "../../Ins";
export class SelectCatGroup extends Module {
constructor(data?: any) {
super(data);
this.type = data.type;
this.imgUUid = data.uuid;
this.nameText = data.name;
// this.addEventListener(FYGE.Event.REMOVED_FROM_STAGE, this.destroy, this)
}
/**猫咪图片uuid */
private imgUUid: string;
/**被选中图片 */
private isSelectImg: FYGE.Sprite;
/**类型 */
private type: number;
/**猫咪名称 */
private nameText: string;
initUi() {
var that = this;
that.mouseEnable = true;
that.mouseChildren = true;
var bg = Ins.initSprite("8850353b-0a98-4335-9d46-a36678f44be0");
that.addChild(bg);
var catImg = Ins.initSprite(that.imgUUid, 67, 36);
that.addChild(catImg);
var nameLabel = Ins.initLabel({ size: 24, x: 32, y: 207, text: that.nameText ? that.nameText : "田园橘猫" });
nameLabel.textWidth = 232;
nameLabel.textAlign = FYGE.TEXT_ALIGN.CENTER;
that.addChild(nameLabel);
that.isSelectImg = Ins.initSprite("f956cda2-5eef-4942-8737-742d171527bd", 224, 172);
that.addChild(that.isSelectImg);
if (that.type == 0) {
that.isSelectImg.visible = true;
} else {
that.isSelectImg.visible = false;
}
that.initEvents();
}
initEvents() {
this.addEventListener(FYGE.MouseEvent.CLICK, this.selected, this);
FYGE.GDispatcher.addEventListener(MSG.SELECT_CAT, this.changeState, this);
}
removeEvents() {
this.removeEventListener(FYGE.MouseEvent.CLICK, this.selected, this);
FYGE.GDispatcher.removeEventListener(MSG.SELECT_CAT, this.changeState, this);
}
/**更新状态 */
changeState(e){
if(e.data == this.type){
this.isSelectImg.visible = true;
}else{
this.isSelectImg.visible = false;
}
}
/**选择 */
selected() {
var that = this;
that.isSelectImg.visible = !that.isSelectImg.visible;
FYGE.GDispatcher.dispatchEvent(MSG.SELECT_CAT, that.type);
}
}
\ No newline at end of file
import { changeScene, closeCurrentPanel } from "../../../module/ctrls";
import { Panel } from "../../../module/views/Panel";
import { MSG } from "../../Enum";
import { Ins } from "../../Ins";
import { MainScene } from "../../scenes/MainScene";
import { SelectCatGroup } from "./SelectCatGroup";
export class SelectCatPanel extends Panel {
/**当前选择的类型 */
curSelectType: number = 0;
/**确认选择按钮 */
selectSureBtn: FYGE.Sprite;
initUi() {
var that = this;
var bg = Ins.initSprite("db53267d-4141-4d3e-afda-9b523c89be3e");
that.addChild(bg);
that.x = (Ins.stageW - bg.width) >> 1;
that.y = Ins.stageH < 1624 ? (Ins.stageH - bg.height + 300) >> 1 : (Ins.stageH - bg.height) >> 1;
that.selectSureBtn = Ins.initSprite("628fc38b-7dc0-4c69-aac1-279d60c8f1ed", 185, 804);
that.addChild(that.selectSureBtn);
that.initSelectCatGroup();
}
initSelectCatGroup() {
var catData = [
{ img: "e28e5250-c740-4e4f-a855-c415c557e77e", name: "11111" },
{ img: "193f6955-d754-4b9f-80ca-b9b9a72e8a8b", name: "22222" },
{ img: "fe52ffae-fadd-40f3-97b5-d3d56fd04781", name: "33333" },
{ img: "95a6b0a9-3e7a-4a0b-82b6-6742e2a8bddf", name: "44444" }];
for (let i = 0; i < 4; i++) {
var selectCatGroup = new SelectCatGroup({ type: i, uuid: catData[i].img, name: catData[i].name });
selectCatGroup.x = 43 + i % 2 * 334;
selectCatGroup.y = 197 + Math.floor(i / 2) * 304;
this.addChild(selectCatGroup);
}
}
/**获取选择信息 */
catSelect(e) {
this.curSelectType = e.data;
console.log("选择了", e.data)
}
/**确认选择 */
selectSure() {
//弹出取名弹窗
closeCurrentPanel();
changeScene(MainScene);
}
initEvents() {
FYGE.GDispatcher.addEventListener(MSG.SELECT_CAT, this.catSelect, this);
this.selectSureBtn.addEventListener(FYGE.MouseEvent.CLICK, this.selectSure, this);
}
removeEvents() {
FYGE.GDispatcher.removeEventListener(MSG.SELECT_CAT, this.catSelect, this);
this.selectSureBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.selectSure, this);
}
}
\ No newline at end of file
import { RES } from "../../module/RES";
import resCanvasList from "../../resCanvasList";
export default class DropItem extends FYGE.Sprite {
constructor() {
super();
this.texture = RES.getRes(
resCanvasList["593e9d74-4944-496a-b6c1-8316756f8bf7"].url
);
this.y = 0;
}
updatePosition() {
this.y += 10;
}
}
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