Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.pfw.utils.Calendar;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class DailyCheckListItem extends PiListItem
|
||||
{
|
||||
|
||||
public var mc_today:Sprite;
|
||||
|
||||
public var mc_get:Sprite;
|
||||
|
||||
public var mc_gotted:Sprite;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
private var dayflag:String;
|
||||
|
||||
private var t:TweenMax;
|
||||
|
||||
public function DailyCheckListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(130,130);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
dayflag = value.toString();
|
||||
container_img.loadNetBitImg("data/img/event/dailyCheck/day" + (int(dayflag) + 1) + ".png");
|
||||
var reward:RewardVo = new RewardVo();
|
||||
reward.setByObject(Table.activity_info.dailyCheck[dayflag]);
|
||||
mc_get.visible = mc_gotted.visible = mc_today.visible = false;
|
||||
mc_get.mouseChildren = mc_get.mouseEnabled = false;
|
||||
mc_gotted.mouseChildren = mc_gotted.mouseEnabled = false;
|
||||
mc_today.mouseChildren = mc_today.mouseEnabled = false;
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
t = null;
|
||||
}
|
||||
removeEventListener(MobiEvent.CLICK,showHandler);
|
||||
removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
var checkDay:int = Calendar.getDayNumber(Master.activityHistory.dailyCheckTime);
|
||||
var today:int = Calendar.getDayNumber();
|
||||
if(Master.activityHistory.dailyCheckCount > int(dayflag))
|
||||
{
|
||||
if(checkDay == today && int(dayflag) + 1 == Master.activityHistory.dailyCheckCount)
|
||||
{
|
||||
mc_today.visible = true;
|
||||
t = TweenMax.fromTo(mc_today,0.6,{"y":0},{
|
||||
"y":-12,
|
||||
"yoyo":true,
|
||||
"repeat":2000
|
||||
});
|
||||
}
|
||||
mc_gotted.visible = true;
|
||||
addEventListener(MobiEvent.CLICK,showHandler);
|
||||
}
|
||||
else if(Master.activityHistory.dailyCheckCount <= int(dayflag))
|
||||
{
|
||||
if(Master.activityHistory.dailyCheckCount == int(dayflag) && checkDay != Calendar.getDayNumber())
|
||||
{
|
||||
mc_get.visible = true;
|
||||
mc_today.visible = true;
|
||||
addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
t = TweenMax.fromTo(mc_today,0.6,{"y":0},{
|
||||
"y":-12,
|
||||
"yoyo":true,
|
||||
"repeat":2000
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
addEventListener(MobiEvent.CLICK,showHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
sendSelect();
|
||||
}
|
||||
|
||||
public function showHandler(e:Event = null) : void
|
||||
{
|
||||
var reward:RewardVo = new RewardVo();
|
||||
reward.setByObject(Table.activity_info.dailyCheck[dayflag]);
|
||||
RewardViewPanel.getIns().showRewardOn(skin,reward.getRewardShowArray());
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
container_img.reset();
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
t = null;
|
||||
}
|
||||
super.dispose();
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.center.ActiCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class DailyCheckPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:DailyCheckPanelUI = new DailyCheckPanelUI();
|
||||
|
||||
public function DailyCheckPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
buffMode = false;
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskCloseHandler);
|
||||
update();
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
var datas:Array = [0,1,2,3,4,5,6];
|
||||
ui.list_list.setDatas(datas);
|
||||
ui.list_list.addEventListener("piselect",selectHandler);
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event = null) : void
|
||||
{
|
||||
ActiCenter.getIns().dailyCheckCheck(checkHandler);
|
||||
}
|
||||
|
||||
public function checkHandler(e:Event = null) : void
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
public function maskCloseHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class DailyCheckPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_list:PiDataList;
|
||||
|
||||
public var container_bg:Sprite;
|
||||
|
||||
public var netimg:NetBitImg;
|
||||
|
||||
public function DailyCheckPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.DailyCheckPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.itemClass = DailyCheckListItem;
|
||||
netimg = new NetBitImg("data/img/ui/act_daily_botm.png");
|
||||
container_bg.addChild(netimg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.myr.panel.task.ItemCardUI;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
|
||||
public class RewardViewListItem extends PiListItem
|
||||
{
|
||||
|
||||
public var ui_card:ItemCardUI;
|
||||
|
||||
public function RewardViewListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
ui_card.modeMid();
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
ui_card.onAutoData(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Locator;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class RewardViewPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:RewardViewPanelUI = new RewardViewPanelUI();
|
||||
|
||||
public function RewardViewPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public static function getIns() : RewardViewPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(RewardViewPanel) as RewardViewPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
}
|
||||
|
||||
public function showRewardOn(dis:DisplayObject, rewards:Array, msg:String = "") : void
|
||||
{
|
||||
ui.list_list.setDatas(rewards);
|
||||
ui.text_msg.text = msg;
|
||||
var p:Point = dis.localToGlobal(new Point());
|
||||
this.x = p.x + 60 - 174 - 103;
|
||||
this.y = p.y + 90 - 144 - 85;
|
||||
Locator.setInStageRectangleByDisplay(this);
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,closeHandler);
|
||||
StageDriver.keepInStageEX(this);
|
||||
this.popIn();
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
|
||||
public class RewardViewPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var list_list:PiDataList;
|
||||
|
||||
public var text_msg:TextField;
|
||||
|
||||
public function RewardViewPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.RewardViewPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.itemClass = RewardViewListItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user