Commit c1785a6f authored by haiyoucuv's avatar haiyoucuv

1

parent cba217ec
No preview for this file type
...@@ -3,31 +3,16 @@ ...@@ -3,31 +3,16 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9464afa6-0efb-46c2-9cfd-05475acd81df" name="Default Changelist" comment=""> <list default="true" id="9464afa6-0efb-46c2-9cfd-05475acd81df" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/egret/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/libs/tw/manager/NetManager.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/libs/tw/manager/NetManager.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/publish.js" beforeDir="false" afterPath="$PROJECT_DIR$/egret/publish.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/warehouse_panel/兑换.png" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/assets/warehouse_panel/兑换.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/default.res.json" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/default.res.json" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/resource/default.res.json" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/default.res.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/default.thm.json" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/default.thm.json" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/resource/default.thm.json" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/default.thm.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/skins/Objs/CropSkin.exml" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/skins/Objs/CropSkin.exml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/resource/skins/IndexUISkin.exml" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/skins/IndexUISkin.exml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/skins/RulePanelSkin.exml" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/skins/RulePanelSkin.exml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/skins/SellRecordItemSkin.exml" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/skins/SellRecordItemSkin.exml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/skins/WareHouseSkin.exml" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/skins/WareHouseSkin.exml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Main.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Main.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Panels/RulePanel/RulePanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Panels/RulePanel/RulePanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Panels/SellPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Panels/SellPanel.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/src/Panels/SellPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Panels/SellPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Panels/SellRecord.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Panels/SellRecord.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Panels/TaskPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Panels/TaskPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Panels/WareHousePanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Panels/WareHousePanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/IndexScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/IndexScene.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/IndexScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/IndexScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/LandMgr.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/LandMgr.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/LandMgr.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/LandMgr.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Crop.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Crop.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Crop.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Crop.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Land.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Land.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/src/ctrls/topLayerCtrl.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/ctrls/topLayerCtrl.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/OptionPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/OptionPanel.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/src/types/Scenes.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/types/Scenes.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/ProgressMgr.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/ProgressMgr.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/src/types/sceneTypes.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/types/sceneTypes.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/TimeProgressBar.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/TimeProgressBar.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/utils.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/utils.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/mock/config.js" beforeDir="false" afterPath="$PROJECT_DIR$/mock/config.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/mock/joyousManor/getLandInfo.json" beforeDir="false" afterPath="$PROJECT_DIR$/mock/joyousManor/getLandInfo.json" afterDir="false" /> <change beforePath="$PROJECT_DIR$/mock/joyousManor/getLandInfo.json" beforeDir="false" afterPath="$PROJECT_DIR$/mock/joyousManor/getLandInfo.json" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
...@@ -59,7 +44,7 @@ ...@@ -59,7 +44,7 @@
<property name="Git.Branch.Popup.ShowAllRemotes" value="true" /> <property name="Git.Branch.Popup.ShowAllRemotes" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/egret/src/components" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/egret/src/Panels" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" /> <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" /> <property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="prettierjs.PrettierConfiguration.Package" value="$PROJECT_DIR$/node_modules/prettier" /> <property name="prettierjs.PrettierConfiguration.Package" value="$PROJECT_DIR$/node_modules/prettier" />
...@@ -71,8 +56,8 @@ ...@@ -71,8 +56,8 @@
<recent name="$PROJECT_DIR$/egret/src/Panels" /> <recent name="$PROJECT_DIR$/egret/src/Panels" />
</key> </key>
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/egret/src/components" />
<recent name="$PROJECT_DIR$/egret/src/Panels" /> <recent name="$PROJECT_DIR$/egret/src/Panels" />
<recent name="$PROJECT_DIR$/egret/src/components" />
<recent name="$PROJECT_DIR$/egret/src/Panels/toastPanel" /> <recent name="$PROJECT_DIR$/egret/src/Panels/toastPanel" />
</key> </key>
</component> </component>
...@@ -104,7 +89,7 @@ ...@@ -104,7 +89,7 @@
<workItem from="1575511989902" duration="370000" /> <workItem from="1575511989902" duration="370000" />
<workItem from="1575512375307" duration="22831000" /> <workItem from="1575512375307" duration="22831000" />
<workItem from="1575602130550" duration="39482000" /> <workItem from="1575602130550" duration="39482000" />
<workItem from="1575855730362" duration="28779000" /> <workItem from="1575855730362" duration="36117000" />
</task> </task>
<servers /> <servers />
</component> </component>
...@@ -132,9 +117,9 @@ ...@@ -132,9 +117,9 @@
<screen x="36" y="23" width="1644" height="1027" /> <screen x="36" y="23" width="1644" height="1027" />
</state> </state>
<state x="659" y="460" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1575620245218" /> <state x="659" y="460" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1575620245218" />
<state x="523" y="250" width="670" height="676" key="search.everywhere.popup" timestamp="1575888980817"> <state x="523" y="250" width="670" height="676" key="search.everywhere.popup" timestamp="1575942163065">
<screen x="36" y="23" width="1644" height="1027" /> <screen x="36" y="23" width="1644" height="1027" />
</state> </state>
<state x="523" y="250" width="670" height="676" key="search.everywhere.popup/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1575888980817" /> <state x="523" y="250" width="670" height="676" key="search.everywhere.popup/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1575942163065" />
</component> </component>
</project> </project>
\ No newline at end of file
No preview for this file type
No preview for this file type
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"name": "index_ui" "name": "index_ui"
}, },
{ {
"keys": "篱笆_png,plant_cattle_1_png,plant_cattle_2_png,plant_chicken_1_png,plant_chicken_2_png,plant_corn_1_png,plant_corn_2_png,plant_land_active_png,plant_land_animal_png,plant_land_none_png,plant_land_plant_png,plant_wheat_1_png,plant_wheat_2_png,食槽_png,_DS_Store,feed_png,feeding_png,hand_png,option_chicken_png,option_panel_png,option_wheat_png,water_png,watering_png,plant_cattle_3_png,plant_cattle_4_png,plant_chicken_3_png,plant_chicken_4_png,plant_corn_3_png,plant_wheat_3_png", "keys": "篱笆_png,plant_cattle_1_png,plant_cattle_2_png,plant_chicken_1_png,plant_chicken_2_png,plant_corn_1_png,plant_corn_2_png,plant_land_active_png,plant_land_animal_png,plant_land_none_png,plant_land_plant_png,plant_wheat_1_png,plant_wheat_2_png,食槽_png,_DS_Store,feed_png,feeding_png,hand_png,option_chicken_png,option_panel_png,option_wheat_png,water_png,watering_png,plant_cattle_3_png,plant_cattle_4_png,plant_chicken_3_png,plant_chicken_4_png,plant_corn_3_png,plant_wheat_3_png,麦粉_png,鸡蛋_png",
"name": "index_plant" "name": "index_plant"
}, },
{ {
...@@ -439,6 +439,16 @@ ...@@ -439,6 +439,16 @@
"url": "assets/bar/路径 2.png", "url": "assets/bar/路径 2.png",
"type": "image", "type": "image",
"name": "路径 2_png" "name": "路径 2_png"
},
{
"url": "assets/index_scene/planting/麦粉.png",
"type": "image",
"name": "麦粉_png"
},
{
"url": "assets/index_scene/planting/鸡蛋.png",
"type": "image",
"name": "鸡蛋_png"
} }
] ]
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
"resource/skins/LoadingSceneSkin.exml", "resource/skins/LoadingSceneSkin.exml",
"resource/skins/LoadingSkin.exml", "resource/skins/LoadingSkin.exml",
"resource/skins/RulePanelSkin.exml", "resource/skins/RulePanelSkin.exml",
"resource/skins/SelledPanelSkin.exml",
"resource/skins/SellPanelSkin.exml", "resource/skins/SellPanelSkin.exml",
"resource/skins/SellRecordItemSkin.exml", "resource/skins/SellRecordItemSkin.exml",
"resource/skins/SellRecordSkin.exml", "resource/skins/SellRecordSkin.exml",
......
...@@ -3,24 +3,6 @@ ...@@ -3,24 +3,6 @@
<w:Config id="16e64c53e86"/> <w:Config id="16e64c53e86"/>
<e:Image source="index_bg_png" horizontalCenter="0" verticalCenter="0" x="0" y="0" scaleX="1" scaleY="1" visible="false"/> <e:Image source="index_bg_png" horizontalCenter="0" verticalCenter="0" x="0" y="0" scaleX="1" scaleY="1" visible="false"/>
<e:Group id="uiLayer" left="0" right="0" horizontalCenter="0" touchChildren="true" touchEnabled="false" top="0" height="1624"> <e:Group id="uiLayer" left="0" right="0" horizontalCenter="0" touchChildren="true" touchEnabled="false" top="0" height="1624">
<e:Group id="btnGroup" left="0" right="182" anchorOffsetX="0" verticalCenter="490.5">
<e:Button id="taskBtn" label="" x="143" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="任务_png" source.down="任务_png" source.disabled="任务_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="warehouseBtn" label="" x="359" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="仓库_png" source.down="仓库_png" source.disabled="仓库_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group>
<e:Group id="propPanel" width="182" height="198" right="0" verticalCenter="452" touchChildren="true" touchEnabled="false"> <e:Group id="propPanel" width="182" height="198" right="0" verticalCenter="452" touchChildren="true" touchEnabled="false">
<e:Group id="speedGroup" x="11" y="0" width="171" height="62" visible="false"> <e:Group id="speedGroup" x="11" y="0" width="171" height="62" visible="false">
<e:Image source="加速卡_png" x="0" y="0"/> <e:Image source="加速卡_png" x="0" y="0"/>
...@@ -44,5 +26,21 @@ ...@@ -44,5 +26,21 @@
<e:Label id="userGold" text="欢趣豆:23" x="78" y="41" size="20"/> <e:Label id="userGold" text="欢趣豆:23" x="78" y="41" size="20"/>
<e:Image id="medal" source="勋章_png" x="44" y="49" visible="false"/> <e:Image id="medal" source="勋章_png" x="44" y="49" visible="false"/>
</e:Group> </e:Group>
<e:Button id="warehouseBtn" label="" x="339" verticalCenter="484.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="仓库_png" source.down="仓库_png" source.disabled="仓库_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="taskBtn" label="" x="121.5" verticalCenter="484.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="任务_png" source.down="任务_png" source.disabled="任务_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group> </e:Group>
</e:Skin> </e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="CreditsTip" width="750" height="1010" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="selled_bg_png" y="114" horizontalCenter="0"/>
<e:Image id="closeBtn" source="closeBtn_png" x="537.7" y="83.85" scaleX="0.9" scaleY="0.9"/>
<e:Label id="infoLabel" text="您的鸡蛋已被欢趣商店收下" y="234" textColor="0x806546" size="22" horizontalCenter="0"/>
<e:Label text="感谢您的辛勤劳作" y="263" textColor="0x806546" size="22" horizontalCenter="0"/>
<e:Label id="numLabel" text="为您献上500个欢趣豆" y="292" textColor="0x806546" size="22" horizontalCenter="0"/>
</e:Skin>
\ No newline at end of file
...@@ -3,6 +3,9 @@ import { spData } from "./WareHousePanel"; ...@@ -3,6 +3,9 @@ import { spData } from "./WareHousePanel";
import { NetManager } from "../../libs/tw/manager/NetManager"; import { NetManager } from "../../libs/tw/manager/NetManager";
import { ProgressNum } from "../components/ProgressNum"; import { ProgressNum } from "../components/ProgressNum";
import { IndexDispatcher } from "../Scenes/IndexScene/IndexScene"; import { IndexDispatcher } from "../Scenes/IndexScene/IndexScene";
import PanelCtrl from "../ctrls/panelCtrl";
import { ModuleTypes } from "../types/sceneTypes";
import TopLayerCtrl from "../ctrls/topLayerCtrl";
export default class SellPanel extends Panel { export default class SellPanel extends Panel {
public closeBtn: eui.Image; public closeBtn: eui.Image;
...@@ -79,12 +82,11 @@ export default class SellPanel extends Panel { ...@@ -79,12 +82,11 @@ export default class SellPanel extends Panel {
*/ */
private doSell() { private doSell() {
let count = this.numBar.value; let count = this.numBar.value;
console.log(count);
NetManager.ins.doSell((success, res) => { NetManager.ins.doSell((success, res) => {
if(!success) { if(!success) {
return; return;
} }
// PanelCtrl.instance.show(ModuleTypes.) TopLayerCtrl.instance.show(ModuleTypes.SELLED_PANEL, {}, .4);
}, this.key, count); }, this.key, count);
} }
......
import Panel from "../views/Panel";
export default class SelledPanel extends Panel {
public closeBtn: eui.Image;
public infoLabel: eui.Label;
public numLabel: eui.Label;
public get skinKey() {
return 'SelledPanel'
}
public get groupName() {
return 'selled_panel'
}
constructor(data?) {
super(data);
}
onShowAnim() {
// const canvasH = 750 / window.innerWidth * window.innerHeight;
egret.Tween.get(this).set({alpha: 0}).to({alpha: 1}, 233, egret.Ease.quadInOut);
}
protected start() {
super.start();
this.initUI();
}
private initUI(): void {
this.y = 750 / window.innerWidth * window.innerHeight * 0.2;
}
destroy() {
super.destroy();
}
}
...@@ -50,7 +50,7 @@ export default class IndexScene extends Scene { ...@@ -50,7 +50,7 @@ export default class IndexScene extends Scene {
public bg: eui.Image; public bg: eui.Image;
public gameLayer: eui.Group; public gameLayer: eui.Group;
private indexUI: IndexUI; public indexUI: IndexUI;
public optionPanel: OptionPanel; public optionPanel: OptionPanel;
public progressMgr: ProgressMgr; public progressMgr: ProgressMgr;
...@@ -58,7 +58,7 @@ export default class IndexScene extends Scene { ...@@ -58,7 +58,7 @@ export default class IndexScene extends Scene {
super(data); super(data);
} }
private landMgr: LandMgr = null; public landMgr: LandMgr = null;
protected start() { protected start() {
super.start(); super.start();
......
...@@ -16,7 +16,7 @@ export default class LandMgr { ...@@ -16,7 +16,7 @@ export default class LandMgr {
return this._parent; return this._parent;
} }
private lands: Land[] = []; public lands: Land[] = [];
constructor(parent: egret.DisplayObject) { constructor(parent: egret.DisplayObject) {
this._parent = parent; this._parent = parent;
......
...@@ -14,8 +14,8 @@ enum CROP_TYPE { ...@@ -14,8 +14,8 @@ enum CROP_TYPE {
let petData = { let petData = {
0: {key: null, optionImg: null}, // 啥也没有 0: {key: null, optionImg: null}, // 啥也没有
1: {key: 'chicken', svga: 'feed_png', optionSvga: '待喂养', option: '喂食'}, // 鸡 1: {key: 'chicken', svga: 'feed_png', optionSvga: '待喂养', option: '喂食', catherImg: '鸡蛋'}, // 鸡
2: {key: 'wheat', svga: 'water_png', optionSvga: '待浇水', option: '浇水'}, // 小麦 2: {key: 'wheat', svga: 'water_png', optionSvga: '待浇水', option: '浇水', catherImg: '麦粉'}, // 小麦
3: {key: 'cattle', svga: 'feed_png', optionSvga: '待喂养', option: '喂食'}, // 牛 3: {key: 'cattle', svga: 'feed_png', optionSvga: '待喂养', option: '喂食'}, // 牛
4: {key: 'corn', svga: 'water_png', optionSvga: '待浇水', option: '浇水'}, // 玉米 4: {key: 'corn', svga: 'water_png', optionSvga: '待浇水', option: '浇水'}, // 玉米
}; };
...@@ -103,7 +103,6 @@ export default class Crop extends eui.Component { ...@@ -103,7 +103,6 @@ export default class Crop extends eui.Component {
private initUI() { private initUI() {
let {petId, level, canFeed, feedLeftSeconds, canGather} = this.data.data; let {petId, level, canFeed, feedLeftSeconds, canGather} = this.data.data;
/// TODO 根据数据添加Crop 初始化状态
this.changePetId(petId); this.changePetId(petId);
this.changeState(level); this.changeState(level);
...@@ -158,10 +157,43 @@ export default class Crop extends eui.Component { ...@@ -158,10 +157,43 @@ export default class Crop extends eui.Component {
private doOption(option) { private doOption(option) {
switch(option) { switch(option) {
case OPTION.GATHER: case OPTION.GATHER:
SetGameLayerUpdate(false);
NetManager.ins.doHarvest((success, res) => { NetManager.ins.doHarvest((success, res) => {
if(!success) { if(!success) {
SetGameLayerUpdate(true);
return; return;
} }
this.cropMv && this.removeChild(this.cropMv) && (this.cropMv = null);
let catherImg = new eui.Image(`${petData[this.petId]['catherImg']}_png`);
let dy = IndexIns().indexUI.height - IndexIns().group.height;
catherImg.x = IndexIns().landMgr.lands[this.index - 1].x + this.x + 100;
catherImg.y = IndexIns().landMgr.lands[this.index - 1].y + this.y - dy / 2 + 20;
catherImg.scaleX = 0;
catherImg.scaleY = 0;
IndexIns().indexUI.addChild(catherImg);
egret.Tween.get(catherImg).to({scaleX: 1, scaleY: 1}, 170).wait(500).call(() => {
egret.Tween.get(catherImg).to({scaleX: 0.8, scaleY: 1.2}, 500).call(() => {
egret.Tween.get(catherImg).to({x: 0.8, y: 0.8}, 330);
});
});
egret.Tween.get(catherImg).to({y: catherImg.y - 10}, 170).call(() => {
egret.Tween.get(catherImg).to({y: catherImg.y + 10}, 160).wait(500).call(() => {
let _x = IndexIns().indexUI.warehouseBtn.x + 25;
let _y = IndexIns().indexUI.warehouseBtn.y + 35;
egret.Tween.get(catherImg).to({x: _x, y: _y}, 680);
});
});
egret.Tween.get(catherImg).wait(1470).to({alpha: 0}, 30).call(() => {
egret.Tween.removeTweens(catherImg);
IndexIns().indexUI.removeChild(catherImg);
SetGameLayerUpdate(true);
IndexDispatcher.dispatchEvent('updateIndex');
});
this.changePetId(CROP_TYPE.NONE);
this.changeState(CROP_STATE.NONE);
this.changeOption(OPTION.NONE);
}, this.index); }, this.index);
break; break;
...@@ -183,6 +215,7 @@ export default class Crop extends eui.Component { ...@@ -183,6 +215,7 @@ export default class Crop extends eui.Component {
mv.stop(); mv.stop();
this.removeChild(mv); this.removeChild(mv);
SetGameLayerUpdate(true); SetGameLayerUpdate(true);
this.changeOption(OPTION.NONE);
IndexDispatcher.dispatchEvent('updateIndex'); IndexDispatcher.dispatchEvent('updateIndex');
}, this); }, this);
} }
...@@ -209,6 +242,22 @@ export default class Crop extends eui.Component { ...@@ -209,6 +242,22 @@ 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 = '';
if((this.petId == 2 && this.state == 3) || this.petId == 1 && this.state == 4) {
_name = '升级至成熟';
} else {
_name = '普通升级';
}
loadSvga(getSvga(_name)).then(
(mv: egret.MovieClip) => {
mv.x = (_name == '升级至成熟') ? 0 : 10;
mv.y = (_name == '升级至成熟') ? -35 : 20;
this.addChild(mv);
mv.addEventListener(egret.Event.COMPLETE, () => {
this.removeChild(mv);
}, this);
}
);
loadSvga(getSvga(`${petData[this.petId].key}${this.state}_birth`)).then( loadSvga(getSvga(`${petData[this.petId].key}${this.state}_birth`)).then(
(_mv: egret.MovieClip) => { (_mv: egret.MovieClip) => {
this.addChild(_mv); this.addChild(_mv);
......
...@@ -19,16 +19,21 @@ export default class TopLayerCtrl { ...@@ -19,16 +19,21 @@ export default class TopLayerCtrl {
} }
show(type: ModuleTypes, data?, maskAlpha: number = 0) { show(type: ModuleTypes, data?, maskAlpha: number = 0) {
if(this._current) {
this.remove(this._current);
// this._current = null;
}
this.addMask(maskAlpha);
this._parent.visible = true;
const cls = this._panelClassMap[type]; const cls = this._panelClassMap[type];
Loading.instace.show(); Loading.instace.show();
const panel: Panel = new cls(data); const panel: Panel = new cls(data);
this._current = panel; this._current = panel;
this.addMask(maskAlpha);
this.add(panel); this.add(panel);
this._parent.visible = true;
} }
/** /**
...@@ -75,6 +80,7 @@ export default class TopLayerCtrl { ...@@ -75,6 +80,7 @@ export default class TopLayerCtrl {
} }
private remove(panel: Panel) { private remove(panel: Panel) {
this._current = null;
this._parent.removeChild(panel); this._parent.removeChild(panel);
} }
......
...@@ -8,6 +8,7 @@ import ToastPanel from "../Panels/toastPanel/ToastPanel"; ...@@ -8,6 +8,7 @@ import ToastPanel from "../Panels/toastPanel/ToastPanel";
import TaskToast from "../Panels/TaskToast"; import TaskToast from "../Panels/TaskToast";
import SellRecord from "../Panels/SellRecord"; import SellRecord from "../Panels/SellRecord";
import SellPanel from "../Panels/SellPanel"; import SellPanel from "../Panels/SellPanel";
import SelledPanel from "../Panels/SelledPanel";
let Scenes = [ let Scenes = [
[ModuleTypes.LOADING_SCENE, LoadingScene], [ModuleTypes.LOADING_SCENE, LoadingScene],
...@@ -25,6 +26,7 @@ let Tops = [ ...@@ -25,6 +26,7 @@ let Tops = [
[ModuleTypes.TASK_TOAST, TaskToast], [ModuleTypes.TASK_TOAST, TaskToast],
[ModuleTypes.SELL_RECORD, SellRecord], [ModuleTypes.SELL_RECORD, SellRecord],
[ModuleTypes.SELL_PANEL, SellPanel], [ModuleTypes.SELL_PANEL, SellPanel],
[ModuleTypes.SELLED_PANEL, SelledPanel],
]; ];
export {Scenes, Panels, Tops} export {Scenes, Panels, Tops}
\ No newline at end of file
...@@ -12,4 +12,5 @@ export enum ModuleTypes { ...@@ -12,4 +12,5 @@ export enum ModuleTypes {
WAREHOUSE_PANEL, WAREHOUSE_PANEL,
SELL_RECORD, SELL_RECORD,
SELL_PANEL, SELL_PANEL,
SELLED_PANEL,
} }
\ No newline at end of file
...@@ -25,13 +25,13 @@ ...@@ -25,13 +25,13 @@
"level": 2, "level": 2,
"canFeed": true, "canFeed": true,
"feedLeftSeconds": 10, "feedLeftSeconds": 10,
"canGather": false "canGather": true
}, },
{ {
"id": 4, "id": 4,
"petId": 1, "petId": 1,
"level": 4, "level": 4,
"canFeed": false, "canFeed": true,
"feedLeftSeconds": 0, "feedLeftSeconds": 0,
"canGather": true "canGather": true
} }
......
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