Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,132 @@
|
||||
package net.pixvi.myr.panel.reward
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.reward.RewardShowVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class RewardShowListBigItem extends PiListItem
|
||||
{
|
||||
|
||||
public var value:int = 0;
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public var text_num_oriy:Number;
|
||||
|
||||
public var container_bg:PiImgContainer;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public var container_star:PiImgContainer;
|
||||
|
||||
public var rank:int = 1;
|
||||
|
||||
public function RewardShowListBigItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_item.setSize(125,125);
|
||||
container_bg.setSize(125,129);
|
||||
text_num_oriy = text_num.y;
|
||||
container_star.setSize(110,34);
|
||||
container_star.visible = false;
|
||||
container_item.mouseChildren = container_item.mouseEnabled = false;
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.effect_click_mon);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var o:RewardShowVo = null;
|
||||
var rank:int = 1;
|
||||
var imgsrc:String = "";
|
||||
text_num.y = text_num_oriy;
|
||||
text_num.visible = false;
|
||||
container_star.reset();
|
||||
container_star.visible = false;
|
||||
if(value is MonsterVo)
|
||||
{
|
||||
rank = int(value.star);
|
||||
imgsrc = (value as MonsterVo).getCurImg();
|
||||
TipCenter.registTextTip(this,value.name);
|
||||
container_star.loadNetBitImg(ImgCenter.getStarImg(value.star),true,true,0);
|
||||
container_star.visible = true;
|
||||
}
|
||||
else if(value is ItemVo)
|
||||
{
|
||||
if(value.maxNum > 1)
|
||||
{
|
||||
text_num.visible = true;
|
||||
text_num.text = value.num.toString();
|
||||
}
|
||||
rank = (value as ItemVo).quality;
|
||||
imgsrc = (value as ItemVo).imgsrc;
|
||||
if(value is EquipVo)
|
||||
{
|
||||
TipCenter.registTextTip(this,value.getTip());
|
||||
}
|
||||
else if(value is EggVo)
|
||||
{
|
||||
if((value as EggVo).num > 1)
|
||||
{
|
||||
text_num.visible = true;
|
||||
text_num.text = value.num.toString();
|
||||
text_num.y = text_num_oriy - 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_num.visible = false;
|
||||
}
|
||||
TipCenter.registTextTip(this,value.name);
|
||||
container_star.loadNetBitImg(ImgCenter.getStarImg(value.star),true,true,0);
|
||||
container_star.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TipCenter.registTextTip(this,value.name);
|
||||
}
|
||||
}
|
||||
else if(value is RewardShowVo)
|
||||
{
|
||||
o = value as RewardShowVo;
|
||||
rank = (value as RewardShowVo).quality;
|
||||
imgsrc = (value as RewardShowVo).imgsrc;
|
||||
if(value.number > 0)
|
||||
{
|
||||
text_num.visible = true;
|
||||
text_num.text = value.number.toString();
|
||||
}
|
||||
TipCenter.registTextTip(this,value.name);
|
||||
}
|
||||
this.rank = rank;
|
||||
container_bg.loadNetBitImg(ImgCenter.getItemBgImgByRank(rank));
|
||||
container_item.loadNetBitImg(imgsrc);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
package net.pixvi.myr.panel.reward
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.reward.RewardShowVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
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.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class RewardShowListSmallItem extends PiListItem
|
||||
{
|
||||
|
||||
public var value:int = 0;
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public var container_bg:PiImgContainer;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public var container_star:PiImgContainer;
|
||||
|
||||
public var rank:int = 1;
|
||||
|
||||
public function RewardShowListSmallItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_num.mapMode = false;
|
||||
text_num.scaleMode = true;
|
||||
container_item.setSize(70,70);
|
||||
container_bg.setSize(70,70);
|
||||
container_item.mouseChildren = container_item.mouseEnabled = false;
|
||||
PiLightButton.btnTouchLight.setDisplay(container_bg);
|
||||
container_bg.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.effect_click_mon);
|
||||
sendSelect();
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var eggvo:EggVo = null;
|
||||
var mon:MonsterVo = null;
|
||||
var imgsrc:String = "";
|
||||
var name:String = "";
|
||||
var des:String = "";
|
||||
var rank:int = 1;
|
||||
var tipstr:String = "";
|
||||
if(value is EggVo)
|
||||
{
|
||||
eggvo = value as EggVo;
|
||||
rank = eggvo.star;
|
||||
imgsrc = eggvo.imgsrc;
|
||||
name = eggvo.desName;
|
||||
des = name;
|
||||
text_num.visible = true;
|
||||
text_num.text = eggvo.num.toString();
|
||||
tipstr = name + "*" + eggvo.num;
|
||||
}
|
||||
else if(value is MonsterVo)
|
||||
{
|
||||
mon = value as MonsterVo;
|
||||
rank = mon.star;
|
||||
imgsrc = mon.getImg();
|
||||
name = mon.name;
|
||||
des = name;
|
||||
tipstr = name + "<br/>" + des;
|
||||
text_num.visible = false;
|
||||
}
|
||||
else if(value is ItemVo)
|
||||
{
|
||||
if(value is EquipVo)
|
||||
{
|
||||
text_num.visible = false;
|
||||
tipstr = value.getTip();
|
||||
}
|
||||
else
|
||||
{
|
||||
text_num.visible = true;
|
||||
text_num.text = value.num.toString();
|
||||
name = ItemVo.getName(value.type);
|
||||
des = value.des;
|
||||
tipstr = name + "<br/>" + des;
|
||||
}
|
||||
rank = int(value.quality);
|
||||
imgsrc = value.imgsrc;
|
||||
}
|
||||
else if(value is RewardShowVo)
|
||||
{
|
||||
imgsrc = (value as RewardShowVo).imgsrc;
|
||||
rank = int(value.quality);
|
||||
name = value.name;
|
||||
text_num.visible = true;
|
||||
text_num.scaleMode = true;
|
||||
text_num.text = value.number;
|
||||
des = name;
|
||||
tipstr = name;
|
||||
}
|
||||
TipCenter.registTextTip(this,tipstr,9);
|
||||
container_bg.loadNetBitImg(ImgCenter.getItemBgImgByRank(rank,"M"));
|
||||
container_item.loadNetBitImg(imgsrc,true,true,9);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
PiLightButton.btnTouchLight.removeDisplay(container_bg);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
package net.pixvi.myr.panel.reward
|
||||
{
|
||||
import com.greensock.TimelineMax;
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.center.MasterCenter;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.levelup.LevelUpPanel;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class RewardShowPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static const SHOW_OVER:String = "showOver";
|
||||
|
||||
public var ui:RewardShowPanelUI = new RewardShowPanelUI();
|
||||
|
||||
public var rewards:Array;
|
||||
|
||||
public var page:int = 1;
|
||||
|
||||
public var onComplete:Function;
|
||||
|
||||
public var checkLevelUp:Boolean;
|
||||
|
||||
private var darkmask:DisplayObject;
|
||||
|
||||
private var listShow:TimelineMax;
|
||||
|
||||
public function RewardShowPanel()
|
||||
{
|
||||
this.rewards = rewards;
|
||||
addChild(ui);
|
||||
super();
|
||||
}
|
||||
|
||||
public static function show(rewards:Array, onComplete:Function = null, checkLevelUp:Boolean = true) : void
|
||||
{
|
||||
getIns().start(rewards,onComplete,checkLevelUp);
|
||||
getIns().popIn();
|
||||
}
|
||||
|
||||
public static function showByVo(rewardvo:RewardResultVo, onComplete:Function = null, checkLevelUp:Boolean = true) : void
|
||||
{
|
||||
show(rewardvo.getRewardShowArray(),onComplete,checkLevelUp);
|
||||
}
|
||||
|
||||
public static function getIns() : RewardShowPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(RewardShowPanel) as RewardShowPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
}
|
||||
|
||||
public function start(rewards:Array, onComplete:Function, checkLevelUp:Boolean = true) : void
|
||||
{
|
||||
page = 1;
|
||||
this.ui.list_rewards.addEventListener(MobiEvent.CLICK,yesHandler,false,10);
|
||||
StageDriver.stage.addEventListener(MobiEvent.CLICK,yesHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
this.rewards = rewards;
|
||||
this.onComplete = onComplete;
|
||||
this.checkLevelUp = checkLevelUp;
|
||||
ui.list_rewards.setDatas(rewards);
|
||||
showByPage(page);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
yesHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function showByPage(page:int) : void
|
||||
{
|
||||
TweenMax.fromTo(ui.mc_board,2,{
|
||||
"alpha":1,
|
||||
"visible":true
|
||||
},{
|
||||
"alpha":0,
|
||||
"visible":false
|
||||
});
|
||||
if(ui.list_rewards.curPage != page)
|
||||
{
|
||||
ui.list_rewards.turnPage(page);
|
||||
}
|
||||
ui.list_rewards.autoCenterItems(490,225,4,110,110,17);
|
||||
listShow = new TimelineMax();
|
||||
for each(var i:PiListItem in ui.list_rewards.itemArray)
|
||||
{
|
||||
if(i.visible)
|
||||
{
|
||||
i.visible = false;
|
||||
listShow.to(i,0,{
|
||||
"colorTransform":{
|
||||
"tint":CP.qualityUint[(i as RewardShowListBigItem).rank],
|
||||
"tintAmount":1
|
||||
},
|
||||
"visible":true,
|
||||
"onComplete":playItemShowSound
|
||||
});
|
||||
listShow.to(i,0.13,{"colorTransform":{"tintAmount":0}});
|
||||
}
|
||||
}
|
||||
if(ui.list_rewards.totalPages == 1)
|
||||
{
|
||||
ui.text_page.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_page.text = page + "/" + ui.list_rewards.totalPages;
|
||||
}
|
||||
this.page++;
|
||||
}
|
||||
|
||||
private function playItemShowSound() : void
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.effect_itemGet);
|
||||
}
|
||||
|
||||
public function yesHandler(e:Event = null) : void
|
||||
{
|
||||
if(ui.list_rewards.totalPages == 0)
|
||||
{
|
||||
e.stopImmediatePropagation();
|
||||
closeHandler();
|
||||
return;
|
||||
}
|
||||
if(e.currentTarget != null && e.currentTarget == ui.list_rewards || listShow.progress() != 1 || PopCenter.getIns().topPanel != this)
|
||||
{
|
||||
if(!(PopCenter.getIns().topPanel is LevelUpPanel))
|
||||
{
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(page <= ui.list_rewards.totalPages)
|
||||
{
|
||||
showByPage(page);
|
||||
}
|
||||
else
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOutAndRemove();
|
||||
if(checkLevelUp)
|
||||
{
|
||||
MasterCenter.getIns().autoCheckLevelUp(true,onComplete);
|
||||
onComplete = null;
|
||||
}
|
||||
if(onComplete != null)
|
||||
{
|
||||
onComplete();
|
||||
onComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha(0);
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,yesHandler);
|
||||
ui.list_rewards.removeEventListener(MobiEvent.CLICK,yesHandler);
|
||||
super.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package net.pixvi.myr.panel.reward
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
|
||||
public class RewardShowPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_page:PiBitTextField;
|
||||
|
||||
public var list_rewards:PiDataList;
|
||||
|
||||
public var mc_board:Sprite;
|
||||
|
||||
public function RewardShowPanelUI(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
if(skin == null)
|
||||
{
|
||||
skin = FF.getMC("ui.RewardShowPanelUI");
|
||||
}
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
mc_board.blendMode = "lighten";
|
||||
list_rewards.itemClass = RewardShowListBigItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user