Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EventClickImgPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EventClickImgPanelUI = new EventClickImgPanelUI();
|
||||
|
||||
public function EventClickImgPanel(imgsrc:String, showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
buffMode = false;
|
||||
ondata(imgsrc);
|
||||
Caller.delayCall(delayAdd,100);
|
||||
}
|
||||
|
||||
public function delayAdd() : void
|
||||
{
|
||||
this.addEventListener(MobiEvent.CLICK,closeHandler);
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,closeHandler);
|
||||
}
|
||||
|
||||
public function ondata(data:Object) : void
|
||||
{
|
||||
if(data == null)
|
||||
{
|
||||
ui.container_img.loadNetImg("");
|
||||
return;
|
||||
}
|
||||
ui.container_img.loadNetImg(data.toString());
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
|
||||
public class EventClickImgPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public function EventClickImgPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.ActivityClickImgPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(640,960);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EventImgPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EventImgPanelUI = new EventImgPanelUI();
|
||||
|
||||
public function EventImgPanel(data:Object, showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
buffMode = false;
|
||||
ondata(data);
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,closeHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function ondata(data:Object) : void
|
||||
{
|
||||
ui.container_img.loadNetImg(data.data.contentImg);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EventImgPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public function EventImgPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.ActivityImgPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(600,480);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.npc.ConditionVo;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myr.panel.noticepanel.NoticePanel;
|
||||
import net.pixvi.myr.panel.storeground.StoreGroundPanel;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EventListPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EventListPanelUI = new EventListPanelUI();
|
||||
|
||||
public function EventListPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super();
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_notice.onClick(noticeHandler);
|
||||
trace(Table.activity_info.events);
|
||||
}
|
||||
|
||||
public static function getIns() : EventListPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(EventListPanel) as EventListPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var edata:Object = null;
|
||||
var vo:ConditionVo = null;
|
||||
var events:Array = [];
|
||||
for(i = 0; i < Table.activity_info.events.length; i++)
|
||||
{
|
||||
edata = Table.activity_info.events[i];
|
||||
if(edata.condition != null)
|
||||
{
|
||||
vo = new ConditionVo(edata.condition);
|
||||
if(!vo.check())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
events.push(edata);
|
||||
}
|
||||
ui.list_event.setDatas(events);
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
public function noticeHandler(e:Event = null) : void
|
||||
{
|
||||
var p:NoticePanel = new NoticePanel();
|
||||
p.popInWith(this);
|
||||
this.visible = false;
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function maskHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
StoreGroundPanel.getIns().ground.resumeOrStart();
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
MainMenu.getIns().ui.ui_top.firstOpen = false;
|
||||
MainMenu.getIns().ui.ui_top.mc_huodong.visible = false;
|
||||
MainMenu.getIns().ui.ui_top.mc_huodong2.visible = false;
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
super.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.panel.noticepanel.NoticeXieyiPanel;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EventListPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var list_event:PiSliderList;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_notice:PiLightButton;
|
||||
|
||||
public var btn_zcxy:PiLightButton;
|
||||
|
||||
public var btn_ysxy:PiLightButton;
|
||||
|
||||
public var btn_etbh:PiLightButton;
|
||||
|
||||
public function EventListPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EventListPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
if(btn_zcxy != null)
|
||||
{
|
||||
btn_zcxy.onClick(zcxyHandler);
|
||||
btn_ysxy.onClick(ysxyHandler);
|
||||
btn_etbh.onClick(etbhHandler);
|
||||
if(MyrCenter.channel == "BLBL")
|
||||
{
|
||||
btn_zcxy.visible = btn_ysxy.visible = btn_etbh.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function zcxyHandler(e:Event = null) : void
|
||||
{
|
||||
NoticeXieyiPanel.pop(null,1);
|
||||
}
|
||||
|
||||
public function ysxyHandler(e:Event = null) : void
|
||||
{
|
||||
NoticeXieyiPanel.pop(null,2);
|
||||
}
|
||||
|
||||
public function etbhHandler(e:Event = null) : void
|
||||
{
|
||||
NoticeXieyiPanel.pop(null,0);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_event.setList(EventPanelSliderItem,6,false,170);
|
||||
super.onSkinComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.myr.center.ActiCenter;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderListItem;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EventPanelSliderItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var img:NetBitImg;
|
||||
|
||||
public function EventPanelSliderItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
super.onData(value);
|
||||
if(img != null)
|
||||
{
|
||||
removeChild(img);
|
||||
img = null;
|
||||
}
|
||||
img = new NetBitImg(value.img);
|
||||
addChild(img);
|
||||
img.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
ActiCenter.getIns().startEvent(data);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
package net.pixvi.myr.panel.event.dailygift
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.AchiCenter;
|
||||
import net.pixvi.myr.center.ActiCenter;
|
||||
import net.pixvi.myr.center.GuideCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MasterCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.achi.AchiType;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.panel.pay.PayPackPanel;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.controls.PiButton;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ActiDailyGiftPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
private static var levelChecked:Boolean = false;
|
||||
|
||||
public var ui:ActiDailyGiftUI = new ActiDailyGiftUI();
|
||||
|
||||
public function ActiDailyGiftPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
var i:int = 0;
|
||||
var rvo:RewardVo = null;
|
||||
buffMode = false;
|
||||
addChild(ui);
|
||||
super();
|
||||
for(i = 1; i <= 5; )
|
||||
{
|
||||
rvo = new RewardVo();
|
||||
rvo.setByObject(Table.activity_info.dailyGift[i]);
|
||||
rvo.buildRewards();
|
||||
(ui["btn_box" + i] as PiButton).setTip(rvo.toDesString("<br/>"));
|
||||
i++;
|
||||
}
|
||||
PiLightButton.btnTouchLight.setDisplay(ui.mc_box);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_check.onClick(startCheck);
|
||||
ui.btn_vipBuy.onClick(vipBuyHandler);
|
||||
ui.btn_vipCheck.onClick(vipCheckHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : ActiDailyGiftPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(ActiDailyGiftPanel) as ActiDailyGiftPanel;
|
||||
}
|
||||
|
||||
public function vipBuyHandler(e:Event = null) : void
|
||||
{
|
||||
if(GameMath.OpenPay && Table.setting.closePay != true)
|
||||
{
|
||||
PayPackPanel.getIns().popByPayId("301");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.showMsg(lang("暂未开放的功能。"));
|
||||
}
|
||||
}
|
||||
|
||||
public function vipCheckHandler(e:Event) : void
|
||||
{
|
||||
ActiCenter.getIns().vipDailyGiftCheck(updateVip);
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
update();
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskHandler);
|
||||
var vipReward:RewardVo = new RewardVo();
|
||||
vipReward.setByObject(Table.game_setting.vipReward);
|
||||
ui.list_vipReward.setDatas(vipReward.getRewardShowArray());
|
||||
GlobalBroadcast.addEventListener(MYREvent.VIP_STATUS_CHANGE,updateVip);
|
||||
if(MasterCenter.getIns().getVipDay() > 0 && !GuideCenter.getIns().checkFin(GSub.ACHI_VIP))
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.ACHI_VIP);
|
||||
AchiCenter.getIns().autoCheck(AchiType.NONE,true);
|
||||
}
|
||||
updateLoopCheckReward();
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
public function updateLoopCheckReward() : void
|
||||
{
|
||||
var rewardvo:RewardVo = null;
|
||||
var curNum:int = 0;
|
||||
var targetNum:int = 0;
|
||||
if(ui.ui_loop != null)
|
||||
{
|
||||
if(Table.activity_info.loopCheckReward.open == true)
|
||||
{
|
||||
ui.ui_loop.visible = true;
|
||||
rewardvo = new RewardVo();
|
||||
rewardvo.setByObject(Table.activity_info.loopCheckReward.reward);
|
||||
ui.ui_loop.card_item.showMode = 1;
|
||||
ui.ui_loop.card_item.onAutoData(rewardvo.getRewardShowArray()[0]);
|
||||
curNum = int(Master.activityHistory.loopCheckRewardDayNum());
|
||||
targetNum = int(Table.activity_info.loopCheckReward.dayNum);
|
||||
ui.ui_loop.text_targetDay.text = targetNum.toString();
|
||||
ui.ui_loop.text_passDay.text = lang("{0}天",curNum.toString());
|
||||
if(curNum >= targetNum)
|
||||
{
|
||||
ui.ui_loop.btn_get.visible = true;
|
||||
ui.ui_loop.text_passDay.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_loop.btn_get.visible = false;
|
||||
ui.ui_loop.text_passDay.visible = true;
|
||||
}
|
||||
ui.ui_loop.btn_get.onClick(getLoopReward);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_loop.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getLoopReward(e:Event = null) : void
|
||||
{
|
||||
ActiCenter.getIns().LoopCheckReward(getLoopRewardComplete);
|
||||
}
|
||||
|
||||
private function getLoopRewardComplete(re:Object = null) : void
|
||||
{
|
||||
updateLoopCheckReward();
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
private function maskHandler(e:Event = null) : void
|
||||
{
|
||||
if(this == PopCenter.getIns().topPanel)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,maskHandler);
|
||||
super.showOut();
|
||||
}
|
||||
|
||||
public function startCheck(e:Event = null) : void
|
||||
{
|
||||
this.mouseEnabled = this.mouseEnabled = false;
|
||||
ActiCenter.getIns().dailyGiftCheck(startCheckHandler);
|
||||
}
|
||||
|
||||
public function startCheckHandler(o:Object = null) : void
|
||||
{
|
||||
this.mouseEnabled = this.mouseEnabled = true;
|
||||
update();
|
||||
updateLoopCheckReward();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
var cha:int = 0;
|
||||
var reduceLevel:int = 0;
|
||||
if(!levelChecked && Master.activityHistory.dailyGiftCheckTime != 0)
|
||||
{
|
||||
cha = MyrCalendar.getDayNumber() - MyrCalendar.getDayNumber(Master.activityHistory.dailyGiftCheckTime * 1000);
|
||||
if(cha > 1)
|
||||
{
|
||||
trace("签到差:" + cha,"原签到等级:",Master.activityHistory.dailyGiftLevel);
|
||||
reduceLevel = Master.activityHistory.dailyGiftLevel - (cha - 1);
|
||||
if(reduceLevel < 1)
|
||||
{
|
||||
reduceLevel = 1;
|
||||
}
|
||||
if(Master.activityHistory.dailyGiftLevel != reduceLevel)
|
||||
{
|
||||
Alert.yes(lang("哎呀!"),lang("由于漏签 {0} 天,签到奖励等级降为:{1}",cha - 1,reduceLevel));
|
||||
Master.activityHistory.dailyGiftLevel = reduceLevel;
|
||||
}
|
||||
Master.activityHistory.dailyGiftCount = 0;
|
||||
}
|
||||
levelChecked = true;
|
||||
}
|
||||
var todaylevel:int = int(Master.activityHistory.dailyGiftLevel);
|
||||
if(ActiCenter.getIns().dailyGiftChecked())
|
||||
{
|
||||
todaylevel = Master.activityHistory.dailyGiftCount > 5 ? 5 : todaylevel - 1;
|
||||
if(todaylevel < 1)
|
||||
{
|
||||
todaylevel = 1;
|
||||
}
|
||||
ui.todaylevel(todaylevel,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.todaylevel(todaylevel,false);
|
||||
}
|
||||
ui.text_daynum.text = Master.activityHistory.dailyGiftCount.toString();
|
||||
ui.text_boxLevel.text = "LV:" + todaylevel.toString();
|
||||
var rvo:RewardVo = new RewardVo();
|
||||
rvo.setByObject(Table.activity_info.dailyGift[todaylevel]);
|
||||
rvo.buildRewards();
|
||||
ui.list_reward.setDatas(rvo.getRewardShowArray());
|
||||
var tiptext:String = rvo.toDesString("<br/>");
|
||||
TipCenter.registTextTip(ui.mc_box,tiptext);
|
||||
ui.text_signCount.text = lang("累计签到:{0}天",Master.activityHistory.dailyGiftSignCount.toString());
|
||||
updateVip();
|
||||
}
|
||||
|
||||
public function updateVip(e:Object = null) : void
|
||||
{
|
||||
var day:int = MasterCenter.getIns().getVipDay();
|
||||
if(day > 0)
|
||||
{
|
||||
ui.btn_vipBuy.visible = false;
|
||||
ui.text_vip.text = lang("剩余:{0}天",day);
|
||||
if(MasterCenter.getIns().getVipChecked())
|
||||
{
|
||||
ui.btn_vipCheck.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_vipCheck.visible = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_vip.visible = false;
|
||||
ui.btn_vipBuy.visible = GameMath.OpenPay;
|
||||
ui.btn_vipCheck.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
GlobalBroadcast.removeEventListener(MYREvent.VIP_STATUS_CHANGE,updateVip);
|
||||
TipCenter.remove(ui.mc_box);
|
||||
PiLightButton.btnTouchLight.removeDisplay(ui.mc_box);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package net.pixvi.myr.panel.event.dailygift
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.panel.stage.DropListItem;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ActiDailyGiftUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_box1:PiLightButton;
|
||||
|
||||
public var btn_box2:PiLightButton;
|
||||
|
||||
public var btn_box3:PiLightButton;
|
||||
|
||||
public var btn_box4:PiLightButton;
|
||||
|
||||
public var btn_box5:PiLightButton;
|
||||
|
||||
public var text_daynum:PiBitTextField;
|
||||
|
||||
public var list_reward:PiDataList;
|
||||
|
||||
public var list_vipReward:PiDataList;
|
||||
|
||||
public var mc_path:MovieClip;
|
||||
|
||||
public var mc_box:MovieClip;
|
||||
|
||||
public var mc_today:MovieClip;
|
||||
|
||||
public var text_checkDays:PiBitTextField;
|
||||
|
||||
public var text_boxLevel:PiBitTextField;
|
||||
|
||||
public var btn_check:PiLightButton;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_vipCheck:PiLightButton;
|
||||
|
||||
public var btn_vipBuy:PiLightButton;
|
||||
|
||||
public var text_vip:PiBitTextField;
|
||||
|
||||
public var text_signCount:PiBitTextField;
|
||||
|
||||
public var ui_loop:ActiDailyLoopCheckRewardUI;
|
||||
|
||||
public function ActiDailyGiftUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EventDailyGiftPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
mc_path.stop();
|
||||
mc_box.stop();
|
||||
list_reward.itemClass = DropListItem;
|
||||
list_reward.setItemPara("modeResult",true);
|
||||
list_vipReward.itemClass = DropListItem;
|
||||
list_vipReward.setItemPara("modeResult",true);
|
||||
if(!(GameMath.OpenPay && Table.setting.closePay != true))
|
||||
{
|
||||
text_vip.visible = list_vipReward.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function todaylevel(level:int = 1, checked:Boolean = false) : void
|
||||
{
|
||||
var tomorrowLevel:int = level;
|
||||
if(checked)
|
||||
{
|
||||
tomorrowLevel = level + 1 > 5 ? 5 : level + 1;
|
||||
mc_today.x = this["btn_box" + tomorrowLevel].x;
|
||||
mc_today.y = this["btn_box" + tomorrowLevel].y;
|
||||
mc_today.gotoAndStop(2);
|
||||
mc_path.gotoAndStop(tomorrowLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_today.x = this["btn_box" + level].x;
|
||||
mc_today.y = this["btn_box" + level].y;
|
||||
mc_today.gotoAndStop(1);
|
||||
mc_path.gotoAndStop(level);
|
||||
}
|
||||
mc_box.gotoAndStop(level);
|
||||
btn_check.visible = !checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package net.pixvi.myr.panel.event.dailygift
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.myr.panel.task.ItemCardUI;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ActiDailyLoopCheckRewardUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_get:PiLightButton;
|
||||
|
||||
public var text_passDay:PiBitTextField;
|
||||
|
||||
public var text_targetDay:TextField;
|
||||
|
||||
public var card_item:ItemCardUI;
|
||||
|
||||
public function ActiDailyLoopCheckRewardUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user