Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
package net.pixvi.myr.panel.levelup
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Cubic;
|
||||
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.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class LevelUpPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:LevelUpPanelUI;
|
||||
|
||||
public var onComplete:Function;
|
||||
|
||||
public function LevelUpPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
buffMode = false;
|
||||
super(0.5,0.5);
|
||||
ui = new LevelUpPanelUI();
|
||||
update();
|
||||
addChild(ui);
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
}
|
||||
|
||||
public static function getIns() : LevelUpPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(LevelUpPanel) as LevelUpPanel;
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
TweenMax.from(ui.mc_flash,1,{"alpha":0});
|
||||
TweenMax.fromTo(ui.mc_title,1,{
|
||||
"alpha":0,
|
||||
"y":ui.mc_title.y - 50,
|
||||
"ease":Cubic.easeIn
|
||||
},{
|
||||
"alpha":1,
|
||||
"y":ui.mc_title.y,
|
||||
"onComplete":startContinue
|
||||
});
|
||||
ui.text_level.text = Master.level.toString();
|
||||
new FlashEffect(900,16777215).startEffect(ui.text_level);
|
||||
ui.text_addAp.text = GameMath.apByLevel(Master.level - 1) + "→" + GameMath.apByLevel(Master.level);
|
||||
if(GameMath.tiMaxByLevel(Master.level) != GameMath.tiMaxByLevel(Master.level - 1))
|
||||
{
|
||||
ui.text_addTi.text = GameMath.tiMaxByLevel(Master.level - 1) + "→" + GameMath.tiMaxByLevel(Master.level);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_addTi.text = GameMath.tiMaxByLevel(Master.level - 1) + lang("(上限)");
|
||||
}
|
||||
for each(var o:Object in Table.team_info.battleTeam)
|
||||
{
|
||||
if(int(o.level) == Master.level)
|
||||
{
|
||||
ui.mc_newStack.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.mc_newStack.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function startContinue() : void
|
||||
{
|
||||
StageDriver.stage.addEventListener(MobiEvent.CLICK,yesHandler);
|
||||
}
|
||||
|
||||
public function yesHandler(e:Event) : void
|
||||
{
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,yesHandler);
|
||||
if(e != null)
|
||||
{
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
this.showOutAndRemove();
|
||||
if(onComplete != null)
|
||||
{
|
||||
onComplete();
|
||||
onComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
override public function popIn() : void
|
||||
{
|
||||
if(this.showing)
|
||||
{
|
||||
update();
|
||||
}
|
||||
else
|
||||
{
|
||||
super.popIn();
|
||||
SoundCenter.getIns().play(GameSound.effect_levelUp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package net.pixvi.myr.panel.levelup
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
|
||||
public class LevelUpPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_level:PiBitTextField;
|
||||
|
||||
public var mc_title:Sprite;
|
||||
|
||||
public var mc_flash:Sprite;
|
||||
|
||||
public var text_addAp:TextField;
|
||||
|
||||
public var text_addTi:TextField;
|
||||
|
||||
public var mc_newStack:Sprite;
|
||||
|
||||
public function LevelUpPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.LevelUpPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user