1510 lines
53 KiB
JavaScript
1510 lines
53 KiB
JavaScript
var AchiconitemRender = class AchiconitemRender extends eui.ItemRenderer {
|
|
constructor() {
|
|
super();
|
|
this.skinName = AchiIconSkin;
|
|
}
|
|
partAdded(e, i) {
|
|
super.partAdded(e, i);
|
|
}
|
|
childrenCreated() {
|
|
super.childrenCreated();
|
|
}
|
|
};
|
|
__reflect(AchiconitemRender.prototype, "AchiconitemRender");
|
|
var GameConfig;
|
|
!(function (GameConfig) {
|
|
function e() {
|
|
const t = window.navigator.userAgent.toLowerCase(),
|
|
e = "" + t.match(/MicroMessenger/i);
|
|
return "null" == e ? !1 : "micromessenger" == e ? !0 : void 0;
|
|
}
|
|
function i() {
|
|
return document.body.clientHeight / document.body.clientWidth > 1.32;
|
|
}
|
|
function n() {
|
|
const t = window.navigator.userAgent.toLowerCase();
|
|
"" + t.match(/MicroMessenger/i);
|
|
return "" + t.match(/windows nt/i) == "windows nt"
|
|
? "windows"
|
|
: "" + t.match(/iphone/i) == "iphone"
|
|
? "ios"
|
|
: "" + t.match(/android/i) == "android"
|
|
? "android"
|
|
: "" + t.match(/ipad/i) == "ipad"
|
|
? "ipad"
|
|
: "" + t.match(/linux/i) == "linux"
|
|
? "linux"
|
|
: "" + t.match(/mac/i) == "mac"
|
|
? "mac"
|
|
: "" + t.match(/ucbrower/i) == "ucbrower"
|
|
? "ucbrower"
|
|
: void 0;
|
|
}
|
|
function a() {
|
|
const t = window.navigator.userAgent.toLowerCase();
|
|
return "" + t.match(/micromessenger/i) == "micromessenger"
|
|
? "micromessenger"
|
|
: "" + t.match(/qzone/i) == "qzone"
|
|
? "qzone"
|
|
: "" + t.match(/weibo/i) == "weibo"
|
|
? "weibo"
|
|
: "" + t.match(/qq/i) == "qq"
|
|
? "qq"
|
|
: "" + t.match(/renren/i) == "renren"
|
|
? "renren"
|
|
: "" + t.match(/txmicroblog/i) == "txmicroblog"
|
|
? "txmicroblog"
|
|
: "" + t.match(/douban/i) == "douban"
|
|
? "douban"
|
|
: "other";
|
|
}
|
|
function o() {
|
|
return egret.MainContext.instance.stage;
|
|
}
|
|
function r() {
|
|
return egret.MainContext.instance.stage.stageWidth;
|
|
}
|
|
function s() {
|
|
return egret.MainContext.instance.stage.stageHeight;
|
|
}
|
|
((GameConfig.version = "1.2"),
|
|
(GameConfig.GAME_EXPORT = !0),
|
|
(GameConfig.SERVER_PATH = window.location.origin + "/index.php?r="),
|
|
(GameConfig.SOKCET_PATH = window.location.hostname + ":9501"),
|
|
(GameConfig.DEBUG_MODEL = !0),
|
|
(GameConfig.WEIXIN_DEBUG = !1),
|
|
(GameConfig.GAME_NAME = "php-farm1"),
|
|
(GameConfig.REMAIN_UN_KEY = "qqfarm2.1024.un"),
|
|
(GameConfig.REMAIN_PW_KEY = "qqfarm2.1024.pw"),
|
|
(GameConfig.REMAIN_UN_SEL_KEY = "qqfarm2.1024.un_select"),
|
|
(GameConfig.REMAIN_PW_SEL_KEY = "qqfarm2.1024.pw_select"),
|
|
(GameConfig.TextColors = {
|
|
white: 16777215,
|
|
milkWhite: 16511407,
|
|
grayWhite: 13547170,
|
|
yellow: 16776960,
|
|
lightYellow: 16765813,
|
|
orangeYellow: 16750848,
|
|
red: 15799040,
|
|
green: 58624,
|
|
blue: 1742039,
|
|
grayBlue: 3101047,
|
|
purple: 15284466,
|
|
pink: 16724016,
|
|
black: 3026221,
|
|
golden: 16766720
|
|
}),
|
|
(GameConfig.LabelFontSize = {
|
|
littleSize: 12,
|
|
middleSize: 18,
|
|
normalSize: 24,
|
|
bigSize: 36
|
|
}),
|
|
(GameConfig.isWeiXin = e),
|
|
(GameConfig.isBigScreen = i),
|
|
(GameConfig.systemType = n),
|
|
(GameConfig.platformType = a),
|
|
(GameConfig.curStage = o),
|
|
(GameConfig.curWidth = r),
|
|
(GameConfig.curHeight = s),
|
|
(GameConfig.GOLD_ID = 105001),
|
|
(GameConfig.GEM_ID = 105002));
|
|
})(GameConfig || (GameConfig = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const FriendGiveListItemRender = class FriendGiveListItemRender extends game.BaseItemRenderer {
|
|
constructor() {
|
|
super();
|
|
this.skinName = new FriendGiveListItemSkin();
|
|
}
|
|
createChildren() {
|
|
super.createChildren();
|
|
}
|
|
dataChanged() {
|
|
this.data;
|
|
if (-3 == this.data.item_id) this.labelNum.text = "x" + this.data.num;
|
|
else {
|
|
const e = Global.gameProxy.getItemConfig(this.data.item_id);
|
|
((this.imgIcon.source = game.URLConfig.getIcon(e.graphical_id)), (this.labelNum.text = "x" + this.data.num));
|
|
}
|
|
}
|
|
};
|
|
((game.FriendGiveListItemRender = FriendGiveListItemRender),
|
|
__reflect(FriendGiveListItemRender.prototype, "game.FriendGiveListItemRender"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const NoticeItemRender = class NoticeItemRender extends game.BaseItemRenderer {
|
|
constructor() {
|
|
super();
|
|
this.skinName = new NoticeListItemSkin();
|
|
}
|
|
createChildren() {
|
|
super.createChildren();
|
|
}
|
|
dataChanged() {
|
|
const t = this.data;
|
|
((this.titleLabel.text = t.title),
|
|
(this.contentLabel.text = t.message),
|
|
(this.timeLabel.text = TimeFormat.showDayOrDate(t.created_at)));
|
|
}
|
|
};
|
|
((game.NoticeItemRender = NoticeItemRender), __reflect(NoticeItemRender.prototype, "game.NoticeItemRender"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const PayItemRender = class PayItemRender extends eui.Component {
|
|
constructor() {
|
|
super();
|
|
this.skinName = new PayItemRenderSkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(), this.buyBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.buyBtnTouchEnded, this));
|
|
}
|
|
buyBtnTouchEnded() {
|
|
this.payPanel.buy(this.payConfig);
|
|
}
|
|
initWidthData(e, i, n) {
|
|
((this.payConfig = e),
|
|
(this.payPanel = n),
|
|
e.id <= 6
|
|
? ((this.iconImage.source = RES.getRes("sicon_diamond_png")),
|
|
(this.payIcon.source = RES.getRes("pay_d" + i + "_png")),
|
|
(this.labelValue.text = game.Utils.BigNumTostring(e.get_diamonds)))
|
|
: ((this.iconImage.source = RES.getRes("sicon_gold_png")),
|
|
(this.labelValue.text = game.Utils.BigNumTostring(e.get_gold)),
|
|
(this.payIcon.source = RES.getRes("pay_g" + i + "_png"))),
|
|
(this.rmbLabel.text = "¥" + e.consume_rmb));
|
|
}
|
|
};
|
|
((game.PayItemRender = PayItemRender), __reflect(PayItemRender.prototype, "game.PayItemRender"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const BagPanel = class BagPanel extends game.BasePanel {
|
|
constructor(t) {
|
|
super();
|
|
this.type = t;
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new BagPanelSkin();
|
|
}
|
|
onShow() {
|
|
this.isVisibleAnimate
|
|
? ((this.x = 114),
|
|
egret.Tween.get(this)
|
|
.to(
|
|
{
|
|
x: 0
|
|
},
|
|
250,
|
|
egret.Ease.sineOut
|
|
)
|
|
.call(this.onShowAnimateOver, this))
|
|
: this.onShowAnimateOver();
|
|
}
|
|
onHide() {
|
|
egret.Tween.get(this)
|
|
.to(
|
|
{
|
|
x: 114
|
|
},
|
|
250,
|
|
egret.Ease.sineOut
|
|
)
|
|
.call(this.onShowAnimateOver, this);
|
|
}
|
|
onAdded() {
|
|
(super.onAdded(),
|
|
Const.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouchBegin, this),
|
|
this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTargetTouchBegin, this));
|
|
}
|
|
onRemoved() {
|
|
(super.onRemoved(),
|
|
Const.stage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageTouchBegin, this),
|
|
this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTargetTouchBegin, this));
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(), (this.list.itemRenderer = game.BagIconRender));
|
|
let i = Global.playerProxy.getItemByType(this.type);
|
|
(this.type == ItemType.PROPS && (i = Global.playerProxy.getItemBySmallType(SmallType.MANURE)),
|
|
i.sort(function (t, e) {
|
|
return t.config.id - e.config.id;
|
|
}),
|
|
(this.list.dataProvider = new eui.ArrayCollection(i)));
|
|
}
|
|
onTargetTouchBegin(t) {
|
|
t.stopPropagation();
|
|
}
|
|
onStageTouchBegin() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_BAG);
|
|
}
|
|
};
|
|
((game.BagPanel = BagPanel), __reflect(BagPanel.prototype, "game.BagPanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const Tab = class Tab extends eui.Group {
|
|
constructor(t, i) {
|
|
super();
|
|
this._selectIndex = -1;
|
|
this.dataArr = t;
|
|
this.itemClickCallback = i;
|
|
this.initItems();
|
|
this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
|
|
}
|
|
initItems() {
|
|
const e = this;
|
|
this.itemArr = [];
|
|
for (let i = 0; i < this.dataArr.length; i++) {
|
|
const n = new game.TabItem(this.dataArr[i]);
|
|
(this.itemArr.push(n), (n.x = 90 * i), (n.bottom = -1), this.addChild(n));
|
|
}
|
|
egret.callLater(function () {
|
|
e.setSelectIndex(0);
|
|
}, this);
|
|
}
|
|
onTouchTap(e) {
|
|
const i = e.target;
|
|
if (i instanceof game.TabItem) {
|
|
const n = this.itemArr.indexOf(i);
|
|
this.setSelectIndex(n);
|
|
}
|
|
}
|
|
setSelectIndex(t, e = !0) {
|
|
for (let i = 0, n = 0; n < this.itemArr.length; n++) {
|
|
const a = this.itemArr[n];
|
|
((a.select = t == n), (a.bottom = t == n ? -4 : -2), (a.x = i), (i += a.width + 5));
|
|
}
|
|
(e && this._selectIndex != t && ((this._selectIndex = t), this.itemClickCallback(t)), (this._selectIndex = t));
|
|
}
|
|
get selectIndex() {
|
|
return this._selectIndex;
|
|
}
|
|
setItemBaseHeight(t) {
|
|
for (let e = 0; e < this.itemArr.length; e++) {
|
|
const i = this.itemArr[e];
|
|
i.baseHeight = t;
|
|
}
|
|
}
|
|
};
|
|
((game.Tab = Tab), __reflect(Tab.prototype, "game.Tab"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const TabItem = class TabItem extends eui.Group {
|
|
constructor(e) {
|
|
super();
|
|
this._select = !1;
|
|
this.baseHeight = 40;
|
|
this.touchChildren = !1;
|
|
this.touchEnabled = !0;
|
|
this.bg = new eui.Image("tab_unselecte_png");
|
|
this.bg.scale9Grid = new egret.Rectangle(40, 20, 2, 2);
|
|
this.addChild(this.bg);
|
|
this.label = new eui.Label(e);
|
|
this.label.fontFamily = "huakang";
|
|
this.label.size = 26;
|
|
this.label.textColor = 7749668;
|
|
this.addChild(this.label);
|
|
this.label.horizontalCenter = 0;
|
|
this.label.verticalCenter = 0;
|
|
this.label.stroke = 0;
|
|
this.label.strokeColor = 7031078;
|
|
}
|
|
get select() {
|
|
return this._select;
|
|
}
|
|
set select(t) {
|
|
const e = this.label.width;
|
|
t
|
|
? ((this.label.stroke = 3),
|
|
(this.label.textColor = 16777215),
|
|
(this.bg.source = "tab_selected_png"),
|
|
(this.bg.width = Math.max(105, e + 34)),
|
|
(this.bg.height = this.baseHeight + 7))
|
|
: ((this.label.stroke = 0),
|
|
(this.label.textColor = 7749668),
|
|
(this.bg.source = "tab_unselecte_png"),
|
|
(this.bg.width = Math.max(88, e + 34)),
|
|
(this.bg.height = this.baseHeight));
|
|
}
|
|
};
|
|
((game.TabItem = TabItem), __reflect(TabItem.prototype, "game.TabItem"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const AlertPanel = class AlertPanel extends game.BaseComponent {
|
|
constructor(t) {
|
|
super();
|
|
this.tipsText = t.tips;
|
|
this.okCallback = t.okCallback || null;
|
|
this.noCallback = t.noCallback || null;
|
|
this.onlyOkBtn = t.onlyOkBtn || !1;
|
|
this.skinName = new AlertSkin();
|
|
}
|
|
btnNoTouchEnded() {
|
|
(this.noCallback && this.noCallback(), game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_ALERT));
|
|
}
|
|
btnOkTouchEnded() {
|
|
(this.okCallback && this.okCallback(), game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_ALERT));
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.labelTxt && (this.labelTxt.text = this.tipsText),
|
|
this.onlyOkBtn
|
|
? ((this.btnOk.horizontalCenter = 0), (this.btnNo.visible = !1))
|
|
: ((this.btnOk.horizontalCenter = -104), (this.btnNo.visible = !0)));
|
|
}
|
|
};
|
|
((game.AlertPanel = AlertPanel), __reflect(AlertPanel.prototype, "game.AlertPanel"));
|
|
})(game || (game = {}));
|
|
var Global;
|
|
!(function (Global) {})(Global || (Global = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const DogPanel = class DogPanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new DogListSkin();
|
|
}
|
|
onAdded() {
|
|
(super.onAdded(), game.EventManager.instance.addEvent(SysNotify.DOG_ENDTIME_CHANGE, this.updateListPage, this));
|
|
}
|
|
onRemoved() {
|
|
(super.onRemoved(),
|
|
game.EventManager.instance.removeEvent(SysNotify.DOG_ENDTIME_CHANGE, this.updateListPage, this));
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(640),
|
|
this.commonPanel.setPanelHeight(700),
|
|
this.commonPanel.setTitle("panel_title_dog_png"),
|
|
(this.list.dataProvider = null),
|
|
(this.list.itemRenderer = game.DogItemRender),
|
|
this.updateListPage());
|
|
}
|
|
updateListPage() {
|
|
const t = Global.playerProxy.getItemBySmallType(SmallType.DOG);
|
|
this.list.dataProvider = new eui.ArrayCollection(t);
|
|
}
|
|
btnCloseTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_DOG);
|
|
}
|
|
};
|
|
((game.DogPanel = DogPanel), __reflect(DogPanel.prototype, "game.DogPanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const FindPasswordScene = class FindPasswordScene extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.timeCount = 60;
|
|
this.skinName = new FindPasswordSkin();
|
|
}
|
|
childrenCreated() {
|
|
RES.getResByUrl(
|
|
window.location.origin + "/validate_image/" + Global.playerProxy.uuid + ".png",
|
|
this.onComplete,
|
|
this,
|
|
"image"
|
|
);
|
|
}
|
|
onComplete(t) {
|
|
this.imgtuxing.source = t;
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(600),
|
|
this.commonPanel.setPanelHeight(560),
|
|
this.commonPanel.setTitleIcon("panel_icon_skin_png"),
|
|
this.commonPanel.setTitle("user_mmxg_png"),
|
|
(this.commonPanel.btnClose.label = "确定"),
|
|
(this.commonPanel.closeBtn.visible = !0),
|
|
(this.pwdEt.displayAsPassword = !0));
|
|
}
|
|
closeBtnTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FIND_PASSWORD);
|
|
}
|
|
onTouchTap(t) {
|
|
const e = this;
|
|
switch ((t.stopPropagation(), t.target)) {
|
|
case this.sendBtn:
|
|
const i = this.phoneEt.text.trim();
|
|
if (!RegUtils.checkMobile(i)) return void PopUpManager.popTip("手机号码错误");
|
|
const n = GameConfig.SERVER_PATH + "user/send-find-password-code";
|
|
let a = Global.playerProxy.uuid;
|
|
("" == a && ((a = egret.getTimer().toString()), (Global.playerProxy.uuid = a), (a = Global.playerProxy.uuid)),
|
|
Global.netProxy.sendRequest(
|
|
n,
|
|
{
|
|
phone: i,
|
|
image_code: this.capEt0.text,
|
|
uuid: a
|
|
},
|
|
function (t) {
|
|
return 0 == t.status
|
|
? (e.lockBtnCode(), void PopUpManager.popTip("验证码已发送"))
|
|
: void TipsUtils.showErrorCodeTips(t.status);
|
|
}
|
|
));
|
|
}
|
|
}
|
|
lockBtnCode() {
|
|
((this.timeCount = 60),
|
|
(this.sendBtn.enabled = !1),
|
|
(this.sendBtn.label = this.timeCount + "S"),
|
|
(this.timeInterval = egret.setInterval(
|
|
function () {
|
|
(this.timeCount--,
|
|
(this.sendBtn.label = this.timeCount + "S"),
|
|
this.timeCount <= 0 &&
|
|
((this.sendBtn.label = "发送"), (this.sendBtn.enabled = !0), egret.clearInterval(this.timeInterval)));
|
|
},
|
|
this,
|
|
1e3
|
|
)));
|
|
}
|
|
btnCloseTouchEnded() {
|
|
const e = this.phoneEt.text.trim(),
|
|
i = this.pwdEt.text.trim(),
|
|
n = this.capEt.text.trim();
|
|
if (!RegUtils.checkMobile(e)) return void PopUpManager.popTip("手机号码格式错误");
|
|
if (RegUtils.isNull(i)) return void PopUpManager.popTip("密码和交易密码不能同时为空");
|
|
let a = Global.playerProxy.uuid;
|
|
"" == a && ((a = egret.getTimer().toString()), (Global.playerProxy.uuid = a), (a = Global.playerProxy.uuid));
|
|
const o = {
|
|
image_code: this.capEt0.text,
|
|
phone: e,
|
|
password: i,
|
|
sms_code: n,
|
|
uuid: a
|
|
};
|
|
(Global.netProxy.setToken(null),
|
|
Global.netProxy.sendRequest(GameConfig.SERVER_PATH + "user/modify-password", o, function (e) {
|
|
return 0 == e.status
|
|
? (PopUpManager.popTip("找回密码成功"),
|
|
void game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_FIND_PASSWORD))
|
|
: void TipsUtils.showErrorCodeTips(e.status);
|
|
}));
|
|
}
|
|
};
|
|
((game.FindPasswordScene = FindPasswordScene), __reflect(FindPasswordScene.prototype, "game.FindPasswordScene"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const HelpPanel = class HelpPanel extends game.BasePanel {
|
|
constructor(t) {
|
|
super();
|
|
this.textId = t;
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new HelpSkin();
|
|
}
|
|
createChildren() {
|
|
super.createChildren();
|
|
const t = Global.gameProxy.getTextConfig(this.textId);
|
|
this.labelTxt.textFlow = FontUtils.html(t.content);
|
|
}
|
|
onTouchTap(e) {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_HELP);
|
|
}
|
|
};
|
|
((game.HelpPanel = HelpPanel), __reflect(HelpPanel.prototype, "game.HelpPanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const HouseUpgradePanel = class HouseUpgradePanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new BuildingSkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(640),
|
|
this.commonPanel.setPanelHeight(810),
|
|
this.commonPanel.setTitleIcon("panel_icon_building_png"),
|
|
this.commonPanel.setTitle("panel_title_building_png"),
|
|
this.initTab());
|
|
}
|
|
initTab() {
|
|
const e = ["房屋升级"];
|
|
((this.tab = new game.Tab(e, this.onTabItemClickCallback.bind(this))),
|
|
(this.tab.bottom = 0),
|
|
this.groupTab.addChild(this.tab));
|
|
}
|
|
onTabItemClickCallback(e) {
|
|
var i = Global.playerProxy.playerData;
|
|
const n = game.Utils.limit(i.farm_level + 1, 1, 12);
|
|
if (
|
|
((this.houseUpgradeData = new game.HouseUpgradeData(Global.gameProxy.getHouseUpgradeConfig(n))),
|
|
(this.imgIcon.source = game.URLConfig.getHouse(n)),
|
|
(this.labelLv.text = "LV." + n),
|
|
(this.labelAddOut.text = this.houseUpgradeData.add_exp.toString()),
|
|
(this.labelAddOut0.text = this.houseUpgradeData.outAddPer.toString()),
|
|
(this.labelAddOut1.text = this.houseUpgradeData.needPlayerLV.toString()),
|
|
(this.btnUp.enabled = !0),
|
|
i.farm_level >= 12)
|
|
) {
|
|
((this.btnUp.enabled = !1), (this.btnUp.label = "满级"));
|
|
for (var a = 1; 5 >= a; a++) ((this["itemLabel" + a].visible = !1), (this["itemIcon" + a].visible = !1));
|
|
} else {
|
|
const missingCount = game.CostUtils.renderCostSlots(this, this.houseUpgradeData.items, 5);
|
|
missingCount > 0 && (this.btnUp.enabled = !1);
|
|
}
|
|
}
|
|
btnCloseTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_HOUSEUPGRADE);
|
|
}
|
|
flushPanel() {
|
|
this.onTabItemClickCallback(0);
|
|
}
|
|
btnUpTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(ClientNotify.UPGREADE_HOUSE, {
|
|
upgradeData: this.houseUpgradeData
|
|
});
|
|
}
|
|
};
|
|
((game.HouseUpgradePanel = HouseUpgradePanel), __reflect(HouseUpgradePanel.prototype, "game.HouseUpgradePanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const LandExtendPanel = class LandExtendPanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new LandOpenSkin();
|
|
}
|
|
createChildren() {
|
|
super.createChildren();
|
|
const i = Global.playerProxy.landData,
|
|
n = Global.gameProxy.getLandExtendConfig(_.values(i).length + 1),
|
|
a = new game.LandExtentData(n);
|
|
((this.landExtendData = a),
|
|
(this.labelLv.text = a.lv + ""),
|
|
(this.labelGold.text = a.gold + ""),
|
|
(this.labelGold.textColor = this.labelLv.textColor = 65280),
|
|
(this.btnOpen.enabled = !0));
|
|
const o = Global.playerProxy.playerData;
|
|
(o.level < a.lv && ((this.labelLv.textColor = 16711680), (this.btnOpen.enabled = !1)),
|
|
o.gold < a.gold && ((this.labelGold.textColor = 16711680), (this.btnOpen.enabled = !1)));
|
|
}
|
|
btnOpenTouchEnded() {
|
|
const e = Global.playerProxy.playerData,
|
|
i = this.landExtendData.gold;
|
|
return i > e.gold
|
|
? void PopUpManager.popTip("金币不足,无法扩建")
|
|
: void game.AppFacade.getInstance().sendNotification(ClientNotify.LAND_EXTEND, {
|
|
gold: i
|
|
});
|
|
}
|
|
btnCloseTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_LANDEXTEND);
|
|
}
|
|
};
|
|
((game.LandExtendPanel = LandExtendPanel), __reflect(LandExtendPanel.prototype, "game.LandExtendPanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const LandUpgradePanel = class LandUpgradePanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.helpTxtId = 7;
|
|
this.skinName = new LandUpSkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(640),
|
|
this.commonPanel.setPanelHeight(864),
|
|
this.commonPanel.setTitleIcon("panel_icon_landup_png"),
|
|
this.commonPanel.setTitle("panel_title_landup_png"),
|
|
this.initTab());
|
|
}
|
|
initTab() {
|
|
const e = ["棕土地", "银土地", "紫土地"];
|
|
((this.tab = new game.Tab(e, this.onTabItemClickCallback.bind(this))),
|
|
(this.tab.bottom = 0),
|
|
this.groupTab.addChild(this.tab));
|
|
}
|
|
onTabItemClickCallback(e) {
|
|
const i = e + 1;
|
|
((this.landLv = i), this.updateStart(i));
|
|
const n = Global.playerProxy.getLandCountByLv(i, !0) + 1,
|
|
a = Global.playerProxy.getLandUpDataByLvOrder(i, n);
|
|
((this.landUpgradeData = a),
|
|
(this.imgIcon.source = "land_up_icon" + (e + 1) + "_png"),
|
|
(this.imgName.source = "land_up_name" + (e + 1) + "_png"));
|
|
const o = ["普通土地", "棕土地", "银土地", "紫土地"];
|
|
((this.labelTxtOut.text = "收获" + o[e + 1] + "的果实将增加产量个数:"),
|
|
(this.labelAddOut.text = a.outAddPer + "个"),
|
|
(this.labelTxtOut0.text = "收获" + o[e + 1] + "的果实将增加农场主经验点:"),
|
|
(this.labelAddOut0.text = a.expAddPer + "点"),
|
|
(this.labelTxtOut1.text = "升级" + o[e + 1] + "需要农场主等级达到:"),
|
|
(this.labelAddOut1.text = "LV" + a.lv));
|
|
const missingCount = game.CostUtils.renderCostSlots(this, a.items, 4);
|
|
((this.btnUp.enabled = 1 > missingCount),
|
|
missingCount > 0 ? (this.labelErr.text = "材料不足") : (this.labelErr.text = ""));
|
|
}
|
|
updateStart(t) {
|
|
for (let e = Global.playerProxy.getLandCountByLv(t, !0), i = 0; 12 > i; i++) {
|
|
const n = this.groupStar.getChildAt(i);
|
|
e > i ? (n.source = "building_land_num" + t + "_png") : (n.source = "building_land_num0_png");
|
|
}
|
|
}
|
|
btnUpTouchEnded() {
|
|
if (Global.playerProxy.getLandCountByLv(this.landLv - 1, !1) <= 0) {
|
|
const e = ["普通土地", "棕土地", "银土地", "紫土地"];
|
|
return void PopUpManager.popTip("没有足够的" + e[this.landLv - 1]);
|
|
}
|
|
game.AppFacade.getInstance().sendNotification(ClientNotify.LAND_UPGRADE, {
|
|
level: this.landLv,
|
|
landData: this.landUpgradeData
|
|
});
|
|
}
|
|
flushPanel() {
|
|
this.onTabItemClickCallback(this.tab.selectIndex);
|
|
}
|
|
onTouchTap(t) {
|
|
(super.onTouchTap(t), t.target == this.btnUp);
|
|
}
|
|
btnCloseTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_LAND_UPGRADE);
|
|
}
|
|
};
|
|
((game.LandUpgradePanel = LandUpgradePanel), __reflect(LandUpgradePanel.prototype, "game.LandUpgradePanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const LogPanel = class LogPanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.pageIndex = 1;
|
|
this.pageMax = 1;
|
|
this.pageEveNum = 10;
|
|
this.pageFruitEveNum = 15;
|
|
this.tabIndex = 0;
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new LogPanelSkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(600),
|
|
this.commonPanel.setPanelHeight(790),
|
|
this.commonPanel.setTitleIcon("panel_icon_log_png"),
|
|
this.commonPanel.setTitle("panel_title_log_png"),
|
|
this.initTab(),
|
|
(this.list.dataProvider = null),
|
|
(this.list.itemRenderer = game.LogItemRender),
|
|
this.scroller.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onScrollerTouchBegan, this));
|
|
}
|
|
initLogList() {
|
|
((this.list.dataProvider = null),
|
|
(this.list.itemRenderer = game.LogItemRender),
|
|
this.changePage(1, !0),
|
|
this.scroller.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onScrollerTouchBegan, this));
|
|
}
|
|
onScrollerTouchBegan(t) {
|
|
((this.scrollerTouchStart = t.stageX),
|
|
this.stage.once(egret.TouchEvent.TOUCH_END, this.onScrollerTouchEnded, this, !0, Number.MAX_VALUE));
|
|
}
|
|
onScrollerTouchEnded(t) {
|
|
const e = t.stageX - this.scrollerTouchStart;
|
|
e > 150 ? this.changePage(-1) : -150 > e && this.changePage(1);
|
|
}
|
|
initTab() {
|
|
const e = ["玩家日志", "系统日志"];
|
|
((this.tab = new game.Tab(e, this.onTabItemClickCallback.bind(this))),
|
|
(this.tab.bottom = 0),
|
|
this.groupTab.addChild(this.tab));
|
|
}
|
|
onTabItemClickCallback(t) {
|
|
((this.logType = t), this.changePage(1, !0));
|
|
}
|
|
changePage(t, e) {
|
|
if ((void 0 === e && (e = !1), e)) this.pageIndex = t;
|
|
else {
|
|
if (this.pageIndex <= 1 && 0 > t) return;
|
|
if (this.pageIndex >= this.pageMax && t > 0) return;
|
|
this.pageIndex += t;
|
|
}
|
|
((this.labelPage.text = this.pageIndex + "/" + this.pageMax), this.updateListPage(this.pageIndex));
|
|
}
|
|
getLogListArr(e) {
|
|
const i = [];
|
|
if (!e) return i;
|
|
for (let n = 0; n < e.length; n++) i.push(new game.LogData(e[n]));
|
|
return i;
|
|
}
|
|
getSysLogListArr(e) {
|
|
const i = [];
|
|
if (!e) return i;
|
|
for (let n = 0; n < e.length; n++) i.push(new game.SystemLogData(e[n]));
|
|
return i;
|
|
}
|
|
onListData(e) {
|
|
((this.pageMax = game.Utils.limit(Math.ceil(e.total_count / 10), 1, 10)),
|
|
(this.labelPage.text = this.pageIndex + "/" + this.pageMax),
|
|
(this.list.dataProvider = new eui.ArrayCollection(this.getLogListArr(e.list))));
|
|
}
|
|
onSysLogListData(e) {
|
|
((this.pageMax = game.Utils.limit(Math.ceil(e.total_count / 10), 1, 10)),
|
|
(this.labelPage.text = this.pageIndex + "/" + this.pageMax),
|
|
(this.list.dataProvider = new eui.ArrayCollection(this.getSysLogListArr(e.list))));
|
|
}
|
|
updateListPage(t) {
|
|
0 == this.logType
|
|
? ((this.btnClear.visible = !0),
|
|
this.mediator.getPlayerLogList(
|
|
(this.pageIndex - 1) * this.pageEveNum,
|
|
this.pageEveNum,
|
|
this.onListData.bind(this)
|
|
))
|
|
: ((this.btnClear.visible = !1),
|
|
this.mediator.getSystemLogList(
|
|
(this.pageIndex - 1) * this.pageEveNum,
|
|
this.pageEveNum,
|
|
this.onSysLogListData.bind(this)
|
|
));
|
|
}
|
|
onTouchTap(t) {
|
|
super.onTouchTap(t);
|
|
const i = t.target;
|
|
switch (i) {
|
|
case this.btnPrev:
|
|
this.changePage(-1);
|
|
break;
|
|
case this.btnNext:
|
|
this.changePage(1);
|
|
break;
|
|
case this.btnClear:
|
|
this.clearLog();
|
|
}
|
|
}
|
|
btnCloseTouchEnded() {
|
|
this.mediator.closeViewComponent();
|
|
}
|
|
clearLog() {
|
|
this.pageIndex = 1;
|
|
const t = this;
|
|
this.mediator.clearLog(function () {
|
|
((t.labelPage.text = "1/1"), (t.list.dataProvider = new eui.ArrayCollection(t.getLogListArr([]))));
|
|
});
|
|
}
|
|
};
|
|
((game.LogPanel = LogPanel), __reflect(LogPanel.prototype, "game.LogPanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const LotteryPanel = class LotteryPanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.rewardCount = 14;
|
|
this.rewardIndex = -1;
|
|
this.lightIndex = 0;
|
|
this.isAcc = !0;
|
|
this.effDelay = 500;
|
|
this.isFullScreen = !0;
|
|
this.skinName = new LotterySkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(), (this.groupLight.visible = !1), (this.imgLight.visible = !1), this.updateView());
|
|
}
|
|
updateView() {
|
|
((this.btnReward.visible = !1),
|
|
(this.btnLottery.visible = !0),
|
|
(this.btnLottery.enabled = !0),
|
|
this.initCards(),
|
|
this.updateCost());
|
|
}
|
|
updateCost() {
|
|
((this.imgDiamond.visible = !1), (this.imgGold.visible = !0));
|
|
const t = Global.playerProxy.playerData.lottery_count || 0;
|
|
if (0 == t) ((this.labelPrice.text = "(本次免费)"), (this.useGold = 0));
|
|
else {
|
|
const e = Global.gameProxy.getCommonConfigById("15").min;
|
|
((this.useGold = e), (this.labelPrice.text = "x" + e));
|
|
}
|
|
}
|
|
initCards() {
|
|
this.cardPosArr = [];
|
|
const e = Global.gameProxy.getTabelConfigByType("lottery");
|
|
this.gifts = e;
|
|
for (let i = 0; i < this.groupItems.numChildren; i++) {
|
|
const n = e[i + 1],
|
|
a = this.groupItems.getChildAt(i);
|
|
if (1 == n.type)
|
|
((a.imgIcon.source = game.URLConfig.getIcon(Const.GOLD_ICON)), (a.labelNum.text = "x" + n.value));
|
|
else if (2 == n.type)
|
|
((a.imgIcon.source = game.URLConfig.getIcon(Const.DIAMOND_ICON)), (a.labelNum.text = "x" + n.value));
|
|
else {
|
|
const o = Global.gameProxy.getItemConfig(n.value);
|
|
((a.imgIcon.source = game.URLConfig.getIcon(o.graphical_id)), (a.labelNum.text = "x" + n.count));
|
|
}
|
|
this.cardPosArr.push(new egret.Point(a.x + this.groupItems.x - 15, a.y + this.groupItems.y - 15));
|
|
}
|
|
}
|
|
onTouchTap(t) {
|
|
switch ((super.onTouchTap(t), t.target)) {
|
|
case this.btnLottery:
|
|
this.lottery();
|
|
}
|
|
}
|
|
btnCloseTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_LOTTERY);
|
|
}
|
|
lottery() {
|
|
const e = this;
|
|
this.btnLottery.enabled = !1;
|
|
const i = GameConfig.SERVER_PATH + "comm/lottery";
|
|
Global.netProxy.sendRequest(i, {}, function (i) {
|
|
0 == i.status
|
|
? ((Global.playerProxy.playerData.lottery_count = i.data.count),
|
|
(Global.playerProxy.playerData.gold -= int(e.useGold)),
|
|
game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE),
|
|
e.updateCost(),
|
|
(e.getConfig = i.data),
|
|
(e.rewardIndex = i.data.id - 1),
|
|
e.showLotteryEffect(),
|
|
Global.audioProxy.playSound("lottery_mp3"))
|
|
: (TipsUtils.showErrorCodeTips(i.status), (e.btnLottery.enabled = !0));
|
|
});
|
|
}
|
|
showLotteryEffect() {
|
|
const t = this;
|
|
((this.lightIndex = 0),
|
|
(this.groupLight.visible = !0),
|
|
(this.imgLight.visible = !0),
|
|
(this.isAcc = !0),
|
|
(this.effDelay = 500),
|
|
this.setLightImgPos());
|
|
for (let e = 0; e < this.groupLight.numChildren; e++) {
|
|
const i = this.groupLight.getChildAt(e);
|
|
((i.alpha = 0),
|
|
egret.Tween.get(i, {
|
|
loop: !0
|
|
})
|
|
.wait(250 * Math.random())
|
|
.to(
|
|
{
|
|
alpha: 1
|
|
},
|
|
50
|
|
)
|
|
.wait(200 + 250 * Math.random())
|
|
.to(
|
|
{
|
|
alpha: 0
|
|
},
|
|
50
|
|
));
|
|
}
|
|
(manager.UpdateTickerManager.instance.add(this), this.update(500));
|
|
let n = 1;
|
|
this.cirLightDelayId = egret.setInterval(
|
|
function () {
|
|
(n++, (t.imgCirLight.source = "lottery_l" + (1 + (n % 2)) + "_png"));
|
|
},
|
|
this,
|
|
100
|
|
);
|
|
}
|
|
hideLotteryEffect() {
|
|
manager.UpdateTickerManager.instance.remove(this);
|
|
for (let t = 0; t < this.groupLight.numChildren; t++) {
|
|
const e = this.groupLight.getChildAt(t);
|
|
egret.Tween.removeTweens(e);
|
|
}
|
|
((this.groupLight.visible = !1), egret.clearInterval(this.cirLightDelayId), this.showResult());
|
|
}
|
|
showResult() {
|
|
const e = this.getConfig;
|
|
let i = "钻石";
|
|
let n = e.value;
|
|
if (1 == e.type)
|
|
((Global.playerProxy.playerData.gold += int(n)),
|
|
(i = "金币"),
|
|
Global.alertMediator.addAlert("恭喜获得" + i + "x" + n));
|
|
else if (2 == e.type)
|
|
((Global.playerProxy.playerData.gem += int(n)), Global.alertMediator.addAlert("恭喜获得" + i + "x" + n));
|
|
else if (3 == e.type) {
|
|
const a = Global.gameProxy.getItemConfig(e.value);
|
|
((i = a.name),
|
|
(n = e.count),
|
|
Global.playerProxy.updateWareHouseItem(
|
|
{
|
|
item_id: a.id
|
|
},
|
|
e.odds
|
|
),
|
|
Global.alertMediator.addAlert("恭喜获得" + i + "x" + e.odds));
|
|
}
|
|
(game.EventManager.instance.dispatch(SysNotify.TOPLAYER_INFO_UPDATE),
|
|
(this.btnLottery.visible = !0),
|
|
(this.btnLottery.enabled = !0));
|
|
}
|
|
resetLotteryEffect() {
|
|
((this.btnLottery.enabled = !0), (this.lightIndex = 0), this.hideLotteryEffect(), (this.btnLottery.visible = !0));
|
|
}
|
|
update(e) {
|
|
if (((this.effDelay -= e), this.effDelay <= 0)) {
|
|
let i = 500;
|
|
if (this.isAcc) i = 500 - 50 * this.lightIndex;
|
|
else {
|
|
var n = this.getRewardIndexAndLightIndexLen();
|
|
((i = 500 - 50 * n), 0 == n && this.hideLotteryEffect());
|
|
}
|
|
if (
|
|
((i = game.Utils.limit(i, 50, 500)),
|
|
(i += this.effDelay),
|
|
(this.effDelay = i),
|
|
this.setLightImgPos(),
|
|
this.lightIndex++,
|
|
this.lightIndex > 100 && this.rewardIndex >= 0)
|
|
) {
|
|
var n = this.getRewardIndexAndLightIndexLen();
|
|
10 == n && (this.isAcc = !1);
|
|
}
|
|
}
|
|
}
|
|
getRewardIndexAndLightIndexLen() {
|
|
let t = 10;
|
|
const e = this.lightIndex % this.rewardCount;
|
|
return (t = e > this.rewardIndex ? this.rewardCount - e + this.rewardIndex : this.rewardIndex - e);
|
|
}
|
|
setLightImgPos() {
|
|
const t = this.cardPosArr[this.lightIndex % this.rewardCount];
|
|
((this.imgLight.x = t.x), (this.imgLight.y = t.y));
|
|
}
|
|
};
|
|
((game.LotteryPanel = LotteryPanel), __reflect(LotteryPanel.prototype, "game.LotteryPanel", ["IUpdate"]));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const NoticePanel = class NoticePanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.pageIndex = 1;
|
|
this.pageMax = 1;
|
|
this.pageEveNum = 4;
|
|
this.pageFruitEveNum = 15;
|
|
this.tabIndex = 0;
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new NoticeSkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(620),
|
|
this.commonPanel.setPanelHeight(780),
|
|
this.commonPanel.setTitleIcon("menu_notice_png"),
|
|
this.commonPanel.setTitle("panel_title_notic1e_png"),
|
|
(this.list.dataProvider = null),
|
|
(this.list.itemRenderer = game.NoticeItemRender),
|
|
this.scroller.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onScrollerTouchBegan, this),
|
|
this.changePage(1, !0));
|
|
}
|
|
onScrollerTouchBegan(t) {
|
|
((this.scrollerTouchStart = t.stageX),
|
|
this.stage.once(egret.TouchEvent.TOUCH_END, this.onScrollerTouchEnded, this, !0, Number.MAX_VALUE));
|
|
}
|
|
onScrollerTouchEnded(t) {
|
|
const e = t.stageX - this.scrollerTouchStart;
|
|
e > 150 ? this.changePage(-1) : -150 > e && this.changePage(1);
|
|
}
|
|
changePage(t, e) {
|
|
if ((void 0 === e && (e = !1), e)) this.pageIndex = t;
|
|
else {
|
|
if (this.pageIndex <= 1 && 0 > t) return;
|
|
if (this.pageIndex >= this.pageMax && t > 0) return;
|
|
this.pageIndex += t;
|
|
}
|
|
((this.labelPage.text = this.pageIndex + "/" + this.pageMax), this.updateListPage(this.pageIndex));
|
|
}
|
|
onSysLogListData(e) {
|
|
((this.pageMax = game.Utils.limit(Math.ceil(e.total_count / 4), 1, 10)),
|
|
(this.labelPage.text = this.pageIndex + "/" + this.pageMax),
|
|
(this.list.dataProvider = new eui.ArrayCollection(e.list)));
|
|
}
|
|
updateListPage(t) {
|
|
this.mediator.getSystemNoticeList(
|
|
(this.pageIndex - 1) * this.pageEveNum,
|
|
this.pageEveNum,
|
|
this.onSysLogListData.bind(this)
|
|
);
|
|
}
|
|
onTouchTap(t) {
|
|
super.onTouchTap(t);
|
|
const i = t.target;
|
|
switch (i) {
|
|
case this.btnPrev:
|
|
this.changePage(-1);
|
|
break;
|
|
case this.btnNext:
|
|
this.changePage(1);
|
|
}
|
|
}
|
|
btnCloseTouchEnded() {
|
|
this.mediator.closeViewComponent();
|
|
}
|
|
};
|
|
((game.NoticePanel = NoticePanel), __reflect(NoticePanel.prototype, "game.NoticePanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const PayPanel = class PayPanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.tabIndex = 0;
|
|
this.locked = !1;
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new PaySkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(600),
|
|
this.commonPanel.setPanelHeight(790),
|
|
this.commonPanel.setTitleIcon("panel_icon_info_png"),
|
|
this.commonPanel.setTitle("pay_title_png"),
|
|
(this.group0.visible = !1),
|
|
(this.group1.visible = !1),
|
|
this.initTab());
|
|
const i = Global.gameProxy.getTabelConfigByType(game.TabelName.diamonds_recharge),
|
|
n = [];
|
|
for (var a in i) i[a].id > 6 && n.push(i[a]);
|
|
for (var o = 0; o < n.length; o++) this["goldpay" + (o + 1)].initWidthData(n[o], o + 1, this);
|
|
const r = [];
|
|
for (var a in i) i[a].id <= 6 && r.push(i[a]);
|
|
for (var o = 0; o < r.length; o++) this["diamondPay" + (o + 1)].initWidthData(r[o], o + 1, this);
|
|
}
|
|
btnCloseTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_PAY);
|
|
}
|
|
initTab() {
|
|
const e = ["钻石充值", "金币充值"];
|
|
((this.tab = new game.Tab(e, this.onTabItemClickCallback.bind(this))),
|
|
(this.tab.bottom = 0),
|
|
this.groupTab.addChild(this.tab));
|
|
}
|
|
onTabItemClickCallback(t) {
|
|
((this.tabIndex = t), (this.group0.visible = 1 == t), (this.group1.visible = !this.group0.visible));
|
|
}
|
|
buy(t) {
|
|
const e = this;
|
|
if (this.locked) return void PopUpManager.popTip("请等待服务器处理");
|
|
const i = GameConfig.SERVER_PATH + "pay/pay",
|
|
n = {
|
|
pay_id: t.id
|
|
};
|
|
Global.netProxy.sendRequest(i, n, function (t) {
|
|
0 == t.status ? (window.location.href = t.data.url) : (TipsUtils.showErrorCodeTips(t.status), (e.locked = !1));
|
|
});
|
|
}
|
|
};
|
|
((game.PayPanel = PayPanel), __reflect(PayPanel.prototype, "game.PayPanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const PlayerInfoPanel = class PlayerInfoPanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new RoleInfoSkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(600),
|
|
this.commonPanel.setPanelHeight(835),
|
|
this.commonPanel.setTitleIcon("panel_icon_warehouse_png"),
|
|
this.commonPanel.setTitle("panel_title_info_png"));
|
|
}
|
|
childrenCreated() {
|
|
(super.childrenCreated(),
|
|
this.initRoleInfo(),
|
|
this.initList(),
|
|
game.UIUtils.addShortTouch(this.setButton, this.onSet.bind(this), null));
|
|
}
|
|
onSet() {
|
|
game.SettingPanel.instance.show();
|
|
}
|
|
flushPanel() {
|
|
this.initRoleInfo();
|
|
}
|
|
initList() {
|
|
((this.list.dataProvider = new eui.ArrayCollection([
|
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
|
|
])),
|
|
(this.list.itemRenderer = AchiconitemRender));
|
|
}
|
|
initRoleInfo() {
|
|
const e = Global.playerProxy.playerData;
|
|
this.imgHead.mask = this.imgHeadMask;
|
|
let i = e.avatar.toString();
|
|
if (("" == i && (i = "1"), i.indexOf("http") > -1)) this.imgHead.source = i;
|
|
else {
|
|
const n = game.URLConfig.getHead(i);
|
|
this.imgHead.source = n;
|
|
}
|
|
((this.labelId.text = e.id + ""),
|
|
(this.labelName.text = e.nickname),
|
|
(this.labelLv.text = "LV." + e.level),
|
|
(this.labelGold.text = game.Utils.BigNumTostring(e.gold)),
|
|
(this.labelDiamond.text = game.Utils.BigNumTostring(e.gem)),
|
|
(this.labelpower.text = game.Utils.BigNumTostring(100 * e.level)),
|
|
(this.labelStone.text = game.Utils.BigNumTostring(e.stone)),
|
|
(this.labelSteel.text = game.Utils.BigNumTostring(e.steel)));
|
|
}
|
|
btnCloseTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_PLAYER_INFO);
|
|
}
|
|
};
|
|
((game.PlayerInfoPanel = PlayerInfoPanel), __reflect(PlayerInfoPanel.prototype, "game.PlayerInfoPanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const Main = class Main extends eui.UILayer {
|
|
constructor() {
|
|
super();
|
|
this.version_num = "1.0411113";
|
|
this.use_oss = !1;
|
|
this.oss_path = "http://down.muchang123.com/";
|
|
this.isThemeLoadEnd = !1;
|
|
this.isResourceLoadEnd = !1;
|
|
}
|
|
createChildren() {
|
|
super.createChildren();
|
|
const main = this;
|
|
(Object.defineProperty(RES.web.Html5VersionController.prototype, "getVirtualUrl", {
|
|
value: (resourcePath) =>
|
|
main.use_oss ? main.oss_path + resourcePath + "?v=" + main.version_num : resourcePath + "?v=" + main.version_num,
|
|
configurable: true,
|
|
writable: true
|
|
}),
|
|
(this.version = new RES.VersionController()),
|
|
RES.registerVersionController(this.version),
|
|
egret.Capabilities.isMobile
|
|
? this.stage.stageHeight / this.stage.stageWidth < 1.5625 &&
|
|
(this.stage.setContentSize(640, 1e3), (this.stage.scaleMode = egret.StageScaleMode.FIXED_HEIGHT))
|
|
: ((this.stage.scaleMode = egret.StageScaleMode.SHOW_ALL), (this.stage.orientation = "auto")));
|
|
const n = new AssetAdapter();
|
|
(this.stage.registerImplementation("eui.IAssetAdapter", n),
|
|
this.stage.registerImplementation("eui.IThemeAdapter", new ThemeAdapter()),
|
|
(this.loadingView = new LoadingUI()),
|
|
this.stage.addChild(this.loadingView),
|
|
this.addChild(GameLayerManager.gameLayer()),
|
|
game.AppFacade.getInstance().startUp(GameLayerManager.gameLayer()),
|
|
RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this),
|
|
RES.loadConfig("resource/default.res.json", "resource/"));
|
|
}
|
|
onConfigComplete(t) {
|
|
RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
|
|
const e = new eui.Theme("resource/default.thm.json?v=bag-panel-original-1", this.stage);
|
|
(e.addEventListener(eui.UIEvent.COMPLETE, this.onThemeLoadComplete, this),
|
|
RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this),
|
|
RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this),
|
|
RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this),
|
|
RES.loadGroup("preload"));
|
|
}
|
|
onThemeLoadComplete() {
|
|
((this.isThemeLoadEnd = !0), this.createScene());
|
|
}
|
|
onResourceLoadComplete(t) {
|
|
"preload" == t.groupName &&
|
|
(this.stage.removeChild(this.loadingView),
|
|
RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this),
|
|
RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this),
|
|
RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this),
|
|
(this.isResourceLoadEnd = !0),
|
|
this.createScene());
|
|
}
|
|
createScene() {
|
|
this.isThemeLoadEnd && this.isResourceLoadEnd && this.startCreateScene();
|
|
}
|
|
onResourceLoadError(t) {
|
|
(console.warn("Group:" + t.groupName + " has failed to load"), this.onResourceLoadComplete(t));
|
|
}
|
|
onResourceProgress(t) {
|
|
"preload" == t.groupName && this.loadingView.setProgress(t.itemsLoaded, t.itemsTotal);
|
|
}
|
|
startCreateScene() {
|
|
((Const.stage = this.stage),
|
|
(Const.WIN_W = this.stage.stageWidth),
|
|
(Const.WIN_H = this.stage.stageHeight),
|
|
DateTimer.instance.run(),
|
|
game.AppFacade.getInstance().sendNotification(SysNotify.START_GAME));
|
|
}
|
|
};
|
|
((game.Main = Main), __reflect(Main.prototype, "game.Main"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const SendMessagePanel = class SendMessagePanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.skinName = new SendMessageSkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(600),
|
|
this.commonPanel.setPanelHeight(730),
|
|
this.commonPanel.setTitleIcon("img_icon_laba_png"),
|
|
this.commonPanel.setTitle("panel_title_message_png"));
|
|
}
|
|
btnCloseTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_SEND_MESSAGE);
|
|
}
|
|
onTouchTap(t) {
|
|
switch ((t.stopPropagation(), t.target)) {
|
|
case this.sendBtn:
|
|
this.sendMessage();
|
|
}
|
|
}
|
|
sendMessage() {
|
|
const t = this,
|
|
e = Global.playerProxy.getHasItemByItemId(107002);
|
|
if (!e || e.number < 1) return void PopUpManager.popTip("喇叭道具不足");
|
|
const i = this.phoneEt.text.trim(),
|
|
n = this.contentEt.text.trim(),
|
|
a = this.wxEt.text.trim();
|
|
if (RegUtils.isNull(n)) return void PopUpManager.popTip("请输入发布内容");
|
|
const o = {
|
|
wx_id: a,
|
|
phone: i,
|
|
message: n
|
|
},
|
|
r = GameConfig.SERVER_PATH + "comm/broadcast";
|
|
Global.netProxy.sendRequest(r, o, function (i) {
|
|
0 == i.status
|
|
? (PopUpManager.popTip("发布成功,等待审核"),
|
|
Global.playerProxy.sellWareHouseItem(
|
|
{
|
|
id: e.config.id
|
|
},
|
|
1
|
|
),
|
|
t.closeBtnTouchEnded())
|
|
: TipsUtils.showErrorCodeTips(i.status);
|
|
});
|
|
}
|
|
};
|
|
((game.SendMessagePanel = SendMessagePanel), __reflect(SendMessagePanel.prototype, "game.SendMessagePanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const SettingPanel = class SettingPanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.isFullScreen = !0;
|
|
this.skinName = new SettingPanelSkin();
|
|
}
|
|
static get instance() {
|
|
return (SettingPanel._instance || (SettingPanel._instance = new SettingPanel()), SettingPanel._instance);
|
|
}
|
|
static set instance(t) {
|
|
SettingPanel._instance = null;
|
|
}
|
|
createChildren() {
|
|
super.createChildren();
|
|
}
|
|
hide() {
|
|
const e = Const.WIN_W / 2,
|
|
n = Const.WIN_H / 2;
|
|
egret.Tween.get(this)
|
|
.to(
|
|
{
|
|
x: e,
|
|
y: n,
|
|
scaleX: 0,
|
|
scaleY: 0
|
|
},
|
|
250,
|
|
egret.Ease.backIn
|
|
)
|
|
.call(function () {
|
|
(game.UIUtils.removeSelf(this), (SettingPanel._instance = null));
|
|
}, this);
|
|
}
|
|
show() {
|
|
var t = !!Global.audioProxy.isOpen;
|
|
((this.closeMusicBtn.visible = t),
|
|
(this.openMusicBtn.visible = !t),
|
|
GameLayerManager.instance.popLayer.addChild(this));
|
|
var t = !!Global.audioProxy.soundOpen;
|
|
((this.closeYinXiaoBtn.visible = t), (this.openYinXiaoBtn.visible = !t));
|
|
}
|
|
onTouchTap(e) {
|
|
switch ((e.stopPropagation(), e.target)) {
|
|
case this.closeYinXiaoBtn:
|
|
(Global.audioProxy.setSoundOpen(!1), (this.closeYinXiaoBtn.visible = !1), (this.openYinXiaoBtn.visible = !0));
|
|
break;
|
|
case this.openYinXiaoBtn:
|
|
(Global.audioProxy.setSoundOpen(!0), (this.closeYinXiaoBtn.visible = !0), (this.openYinXiaoBtn.visible = !1));
|
|
break;
|
|
case this.closeMusicBtn:
|
|
(Global.audioProxy.openSound(!1), (this.closeMusicBtn.visible = !1), (this.openMusicBtn.visible = !0));
|
|
break;
|
|
case this.openMusicBtn:
|
|
(Global.audioProxy.openSound(!0), (this.closeMusicBtn.visible = !0), (this.openMusicBtn.visible = !1));
|
|
break;
|
|
case this.closePanelBtn:
|
|
this.hide();
|
|
break;
|
|
case this.changeBtn:
|
|
window.location.href = window.location.href;
|
|
break;
|
|
case this.zhuangbanBtn:
|
|
(this.hide(), game.AppFacade.getInstance().sendNotification(PanelNotify.OPEN_SKIN));
|
|
}
|
|
}
|
|
};
|
|
((game.SettingPanel = SettingPanel), __reflect(SettingPanel.prototype, "game.SettingPanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const ShopPanel = class ShopPanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new ShopSkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(620),
|
|
this.commonPanel.setPanelHeight(754),
|
|
this.commonPanel.setTitleIcon("panel_icon_shop_png"),
|
|
this.commonPanel.setTitle("panel_title_shop_png"),
|
|
this.initTab());
|
|
}
|
|
initTab() {
|
|
const e = ["普通道具", "神秘商店", "背景"];
|
|
((this.tab = new game.Tab(e, this.onTabItemClickCallback.bind(this))),
|
|
(this.tab.bottom = 0),
|
|
this.groupTab.addChild(this.tab));
|
|
}
|
|
onTabItemClickCallback(e) {
|
|
((this.list.itemRenderer = game.ShopItemRender), (this.list.dataProvider = null));
|
|
let i = null;
|
|
(0 == e
|
|
? ((i = Global.gameProxy.getShopConfigByType(1)), (i = _.sortBy(i, "playerLevel")))
|
|
: 1 == e
|
|
? (i = Global.gameProxy.getShopConfigByType(2))
|
|
: 2 == e &&
|
|
((i = Global.gameProxy.getShopConfigByType(3)), (this.list.itemRenderer = game.ShopSkinItemRender)),
|
|
this.updateTabPageByData(i));
|
|
}
|
|
btnCloseTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_SHOP);
|
|
}
|
|
updateTabPageByData(t) {
|
|
this.list.dataProvider = new eui.ArrayCollection(t);
|
|
}
|
|
};
|
|
((game.ShopPanel = ShopPanel), __reflect(ShopPanel.prototype, "game.ShopPanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const SkinPanel = class SkinPanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new ChangeSkinSkin();
|
|
}
|
|
createChildren() {
|
|
(super.createChildren(),
|
|
this.commonPanel.setPanelWidth(640),
|
|
this.commonPanel.setPanelHeight(734),
|
|
this.commonPanel.setIconOffsetX(65),
|
|
this.commonPanel.setTitleIcon("panel_icon_skin_png"),
|
|
this.commonPanel.setTitle("panel_title_skin_png"),
|
|
this.initList());
|
|
}
|
|
onRemoved() {
|
|
super.onRemoved();
|
|
}
|
|
initList() {
|
|
const e = Global.playerProxy.getMySkins();
|
|
(e.sort(function (t, e) {
|
|
return t.config.id - e.config.id;
|
|
}),
|
|
(this.list.dataProvider = new eui.ArrayCollection(e)),
|
|
(this.list.itemRenderer = game.SkinItem));
|
|
}
|
|
btnCloseTouchEnded() {
|
|
game.AppFacade.getInstance().sendNotification(PanelNotify.CLOSE_SKIN);
|
|
}
|
|
};
|
|
((game.SkinPanel = SkinPanel), __reflect(SkinPanel.prototype, "game.SkinPanel"));
|
|
})(game || (game = {}));
|
|
var game;
|
|
!(function (game) {
|
|
const SurePasswordPanel = class SurePasswordPanel extends game.BasePanel {
|
|
constructor() {
|
|
super();
|
|
this.isFullScreen = !0;
|
|
this.isVisibleAnimate = !0;
|
|
this.skinName = new SurePasswordSkin();
|
|
}
|
|
static get instance() {
|
|
return (
|
|
SurePasswordPanel._instance || (SurePasswordPanel._instance = new SurePasswordPanel()),
|
|
SurePasswordPanel._instance
|
|
);
|
|
}
|
|
show(t, e, i) {
|
|
((this.serverPath = t),
|
|
(this.data = e),
|
|
(this.sucCallback = i),
|
|
GameLayerManager.instance.popLayer.addChild(this));
|
|
}
|
|
btnOkTouch() {
|
|
const t = this,
|
|
e = this.pwdEt.text;
|
|
return RegUtils.isNull(e)
|
|
? void PopUpManager.popTip("请输入交易密码")
|
|
: ((this.data.pay_password = e.trim()),
|
|
void Global.netProxy.sendRequest(this.serverPath, this.data, function (e) {
|
|
(t.sucCallback && t.sucCallback(e), t.closeBtnTouchEnded());
|
|
}));
|
|
}
|
|
closeBtnTouchEnded() {
|
|
const e = Const.WIN_W / 2,
|
|
n = Const.WIN_H / 2;
|
|
egret.Tween.get(this)
|
|
.to(
|
|
{
|
|
x: e,
|
|
y: n,
|
|
scaleX: 0,
|
|
scaleY: 0
|
|
},
|
|
250,
|
|
egret.Ease.backIn
|
|
)
|
|
.call(function () {
|
|
(game.UIUtils.removeSelf(this), (SurePasswordPanel._instance = null));
|
|
}, this);
|
|
}
|
|
onTouchTap(t) {
|
|
switch ((t.stopPropagation(), t.target)) {
|
|
case this.btnOk:
|
|
((this.btnOk.enabled = !1), this.btnOkTouch());
|
|
break;
|
|
case this.btnNo:
|
|
this.closeBtnTouchEnded();
|
|
}
|
|
}
|
|
};
|
|
((game.SurePasswordPanel = SurePasswordPanel), __reflect(SurePasswordPanel.prototype, "game.SurePasswordPanel"));
|
|
})(game || (game = {}));
|