Commit c5ddb2aa authored by Edwise's avatar Edwise 🍷

ok

parent ff65b3cf
No preview for this file type
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
"name": "shop" "name": "shop"
}, },
{ {
"keys": "option_left_png,option_right_png,option_scrollbar_png,ex_panda_png,ex_buybtn_png,ex_close_png,hotballoon_png,道具数量框_png,光线_png,水_半_png,水_空_png,水_满_png,饲料_半_png,饲料_空_png,饲料_满_png,roalightimg_png,closebtn_png,exd_fail_bg_png,iknowbtn_png,lightdotimg_png,roalightbg_png,奖品1_png,我要兑换按钮_png,奖品12_png,我要兑换按钮2_png,ex_buybtn2_png,ex_close2_png,ex_panda2_png,closebtn2_png,exd_fail_bg2_png,iknowbtn2_png,lightdotimg2_png,roalightbg2_png,roalightimg2_png,hotballoon2_png,option_left2_png,option_right2_png,option_scrollbar2_png,规则背景_png,规则关闭_png,introduce_bg_new_png,introduce_btn_close_png,introduce_btn_new_png,shopPanel_close_png,shop_btn_-_png,shop_btn_+_png,shop_item_bg_big_png,shop_item_cntBg_png,prop_apple_png,prop_papaya_png,shopBuy_close_btn_png,warehouse_close_btn_png,papaya_bg_png,apple_bg_png,sellOutLine_png,sell_+_en_png,sell_-_en_png,task_close_btn_png,task_brn_bg_dis_png,欢趣竞猜 icon_png,趣赶集 icon_png,newUserCloseBtn_png,noFeed_bg_png,noFeed_sr_btn_png,noWater_btn_png,noWater_bg_png,oldUserClose_png,sellTitle_apple_png,sellTitle_papaya_png,introduce_apple_png,introduce_papaya_png,横幅_png,index_liba_png,进度条_ed_png,gameGroup_close_png,木瓜_png,苹果_png,饲料_new_png,浇水_new_png", "keys": "option_left_png,option_right_png,option_scrollbar_png,ex_panda_png,ex_buybtn_png,ex_close_png,hotballoon_png,道具数量框_png,光线_png,水_半_png,水_空_png,水_满_png,饲料_半_png,饲料_空_png,饲料_满_png,roalightimg_png,closebtn_png,exd_fail_bg_png,iknowbtn_png,lightdotimg_png,roalightbg_png,奖品1_png,我要兑换按钮_png,奖品12_png,我要兑换按钮2_png,ex_buybtn2_png,ex_close2_png,ex_panda2_png,closebtn2_png,exd_fail_bg2_png,iknowbtn2_png,lightdotimg2_png,roalightbg2_png,roalightimg2_png,hotballoon2_png,option_left2_png,option_right2_png,option_scrollbar2_png,规则背景_png,规则关闭_png,introduce_bg_new_png,introduce_btn_close_png,introduce_btn_new_png,shopPanel_close_png,shop_btn_-_png,shop_btn_+_png,shop_item_bg_big_png,shop_item_cntBg_png,prop_apple_png,prop_papaya_png,shopBuy_close_btn_png,warehouse_close_btn_png,papaya_bg_png,apple_bg_png,sellOutLine_png,sell_+_en_png,sell_-_en_png,task_close_btn_png,task_brn_bg_dis_png,欢趣竞猜 icon_png,趣赶集 icon_png,newUserCloseBtn_png,noFeed_bg_png,noFeed_sr_btn_png,noWater_btn_png,noWater_bg_png,oldUserClose_png,sellTitle_apple_png,sellTitle_papaya_png,introduce_apple_png,introduce_papaya_png,横幅_png,index_liba_png,进度条_ed_png,gameGroup_close_png,木瓜_png,苹果_png,饲料_new_png,浇水_new_png,小E阴影_png",
"name": "preload" "name": "preload"
} }
], ],
...@@ -1660,6 +1660,11 @@ ...@@ -1660,6 +1660,11 @@
"name": "浇水_new_png", "name": "浇水_new_png",
"type": "image", "type": "image",
"url": "assets/task_panel/浇水_new.png" "url": "assets/task_panel/浇水_new.png"
},
{
"name": "小E阴影_png",
"type": "image",
"url": "assets/index_scene/小E阴影.png"
} }
] ]
} }
\ No newline at end of file
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<e:Image id="bg" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0" source="guide_bg_jpg" visible="false"/> <e:Image id="bg" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0" source="guide_bg_jpg" visible="false"/>
<e:Group id="guideBack" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624" touchChildren="false" touchEnabled="false"/> <e:Group id="guideBack" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624" touchChildren="false" touchEnabled="false"/>
<e:Rect verticalCenter="0" top="0" horizontalCenter="0" left="0" right="0" bottom="0" fillAlpha="0.6"/> <e:Rect verticalCenter="0" top="0" horizontalCenter="0" left="0" right="0" bottom="0" fillAlpha="0.6"/>
<e:Group id="guide1" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624" visible="false" locked="true"> <e:Group id="guide1" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624" locked="true" visible="false">
<e:Image source="plant_land_active_png" x="208" y="558"/> <e:Image source="plant_land_active_png" x="188" y="546"/>
<e:Image id="guide1_tip" source="guide1_tip_png" x="224.5" y="736"/> <e:Image id="guide1_tip" source="guide1_tip_png" x="224.5" y="736"/>
<e:Button id="guide1_btn" label="" anchorOffsetX="95" anchorOffsetY="23" y="1148" horizontalCenter="0"> <e:Button id="guide1_btn" label="" anchorOffsetX="95" anchorOffsetY="23" y="1148" horizontalCenter="0">
<e:skinName> <e:skinName>
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
</e:Button> </e:Button>
<e:Image verticalCenter="484.5" y="1236" scaleX="1" scaleY="1" horizontalCenter="79.5" source="商店_png" x="401"/> <e:Image verticalCenter="484.5" y="1236" scaleX="1" scaleY="1" horizontalCenter="79.5" source="商店_png" x="401"/>
</e:Group> </e:Group>
<e:Group id="guide2" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624" visible="false" locked="true"> <e:Group id="guide2" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624" visible="false">
<e:Image source="guide2_land_png" x="190" y="468"/> <e:Image source="guide2_land_png" x="180" y="458"/>
<e:Image id="guide2_tip" x="224.5" y="736" source="guide2_tip_png"/> <e:Image id="guide2_tip" x="224.5" y="736" source="guide2_tip_png"/>
<e:Button id="guide2_btn" label="" anchorOffsetY="23" anchorOffsetX="95" verticalCenter="342.5" horizontalCenter="0"> <e:Button id="guide2_btn" label="" anchorOffsetY="23" anchorOffsetX="95" verticalCenter="342.5" horizontalCenter="0">
<e:skinName> <e:skinName>
......
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
<w:Config id="16e64c53e86"/> <w:Config id="16e64c53e86"/>
<e:Group id="group" horizontalCenter="0" verticalCenter="0" left="0" right="0" bottom="0" top="0"> <e:Group id="group" horizontalCenter="0" verticalCenter="0" left="0" right="0" bottom="0" top="0">
<e:Image id="bg" source="index_bg_png" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0"/> <e:Image id="bg" source="index_bg_png" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0"/>
<e:Image source="小E阴影_png" x="290" verticalCenter="-300"/>
<e:Group id="gameLayer" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624" locked="true"> <e:Group id="gameLayer" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624" locked="true">
</e:Group> </e:Group>
<e:Group id="houseBtn" width="212" height="300" x="0" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="-330" locked="true"> <e:Group id="houseBtn" width="212" height="300" x="0" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="-330" locked="true">
</e:Group> </e:Group>
<e:Group id="xiaoEGroup" x="220" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="-140" visible="false"> <e:Group id="xiaoEGroup" x="220" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="-190" visible="false">
<e:Image source="xiaoETip_bg_png" x="0" y="0"/> <e:Image source="xiaoETip_bg_png" x="0" y="0"/>
<e:Label text="哈喽小主人,你想了解哪些内容?" x="26" y="20" textColor="0x785332" size="24" bold="true"/> <e:Label text="哈喽小主人,你想了解哪些内容?" x="26" y="20" textColor="0x785332" size="24" bold="true"/>
<e:Scroller top="60" right="21" left="26" height="160"> <e:Scroller top="60" right="21" left="26" height="160">
...@@ -20,7 +21,7 @@ ...@@ -20,7 +21,7 @@
</e:Group> </e:Group>
</e:Scroller> </e:Scroller>
</e:Group> </e:Group>
<e:Group id="xiaoEAnswer" x="220" anchorOffsetX="0" anchorOffsetY="0" touchChildren="true" verticalCenter="-140" visible="false"> <e:Group id="xiaoEAnswer" x="220" anchorOffsetX="0" anchorOffsetY="0" touchChildren="true" verticalCenter="-190" visible="false">
<e:Image source="xiaoETip_bg_png" x="0" y="0"/> <e:Image source="xiaoETip_bg_png" x="0" y="0"/>
<e:Label id="answerTitle" text="哈喽小主人,你想了解哪些内容?" x="26" y="20" size="24" bold="true" textColor="0x785332"/> <e:Label id="answerTitle" text="哈喽小主人,你想了解哪些内容?" x="26" y="20" size="24" bold="true" textColor="0x785332"/>
<e:Scroller width="386" height="138" x="26" y="52"> <e:Scroller width="386" height="138" x="26" y="52">
...@@ -31,14 +32,14 @@ ...@@ -31,14 +32,14 @@
<e:Label id="xiaoEIKnow" text="我知道了&gt;" x="315" y="200.04" size="22" bold="true" anchorOffsetX="0" anchorOffsetY="0" textColor="0x785332"/> <e:Label id="xiaoEIKnow" text="我知道了&gt;" x="315" y="200.04" size="22" bold="true" anchorOffsetX="0" anchorOffsetY="0" textColor="0x785332"/>
</e:Group> </e:Group>
<e:Image id="xiaoE1" x="24" source="小E_png" verticalCenter="62.5" visible="false"/> <e:Image id="xiaoE1" x="24" source="小E_png" verticalCenter="62.5" visible="false"/>
<e:Image id="hotballoon" source="hotballoon_png" x="334.12" verticalCenter="-501.5" locked="true"/> <e:Image id="hotballoon" source="hotballoon_png" x="334.12" verticalCenter="-550"/>
<e:Group id="xiaoETip" x="180" anchorOffsetX="0" anchorOffsetY="0" touchChildren="false" y="540" visible="false"> <e:Group id="xiaoETip" x="180" anchorOffsetX="0" anchorOffsetY="0" touchChildren="false" y="540" visible="false">
<e:Image id="xiaoETipImg" x="0" y="0" scaleX="1" scaleY="1" source="xiaoETip_get_png"/> <e:Image id="xiaoETipImg" x="0" y="0" scaleX="1" scaleY="1" source="xiaoETip_get_png"/>
</e:Group> </e:Group>
<e:Group id="advertBtn" width="303.03" height="212.13" x="339.15" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="-603" locked="true"/> <e:Group id="advertBtn" width="303.03" height="212.13" x="339.15" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="-603" locked="true"/>
<e:Group id="xiaoE" width="206.06" height="175.77" x="346.12" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="-371" locked="true"> <e:Group id="xiaoE" width="206.06" height="175.77" x="346.12" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="-421">
</e:Group> </e:Group>
<e:Group id="posterGroup" width="312" height="84" x="279" verticalCenter="-299" locked="true"> <e:Group id="posterGroup" width="312" height="84" x="279" verticalCenter="-350">
<e:Image id="posterImg" source="横幅_png" x="0" y="0" scaleX="1" scaleY="1" touchEnabled="false"/> <e:Image id="posterImg" source="横幅_png" x="0" y="0" scaleX="1" scaleY="1" touchEnabled="false"/>
<e:Label id="posterLabel" text="快来当快乐农场主吧" y="36" textColor="0xb94401" horizontalCenter="0" size="24" touchEnabled="false"/> <e:Label id="posterLabel" text="快来当快乐农场主吧" y="36" textColor="0xb94401" horizontalCenter="0" size="24" touchEnabled="false"/>
</e:Group> </e:Group>
......
...@@ -57,6 +57,7 @@ export default class ExchangePanel extends Panel { ...@@ -57,6 +57,7 @@ export default class ExchangePanel extends Panel {
showToast('商品无库存,耐心等待商品补货后再来吧'); showToast('商品无库存,耐心等待商品补货后再来吧');
return; return;
} }
console.log('库存是否充足--->>',this.canGet())
if (!this.canGet()) { if (!this.canGet()) {
// showToast('啊哦,合成所需食材不足,快去赚食材吧'); // showToast('啊哦,合成所需食材不足,快去赚食材吧');
PanelCtrl.instance.show(ModuleTypes.EXCHANGED_PANEL, { PanelCtrl.instance.show(ModuleTypes.EXCHANGED_PANEL, {
...@@ -107,13 +108,15 @@ export default class ExchangePanel extends Panel { ...@@ -107,13 +108,15 @@ export default class ExchangePanel extends Panel {
this.introduce.text = `商品介绍:${title[1] || '无'}`; this.introduce.text = `商品介绍:${title[1] || '无'}`;
this.stock.text = `剩余数量:${this.data.stock}`; this.stock.text = `剩余数量:${this.data.stock}`;
this.setNeed(); this.setNeed();
this.setBtn(); // this.setBtn();
let key0 = Object.keys(this.data.spMap)[0]; let key0 = Object.keys(this.data.spMap)[0];
let changespnum = this.data.spMap[key0]; let changespnum = this.data.spMap[key0];
console.error("兑换id", changespnum); console.error("兑换id", changespnum);
let danwei = productData[key0].numLabel; let danwei = productData[key0].numLabel;
let iprice = productData[key0].price; let iprice = productData[key0].price;
let name = productData[key0].nameLabel;
console.log('兑换所需-->',key0,productData[key0])
if (iprice == 0) { if (iprice == 0) {
NetManager.ins.priceInfo((success, res) => { NetManager.ins.priceInfo((success, res) => {
if (!success) { if (!success) {
...@@ -124,28 +127,30 @@ export default class ExchangePanel extends Panel { ...@@ -124,28 +127,30 @@ export default class ExchangePanel extends Panel {
productData[k].price = data[k]; productData[k].price = data[k];
} }
iprice = productData[key0].price; iprice = productData[key0].price;
this.newextxt.text = `今天我需要「${changespnum}${danwei}跟你换实物哦, 或者直接卖给我,每袋可以得「20」欢趣豆。 考虑看看呢?`; this.newextxt.text = `今天我需要「${changespnum}${danwei}${name}跟你换${this.data.name}哦, 或者直接卖给我,每袋可以得「${iprice}」欢趣豆。 考虑看看呢?`;
}); });
} else { } else {
this.newextxt.text = `今天我需要「${changespnum}${danwei}跟你换实物哦, 或者直接卖给我,每袋可以得「20」欢趣豆。 考虑看看呢?`; this.newextxt.text = `今天我需要「${changespnum}${danwei}${name}跟你换${this.data.name}哦, 或者直接卖给我,每袋可以得「${iprice}」欢趣豆。 考虑看看呢?`;
} }
} }
private setBtn() { private setBtn() {
this.canGet().then( //TODO 不需要设置btn了! 2021-05-10
(res) => { // this.canGet().then(
this.btn.source = 'ex_btn_png'; // (res) => {
this.btn.touchEnabled = true; // this.btn.source = 'ex_btn_png';
}, // this.btn.touchEnabled = true;
(err) => { // },
this.btn.source = err; // (err) => {
this.btn.touchEnabled = false; // this.btn.source = err;
} // this.btn.touchEnabled = false;
); // }
// );
} }
private canGet(): Promise<boolean> { private canGet() {
return new Promise<boolean>((resolve, reject) => { //TODO 不需要异步!直接判断! 2021—05-10
// return new Promise<boolean>((resolve, reject) => {
const showList = []; const showList = [];
for (let spk in this.data['spMap']) { for (let spk in this.data['spMap']) {
showList.push(spk); showList.push(spk);
...@@ -153,12 +158,14 @@ export default class ExchangePanel extends Panel { ...@@ -153,12 +158,14 @@ export default class ExchangePanel extends Panel {
const products: {} = G_GetHomeDataByKey(HOME.PRODUCT); const products: {} = G_GetHomeDataByKey(HOME.PRODUCT);
for (let v of showList) { for (let v of showList) {
if (this.data['spMap'][v] > products[v]) { // 有一项不足,不能合成 if (this.data['spMap'][v] > products[v]) { // 有一项不足,不能合成
reject('ex_btn_dis_png'); // reject('ex_btn_dis_png');
return; // reject(false)
return false;
} }
} }
resolve(true); // 以上都没有,可以合成 return true
}); // resolve(true); // 以上都没有,可以合成
// });
} }
// 显示需要的道具 // 显示需要的道具
......
...@@ -333,7 +333,7 @@ class ShopItem extends Component { ...@@ -333,7 +333,7 @@ class ShopItem extends Component {
let count = spdata1[spId]; let count = spdata1[spId];
let maxCount = Tools.frontInfo.data.spLimit; let maxCount = Tools.frontInfo.data.spLimit;
if(count>=maxCount){ if(count>=maxCount){
showToast("已达上限"); showToast("道具已达上限,先去消耗掉再来兑换吧~");
return; return;
} }
} }
......
...@@ -315,6 +315,7 @@ export default class WareHousePanel extends Panel { ...@@ -315,6 +315,7 @@ export default class WareHousePanel extends Panel {
console.log('aaa---->>',productData) console.log('aaa---->>',productData)
this.cropNoneImg.visible = (showProp.length <= 0); this.cropNoneImg.visible = (showProp.length <= 0);
this.crops.visible = (showProp.length> 0);
const showSeed = []; const showSeed = [];
...@@ -335,6 +336,8 @@ export default class WareHousePanel extends Panel { ...@@ -335,6 +336,8 @@ export default class WareHousePanel extends Panel {
}); });
this.seedNoneImg.visible = (showSeed.length <= 0); this.seedNoneImg.visible = (showSeed.length <= 0);
this.seeds.visible = (showSeed.length > 0);
} }
private async getWareHouseInfo() { private async getWareHouseInfo() {
......
...@@ -39,7 +39,7 @@ export let petData = { ...@@ -39,7 +39,7 @@ export let petData = {
key: 'wheat', key: 'wheat',
name: '水稻', name: '水稻',
type: 'plant', type: 'plant',
pos: [-30, -150], pos: [-25, -135],
propId: 'sp_food_2', propId: 'sp_food_2',
optionSvga: 'ready_water', optionSvga: 'ready_water',
option: 'water', option: 'water',
...@@ -62,7 +62,7 @@ export let petData = { ...@@ -62,7 +62,7 @@ export let petData = {
key: 'cattle', key: 'cattle',
name: '牛', name: '牛',
type: 'animal', type: 'animal',
pos: [-30, -130], pos: [-30, -140],
prop: 'food', prop: 'food',
propId: 'sp_food_1', propId: 'sp_food_1',
optionSvga: 'ready_feed', optionSvga: 'ready_feed',
...@@ -74,7 +74,7 @@ export let petData = { ...@@ -74,7 +74,7 @@ export let petData = {
key: 'potato', key: 'potato',
name: '土豆', name: '土豆',
type: 'plant', type: 'plant',
pos: [-32, -130], pos: [-32, -140],
propId: 'sp_food_2', propId: 'sp_food_2',
optionSvga: 'ready_water', optionSvga: 'ready_water',
option: 'water', option: 'water',
...@@ -96,7 +96,8 @@ export let petData = { ...@@ -96,7 +96,8 @@ export let petData = {
key: 'apple', key: 'apple',
name: '苹果', name: '苹果',
type: 'plant', type: 'plant',
pos: [30, -60], pos: [-32, -155],
pos1:[-32,-155],
propId: 'sp_food_2', propId: 'sp_food_2',
optionSvga: 'ready_water', optionSvga: 'ready_water',
option: 'water', option: 'water',
...@@ -107,7 +108,8 @@ export let petData = { ...@@ -107,7 +108,8 @@ export let petData = {
key: 'papaya', key: 'papaya',
name: '木瓜', name: '木瓜',
type: 'plant', type: 'plant',
pos: [35, -70], pos: [-30, -175],
pos1:[-32,-145],
propId: 'sp_food_2', propId: 'sp_food_2',
optionSvga: 'ready_water', optionSvga: 'ready_water',
option: 'water', option: 'water',
......
import Land from "./Objs/Land"; import Land from "./Objs/Land";
import {MainDispatcher, MainIns} from "./MainScene"; import { MainDispatcher, MainIns } from "./MainScene";
import {NetManager} from "../../../libs/tw/manager/NetManager"; import { NetManager } from "../../../libs/tw/manager/NetManager";
import {GDispatcher} from "../../../libs/tc/util/GDispatcher"; import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import {loadSvga} from "../../comm/loadSvga"; import { loadSvga } from "../../comm/loadSvga";
import {getSvga} from "../../utils"; import { getSvga } from "../../utils";
import M_EVENT from "./MSceneEnum"; import M_EVENT from "./MSceneEnum";
import {M_HideOption} from "./Objs/OptionPanel"; import { M_HideOption } from "./Objs/OptionPanel";
import MovieClip = egret.MovieClip; import MovieClip = egret.MovieClip;
/** /**
...@@ -28,12 +28,12 @@ import MovieClip = egret.MovieClip; ...@@ -28,12 +28,12 @@ import MovieClip = egret.MovieClip;
*/ */
const landPos = [ // 地块位置(注意顺序,影响层级) const landPos = [ // 地块位置(注意顺序,影响层级)
{x: 189, y: 554}, { x: 189, y: 554 },
{x: 422, y: 640}, { x: 422, y: 640 },
{x: 106, y: 725}, { x: 106, y: 725 },
{x: 318, y: 835}, { x: 318, y: 835 },
{x: 49, y: 942}, { x: 49, y: 942 },
{x: 295, y: 1052}, { x: 295, y: 1052 },
]; ];
export default class LandMgr { export default class LandMgr {
...@@ -83,7 +83,7 @@ export default class LandMgr { ...@@ -83,7 +83,7 @@ export default class LandMgr {
*/ */
private async addLand(data) { private async addLand(data) {
for (let v of data) { for (let v of data) {
let newLand = new Land({data: v, index: v.id, x: landPos[v.id - 1].x, y: landPos[v.id - 1].y}); let newLand = new Land({ data: v, index: v.id, x: landPos[v.id - 1].x, y: landPos[v.id - 1].y });
MainIns().gameLayer.addChildAt(newLand, v.id); MainIns().gameLayer.addChildAt(newLand, v.id);
this.lands.push(newLand); // 加入数组方便管理 this.lands.push(newLand); // 加入数组方便管理
} }
...@@ -116,11 +116,11 @@ export default class LandMgr { ...@@ -116,11 +116,11 @@ export default class LandMgr {
const index = id - 1; const index = id - 1;
const land = this.lands[index]; const land = this.lands[index];
const data = res.data[index]; const data = res.data[index];
land.updateData({data, index: data.id, x: landPos[index].x, y: landPos[index].y}); land.updateData({ data, index: data.id, x: landPos[index].x, y: landPos[index].y });
} else { // 更新全部 } else { // 更新全部
for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
let v = res.data[i]; let v = res.data[i];
this.lands[i].updateData({data: v, index: v.id, x: landPos[v.id - 1].x, y: landPos[v.id - 1].y}); this.lands[i].updateData({ data: v, index: v.id, x: landPos[v.id - 1].x, y: landPos[v.id - 1].y });
} }
} }
...@@ -148,11 +148,13 @@ export default class LandMgr { ...@@ -148,11 +148,13 @@ export default class LandMgr {
} }
const M_UpdateLand = function (id?) { const M_UpdateLand = function (id?) {
MainDispatcher.dispatchEvent(M_EVENT.UPDATE_LANDS, id); if (MainDispatcher)
MainDispatcher.dispatchEvent(M_EVENT.UPDATE_LANDS, id);
}; };
const M_Plant = function (data: { landId: number, petId: number }) { const M_Plant = function (data: { landId: number, petId: number }) {
MainDispatcher.dispatchEvent(M_EVENT.PLANT, data); if (MainDispatcher)
MainDispatcher.dispatchEvent(M_EVENT.PLANT, data);
}; };
export {M_UpdateLand, M_Plant} export { M_UpdateLand, M_Plant }
import {getSkinPath, getSvga} from "../../../utils"; import { getSkinPath, getSvga } from "../../../utils";
import TimeProgressBar from "../TimeProgressBar"; import TimeProgressBar from "../TimeProgressBar";
import {MainIns} from "../MainScene"; import { MainIns } from "../MainScene";
import {loadSvga} from "../../../comm/loadSvga"; import { loadSvga } from "../../../comm/loadSvga";
import {NetManager} from "../../../../libs/tw/manager/NetManager"; import { NetManager } from "../../../../libs/tw/manager/NetManager";
import {showToast} from "../../../comm/UtilsConst"; import { showToast } from "../../../comm/UtilsConst";
import {M_HideOption} from "./OptionPanel"; import { M_HideOption } from "./OptionPanel";
import {M_UpdateLand} from "../LandMgr"; import { M_UpdateLand } from "../LandMgr";
import {G_GetHomeDataByKey, G_UpdateHomeData, HOME} from "../../Home"; import { G_GetHomeDataByKey, G_UpdateHomeData, HOME } from "../../Home";
import {CROP_TYPE, detectionDiamond, petData} from "../Const"; import { CROP_TYPE, detectionDiamond, petData } from "../Const";
import Tween = egret.Tween; import Tween = egret.Tween;
import MovieClip = egret.MovieClip; import MovieClip = egret.MovieClip;
import Event = egret.Event; import Event = egret.Event;
...@@ -126,7 +126,7 @@ export default class Crop extends eui.Component { ...@@ -126,7 +126,7 @@ export default class Crop extends eui.Component {
} }
private async initUI() { private async initUI() {
let {petId, level, canFeed, canGather} = this.data.data; let { petId, level, canFeed, canGather } = this.data.data;
this.changePetId(petId || 0); this.changePetId(petId || 0);
this.changeState(level || 0); this.changeState(level || 0);
...@@ -161,7 +161,7 @@ export default class Crop extends eui.Component { ...@@ -161,7 +161,7 @@ export default class Crop extends eui.Component {
this.addEventListener(TouchEvent.TOUCH_TAP, this.dOp, this); this.addEventListener(TouchEvent.TOUCH_TAP, this.dOp, this);
this.optionMv && this.optionMv.addEventListener(TouchEvent.TOUCH_TAP, this.dOp, this); this.optionMv && this.optionMv.addEventListener(TouchEvent.TOUCH_TAP, this.dOp, this);
return; return;
}else { } else {
MainIns() && (MainIns().progressMgr.removeProgress(this.index)); MainIns() && (MainIns().progressMgr.removeProgress(this.index));
} }
...@@ -234,24 +234,24 @@ export default class Crop extends eui.Component { ...@@ -234,24 +234,24 @@ export default class Crop extends eui.Component {
const _x = MainIns().mainUI.warehouseBtn.x; const _x = MainIns().mainUI.warehouseBtn.x;
const _y = MainIns().mainUI.warehouseBtn.y; const _y = MainIns().mainUI.warehouseBtn.y;
Tween.get(catherImg) Tween.get(catherImg)
.to({y: cy - 10}, 170) .to({ y: cy - 10 }, 170)
.to({y: cy + 10}, 160, Ease.quadInOut) .to({ y: cy + 10 }, 160, Ease.quadInOut)
.to({y: cy - 10}, 160, Ease.quadInOut) .to({ y: cy - 10 }, 160, Ease.quadInOut)
.to({y: cy + 10}, 160, Ease.quadInOut) .to({ y: cy + 10 }, 160, Ease.quadInOut)
.wait(500) .wait(500)
.to({x: _x, y: _y}, 680); .to({ x: _x, y: _y }, 680);
// 缩放 // 缩放
Tween.get(catherImg) Tween.get(catherImg)
.to({scaleX: 1, scaleY: 1}, 170) .to({ scaleX: 1, scaleY: 1 }, 170)
.wait(820) .wait(820)
.to({scaleX: 0.8, scaleY: 1.2}, 500) .to({ scaleX: 0.8, scaleY: 1.2 }, 500)
.to({x: 0.8, y: 0.8}, 330); .to({ x: 0.8, y: 0.8 }, 330);
// 透明度 // 透明度
Tween.get(catherImg) Tween.get(catherImg)
.wait(1790) .wait(1790)
.to({alpha: 0}, 30) .to({ alpha: 0 }, 30)
.call(() => { .call(() => {
Tween.removeTweens(catherImg); Tween.removeTweens(catherImg);
MainIns().mainUI.removeChild(catherImg); MainIns().mainUI.removeChild(catherImg);
...@@ -278,22 +278,22 @@ export default class Crop extends eui.Component { ...@@ -278,22 +278,22 @@ export default class Crop extends eui.Component {
this.touchEnable(true); this.touchEnable(true);
// let msg = ((petData[this.petId]['propId'] == 'sp_food_1') ? '饲料' : '水壶') + '不够了,快去做任务吧'; // let msg = ((petData[this.petId]['propId'] == 'sp_food_1') ? '饲料' : '水壶') + '不够了,快去做任务吧';
// showToast(msg); // showToast(msg);
if(petData[this.petId]['propId'] == 'sp_food_1'){ if (petData[this.petId]['propId'] == 'sp_food_1') {
PanelCtrl.instance.show(NoFeedPanel); PanelCtrl.instance.show(NoFeedPanel);
}else{ } else {
PanelCtrl.instance.show(NoWaterPanel) PanelCtrl.instance.show(NoWaterPanel)
} }
} else { } else {
this.touchEnabled = false; this.touchEnabled = false;
NetManager.ins.doFeed(async (success) => { NetManager.ins.doFeed(async (success) => {
if (!success) { if (!success) {
// let msg = ((petData[this.petId]['propId'] == 'sp_food_1') ? '饲料' : '水壶') + '不够了,快去做任务吧'; // let msg = ((petData[this.petId]['propId'] == 'sp_food_1') ? '饲料' : '水壶') + '不够了,快去做任务吧';
// showToast(msg); // showToast(msg);
if(petData[this.petId]['propId'] == 'sp_food_1'){ if (petData[this.petId]['propId'] == 'sp_food_1') {
PanelCtrl.instance.show(NoFeedPanel); PanelCtrl.instance.show(NoFeedPanel);
}else{ } else {
PanelCtrl.instance.show(NoWaterPanel) PanelCtrl.instance.show(NoWaterPanel)
} }
this.touchEnable(true); this.touchEnable(true);
return; return;
} }
...@@ -433,7 +433,10 @@ export default class Crop extends eui.Component { ...@@ -433,7 +433,10 @@ export default class Crop extends eui.Component {
}, this); }, this);
this.addChild(birthMv); this.addChild(birthMv);
const pos = (mvId == 3 && this.petId == 3) ? petD.catherPos : petD.pos; var pos = (mvId == 3 && this.petId == 3) ? petD.catherPos : petD.pos;
if (this.state <= 2 && (this.petId == 7 || this.petId == 8)) {
pos = petD.pos1;
}
birthMv.x = pos[0]; birthMv.x = pos[0];
birthMv.y = pos[1]; birthMv.y = pos[1];
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"data": { "data": {
"popup": false, "popup": false,
"ifLogin": true, "ifLogin": true,
"newUser": false, "newUser": true,
"nickname": "4l60053306590_", "nickname": "4l60053306590_",
"loginPresent": { "loginPresent": {
"sp_food_2": 0 "sp_food_2": 0
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"feedNum": 20, "feedNum": 20,
"id": 1, "id": 1,
"level": 1, "level": 1,
"petId": 2, "petId":6,
"lock": false "lock": false
}, },
{ {
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
}, },
{ {
"canFeed": false, "canFeed": false,
"canGather": true, "canGather": false,
"feedLeftSeconds": 10000, "feedLeftSeconds": 10000,
"feedNum": 30, "feedNum": 30,
"id": 3, "id": 3,
"level": 3, "level": 3,
"petId": 8, "petId": 7,
"lock": false "lock": false
}, },
{ {
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
"feedLeftSeconds": 10000, "feedLeftSeconds": 10000,
"feedNum": 20, "feedNum": 20,
"id": 4, "id": 4,
"level": 4, "level": 3,
"petId": 8, "petId": 8,
"lock": false "lock": false
}, },
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"sp_achv_excellent_farmer": 0, "sp_achv_excellent_farmer": 0,
"sp_6": 10, "sp_6": 10,
"sp_seed_5": 0, "sp_seed_5": 0,
"sp_3": 6, "sp_3": 0,
"sp_seed_4": 0, "sp_seed_4": 0,
"sp_2": 60, "sp_2": 60,
"sp_5": 10, "sp_5": 10,
......
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