Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.panel.home
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class HomeMenuUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_mon:PiLightButton;
|
||||
|
||||
public var btn_equip:PiLightButton;
|
||||
|
||||
public function HomeMenuUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
package net.pixvi.myr.panel.home
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.myr.center.AchiCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.panel.achi.AchiPanel;
|
||||
import net.pixvi.myr.panel.avatar.AvatarSetPanel;
|
||||
import net.pixvi.myr.panel.diary.DiaryPanel;
|
||||
import net.pixvi.myr.panel.figure.FigureListPanel;
|
||||
import net.pixvi.myr.panel.lib.LibPanel;
|
||||
import net.pixvi.myr.panel.libEquip.LibEquipListPanel;
|
||||
import net.pixvi.myr.panel.setting.SettingPanel;
|
||||
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 HomePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:HomePanelUI = new HomePanelUI();
|
||||
|
||||
public function HomePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_achi.addEventListener(MobiEvent.CLICK,btnHandler);
|
||||
ui.btn_setting.onClick(btnHandler);
|
||||
ui.btn_diary.onClick(btnHandler);
|
||||
ui.btn_lib.onClick(btnHandler);
|
||||
ui.btn_figure.onClick(btnHandler);
|
||||
ui.ui_menu.btn_equip.onClick(btnHandler);
|
||||
ui.ui_menu.btn_mon.onClick(btnHandler);
|
||||
if(ui.btn_me != null)
|
||||
{
|
||||
ui.btn_me.onClick(meHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getIns() : HomePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(HomePanel) as HomePanel;
|
||||
}
|
||||
|
||||
public function meHandler(e:Event = null) : void
|
||||
{
|
||||
AvatarSetPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
public function btnHandler(e:Event = null) : void
|
||||
{
|
||||
var settingPanel:SettingPanel = null;
|
||||
switch(e.target)
|
||||
{
|
||||
case ui.btn_achi:
|
||||
this.showOut();
|
||||
AchiPanel.getIns().popInWith(this);
|
||||
break;
|
||||
case ui.btn_diary:
|
||||
this.showOut();
|
||||
DiaryPanel.getIns().popInWith(this);
|
||||
break;
|
||||
case ui.btn_lib:
|
||||
ui.ui_menu.visible = true;
|
||||
addChild(ui.ui_menu);
|
||||
e.stopImmediatePropagation();
|
||||
StageDriver.stage.addEventListener(MobiEvent.CLICK,hideMenu);
|
||||
break;
|
||||
case ui.ui_menu.btn_equip:
|
||||
this.showOut();
|
||||
LibEquipListPanel.getIns().popInWith(this);
|
||||
break;
|
||||
case ui.ui_menu.btn_mon:
|
||||
this.showOut();
|
||||
LibPanel.getIns().popInWith(this);
|
||||
break;
|
||||
case ui.btn_figure:
|
||||
PopCenter.POP(FigureListPanel.getIns());
|
||||
break;
|
||||
case ui.btn_setting:
|
||||
settingPanel = new SettingPanel();
|
||||
PopCenter.POP(settingPanel);
|
||||
}
|
||||
}
|
||||
|
||||
private function hideMenu(e:Event = null) : void
|
||||
{
|
||||
ui.ui_menu.visible = false;
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
ui.mc_tipAchi.visible = AchiCenter.getIns().hasCompleteAchi();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
ui.ui_menu.visible = false;
|
||||
ui.startShow();
|
||||
update();
|
||||
ImgCenter.addFsMask(this);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
openPanel.popInWith(this);
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
super.showOut();
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package net.pixvi.myr.panel.home
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.MasterCenter;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiLoopMC;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class HomePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_bottom:Sprite;
|
||||
|
||||
public var mc_top:Sprite;
|
||||
|
||||
public var mc_title:Sprite;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_diary:PiLightButton;
|
||||
|
||||
public var btn_lib:PiLightButton;
|
||||
|
||||
public var btn_figure:PiLightButton;
|
||||
|
||||
public var btn_achi:MovieClip;
|
||||
|
||||
public var btn_me:PiLightButton;
|
||||
|
||||
public var btn_setting:PiLightButton;
|
||||
|
||||
public var mc_topb:Sprite;
|
||||
|
||||
public var mc_bottomb:Sprite;
|
||||
|
||||
public var mc_tipAchi:PiLoopMC;
|
||||
|
||||
public var ui_menu:HomeMenuUI;
|
||||
|
||||
public function HomePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.HomePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
btn_me.visible = true;
|
||||
btn_achi.stop();
|
||||
PiLightButton.btnTouchLight.setDisplay(btn_achi);
|
||||
if(MasterCenter.getIns().getVipDay() > 0)
|
||||
{
|
||||
btn_achi.gotoAndStop(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_achi.gotoAndStop(1);
|
||||
}
|
||||
}
|
||||
|
||||
public function startShow() : void
|
||||
{
|
||||
TweenMax.killTweensOf(mc_topb);
|
||||
TweenMax.killTweensOf(mc_bottomb);
|
||||
StageLocator.setSide(mc_topb,"none","top",0,54);
|
||||
StageLocator.setSide(mc_bottomb,"none","bottom");
|
||||
TweenMax.fromTo(mc_topb,0.8,{"y":-89},{
|
||||
"y":-35,
|
||||
"delay":0.4
|
||||
});
|
||||
TweenMax.fromTo(mc_bottomb,0.8,{"y":1050},{
|
||||
"y":996,
|
||||
"delay":0.4
|
||||
});
|
||||
TweenMax.fromTo(mc_top,0.8,{"y":-130},{"y":-88});
|
||||
TweenMax.fromTo(mc_bottom,0.8,{"y":120},{"y":81});
|
||||
if(btn_me != null)
|
||||
{
|
||||
TweenMax.allFromTo([mc_title,btn_achi,btn_close,btn_diary,btn_lib,btn_setting,btn_me],0.5,{"alpha":0},{"alpha":1});
|
||||
}
|
||||
else
|
||||
{
|
||||
TweenMax.allFromTo([mc_title,btn_achi,btn_close,btn_diary,btn_lib,btn_setting],0.5,{"alpha":0},{"alpha":1});
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
PiLightButton.btnTouchLight.removeDisplay(btn_achi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user