Commit eeaddacf authored by haiyoucuv's avatar haiyoucuv

1

parent 0b717c2f
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1577324647364</updated> <updated>1577324647364</updated>
<workItem from="1577324653437" duration="32303000" /> <workItem from="1577324653437" duration="32303000" />
<workItem from="1577410840738" duration="3763000" /> <workItem from="1577410840738" duration="4120000" />
</task> </task>
<servers /> <servers />
</component> </component>
......
...@@ -429,44 +429,43 @@ export default class Crop extends eui.Component { ...@@ -429,44 +429,43 @@ export default class Crop extends eui.Component {
} }
this.cropMv && this.removeChild(this.cropMv) && (this.cropMv = null); this.cropMv && this.removeChild(this.cropMv) && (this.cropMv = null);
this.optionMv && this.removeChild(this.optionMv) && (this.optionMv = null); this.optionMv && this.removeChild(this.optionMv) && (this.optionMv = null);
let _name = ''; let upName = '';
if((petData[this.petId].type == 'plant' && this.state == 3) if((petData[this.petId].type == 'plant' && this.state == 3)
|| (petData[this.petId].type == 'animal' && this.state == 4) || (petData[this.petId].type == 'animal' && this.state == 4)
|| this.data.data.canGather) { || this.data.data.canGather) {
_name = 'up2'; upName = 'up2';
} else { } else {
_name = 'up1'; upName = 'up1';
} }
/// TODO 坑爹,1级展示未成熟,2级展示未成熟, 三级展示半成熟,只有可收取才展示成熟 /// TODO 坑爹,1级展示未成熟,2级展示未成熟, 三级展示半成熟,只有可收取才展示成熟
let mvId = (this.state == 1) ? this.state : this.state - 1; let mvId = (this.state == 1) ? this.state : this.state - 1;
// console.log(this.data.data.canGather); // console.log(this.data.data.canGather);
(this.data.data.canGather) ? mvId = (petData[this.petId].type == 'animal' ? 4 : 3) : mvId; (this.data.data.canGather) ? mvId = (petData[this.petId].type == 'animal' ? 4 : 3) : mvId;
/// TODO 坑爹,1级展示未成熟,2级展示未成熟, 三级展示半成熟,只有可收取才展示成熟 /// TODO 坑爹,1级展示未成熟,2级展示未成熟, 三级展示半成熟,只有可收取才展示成熟
loadSvga(getSvga(_name)).then( // 加载升级动画 loadSvga(getSvga(upName)).then( // 加载升级动画
(__mv: egret.MovieClip) => { (upMv: egret.MovieClip) => {
loadSvga(getSvga(`${petData[this.petId].key}${mvId}_birth`)).then( // 加载出生动画 loadSvga(getSvga(`${petData[this.petId].key}${mvId}_birth`)).then( // 加载出生动画
(_mv: egret.MovieClip) => { (birthMv: egret.MovieClip) => {
__mv.gotoAndPlay(1, 1); upMv.gotoAndPlay(1, 1);
__mv.x = (_name == 'up2') ? 0 : 10; upMv.x = (upName == 'up2') ? 0 : 10;
__mv.y = (_name == 'up2') ? -35 : 20; upMv.y = (upName == 'up2') ? -35 : 20;
this.addChild(__mv); this.addChild(upMv);
__mv.addEventListener(egret.Event.COMPLETE, () => { upMv.addEventListener(egret.Event.COMPLETE, () => {
this.removeChild(__mv); this.removeChild(upMv);
}, this); }, this);
this.addChild(_mv); this.addChild(birthMv);
let pos = (mvId == 3 && this.petId == 4) ? petData[this.petId]['catherPos'] : petData[this.petId]['pos']; let pos = (mvId == 3 && this.petId == 4) ? petData[this.petId]['catherPos'] : petData[this.petId]['pos'];
_mv.x = pos[0]; birthMv.x = pos[0];
_mv.y = pos[1]; birthMv.y = pos[1];
_mv.addEventListener(egret.Event.COMPLETE, () => { birthMv.addEventListener(egret.Event.COMPLETE, () => {
_mv.stop(); birthMv.stop();
let name = `${petData[this.petId].key}${mvId}`; let name = `${petData[this.petId].key}${mvId}`;
loadSvga(getSvga(name)).then( loadSvga(getSvga(name)).then(
(mv: egret.MovieClip) => { (mv: egret.MovieClip) => {
this.removeChild(_mv); this.removeChild(birthMv);
this.addChild(mv); this.addChild(mv);
this.cropMv = mv; this.cropMv = mv;
this.cropMv.x = pos[0]; this.cropMv.x = pos[0];
this.cropMv.y = pos[1]; this.cropMv.y = pos[1];
this.cropMv.pixelHitTest = true; this.cropMv.pixelHitTest = true;
...@@ -489,8 +488,8 @@ export default class Crop extends eui.Component { ...@@ -489,8 +488,8 @@ export default class Crop extends eui.Component {
private addOption(name) { private addOption(name) {
this.optionMv && this.removeChild(this.optionMv) && (this.optionMv = null); this.optionMv && this.removeChild(this.optionMv) && (this.optionMv = null);
loadSvga(getSvga(name)).then( loadSvga(getSvga(name)).then(
(mv: egret.DisplayObject) => { (optionMv: egret.DisplayObject) => {
this.optionMv = mv; this.optionMv = optionMv;
this.addChild(this.optionMv); this.addChild(this.optionMv);
this.optionMv.x = 80; this.optionMv.x = 80;
this.optionMv.y = -85; this.optionMv.y = -85;
......
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