|
|
@@ -1,3 +1,4 @@
|
|
|
+import Util from "../../before/util/Util";
|
|
|
import JsbSystem from "../../mk/system/JsbSystem";
|
|
|
import { RateConfig } from "../data/AdData";
|
|
|
import { DataEventId, GameProp, ProductType, VideoAdType } from "../data/GameData";
|
|
|
@@ -77,6 +78,14 @@ export default class Game extends cc.Component {
|
|
|
@property({ type: cc.Label, displayName: '加红包币文本' })
|
|
|
lbl_addHb: cc.Label = null;
|
|
|
|
|
|
+ //图鉴部分
|
|
|
+ @property({ type: cc.Sprite, displayName: '图鉴图标' })
|
|
|
+ sp_farmMapIcon: cc.Label = null;
|
|
|
+ @property({ type: cc.Label, displayName: '描述' })
|
|
|
+ lbl_farmMapDes: cc.Label = null;
|
|
|
+ @property({ displayName: '数字组', type: cc.Label })
|
|
|
+ lbl_value: cc.Label[] = [];
|
|
|
+
|
|
|
posY = 0;
|
|
|
/** 是否开始增加次数倒计时 */
|
|
|
private lastTimeSpan = 0;
|
|
|
@@ -568,5 +577,83 @@ export default class Game extends cc.Component {
|
|
|
|
|
|
// gData.gameData.init_add = false;
|
|
|
}
|
|
|
+
|
|
|
+ //图鉴部分logic
|
|
|
+ public initRefreshEvent()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public initFarmMapUi()
|
|
|
+ {
|
|
|
+ for (let key in ProductType) {
|
|
|
+ let max = gData.gameData.getMaxProduct(ProductType[key]);
|
|
|
+ if (max) {
|
|
|
+ let list_data = gData.gameData.getProductArrByType(ProductType[key]);
|
|
|
+ for (let i = 0; i != list_data.length; ++i) {
|
|
|
+ if (list_data[i].picture <= max) {
|
|
|
+ let state = gData.gameData.getFarmMapRewardState(this.getIndex(list_data[i]));
|
|
|
+ if (state == 0) {
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ showChangePart() {
|
|
|
+ //this.changePart.active = true
|
|
|
+ let len = this.lbl_value.length;
|
|
|
+ this.schedule(() => {
|
|
|
+ for (var i = 0; i < len; i++) {
|
|
|
+ let ran = Util.rnd(0, 9);
|
|
|
+ this.lbl_value[i].string = `${ran}`;
|
|
|
+ }
|
|
|
+ }, 0.1)
|
|
|
+ }
|
|
|
+
|
|
|
+ getIndex(data) {
|
|
|
+ let index: any = {};
|
|
|
+ index.i = 0;
|
|
|
+ index.j = 0;
|
|
|
+ switch (data.tab) {
|
|
|
+ case '农作物':
|
|
|
+ index.i = 0;
|
|
|
+ index.j = data.picture - 10001;
|
|
|
+ break;
|
|
|
+ case '动物':
|
|
|
+ index.i = 1;
|
|
|
+ index.j = data.picture - 20001;
|
|
|
+ break;
|
|
|
+ case '爆米花厂':
|
|
|
+ index.i = 2;
|
|
|
+ index.j = data.picture - 20004;
|
|
|
+ break;
|
|
|
+ case '糕点铺':
|
|
|
+ index.i = 3;
|
|
|
+ index.j = data.picture - 20013;
|
|
|
+ break;
|
|
|
+ case '制糖厂':
|
|
|
+ index.i = 4;
|
|
|
+ index.j = data.picture - 20010;
|
|
|
+ break;
|
|
|
+ case '炼乳厂':
|
|
|
+ index.i = 5;
|
|
|
+ index.j = data.picture - 20007;
|
|
|
+ break;
|
|
|
+ case '功夫面馆':
|
|
|
+ index.i = 6;
|
|
|
+ index.j = data.picture - 20025;
|
|
|
+ break;
|
|
|
+ case '快餐店':
|
|
|
+ index.i = 7;
|
|
|
+ index.j = data.picture - 20019;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return index;
|
|
|
+ }
|
|
|
}
|
|
|
|