Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package net.pixvi.myr.panel.bar
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.myr.panel.stagesp.MYREventButton;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BarBottomUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_gacha:PiLightButton;
|
||||
|
||||
public var btn_gachaKe:PiLightButton;
|
||||
|
||||
public var btn_rank:PiLightButton;
|
||||
|
||||
public var btn_city:PiLightButton;
|
||||
|
||||
public var btn_event:MYREventButton;
|
||||
|
||||
public var btn_event2:MYREventButton;
|
||||
|
||||
public var btn_event3:MYREventButton;
|
||||
|
||||
public var btn_exchange:MYREventButton;
|
||||
|
||||
public function BarBottomUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
package net.pixvi.myr.panel.bar
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.events.Event;
|
||||
import net.gaooo.nano.center.GAoNano;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.myr.GameSetting;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.PosCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.panel.city.CityPanel;
|
||||
import net.pixvi.myr.panel.gacha.GachaPanel;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myr.panel.stagegzxb.StageGzxbPanel;
|
||||
import net.pixvi.myr.panel.story.StoryPanel;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.display.NetImg;
|
||||
import net.pixvi.pfw.event.PiEvent;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class BarPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var bgimg:NetImg;
|
||||
|
||||
public var ui:BarPanelUI = new BarPanelUI();
|
||||
|
||||
public function BarPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(0,GameSetting.PanelTransTime);
|
||||
ui.ui_bottom.btn_city.onClick(cityHandler);
|
||||
bgimg = new NetBitImg();
|
||||
bgimg.addEventListener("complete",bgimgCompleteHandler);
|
||||
bgimg.load("/data/img/bg/bg_4.jpg");
|
||||
ui.ui_bottom.btn_gacha.onClick(buyHandler);
|
||||
ui.ui_bottom.btn_gachaKe.onClick(keHandler);
|
||||
ui.ui_bottom.btn_rank.onClick(rankHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : BarPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BarPanel) as BarPanel;
|
||||
}
|
||||
|
||||
public function rankHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
PopCenter.POP(StageGzxbPanel.getIns());
|
||||
}
|
||||
|
||||
public function buyHandler(e:Event = null) : void
|
||||
{
|
||||
StoryPanel.getIns().start("sys_bar_" + Random.integer(1,2),buyStoryComplete,null,false,false);
|
||||
GAoNano.getIns().stage.addEventListener("GAoEvent",gaoEventHandler);
|
||||
}
|
||||
|
||||
public function keHandler(e:Event = null) : void
|
||||
{
|
||||
GachaPanel.popInGacha(Table.game_setting.normalKeShop);
|
||||
}
|
||||
|
||||
private function gaoEventHandler(e:PiEvent) : void
|
||||
{
|
||||
if(e.data.toString() == "buy")
|
||||
{
|
||||
GachaPanel.popInGacha("bar_city" + Master.curCityId);
|
||||
GachaPanel.getIns().addEventListener("showout",gachaFinishHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private function buyStoryComplete(e:Event = null) : void
|
||||
{
|
||||
StoryPanel.getIns().showOutAndRemove();
|
||||
}
|
||||
|
||||
private function gachaFinishHandler(e:Event) : void
|
||||
{
|
||||
GAoNano.getIns().stage.removeEventListener("GAoEvent",gaoEventHandler);
|
||||
e.target.removeEventListener("showout",gachaFinishHandler);
|
||||
GAoNano.getIns().stage.continuePlay();
|
||||
}
|
||||
|
||||
public function bgimgCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
ui.container_img.addChild(bgimg);
|
||||
StageLocator.setfullWithNoFix(ui.container_img);
|
||||
}
|
||||
|
||||
public function cityHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
CityPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
private function enableMouse() : void
|
||||
{
|
||||
ui.ui_bottom.mouseChildren = ui.ui_bottom.mouseEnabled = true;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
ui.ui_bottom.mouseChildren = ui.ui_bottom.mouseEnabled = false;
|
||||
TweenMax.fromTo(ui,GameSetting.PanelTransTime,{"alpha":0},{
|
||||
"alpha":1,
|
||||
"onComplete":enableMouse
|
||||
});
|
||||
addChild(MainMenu.getIns(this));
|
||||
addChild(ui.ui_bottom);
|
||||
MainMenu.getIns().onIn();
|
||||
MainMenu.getIns().ui.barMode();
|
||||
PosCenter.activity("city" + CityPanel.getIns().curCityVo.cid + "_bar");
|
||||
CityPanel.getIns().ui.ui_top.text_des.text = CityPanel.getIns().curCityVo.barDes;
|
||||
CityPanel.getIns().ui.ui_top.text_name.htmlText = lang("{0}酒吧",CityPanel.getIns().curCityVo.name);
|
||||
addChild(CityPanel.getIns().ui.ui_top);
|
||||
ui.ui_bottom.btn_event.loadByBtnData(Table.activity_info.specialBtn.barBtn);
|
||||
ui.ui_bottom.btn_exchange.loadByBtnData(Table.activity_info.specialBtn.barExchangeBtn);
|
||||
ui.ui_bottom.btn_event2.loadByBtnData(Table.activity_info.specialBtn.bar2Btn);
|
||||
ui.ui_bottom.btn_event3.loadByBtnData(Table.activity_info.specialBtn.bar3Btn);
|
||||
guide();
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
cityHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function guide() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package net.pixvi.myr.panel.bar
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.GameSetting;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
|
||||
public class BarPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var ui_bottom:BarBottomUI;
|
||||
|
||||
public var container_img:Sprite;
|
||||
|
||||
public function BarPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.BarPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
StageLocator.setSide(ui_bottom,"none","bottom",0,GameSetting.BottomMenuSpace + 5);
|
||||
StageLocator.setSide(ui_bottom.btn_city,"left","none");
|
||||
ui_bottom.btn_rank.visible = Table.game_setting.openRank || GameMath.ModeTrace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user