Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
package net.pixvi.myr.panel.looptask
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
import net.pixvi.myr.panel.task.TaskViewPanel;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class LoopTaskListItem extends PiListItem
|
||||
{
|
||||
|
||||
public static var namecolor:Object = {
|
||||
1:"#5f982c",
|
||||
2:"#2d82c4",
|
||||
3:"#b13dad"
|
||||
};
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_des:PiBitTextField;
|
||||
|
||||
public var text_money:PiBitTextField;
|
||||
|
||||
public var text_ke:PiBitTextField;
|
||||
|
||||
public var mc_level:MovieClip;
|
||||
|
||||
public var mc_icon:MovieClip;
|
||||
|
||||
public var mc_levelBg:MovieClip;
|
||||
|
||||
private var taskvo:TaskVo;
|
||||
|
||||
public function LoopTaskListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
mc_icon.stop();
|
||||
mc_levelBg.stop();
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
text_name.scaleMode = true;
|
||||
}
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var taskid:String = value.toString();
|
||||
taskvo = new TaskVo();
|
||||
taskvo.typeId = taskid;
|
||||
text_des.text = taskvo.shortDes;
|
||||
text_name.htmlText = Paster.font(taskvo.name,namecolor[taskvo.taskLevel],null,true);
|
||||
var reward:RewardVo = taskvo.reward;
|
||||
text_money.text = reward.money.toString();
|
||||
text_ke.text = reward.ke.toString();
|
||||
mc_level.gotoAndStop(taskvo.taskLevel);
|
||||
mc_levelBg.gotoAndStop(taskvo.taskLevel);
|
||||
container_img.sideModeH = 2;
|
||||
container_img.sideModeV = 2;
|
||||
container_img.loadNetBitImg(taskvo.getNpcCharaImgSrc(),true,true,0);
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
this.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
TaskViewPanel.getIns().curvo = taskvo;
|
||||
TaskViewPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package net.pixvi.myr.panel.looptask
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.SecondDriver;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TaskCenter;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class LoopTaskPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:LoopTaskPanelUI;
|
||||
|
||||
public function LoopTaskPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
super(showTime,hideTime);
|
||||
ui = new LoopTaskPanelUI();
|
||||
addChild(ui);
|
||||
}
|
||||
|
||||
public static function getIns() : LoopTaskPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(LoopTaskPanel) as LoopTaskPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskclickHandler);
|
||||
GlobalBroadcast.addEventListener(MYREvent.LOOP_TASK_UPDATE,updateHandler);
|
||||
SecondDriver.getInstance().regist(secondHandler);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
update();
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function maskclickHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
this.closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function secondHandler(e:Event = null) : void
|
||||
{
|
||||
ui.text_lefttime.text = Paster.secondFormat(TaskCenter.getIns().loopTaskResetLeftTime());
|
||||
TaskCenter.getIns().autoCheckResetLoopTask();
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOut();
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,maskclickHandler);
|
||||
}
|
||||
|
||||
public function updateHandler(e:Event = null) : void
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
secondHandler();
|
||||
var cityId:int = int(Master.curCityId);
|
||||
if(ui.mc_bg != null && ui.mc_bg.totalFrames > 1)
|
||||
{
|
||||
if(Table.game_setting.cityInfo[cityId].country == 2)
|
||||
{
|
||||
ui.mc_bg.gotoAndStop(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.mc_bg.gotoAndStop(1);
|
||||
}
|
||||
}
|
||||
if(Master.history.loopTask[cityId] == null)
|
||||
{
|
||||
Master.history.loopTask[cityId] = [];
|
||||
}
|
||||
var o:Object = Master.history.loopTask;
|
||||
ui.text_loopTaskNum.text = Master.history.loopTaskNum + "/" + GameMath.loopTaskMaxNum;
|
||||
ui.list_list.setDatas(Master.history.loopTask[cityId]);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
SecondDriver.getInstance().remove(secondHandler);
|
||||
GlobalBroadcast.removeEventListener(MYREvent.LOOP_TASK_UPDATE,updateHandler);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package net.pixvi.myr.panel.looptask
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class LoopTaskPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_list:PiDataList;
|
||||
|
||||
public var text_lefttime:TextField;
|
||||
|
||||
public var text_loopTaskNum:TextField;
|
||||
|
||||
public var mc_bg:MovieClip;
|
||||
|
||||
public function LoopTaskPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.LoopTaskPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.itemClass = LoopTaskListItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user