Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
package net.pixvi.myr.panel.lib
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.utils.Gesturer;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.utils.Locator;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class LibImgViewPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var imgsrc:String = "";
|
||||
|
||||
public var img:NetBitImg;
|
||||
|
||||
public var gesture:Gesturer;
|
||||
|
||||
public function LibImgViewPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public static function getIns() : LibImgViewPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(LibImgViewPanel) as LibImgViewPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha(0.8);
|
||||
if(img != null)
|
||||
{
|
||||
img.removeEventListener("complete",imgCompleteHandler);
|
||||
img.dispose();
|
||||
}
|
||||
img = new NetBitImg();
|
||||
img.addEventListener("complete",imgCompleteHandler);
|
||||
img.load(imgsrc);
|
||||
}
|
||||
|
||||
private function imgCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
gesture = new Gesturer(StageDriver.stage,true);
|
||||
gesture.start();
|
||||
img.x = StageDriver.stageWidth / 2 - img.width / 2;
|
||||
img.y = StageDriver.stageHeight / 2 - img.height / 2;
|
||||
addChild(img);
|
||||
gesture.addEventListener(Gesturer.DRAG,startDragHandler);
|
||||
gesture.addEventListener(Gesturer.TAP_OVER,tapHandler);
|
||||
}
|
||||
|
||||
private function startDragHandler(e:Event = null) : void
|
||||
{
|
||||
img.startMoveDrag(false,Locator.getInStageRectangleByDisplay(img,40,40,true));
|
||||
}
|
||||
|
||||
private function tapHandler(e:Event = null) : void
|
||||
{
|
||||
img.stopMoveDrag();
|
||||
if(!gesture.draging)
|
||||
{
|
||||
overHandler();
|
||||
}
|
||||
}
|
||||
|
||||
private function overHandler(e:Event = null) : void
|
||||
{
|
||||
gesture.removeEventListener(Gesturer.DRAG,startDragHandler);
|
||||
gesture.removeEventListener(Gesturer.TAP_OVER,tapHandler);
|
||||
gesture.dispose();
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package net.pixvi.myr.panel.lib
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.LibCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.PosCenter;
|
||||
import net.pixvi.myr.element.lib.LibTypeVo;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class LibPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:LibPanelUI = new LibPanelUI();
|
||||
|
||||
public var curMode:int = 1;
|
||||
|
||||
public function LibPanel()
|
||||
{
|
||||
addChild(ui);
|
||||
super();
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.switch_tab.setValues(1,2);
|
||||
ui.switch_tab.selectFlag(1);
|
||||
ui.switch_tab.addEventListener("piselect",tabSelectHandler);
|
||||
ui.list_lib.addEventListener("piselect",itemSelectHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : LibPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(LibPanel) as LibPanel;
|
||||
}
|
||||
|
||||
public function tabSelectHandler(e:Event = null) : void
|
||||
{
|
||||
curMode = int(ui.switch_tab.value);
|
||||
showData(int(ui.switch_tab.value));
|
||||
}
|
||||
|
||||
public function itemSelectHandler(e:Event = null) : void
|
||||
{
|
||||
LibCenter.getIns().curLibVo = ui.list_lib.curSelectedItemData as LibTypeVo;
|
||||
this.visible = false;
|
||||
LibViewPanel.getInst().popInWith(this);
|
||||
LibViewPanel.getInst().addEventListener("showout",viewOutHandler);
|
||||
}
|
||||
|
||||
public function viewOutHandler(e:Event = null) : void
|
||||
{
|
||||
this.visible = true;
|
||||
ImgCenter.addFsMask(this);
|
||||
}
|
||||
|
||||
public function showData(value:int = 1) : void
|
||||
{
|
||||
var datas:Array = null;
|
||||
if(value == 1)
|
||||
{
|
||||
datas = LibCenter.getIns().getLibs();
|
||||
}
|
||||
else
|
||||
{
|
||||
datas = LibCenter.getIns().getUnlockLibs();
|
||||
}
|
||||
ui.list_lib.setDatas(datas);
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
ui.text_empty.text = Master.history.monLib.length + "/" + LibCenter.getIns().countLibs();
|
||||
PosCenter.activity("lib");
|
||||
showData(curMode);
|
||||
ImgCenter.addFsMask(this);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
showOut();
|
||||
openPanel.popIn();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
if(!buffMode)
|
||||
{
|
||||
ui.list_lib.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package net.pixvi.myr.panel.lib
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.panel.store.MonsterLibSliderListItem;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
import net.pixvi.psg.ui.controller.PiLightSwitch;
|
||||
|
||||
public class LibPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_empty:PiBitTextField;
|
||||
|
||||
public var list_lib:PiSliderList;
|
||||
|
||||
public var switch_tab:PiLightSwitch;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public function LibPanelUI(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.LibPanelUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_lib.setList(MonsterLibSliderListItem,18,false,235,3,199);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
package net.pixvi.myr.panel.lib
|
||||
{
|
||||
import flash.events.Event;
|
||||
import flash.geom.Rectangle;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.LibCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.center.SkinCenter;
|
||||
import net.pixvi.myr.element.MonsterElement;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.panel.ground.GroundArea;
|
||||
import net.pixvi.myr.panel.monster.MonsterViewPanel;
|
||||
import net.pixvi.myr.panel.skin.SetSkinPanel;
|
||||
import net.pixvi.myr.view.mon.GroundMon;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.display.NetImg;
|
||||
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 LibViewPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:LibViewPanelUI;
|
||||
|
||||
public var vo:MonsterVo;
|
||||
|
||||
public var img:NetImg;
|
||||
|
||||
public var groundArea:GroundArea;
|
||||
|
||||
private var starty:int;
|
||||
|
||||
private var startRoll:int;
|
||||
|
||||
public function LibViewPanel()
|
||||
{
|
||||
super();
|
||||
ui = new LibViewPanelUI();
|
||||
addChild(ui);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_cg.onClick(cgHandler);
|
||||
groundArea = new GroundArea(new Rectangle(363,297,200,66),false);
|
||||
groundArea.overFixRule = 2;
|
||||
groundArea.libMode = true;
|
||||
groundArea.randomPandding = 0;
|
||||
addChild(groundArea);
|
||||
}
|
||||
|
||||
public static function getInst() : LibViewPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(LibViewPanel);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
groundArea.gcAllMonster();
|
||||
ImgCenter.gcMonsterImg(vo.type);
|
||||
vo = null;
|
||||
this.showOut();
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
private function cgHandler(e:Event = null) : void
|
||||
{
|
||||
LibImgViewPanel.getIns().imgsrc = ImgCenter.getMonsterCGImg(vo.type);
|
||||
LibImgViewPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
groundArea.gcAllMonster();
|
||||
groundArea.resume();
|
||||
var a:Object = LibCenter.getIns().curLibVo;
|
||||
if(a == null && GameMath.ModeTrace)
|
||||
{
|
||||
Alert.showMsg("[调试模式]未开启图鉴的魔物。");
|
||||
this.showOut();
|
||||
return;
|
||||
}
|
||||
vo = new MonsterVo(LibCenter.getIns().curLibVo.monType);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
LibCenter.getIns().curLibVo.recNew = false;
|
||||
vo.buildRandom();
|
||||
vo.mode = 0;
|
||||
var m:GroundMon = groundArea.addMonsterByVo(vo);
|
||||
m.x = groundArea.area.x + groundArea.area.width / 2;
|
||||
m.y = groundArea.area.y + groundArea.area.height / 2;
|
||||
var vo2:MonsterVo = new MonsterVo(vo.type);
|
||||
vo2.buildRandom();
|
||||
vo2.mode = 1;
|
||||
groundArea.addMonsterByVo(vo2);
|
||||
var vo3:MonsterVo = new MonsterVo(vo.type);
|
||||
vo3.buildRandom();
|
||||
vo3.mode = 2;
|
||||
groundArea.addMonsterByVo(vo3);
|
||||
TipCenter.registTextTip(ui.container_element,MonsterElement.getElementTip(vo3.element));
|
||||
ui.text_name.text = vo3.name;
|
||||
ui.text_des.text = vo.des;
|
||||
ui.text_count.text = Master.history.getNumFeedMonster(vo3.type).toString();
|
||||
ui.text_skin.text = SkinCenter.getIns().getMonAllSkins(vo.type,false,false).length.toString();
|
||||
ui.container_element.loadNetBitImg(ImgCenter.getMonElement(vo3.element));
|
||||
ui.container_group.loadNetBitImg(ImgCenter.getMonGroup(vo3.group));
|
||||
ui.mc_shooter.gotoAndStop(vo3.isShooter() ? 1 : 2);
|
||||
ui.mc_star.gotoAndStop(vo.star);
|
||||
ui.text_atk.text = vo.table().atk;
|
||||
ui.text_def.text = vo.table().def;
|
||||
ui.text_hp.text = vo.table().hp;
|
||||
ui.text_dex.text = vo.table().dex;
|
||||
ui.text_gatk.text = vo.table().atk_grow_min + "~" + vo.table().atk_grow_max;
|
||||
ui.text_gdef.text = vo.table().def_grow_min + "~" + vo.table().def_grow_max;
|
||||
ui.text_ghp.text = vo.table().hp_grow_min + "~" + vo.table().hp_grow_max;
|
||||
ui.text_gdex.text = vo.table().dex_grow_min + "~" + vo.table().dex_grow_max;
|
||||
vo3.buildSkill();
|
||||
ui.mc_skill1.setSkillType(vo3.skill_1);
|
||||
ui.mc_skill2.setSkillType(vo3.skill_2);
|
||||
ui.text_des.mouseEnabled = true;
|
||||
ui.text_des.addEventListener(MobiEvent.MOUSE_DOWN,downDragHandler);
|
||||
if(img != null)
|
||||
{
|
||||
ui.container_bg.removeChild(img);
|
||||
}
|
||||
img = new NetBitImg(vo.getImg("l"));
|
||||
img.x = vo.imgFix["l"].x;
|
||||
img.y = vo.imgFix["l"].y;
|
||||
img.setScale(0.8);
|
||||
ui.container_bg.addChild(img);
|
||||
ui.container_bg.mouseChildren = ui.container_bg.mouseEnabled = false;
|
||||
var entangleMon:MonsterVo = MonsterCenter.getIns().getEntangleMonByType(vo3.type);
|
||||
if(entangleMon != null)
|
||||
{
|
||||
ui.mc_entangle.gotoAndStop(2);
|
||||
ui.mc_entangle.addEventListener(MobiEvent.CLICK,entangleHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.mc_entangle.gotoAndStop(1);
|
||||
ui.mc_entangle.removeEventListener(MobiEvent.CLICK,entangleHandler);
|
||||
}
|
||||
ui.mc_skin.onClick(skinHandler);
|
||||
ImgCenter.addFsMask(this);
|
||||
}
|
||||
|
||||
public function skinHandler(e:Event = null) : void
|
||||
{
|
||||
SetSkinPanel.vo = vo.clone();
|
||||
SetSkinPanel.vo.mode = 2;
|
||||
SetSkinPanel.getIns().mode = "lib";
|
||||
SetSkinPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
private function downDragHandler(e:Event) : void
|
||||
{
|
||||
starty = e["stageY"];
|
||||
startRoll = ui.text_des.scrollV;
|
||||
ui.text_des.addEventListener(MobiEvent.MOUSE_MOVE,downDragMoveHandler);
|
||||
StageDriver.stage.addEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
}
|
||||
|
||||
private function downDragMoveHandler(e:Event) : void
|
||||
{
|
||||
var dt:int = e["stageY"] - starty;
|
||||
ui.text_des.scrollV = startRoll - dt / 10;
|
||||
}
|
||||
|
||||
private function upDragHandler(e:Event) : void
|
||||
{
|
||||
ui.text_des.removeEventListener(MobiEvent.MOUSE_MOVE,downDragMoveHandler);
|
||||
StageDriver.stage.removeEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
}
|
||||
|
||||
public function entangleHandler(e:Event = null) : void
|
||||
{
|
||||
var entangleMon:MonsterVo = MonsterCenter.getIns().getEntangleMonByType(LibCenter.getIns().curLibVo.monType);
|
||||
if(MonsterViewPanel.getIns().showing)
|
||||
{
|
||||
this.showOut();
|
||||
}
|
||||
else
|
||||
{
|
||||
MonsterViewPanel.getIns().vo = entangleMon;
|
||||
MonsterViewPanel.getIns().popIn();
|
||||
}
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
groundArea.pause();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
if(!buffMode)
|
||||
{
|
||||
groundArea.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package net.pixvi.myr.panel.lib
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.monster.MonsterViewSkillUI;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class LibViewPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_des:TextField;
|
||||
|
||||
public var mc_moveArea:Sprite;
|
||||
|
||||
public var mc_mask:Sprite;
|
||||
|
||||
public var btn_cg:PiLightButton;
|
||||
|
||||
public var container_element:PiImgContainer;
|
||||
|
||||
public var container_group:PiImgContainer;
|
||||
|
||||
public var mc_shooter:MovieClip;
|
||||
|
||||
public var mc_star:MovieClip;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var container_bg:PiImgContainer;
|
||||
|
||||
public var text_atk:TextField;
|
||||
|
||||
public var text_def:TextField;
|
||||
|
||||
public var text_hp:TextField;
|
||||
|
||||
public var text_dex:TextField;
|
||||
|
||||
public var text_gatk:TextField;
|
||||
|
||||
public var text_gdef:TextField;
|
||||
|
||||
public var text_ghp:TextField;
|
||||
|
||||
public var text_gdex:TextField;
|
||||
|
||||
public var text_rank:PiBitTextField;
|
||||
|
||||
public var btn_rank:PiLightButton;
|
||||
|
||||
public var mc_entangle:MovieClip;
|
||||
|
||||
public var mc_count:MovieClip;
|
||||
|
||||
public var mc_skin:PiLightButton;
|
||||
|
||||
public var text_count:PiBitTextField;
|
||||
|
||||
public var text_skin:PiBitTextField;
|
||||
|
||||
public var mc_skill1:MonsterViewSkillUI;
|
||||
|
||||
public var mc_skill2:MonsterViewSkillUI;
|
||||
|
||||
public function LibViewPanelUI(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.LibViewPanelUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
mc_entangle.stop();
|
||||
mc_count.stop();
|
||||
container_bg.mask = mc_mask;
|
||||
container_element.setSize(48,50);
|
||||
container_group.setSize(37,61);
|
||||
mc_shooter.stop();
|
||||
super.onSkinComplete();
|
||||
btn_close.sound_click = GameSound.effect_click_close1;
|
||||
PiLightButton.btnTouchLight.setDisplay(mc_count);
|
||||
PiLightButton.btnTouchLight.setDisplay(mc_entangle);
|
||||
text_rank.text = "9999+";
|
||||
text_rank.visible = false;
|
||||
btn_rank.visible = false;
|
||||
TipCenter.registTextTip(mc_count,lang("总培育数"));
|
||||
TipCenter.registTextTip(mc_entangle,lang("羁绊"));
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
PiLightButton.btnTouchLight.removeDisplay(mc_count);
|
||||
PiLightButton.btnTouchLight.removeDisplay(mc_entangle);
|
||||
PiLightButton.btnTouchLight.removeDisplay(container_element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user