Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
package net.pixvi.myr.panel.achi
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.center.AchiCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.element.achi.AchiVo;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class AchiPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:AchiPanelUI;
|
||||
|
||||
public var storySelect:TaskVo;
|
||||
|
||||
public var eventSelect:TaskVo;
|
||||
|
||||
public var curmode:int = 1;
|
||||
|
||||
public function AchiPanel()
|
||||
{
|
||||
buffMode = false;
|
||||
super();
|
||||
ui = new AchiPanelUI();
|
||||
addChild(ui);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.switch_tab.setValues(1,2);
|
||||
}
|
||||
|
||||
public static function getIns() : AchiPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(AchiPanel) as AchiPanel;
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
showOut();
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
openPanel.popInWith();
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
ui.list_achi.addEventListener("piselect",selectHandler);
|
||||
changeMode(1);
|
||||
ui.switch_tab.selectFlag(1);
|
||||
ui.switch_tab.addEventListener("piselect",switchHandler);
|
||||
GlobalBroadcast.addEventListener(MYREvent.ACHI_NUM_CHANGE,numChangeHandler);
|
||||
ImgCenter.addFsMask(this);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
public function numChangeHandler(e:Event = null) : void
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
if(curmode == 1)
|
||||
{
|
||||
ui.list_achi.setDatas(AchiCenter.getIns().getShowAchis());
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.list_achi.setDatas(Master.achispass);
|
||||
}
|
||||
}
|
||||
|
||||
public function changeMode(mode:int) : void
|
||||
{
|
||||
if(mode == 1)
|
||||
{
|
||||
ui.list_achi.setDatas(AchiCenter.getIns().getShowAchis());
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.list_achi.setDatas(Master.achispass);
|
||||
}
|
||||
curmode = mode;
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event = null) : void
|
||||
{
|
||||
AchiCenter.getIns().finishAchi(ui.list_achi.curSelectedItemData as AchiVo);
|
||||
}
|
||||
|
||||
public function switchHandler(e:Event) : void
|
||||
{
|
||||
changeMode(int(ui.switch_tab.value));
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
ui.switch_tab.removeEventListener("piselect",switchHandler);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener(MYREvent.ACHI_NUM_CHANGE,numChangeHandler);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package net.pixvi.myr.panel.achi
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
import net.pixvi.psg.ui.controller.PiLightSwitch;
|
||||
|
||||
public class AchiPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_achi:PiSliderList;
|
||||
|
||||
public var switch_tab:PiLightSwitch;
|
||||
|
||||
public function AchiPanelUI(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.AchiPanelUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
public function nothing() : void
|
||||
{
|
||||
this["btn_close"];
|
||||
this["list_achi"];
|
||||
this["switch_tab"];
|
||||
this["AchiPanelUI"];
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
btn_close.sound_click = GameSound.effect_click_close1;
|
||||
list_achi.setList(AchiSliderItem,10,false,183);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package net.pixvi.myr.panel.achi
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.element.achi.AchiVo;
|
||||
import net.pixvi.myr.panel.msg.RewardUI;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class AchiSliderItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var text_title:PiBitTextField;
|
||||
|
||||
public var text_des:TextField;
|
||||
|
||||
public var btn_finish:PiLightButton;
|
||||
|
||||
public var mc_got:Sprite;
|
||||
|
||||
public var container_type:PiImgContainer;
|
||||
|
||||
public var ui_reward:RewardUI;
|
||||
|
||||
public function AchiSliderItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.AchiSliderItemUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_type.setSize(36,55);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var vo:AchiVo = value as AchiVo;
|
||||
text_title.text = vo.name;
|
||||
var html:String = vo.des;
|
||||
if(vo.isComplete)
|
||||
{
|
||||
mc_got.visible = true;
|
||||
btn_finish.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_got.visible = false;
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
this.alpha = vo.hide ? 0.5 : 1;
|
||||
}
|
||||
if(vo.canFinish())
|
||||
{
|
||||
btn_finish.visible = true;
|
||||
html += " " + Paster.font("(完成)","#d1ff1b");
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_finish.visible = false;
|
||||
html += " " + Paster.font("(" + vo.desOfProcess + ")","#da3568");
|
||||
}
|
||||
}
|
||||
ui_reward.ondata(vo.rewardvo);
|
||||
btn_finish.onClick(sendSelect);
|
||||
text_des.htmlText = html;
|
||||
container_type.loadNetBitImg(ImgCenter.getAchiTagImg(vo.achiTag),true,true,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package net.pixvi.myr.panel.alchemy
|
||||
{
|
||||
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.alchemy.MaterialType;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class AlchemyMaterialItemUI extends UIComponent
|
||||
{
|
||||
|
||||
public var itemType:int;
|
||||
|
||||
public var item:ItemVo;
|
||||
|
||||
public var container_bg:PiImgContainer;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public function AlchemyMaterialItemUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
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);
|
||||
reset();
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.effect_click_mon);
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
onData(null);
|
||||
}
|
||||
|
||||
public function onData(value:ItemVo = null) : void
|
||||
{
|
||||
if(value == null)
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
this.item = null;
|
||||
this.itemType = -1;
|
||||
container_item.reset();
|
||||
container_bg.loadNetBitImg(ImgCenter.getItemBgImgByRank(1));
|
||||
return;
|
||||
}
|
||||
this.itemType = value.type;
|
||||
this.item = value;
|
||||
var imgsrc:String = "";
|
||||
var name:String = "";
|
||||
var rank:int = 1;
|
||||
rank = value.quality;
|
||||
imgsrc = value.imgsrc;
|
||||
name = ItemVo.getName(value.type);
|
||||
var tiptail:Array = MaterialType.getMaterialsTip([item.type]);
|
||||
var tip:String = name + "<br/>" + Paster.font(tiptail.join("<br/>"),"#ca5000",18);
|
||||
TipCenter.registTextTip(this,tip,9);
|
||||
container_bg.loadNetBitImg(ImgCenter.getItemBgImgByRank(rank,"M"));
|
||||
container_item.loadNetBitImg(imgsrc,true,true,9);
|
||||
}
|
||||
|
||||
public function onType(type:int = -1) : void
|
||||
{
|
||||
this.itemType = type;
|
||||
if(type == -1)
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
this.item = null;
|
||||
this.itemType = -1;
|
||||
container_item.reset();
|
||||
container_bg.loadNetBitImg(ImgCenter.getItemBgImgByRank(1));
|
||||
return;
|
||||
}
|
||||
var vo:ItemVo = new ItemVo();
|
||||
vo.num = 1;
|
||||
vo.type = type;
|
||||
onData(vo);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package net.pixvi.myr.panel.alchemy
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.myr.element.bag.ItemType;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EquipMakerCompletePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EquipMakerCompleteUI = new EquipMakerCompleteUI();
|
||||
|
||||
public var equip:EquipVo;
|
||||
|
||||
public function EquipMakerCompletePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.btn_yes.onClick(yesHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : EquipMakerCompletePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(EquipMakerCompletePanel) as EquipMakerCompletePanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
update();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var effects:Array = equip.effectDes();
|
||||
for(i = 0; i < 4; )
|
||||
{
|
||||
if(effects[i] != null)
|
||||
{
|
||||
ui["text_para" + (i + 1)].htmlText = effects[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
ui["text_para" + (i + 1)].htmlText = "";
|
||||
}
|
||||
i++;
|
||||
}
|
||||
ui.text_name.text = equip.name;
|
||||
ui.text_type.text = equip.typeName;
|
||||
ui.text_des.text = equip.des;
|
||||
ui.text_quality.htmlText = Paster.font(ItemType.equipQuality[equip.quality].name,ItemType.equipQuality[equip.quality].color);
|
||||
ui.showIn();
|
||||
SoundCenter.getIns().play(GameSound.effect_levelUp);
|
||||
ui.container_img.loadNetBitImg(equip.imgsrc,true,true);
|
||||
new FlashEffect(1500,16777215).startEffect(ui.container_img);
|
||||
}
|
||||
|
||||
public function yesHandler(e:Event = null) : void
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.effect_itemGet);
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
override protected function stageResizeAndKeepInCenter() : void
|
||||
{
|
||||
super.stageResizeAndKeepInCenter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package net.pixvi.myr.panel.alchemy
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Elastic;
|
||||
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.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EquipMakerCompleteUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_yes:PiLightButton;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_type:PiBitTextField;
|
||||
|
||||
public var text_des:PiBitTextField;
|
||||
|
||||
public var text_quality:PiBitTextField;
|
||||
|
||||
public var text_para1:TextField;
|
||||
|
||||
public var text_para2:TextField;
|
||||
|
||||
public var text_para3:TextField;
|
||||
|
||||
public var text_para4:TextField;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var mc_title:Sprite;
|
||||
|
||||
public var mc_flash:Sprite;
|
||||
|
||||
public function EquipMakerCompleteUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EquipMakerCompleteUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(125,125);
|
||||
}
|
||||
|
||||
public function showIn() : void
|
||||
{
|
||||
TweenMax.fromTo(mc_flash,1.5,{
|
||||
"scaleX":0.2,
|
||||
"scaleY":0.2,
|
||||
"alpha":0
|
||||
},{
|
||||
"alpha":1,
|
||||
"scaleX":1,
|
||||
"scaleY":1
|
||||
});
|
||||
TweenMax.fromTo(mc_title,1.5,{
|
||||
"scaleX":2,
|
||||
"scaleY":2
|
||||
},{
|
||||
"scaleX":1,
|
||||
"scaleY":1,
|
||||
"ease":Elastic.easeOut
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package net.pixvi.myr.panel.alchemy
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.AlchemyCenter;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBar;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EquipMakerControllerUI extends UIComponent
|
||||
{
|
||||
|
||||
public var bar_process:PiBar;
|
||||
|
||||
public var btn_speed:PiLightButton;
|
||||
|
||||
public var text_time:PiBitTextField;
|
||||
|
||||
public var btn_start:PiLightButton;
|
||||
|
||||
public function EquipMakerControllerUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
public function modeNormal(startable:Boolean = false) : void
|
||||
{
|
||||
bar_process.visible = false;
|
||||
btn_speed.visible = false;
|
||||
btn_start.visible = true;
|
||||
if(startable)
|
||||
{
|
||||
btn_start.alpha = 1;
|
||||
btn_start.mouseChildren = btn_start.mouseEnabled = true;
|
||||
new FlashEffect(800,16777215,1).startEffect(btn_start);
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_start.alpha = 0.5;
|
||||
btn_start.mouseChildren = btn_start.mouseEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function modeing() : void
|
||||
{
|
||||
bar_process.visible = true;
|
||||
btn_speed.visible = true;
|
||||
btn_start.visible = false;
|
||||
}
|
||||
|
||||
public function modeComplete() : void
|
||||
{
|
||||
bar_process.visible = false;
|
||||
btn_speed.visible = false;
|
||||
btn_start.visible = false;
|
||||
text_time.htmlText = Paster.font(lang("点击完成炼金!"),"#fff479");
|
||||
}
|
||||
|
||||
public function showNeedTime() : void
|
||||
{
|
||||
var types:Array = EquipMakerPanel.getIns().ui.ui_left.getTypes();
|
||||
var formulaLevel:int = AlchemyCenter.getIns().getFormulaLevel(types);
|
||||
var dicobj:Object = GameMath.alchemyFormulaCost[formulaLevel];
|
||||
text_time.text = Paster.secondFormat(dicobj.time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
package net.pixvi.myr.panel.alchemy
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.AlchemyCenter;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.panel.itemselect.ItemSelectPanel;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
|
||||
public class EquipMakerLeftUI extends UIComponent
|
||||
{
|
||||
|
||||
public var ui_item1:AlchemyMaterialItemUI;
|
||||
|
||||
public var ui_item2:AlchemyMaterialItemUI;
|
||||
|
||||
public var ui_item3:AlchemyMaterialItemUI;
|
||||
|
||||
public var ui_item4:AlchemyMaterialItemUI;
|
||||
|
||||
public var items:Array;
|
||||
|
||||
public var text_cost:PiBitTextField;
|
||||
|
||||
public var curSelectItem:AlchemyMaterialItemUI;
|
||||
|
||||
private var nitems:Array = [];
|
||||
|
||||
public function EquipMakerLeftUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
items = [ui_item1,ui_item2,ui_item3,ui_item4];
|
||||
}
|
||||
|
||||
public function getTypes() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var arr:Array = [];
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if((items[i] as AlchemyMaterialItemUI).itemType != -1)
|
||||
{
|
||||
arr.push(items[i].itemType);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getItems() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var arr:Array = [];
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
if((items[i] as AlchemyMaterialItemUI).itemType != -1)
|
||||
{
|
||||
arr.push(items[i].item);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function modeLock() : void
|
||||
{
|
||||
ui_item1.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
ui_item2.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
ui_item3.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
ui_item4.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function modeInput() : void
|
||||
{
|
||||
ui_item1.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
ui_item2.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
ui_item3.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
ui_item4.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
private function clickHandler(e:Event) : void
|
||||
{
|
||||
if(EquipMakerPanel.getIns().curSelectStack.starting)
|
||||
{
|
||||
return;
|
||||
}
|
||||
curSelectItem = e.currentTarget as AlchemyMaterialItemUI;
|
||||
var itemui:AlchemyMaterialItemUI = e.currentTarget as AlchemyMaterialItemUI;
|
||||
var p:ItemSelectPanel = ItemSelectPanel.getIns();
|
||||
ItemSelectPanel.getIns().modeEquipMakeMaterial();
|
||||
p.popIn();
|
||||
p.addEventListener("showout",selectItemHandler);
|
||||
}
|
||||
|
||||
public function onTypes(types:Array) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 0; i < types.length; )
|
||||
{
|
||||
(items[i] as AlchemyMaterialItemUI).onType(types[i]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
private function selectItemHandler(e:Event) : void
|
||||
{
|
||||
ItemSelectPanel.getIns().removeEventListener("showout",selectItemHandler);
|
||||
if(ItemSelectPanel.selectedComplete)
|
||||
{
|
||||
putItem(ItemSelectPanel.selectItem);
|
||||
}
|
||||
}
|
||||
|
||||
public function putItem(itemVo:ItemVo = null, curSelectItem:AlchemyMaterialItemUI = null) : void
|
||||
{
|
||||
if(curSelectItem == null)
|
||||
{
|
||||
curSelectItem = this.curSelectItem;
|
||||
}
|
||||
if(itemVo == null)
|
||||
{
|
||||
curSelectItem.onData(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
curSelectItem.onData(itemVo);
|
||||
}
|
||||
showCostMoney();
|
||||
EquipMakerPanel.getIns().ui.ui_controller.showNeedTime();
|
||||
EquipMakerPanel.getIns().updateTip();
|
||||
BagCenter.getIns().resetItemUsingNum();
|
||||
for each(var i:AlchemyMaterialItemUI in items)
|
||||
{
|
||||
if(i.item != null)
|
||||
{
|
||||
i.item.usingNum++;
|
||||
}
|
||||
}
|
||||
for each(var ai:AlchemyMaterialItemUI in items)
|
||||
{
|
||||
if(ai.itemType == -1)
|
||||
{
|
||||
EquipMakerPanel.getIns().ui.ui_controller.modeNormal(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
EquipMakerPanel.getIns().ui.ui_controller.modeNormal(true);
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
nitems = [];
|
||||
BagCenter.getIns().resetItemUsingNum();
|
||||
for each(var i:AlchemyMaterialItemUI in items)
|
||||
{
|
||||
if(i.item != null && i.item.num > 0)
|
||||
{
|
||||
nitems.push(i.item);
|
||||
}
|
||||
i.reset();
|
||||
}
|
||||
super.reset();
|
||||
}
|
||||
|
||||
public function resetWithOutItem() : void
|
||||
{
|
||||
var j:int = 0;
|
||||
var nnnitem:ItemVo = null;
|
||||
for(j = 0; j < nitems.length; )
|
||||
{
|
||||
nnnitem = BagCenter.getIns().getByType(nitems[j].type);
|
||||
if(nnnitem != null && nnnitem.showNum > 0)
|
||||
{
|
||||
putItem(nnnitem,items[j]);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
public function showCostMoney() : void
|
||||
{
|
||||
var types:Array = getTypes();
|
||||
if(types.length == 0)
|
||||
{
|
||||
text_cost.text = "×0";
|
||||
return;
|
||||
}
|
||||
var formulaLevel:int = AlchemyCenter.getIns().getFormulaLevel(types);
|
||||
var dicobj:Object = GameMath.alchemyFormulaCost[formulaLevel];
|
||||
text_cost.text = "×" + dicobj.cost.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,354 @@
|
||||
package net.pixvi.myr.panel.alchemy
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.driver.SecondDriver;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.AlchemyCenter;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.PosCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TaskCenter;
|
||||
import net.pixvi.myr.element.alchemy.AlchemyStackVo;
|
||||
import net.pixvi.myr.element.alchemy.MaterialType;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.bag.UseItemPanel;
|
||||
import net.pixvi.myr.panel.city.CityPanel;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myr.panel.market.MarketPanel;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EquipMakerPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EquipMakerPanelUI = new EquipMakerPanelUI();
|
||||
|
||||
private var itemsui:Array = [];
|
||||
|
||||
public var curSelectStack:AlchemyStackVo;
|
||||
|
||||
public function EquipMakerPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public static function getIns() : EquipMakerPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(EquipMakerPanel) as EquipMakerPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
for each(var vo:AlchemyStackVo in Master.alchemyStacks)
|
||||
{
|
||||
if(vo.starting && vo.finish())
|
||||
{
|
||||
curSelectStack = vo;
|
||||
}
|
||||
}
|
||||
StageLocator.setSide(ui.mc_npc,"right","none",-130,0);
|
||||
TweenMax.from(ui.mc_npc,0.8,{"x":ui.mc_npc.x + 20});
|
||||
TweenMax.from(ui.mc_mov,0.8,{"x":ui.mc_mov.x + 10});
|
||||
TweenMax.from(ui.ui_left,0.8,{"x":ui.ui_left.x - 15});
|
||||
TweenMax.from(ui.ui_stackList,0.8,{"y":ui.ui_stackList.y + 15});
|
||||
addChild(MainMenu.getIns(this));
|
||||
MainMenu.getIns().onIn();
|
||||
MainMenu.getIns().ui.alchemyMode();
|
||||
PosCenter.activity("city" + CityPanel.getIns().curCityVo.cid + "_alchemy");
|
||||
ui.ui_left.reset();
|
||||
addChild(ui.btn_close);
|
||||
ui.ui_stackList.list_stack.setDatas(Master.alchemyStacks);
|
||||
ui.ui_stackList.list_stack.addEventListener("piselect",stackSelectHandler);
|
||||
ui.ui_stackList.btn_add.onClick(addStackHandler);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.ui_controller.btn_start.onClick(startAlchemy);
|
||||
ui.ui_controller.btn_speed.onClick(speedHandler);
|
||||
ui.mc_mov.addEventListener("hit",hitSound);
|
||||
CityPanel.getIns().ui.ui_top.text_des.text = CityPanel.getIns().curCityVo.alchemyDes;
|
||||
CityPanel.getIns().ui.ui_top.text_name.text = CityPanel.getIns().curCityVo.name + lang("炼金工坊");
|
||||
addChild(CityPanel.getIns().ui.ui_top);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
update();
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
private function hitSound(e:Event) : void
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.soundName("effect_alchemy"));
|
||||
}
|
||||
|
||||
public function startAlchemy(e:Event = null) : void
|
||||
{
|
||||
var types:Array = EquipMakerPanel.getIns().ui.ui_left.getTypes();
|
||||
var formulaLevel:int = AlchemyCenter.getIns().getFormulaLevel(types);
|
||||
var dicobj:Object = GameMath.alchemyFormulaCost[formulaLevel];
|
||||
if(Master.money < dicobj.cost)
|
||||
{
|
||||
Alert.yes(lang("提示"),lang("没有足够的金币!"));
|
||||
return;
|
||||
}
|
||||
if(AlchemyCenter.getIns().checkAlchemyFormula(ui.ui_left.getTypes()))
|
||||
{
|
||||
AlchemyCenter.getIns().startAlchemy(curSelectStack.id,ui.ui_left.getTypes(),ui.ui_left.getItems(),startAlchemyHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.yes(lang("提示"),lang("材料太单一了...做不出什么东西的样子,换个配方试试吧!"));
|
||||
}
|
||||
}
|
||||
|
||||
public function startAlchemyHandler() : void
|
||||
{
|
||||
ui.modeWaiting();
|
||||
update();
|
||||
}
|
||||
|
||||
public function speedHandler(e:Event = null) : void
|
||||
{
|
||||
if(BagCenter.alchemySpeedItemNum() > 0)
|
||||
{
|
||||
startAlchemySpeed();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.showMsg(lang("没有炼金加速券"));
|
||||
}
|
||||
}
|
||||
|
||||
public function startAlchemySpeed() : void
|
||||
{
|
||||
var neednum:int = Math.ceil(curSelectStack.leftTime() / AlchemyCenter.alchemySpeedTime);
|
||||
var hasnum:int = BagCenter.alchemySpeedItemNum();
|
||||
if(hasnum == 0)
|
||||
{
|
||||
Alert.showMsg(lang("没有炼金加速券"));
|
||||
return;
|
||||
}
|
||||
var maxnum:int = Math.min(hasnum,neednum);
|
||||
UseItemPanel.getIns().useItem(BagCenter.getIns().getByType(GameMath.alchemySpeedItemId),true,maxnum,startAlchemySpeedNumChange,yesStartAlchemySpeed,1);
|
||||
UseItemPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
private function startAlchemySpeedNumChange(num:int) : void
|
||||
{
|
||||
var speedTimeStr:String = Paster.secondFormatAutoString(num * AlchemyCenter.alchemySpeedTime);
|
||||
UseItemPanel.getIns().ui.text_msg.htmlText = lang("加速") + CP.lightYellow(speedTimeStr);
|
||||
}
|
||||
|
||||
private function yesStartAlchemySpeed(num:int) : void
|
||||
{
|
||||
AlchemyCenter.getIns().speedAlchemyByItem(curSelectStack.id,num,yesStartAlchemySpeedHandler);
|
||||
}
|
||||
|
||||
private function yesStartAlchemySpeedHandler() : void
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
public function addStackHandler(e:Event = null) : void
|
||||
{
|
||||
var num:int = int(Master.alchemyStacks.length);
|
||||
var money:int = int(Table.alchemyStack_price[num.toString()].money);
|
||||
var ke:int = int(Table.alchemyStack_price[num.toString()].ke);
|
||||
if(money > 0)
|
||||
{
|
||||
Alert.yesno(lang("提示"),lang("是否要花费 {0} 开启一个新的炼金槽位?",CP.money(money.toString() + lang("金币"))),yesAddStackHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.yesno(lang("提示"),lang("是否要花费 {0} 开启一个新的炼金槽位?",CP.ke(ke.toString() + lang("氪金"))),yesAddStackHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private function yesAddStackHandler() : void
|
||||
{
|
||||
var num:int = int(Master.alchemyStacks.length);
|
||||
var money:int = int(Table.alchemyStack_price[num.toString()].money);
|
||||
var ke:int = int(Table.alchemyStack_price[num.toString()].ke);
|
||||
if(Master.money < money)
|
||||
{
|
||||
Alert.showMsg(lang("没有足够的 {0} !",CP.money(lang("金币"))));
|
||||
return;
|
||||
}
|
||||
if(Master.ke < ke)
|
||||
{
|
||||
Alert.showMsg(lang("没有足够的 {0} !",CP.ke(lang("氪金"))));
|
||||
return;
|
||||
}
|
||||
AlchemyCenter.getIns().addAlchemeyStack(addStackComplete);
|
||||
}
|
||||
|
||||
private function addStackComplete() : void
|
||||
{
|
||||
update();
|
||||
new FlashEffect(900,16777215).startEffect(ui.ui_stackList);
|
||||
}
|
||||
|
||||
public function stackSelectHandler(e:Event = null) : void
|
||||
{
|
||||
curSelectStack = ui.ui_stackList.list_stack.curSelectedItemData as AlchemyStackVo;
|
||||
if(!curSelectStack.starting)
|
||||
{
|
||||
ui.ui_left.reset();
|
||||
}
|
||||
BagCenter.getIns().resetItemUsingNum();
|
||||
update();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
if(curSelectStack == null)
|
||||
{
|
||||
curSelectStack = Master.alchemyStacks[0];
|
||||
}
|
||||
if(curSelectStack == null)
|
||||
{
|
||||
Alert.yes("data error","Can\'t find alchemySlot。");
|
||||
return;
|
||||
}
|
||||
ui.ui_stackList.showNum(Master.alchemyStacks.length);
|
||||
ui.ui_stackList.list_stack.update();
|
||||
if(ui.ui_stackList.list_stack.curSelectedItemData != curSelectStack)
|
||||
{
|
||||
ui.ui_stackList.list_stack.selectByValue(curSelectStack);
|
||||
}
|
||||
if(AlchemyCenter.getIns().hasFinish())
|
||||
{
|
||||
GameSound.playSysVoice("alchemyFinish",true,true);
|
||||
}
|
||||
PiLightButton.btnTouchLight.removeDisplay(ui.mc_mov);
|
||||
ui.mc_mov.removeEventListener(MobiEvent.CLICK,alchemyOver);
|
||||
if(curSelectStack.starting)
|
||||
{
|
||||
ui.ui_left.modeLock();
|
||||
ui.ui_left.onTypes(curSelectStack.itemTypes);
|
||||
if(curSelectStack.finish())
|
||||
{
|
||||
ui.modeComplete();
|
||||
ui.ui_controller.modeComplete();
|
||||
SecondDriver.getIns().remove(secondHandler);
|
||||
PiLightButton.btnTouchLight.setDisplay(ui.mc_mov);
|
||||
ui.mc_mov.addEventListener(MobiEvent.CLICK,alchemyOver);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.modeWaiting();
|
||||
ui.ui_controller.modeing();
|
||||
SecondDriver.getIns().regist(secondHandler);
|
||||
secondHandler();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_left.modeInput();
|
||||
ui.modeNormal();
|
||||
ui.ui_controller.modeNormal();
|
||||
ui.ui_controller.showNeedTime();
|
||||
SecondDriver.getIns().remove(secondHandler);
|
||||
}
|
||||
updateTip();
|
||||
ui.ui_left.showCostMoney();
|
||||
}
|
||||
|
||||
public function updateTip() : void
|
||||
{
|
||||
var mats:Array = MaterialType.getMaterialsTip(ui.ui_left.getTypes());
|
||||
ui.ui_tips.text_tips.htmlText = mats.join("<br/>");
|
||||
}
|
||||
|
||||
public function alchemyOver(e:Event) : void
|
||||
{
|
||||
AlchemyCenter.getIns().overAlchemy(curSelectStack.id,alchemyOverHandler);
|
||||
}
|
||||
|
||||
private function alchemyOverHandler(re:EquipVo) : void
|
||||
{
|
||||
var panel:EquipMakerCompletePanel = null;
|
||||
TaskCenter.getIns().activityLockStatus(GSub.ALCHEMY_OVER);
|
||||
if(re != null && re.quality == 3)
|
||||
{
|
||||
GameSound.playSysVoice("getEquip3",true,true);
|
||||
}
|
||||
else if(re != null && re.quality == 4)
|
||||
{
|
||||
GameSound.playSysVoice("getEquip4",true,true);
|
||||
}
|
||||
if(re != null)
|
||||
{
|
||||
panel = EquipMakerCompletePanel.getIns();
|
||||
panel.equip = re;
|
||||
PopCenter.POP(panel);
|
||||
panel.addEventListener("showoutend",alchemyOverResultOutHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private function alchemyOverResultOutHandler(e:Event) : void
|
||||
{
|
||||
ui.ui_left.reset();
|
||||
update();
|
||||
ui.ui_left.resetWithOutItem();
|
||||
}
|
||||
|
||||
public function secondHandler() : void
|
||||
{
|
||||
if(curSelectStack.starting)
|
||||
{
|
||||
if(curSelectStack.finish())
|
||||
{
|
||||
SecondDriver.getInstance().remove(secondHandler);
|
||||
update();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_controller.bar_process.setValue(curSelectStack.process(),1,0,false);
|
||||
ui.ui_controller.text_time.text = Paster.secondFormat(curSelectStack.leftTime());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SecondDriver.getInstance().remove(secondHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
MarketPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
ui.mc_mov.stop();
|
||||
BagCenter.getIns().resetItemUsingNum();
|
||||
ui.ui_left.modeLock();
|
||||
PiLightButton.btnTouchLight.removeDisplay(ui.mc_mov);
|
||||
SecondDriver.getInstance().remove(secondHandler);
|
||||
super.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package net.pixvi.myr.panel.alchemy
|
||||
{
|
||||
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.Game;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EquipMakerPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var ui_left:EquipMakerLeftUI;
|
||||
|
||||
public var ui_controller:EquipMakerControllerUI;
|
||||
|
||||
public var ui_stackList:EquipMakerStackListUI;
|
||||
|
||||
public var ui_tips:EquipMakerTipsUI;
|
||||
|
||||
public var mc_npc:Sprite;
|
||||
|
||||
public var mc_mov:MovieClip;
|
||||
|
||||
public var mc_bg:Sprite;
|
||||
|
||||
public function EquipMakerPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EquipMakerPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
ui_stackList.list_stack.itemClass = EquipMakerStackItem;
|
||||
mc_mov.stop();
|
||||
StageLocator.setSide(btn_close,"left","bottom",0,30);
|
||||
if(Game.getIns().setting.liuhaiMode)
|
||||
{
|
||||
StageLocator.setSide(ui_stackList,"none","top",0,285);
|
||||
}
|
||||
else
|
||||
{
|
||||
StageLocator.setSide(ui_stackList,"none","top",0,239);
|
||||
}
|
||||
mc_npc.scaleX = mc_npc.scaleY = 0.8;
|
||||
if(StageLocator.MainFixVo.fix[3] < 0)
|
||||
{
|
||||
ui_left.scaleX = ui_left.scaleY = 0.91;
|
||||
ui_left.y += 43;
|
||||
}
|
||||
}
|
||||
|
||||
public function modeWaiting() : void
|
||||
{
|
||||
mc_mov.gotoAndPlay("loading");
|
||||
}
|
||||
|
||||
public function modeComplete() : void
|
||||
{
|
||||
mc_mov.gotoAndPlay("finish");
|
||||
}
|
||||
|
||||
public function modeNormal() : void
|
||||
{
|
||||
mc_mov.gotoAndStop("normal");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package net.pixvi.myr.panel.alchemy
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.driver.SecondDriver;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.element.alchemy.AlchemyStackVo;
|
||||
import net.pixvi.pfw.driver.EnterFrameDriver;
|
||||
import net.pixvi.pfw.ui.controls.PiBar;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
|
||||
public class EquipMakerStackItem extends PiListItem
|
||||
{
|
||||
|
||||
public var vo:AlchemyStackVo;
|
||||
|
||||
public var text_time:PiBitTextField;
|
||||
|
||||
public var bar_bar:PiBar;
|
||||
|
||||
public var mc_light:Sprite;
|
||||
|
||||
public function EquipMakerStackItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_time.mouseChildren = text_time.mouseEnabled = false;
|
||||
bar_bar.mouseChildren = bar_bar.mouseEnabled = false;
|
||||
mc_light.mouseChildren = mc_light.mouseEnabled = false;
|
||||
}
|
||||
|
||||
override public function hackUiMap(uimap:Object) : void
|
||||
{
|
||||
uimap["btn_select"] = "net.pixvi.psg.ui.controller.PiLightButton";
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
this.vo = value as AlchemyStackVo;
|
||||
update();
|
||||
btn_select.onClick(sendSelect);
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(vo.starting)
|
||||
{
|
||||
if(vo.finish())
|
||||
{
|
||||
mc_light.visible = true;
|
||||
text_time.htmlText = Paster.font(lang("炼金完成"),"#ffff00");
|
||||
bar_bar.setValue(1,1,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_light.visible = false;
|
||||
secondUpdate();
|
||||
SecondDriver.getIns().regist(secondUpdate);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EnterFrameDriver.getIns().remove(secondUpdate);
|
||||
text_time.htmlText = Paster.font(lang("空闲"),"#ffffff");
|
||||
bar_bar.setValue(0,1,0,false);
|
||||
}
|
||||
}
|
||||
|
||||
public function secondUpdate() : void
|
||||
{
|
||||
if(vo.finish())
|
||||
{
|
||||
update();
|
||||
}
|
||||
else
|
||||
{
|
||||
text_time.text = Paster.secondFormat(vo.leftTime());
|
||||
bar_bar.setValue(vo.process(),1,0,false);
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
SecondDriver.getIns().remove(secondUpdate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package net.pixvi.myr.panel.alchemy
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EquipMakerStackListUI extends UIComponent
|
||||
{
|
||||
|
||||
public var list_stack:PiDataList;
|
||||
|
||||
public var btn_add:PiLightButton;
|
||||
|
||||
public var mc_num1:Sprite;
|
||||
|
||||
public var mc_num2:Sprite;
|
||||
|
||||
public var mc_num3:Sprite;
|
||||
|
||||
public var mc_num4:Sprite;
|
||||
|
||||
private var original_btnadd_x:int = 0;
|
||||
|
||||
public function EquipMakerStackListUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
original_btnadd_x = btn_add.x;
|
||||
mc_num1.mouseChildren = mc_num1.mouseEnabled = false;
|
||||
mc_num2.mouseChildren = mc_num2.mouseEnabled = false;
|
||||
mc_num3.mouseChildren = mc_num3.mouseEnabled = false;
|
||||
mc_num4.mouseChildren = mc_num4.mouseEnabled = false;
|
||||
}
|
||||
|
||||
public function showNum(num:int) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 1; i <= 4; )
|
||||
{
|
||||
if(i <= num)
|
||||
{
|
||||
this["mc_num" + i].visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this["mc_num" + i].visible = false;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(num < 4)
|
||||
{
|
||||
btn_add.visible = true;
|
||||
btn_add.x = original_btnadd_x + (num - 1) * 155;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_add.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package net.pixvi.myr.panel.alchemy
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
|
||||
public class EquipMakerTipsUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_tips:TextField;
|
||||
|
||||
public function EquipMakerTipsUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package net.pixvi.myr.panel.avatar
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
|
||||
public class AvatarCardUI extends UIComponent
|
||||
{
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public function AvatarCardUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(74,74);
|
||||
}
|
||||
|
||||
public function onData(avatarvo:AvatarVo) : void
|
||||
{
|
||||
container_img.loadNetBitImg(avatarvo.img);
|
||||
}
|
||||
|
||||
public function onDataByAvatarType(type:int) : void
|
||||
{
|
||||
var avatarvo:AvatarVo = new AvatarVo();
|
||||
avatarvo.avatarId = type;
|
||||
onData(avatarvo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package net.pixvi.myr.panel.avatar
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MasterCenter;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class AvatarSetPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:AvatarSetPanelUI = new AvatarSetPanelUI();
|
||||
|
||||
public function AvatarSetPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
buffMode = false;
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_save.onClick(saveAvatarHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : AvatarSetPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(AvatarSetPanel) as AvatarSetPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
MasterCenter.getIns().getAvatar(getCompleteHandler);
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskCloseHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function maskCloseHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getInstance().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().resetMaskAlpha();
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,maskCloseHandler);
|
||||
super.showOut();
|
||||
}
|
||||
|
||||
public function getCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
var curAvatarVo:AvatarVo = new AvatarVo();
|
||||
curAvatarVo.avatarId = Master.avatar;
|
||||
updateCurByAvatarVo(curAvatarVo);
|
||||
var avatars:Array = MasterCenter.getIns().getUseableAvatar();
|
||||
ui.list_avatar.setDatas(avatars);
|
||||
ui.list_avatar.addEventListener("piselect",avatarSelectHandler);
|
||||
var curSelectAvatar:AvatarVo = ArrayUtil.getElementByValue(avatars,"avatarId",Master.avatar) as AvatarVo;
|
||||
ui.list_avatar.selectByData(curSelectAvatar);
|
||||
}
|
||||
|
||||
public function avatarSelectHandler(e:Event = null) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function updateCurByAvatarVo(avatarVo:AvatarVo) : void
|
||||
{
|
||||
ui.ui_avatarCard.onData(avatarVo);
|
||||
}
|
||||
|
||||
public function saveAvatarHandler(e:Event = null) : void
|
||||
{
|
||||
var curSelectAvatar:AvatarVo = ui.list_avatar.curSelectedItemData as AvatarVo;
|
||||
if(curSelectAvatar.avatarId == Master.avatar)
|
||||
{
|
||||
Alert.showMsg(lang("所选头像已经是当前头像了!"));
|
||||
return;
|
||||
}
|
||||
MasterCenter.getIns().setAvatar(curSelectAvatar.avatarId,saveCompleteHandler);
|
||||
}
|
||||
|
||||
public function saveCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
Alert.yes(lang("更换头像"),lang("新的头像已保存!"));
|
||||
updateCurByAvatarVo(ui.list_avatar.curSelectedItemData as AvatarVo);
|
||||
MainMenu.getIns().ui.ui_top.updateAvatar();
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package net.pixvi.myr.panel.avatar
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class AvatarSetPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_save:PiLightButton;
|
||||
|
||||
public var list_avatar:PiSliderList;
|
||||
|
||||
public var ui_avatarCard:AvatarCardUI;
|
||||
|
||||
public function AvatarSetPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.AvatarSetPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_avatar.setList(AvatarSliderListItem,10,false,120,5,120);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package net.pixvi.myr.panel.avatar
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.view.FF;
|
||||
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.PiSliderListItem;
|
||||
|
||||
public class AvatarSliderListItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public function AvatarSliderListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.AvatarSliderListItemUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(100,100);
|
||||
this.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
container_img.loadNetBitImg((value as AvatarVo).img);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
SoundCenter.getIns().play(GameSound.effect_click2);
|
||||
sendSelect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package net.pixvi.myr.panel.avatar
|
||||
{
|
||||
public class AvatarType
|
||||
{
|
||||
|
||||
public static const FREE:String = "free";
|
||||
|
||||
public static const ACHIVEMENT:String = "achi";
|
||||
|
||||
public static const TASK:String = "task";
|
||||
|
||||
public static const ENTANGLE:String = "entangle";
|
||||
|
||||
public static const SKIN:String = "skin";
|
||||
|
||||
public static const LOCK:String = "lock";
|
||||
|
||||
public function AvatarType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package net.pixvi.myr.panel.avatar
|
||||
{
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.AchiCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
|
||||
public class AvatarVo
|
||||
{
|
||||
|
||||
public var avatarId:int = 1;
|
||||
|
||||
public function AvatarVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function useable() : Boolean
|
||||
{
|
||||
var emon:MonsterVo = null;
|
||||
switch(type)
|
||||
{
|
||||
case "free":
|
||||
return true;
|
||||
case "entangle":
|
||||
emon = MonsterCenter.getIns().getEntangleMonByType(avatarId);
|
||||
if(emon != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case "task":
|
||||
if(Master.history.passTask[task] == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case "achi":
|
||||
if(AchiCenter.getIns().checkAchiFinished(int(achi)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case "lock":
|
||||
if(Master.avatars.indexOf(avatarId.toString()) != -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case "skin":
|
||||
if(Master.history.unlockSkins.indexOf(avatarId) != -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function get type() : String
|
||||
{
|
||||
return table().type;
|
||||
}
|
||||
|
||||
public function get task() : String
|
||||
{
|
||||
return table().task;
|
||||
}
|
||||
|
||||
public function get achi() : String
|
||||
{
|
||||
return table().achi;
|
||||
}
|
||||
|
||||
public function get img() : String
|
||||
{
|
||||
if(type == "entangle")
|
||||
{
|
||||
return "data/img/monster/a/" + avatarId.toString() + "_a_0.png";
|
||||
}
|
||||
return table().img;
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
if(Table.avatar_info[avatarId] == null)
|
||||
{
|
||||
Alert.showMsg("找不到头像[" + avatarId + "],检查魔物是否hide。");
|
||||
}
|
||||
}
|
||||
return Table.avatar_info[avatarId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,429 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.center.AchiCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.PosCenter;
|
||||
import net.pixvi.myr.element.achi.AchiType;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.panel.exchange.ExchangePanel;
|
||||
import net.pixvi.myr.panel.jxh.CzAddPanel;
|
||||
import net.pixvi.myr.panel.setting.ChangeNamePanel;
|
||||
import net.pixvi.pfw.event.PiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class BagPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:BagPanelUI = new BagPanelUI();
|
||||
|
||||
public var curmode:int = 1;
|
||||
|
||||
public var showEggList:Boolean = false;
|
||||
|
||||
public var showEquipQuality:int = 0;
|
||||
|
||||
private var sortMode:uint = 18;
|
||||
|
||||
public function BagPanel(showTime:Number = 0.3, hideTime:Number = 0.3)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.switch_tab.setValues(0,1,2);
|
||||
ui.switch_tab.selectFlag(2);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
gotoMode(1);
|
||||
ui.switch_tab.addEventListener("piselect",tabSelectHandler);
|
||||
ui.list_item.addEventListener("piselect",itemSelectHandler);
|
||||
ui.list_egg.addEventListener("piselect",itemSelectHandler);
|
||||
ui.list_item.addEventListener("pislide",listSliderHandler);
|
||||
ui.switch_sort_egg.addEventListener("piselect",sortEgg);
|
||||
ui.switch_sort_equip.addEventListener("piselect",sortEquip);
|
||||
ui.switch_sort_item.addEventListener("piselect",sortItem);
|
||||
ui.btn_sortDirect.onClick(switchSortDirect);
|
||||
if(ui.btn_equipQuality != null && ui.switch_equipQuality != null)
|
||||
{
|
||||
ui.btn_equipQuality.onClick(openEquipQuality);
|
||||
ui.switch_equipQuality.addEventListener("piselect",changeEquipQualityHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getIns() : BagPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BagPanel) as BagPanel;
|
||||
}
|
||||
|
||||
public function openEquipQuality(e:Event = null) : void
|
||||
{
|
||||
if(ui.switch_equipQuality == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(ui.switch_equipQuality.visible == false)
|
||||
{
|
||||
ui.switch_equipQuality.visible = true;
|
||||
ui.switch_sort_equip.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
showEquipQuality = 0;
|
||||
ui.switch_equipQuality.releaseAll();
|
||||
ui.switch_equipQuality.visible = false;
|
||||
ui.switch_sort_equip.visible = true;
|
||||
if(ui.mc_equipQuality != null)
|
||||
{
|
||||
ui.mc_equipQuality.visible = false;
|
||||
}
|
||||
sortEquip();
|
||||
}
|
||||
}
|
||||
|
||||
public function changeEquipQualityHandler(e:Event = null) : void
|
||||
{
|
||||
if(ui.switch_equipQuality == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ui.switch_equipQuality.visible = false;
|
||||
ui.switch_sort_equip.visible = true;
|
||||
this.showEquipQuality = int(ui.switch_equipQuality.value);
|
||||
if(ui.mc_equipQuality != null && showEquipQuality > 0)
|
||||
{
|
||||
ui.mc_equipQuality.visible = true;
|
||||
ui.mc_equipQuality.gotoAndStop(showEquipQuality);
|
||||
}
|
||||
else if(ui.mc_equipQuality != null)
|
||||
{
|
||||
ui.mc_equipQuality.visible = false;
|
||||
}
|
||||
sortEquip();
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function switchSortDirect(e:Event = null) : void
|
||||
{
|
||||
ui.btn_sortDirect.switchSelectStatus();
|
||||
if(ui.btn_sortDirect.selected)
|
||||
{
|
||||
sortMode = 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
sortMode = 0x10 | 2;
|
||||
}
|
||||
if(ui.switch_tab.value == 0)
|
||||
{
|
||||
sortEgg();
|
||||
}
|
||||
else if(ui.switch_tab.value == 1)
|
||||
{
|
||||
sortItem();
|
||||
}
|
||||
else if(ui.switch_tab.value == 2)
|
||||
{
|
||||
sortEquip();
|
||||
}
|
||||
}
|
||||
|
||||
public function sortEgg(e:Event = null) : void
|
||||
{
|
||||
ui.list_egg.itemDatas.sortOn(ui.switch_sort_egg.value,sortMode);
|
||||
ui.list_egg.refresh(ui.list_egg.itemDatas);
|
||||
}
|
||||
|
||||
public function sortEquip(e:Event = null) : void
|
||||
{
|
||||
var arr:Array = null;
|
||||
arr = null;
|
||||
var part:int = 0;
|
||||
var earr:Array = null;
|
||||
if(ui.switch_sort_equip.value == "quality")
|
||||
{
|
||||
arr = Master.bag.getEquipArr(-1,showEquipQuality);
|
||||
arr.sortOn([ui.switch_sort_equip.value,"id"],sortMode);
|
||||
ui.list_item.refresh(arr);
|
||||
}
|
||||
else if(ui.switch_sort_equip.value == "zb")
|
||||
{
|
||||
arr = Master.bag.getEquipArr(4,showEquipQuality);
|
||||
arr = arr.concat(Master.bag.getEquipArr(5,showEquipQuality));
|
||||
arr.sortOn(["quality","id"],sortMode);
|
||||
ui.list_item.refresh(arr);
|
||||
}
|
||||
else
|
||||
{
|
||||
part = -1;
|
||||
if(ui.switch_sort_equip.value != null)
|
||||
{
|
||||
part = int(ui.switch_sort_equip.value);
|
||||
}
|
||||
earr = Master.bag.getEquipArr(part,showEquipQuality);
|
||||
earr.sortOn(["quality","id"],sortMode);
|
||||
ui.list_item.refresh(earr);
|
||||
}
|
||||
}
|
||||
|
||||
public function sortItem(e:Event = null) : void
|
||||
{
|
||||
var datas:Array = [];
|
||||
if(ui.switch_sort_item.value == "useable")
|
||||
{
|
||||
datas = Master.bag.getItemArrUseable();
|
||||
}
|
||||
else if(ui.switch_sort_item.value == "q1")
|
||||
{
|
||||
datas = Master.bag.getItemArrQuality(1);
|
||||
}
|
||||
else if(ui.switch_sort_item.value == "q2")
|
||||
{
|
||||
datas = Master.bag.getItemArrQuality(2);
|
||||
}
|
||||
else if(ui.switch_sort_item.value == "q3")
|
||||
{
|
||||
datas = Master.bag.getItemArrQuality(3);
|
||||
}
|
||||
else if(ui.switch_sort_item.value == "q4")
|
||||
{
|
||||
datas = Master.bag.getItemArrQuality(4);
|
||||
}
|
||||
else if(ui.switch_sort_item.value == "q5")
|
||||
{
|
||||
datas = Master.bag.getItemArrQuality(5);
|
||||
}
|
||||
else
|
||||
{
|
||||
datas = Master.bag.getItemArr();
|
||||
}
|
||||
if(ui.switch_sort_item.value == "quality")
|
||||
{
|
||||
datas.sortOn([ui.switch_sort_item.value,"id"],sortMode);
|
||||
}
|
||||
ui.list_item.refresh(datas);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
showEquipQuality = 0;
|
||||
if(ui.switch_equipQuality != null)
|
||||
{
|
||||
ui.switch_equipQuality.releaseAll();
|
||||
}
|
||||
this.showOut();
|
||||
this.openPanel.popInWith(this);
|
||||
}
|
||||
|
||||
public function listSliderHandler(e:Event = null) : void
|
||||
{
|
||||
ItemTip.getIns().showOut();
|
||||
EquipTip.getIns().showOut();
|
||||
}
|
||||
|
||||
public function gotoMode(mode:int = 1) : void
|
||||
{
|
||||
EquipTip.getIns().showOut();
|
||||
ItemTip.getIns().showOut();
|
||||
ui.switch_sort_egg.visible = false;
|
||||
ui.switch_sort_egg.releaseAll();
|
||||
ui.switch_sort_equip.visible = false;
|
||||
ui.switch_sort_equip.releaseAll();
|
||||
ui.switch_sort_item.visible = false;
|
||||
ui.switch_sort_item.releaseAll();
|
||||
if(ui.mc_equipQuality != null)
|
||||
{
|
||||
ui.mc_equipQuality.visible = false;
|
||||
}
|
||||
if(ui.switch_equipQuality != null)
|
||||
{
|
||||
ui.switch_equipQuality.visible = false;
|
||||
}
|
||||
if(ui.btn_equipQuality != null)
|
||||
{
|
||||
ui.btn_equipQuality.visible = false;
|
||||
}
|
||||
if(ui.mc_empty != null)
|
||||
{
|
||||
ui.mc_empty.visible = false;
|
||||
}
|
||||
if(mode == 1)
|
||||
{
|
||||
curmode = 1;
|
||||
ui.switch_sort_item.visible = true;
|
||||
ui.list_egg.visible = false;
|
||||
ui.list_item.visible = true;
|
||||
ui.list_item.setDatas(Master.bag.getItemArr());
|
||||
if(ui.mc_eggTip != null)
|
||||
{
|
||||
ui.mc_eggTip.visible = false;
|
||||
}
|
||||
ui.list_item.setMcEmpty(ui.mc_empty);
|
||||
}
|
||||
else if(mode == 0)
|
||||
{
|
||||
curmode = 0;
|
||||
ui.switch_sort_egg.visible = true;
|
||||
ui.list_egg.visible = true;
|
||||
ui.list_item.visible = false;
|
||||
if(!showEggList)
|
||||
{
|
||||
showEggList = true;
|
||||
ui.list_egg.setDatas(Master.bag.getEggArr());
|
||||
}
|
||||
if(ui.mc_empty != null)
|
||||
{
|
||||
ui.mc_empty.visible = true;
|
||||
}
|
||||
if(ui.mc_eggTip != null)
|
||||
{
|
||||
ui.mc_eggTip.visible = true;
|
||||
}
|
||||
ui.list_egg.setMcEmpty(ui.mc_empty);
|
||||
}
|
||||
else if(mode == 2)
|
||||
{
|
||||
if(ui.btn_equipQuality != null && ui.switch_equipQuality != null)
|
||||
{
|
||||
ui.btn_equipQuality.visible = true;
|
||||
}
|
||||
curmode = 2;
|
||||
ui.switch_sort_equip.visible = true;
|
||||
ui.list_egg.visible = false;
|
||||
ui.list_item.visible = true;
|
||||
ui.list_item.setDatas(Master.bag.getEquipArr(-1,showEquipQuality));
|
||||
ui.list_item.setMcEmpty(ui.mc_empty);
|
||||
if(ui.mc_eggTip != null)
|
||||
{
|
||||
ui.mc_eggTip.visible = false;
|
||||
}
|
||||
if(ui.mc_equipQuality != null && showEquipQuality > 0)
|
||||
{
|
||||
ui.mc_equipQuality.visible = true;
|
||||
ui.mc_equipQuality.gotoAndStop(showEquipQuality);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
showEggList = false;
|
||||
PosCenter.activity("bag");
|
||||
ItemTip.getIns().btn_sell.onClick(sellHandler);
|
||||
ItemTip.getIns().btn_use.onClick(useHandler);
|
||||
EquipTip.getIns().btn_sell.onClick(sellHandler);
|
||||
update();
|
||||
AchiCenter.getIns().autoCheck(AchiType.ITEM);
|
||||
GlobalBroadcast.addEventListener(MYREvent.ITEM_NUM_CHANGE,itemNumChangeHandler);
|
||||
ImgCenter.addFsMask(this);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
var arr:Array = Master.bag.getItemArr();
|
||||
ui.list_item.setDatas(Master.bag.getItemArr());
|
||||
gotoMode(curmode);
|
||||
}
|
||||
|
||||
public function itemNumChangeHandler(e:PiEvent = null) : void
|
||||
{
|
||||
if(e.data == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var item:ItemVo = e.data as ItemVo;
|
||||
if(curmode == 1)
|
||||
{
|
||||
sortItem();
|
||||
}
|
||||
else if(curmode == 2)
|
||||
{
|
||||
sortEquip();
|
||||
}
|
||||
}
|
||||
|
||||
public function itemSelectHandler(e:Event = null) : void
|
||||
{
|
||||
var curSelectItemVo:ItemVo = ui.list_item.curSelectedItemData as ItemVo;
|
||||
if(curmode == 1 || curmode == 0)
|
||||
{
|
||||
ItemTip.getIns().breakHandler();
|
||||
addChild(ItemTip.getIns());
|
||||
ItemTip.getIns().onData(ui.list_item.curSelectedItemData);
|
||||
ItemTip.getIns().showOn(ui.list_item.curSelectedItem);
|
||||
}
|
||||
else if(curmode == 2)
|
||||
{
|
||||
EquipTip.getIns().breakHandler();
|
||||
addChild(EquipTip.getIns());
|
||||
EquipTip.getIns().onData(ui.list_item.curSelectedItemData);
|
||||
EquipTip.getIns().showOn(ui.list_item.curSelectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
public function tabSelectHandler(e:Event = null) : void
|
||||
{
|
||||
gotoMode(int(ui.switch_tab.value));
|
||||
}
|
||||
|
||||
public function sellHandler(e:Event = null) : void
|
||||
{
|
||||
SellItemPanel.getIns().sellItem(ui.list_item.curSelectedItemData as ItemVo);
|
||||
SellItemPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
public function useHandler(e:Event = null) : void
|
||||
{
|
||||
var level:int = 0;
|
||||
var itemvo:ItemVo = ui.list_item.curSelectedItemData as ItemVo;
|
||||
if(itemvo.bz.indexOf("useLevel:") == 0)
|
||||
{
|
||||
level = int(itemvo.bz.split(":")[1]);
|
||||
if(Master.level < level)
|
||||
{
|
||||
Alert.showMsg("需要达到 等级:" + level);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(itemvo.para != null)
|
||||
{
|
||||
switch(itemvo.para.action)
|
||||
{
|
||||
case "changeName":
|
||||
PopCenter.POP(new ChangeNamePanel());
|
||||
return;
|
||||
case "exchange":
|
||||
ExchangePanel.getIns().popInExchange(itemvo.para.team);
|
||||
return;
|
||||
case "czAdd":
|
||||
PopCenter.POP(new CzAddPanel());
|
||||
return;
|
||||
}
|
||||
}
|
||||
UseItemPanel.getIns().useItem(ui.list_item.curSelectedItemData as ItemVo);
|
||||
UseItemPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener(MYREvent.ITEM_NUM_CHANGE,itemNumChangeHandler);
|
||||
ItemTip.getIns().btn_sell.onClick(sellHandler,true);
|
||||
EquipTip.getIns().btn_sell.onClick(sellHandler,true);
|
||||
ItemTip.getIns().btn_use.onClick(useHandler,true);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.panel.egg.EggSliderListItem;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
import net.pixvi.psg.ui.controller.PiLightSwitch;
|
||||
|
||||
public class BagPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var list_item:PiSliderList;
|
||||
|
||||
public var mc_empty:Sprite;
|
||||
|
||||
public var list_egg:PiSliderList;
|
||||
|
||||
public var switch_tab:PiLightSwitch;
|
||||
|
||||
public var switch_sort_egg:PiLightSwitch;
|
||||
|
||||
public var switch_sort_equip:PiLightSwitch;
|
||||
|
||||
public var switch_sort_item:PiLightSwitch;
|
||||
|
||||
public var btn_equipQuality:PiLightButton;
|
||||
|
||||
public var switch_equipQuality:PiLightSwitch;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_sortDirect:PiLightButton;
|
||||
|
||||
public var mc_equipQuality:MovieClip;
|
||||
|
||||
public var mc_eggTip:Sprite;
|
||||
|
||||
public function BagPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.BagPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_item.setMcEmpty(mc_empty);
|
||||
if(mc_equipQuality != null)
|
||||
{
|
||||
mc_equipQuality.stop();
|
||||
mc_equipQuality.visible = false;
|
||||
}
|
||||
list_egg.setMcEmpty(mc_empty);
|
||||
list_item.setList(ItemSliderListItemLarge,30,false,143,4,146);
|
||||
list_egg.setList(EggSliderListItem,30,false,176,4,146);
|
||||
list_egg.multiSelectedMax = 0;
|
||||
switch_sort_egg.setValues("star","timeTotal","q1","q2","q3","q4","q5");
|
||||
switch_sort_egg.visible = false;
|
||||
switch_sort_equip.setValues("quality","1","2","3","zb");
|
||||
switch_sort_equip.visible = false;
|
||||
switch_sort_item.setValues("quality","useable","q1","q2","q3","q4","q5");
|
||||
switch_sort_item.visible = false;
|
||||
if(switch_equipQuality != null)
|
||||
{
|
||||
switch_equipQuality.setValues(1,2,3,4,5);
|
||||
switch_equipQuality.visible = false;
|
||||
}
|
||||
if(btn_equipQuality != null)
|
||||
{
|
||||
btn_equipQuality.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
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.PiSliderListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EggSelectSliderListItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var container_bg:PiImgContainer;
|
||||
|
||||
public var container_egg:PiImgContainer;
|
||||
|
||||
public var container_star:PiImgContainer;
|
||||
|
||||
public var container_element:PiImgContainer;
|
||||
|
||||
public var text_time:TextField;
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public function EggSelectSliderListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EggSliderListItemUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_egg.setSize(125,125);
|
||||
container_bg.setSize(125,129);
|
||||
container_star.setSize(110,34);
|
||||
container_element.setSize(48,50);
|
||||
container_element.setScale(0.8);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var egg:EggVo = value as EggVo;
|
||||
container_bg.loadNetBitImg(ImgCenter.getItemBgImg(egg));
|
||||
container_egg.loadNetBitImg(egg.imgsrc,true);
|
||||
container_star.loadNetBitImg(ImgCenter.getStarImg(egg.star));
|
||||
text_time.text = Paster.secondFormat(egg.timeTotal);
|
||||
text_num.text = egg.num.toString();
|
||||
container_element.loadNetBitImg(ImgCenter.getMonElement(egg.element),true,true,0);
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
TipCenter.registTextTip(this,egg.name,10);
|
||||
addEventListener(MobiEvent.CLICK,sendSelect);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
this.removeEventListener(MobiEvent.CLICK,sendSelect);
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.alchemy.EquipType;
|
||||
import net.pixvi.myr.element.bag.EquipLimitVo;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.event.PiEvent;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.utils.Oncer;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EquipTip extends UIComponent
|
||||
{
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var btn_sell:PiLightButton;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_effect1:TextField;
|
||||
|
||||
public var text_effect2:TextField;
|
||||
|
||||
public var text_effect3:TextField;
|
||||
|
||||
public var text_effect4:TextField;
|
||||
|
||||
public var text_effect5:TextField;
|
||||
|
||||
public var text_effect6:TextField;
|
||||
|
||||
public var text_des:TextField;
|
||||
|
||||
public var btn_use:PiLightButton;
|
||||
|
||||
public var btn_hide:PiLightButton;
|
||||
|
||||
public var text_part:PiBitTextField;
|
||||
|
||||
public var text_limit:PiBitTextField;
|
||||
|
||||
public var mc_limit:Sprite;
|
||||
|
||||
public function EquipTip(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EquipTipUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
public static function getIns() : EquipTip
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(EquipTip) as EquipTip;
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
text_name.scaleMode = true;
|
||||
if(btn_hide != null)
|
||||
{
|
||||
btn_hide.visible = false;
|
||||
}
|
||||
if(text_limit != null)
|
||||
{
|
||||
text_limit.visible = false;
|
||||
text_limit.scaleMode = true;
|
||||
}
|
||||
if(mc_limit.visible != null)
|
||||
{
|
||||
mc_limit.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function onData(data:Object) : void
|
||||
{
|
||||
var equip:EquipVo = null;
|
||||
var limitVo:EquipLimitVo = null;
|
||||
var i:int = 0;
|
||||
this.data = data;
|
||||
if(data is EquipVo)
|
||||
{
|
||||
if(text_limit != null)
|
||||
{
|
||||
text_limit.visible = false;
|
||||
}
|
||||
if(mc_limit.visible != null)
|
||||
{
|
||||
mc_limit.visible = false;
|
||||
}
|
||||
equip = data as EquipVo;
|
||||
limitVo = equip.getLimit();
|
||||
if(limitVo.hasLimit())
|
||||
{
|
||||
text_limit.visible = mc_limit.visible = true;
|
||||
text_limit.text = limitVo.getDes();
|
||||
}
|
||||
container_img.loadNetBitImg(equip.imgsrc);
|
||||
btn_sell.visible = equip.sellable;
|
||||
btn_use.visible = equip.useable;
|
||||
text_part.text = EquipType.partNameDic[equip.part];
|
||||
if(equip.des.length >= 48)
|
||||
{
|
||||
text_des.htmlText = Paster.font(equip.des,null,14);
|
||||
}
|
||||
else
|
||||
{
|
||||
text_des.htmlText = equip.des;
|
||||
}
|
||||
text_name.text = equip.name;
|
||||
for(i = 0; i < 6; )
|
||||
{
|
||||
if(this["text_effect" + (i + 1)] != null)
|
||||
{
|
||||
if(equip.effectDes()[i] != null)
|
||||
{
|
||||
this["text_effect" + (i + 1)].htmlText = equip.effectDes()[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
this["text_effect" + (i + 1)].htmlText = "";
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function showOn(displayObject:DisplayObject, clickHide:Boolean = true, showSellBtn:Boolean = true, showUseBtn:Boolean = false, showHideBtn:Boolean = false) : void
|
||||
{
|
||||
var rec:Rectangle = displayObject.getRect(StageDriver.stage);
|
||||
this.x = rec.x + rec.width / 2;
|
||||
this.y = rec.y + rec.height / 2;
|
||||
if(!showSellBtn)
|
||||
{
|
||||
btn_sell.visible = showSellBtn;
|
||||
}
|
||||
btn_use.visible = showUseBtn;
|
||||
if(btn_hide != null)
|
||||
{
|
||||
btn_hide.visible = showHideBtn;
|
||||
btn_hide.onClick(hideHandler);
|
||||
}
|
||||
btn_use.onClick(useHandler);
|
||||
StageDriver.keepInStage(this,20);
|
||||
if(clickHide)
|
||||
{
|
||||
Oncer.lastRun(StageDriver.stage.addEventListener,[MobiEvent.CLICK,clickHandler]);
|
||||
}
|
||||
}
|
||||
|
||||
public function hideHandler(e:Event = null) : void
|
||||
{
|
||||
dispatchEvent(new PiEvent("hide",this.data));
|
||||
}
|
||||
|
||||
public function useHandler(e:Event = null) : void
|
||||
{
|
||||
dispatchEvent(new Event("use"));
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
if(this.parent != null)
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
public function breakHandler() : void
|
||||
{
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
container_img.reset();
|
||||
}
|
||||
|
||||
public function showOut() : void
|
||||
{
|
||||
clickHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
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.PiSliderListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ItemSliderListItemCompareMiddle extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var value:int = 0;
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public var container_bg:PiImgContainer;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public function ItemSliderListItemCompareMiddle(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.ItemSliderListItemMiddleUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
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 imgsrc:String = "";
|
||||
var name:String = "";
|
||||
var rank:int = 1;
|
||||
var itemvo:ItemVo = new ItemVo();
|
||||
itemvo.type = value.type;
|
||||
itemvo.num = value.num;
|
||||
text_num.visible = true;
|
||||
rank = itemvo.quality;
|
||||
imgsrc = itemvo.imgsrc;
|
||||
name = ItemVo.getName(itemvo.type);
|
||||
TipCenter.registTextTip(this,name,9);
|
||||
container_bg.loadNetBitImg(ImgCenter.getItemBgImgByRank(rank,"M"));
|
||||
container_item.loadNetBitImg(imgsrc,true,true,9);
|
||||
if(BagCenter.getIns().getNum(itemvo.type) >= itemvo.num)
|
||||
{
|
||||
text_num.htmlText = Paster.font(itemvo.num.toString(),"#ffffff");
|
||||
}
|
||||
else
|
||||
{
|
||||
text_num.htmlText = Paster.font(itemvo.num.toString(),"#FF6067");
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.itemselect.ItemSelectPanel;
|
||||
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.PiSliderListItem;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ItemSliderListItemLarge extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var value:int = 0;
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public var container_bg:PiImgContainer;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public function ItemSliderListItemLarge(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.ItemSliderListItemLargeUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_item.setSize(125,125);
|
||||
container_bg.setSize(125,129);
|
||||
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
|
||||
{
|
||||
if(value.maxNum > 1)
|
||||
{
|
||||
text_num.visible = true;
|
||||
text_num.text = (value as ItemVo).showNum.toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
text_num.visible = false;
|
||||
}
|
||||
if(ItemSelectPanel.itemTipGetFunction != null)
|
||||
{
|
||||
TipCenter.registTextTip(this,ItemSelectPanel.itemTipGetFunction(value),11);
|
||||
}
|
||||
container_bg.loadNetBitImg(ImgCenter.getItemBgImg(value,"L"));
|
||||
container_item.loadNetBitImg(value.imgsrc);
|
||||
container_bg.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
super.reset();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
PiLightButton.btnTouchLight.removeDisplay(container_bg);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.view.FF;
|
||||
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.PiSliderListItem;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ItemSliderListItemMiddle extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var value:int = 0;
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public var container_bg:PiImgContainer;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public var desTipMode:Boolean = false;
|
||||
|
||||
public function ItemSliderListItemMiddle(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.ItemSliderListItemMiddleUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_num.scaleMode = true;
|
||||
text_num.mapMode = false;
|
||||
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;
|
||||
if(value is EggVo)
|
||||
{
|
||||
eggvo = value as EggVo;
|
||||
rank = eggvo.star;
|
||||
imgsrc = eggvo.imgsrc;
|
||||
name = eggvo.name;
|
||||
des = name;
|
||||
text_num.visible = true;
|
||||
text_num.text = eggvo.num.toString();
|
||||
}
|
||||
else if(value is MonsterVo)
|
||||
{
|
||||
mon = value as MonsterVo;
|
||||
rank = mon.star;
|
||||
imgsrc = mon.getImg();
|
||||
name = mon.name;
|
||||
des = name;
|
||||
text_num.visible = false;
|
||||
}
|
||||
else if(value is ItemVo)
|
||||
{
|
||||
if(value is EquipVo)
|
||||
{
|
||||
text_num.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_num.visible = true;
|
||||
text_num.text = value.num.toString();
|
||||
}
|
||||
rank = int(value.quality);
|
||||
imgsrc = value.imgsrc;
|
||||
name = ItemVo.getName(value.type);
|
||||
des = value.des;
|
||||
}
|
||||
else if(value is RewardShowVo)
|
||||
{
|
||||
imgsrc = (value as RewardShowVo).imgsrc;
|
||||
rank = int(value.quality);
|
||||
name = value.name;
|
||||
text_num.visible = true;
|
||||
text_num.text = value.number;
|
||||
des = name;
|
||||
}
|
||||
if(desTipMode)
|
||||
{
|
||||
TipCenter.registTextTip(this,des.length > 30 ? des + "<br/>" : des,9);
|
||||
}
|
||||
else if(text_num.visible)
|
||||
{
|
||||
TipCenter.registTextTip(this,name + "*" + text_num.text,9);
|
||||
}
|
||||
else
|
||||
{
|
||||
TipCenter.registTextTip(this,name,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,132 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.utils.Oncer;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ItemTip extends UIComponent
|
||||
{
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var btn_sell:PiLightButton;
|
||||
|
||||
public var btn_use:PiLightButton;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_des:TextField;
|
||||
|
||||
public var centerx:int = 71;
|
||||
|
||||
public var x1:int;
|
||||
|
||||
public var x2:int;
|
||||
|
||||
public function ItemTip(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.ItemTipUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
public static function getIns() : ItemTip
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(ItemTip) as ItemTip;
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
x1 = btn_sell.x;
|
||||
x2 = btn_use.x;
|
||||
text_name.scaleMode = true;
|
||||
}
|
||||
|
||||
public function onData(data:Object) : void
|
||||
{
|
||||
var item:ItemVo = null;
|
||||
var egg:EggVo = null;
|
||||
if(data is ItemVo)
|
||||
{
|
||||
item = data as ItemVo;
|
||||
container_img.loadNetBitImg(item.imgsrc);
|
||||
btn_sell.visible = item.sellable;
|
||||
btn_use.visible = item.useable;
|
||||
text_des.htmlText = item.desWithFrom;
|
||||
if(item.bz.indexOf("useLevel:") == 0)
|
||||
{
|
||||
text_des.htmlText = Paster.font("使用等级限制:" + item.bz.split(":")[1],"#ef21b5",18,true) + "<br/>" + text_des.htmlText;
|
||||
}
|
||||
text_name.text = item.name;
|
||||
if(item.sellable != item.useable)
|
||||
{
|
||||
btn_use.x = btn_sell.x = centerx;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_sell.x = x1;
|
||||
btn_use.x = x2;
|
||||
}
|
||||
}
|
||||
else if(data is EggVo)
|
||||
{
|
||||
egg = data as EggVo;
|
||||
btn_use.visible = false;
|
||||
btn_sell.visible = true;
|
||||
text_name.text = egg.name;
|
||||
text_des.text = egg.des;
|
||||
btn_use.x = btn_sell.x = centerx;
|
||||
}
|
||||
}
|
||||
|
||||
public function showOn(displayObject:DisplayObject, clickHide:Boolean = true) : void
|
||||
{
|
||||
var rec:Rectangle = displayObject.getRect(StageDriver.stage);
|
||||
this.x = rec.x + rec.width / 2;
|
||||
this.y = rec.y + rec.height / 2;
|
||||
StageDriver.keepInStage(this,20);
|
||||
if(clickHide)
|
||||
{
|
||||
Oncer.lastRun(StageDriver.stage.addEventListener,[MobiEvent.CLICK,clickHandler]);
|
||||
}
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
if(this.parent != null)
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
public function breakHandler() : void
|
||||
{
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
container_img.reset();
|
||||
}
|
||||
|
||||
public function showOut() : void
|
||||
{
|
||||
clickHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class SellItemPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:SellItemPanelUI = new SellItemPanelUI();
|
||||
|
||||
public var cur:ItemVo;
|
||||
|
||||
public function SellItemPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(0,0);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_sell.onClick(yesHandler);
|
||||
ui.slider_num.img_icon.mouseChildren = ui.slider_num.img_icon.mouseEnabled = true;
|
||||
}
|
||||
|
||||
public static function getIns() : SellItemPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(SellItemPanel) as SellItemPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
cur = null;
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function yesHandler(e:Event = null) : void
|
||||
{
|
||||
BagCenter.getIns().sell(cur.id,int(ui.text_num.text),true);
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
public function sellItem(item:ItemVo) : void
|
||||
{
|
||||
cur = item;
|
||||
ui.container_img.loadNetBitImg(item.imgsrc);
|
||||
ui.text_name.text = item.name;
|
||||
ui.slider_num.setValue(0);
|
||||
if(item.num == 1)
|
||||
{
|
||||
ui.slider_num.img_icon.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.slider_num.img_icon.visible = true;
|
||||
}
|
||||
ui.slider_num.addEventListener("pislide",updateNum);
|
||||
ui.text_num.text = ui.slider_num.getValue(1,item.num).toString();
|
||||
updateNum(null,true);
|
||||
}
|
||||
|
||||
public function updateNum(e:Event = null, force:Boolean = false) : void
|
||||
{
|
||||
var cnum:int = ui.slider_num.getInt(1,cur.num);
|
||||
if(force || cnum.toString() != ui.text_num.text)
|
||||
{
|
||||
ui.text_num.text = cnum.toString();
|
||||
ui.text_money.text = "×" + (cnum * cur.sellMoney).toString();
|
||||
}
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
super.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderRect;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class SellItemPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_name:TextField;
|
||||
|
||||
public var text_money:TextField;
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_sell:PiLightButton;
|
||||
|
||||
public var slider_num:PiSliderRect;
|
||||
|
||||
public function SellItemPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.SellItemPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.ShopCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.panel.exchange.ExchangePanel;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class UseItemPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:UseItemPanelUI = new UseItemPanelUI();
|
||||
|
||||
public var cur:ItemVo;
|
||||
|
||||
public var modeNum:Boolean = false;
|
||||
|
||||
public var onModeNumComplete:Function;
|
||||
|
||||
public var onModeNumChange:Function;
|
||||
|
||||
public var maxNum:int = -1;
|
||||
|
||||
public function UseItemPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_yes.onClick(yesHandler);
|
||||
ui.slider_num.img_icon.mouseChildren = ui.slider_num.img_icon.mouseEnabled = true;
|
||||
}
|
||||
|
||||
public static function getIns() : UseItemPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(UseItemPanel) as UseItemPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function useItem(item:ItemVo, modeNum:Boolean = false, maxNum:int = -1, onModeNumChange:Function = null, onModeNumComplete:* = null, normalValue:Number = 0) : void
|
||||
{
|
||||
this.modeNum = modeNum;
|
||||
cur = item;
|
||||
ui.container_img.loadNetBitImg(item.imgsrc);
|
||||
ui.text_name.text = item.name;
|
||||
ui.text_msg.text = "";
|
||||
this.onModeNumChange = onModeNumChange;
|
||||
this.onModeNumComplete = onModeNumComplete;
|
||||
ui.slider_num.setValue(normalValue);
|
||||
ui.slider_num.addEventListener("pislide",updateNum);
|
||||
if(maxNum == -1)
|
||||
{
|
||||
maxNum = item.num;
|
||||
}
|
||||
this.maxNum = maxNum;
|
||||
if(item.para != null && item.para.action == "getSkin")
|
||||
{
|
||||
if(Master.history.unlockSkins.indexOf(int(item.para.skinType)) == -1)
|
||||
{
|
||||
this.maxNum = 1;
|
||||
}
|
||||
}
|
||||
if(item.para != null && item.para.action == "exchange")
|
||||
{
|
||||
this.maxNum = 1;
|
||||
}
|
||||
if(this.maxNum == 1)
|
||||
{
|
||||
ui.slider_num.img_icon.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.slider_num.img_icon.visible = true;
|
||||
}
|
||||
if(item.hasOwnProperty("delayDay") && item.delayDay > 0 && Master.passDay < item.delayDay)
|
||||
{
|
||||
ui.text_msg.text = lang("{0}天后可使用",(item.delayDay - Master.passDay).toString());
|
||||
ui.btn_yes.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_yes.visible = true;
|
||||
}
|
||||
ui.text_num.text = ui.slider_num.getValue(1,maxNum).toString();
|
||||
updateNum(null,true);
|
||||
}
|
||||
|
||||
public function yesHandler(e:Event = null) : void
|
||||
{
|
||||
var yc:int = 0;
|
||||
if(modeNum)
|
||||
{
|
||||
if(onModeNumComplete != null)
|
||||
{
|
||||
onModeNumComplete(int(ui.text_num.text));
|
||||
onModeNumComplete = null;
|
||||
onModeNumChange = null;
|
||||
}
|
||||
this.showOut();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(cur.para.action == "exchange")
|
||||
{
|
||||
ExchangePanel.getIns().popInExchange(cur.para.team);
|
||||
useHandler();
|
||||
return;
|
||||
}
|
||||
if(cur.para != null && cur.para.action == "getSkin")
|
||||
{
|
||||
if(Master.history.unlockSkins.indexOf(int(cur.para.skinType)) != -1)
|
||||
{
|
||||
if(Table.exchange_info["99" + cur.type.toString()] == null)
|
||||
{
|
||||
Alert.showMsg("can\'t find " + cur.type + " skin itemExchange!");
|
||||
useHandler();
|
||||
return;
|
||||
}
|
||||
ShopCenter.getIns().exchangeItem("99" + cur.type.toString(),int(ui.text_num.text),sellSkinHandler,true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(cur.para != null && cur.para.ti != null && cur.para.ti > 0 && Master.ti + cur.para.ti * int(ui.text_num.text) > 999)
|
||||
{
|
||||
yc = Master.ti + cur.para.ti * int(ui.text_num.text) - 999;
|
||||
Alert.yesno(lang("提示"),lang("体力最高上限为:{0},使用后将造成体力溢出:{1},确认要使用吗?",CP.ti("999"),CP.ti(yc.toString())),confirmHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
BagCenter.getIns().useItem(cur.id,int(ui.text_num.text),useHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function confirmHandler(e:Event = null) : void
|
||||
{
|
||||
BagCenter.getIns().useItem(cur.id,int(ui.text_num.text),useHandler);
|
||||
}
|
||||
|
||||
public function useHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
public function sellSkinHandler(o:Object = null) : void
|
||||
{
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.ITEM_NUM_CHANGE,cur));
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
public function updateNum(e:Event = null, force:Boolean = false) : void
|
||||
{
|
||||
var cnum:int = ui.slider_num.getInt(1,maxNum);
|
||||
if(force || cnum.toString() != ui.text_num.text)
|
||||
{
|
||||
ui.text_num.text = cnum.toString();
|
||||
if(onModeNumChange != null)
|
||||
{
|
||||
onModeNumChange(cnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
super.showOut();
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
cur = null;
|
||||
onModeNumComplete = null;
|
||||
onModeNumChange = null;
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package net.pixvi.myr.panel.bag
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderRect;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class UseItemPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_yes:PiLightButton;
|
||||
|
||||
public var slider_num:PiSliderRect;
|
||||
|
||||
public var text_msg:TextField;
|
||||
|
||||
public function UseItemPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.UseItemPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_name.scaleMode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.effect.effects.JumpToNumEffect;
|
||||
import net.pixvi.myr.battle.BattleModeType;
|
||||
import net.pixvi.myr.center.GuideCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MasterCenter;
|
||||
import net.pixvi.myr.center.TaskCenter;
|
||||
import net.pixvi.myr.element.battle.BattleVo;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.reward.RewardShowVo;
|
||||
import net.pixvi.myr.element.reward.RewardType;
|
||||
import net.pixvi.myr.panel.boss.BossStagePanel;
|
||||
import net.pixvi.myr.panel.reward.RewardShowPanel;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class BattleOverPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:BattleOverPanelUI = new BattleOverPanelUI();
|
||||
|
||||
public var iswin:Boolean;
|
||||
|
||||
public var onComplete:Function;
|
||||
|
||||
public var reward:Array;
|
||||
|
||||
public var expRewards:Array;
|
||||
|
||||
private var monListShowFlag:int = 0;
|
||||
|
||||
public function BattleOverPanel()
|
||||
{
|
||||
addChild(ui);
|
||||
PopCenter.getIns().setMaskAlpha(0);
|
||||
super(0.5);
|
||||
}
|
||||
|
||||
public static function getIns() : BattleOverPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BattleOverPanel) as BattleOverPanel;
|
||||
}
|
||||
|
||||
public function win() : void
|
||||
{
|
||||
ui.mc_continue.alpha = 0;
|
||||
TweenMax.from(ui.mc_win,1,{"alpha":0});
|
||||
TweenMax.fromTo(ui.ui_reward,1,{"alpha":0},{
|
||||
"alpha":1,
|
||||
"onComplete":showTouch
|
||||
});
|
||||
ui.mc_win.visible = ui.ui_reward.visible = true;
|
||||
ui.mc_win.gotoAndPlay(1);
|
||||
ui.ui_reward.text_money.text = "0";
|
||||
ui.ui_reward.text_exp.text = "0";
|
||||
ui.list_mon.setDatas(expRewards);
|
||||
ui.centerList();
|
||||
monListShowFlag = 0;
|
||||
var curbattle:BattleVo = BattlePanel.getIns().battle;
|
||||
if(curbattle.battleMode == BattleModeType.PVE)
|
||||
{
|
||||
ui.text_bossPoint.visible = false;
|
||||
ui.ui_reward.visible = ui.list_mon.visible = false;
|
||||
}
|
||||
else if(curbattle.battleMode == BattleModeType.BOSS)
|
||||
{
|
||||
TweenMax.fromTo(ui.text_bossPoint,0.5,{
|
||||
"alpha":0,
|
||||
"y":ui.text_bossPoint.y - 50
|
||||
},{
|
||||
"alpha":1,
|
||||
"y":ui.text_bossPoint.y,
|
||||
"delay":1
|
||||
});
|
||||
ui.text_bossPoint.visible = true;
|
||||
ui.text_bossPoint.htmlText = BossStagePanel.getIns().curVo.getDamageMsg(BattlePanel.battleData.bossDamage);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_bossPoint.visible = false;
|
||||
ui.ui_reward.visible = ui.list_mon.visible = true;
|
||||
monListShow();
|
||||
new JumpToNumEffect(1000,BattlePanel.getIns().battle.reward.money).startEffect(ui.ui_reward.text_money);
|
||||
new JumpToNumEffect(1000,BattlePanel.getIns().battle.reward.exp).startEffect(ui.ui_reward.text_exp);
|
||||
}
|
||||
}
|
||||
|
||||
public function winForSaodang(money:int, exp:int) : void
|
||||
{
|
||||
ui.mc_continue.alpha = 0;
|
||||
TweenMax.from(ui.mc_win,1,{"alpha":0});
|
||||
TweenMax.fromTo(ui.ui_reward,1,{"alpha":0},{
|
||||
"alpha":1,
|
||||
"onComplete":showTouch
|
||||
});
|
||||
ui.mc_win.visible = ui.ui_reward.visible = true;
|
||||
ui.mc_win.gotoAndPlay(1);
|
||||
ui.ui_reward.text_money.text = "0";
|
||||
ui.ui_reward.text_exp.text = "0";
|
||||
ui.list_mon.setDatas(expRewards);
|
||||
ui.centerList();
|
||||
monListShowFlag = 0;
|
||||
ui.text_bossPoint.visible = false;
|
||||
ui.ui_reward.visible = ui.list_mon.visible = true;
|
||||
monListShow();
|
||||
new JumpToNumEffect(1000,money).startEffect(ui.ui_reward.text_money);
|
||||
new JumpToNumEffect(1000,exp).startEffect(ui.ui_reward.text_exp);
|
||||
}
|
||||
|
||||
private function monListShow() : void
|
||||
{
|
||||
if(ui.list_mon.itemArray.length > monListShowFlag && ui.list_mon.itemArray[monListShowFlag].visible)
|
||||
{
|
||||
(ui.list_mon.itemArray[monListShowFlag] as MonExpListItem).showFlash();
|
||||
Caller.delayCall(monListShow,150);
|
||||
monListShowFlag++;
|
||||
}
|
||||
}
|
||||
|
||||
public function showTouch() : void
|
||||
{
|
||||
ui.mc_continue.visible = true;
|
||||
TweenMax.to(ui.mc_continue,0.3,{"alpha":1});
|
||||
StageDriver.stage.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function showover(e:Event = null) : void
|
||||
{
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
if(onComplete != null)
|
||||
{
|
||||
onComplete();
|
||||
onComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
if(PopCenter.getIns().topPanel != this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ui.mc_continue.visible = false;
|
||||
if(reward != null)
|
||||
{
|
||||
for(i = 0; i < reward.length; )
|
||||
{
|
||||
if(reward[i] is RewardShowVo && ((reward[i] as RewardShowVo).rewardType == RewardType.EXP || (reward[i] as RewardShowVo).rewardType == RewardType.MONEY))
|
||||
{
|
||||
reward.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if(reward != null && reward.length > 0)
|
||||
{
|
||||
RewardShowPanel.show(reward,showover);
|
||||
}
|
||||
else
|
||||
{
|
||||
MasterCenter.getIns().autoCheckLevelUp(true,showover);
|
||||
}
|
||||
}
|
||||
|
||||
public function lose() : void
|
||||
{
|
||||
ui.mc_continue.alpha = 0;
|
||||
TweenMax.from(ui.mc_lose,1,{
|
||||
"alpha":0,
|
||||
"onComplete":showTouch
|
||||
});
|
||||
if(Master.history.guide_record[GSub.FIRST_FAIL] == null && Master.history.passTask["2001001"] == null)
|
||||
{
|
||||
TaskCenter.getIns().receiveTask("2001001",true,receiveFailTask);
|
||||
}
|
||||
else if(BattlePanel.getIns().battlePosition != null && Master.history.guide_record[GSub.MINE_FAIL] == null && ((BattlePanel.getIns().battlePosition.stageId == "0109" || BattlePanel.getIns().battlePosition.stageId == "0108") && BattlePanel.getIns().battlePosition.stageLevel == "1" || BattlePanel.getIns().battlePosition.taskTypeId == "1001007"))
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.MINE_FAIL);
|
||||
}
|
||||
ui.ui_reward.text_money.text = "";
|
||||
ui.ui_reward.text_exp.text = "";
|
||||
ui.mc_lose.visible = true;
|
||||
ui.mc_lose.gotoAndPlay(1);
|
||||
ui.ui_reward.visible = false;
|
||||
}
|
||||
|
||||
private function receiveFailTask() : void
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.FIRST_FAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
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.PiDataList;
|
||||
|
||||
public class BattleOverPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_win:MovieClip;
|
||||
|
||||
public var mc_lose:MovieClip;
|
||||
|
||||
public var ui_reward:BattleOverRewardUI;
|
||||
|
||||
public var mc_continue:Sprite;
|
||||
|
||||
public var list_mon:PiDataList;
|
||||
|
||||
public var text_bossPoint:TextField;
|
||||
|
||||
public function BattleOverPanelUI(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
if(skin == null)
|
||||
{
|
||||
skin = FF.getMC("ui.BattleOverPanelUI");
|
||||
}
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
list_mon.itemClass = MonExpListItem;
|
||||
mc_lose.visible = mc_win.visible = false;
|
||||
mc_win.stop();
|
||||
mc_lose.stop();
|
||||
}
|
||||
|
||||
public function centerList() : void
|
||||
{
|
||||
list_mon.autoCenterItems(630,95,7,90,100,0,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
|
||||
public class BattleOverRewardUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_money:TextField;
|
||||
|
||||
public var text_exp:TextField;
|
||||
|
||||
public function BattleOverRewardUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,560 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.driver.ActivityDriver;
|
||||
import net.pixvi.common.driver.SecondDriver;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.manager.resource.RM;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.GameSetting;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.battle.BattleModeType;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.center.AchiCenter;
|
||||
import net.pixvi.myr.center.GuideCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.center.RewardCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.achi.AchiType;
|
||||
import net.pixvi.myr.element.battle.BattleData;
|
||||
import net.pixvi.myr.element.battle.BattleMonVo;
|
||||
import net.pixvi.myr.element.battle.BattlePosition;
|
||||
import net.pixvi.myr.element.battle.BattleTeamVo;
|
||||
import net.pixvi.myr.element.battle.BattleVo;
|
||||
import net.pixvi.myr.element.guide.GMain;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetBattle;
|
||||
import net.pixvi.myr.panel.boss.BossStagePanel;
|
||||
import net.pixvi.myr.panel.help.BattleGuidePanel;
|
||||
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;
|
||||
import net.pixvi.psg.utils.Blacker;
|
||||
|
||||
public class BattlePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var battleData:BattleData;
|
||||
|
||||
public static var autoMIDCount:int = 0;
|
||||
|
||||
public var battle:BattleVo;
|
||||
|
||||
public var ground:BattleGround;
|
||||
|
||||
public var onComplete:Function;
|
||||
|
||||
public var onBattleShowResult:Function;
|
||||
|
||||
public var readyStart:Boolean = true;
|
||||
|
||||
public var battlePosition:BattlePosition;
|
||||
|
||||
public var onWinCallBack:Function;
|
||||
|
||||
public var onLoseCallBack:Function;
|
||||
|
||||
public var battleMode:int = 0;
|
||||
|
||||
private var battleAutoStartSecond:int = 0;
|
||||
|
||||
private var a_needResume:Boolean = false;
|
||||
|
||||
public function BattlePanel()
|
||||
{
|
||||
buffMode = false;
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : BattlePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BattlePanel) as BattlePanel;
|
||||
}
|
||||
|
||||
public static function getT() : Cooldowner
|
||||
{
|
||||
return getIns().ground.battleTime;
|
||||
}
|
||||
|
||||
public static function getTempMID() : int
|
||||
{
|
||||
autoMIDCount++;
|
||||
return 100 + autoMIDCount;
|
||||
}
|
||||
|
||||
public function startBuild() : void
|
||||
{
|
||||
var battleTeam:BattleTeamVo = null;
|
||||
var i:int = 0;
|
||||
var battleMon:BattleMon = null;
|
||||
Alert.pauseMsg();
|
||||
if(BattleGround.line == null)
|
||||
{
|
||||
BattleGround.firstStartUp();
|
||||
}
|
||||
ground = new BattleGround();
|
||||
ground.init(battle);
|
||||
ground.loadMovies();
|
||||
addChild(ground);
|
||||
addChild(ground.ui.ui_bottom);
|
||||
addChild(ground.ui.ui_top);
|
||||
addChild(ground.ui.ui_top.btn_pause);
|
||||
ImgCenter.addFsMask(this,"fs2");
|
||||
ground.ui.ui_top.btn_pause.onClick(btnPauseHandler);
|
||||
battleData = new BattleData();
|
||||
battleData.battlePosition = battlePosition;
|
||||
battleData.battleMonIds = [];
|
||||
if(!battle.hideTeamMon)
|
||||
{
|
||||
battleTeam = battle.getTeam(1);
|
||||
for(i = 0; i < battleTeam.mons.length; )
|
||||
{
|
||||
battleMon = battleTeam.mons[i];
|
||||
if(battleMon.monVo.from == "master")
|
||||
{
|
||||
battleData.battleMonIds.push(battleMon.monVo.mid);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
BattleGround.mc_startMov.gotoAndStop(1);
|
||||
BattleGround.mc_startMov.stop();
|
||||
}
|
||||
|
||||
public function btnPauseHandler(e:Event = null) : void
|
||||
{
|
||||
if(ground.battlePauseHandler())
|
||||
{
|
||||
ActivityDriver.getIns().remove(activity,deactivity);
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public function btnResumeHandler(e:Event = null) : void
|
||||
{
|
||||
ActivityDriver.getIns().regist(activity,deactivity);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
btnPauseHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function battleStartReady() : void
|
||||
{
|
||||
SoundCenter.getIns().bgmPlay(battle.battleBgm());
|
||||
addChild(BattleGround.mc_startMov);
|
||||
StageDriver.setCenter(BattleGround.mc_startMov);
|
||||
BattleGround.mc_startMov.play();
|
||||
BattleGround.mc_startMov.addEventListener("complete",battleStartMovCompleteHandler);
|
||||
BattleGround.mc_startMov.addEventListener("showTip",battleStartMovTipHandler);
|
||||
StageDriver.stage.addEventListener(MobiEvent.CLICK,startMovTouchHandler);
|
||||
ActivityDriver.getIns().regist(activity,deactivity);
|
||||
battleAutoStartSecond = GameSetting.BattleStartCD;
|
||||
SecondDriver.getIns().regist(battleAutoStartSecondHandler);
|
||||
}
|
||||
|
||||
private function battleAutoStartSecondHandler(e:Event = null) : void
|
||||
{
|
||||
battleAutoStartSecond--;
|
||||
if(battleAutoStartSecond <= 0)
|
||||
{
|
||||
startMovTouchHandler();
|
||||
}
|
||||
else
|
||||
{
|
||||
BattleGround.ui_battleTip.text_countDown.text = battleAutoStartSecond.toString();
|
||||
}
|
||||
}
|
||||
|
||||
private function battleStartMovTipHandler(e:Event) : void
|
||||
{
|
||||
BattleGround.ui_battleTip.showType(battle);
|
||||
BattleGround.ui_battleTip.alpha = 0;
|
||||
addChild(BattleGround.ui_battleTip);
|
||||
TweenMax.to(BattleGround.ui_battleTip,0.4,{"alpha":1});
|
||||
}
|
||||
|
||||
private function activity() : void
|
||||
{
|
||||
if(a_needResume && !readyStart)
|
||||
{
|
||||
a_needResume = false;
|
||||
ground.resume();
|
||||
}
|
||||
}
|
||||
|
||||
public function startMovTouchHandler(e:Event = null) : void
|
||||
{
|
||||
if(!BattleGround.mc_startMov.isPlaying)
|
||||
{
|
||||
TweenMax.to(BattleGround.ui_battleTip,0,{
|
||||
"alpha":1,
|
||||
"onComplete":BattleGround.ui_battleTip.removeFromStage
|
||||
});
|
||||
SecondDriver.getIns().remove(battleAutoStartSecondHandler);
|
||||
StageDriver.stage.removeEventListener(MobiEvent.CLICK,startMovTouchHandler);
|
||||
BattleGround.mc_startMov.play();
|
||||
}
|
||||
}
|
||||
|
||||
private function deactivity() : void
|
||||
{
|
||||
if(!ground.paused)
|
||||
{
|
||||
a_needResume = true;
|
||||
ground.pause();
|
||||
}
|
||||
}
|
||||
|
||||
private function battleStartMovCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
var p:BattleGuidePanel = null;
|
||||
p = null;
|
||||
readyStart = false;
|
||||
BattleGround.mc_startMov.stop();
|
||||
removeChild(BattleGround.mc_startMov);
|
||||
BattleGround.mc_startMov.stop();
|
||||
BattleGround.mc_startMov.removeEventListener("complete",battleStartMovCompleteHandler);
|
||||
ground.battleStart(battleCompleteHandler);
|
||||
if(GuideCenter.getIns().checkCur(GMain.battleTeach))
|
||||
{
|
||||
ground.pause();
|
||||
p = new BattleGuidePanel();
|
||||
PopCenter.POP(p);
|
||||
p.onComplete = ground.resume;
|
||||
ground.ui.ui_top.btn_pause.enabled = false;
|
||||
}
|
||||
else if(battle.rollmapMode && !GuideCenter.getIns().checkFin(GMain.battleTeach2))
|
||||
{
|
||||
ground.pause();
|
||||
p = new BattleGuidePanel("2");
|
||||
PopCenter.POP(p);
|
||||
p.onComplete = ground.resume;
|
||||
ground.ui.ui_top.btn_pause.enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ground.ui.ui_top.btn_pause.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCheckPack() : Object
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
public function battleCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
autoMIDCount = 0;
|
||||
Alert.resumeMsg();
|
||||
ActivityDriver.getIns().remove(activity,deactivity);
|
||||
cheatCheck();
|
||||
var myteamvo:BattleTeamVo = ground.vo.teamDic["1"] as BattleTeamVo;
|
||||
battleData.leftTime = ground.battleTime.leftTime;
|
||||
battleData.apLeft = myteamvo.ap;
|
||||
battleData.aliveNum = myteamvo.getAliveNum();
|
||||
if(battleMode == BattleModeType.BOSS)
|
||||
{
|
||||
battleData.win = true;
|
||||
if(battleData.bossDamage > BossStagePanel.getIns().curVo.maxDamage)
|
||||
{
|
||||
battleData.bossDamage = BossStagePanel.getIns().curVo.maxDamage;
|
||||
}
|
||||
if(BossStagePanel.getIns().curVo.currentHp <= 0)
|
||||
{
|
||||
battleData.bossDamage = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
battleData.win = ground.winnerTeam == 1;
|
||||
}
|
||||
battleData.killMonster = ground.battleRecords.killMons;
|
||||
battleData.bossDamage = ground.battleRecords.bossPoint.val;
|
||||
if(battleMode == BattleModeType.BOSS && BossStagePanel.getIns().curVo.currentHp <= 0)
|
||||
{
|
||||
battleData.bossDamage = 0;
|
||||
}
|
||||
if(battleData.win)
|
||||
{
|
||||
if(onWinCallBack != null)
|
||||
{
|
||||
onWinCallBack(battleData);
|
||||
onWinCallBack = null;
|
||||
}
|
||||
}
|
||||
else if(onLoseCallBack != null)
|
||||
{
|
||||
onLoseCallBack(battleData);
|
||||
onLoseCallBack = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
showLose();
|
||||
}
|
||||
}
|
||||
|
||||
private function cheatCheck() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var checkmon:BattleMon = null;
|
||||
var montable:Object = null;
|
||||
var skillCheckResult:String = null;
|
||||
var checktable:Object = null;
|
||||
var checktable2:Object = null;
|
||||
var pdata:Object = null;
|
||||
var maxPara:int = 0;
|
||||
var targetPara:int = 0;
|
||||
var maxLevel:int = 0;
|
||||
var realmon:BattleMonVo = null;
|
||||
var cheat:int = 0;
|
||||
var battleteam:BattleTeamVo = ground.vo.teamDic[1];
|
||||
var mons:Array = battleteam.mons.concat(battleteam.deadMons.concat(battleteam.stageMons));
|
||||
var monster_info:Object = RM.TXT.getJson("monster_info").datas;
|
||||
var checkPara:Array = ["atk","def","dex","hp"];
|
||||
if(battleMode == BattleModeType.PVE)
|
||||
{
|
||||
checkPara.pop();
|
||||
}
|
||||
var skillTable:Object = RM.TXT.getJson("monster_skill").datas;
|
||||
var settingTable:Object = RM.TXT.getJson("game_setting");
|
||||
var settingCheckResult:String = "";
|
||||
for(var key:String in settingTable)
|
||||
{
|
||||
if(Table.game_setting[key] is Number && Math.abs(Table.game_setting[key] - settingTable[key]) > 0.001)
|
||||
{
|
||||
battleData.cheatNum += 41;
|
||||
settingCheckResult += "_" + key + "_o" + settingTable[key] + "!=" + Table.game_setting[key];
|
||||
}
|
||||
}
|
||||
if(settingCheckResult != "")
|
||||
{
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+41SettingTable_" + settingCheckResult);
|
||||
}
|
||||
if(battleMode == BattleModeType.BOSS && BattlePanel.battleData.bossDamage > BossStagePanel.getIns().curVo.maxDamage * 1.2)
|
||||
{
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+1BossOverDamage_" + BattlePanel.battleData.bossDamage + "_" + BossStagePanel.getIns().curVo.maxDamage);
|
||||
}
|
||||
for(i = 0; i < mons.length; )
|
||||
{
|
||||
checkmon = mons[i];
|
||||
montable = monster_info[checkmon.vo.type];
|
||||
skillCheckResult = "";
|
||||
if(checkmon.skill_1 != null && checkmon.skill_1.type != 223 && checkmon.skill_1.type != 57 && checkmon.skill_1.type != 229)
|
||||
{
|
||||
checktable = skillTable[checkmon.skill_1.type]["lv" + checkmon.skill_1.lv].para;
|
||||
for(key in checktable)
|
||||
{
|
||||
if(!(checkmon.skill_1.para[key] is Array) && checktable[key] != checkmon.skill_1.para[key])
|
||||
{
|
||||
skillCheckResult += "+41skillTable_" + checkmon.skill_1.type + "_" + key + "_o" + checktable[key] + "!=" + checkmon.skill_1.para[key];
|
||||
battleData.cheatNum += 41;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(checkmon.skill_2 != null && checkmon.skill_2.type != 223 && checkmon.skill_2.type != 57)
|
||||
{
|
||||
checktable2 = skillTable[checkmon.skill_2.type]["lv" + checkmon.skill_2.lv].para;
|
||||
for(key in checktable2)
|
||||
{
|
||||
if(!(checkmon.skill_2.para[key] is Array) && checktable2[key] != checkmon.skill_2.para[key])
|
||||
{
|
||||
skillCheckResult += "+41skillTable_" + checkmon.skill_2.type + "_" + key + "_o" + checktable2[key] + "!=" + checkmon.skill_2.para[key];
|
||||
battleData.cheatNum += 41;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(skillCheckResult != "")
|
||||
{
|
||||
BattlePanel.battleData.cheatRecords.addRecord(skillCheckResult);
|
||||
}
|
||||
if(!(checkmon.monVo.summonUnit || checkmon.monVo.isObject || checkmon.mid < 99999))
|
||||
{
|
||||
if(checkmon.vo.feel > 200)
|
||||
{
|
||||
battleData.cheatNum += 50;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+15overfeel");
|
||||
}
|
||||
for each(var para:String in checkPara)
|
||||
{
|
||||
if(monster_info[checkmon.vo.type][para] != checkmon.vo.table()[para])
|
||||
{
|
||||
battleData.cheatNum += 15;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+15overbase");
|
||||
}
|
||||
if(checkmon.monVo[para] > montable[para] + montable[para + "_grow_max"] * (checkmon.monVo.level + checkmon.vo.potentialLevel) * 4)
|
||||
{
|
||||
battleData.cheatNum += 25;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+15overgrow" + checkmon.mid);
|
||||
}
|
||||
pdata = Table.potential_info.potential[checkmon.vo.job][checkmon.vo.star];
|
||||
maxPara = pdata[para] + pdata[para + "TpAdd"] * checkmon.vo.tplevel;
|
||||
targetPara = int(checkmon.vo["potential_" + para]);
|
||||
if(targetPara > maxPara * 1.5)
|
||||
{
|
||||
battleData.cheatNum += 30;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+15overpoten");
|
||||
}
|
||||
}
|
||||
maxLevel = GameMath.getMonMaxLevel(checkmon.vo.potentialLevel);
|
||||
if(checkmon.vo.level > maxLevel)
|
||||
{
|
||||
battleData.cheatNum += 50;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+50overlv");
|
||||
}
|
||||
realmon = MonsterCenter.getIns().getBattleMonVoByMid(checkmon.monVo.mid);
|
||||
cheat = realmon.checkCheat(checkmon.monVo);
|
||||
battleData.cheatRecords.mons.push(checkmon.makeRecord());
|
||||
battleData.cheatNum += cheat;
|
||||
BattlePanel.battleData.cheatRecords.addRecord("+" + cheat + "uneqmon" + checkmon.monVo.mid);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(battleData.cheatNum > 0)
|
||||
{
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
Alert.showMsg("battleData.cheatNum:" + battleData.cheatNum);
|
||||
}
|
||||
battleData.cheatRecords.master = Master.getRecords();
|
||||
}
|
||||
}
|
||||
|
||||
public function showLose(rewardResultVo:RewardResultVo = null) : void
|
||||
{
|
||||
var rewards:Array = null;
|
||||
BattleOverPanel.getIns().lose();
|
||||
showEnd();
|
||||
if(battlePosition != null && battlePosition.isStageBattle())
|
||||
{
|
||||
NetBattle.getIns().battleResult(battlePosition.getStageId(),false);
|
||||
}
|
||||
if(rewardResultVo != null)
|
||||
{
|
||||
rewards = rewardResultVo.getRewardShowArray();
|
||||
if(rewards.length > 0)
|
||||
{
|
||||
BattleOverPanel.getIns().reward = rewards;
|
||||
}
|
||||
RewardCenter.getIns().getReward(rewardResultVo);
|
||||
}
|
||||
}
|
||||
|
||||
public function showWin(reward:RewardResultVo, monsterExps:Array) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var expData:Object = null;
|
||||
var expRewardVo:ExpRewardVo = null;
|
||||
var rewards:Array = null;
|
||||
var monsterExpRewards:Array = [];
|
||||
if(monsterExps != null)
|
||||
{
|
||||
for(i = 0; i < monsterExps.length; )
|
||||
{
|
||||
expData = monsterExps[i];
|
||||
expRewardVo = new ExpRewardVo();
|
||||
expRewardVo.vo = MonsterCenter.getIns().getMonById(expData.monsterId);
|
||||
expRewardVo.oldLevel = expRewardVo.vo.level;
|
||||
expRewardVo.newLevel = expData.level;
|
||||
expRewardVo.levelUp = expData.level != expRewardVo.vo.level;
|
||||
expRewardVo.addExp = expData.exp - expRewardVo.vo.exp;
|
||||
expRewardVo.vo.exp = expData.exp;
|
||||
expRewardVo.vo.level = expData.level;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_NUM_CHANGE,{"mon":expRewardVo.vo}));
|
||||
monsterExpRewards.push(expRewardVo);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
BattleOverPanel.getIns().expRewards = monsterExpRewards;
|
||||
BattleOverPanel.getIns().win();
|
||||
SoundCenter.getIns().bgmStop();
|
||||
SoundCenter.getIns().play(GameSound.effect_battle_win);
|
||||
Master.history.countBattle++;
|
||||
for(var key:String in battleData.killMonster)
|
||||
{
|
||||
if(Master.history.numKillMonsters[key] == null)
|
||||
{
|
||||
Master.history.numKillMonsters[key] = 0;
|
||||
}
|
||||
var _loc9_:String = key;
|
||||
var _loc10_:Number = Master.history.numKillMonsters[_loc9_] + battleData.killMonster[key];
|
||||
Master.history.numKillMonsters[_loc9_] = _loc10_;
|
||||
}
|
||||
if(reward != null)
|
||||
{
|
||||
rewards = reward.getRewardShowArray();
|
||||
if(rewards.length > 0)
|
||||
{
|
||||
BattleOverPanel.getIns().reward = rewards;
|
||||
}
|
||||
RewardCenter.getIns().getReward(reward);
|
||||
}
|
||||
AchiCenter.getIns().autoCheck(AchiType.HUNTER);
|
||||
guide2();
|
||||
showEnd();
|
||||
if(battle.battleMode != BattleModeType.PVE && battlePosition != null && battlePosition.isStageBattle())
|
||||
{
|
||||
NetBattle.getIns().battleResult(battlePosition.getStageId(),true);
|
||||
}
|
||||
}
|
||||
|
||||
public function showEnd() : void
|
||||
{
|
||||
PopCenter.POP(BattleOverPanel.getIns());
|
||||
BattleOverPanel.getIns().onComplete = yesFinishGameHandler;
|
||||
if(onBattleShowResult != null)
|
||||
{
|
||||
onBattleShowResult(battleData.win);
|
||||
onBattleShowResult = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function yesFinishGameHandler(e:Event = null) : void
|
||||
{
|
||||
Blacker.getIns().show(finishGameShowComplete);
|
||||
}
|
||||
|
||||
public function finishGameShowComplete() : void
|
||||
{
|
||||
if(onComplete != null)
|
||||
{
|
||||
onComplete(battleData.win);
|
||||
onComplete = null;
|
||||
}
|
||||
battleData = null;
|
||||
BattleOverPanel.getIns().showOutAndRemove();
|
||||
this.showOutAndRemove();
|
||||
Blacker.getIns().hide();
|
||||
}
|
||||
|
||||
private function guide2() : void
|
||||
{
|
||||
if(GuideCenter.getIns().checkCur(GMain.battleTeach))
|
||||
{
|
||||
GuideCenter.getIns().fin();
|
||||
}
|
||||
else if(battle.rollmapMode && !GuideCenter.getIns().checkFin(GMain.battleTeach2))
|
||||
{
|
||||
GuideCenter.getIns().fin(GMain.battleTeach2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.gaooo.nano.center.GAoNano;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.center.Game;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class BattlePausePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:BattlePausePanelUI = new BattlePausePanelUI();
|
||||
|
||||
public function BattlePausePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.btn_bgm.onClick(bgmHandler);
|
||||
ui.btn_effect.onClick(effectHandler);
|
||||
ui.btn_escape.onClick(escapeHandler);
|
||||
ui.btn_continue.onClick(continueHandler);
|
||||
ui.btn_close.onClick(continueHandler);
|
||||
if(ui.btn_quickSkill != null)
|
||||
{
|
||||
ui.btn_quickSkill.onClick(quickSkillHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getIns() : BattlePausePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BattlePausePanel) as BattlePausePanel;
|
||||
}
|
||||
|
||||
public function quickSkillHandler(e:Event = null) : void
|
||||
{
|
||||
ui.btn_quickSkill.switchSelectStatus();
|
||||
Game.getIns().setting.quickSkill = ui.btn_quickSkill.selected;
|
||||
Game.getIns().saveSetting();
|
||||
BattleGround.getIns().quickSkill = ui.btn_quickSkill.selected;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
ui.btn_bgm.selected = Game.getIns().setting.openBgm;
|
||||
ui.btn_effect.selected = Game.getIns().setting.openEffect;
|
||||
update();
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
ui.btn_bgm.selected = Game.getIns().setting.openBgm;
|
||||
ui.btn_effect.selected = Game.getIns().setting.openEffect;
|
||||
if(ui.btn_quickSkill != null)
|
||||
{
|
||||
ui.btn_quickSkill.selected = Game.getIns().setting.quickSkill;
|
||||
}
|
||||
}
|
||||
|
||||
public function bgmHandler(e:Event = null) : void
|
||||
{
|
||||
ui.btn_bgm.switchSelectStatus();
|
||||
SoundCenter.getIns().setBgmEnable(ui.btn_bgm.selected);
|
||||
Game.getIns().setting.openBgm = ui.btn_bgm.selected;
|
||||
GAoNano.getIns().volume = Game.getIns().setting.openBgm ? Game.getIns().setting.globalVolume : 0;
|
||||
Game.getIns().saveSetting();
|
||||
}
|
||||
|
||||
public function effectHandler(e:Event = null) : void
|
||||
{
|
||||
ui.btn_effect.switchSelectStatus();
|
||||
SoundCenter.getIns().setEffectEnable(ui.btn_effect.selected);
|
||||
Game.getIns().setting.openEffect = ui.btn_effect.selected;
|
||||
Game.getIns().saveSetting();
|
||||
}
|
||||
|
||||
public function escapeHandler(e:Event = null) : void
|
||||
{
|
||||
Alert.yesno(lang("逃跑"),lang("逃跑将视作战斗失败,确认要逃走吗?"),yesEscapeHandler);
|
||||
}
|
||||
|
||||
public function yesEscapeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
BattleGround.getIns().run = true;
|
||||
BattleGround.getIns().checkGameOver();
|
||||
}
|
||||
|
||||
public function continueHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
PopCenter.getIns().setMaskAlpha(0);
|
||||
BattleGround.getIns().resume();
|
||||
BattlePanel.getIns().btnResumeHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BattlePausePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_escape:PiLightButton;
|
||||
|
||||
public var btn_continue:PiLightButton;
|
||||
|
||||
public var btn_bgm:PiLightButton;
|
||||
|
||||
public var btn_effect:PiLightButton;
|
||||
|
||||
public var btn_quickSkill:PiLightButton;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public function BattlePausePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.BattlePausePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
btn_effect.sound_click = GameSound.effect_click1;
|
||||
btn_bgm.sound_click = GameSound.effect_click1;
|
||||
btn_effect.sound_click = GameSound.effect_click1;
|
||||
btn_close.sound_click = GameSound.effect_click_close1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class BattleRecords
|
||||
{
|
||||
|
||||
public var killMons:Object;
|
||||
|
||||
public var bossPoint:PointLocker;
|
||||
|
||||
public function BattleRecords()
|
||||
{
|
||||
super();
|
||||
killMons = {};
|
||||
bossPoint = new PointLocker();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
|
||||
public class ExpRewardVo
|
||||
{
|
||||
|
||||
public var vo:MonsterVo;
|
||||
|
||||
public var addExp:int = 0;
|
||||
|
||||
public var levelUp:Boolean = false;
|
||||
|
||||
public var oldLevel:int = 0;
|
||||
|
||||
public var newLevel:int = 0;
|
||||
|
||||
public function ExpRewardVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package net.pixvi.myr.panel.battle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Back;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.EffectCenter;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.exchange.MonCardSmallUI;
|
||||
import net.pixvi.pfw.display.BitSprite;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
|
||||
public class MonExpListItem extends PiListItem
|
||||
{
|
||||
|
||||
public var ui_card:MonCardSmallUI;
|
||||
|
||||
public var text_exp:PiBitTextField;
|
||||
|
||||
public function MonExpListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var vo:ExpRewardVo = value as ExpRewardVo;
|
||||
ui_card.onData(vo.vo,false);
|
||||
ui_card.showLevel(vo.oldLevel);
|
||||
this.ui_card.visible = text_exp.visible = false;
|
||||
if(vo.addExp <= 0)
|
||||
{
|
||||
text_exp.text = "MAX";
|
||||
}
|
||||
else
|
||||
{
|
||||
text_exp.scaleMode = true;
|
||||
text_exp.text = "+" + vo.addExp + "EXP";
|
||||
}
|
||||
}
|
||||
|
||||
public function showFlash() : void
|
||||
{
|
||||
var bs:BitSprite = FF.getBS("mov.ItemFlash",false);
|
||||
ui_card.addChild(bs);
|
||||
TweenMax.fromTo(ui_card,0.2,{"alpha":0},{"alpha":1});
|
||||
this.ui_card.visible = text_exp.visible = true;
|
||||
TweenMax.fromTo(text_exp,0.4,{
|
||||
"y":40,
|
||||
"alpha":0
|
||||
},{
|
||||
"alpha":1,
|
||||
"y":0
|
||||
});
|
||||
TweenMax.to(bs,0.5,{
|
||||
"alpha":0,
|
||||
"ease":Back.easeIn,
|
||||
"onComplete":showFlashComplete
|
||||
});
|
||||
}
|
||||
|
||||
public function showFlashComplete() : void
|
||||
{
|
||||
var vo:ExpRewardVo = data as ExpRewardVo;
|
||||
if(vo.levelUp)
|
||||
{
|
||||
Caller.delayCall(levelUpShow,0.5);
|
||||
}
|
||||
}
|
||||
|
||||
public function levelUpShow() : void
|
||||
{
|
||||
var vo:ExpRewardVo = data as ExpRewardVo;
|
||||
SoundCenter.getIns().play(GameSound.effect_monLevelUp);
|
||||
text_exp.text = lang("等级提升");
|
||||
var p:Point = new Point();
|
||||
p = ui_card.localToGlobal(p);
|
||||
p.x += 45;
|
||||
p.y += 45;
|
||||
EffectCenter.open_effect(p.x,p.y,40,1.4,1.4);
|
||||
TweenMax.fromTo(text_exp,0.4,{
|
||||
"y":40,
|
||||
"alpha":0
|
||||
},{
|
||||
"alpha":1,
|
||||
"y":0
|
||||
});
|
||||
new FlashEffect(400,16777215).startEffect(this);
|
||||
ui_card.showLevel(vo.newLevel);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
Caller.stopCall(levelUpShow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.myr.center.BattleCenter;
|
||||
import net.pixvi.myr.center.BossCenter;
|
||||
import net.pixvi.myr.element.battle.BattleData;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
import net.pixvi.psg.utils.Blacker;
|
||||
|
||||
public class BossBattleStartPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
private var battleResult:BattleData;
|
||||
|
||||
public function BossBattleStartPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public function startBattle(e:Event = null) : void
|
||||
{
|
||||
BossCenter.getIns().startBoss(BossStagePanel.getIns().curVo.bossId,startBattleHandler);
|
||||
}
|
||||
|
||||
public function startBattleHandler() : void
|
||||
{
|
||||
Blacker.getIns().show(startBattleReady);
|
||||
}
|
||||
|
||||
public function startBattleReady() : void
|
||||
{
|
||||
BossStagePanel.getIns().showOut();
|
||||
BattleCenter.getIns().startBossBattle(BossStagePanel.getIns().curVo,battleComplete,battleOver);
|
||||
BattlePanel.getIns().onWinCallBack = battleWin;
|
||||
BattlePanel.getIns().onLoseCallBack = battleLose;
|
||||
MainMenu.getIns().onOut();
|
||||
Caller.delayCall(Blacker.getIns().hide,100,1,[BattlePanel.getIns().battleStartReady]);
|
||||
}
|
||||
|
||||
public function battleWin(result:BattleData) : void
|
||||
{
|
||||
BossCenter.getIns().endBoss(BossStagePanel.getIns().curVo.bossId,BattlePanel.battleData.bossDamage,BattlePanel.battleData,battleWinHandler);
|
||||
}
|
||||
|
||||
public function battleWinHandler(rewardResultVo:RewardResultVo) : void
|
||||
{
|
||||
BattlePanel.getIns().showWin(rewardResultVo,[]);
|
||||
}
|
||||
|
||||
public function battleLoseHandler(rewardResultVo:RewardResultVo) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function battleLose(result:BattleData) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function battleComplete(winOrLose:Boolean) : void
|
||||
{
|
||||
this.showOut();
|
||||
BossStagePanel.getIns().popIn();
|
||||
SoundCenter.getIns().bgmPlay(GameSound.bgm_farm);
|
||||
}
|
||||
|
||||
public function battleOver(winOrLose:Boolean) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.myr.element.cost.CostVo;
|
||||
import net.pixvi.myr.panel.task.ItemCardUI;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BossStageBottom1PanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_start:PiLightButton;
|
||||
|
||||
public var text_ti:TextField;
|
||||
|
||||
public var card_needItem:ItemCardUI;
|
||||
|
||||
public var text_leftNum:PiBitTextField;
|
||||
|
||||
public var mc_cd:Sprite;
|
||||
|
||||
public var text_cd:TextField;
|
||||
|
||||
private var prevNum:int = -1;
|
||||
|
||||
public function BossStageBottom1PanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_cd.visible = false;
|
||||
card_needItem.modeNeed = true;
|
||||
}
|
||||
|
||||
public function update(curvo:BossVo) : void
|
||||
{
|
||||
secondUpdate(curvo);
|
||||
if(curvo.getLeftNum() > 0)
|
||||
{
|
||||
btn_start.alpha = 1;
|
||||
btn_start.mouseChildren = btn_start.mouseEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_start.alpha = 0.5;
|
||||
btn_start.mouseChildren = btn_start.mouseEnabled = false;
|
||||
}
|
||||
text_ti.text = "×" + curvo.costTi().toString();
|
||||
var cost:CostVo = curvo.battleCost;
|
||||
var showarr:Array = cost.getShowArray(false,false,false);
|
||||
if(showarr.length > 0)
|
||||
{
|
||||
card_needItem.onItemByType(showarr[0].typeId,showarr[0].num);
|
||||
card_needItem.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
card_needItem.visible = false;
|
||||
}
|
||||
text_leftNum.text = lang("剩余次数:") + curvo.getLeftNum() + "/" + curvo.maxNum;
|
||||
}
|
||||
|
||||
public function secondUpdate(curvo:BossVo) : void
|
||||
{
|
||||
if(prevNum == -1 || prevNum != curvo.getLeftNum())
|
||||
{
|
||||
prevNum = curvo.getLeftNum();
|
||||
update(curvo);
|
||||
}
|
||||
if(curvo.getLeftNum() >= curvo.maxNum)
|
||||
{
|
||||
mc_cd.visible = text_cd.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_cd.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BossStageBottom2PanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_zhanzheng:PiLightButton;
|
||||
|
||||
public function BossStageBottom2PanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
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 BossStageCenterPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_hp:PiBitTextField;
|
||||
|
||||
public var mc_hpBoard:MovieClip;
|
||||
|
||||
public var mc_hpBar:MovieClip;
|
||||
|
||||
public var btn_reward:PiLightButton;
|
||||
|
||||
public var text_damage:TextField;
|
||||
|
||||
public var text_process:PiBitTextField;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public function BossStageCenterPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(390,370);
|
||||
text_hp.scaleMode = true;
|
||||
}
|
||||
|
||||
public function update(boss:BossVo, buffMov:Boolean = false) : void
|
||||
{
|
||||
text_hp.text = boss.showHp + "/" + boss.totalHp;
|
||||
if(container_img.imgSrc != boss.getImg())
|
||||
{
|
||||
container_img.loadNetBitImg(boss.getImg(),true,true,0);
|
||||
}
|
||||
if(buffMov == true)
|
||||
{
|
||||
if(mc_hpBar.currentFrame - 1 != boss.getShowMode())
|
||||
{
|
||||
trace(mc_hpBar.currentFrame,boss.getShowMode());
|
||||
new FlashEffect(900,16777215,1).startEffect(this);
|
||||
}
|
||||
}
|
||||
if(boss.isOver())
|
||||
{
|
||||
modeReward(boss);
|
||||
}
|
||||
else
|
||||
{
|
||||
modeMon();
|
||||
}
|
||||
text_damage.text = boss.pointMsg + boss.damage.toString();
|
||||
text_process.text = int((1 - boss.getShowHpScale()) * 100) + "%";
|
||||
mc_hpBar.scaleX = 1 - boss.getShowHpScale();
|
||||
mc_hpBar.gotoAndStop(boss.getShowMode() + 1);
|
||||
mc_hpBoard.gotoAndStop(boss.getShowMode() + 1);
|
||||
}
|
||||
|
||||
public function modeReward(boss:BossVo) : void
|
||||
{
|
||||
btn_reward.visible = true;
|
||||
if(boss.hasGetReward())
|
||||
{
|
||||
btn_reward.alpha = 0.5;
|
||||
btn_reward.mouseChildren = btn_reward.mouseEnabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_reward.alpha = 1;
|
||||
btn_reward.mouseChildren = btn_reward.mouseEnabled = true;
|
||||
}
|
||||
container_img.visible = false;
|
||||
}
|
||||
|
||||
public function modeMon() : void
|
||||
{
|
||||
btn_reward.visible = false;
|
||||
container_img.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,426 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Cubic;
|
||||
import com.greensock.easing.Linear;
|
||||
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.SecondDriver;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.effect.effects.ShakeEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.common.view.font.BitNumber;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.BossCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.PosCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TeamCenter;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.myr.panel.event.EventClickImgPanel;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myr.panel.rank.RankPanel;
|
||||
import net.pixvi.myr.panel.story.StoryPanel;
|
||||
import net.pixvi.myr.panel.team.TeamPanel;
|
||||
import net.pixvi.myr.panel.wild.WildPanel;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.Director;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class BossStagePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var userHit:int = 0;
|
||||
|
||||
public var ui:BossStagePanelUI = new BossStagePanelUI();
|
||||
|
||||
public var curVo:BossVo;
|
||||
|
||||
public var hpUpdateCd:Cooldowner;
|
||||
|
||||
public var hitCd:Cooldowner;
|
||||
|
||||
public var img:DisplayObject;
|
||||
|
||||
public var curImg:String = "";
|
||||
|
||||
public function BossStagePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
hpUpdateCd = new Cooldowner(Table.game_setting.bossHpInternal);
|
||||
hpUpdateCd.activity();
|
||||
hitCd = new Cooldowner(Table.game_setting.bossHitInternal);
|
||||
ui.ui_bottom.btn_start.onClick(startHandler);
|
||||
ui.ui_bottom2.btn_close.onClick(closeHandler);
|
||||
ui.ui_bottom2.btn_zhanzheng.onClick(zhanzhengHandler);
|
||||
ui.ui_top.btn_help.onClick(helpHandler);
|
||||
ui.ui_top.btn_reward.onClick(rewardHandler);
|
||||
ui.ui_top.btn_rank.onClick(rankHandler);
|
||||
ui.ui_center.btn_reward.onClick(getReward);
|
||||
}
|
||||
|
||||
public static function getIns() : BossStagePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BossStagePanel) as BossStagePanel;
|
||||
}
|
||||
|
||||
public function helpHandler(e:Event = null) : void
|
||||
{
|
||||
StoryPanel.getIns().start(curVo.helpScript);
|
||||
}
|
||||
|
||||
public function rewardHandler(e:Event = null) : void
|
||||
{
|
||||
PopCenter.POP(new EventClickImgPanel(curVo.rewardImg));
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
hpUpdateCd.activity();
|
||||
if(!curVo.isShow())
|
||||
{
|
||||
runAndClose();
|
||||
return;
|
||||
}
|
||||
curVo.showHp = curVo.currentHp;
|
||||
if(userHit > 0 && !curVo.isOver())
|
||||
{
|
||||
curVo.showHp += userHit;
|
||||
}
|
||||
MainMenu.getIns().onIn();
|
||||
MainMenu.getIns().ui.stageSpMode();
|
||||
PosCenter.activity("boss_" + curVo.bossId);
|
||||
update();
|
||||
addChild(MainMenu.getIns(this));
|
||||
addChild(ui.ui_bottom);
|
||||
addChild(ui.ui_bottom2);
|
||||
MainMenu.getIns().onIn();
|
||||
MainMenu.getIns().ui.stageSpMode();
|
||||
SecondDriver.getIns().regist(secondUpdate);
|
||||
}
|
||||
|
||||
public function getReward(e:Event = null) : void
|
||||
{
|
||||
SecondDriver.getIns().remove(secondUpdate);
|
||||
BossCenter.getIns().getBossReward(curVo.bossId,getRewardComplete);
|
||||
}
|
||||
|
||||
private function getRewardComplete(e:Object = null) : void
|
||||
{
|
||||
Alert.showMsg(curVo.closeMsg);
|
||||
closeHandler();
|
||||
}
|
||||
|
||||
public function startHandler(e:Event = null) : void
|
||||
{
|
||||
if(curVo.currentHp <= 0)
|
||||
{
|
||||
if(curVo.showHp != curVo.currentHp)
|
||||
{
|
||||
curVo.showHp = curVo.currentHp;
|
||||
update();
|
||||
}
|
||||
Alert.yes(curVo.finishTitle,curVo.finishContent,realStart);
|
||||
}
|
||||
else
|
||||
{
|
||||
realStart();
|
||||
}
|
||||
}
|
||||
|
||||
public function realStart() : void
|
||||
{
|
||||
if(curVo.endTime - TimeCenter.timestamp < 15)
|
||||
{
|
||||
Alert.showMsg(lang("地区威胁即将被消除。"));
|
||||
return;
|
||||
}
|
||||
if(curVo.costTi() > Master.ti)
|
||||
{
|
||||
Alert.showMsg(lang("体力不足!"));
|
||||
new FlashEffect(900,16711680,1).startEffect(ui.ui_bottom.text_ti);
|
||||
return;
|
||||
}
|
||||
if(!BagCenter.getIns().checkCost(curVo.battleCost))
|
||||
{
|
||||
Alert.showMsg(lang("必要道具不足!"));
|
||||
new FlashEffect(900,16711680,0.5).startEffect(ui.ui_bottom.card_needItem);
|
||||
return;
|
||||
}
|
||||
if(!TeamCenter.getIns().checkTeamVail(Master.curBattleTeam,true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var panel:BossBattleStartPanel = new BossBattleStartPanel();
|
||||
PopCenter.POP(panel);
|
||||
panel.startBattle();
|
||||
}
|
||||
|
||||
public function zhanzhengHandler(e:Event) : void
|
||||
{
|
||||
this.showOut();
|
||||
TeamPanel.getIns().modeBattleTeam();
|
||||
TeamPanel.getIns().popInWith(this);
|
||||
MainMenu.getIns().onOut();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
ui.update(curVo);
|
||||
var nimg:String = curVo.position.mapImg;
|
||||
if(nimg != curImg)
|
||||
{
|
||||
if(img != null)
|
||||
{
|
||||
ui.mc_container.removeChild(img);
|
||||
}
|
||||
img = new NetBitImg(nimg);
|
||||
ui.mc_container.addChild(img);
|
||||
}
|
||||
StageLocator.setfullWithNoFix(ui.mc_container,1);
|
||||
if(curVo.isOver())
|
||||
{
|
||||
ui.ui_bottom.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_bottom.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function rankHandler(e:Event = null) : void
|
||||
{
|
||||
RankPanel.getIns().setRank(curVo.rankId,lang("地区威胁"),0);
|
||||
RankPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
public function updateHp() : void
|
||||
{
|
||||
if(curVo.isOver())
|
||||
{
|
||||
if(!curVo.updateOver)
|
||||
{
|
||||
update();
|
||||
}
|
||||
return;
|
||||
}
|
||||
BossCenter.getIns().updateBossHp(curVo.bossId,updateHpComplete);
|
||||
}
|
||||
|
||||
private function updateHpComplete(hp:int = 0) : void
|
||||
{
|
||||
ui.ui_center.update(curVo,true);
|
||||
}
|
||||
|
||||
public function runAndClose() : void
|
||||
{
|
||||
closeHandler();
|
||||
Alert.showMsg(curVo.closeMsg);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
SecondDriver.getIns().remove(secondUpdate);
|
||||
WildPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
public function secondUpdate() : void
|
||||
{
|
||||
if(!curVo.isShow())
|
||||
{
|
||||
runAndClose();
|
||||
return;
|
||||
}
|
||||
ui.ui_bottom.secondUpdate(curVo);
|
||||
ui.ui_top.secondUpdate(curVo);
|
||||
if(curVo.isOver() && !curVo.gotoReward)
|
||||
{
|
||||
update();
|
||||
curVo.gotoReward = true;
|
||||
}
|
||||
if(hitCd.cooldown && curVo.showHp > curVo.currentHp)
|
||||
{
|
||||
if(userHit > 0)
|
||||
{
|
||||
Caller.delayCall(showHit,Random.integer(0,100));
|
||||
}
|
||||
else
|
||||
{
|
||||
Caller.delayCall(showHit,Random.integer(0,800));
|
||||
}
|
||||
}
|
||||
if(hpUpdateCd.cooldown)
|
||||
{
|
||||
hpUpdateCd.activity();
|
||||
updateHp();
|
||||
}
|
||||
}
|
||||
|
||||
public function showHit() : void
|
||||
{
|
||||
var maxdamage:int = 0;
|
||||
var perSecond:int = 0;
|
||||
var rand:Number = NaN;
|
||||
var randamage:int = 0;
|
||||
if(curVo.showHp > curVo.currentHp)
|
||||
{
|
||||
maxdamage = curVo.showHp - curVo.currentHp;
|
||||
perSecond = maxdamage / (hpUpdateCd.leftTime / Table.game_setting.bossHitInternal);
|
||||
if(perSecond < curVo.maxDamage * 0.66)
|
||||
{
|
||||
perSecond = curVo.maxDamage * 0.66;
|
||||
}
|
||||
rand = Random.number(0.5,1.5);
|
||||
randamage = perSecond * rand;
|
||||
if(randamage > maxdamage)
|
||||
{
|
||||
randamage = maxdamage;
|
||||
}
|
||||
new FlashEffect(300,16711680,1).startEffect(ui.ui_center.container_img);
|
||||
new ShakeEffect(Random.integer(-5,5),Random.integer(-5,5),0.8).startEffect(ui.ui_center.container_img);
|
||||
if(userHit > 0)
|
||||
{
|
||||
hitNumJump(userHit,true,true);
|
||||
curVo.showHp -= userHit;
|
||||
userHit = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
hitNumJump(randamage,rand > 1 ? true : false);
|
||||
curVo.showHp -= randamage;
|
||||
}
|
||||
ui.ui_center.update(curVo,true);
|
||||
}
|
||||
}
|
||||
|
||||
public function hitNumJump(hitpow:int, isCrit:Boolean = false, isSelf:Boolean = false) : void
|
||||
{
|
||||
var num:BitNumber = null;
|
||||
var hitmov:Object = null;
|
||||
var hitmc:BitMovieClip = null;
|
||||
if(BattleGround.hitNumPool == null)
|
||||
{
|
||||
BattleGround.firstStartUp();
|
||||
}
|
||||
if(BattleGround.hitNumPool.length == 0)
|
||||
{
|
||||
num = new BitNumber(FF.getFC("ui.HurtBitNumber"));
|
||||
}
|
||||
else
|
||||
{
|
||||
num = BattleGround.hitNumPool.get();
|
||||
}
|
||||
num.value = hitpow;
|
||||
var randomw:Number = Random.number(0.2,0.8);
|
||||
var faceto:int = 1;
|
||||
if(randomw < 0.5)
|
||||
{
|
||||
faceto = -1;
|
||||
}
|
||||
num.x = ui.ui_center.container_img.x + ui.ui_center.container_img.width * randomw;
|
||||
num.y = ui.ui_center.container_img.y + ui.ui_center.container_img.height * 0.6;
|
||||
if(curVo.hitMovs.length > 0)
|
||||
{
|
||||
hitmov = Random.element(curVo.hitMovs);
|
||||
hitmc = FF.getBMC(hitmov.mov,hitmov.fps);
|
||||
if(isSelf)
|
||||
{
|
||||
hitmc.setScale(hitmov.scale * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
hitmc.setScale(hitmov.scale);
|
||||
}
|
||||
hitmc.x = num.x;
|
||||
hitmc.y = num.y;
|
||||
hitmc.rotation = Random.integer(1,360);
|
||||
ui.ui_center.addChild(hitmc);
|
||||
Director.playOnce(hitmc);
|
||||
if(hitmov.snd != null && hitmov.snd != "")
|
||||
{
|
||||
SoundCenter.getIns().play(hitmov.snd);
|
||||
}
|
||||
}
|
||||
var jumpfar:Boolean = false;
|
||||
if(isCrit)
|
||||
{
|
||||
TweenMax.to(num,0,{"tint":16711680});
|
||||
num.scaleX = num.scaleY = 2.5;
|
||||
jumpfar = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
num.scaleX = num.scaleY = 1;
|
||||
}
|
||||
num.scaleY *= 1.3;
|
||||
ui.ui_center.addChild(num);
|
||||
var pyl:Number = Random.number(50,75);
|
||||
pyl *= faceto;
|
||||
if(jumpfar)
|
||||
{
|
||||
TweenMax.to(num,1,{
|
||||
"scaleX":1,
|
||||
"removeTint":true,
|
||||
"scaleY":1,
|
||||
"x":num.x + pyl * 2,
|
||||
"onComplete":recycleHitNum,
|
||||
"onCompleteParams":[num],
|
||||
"ease":Linear.easeOut
|
||||
});
|
||||
TweenMax.to(num,0.5,{
|
||||
"y":num.y - Random.integer(70,90),
|
||||
"ease":Cubic.easeOut,
|
||||
"yoyo":true,
|
||||
"repeat":1
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
TweenMax.to(num,0.8,{
|
||||
"scaleX":1,
|
||||
"scaleY":1,
|
||||
"x":num.x + pyl,
|
||||
"onComplete":recycleHitNum,
|
||||
"onCompleteParams":[num],
|
||||
"ease":Linear.easeOut
|
||||
});
|
||||
TweenMax.to(num,0.4,{
|
||||
"y":num.y - Random.integer(30,50),
|
||||
"ease":Cubic.easeOut,
|
||||
"yoyo":true,
|
||||
"repeat":1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private function recycleHitNum(hitNum:BitNumber) : void
|
||||
{
|
||||
BattleGround.hitNumPool.drop(hitNum);
|
||||
if(hitNum.parent != null)
|
||||
{
|
||||
hitNum.parent.removeChild(hitNum);
|
||||
}
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
SecondDriver.getIns().remove(secondUpdate);
|
||||
Caller.stopCall(showHit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.Game;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
|
||||
public class BossStagePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_container:Sprite;
|
||||
|
||||
public var ui_top:BossStageTopPanelUI;
|
||||
|
||||
public var ui_bottom:BossStageBottom1PanelUI;
|
||||
|
||||
public var ui_bottom2:BossStageBottom2PanelUI;
|
||||
|
||||
public var ui_center:BossStageCenterPanelUI;
|
||||
|
||||
public function BossStagePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.BossStagePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
public function update(curVo:BossVo) : void
|
||||
{
|
||||
ui_top.update(curVo);
|
||||
ui_center.update(curVo);
|
||||
ui_bottom.update(curVo);
|
||||
StageLocator.setSide(ui_bottom2.btn_close,"left","none");
|
||||
StageLocator.setSide(ui_bottom2,"none","bottom",0,23);
|
||||
StageLocator.setSide(ui_center,"none","bottom",0,251 - StageLocator.MainFixVo.fix[0] / 2);
|
||||
StageLocator.setSide(ui_bottom,"none","bottom",0,105);
|
||||
if(Game.getIns().setting.liuhaiMode)
|
||||
{
|
||||
StageLocator.setSide(ui_top,"none","top",0,187 + Game.getIns().getLiuHaiAdd());
|
||||
}
|
||||
else
|
||||
{
|
||||
StageLocator.setSide(ui_top,"none","top",0,172);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
package net.pixvi.myr.panel.boss
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.TimeCenter;
|
||||
import net.pixvi.myr.element.MonsterElement;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BossStageTopPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_leftTime:TextField;
|
||||
|
||||
public var btn_help:PiLightButton;
|
||||
|
||||
public var btn_rank:PiLightButton;
|
||||
|
||||
public var btn_reward:PiLightButton;
|
||||
|
||||
public var text_element:TextField;
|
||||
|
||||
public var mc_element:MovieClip;
|
||||
|
||||
public var mc_elementBg:MovieClip;
|
||||
|
||||
public function BossStageTopPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_name.scaleMode = true;
|
||||
mc_element.mouseChildren = mc_element.mouseEnabled = false;
|
||||
text_element.mouseEnabled = false;
|
||||
}
|
||||
|
||||
public function update(boss:BossVo) : void
|
||||
{
|
||||
text_name.text = boss.name;
|
||||
if(boss.element == 5)
|
||||
{
|
||||
mc_element.visible = false;
|
||||
mc_elementBg.visible = false;
|
||||
text_element.visible = false;
|
||||
return;
|
||||
}
|
||||
mc_element.visible = true;
|
||||
mc_elementBg.visible = true;
|
||||
text_element.visible = true;
|
||||
mc_element.gotoAndStop(boss.element);
|
||||
text_element.text = lang(MonsterElement.elementBossDes[boss.element]);
|
||||
TipCenter.registTextTip(mc_elementBg,lang(MonsterElement.elementDesDic[boss.element]));
|
||||
secondUpdate(boss);
|
||||
}
|
||||
|
||||
public function secondUpdate(boss:BossVo) : void
|
||||
{
|
||||
if(boss.isOver())
|
||||
{
|
||||
if(text_leftTime.text != boss.overMsg)
|
||||
{
|
||||
text_leftTime.text = boss.overMsg;
|
||||
}
|
||||
return;
|
||||
}
|
||||
var leftTime:int = boss.endTime - TimeCenter.timestamp;
|
||||
if(leftTime < 0)
|
||||
{
|
||||
leftTime = 0;
|
||||
}
|
||||
text_leftTime.text = Paster.secondFormat(leftTime);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(mc_elementBg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package net.pixvi.myr.panel.build
|
||||
{
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.cost.CostVo;
|
||||
|
||||
public class BuildVo
|
||||
{
|
||||
|
||||
public var id:int;
|
||||
|
||||
public var typeId:String;
|
||||
|
||||
public var level:int = 1;
|
||||
|
||||
public var x:int;
|
||||
|
||||
public var y:int;
|
||||
|
||||
public var roomId:int;
|
||||
|
||||
public function BuildVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function name() : String
|
||||
{
|
||||
return table().name + "Lv" + level;
|
||||
}
|
||||
|
||||
public function des() : String
|
||||
{
|
||||
return table().des;
|
||||
}
|
||||
|
||||
public function buildType() : String
|
||||
{
|
||||
return table().buildType;
|
||||
}
|
||||
|
||||
public function needLevel() : int
|
||||
{
|
||||
return table().needLevel[level.toString()];
|
||||
}
|
||||
|
||||
public function isMaxLevel() : Boolean
|
||||
{
|
||||
return table().needLevel[level.toString()] == null;
|
||||
}
|
||||
|
||||
public function buildCost() : CostVo
|
||||
{
|
||||
var cost:CostVo = new CostVo();
|
||||
cost.setByVo(table().buildCost[level]);
|
||||
return cost;
|
||||
}
|
||||
|
||||
public function canBuild() : Boolean
|
||||
{
|
||||
if(needLevel() <= Master.level && BagCenter.getIns().checkCost(buildCost()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function productData() : Object
|
||||
{
|
||||
return table().product[level];
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.build_info[typeId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package net.pixvi.myr.panel.build
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.cost.CostShowVo;
|
||||
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 CostShowMiddleItem extends PiListItem
|
||||
{
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public var container_bg:PiImgContainer;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public function CostShowMiddleItem(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(70,70);
|
||||
container_bg.setSize(70,70);
|
||||
text_num.scaleMode = true;
|
||||
text_num.mapMode = false;
|
||||
container_item.mouseChildren = container_item.mouseEnabled = false;
|
||||
PiLightButton.btnTouchLight.setDisplay(container_bg);
|
||||
}
|
||||
|
||||
override public function onData(costvo:Object) : void
|
||||
{
|
||||
var tip:String = null;
|
||||
var showvo:CostShowVo = costvo as CostShowVo;
|
||||
var hasNum:int = BagCenter.getIns().getNum(showvo.typeId);
|
||||
tip = tip = showvo.name + "<br/>" + lang("拥有:") + hasNum + CP.item("<br/>" + ItemVo.getFrom(showvo.typeId));
|
||||
TipCenter.registTextTip(this,tip,9);
|
||||
container_bg.loadNetBitImg(ImgCenter.getItemBgImgByRank(showvo.quality,"M"));
|
||||
container_item.loadNetBitImg(showvo.imgSrc,true,true,9);
|
||||
if(hasNum < showvo.num)
|
||||
{
|
||||
text_num.htmlText = CP.itemNeedRed(showvo.num.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
text_num.htmlText = showvo.num.toString();
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
PiLightButton.btnTouchLight.removeDisplay(container_bg);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package net.pixvi.myr.panel.city
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.myr.panel.stagesp.MYREventButton;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiLoopMC;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class CityBottomUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_wild:PiLightButton;
|
||||
|
||||
public var btn_farm:PiLightButton;
|
||||
|
||||
public var mc_taskTip_wild:PiLoopMC;
|
||||
|
||||
public var mc_taskTip_farm:PiLoopMC;
|
||||
|
||||
public var btn_event:MYREventButton;
|
||||
|
||||
public var btn_event2:MYREventButton;
|
||||
|
||||
public var btn_weekTask:PiLightButton;
|
||||
|
||||
public function CityBottomUI(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
package net.pixvi.myr.panel.city
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.AlchemyCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiLoopMC;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class CityMiddleUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_globalMap:PiLightButton;
|
||||
|
||||
public var btn_shop:PiLightButton;
|
||||
|
||||
public var btn_bar:PiLightButton;
|
||||
|
||||
public var btn_xiehui:PiLightButton;
|
||||
|
||||
public var btn_market:PiLightButton;
|
||||
|
||||
public var mc_taskTip_globalMap:PiLoopMC;
|
||||
|
||||
public var mc_taskTip_bar:PiLoopMC;
|
||||
|
||||
public var mc_taskTip_xiehui:PiLoopMC;
|
||||
|
||||
public var mc_taskTip_market:PiLoopMC;
|
||||
|
||||
public var mc_taskTip_shop:PiLoopMC;
|
||||
|
||||
public var mc_tipAlch:PiLoopMC;
|
||||
|
||||
public var mc_cityMap:MovieClip;
|
||||
|
||||
public function CityMiddleUI(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function updateFunction() : void
|
||||
{
|
||||
var alp:Number = 0.3;
|
||||
btn_xiehui.alpha = 1;
|
||||
btn_xiehui.mouseChildren = btn_xiehui.mouseEnabled = true;
|
||||
if(GameMath.ModeTrace || Boolean(Master.history.openBar))
|
||||
{
|
||||
btn_bar.alpha = 1;
|
||||
btn_bar.mouseChildren = btn_bar.mouseEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_bar.alpha = alp;
|
||||
btn_bar.mouseChildren = btn_bar.mouseEnabled = false;
|
||||
}
|
||||
if(GameMath.ModeTrace || Boolean(Master.history.openMarket))
|
||||
{
|
||||
btn_market.alpha = 1;
|
||||
btn_market.mouseChildren = btn_market.mouseEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_market.alpha = alp;
|
||||
btn_market.mouseChildren = btn_market.mouseEnabled = false;
|
||||
}
|
||||
if(GameMath.ModeTrace || Boolean(Master.history.openShop))
|
||||
{
|
||||
btn_shop.mouseChildren = btn_shop.mouseEnabled = true;
|
||||
btn_shop.alpha = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_shop.mouseChildren = btn_shop.mouseEnabled = false;
|
||||
btn_shop.alpha = alp;
|
||||
}
|
||||
if(mc_tipAlch != null)
|
||||
{
|
||||
mc_tipAlch.visible = AlchemyCenter.getIns().hasFinish();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,566 @@
|
||||
package net.pixvi.myr.panel.city
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.GameSetting;
|
||||
import net.pixvi.myr.center.CityCenter;
|
||||
import net.pixvi.myr.center.GuideCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.PosCenter;
|
||||
import net.pixvi.myr.center.StageCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TaskCenter;
|
||||
import net.pixvi.myr.element.city.CityVo;
|
||||
import net.pixvi.myr.element.guide.GMain;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.npc.ConditionVo;
|
||||
import net.pixvi.myr.panel.bar.BarPanel;
|
||||
import net.pixvi.myr.panel.guide.NewFunctionGuidePanel;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myr.panel.map.CountryMapPanel;
|
||||
import net.pixvi.myr.panel.map.GlobalMapPanel;
|
||||
import net.pixvi.myr.panel.market.MarketPanel;
|
||||
import net.pixvi.myr.panel.shop.ShopPanel;
|
||||
import net.pixvi.myr.panel.stagegzxb.StageGzxbPanel;
|
||||
import net.pixvi.myr.panel.stagejbl.StageJblPanel;
|
||||
import net.pixvi.myr.panel.stagejr.StageJRPanel;
|
||||
import net.pixvi.myr.panel.stagelnp.StageLnp2Panel;
|
||||
import net.pixvi.myr.panel.stagelnp.StageLnpPanel;
|
||||
import net.pixvi.myr.panel.stagemj.StageMjPanel;
|
||||
import net.pixvi.myr.panel.stagesyc.StageSycPanel;
|
||||
import net.pixvi.myr.panel.stagexxs.StageXxsPanel;
|
||||
import net.pixvi.myr.panel.storeground.StoreGroundPanel;
|
||||
import net.pixvi.myr.panel.story.StoryPanel;
|
||||
import net.pixvi.myr.panel.wild.WildPanel;
|
||||
import net.pixvi.myr.panel.xiehui.XiehuiPanel;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.display.NetImg;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.driver.GuideDriver;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class CityPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:CityPanelUI;
|
||||
|
||||
public var bgimg:NetImg;
|
||||
|
||||
public var curCityVo:CityVo;
|
||||
|
||||
private var showOutMode:String = "in";
|
||||
|
||||
public function CityPanel()
|
||||
{
|
||||
super();
|
||||
ui = new CityPanelUI();
|
||||
addChild(ui);
|
||||
ui.ui_bottom.btn_wild.onClick(maoxianHandler);
|
||||
ui.ui_bottom.btn_farm.onClick(farmHandler);
|
||||
ui.ui_mid.btn_globalMap.onClick(globalMapHandler);
|
||||
ui.ui_mid.btn_bar.onClick(barHandler);
|
||||
ui.ui_mid.btn_market.onClick(marketHandler);
|
||||
ui.ui_mid.btn_xiehui.onClick(xiehuiHandler);
|
||||
ui.ui_mid.btn_shop.onClick(shopHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : CityPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(CityPanel) as CityPanel;
|
||||
}
|
||||
|
||||
public function farmHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "in";
|
||||
this.showOut();
|
||||
StoreGroundPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
baseShowOut();
|
||||
if(showOutMode == "in")
|
||||
{
|
||||
TweenMax.fromTo(ui.ui_mid,GameSetting.PanelTransTime,{
|
||||
"scaleX":1,
|
||||
"scaleY":1
|
||||
},{
|
||||
"scaleX":1.1,
|
||||
"scaleY":1.1,
|
||||
"onComplete":showOutEnd
|
||||
});
|
||||
TweenMax.fromTo(ui.container_container_img,GameSetting.PanelTransTime,{
|
||||
"scaleX":1.03,
|
||||
"scaleY":1.03
|
||||
},{
|
||||
"scaleX":1.08,
|
||||
"scaleY":1.08
|
||||
});
|
||||
}
|
||||
else if(showOutMode == "out")
|
||||
{
|
||||
TweenMax.fromTo(ui.ui_mid,GameSetting.PanelTransTime,{
|
||||
"scaleX":1,
|
||||
"scaleY":1
|
||||
},{
|
||||
"scaleX":0.9,
|
||||
"scaleY":0.9,
|
||||
"onComplete":showOutEnd
|
||||
});
|
||||
TweenMax.fromTo(ui.container_container_img,GameSetting.PanelTransTime,{
|
||||
"scaleX":1.03,
|
||||
"scaleY":1.03
|
||||
},{
|
||||
"scaleX":1,
|
||||
"scaleY":1
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
TweenMax.fromTo(ui.container_container_img,GameSetting.PanelTransTime,{},{"onComplete":showOutEnd});
|
||||
}
|
||||
}
|
||||
|
||||
private function enableMouse() : void
|
||||
{
|
||||
ui.ui_bottom.mouseChildren = ui.ui_bottom.mouseEnabled = true;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
showOutMode = "";
|
||||
ui.ui_bottom.mouseChildren = ui.ui_bottom.mouseEnabled = false;
|
||||
if(openPanel is StoreGroundPanel)
|
||||
{
|
||||
TweenMax.fromTo(ui.ui_mid,GameSetting.PanelTransTime,{
|
||||
"scaleX":1.1,
|
||||
"scaleY":1.1,
|
||||
"alpha":0
|
||||
},{
|
||||
"alpha":1,
|
||||
"scaleX":1,
|
||||
"scaleY":1,
|
||||
"onComplete":enableMouse
|
||||
});
|
||||
TweenMax.fromTo(ui.container_container_img,GameSetting.PanelTransTime,{
|
||||
"scaleX":1.08,
|
||||
"scaleY":1.08,
|
||||
"alpha":0
|
||||
},{
|
||||
"alpha":1,
|
||||
"scaleX":1.03,
|
||||
"scaleY":1.03
|
||||
});
|
||||
}
|
||||
else if(openPanel is GlobalMapPanel || openPanel is WildPanel)
|
||||
{
|
||||
TweenMax.fromTo(ui.ui_mid,GameSetting.PanelTransTime,{
|
||||
"scaleX":0.9,
|
||||
"scaleY":0.9,
|
||||
"alpha":0
|
||||
},{
|
||||
"alpha":1,
|
||||
"scaleX":1,
|
||||
"scaleY":1,
|
||||
"onComplete":enableMouse
|
||||
});
|
||||
TweenMax.fromTo(ui.container_container_img,GameSetting.PanelTransTime,{
|
||||
"scaleX":1,
|
||||
"scaleY":1,
|
||||
"alpha":0
|
||||
},{
|
||||
"scaleX":1.03,
|
||||
"scaleY":1.03,
|
||||
"alpha":1
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.container_container_img.scaleX = ui.container_container_img.scaleY = 1.03;
|
||||
TweenMax.fromTo(ui.ui_mid,GameSetting.PanelTransTime,{"alpha":0},{
|
||||
"alpha":1,
|
||||
"onComplete":enableMouse
|
||||
});
|
||||
TweenMax.fromTo(ui.container_container_img,GameSetting.PanelTransTime,{"alpha":0},{"alpha":1});
|
||||
}
|
||||
addChild(ui.ui_mid);
|
||||
addChild(MainMenu.getIns(this));
|
||||
MainMenu.getIns().onIn();
|
||||
MainMenu.getIns().ui.cityMode();
|
||||
addChild(ui.ui_bottom);
|
||||
ui.ui_top.text_name.text = CityCenter.getIns().curCity.name;
|
||||
ui.ui_top.text_des.text = CityCenter.getIns().curCity.table().des;
|
||||
if(curCityVo != null && curCityVo == CityCenter.getIns().curCity)
|
||||
{
|
||||
addChild(ui.ui_top);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(curCityVo == null || curCityVo.country != CityCenter.getIns().curCity.country)
|
||||
{
|
||||
}
|
||||
curCityVo = CityCenter.getIns().curCity;
|
||||
ui.countryMode(curCityVo.country);
|
||||
if(bgimg != null)
|
||||
{
|
||||
bgimg.dispose();
|
||||
bgimg = null;
|
||||
}
|
||||
bgimg = new NetBitImg();
|
||||
bgimg.addEventListener("complete",bgimgComplete);
|
||||
bgimg.load(curCityVo.imgSrc);
|
||||
ui.container_img.addChild(bgimg);
|
||||
addChild(ui.ui_top);
|
||||
}
|
||||
ui.ui_bottom.btn_event.loadByBtnData(Table.activity_info.specialBtn.cityBtn);
|
||||
ui.ui_bottom.btn_event.onClick(cityEventBtnHandler);
|
||||
ui.ui_bottom.btn_event2.loadByBtnData(Table.activity_info.specialBtn.cityBtn2);
|
||||
ui.ui_bottom.btn_event2.onClick(cityEventBtnHandler);
|
||||
updateTask();
|
||||
PosCenter.activity("city" + curCityVo.cid);
|
||||
ui.update();
|
||||
guide();
|
||||
}
|
||||
|
||||
public function updateTask() : void
|
||||
{
|
||||
if(TaskCenter.getIns().hasTaskByPosition("city" + curCityVo.cid + "_bar"))
|
||||
{
|
||||
ui.ui_mid.mc_taskTip_bar.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_mid.mc_taskTip_bar.visible = false;
|
||||
}
|
||||
if(TaskCenter.getIns().hasTaskByPosition("city" + curCityVo.cid + "_market"))
|
||||
{
|
||||
ui.ui_mid.mc_taskTip_market.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_mid.mc_taskTip_market.visible = false;
|
||||
}
|
||||
if(TaskCenter.getIns().hasTaskByPosition("city" + curCityVo.cid + "_shop"))
|
||||
{
|
||||
ui.ui_mid.mc_taskTip_shop.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_mid.mc_taskTip_shop.visible = false;
|
||||
}
|
||||
if(TaskCenter.getIns().hasTaskByPosition("city" + curCityVo.cid + "_wild"))
|
||||
{
|
||||
ui.ui_bottom.mc_taskTip_wild.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_bottom.mc_taskTip_wild.visible = false;
|
||||
}
|
||||
if(TaskCenter.getIns().hasTaskByPosition("farm"))
|
||||
{
|
||||
ui.ui_bottom.mc_taskTip_farm.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_bottom.mc_taskTip_farm.visible = false;
|
||||
}
|
||||
if(TaskCenter.getIns().hasTaskByPosition("city" + curCityVo.cid + "_xiehui"))
|
||||
{
|
||||
ui.ui_mid.mc_taskTip_xiehui.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_mid.mc_taskTip_xiehui.visible = false;
|
||||
}
|
||||
if(TaskCenter.getIns().hasTaskByOtherCity(curCityVo.cid))
|
||||
{
|
||||
ui.ui_mid.mc_taskTip_globalMap.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_mid.mc_taskTip_globalMap.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function guide() : void
|
||||
{
|
||||
var p:NewFunctionGuidePanel = null;
|
||||
p = null;
|
||||
p = null;
|
||||
if(GuideCenter.getIns().checkCur(GMain.goCity3))
|
||||
{
|
||||
GuideCenter.getIns().fin();
|
||||
StoryPanel.getIns().start("sys_guide_7",guide);
|
||||
}
|
||||
else if(GuideCenter.getIns().checkCur(GMain.goXiehui1))
|
||||
{
|
||||
GuideCenter.getIns().fin();
|
||||
GuideDriver.getIns().guideDisplay(ui.ui_mid.btn_xiehui,"");
|
||||
}
|
||||
else if(GuideCenter.getIns().checkCur(GMain.goXiehui4))
|
||||
{
|
||||
GuideCenter.getIns().fin();
|
||||
if(MainMenu.getIns().ui.list_npc.items[0] != null)
|
||||
{
|
||||
GuideDriver.getIns().guideDisplay(MainMenu.getIns().ui.list_npc.items[0],"",true);
|
||||
}
|
||||
}
|
||||
else if(GuideCenter.getIns().checkCur(GMain.goWild1))
|
||||
{
|
||||
GuideCenter.getIns().fin();
|
||||
GuideDriver.getIns().guideDisplay(ui.ui_bottom.btn_wild,"ui.guideicon_goWild",true);
|
||||
}
|
||||
else if(GuideCenter.getIns().checkCur(GMain.finishTaskB))
|
||||
{
|
||||
GuideCenter.getIns().fin();
|
||||
GuideDriver.getIns().guideDisplay(MainMenu.getIns().ui.ui_top.ui_right.btn_task,"",true);
|
||||
}
|
||||
ui.ui_mid.updateFunction();
|
||||
if(Table.activity_info["city" + curCityVo.cid] != null)
|
||||
{
|
||||
if(ConditionVo.checkCondition(Table.activity_info["city" + curCityVo.cid].function_bar.condition))
|
||||
{
|
||||
ui.ui_mid.btn_bar.alpha = 1;
|
||||
ui.ui_mid.btn_bar.mouseChildren = ui.ui_mid.btn_bar.mouseEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_mid.btn_bar.alpha = 0.3;
|
||||
if(!GameMath.ModeTrace)
|
||||
{
|
||||
ui.ui_mid.btn_bar.mouseChildren = ui.ui_mid.btn_bar.mouseEnabled = false;
|
||||
}
|
||||
}
|
||||
if(ConditionVo.checkCondition(Table.activity_info["city" + curCityVo.cid].function_market.condition))
|
||||
{
|
||||
ui.ui_mid.btn_market.alpha = 1;
|
||||
ui.ui_mid.btn_market.mouseChildren = ui.ui_mid.btn_market.mouseEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_mid.btn_market.alpha = 0.3;
|
||||
if(!GameMath.ModeTrace)
|
||||
{
|
||||
ui.ui_mid.btn_market.mouseChildren = ui.ui_mid.btn_market.mouseEnabled = false;
|
||||
}
|
||||
}
|
||||
if(ConditionVo.checkCondition(Table.activity_info["city" + curCityVo.cid].function_xiehui.condition))
|
||||
{
|
||||
ui.ui_mid.btn_xiehui.alpha = 1;
|
||||
ui.ui_mid.btn_xiehui.mouseChildren = ui.ui_mid.btn_xiehui.mouseEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_mid.btn_xiehui.alpha = 0.3;
|
||||
if(!GameMath.ModeTrace)
|
||||
{
|
||||
ui.ui_mid.btn_xiehui.mouseChildren = ui.ui_mid.btn_xiehui.mouseEnabled = false;
|
||||
}
|
||||
}
|
||||
if(ConditionVo.checkCondition(Table.activity_info["city" + curCityVo.cid].function_shop.condition))
|
||||
{
|
||||
ui.ui_mid.btn_shop.alpha = 1;
|
||||
ui.ui_mid.btn_shop.mouseChildren = ui.ui_mid.btn_shop.mouseEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_mid.btn_shop.alpha = 0.3;
|
||||
if(!GameMath.ModeTrace)
|
||||
{
|
||||
ui.ui_mid.btn_shop.mouseChildren = ui.ui_mid.btn_shop.mouseEnabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(TaskCenter.getIns().getLocalTaskByTypeId("2001000") != null && !GuideCenter.getIns().checkFin(GSub.OPEN_MARKET))
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.OPEN_MARKET);
|
||||
p = new NewFunctionGuidePanel();
|
||||
p.modeMarket();
|
||||
PopCenter.POP(p);
|
||||
}
|
||||
else if(Master.history.passTask["1001006"] != null && !GuideCenter.getIns().checkFin(GSub.OPEN_BAR))
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.OPEN_BAR);
|
||||
p = new NewFunctionGuidePanel();
|
||||
p.modeBar();
|
||||
PopCenter.POP(p);
|
||||
}
|
||||
else if(ui.ui_mid.btn_shop.mouseChildren && !GuideCenter.getIns().checkFin(GSub.OPEN_SHOP))
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.OPEN_SHOP);
|
||||
p = new NewFunctionGuidePanel();
|
||||
p.modeShop();
|
||||
PopCenter.POP(p);
|
||||
}
|
||||
else if(Master.history.openAlchemy && !GuideCenter.getIns().checkFin(GSub.GUIDE_ALCHEMY))
|
||||
{
|
||||
GuideDriver.getIns().guideDisplay(ui.ui_mid.btn_market,"");
|
||||
GuideCenter.getIns().fin(GSub.GUIDE_ALCHEMY);
|
||||
}
|
||||
}
|
||||
|
||||
private function barHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "";
|
||||
this.showOut();
|
||||
BarPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
private function marketHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "";
|
||||
this.showOut();
|
||||
MarketPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
private function xiehuiHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "";
|
||||
this.showOut();
|
||||
XiehuiPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
public function shopHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "";
|
||||
showOut();
|
||||
ShopPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
private function bgimgComplete(e:Event = null) : void
|
||||
{
|
||||
bgimg.removeEventListener("complete",bgimgComplete);
|
||||
TweenMax.fromTo(bgimg,0.3,{"alpha":0},{"alpha":1});
|
||||
StageLocator.setfullWithNoFix(ui.container_img,1);
|
||||
}
|
||||
|
||||
private function titleimgComplete(e:Event = null) : void
|
||||
{
|
||||
}
|
||||
|
||||
override public function reset() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function globalMapHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "out";
|
||||
this.showOut();
|
||||
CountryMapPanel.openCountry(curCityVo.country.toString());
|
||||
}
|
||||
|
||||
public function maoxianHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "out";
|
||||
this.showOut();
|
||||
WildPanel.getIns().setWild(curCityVo.cid);
|
||||
WildPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
public function farmClickHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "in";
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
public function jrHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "in";
|
||||
this.showOut();
|
||||
StageJRPanel.getIns().curstage = StageCenter.getIns().getStage("02m1");
|
||||
StageJRPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
public function gzxbHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "in";
|
||||
this.showOut();
|
||||
StageGzxbPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
public function xxsHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "in";
|
||||
this.showOut();
|
||||
StageXxsPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
public function sycHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "in";
|
||||
this.showOut();
|
||||
StageSycPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
public function jblHandler(e:Event = null) : void
|
||||
{
|
||||
showOutMode = "in";
|
||||
this.showOut();
|
||||
StageJblPanel.getIns().popInWith(this);
|
||||
}
|
||||
|
||||
public function cityEventBtnHandler(e:Event = null) : void
|
||||
{
|
||||
var eventType:String = null;
|
||||
trace("活动按钮:" + Table.activity_info.specialBtn.cityBtn.event);
|
||||
if(e.currentTarget == ui.ui_bottom.btn_event2)
|
||||
{
|
||||
eventType = Table.activity_info.specialBtn.cityBtn2.event;
|
||||
}
|
||||
else
|
||||
{
|
||||
eventType = Table.activity_info.specialBtn.cityBtn.event;
|
||||
}
|
||||
switch(eventType)
|
||||
{
|
||||
case "lnp":
|
||||
lnpHandler(e);
|
||||
break;
|
||||
case "lnp2":
|
||||
lnp2Handler(e);
|
||||
break;
|
||||
case "mj":
|
||||
mjHandler(e);
|
||||
break;
|
||||
case "gzxb":
|
||||
gzxbHandler(e);
|
||||
break;
|
||||
case "xxs":
|
||||
xxsHandler(e);
|
||||
break;
|
||||
case "jr":
|
||||
jrHandler(e);
|
||||
break;
|
||||
case "syc":
|
||||
sycHandler(e);
|
||||
break;
|
||||
case "jbl":
|
||||
jblHandler(e);
|
||||
}
|
||||
}
|
||||
|
||||
public function lnpHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
StageLnpPanel.getIns().curstage = StageCenter.getIns().getStage("02h1");
|
||||
StageLnpPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
public function mjHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
StageMjPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
public function lnp2Handler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
StageLnp2Panel.getIns().curstage = StageCenter.getIns().getStage("02o1");
|
||||
StageLnp2Panel.getIns().popIn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package net.pixvi.myr.panel.city
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
|
||||
public class CityPanelTopUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_des:PiBitTextField;
|
||||
|
||||
public function CityPanelTopUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
text_name.scaleMode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package net.pixvi.myr.panel.city
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.Game;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.panel.weektask.WeekTaskPanel;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
|
||||
public class CityPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var container_img:Sprite;
|
||||
|
||||
public var container_container_img:Sprite;
|
||||
|
||||
public var ui_mid:CityMiddleUI;
|
||||
|
||||
public var ui_bottom:CityBottomUI;
|
||||
|
||||
public var ui_top:CityPanelTopUI;
|
||||
|
||||
public var mc_title:Sprite;
|
||||
|
||||
public function CityPanelUI(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.CityPanelUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
public function countryMode(country:int) : void
|
||||
{
|
||||
ui_mid.mc_cityMap.gotoAndStop(country);
|
||||
if(ui_mid.btn_market.skinAsContainer["img_icon"] != null)
|
||||
{
|
||||
ui_mid.btn_market.skinAsContainer["img_icon"].gotoAndStop(country);
|
||||
}
|
||||
if(ui_mid.btn_xiehui.skinAsContainer["img_icon"] != null)
|
||||
{
|
||||
ui_mid.btn_xiehui.skinAsContainer["img_icon"].gotoAndStop(country);
|
||||
}
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
countryMode(1);
|
||||
ui_mid.mc_cityMap.stop();
|
||||
if(ui_mid.btn_market.skinAsContainer["img_icon"] != null)
|
||||
{
|
||||
ui_mid.btn_market.skinAsContainer["img_icon"].stop();
|
||||
}
|
||||
if(ui_mid.btn_xiehui.skinAsContainer["img_icon"] != null)
|
||||
{
|
||||
ui_mid.btn_xiehui.skinAsContainer["img_icon"].stop();
|
||||
}
|
||||
StageLocator.setSide(ui_mid,"none","center");
|
||||
StageLocator.setSide(ui_bottom,"none","bottom");
|
||||
StageLocator.setSide(ui_bottom.btn_farm,"left","none");
|
||||
StageLocator.setSide(ui_bottom.btn_wild,"right","none");
|
||||
StageLocator.setSide(ui_bottom.btn_weekTask,"right","none",18);
|
||||
ui_bottom.mc_taskTip_wild.x = ui_bottom.btn_wild.x + 66;
|
||||
ui_bottom.mc_taskTip_farm.x = ui_bottom.btn_farm.x + 170;
|
||||
if(Game.getIns().setting.liuhaiMode)
|
||||
{
|
||||
StageLocator.setSide(ui_top,"left","top",0,125 + Game.getIns().getLiuHaiAdd());
|
||||
}
|
||||
else
|
||||
{
|
||||
StageLocator.setSide(ui_top,"left","top",0,125);
|
||||
}
|
||||
ui_top.mouseChildren = ui_top.mouseEnabled = false;
|
||||
container_container_img = new Sprite();
|
||||
container_container_img.addChild(container_img);
|
||||
addChild(container_container_img);
|
||||
ui_bottom.btn_weekTask.onClick(weekTaskHandler);
|
||||
}
|
||||
|
||||
public function weekTaskHandler(e:Event = null) : void
|
||||
{
|
||||
PopCenter.POP(new WeekTaskPanel());
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
if(Game.getIns().setting.liuhaiMode)
|
||||
{
|
||||
StageLocator.setSide(ui_top,"left","top",0,125 + Game.getIns().getLiuHaiAdd());
|
||||
}
|
||||
else
|
||||
{
|
||||
StageLocator.setSide(ui_top,"left","top",0,125);
|
||||
}
|
||||
trace(ui_bottom.btn_weekTask);
|
||||
ui_bottom.btn_weekTask.visible = false;
|
||||
var a:Object = Table.game_config;
|
||||
if(Table.game_config != null && Table.game_config.weekActivityOpen == true)
|
||||
{
|
||||
ui_bottom.btn_weekTask.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.pfw.utils.Calendar;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class DailyCheckListItem extends PiListItem
|
||||
{
|
||||
|
||||
public var mc_today:Sprite;
|
||||
|
||||
public var mc_get:Sprite;
|
||||
|
||||
public var mc_gotted:Sprite;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
private var dayflag:String;
|
||||
|
||||
private var t:TweenMax;
|
||||
|
||||
public function DailyCheckListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(130,130);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
dayflag = value.toString();
|
||||
container_img.loadNetBitImg("data/img/event/dailyCheck/day" + (int(dayflag) + 1) + ".png");
|
||||
var reward:RewardVo = new RewardVo();
|
||||
reward.setByObject(Table.activity_info.dailyCheck[dayflag]);
|
||||
mc_get.visible = mc_gotted.visible = mc_today.visible = false;
|
||||
mc_get.mouseChildren = mc_get.mouseEnabled = false;
|
||||
mc_gotted.mouseChildren = mc_gotted.mouseEnabled = false;
|
||||
mc_today.mouseChildren = mc_today.mouseEnabled = false;
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
t = null;
|
||||
}
|
||||
removeEventListener(MobiEvent.CLICK,showHandler);
|
||||
removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
var checkDay:int = Calendar.getDayNumber(Master.activityHistory.dailyCheckTime);
|
||||
var today:int = Calendar.getDayNumber();
|
||||
if(Master.activityHistory.dailyCheckCount > int(dayflag))
|
||||
{
|
||||
if(checkDay == today && int(dayflag) + 1 == Master.activityHistory.dailyCheckCount)
|
||||
{
|
||||
mc_today.visible = true;
|
||||
t = TweenMax.fromTo(mc_today,0.6,{"y":0},{
|
||||
"y":-12,
|
||||
"yoyo":true,
|
||||
"repeat":2000
|
||||
});
|
||||
}
|
||||
mc_gotted.visible = true;
|
||||
addEventListener(MobiEvent.CLICK,showHandler);
|
||||
}
|
||||
else if(Master.activityHistory.dailyCheckCount <= int(dayflag))
|
||||
{
|
||||
if(Master.activityHistory.dailyCheckCount == int(dayflag) && checkDay != Calendar.getDayNumber())
|
||||
{
|
||||
mc_get.visible = true;
|
||||
mc_today.visible = true;
|
||||
addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
t = TweenMax.fromTo(mc_today,0.6,{"y":0},{
|
||||
"y":-12,
|
||||
"yoyo":true,
|
||||
"repeat":2000
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
addEventListener(MobiEvent.CLICK,showHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
sendSelect();
|
||||
}
|
||||
|
||||
public function showHandler(e:Event = null) : void
|
||||
{
|
||||
var reward:RewardVo = new RewardVo();
|
||||
reward.setByObject(Table.activity_info.dailyCheck[dayflag]);
|
||||
RewardViewPanel.getIns().showRewardOn(skin,reward.getRewardShowArray());
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
container_img.reset();
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
t = null;
|
||||
}
|
||||
super.dispose();
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.center.ActiCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class DailyCheckPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:DailyCheckPanelUI = new DailyCheckPanelUI();
|
||||
|
||||
public function DailyCheckPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
buffMode = false;
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskCloseHandler);
|
||||
update();
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
var datas:Array = [0,1,2,3,4,5,6];
|
||||
ui.list_list.setDatas(datas);
|
||||
ui.list_list.addEventListener("piselect",selectHandler);
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event = null) : void
|
||||
{
|
||||
ActiCenter.getIns().dailyCheckCheck(checkHandler);
|
||||
}
|
||||
|
||||
public function checkHandler(e:Event = null) : void
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
public function maskCloseHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class DailyCheckPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_list:PiDataList;
|
||||
|
||||
public var container_bg:Sprite;
|
||||
|
||||
public var netimg:NetBitImg;
|
||||
|
||||
public function DailyCheckPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.DailyCheckPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.itemClass = DailyCheckListItem;
|
||||
netimg = new NetBitImg("data/img/ui/act_daily_botm.png");
|
||||
container_bg.addChild(netimg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.myr.panel.task.ItemCardUI;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
|
||||
public class RewardViewListItem extends PiListItem
|
||||
{
|
||||
|
||||
public var ui_card:ItemCardUI;
|
||||
|
||||
public function RewardViewListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
ui_card.modeMid();
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
ui_card.onAutoData(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Locator;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class RewardViewPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:RewardViewPanelUI = new RewardViewPanelUI();
|
||||
|
||||
public function RewardViewPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public static function getIns() : RewardViewPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(RewardViewPanel) as RewardViewPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
}
|
||||
|
||||
public function showRewardOn(dis:DisplayObject, rewards:Array, msg:String = "") : void
|
||||
{
|
||||
ui.list_list.setDatas(rewards);
|
||||
ui.text_msg.text = msg;
|
||||
var p:Point = dis.localToGlobal(new Point());
|
||||
this.x = p.x + 60 - 174 - 103;
|
||||
this.y = p.y + 90 - 144 - 85;
|
||||
Locator.setInStageRectangleByDisplay(this);
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,closeHandler);
|
||||
StageDriver.keepInStageEX(this);
|
||||
this.popIn();
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.panel.dailycheck
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
|
||||
public class RewardViewPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var list_list:PiDataList;
|
||||
|
||||
public var text_msg:TextField;
|
||||
|
||||
public function RewardViewPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.RewardViewPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.itemClass = RewardViewListItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package net.pixvi.myr.panel.diary
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.Master;
|
||||
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.PiSliderListItem;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class DiaryCGSliderListItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public function DiaryCGSliderListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.DiaryCGSliderListUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var total:int = int(value.cg.length);
|
||||
var unlock:int = 0;
|
||||
if(value.title == null)
|
||||
{
|
||||
value.title = 0;
|
||||
}
|
||||
for(i = 0; i < total; )
|
||||
{
|
||||
if(Master.history.passStory[value.cg[i].story] == true)
|
||||
{
|
||||
unlock++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
var lock:Boolean = unlock == 0;
|
||||
text_num.text = unlock + "/" + total;
|
||||
if(lock)
|
||||
{
|
||||
container_img.reset();
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
this.removeEventListener(MobiEvent.CLICK,sendSelect);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addEventListener(MobiEvent.CLICK,sendSelect);
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
container_img.loadNetBitImg("data/img/cgtitle/" + value.title,true,true,1,true,true);
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
this.removeEventListener(MobiEvent.CLICK,sendSelect);
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
package net.pixvi.myr.panel.diary
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.myr.center.DiaryCenter;
|
||||
import net.pixvi.myr.center.Game;
|
||||
import net.pixvi.myr.center.GameCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
import net.pixvi.psg.utils.CGShower;
|
||||
|
||||
public class DiaryPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:DiaryPanelUI;
|
||||
|
||||
public var mode:int = 0;
|
||||
|
||||
public function DiaryPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
super(showTime,hideTime);
|
||||
ui = new DiaryPanelUI();
|
||||
addChild(ui);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_cg.onClick(cgMode);
|
||||
ui.btn_story.onClick(storyMode);
|
||||
}
|
||||
|
||||
public static function getIns() : DiaryPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(DiaryPanel) as DiaryPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
DiaryCenter.getIns().autoCheckPassStory();
|
||||
modeChange(2);
|
||||
ImgCenter.addFsMask(this);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function cgMode(e:Event = null) : void
|
||||
{
|
||||
modeChange(1);
|
||||
}
|
||||
|
||||
public function storyMode(e:Event = null) : void
|
||||
{
|
||||
modeChange(2);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
var panel:PSGPopPanel = openPanel;
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOutAndRemove();
|
||||
if(Singleton.hasIns(DiaryStoryListPanel))
|
||||
{
|
||||
Singleton.removeIns(DiaryStoryListPanel);
|
||||
}
|
||||
panel.popIn();
|
||||
}
|
||||
|
||||
public function modeChange(mode:int = 1) : void
|
||||
{
|
||||
var storys:Array = null;
|
||||
var i:int = 0;
|
||||
GameCenter.traceMode("test",true);
|
||||
if(mode == 1)
|
||||
{
|
||||
GameCenter.traceMode("A");
|
||||
ui.list_story.visible = false;
|
||||
ui.list_cg.visible = true;
|
||||
ui.btn_story.enabled = true;
|
||||
ui.btn_cg.enabled = false;
|
||||
ui.list_cg.setDatas(DiaryCenter.getIns().getDiaryCg());
|
||||
GameCenter.traceMode("B");
|
||||
ui.list_cg.addEventListener("piselect",cgSelectHandler);
|
||||
}
|
||||
else if(mode == 2)
|
||||
{
|
||||
ui.list_cg.visible = false;
|
||||
ui.list_story.visible = true;
|
||||
ui.btn_cg.enabled = true;
|
||||
ui.btn_story.enabled = false;
|
||||
storys = [];
|
||||
for(i = 0; i < Table.diary_info.storys.length; )
|
||||
{
|
||||
if(Table.diary_info.storys[i].hide != true)
|
||||
{
|
||||
storys.push(Table.diary_info.storys[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
ui.list_story.setDatas(storys);
|
||||
ui.list_story.addEventListener("piselect",storySelectHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public function cgSelectHandler(e:Event = null) : void
|
||||
{
|
||||
var arr1:Array = null;
|
||||
var arr2:Array = null;
|
||||
var i:int = 0;
|
||||
var shower:CGShower = null;
|
||||
try
|
||||
{
|
||||
GameCenter.traceMode("C");
|
||||
arr1 = ui.list_cg.curSelectedItemData.cg;
|
||||
arr2 = [];
|
||||
GameCenter.traceMode("D");
|
||||
for(i = 0; i < arr1.length; )
|
||||
{
|
||||
if(Master.history.passStory[arr1[i].story] == true)
|
||||
{
|
||||
arr2.push(arr1[i].img);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
GameCenter.traceMode("E");
|
||||
shower = new CGShower();
|
||||
if(Game.getIns().setting.openEffect)
|
||||
{
|
||||
shower.clickSound = GameSound.effect_clickGAo;
|
||||
}
|
||||
GameCenter.traceMode("F");
|
||||
StageLocator.setfullWithNoFix(shower,1,"center","center",StageLocator.SubFixVos["fs1"]);
|
||||
shower.init(arr2,shower.disposeHandler);
|
||||
addChild(shower);
|
||||
}
|
||||
catch(error:Error)
|
||||
{
|
||||
GameCenter.traceMode(error.errorID + error.name + error.message,true);
|
||||
}
|
||||
}
|
||||
|
||||
public function storySelectHandler(e:Event = null) : void
|
||||
{
|
||||
DiaryStoryListPanel.getIns().cur = ui.list_story.curSelectedItemData;
|
||||
ui.list_story.releaseAllSelect();
|
||||
PopCenter.POP(DiaryStoryListPanel.getIns());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package net.pixvi.myr.panel.diary
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class DiaryPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_cg:PiLightButton;
|
||||
|
||||
public var btn_story:PiLightButton;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_cg:PiSliderList;
|
||||
|
||||
public var list_story:PiSliderList;
|
||||
|
||||
public function DiaryPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.DiaryPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
btn_close.sound_click = GameSound.effect_click_close1;
|
||||
list_cg.setList(DiaryCGSliderListItem,18,false,335,3,200);
|
||||
list_story.setList(DiaryStorySliderListItem,16,false,60);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package net.pixvi.myr.panel.diary
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class DiaryStoryListItem extends PiListItem
|
||||
{
|
||||
|
||||
public var text_id:TextField;
|
||||
|
||||
public var mc_lock:Sprite;
|
||||
|
||||
public function DiaryStoryListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_id.mouseEnabled = mc_lock.mouseChildren = mc_lock.mouseEnabled = false;
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var lock:Boolean = Master.history.passStory[value.story] != true;
|
||||
btn_select.onClick(sendSelect);
|
||||
if(lock)
|
||||
{
|
||||
btn_select.enabled = false;
|
||||
mc_lock.visible = true;
|
||||
text_id.visible = false;
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
btn_select.enabled = true;
|
||||
mc_lock.visible = false;
|
||||
text_id.visible = true;
|
||||
text_id.text = value.id;
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
package net.pixvi.myr.panel.diary
|
||||
{
|
||||
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.myr.center.DiaryCenter;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.panel.story.StoryPanel;
|
||||
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 DiaryStoryListPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:DiaryStoryListUI;
|
||||
|
||||
public var cur:Object;
|
||||
|
||||
public function DiaryStoryListPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
super(showTime,hideTime);
|
||||
ui = new DiaryStoryListUI();
|
||||
addChild(ui);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : DiaryStoryListPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(DiaryStoryListPanel) as DiaryStoryListPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
update();
|
||||
PopCenter.getIns().setMaskAlpha(0.5);
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,closeHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function modeEntangle(monType:int, taskTypeId:int = 0) : void
|
||||
{
|
||||
var vo:MonsterVo = MonsterCenter.getIns().getEntangleMonByType(monType);
|
||||
var o:Object = {
|
||||
"name":lang("{0}的羁绊回放",vo.name),
|
||||
"story":[]
|
||||
};
|
||||
o.story = DiaryCenter.getIns().getTaskAllStory(taskTypeId.toString());
|
||||
DiaryStoryListPanel.getIns().cur = o;
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().resetMaskAlpha();
|
||||
PopCenter.getInstance().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
ui.text_name.text = cur.name;
|
||||
var storys:Array = cur.story;
|
||||
var nstorys:Array = [];
|
||||
for(i = 0; i < storys.length; )
|
||||
{
|
||||
if(storys[i] is String)
|
||||
{
|
||||
nstorys[i] = {
|
||||
"id":i + 1,
|
||||
"story":storys[i]
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
nstorys[i] = {
|
||||
"id":i + 1,
|
||||
"story":storys[i].story
|
||||
};
|
||||
if(storys[i].para != null)
|
||||
{
|
||||
nstorys[i].para = storys[i].para;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
ui.list_list.setDatas(nstorys);
|
||||
ui.list_list.addEventListener("piselect",selectHandler);
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event = null) : void
|
||||
{
|
||||
var script:String = ui.list_list.curSelectedItemData.story;
|
||||
var para:Object = ui.list_list.curSelectedItemData.para;
|
||||
StoryPanel.getIns().start(script,null,null,true,true,false);
|
||||
if(para != null)
|
||||
{
|
||||
for(var key:String in para)
|
||||
{
|
||||
GAoNano.getIns().para[key] = para[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package net.pixvi.myr.panel.diary
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class DiaryStoryListUI extends UIComponent
|
||||
{
|
||||
|
||||
public var list_list:PiDataList;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public function DiaryStoryListUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.DiaryStoryListPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
btn_close.sound_click = GameSound.effect_click_close1;
|
||||
list_list.itemClass = DiaryStoryListItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package net.pixvi.myr.panel.diary
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
|
||||
public class DiaryStorySliderListItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var text_name:TextField;
|
||||
|
||||
public var text_id:TextField;
|
||||
|
||||
public var text_num:TextField;
|
||||
|
||||
public var mc_lock:Sprite;
|
||||
|
||||
public function DiaryStorySliderListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.DiaryStorySliderItem");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
text_id.mouseEnabled = text_name.mouseEnabled = text_num.mouseEnabled = false;
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
if(int(value.sort) >= 100)
|
||||
{
|
||||
text_id.htmlText = Paster.font(value.sort,null,33);
|
||||
}
|
||||
else
|
||||
{
|
||||
text_id.text = value.sort;
|
||||
}
|
||||
text_name.text = value.name;
|
||||
var total:int = int(value.story.length);
|
||||
var unlock:int = 0;
|
||||
for each(var s:String in value.story)
|
||||
{
|
||||
if(Master.history.passStory[s] == true)
|
||||
{
|
||||
unlock++;
|
||||
}
|
||||
}
|
||||
if(unlock > 0)
|
||||
{
|
||||
text_name.visible = true;
|
||||
mc_lock.visible = false;
|
||||
btn_select.onClick(sendSelect);
|
||||
btn_select.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_name.visible = false;
|
||||
mc_lock.visible = true;
|
||||
btn_select.visible = false;
|
||||
btn_select.onClick(sendSelect,true);
|
||||
}
|
||||
text_num.text = "(" + unlock + "/" + total + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
package net.pixvi.myr.panel.egg
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.GameSetting;
|
||||
import net.pixvi.myr.center.GuideCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.element.guide.GMain;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.myr.panel.stackground.StackGroundPanel;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.driver.GuideDriver;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EggSelectPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var selectedComplete:Boolean = true;
|
||||
|
||||
public static var selectedEgg:EggVo;
|
||||
|
||||
public static var selectedEggs:Array;
|
||||
|
||||
public static var selectMode:String;
|
||||
|
||||
public var ui:EggSelectPanelUI = new EggSelectPanelUI();
|
||||
|
||||
private var cacheY:Number = 0;
|
||||
|
||||
public function EggSelectPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(GameSetting.PanelTransTime,GameSetting.PanelTransTime);
|
||||
selectedEgg = null;
|
||||
selectedComplete = false;
|
||||
ui.btn_close.onClick(closeBtnHandler);
|
||||
ui.btn_yes.onClick(yesHandler);
|
||||
ui.switch_sort.addEventListener("piselect",updateSort);
|
||||
ui.btn_sortDirect.onClick(switchSortDirect);
|
||||
}
|
||||
|
||||
public static function getIns() : EggSelectPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(EggSelectPanel) as EggSelectPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
selectedEgg = null;
|
||||
selectedComplete = false;
|
||||
guide();
|
||||
ImgCenter.addFsMask(this);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
if(cacheY > 0)
|
||||
{
|
||||
ui.list_egg.process_value = cacheY;
|
||||
}
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function updateSort(e:Event = null) : void
|
||||
{
|
||||
var sortA:uint = 18;
|
||||
if(ui.btn_sortDirect.selected)
|
||||
{
|
||||
sortA = 16;
|
||||
}
|
||||
ui.list_egg.itemDatas.sortOn(ui.switch_sort.value,sortA);
|
||||
ui.list_egg.setDatas(ui.list_egg.itemDatas);
|
||||
}
|
||||
|
||||
public function switchSortDirect(e:Event = null) : void
|
||||
{
|
||||
ui.btn_sortDirect.switchSelectStatus();
|
||||
updateSort();
|
||||
}
|
||||
|
||||
public function guide() : void
|
||||
{
|
||||
if(GuideCenter.getIns().checkCur(GMain.stackMon25))
|
||||
{
|
||||
GuideDriver.getIns().curGuideComplete();
|
||||
GuideCenter.getIns().fin("auto",false);
|
||||
GuideDriver.getIns().guideDisplay(ui.list_egg.items[0],"",true);
|
||||
}
|
||||
}
|
||||
|
||||
private function closeBtnHandler(e:Event = null) : void
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
|
||||
public function yesHandler(e:Event = null) : void
|
||||
{
|
||||
if(ui.list_egg.curItemDatasSelected.length > 0)
|
||||
{
|
||||
selectedComplete = true;
|
||||
selectedEggs = ui.list_egg.curItemDatasSelected;
|
||||
selectedEgg = selectedEggs[0];
|
||||
}
|
||||
closeHandler();
|
||||
}
|
||||
|
||||
private function selectHandler(e:Event = null) : void
|
||||
{
|
||||
selectedEgg = ui.list_egg.curSelectedItemData as EggVo;
|
||||
selectedComplete = true;
|
||||
closeHandler();
|
||||
ui.list_egg.removeEventListener("piselect",selectHandler);
|
||||
StackGroundPanel.getIns().guide();
|
||||
if(ui.list_egg.multiSelectedMax > 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function modeSingle() : void
|
||||
{
|
||||
selectMode = "single";
|
||||
ui.modeSingle();
|
||||
ui.list_egg.multiSelectedMax = 1;
|
||||
ui.list_egg.setDatas(Master.bag.getEggArr());
|
||||
ui.list_egg.addEventListener("piselect",selectHandler);
|
||||
if(ui.switch_sort.value != null)
|
||||
{
|
||||
updateSort();
|
||||
}
|
||||
if(ui.mc_empty != null)
|
||||
{
|
||||
if(ui.list_egg.itemDatasLength <= 0)
|
||||
{
|
||||
ui.mc_empty.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.mc_empty.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function modeMuilty(num:int) : void
|
||||
{
|
||||
ui.modeMuilty();
|
||||
selectMode = "multy";
|
||||
ui.list_egg.multiSelectedMax = num;
|
||||
ui.list_egg.setDatas(Master.bag.getEggArr());
|
||||
ui.list_egg.addEventListener("piselect",selectHandler);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
cacheY = ui.list_egg.process_value;
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOut();
|
||||
dispatchEvent(new Event("complete"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package net.pixvi.myr.panel.egg
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.panel.bag.EggSelectSliderListItem;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
import net.pixvi.psg.ui.controller.PiLightSwitch;
|
||||
|
||||
public class EggSelectPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var list_egg:PiSliderList;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_yes:PiLightButton;
|
||||
|
||||
public var mc_kxcw:Sprite;
|
||||
|
||||
public var text_num:TextField;
|
||||
|
||||
public var switch_sort:PiLightSwitch;
|
||||
|
||||
public var btn_sortDirect:PiLightButton;
|
||||
|
||||
public var mc_empty:Sprite;
|
||||
|
||||
public function EggSelectPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EggSelectPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
switch_sort.setValues("star","timeTotal","q1","q2","q3","q4","q5");
|
||||
list_egg.setList(EggSelectSliderListItem,16,false,165,4,146);
|
||||
list_egg.multiSelectedMax = 1;
|
||||
if(mc_empty != null)
|
||||
{
|
||||
mc_empty.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function modeSingle() : void
|
||||
{
|
||||
mc_kxcw.visible = text_num.visible = btn_yes.visible = false;
|
||||
}
|
||||
|
||||
public function modeMuilty() : void
|
||||
{
|
||||
mc_kxcw.visible = text_num.visible = btn_yes.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package net.pixvi.myr.panel.egg
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
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.center.ImgCenter;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.myr.panel.bag.BagPanel;
|
||||
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.PiSliderListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EggSliderListItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var container_bg:PiImgContainer;
|
||||
|
||||
public var container_egg:PiImgContainer;
|
||||
|
||||
public var container_star:PiImgContainer;
|
||||
|
||||
public var container_element:PiImgContainer;
|
||||
|
||||
public var text_time:TextField;
|
||||
|
||||
public var text_num:PiBitTextField;
|
||||
|
||||
public function EggSliderListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EggSliderListItemUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_egg.setSize(125,125);
|
||||
container_bg.setSize(125,129);
|
||||
container_star.setSize(110,34);
|
||||
container_element.setSize(48,50);
|
||||
container_element.setScale(0.8);
|
||||
container_egg.mouseChildren = container_egg.mouseEnabled = false;
|
||||
container_element.mouseChildren = container_egg.mouseEnabled = false;
|
||||
container_star.mouseChildren = container_egg.mouseEnabled = false;
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var egg:EggVo = value as EggVo;
|
||||
container_bg.loadNetBitImg(ImgCenter.getItemBgImg(egg));
|
||||
container_egg.loadNetBitImg(egg.imgsrc,true);
|
||||
container_star.loadNetBitImg(ImgCenter.getStarImg(egg.star));
|
||||
container_element.loadNetBitImg(ImgCenter.getMonElement(egg.element),true,true,0);
|
||||
text_time.text = Paster.secondFormat(egg.timeTotal);
|
||||
text_num.text = egg.num.toString();
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
TipCenter.registTextTip(this,egg.name,10);
|
||||
if(egg.feedLock)
|
||||
{
|
||||
container_egg.alpha = 0.4;
|
||||
text_time.text = lang("LOCK");
|
||||
}
|
||||
else
|
||||
{
|
||||
container_egg.alpha = 1;
|
||||
text_time.text = Paster.secondFormat((data as EggVo).timeTotal);
|
||||
}
|
||||
container_bg.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
if(BagPanel.getIns().ui.mc_eggTip != null)
|
||||
{
|
||||
(data as EggVo).feedLock = !(data as EggVo).feedLock;
|
||||
if((data as EggVo).feedLock)
|
||||
{
|
||||
text_time.text = lang("LOCK");
|
||||
container_egg.alpha = 0.4;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_time.text = Paster.secondFormat((data as EggVo).timeTotal);
|
||||
container_egg.alpha = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(this);
|
||||
container_bg.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
this.removeEventListener(MobiEvent.CLICK,sendSelect);
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
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 EntangleNoUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_makeEntangle:PiLightButton;
|
||||
|
||||
public var container_item:PiImgContainer;
|
||||
|
||||
public var text_msg:PiBitTextField;
|
||||
|
||||
public function EntangleNoUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_item.setSize(60,60);
|
||||
}
|
||||
|
||||
public function update(vo:MonsterVo) : void
|
||||
{
|
||||
var item:ItemVo = BagCenter.getIns().getByType(Table.entangle_info.entangleItem);
|
||||
if(vo.feel != vo.maxFeel)
|
||||
{
|
||||
text_msg.text = lang("好感不足");
|
||||
btn_makeEntangle.visible = false;
|
||||
}
|
||||
else if(item == null || item.num <= 0)
|
||||
{
|
||||
text_msg.text = lang("缺少道具");
|
||||
btn_makeEntangle.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_makeEntangle.visible = true;
|
||||
}
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
text_msg.scaleMode = true;
|
||||
}
|
||||
container_item.loadNetBitImg(ImgCenter.getItemImg(Table.entangle_info.entangleItem));
|
||||
TipCenter.registTextTip(container_item,ItemVo.getName(Table.entangle_info.entangleItem),11);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
TipCenter.remove(container_item);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.DiaryCenter;
|
||||
import net.pixvi.myr.center.EntangleCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MonsterCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.diary.DiaryStoryListPanel;
|
||||
import net.pixvi.myr.panel.monster.MonsterViewPanel;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.display.NetImg;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.controls.PiButton;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EntanglePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var maxEntangleLevel:int = 1;
|
||||
|
||||
public var cur:MonsterVo;
|
||||
|
||||
public var ui:EntanglePanelUI = new EntanglePanelUI();
|
||||
|
||||
public var onComplete:Function;
|
||||
|
||||
public var hasChange:Boolean = false;
|
||||
|
||||
public var img:NetImg;
|
||||
|
||||
private var upstarbtn:PiButton;
|
||||
|
||||
public function EntanglePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
buffMode = false;
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.ui_no.btn_makeEntangle.onClick(makeEntangle);
|
||||
ui.ui_yes.btn_effect.onClick(effectHandler);
|
||||
ui.ui_yes.btn_reset.onClick(resetHandler);
|
||||
if(ui.ui_yes.btn_upStar1 != null)
|
||||
{
|
||||
ui.ui_yes.btn_upStar1.onClick(upStarHandler);
|
||||
}
|
||||
if(ui.ui_yes.btn_upStar2 != null)
|
||||
{
|
||||
ui.ui_yes.btn_upStar2.onClick(upStarHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getIns() : EntanglePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(EntanglePanel) as EntanglePanel;
|
||||
}
|
||||
|
||||
public function upStarHandler(e:Event = null) : void
|
||||
{
|
||||
var o:Object = null;
|
||||
var targetStar:int = 0;
|
||||
if(e.currentTarget == ui.ui_yes.btn_upStar1)
|
||||
{
|
||||
targetStar = 1;
|
||||
upstarbtn = ui.ui_yes.btn_upStar1;
|
||||
}
|
||||
if(e.currentTarget == ui.ui_yes.btn_upStar2)
|
||||
{
|
||||
targetStar = 2;
|
||||
upstarbtn = ui.ui_yes.btn_upStar2;
|
||||
}
|
||||
if(cur.upStar >= targetStar)
|
||||
{
|
||||
o = {
|
||||
"name":lang("{0}的升星回放",cur.name),
|
||||
"story":[]
|
||||
};
|
||||
o.story = DiaryCenter.getIns().getTaskAllStory(Table.upstar_info[cur.type].task[targetStar - 1]);
|
||||
DiaryStoryListPanel.getIns().cur = o;
|
||||
PopCenter.POP(DiaryStoryListPanel.getIns());
|
||||
return;
|
||||
}
|
||||
if(Master.history.passTask[cur.upStartTask[targetStar]] == true)
|
||||
{
|
||||
if(cur.skin != Table.upstar_info[cur.type].skin[cur.upStar + 1])
|
||||
{
|
||||
Alert.showMsg(lang("需要切换至升星皮肤【{0}】",Table.skin_info[Table.upstar_info[cur.type].skin[cur.upStar + 1]].name));
|
||||
return;
|
||||
}
|
||||
MonsterCenter.getIns().upStar(cur,upStarComplete);
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("没有完成目标任务");
|
||||
}
|
||||
}
|
||||
|
||||
private function upStarComplete(re:Object) : void
|
||||
{
|
||||
var p:UpStarShowPanel = new UpStarShowPanel();
|
||||
PopCenter.POP(p);
|
||||
p.start(cur.type,0,1);
|
||||
if(ui.ui_yes.upt != null)
|
||||
{
|
||||
ui.ui_yes.upt.kill();
|
||||
}
|
||||
ui.ui_yes.update(cur);
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
update();
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
private function maskHandler(e:Event = null) : void
|
||||
{
|
||||
if(this == PopCenter.getIns().topPanel)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,maskHandler);
|
||||
cur = null;
|
||||
super.showOut();
|
||||
if(hasChange)
|
||||
{
|
||||
MonsterViewPanel.getIns().update(false,true);
|
||||
}
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
if(cur.entangle)
|
||||
{
|
||||
ui.modeYes();
|
||||
ui.ui_yes.update(cur);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.modeNo();
|
||||
ui.ui_no.update(cur);
|
||||
}
|
||||
ui.showEntangleLevel(cur.entangleLevel);
|
||||
ui.text_feel.text = cur.feel + "/" + cur.maxFeel;
|
||||
ui.bar_feel.setValue(cur.feel,200,0,false);
|
||||
if(img != null)
|
||||
{
|
||||
ui.container_lh.removeChild(img);
|
||||
}
|
||||
img = new NetBitImg(cur.getImg("l"));
|
||||
img.x = cur.imgFix["l"].x;
|
||||
img.y = cur.imgFix["l"].y;
|
||||
img.setScale(0.8);
|
||||
ui.container_lh.addChild(img);
|
||||
ui.container_lh.mouseChildren = ui.container_lh.mouseEnabled = false;
|
||||
}
|
||||
|
||||
public function resetHandler(e:Event) : void
|
||||
{
|
||||
var itemvo:ItemVo = BagCenter.getIns().getByType(Table.entangle_info.resetEntangleSkillItem);
|
||||
var itemname:String = ItemVo.getName(Table.entangle_info.resetEntangleSkillItem);
|
||||
if(itemvo == null)
|
||||
{
|
||||
Alert.yes(lang("缺少道具"),lang("重置羁绊效果需要道具:{0}",itemname));
|
||||
return;
|
||||
}
|
||||
Alert.yesno(lang("提示"),lang("是否使用 {0} 来重置该魔物的所有羁绊效果?",itemname),yesResetHandler);
|
||||
}
|
||||
|
||||
private function yesResetHandler() : void
|
||||
{
|
||||
EntangleCenter.getIns().resetEntangleSkill(cur.id,resetCompleteHandler);
|
||||
}
|
||||
|
||||
private function resetCompleteHandler() : void
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
public function effectHandler(e:Event) : void
|
||||
{
|
||||
var effect:String = "";
|
||||
TipCenter.registTextTipLeft(ui.ui_yes.btn_effect,effect);
|
||||
}
|
||||
|
||||
public function makeEntangle(e:Event) : void
|
||||
{
|
||||
EntangleCenter.getIns().makeEntangle(cur.id,makeEntangleHandler);
|
||||
}
|
||||
|
||||
private function makeEntangleHandler() : void
|
||||
{
|
||||
new FlashEffect(1200,16777215,1).startEffect(this);
|
||||
update();
|
||||
GameSound.playMonVoice(cur.type.toString(),"entangle");
|
||||
MonsterViewPanel.getIns().ui.btn_sell.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBar;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EntanglePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var ui_yes:EntangleYesUI;
|
||||
|
||||
public var ui_no:EntangleNoUI;
|
||||
|
||||
public var text_feel:PiBitTextField;
|
||||
|
||||
public var mc_tag1:MovieClip;
|
||||
|
||||
public var mc_tag2:MovieClip;
|
||||
|
||||
public var mc_tag3:MovieClip;
|
||||
|
||||
public var mc_tag4:MovieClip;
|
||||
|
||||
public var bar_feel:PiBar;
|
||||
|
||||
public var container_lh:Sprite;
|
||||
|
||||
public var mc_mask:Sprite;
|
||||
|
||||
public function EntanglePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EntanglePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 1; i <= 4; )
|
||||
{
|
||||
this["mc_tag" + i].stop();
|
||||
i++;
|
||||
}
|
||||
container_lh.mask = mc_mask;
|
||||
}
|
||||
|
||||
public function modeYes() : void
|
||||
{
|
||||
ui_yes.visible = true;
|
||||
ui_no.visible = false;
|
||||
}
|
||||
|
||||
public function modeNo() : void
|
||||
{
|
||||
ui_yes.visible = false;
|
||||
ui_no.visible = true;
|
||||
}
|
||||
|
||||
public function showEntangleLevel(level:int) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 1; i <= 4; )
|
||||
{
|
||||
if(level >= i)
|
||||
{
|
||||
this["mc_tag" + i].gotoAndStop(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
this["mc_tag" + i].gotoAndStop(1);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,227 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import net.gaooo.nano.center.GAoNano;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.DiaryCenter;
|
||||
import net.pixvi.myr.center.EntangleCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.center.TaskCenter;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
import net.pixvi.myr.panel.diary.DiaryStoryListPanel;
|
||||
import net.pixvi.myr.panel.task.TaskViewPanel;
|
||||
import net.pixvi.myr.panel.taskstartpanel.TaskStartPanel;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.utils.Director;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EntangleRoadUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_pointFeel:MovieClip;
|
||||
|
||||
public var mc_pointTask:MovieClip;
|
||||
|
||||
public var mc_task:MovieClip;
|
||||
|
||||
public var ui_skill:EntangleSkillUI;
|
||||
|
||||
public var level:int = 1;
|
||||
|
||||
public var vo:MonsterVo;
|
||||
|
||||
public function EntangleRoadUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
if(mc_pointFeel != null)
|
||||
{
|
||||
mc_pointFeel.stop();
|
||||
}
|
||||
mc_pointTask.stop();
|
||||
mc_task.stop();
|
||||
PiLightButton.btnTouchLight.setDisplay(mc_task);
|
||||
PiLightButton.btnTouchLight.setDisplay(ui_skill);
|
||||
}
|
||||
|
||||
public function updateByMonster(vo:MonsterVo) : void
|
||||
{
|
||||
var max:int = 0;
|
||||
var canLevelUp:Boolean = false;
|
||||
this.vo = vo;
|
||||
mc_task.removeEventListener(MobiEvent.CLICK,taskHandler);
|
||||
ui_skill.removeEventListener(MobiEvent.CLICK,showEffectHandler);
|
||||
ui_skill.removeEventListener(MobiEvent.CLICK,selectEffectHandler);
|
||||
ui_skill.removeEventListener(MobiEvent.CLICK,unlockEffectHandler);
|
||||
if(vo.entangleLevel >= level)
|
||||
{
|
||||
mc_task.addEventListener(MobiEvent.CLICK,taskHandler);
|
||||
if(vo.entangleSkill[level] != null)
|
||||
{
|
||||
ui_skill.onData(true,vo.entangleSkill[level]);
|
||||
if(mc_pointFeel != null)
|
||||
{
|
||||
mc_pointFeel.gotoAndStop(2);
|
||||
}
|
||||
mc_pointTask.gotoAndStop(2);
|
||||
mc_task.gotoAndStop(3);
|
||||
ui_skill.addEventListener(MobiEvent.CLICK,showEffectHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui_skill.onData(true,null,false);
|
||||
ui_skill.addEventListener(MobiEvent.CLICK,selectEffectHandler);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
max = int(Table.entangle_info.haoganMax[level - 1]);
|
||||
canLevelUp = true;
|
||||
if(vo.feel < max)
|
||||
{
|
||||
canLevelUp = false;
|
||||
if(mc_pointFeel != null)
|
||||
{
|
||||
mc_pointFeel.gotoAndStop(1);
|
||||
}
|
||||
}
|
||||
else if(mc_pointFeel != null)
|
||||
{
|
||||
mc_pointFeel.gotoAndStop(2);
|
||||
}
|
||||
if(Master.history.passTask[vo.entangleTask[level - 1]] != true)
|
||||
{
|
||||
ui_skill.addEventListener(MobiEvent.CLICK,showEffectHandler);
|
||||
canLevelUp = false;
|
||||
if(vo.feel < max)
|
||||
{
|
||||
mc_task.gotoAndStop(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_task.addEventListener(MobiEvent.CLICK,taskHandler);
|
||||
mc_task.gotoAndStop(2);
|
||||
}
|
||||
mc_pointTask.gotoAndStop(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_task.addEventListener(MobiEvent.CLICK,taskHandler);
|
||||
mc_pointTask.gotoAndStop(2);
|
||||
mc_task.gotoAndStop(3);
|
||||
ui_skill.addEventListener(MobiEvent.CLICK,unlockEffectHandler);
|
||||
}
|
||||
ui_skill.onData(false,null,canLevelUp);
|
||||
}
|
||||
}
|
||||
|
||||
public function showEffectHandler(e:Event = null) : void
|
||||
{
|
||||
var taskTypeId:int = int(vo.entangleTask[level - 1]);
|
||||
if(Table.task_info[taskTypeId] == null || Table.task_info[taskTypeId].closed == true)
|
||||
{
|
||||
Alert.showMsg(lang("暂未开放的羁绊"));
|
||||
return;
|
||||
}
|
||||
var p:EntangleSkillSelectPanel = new EntangleSkillSelectPanel();
|
||||
p.startSelect(vo,level,null);
|
||||
p.modeView();
|
||||
PopCenter.POP(p);
|
||||
}
|
||||
|
||||
public function selectEffectHandler(e:Event = null) : void
|
||||
{
|
||||
var p:EntangleSkillSelectPanel = new EntangleSkillSelectPanel();
|
||||
p.startSelect(vo,level,selectEffect);
|
||||
p.modeSelect();
|
||||
PopCenter.POP(p);
|
||||
}
|
||||
|
||||
private function selectEffect(skillId:String) : void
|
||||
{
|
||||
EntangleCenter.getIns().setEntangleSkill(vo.id,skillId,level,selectEffectComplete);
|
||||
}
|
||||
|
||||
private function selectEffectComplete() : void
|
||||
{
|
||||
updateByMonster(vo);
|
||||
EntanglePanel.getIns().hasChange = true;
|
||||
new FlashEffect(900,16777215,1).startEffect(ui_skill);
|
||||
}
|
||||
|
||||
public function taskHandler(e:Event = null) : void
|
||||
{
|
||||
var task:TaskVo = null;
|
||||
var o:Object = null;
|
||||
var taskTypeId:int = int(vo.entangleTask[level - 1]);
|
||||
if(Table.task_info[taskTypeId] == null || Table.task_info[taskTypeId].closed == true)
|
||||
{
|
||||
Alert.showMsg(lang("暂未开放的羁绊"));
|
||||
return;
|
||||
}
|
||||
if(Master.history.passTask[taskTypeId] != true)
|
||||
{
|
||||
task = TaskCenter.getIns().getLocalTaskByTypeId(taskTypeId.toString());
|
||||
if(task != null && task.recieved)
|
||||
{
|
||||
TaskViewPanel.getIns().curvo = task;
|
||||
TaskViewPanel.getIns().popIn();
|
||||
}
|
||||
else
|
||||
{
|
||||
TaskStartPanel.getIns().start(task,null,true);
|
||||
GAoNano.getIns().para["monName"] = vo.shortName;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
o = {
|
||||
"name":lang("{0}的羁绊回放",vo.name),
|
||||
"story":[]
|
||||
};
|
||||
o.story = DiaryCenter.getIns().getTaskAllStory(taskTypeId.toString());
|
||||
DiaryStoryListPanel.getIns().cur = o;
|
||||
PopCenter.POP(DiaryStoryListPanel.getIns());
|
||||
}
|
||||
}
|
||||
|
||||
public function unlockEffectHandler(e:Event = null) : void
|
||||
{
|
||||
EntangleCenter.getIns().entangleLevelUp(vo.id,unlockEffectComplete);
|
||||
}
|
||||
|
||||
public function unlockEffectComplete() : void
|
||||
{
|
||||
var bmc:BitMovieClip = FF.getBMC("mov.SkillStartLevel3",40);
|
||||
bmc.x = ui_skill.x + 41;
|
||||
bmc.y = ui_skill.y + 41;
|
||||
bmc.setScale(1.5);
|
||||
addChild(bmc);
|
||||
Director.playOnce(bmc);
|
||||
EntanglePanel.getIns().update();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
PiLightButton.btnTouchLight.removeDisplay(mc_task);
|
||||
PiLightButton.btnTouchLight.removeDisplay(ui_skill);
|
||||
TipCenter.remove(ui_skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
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 EntangleSkillListItem extends PiListItem
|
||||
{
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var text_des:PiBitTextField;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var text_target:PiBitTextField;
|
||||
|
||||
public function EntangleSkillListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
text_des.scaleMode = true;
|
||||
text_name.scaleMode = true;
|
||||
text_target.scaleMode = true;
|
||||
}
|
||||
container_img.setSize(70,70);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var skill:String = value.toString();
|
||||
var skillData:Object = Table.entangle_skill[skill];
|
||||
if(skillData.addType == "global")
|
||||
{
|
||||
text_target.text = lang("所有魔物");
|
||||
}
|
||||
else
|
||||
{
|
||||
text_target.text = lang("自体");
|
||||
}
|
||||
text_des.text = skillData.des;
|
||||
text_name.text = skillData.name;
|
||||
container_img.loadNetImg(ImgCenter.getEntangleSkillIcon(skill),true,true,0);
|
||||
PiLightButton.btnTouchLight.setDisplay(container_img);
|
||||
this.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
sendSelect();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
PiLightButton.btnTouchLight.removeDisplay(container_img);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EntangleSkillSelectPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EntangleSkillSelectPanelUI = new EntangleSkillSelectPanelUI();
|
||||
|
||||
public var onComplete:Function;
|
||||
|
||||
public function EntangleSkillSelectPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
buffMode = false;
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
}
|
||||
|
||||
public function modeView() : void
|
||||
{
|
||||
ui.mc_msg.visible = false;
|
||||
}
|
||||
|
||||
public function modeSelect() : void
|
||||
{
|
||||
ui.mc_msg.visible = true;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
ui.list_list.addEventListener("piselect",selectHandler);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOutAndRemove();
|
||||
}
|
||||
|
||||
public function startSelect(mon:MonsterVo, level:int, onComplete:Function) : void
|
||||
{
|
||||
this.onComplete = onComplete;
|
||||
ui.list_list.setDatas(mon.hasEntangleSkill[level]);
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event) : void
|
||||
{
|
||||
this.showOutAndRemove();
|
||||
if(onComplete == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ui.list_list.removeEventListener("piselect",selectHandler);
|
||||
var type:String = ui.list_list.curSelectedItemData.toString();
|
||||
onComplete(type);
|
||||
onComplete = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
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.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EntangleSkillSelectPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_list:PiDataList;
|
||||
|
||||
public var mc_msg:Sprite;
|
||||
|
||||
public function EntangleSkillSelectPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EntangleSkillSelectPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.itemClass = EntangleSkillListItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
|
||||
public class EntangleSkillUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_add:MovieClip;
|
||||
|
||||
public var mc_lock:MovieClip;
|
||||
|
||||
public var mc_unlock:MovieClip;
|
||||
|
||||
public var container_skill:PiImgContainer;
|
||||
|
||||
public function EntangleSkillUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_skill.setSize(70,70);
|
||||
}
|
||||
|
||||
public function onData(open:Boolean = false, skillType:String = null, canLevelUp:Boolean = false) : void
|
||||
{
|
||||
if(open)
|
||||
{
|
||||
mc_lock.visible = false;
|
||||
mc_unlock.visible = false;
|
||||
if(skillType == null)
|
||||
{
|
||||
container_skill.visible = false;
|
||||
mc_add.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
container_skill.visible = true;
|
||||
mc_add.visible = false;
|
||||
container_skill.loadNetImg(ImgCenter.getEntangleSkillIcon(skillType),true,true,0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
container_skill.visible = false;
|
||||
mc_add.visible = false;
|
||||
if(canLevelUp)
|
||||
{
|
||||
mc_unlock.visible = true;
|
||||
mc_lock.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_unlock.visible = false;
|
||||
mc_lock.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EntangleYesUI extends UIComponent
|
||||
{
|
||||
|
||||
public var ui_entangle1:EntangleRoadUI;
|
||||
|
||||
public var ui_entangle2:EntangleRoadUI;
|
||||
|
||||
public var ui_entangle3:EntangleRoadUI;
|
||||
|
||||
public var ui_entangle4:EntangleRoadUI;
|
||||
|
||||
public var btn_upStar1:PiLightButton;
|
||||
|
||||
public var btn_upStar2:PiLightButton;
|
||||
|
||||
public var btn_reset:PiLightButton;
|
||||
|
||||
public var btn_effect:PiLightButton;
|
||||
|
||||
public var upt:TweenMax;
|
||||
|
||||
public function EntangleYesUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
ui_entangle1.level = 1;
|
||||
ui_entangle2.level = 2;
|
||||
ui_entangle3.level = 3;
|
||||
ui_entangle4.level = 4;
|
||||
btn_effect.visible = false;
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
upt.kill();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
public function update(vo:MonsterVo) : void
|
||||
{
|
||||
ui_entangle1.updateByMonster(vo);
|
||||
ui_entangle2.updateByMonster(vo);
|
||||
ui_entangle3.updateByMonster(vo);
|
||||
ui_entangle4.updateByMonster(vo);
|
||||
if(btn_upStar1 != null)
|
||||
{
|
||||
TipCenter.remove(btn_upStar1);
|
||||
TipCenter.remove(btn_upStar2);
|
||||
if(vo.upStartTask[1] != null || Master.history.passTask[vo.upStartTask[1]] == true)
|
||||
{
|
||||
btn_upStar1.visible = true;
|
||||
if(vo.upStar > 0)
|
||||
{
|
||||
btn_upStar1.selected = true;
|
||||
TipCenter.registTextTip(btn_upStar1,lang("全属性增加15%"));
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_upStar1.selected = false;
|
||||
if(Master.history.passTask[vo.upStartTask[1]])
|
||||
{
|
||||
TipCenter.registTextTip(btn_upStar1,lang("升星所需契机已达成!"));
|
||||
upt = TweenMax.from(btn_upStar1,0.5,{
|
||||
"tint":16777113,
|
||||
"repeat":999
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
TipCenter.registTextTip(btn_upStar1,lang("缺少升星所需契机!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_upStar1.visible = false;
|
||||
}
|
||||
if(vo.upStartTask[2] != null || Master.history.passTask[vo.upStartTask[2]] == true)
|
||||
{
|
||||
btn_upStar2.visible = true;
|
||||
if(vo.upStar > 1)
|
||||
{
|
||||
btn_upStar2.selected = true;
|
||||
TipCenter.registTextTip(btn_upStar2,lang("全属性增加15%"));
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_upStar2.selected = false;
|
||||
TipCenter.registTextTip(btn_upStar1,lang("升星所需契机已达成!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_upStar2.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class UpStarShowPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:UpStarShowPanelUI = new UpStarShowPanelUI();
|
||||
|
||||
public function UpStarShowPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
}
|
||||
|
||||
public function start(montype:int, beforeStar:int, afterStar:int) : void
|
||||
{
|
||||
Caller.delayCall(openClick,4000);
|
||||
ui.autoShow(montype,beforeStar,afterStar);
|
||||
}
|
||||
|
||||
public function openClick() : void
|
||||
{
|
||||
stage.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
stage.removeEventListener(MobiEvent.CLICK,clickHandler);
|
||||
this.showOutAndRemove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package net.pixvi.myr.panel.entangle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Elastic;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
|
||||
public class UpStarShowPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_star:Sprite;
|
||||
|
||||
public var mc_tip:Sprite;
|
||||
|
||||
public var container_lh:Sprite;
|
||||
|
||||
public var container_star:PiImgContainer;
|
||||
|
||||
public var imgBefore:NetBitImg;
|
||||
|
||||
public var imgAfter:NetBitImg;
|
||||
|
||||
public function UpStarShowPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.UpStarShowPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_star.setSize(216,72);
|
||||
}
|
||||
|
||||
public function autoShow(monType:int, star:int, toStar:int) : void
|
||||
{
|
||||
container_star.parent.setChildIndex(container_star,container_star.parent.numChildren - 1);
|
||||
mc_tip.parent.setChildIndex(mc_tip,mc_tip.parent.numChildren - 1);
|
||||
var typeBefore:int = int(star == 0 ? monType : Table.skin_info[monType].skin[star]);
|
||||
var typeAfter:int = int(Table.upstar_info[monType].skin[toStar.toString()]);
|
||||
imgBefore = new NetBitImg(ImgCenter.getMonsterCGImg(typeBefore));
|
||||
imgAfter = new NetBitImg(ImgCenter.getMonsterCGImg(typeAfter));
|
||||
imgBefore.x = ImgCenter.getMonTagFix(typeBefore).x - 90;
|
||||
imgBefore.y = ImgCenter.getMonTagFix(typeBefore).y;
|
||||
imgAfter.x = ImgCenter.getMonTagFix(typeAfter).x - 90;
|
||||
imgAfter.y = ImgCenter.getMonTagFix(typeAfter).y;
|
||||
imgAfter.alpha = 0;
|
||||
container_lh.scaleX = container_lh.scaleY = 0.9;
|
||||
container_lh.addChild(imgBefore);
|
||||
container_lh.addChild(imgAfter);
|
||||
var newStar:int = Table.monster_info[monType].star + toStar;
|
||||
container_star.loadNetBitImg("data/img/common/common_stars_" + newStar + ".png");
|
||||
container_star.alpha = 0;
|
||||
mc_star.alpha = 0;
|
||||
mc_star.scaleX = mc_star.scaleY = 0.4;
|
||||
mc_tip.alpha = 0;
|
||||
SoundCenter.getIns().play(GameSound.soundName("upstar"));
|
||||
TweenMax.to(container_lh,1,{"tint":16777215});
|
||||
TweenMax.to(imgBefore,0.2,{
|
||||
"alpha":0,
|
||||
"delay":1
|
||||
});
|
||||
TweenMax.to(imgAfter,0.2,{
|
||||
"alpha":1,
|
||||
"delay":1
|
||||
});
|
||||
TweenMax.to(container_lh,1,{"tint":16777215});
|
||||
TweenMax.to(container_lh,1,{
|
||||
"removeTint":true,
|
||||
"delay":1.2
|
||||
});
|
||||
TweenMax.to(mc_star,0.5,{
|
||||
"alpha":1,
|
||||
"scaleX":1,
|
||||
"scaleY":1,
|
||||
"ease":Elastic.easeOut,
|
||||
"delay":1.2
|
||||
});
|
||||
TweenMax.to(mc_tip,0.4,{
|
||||
"alpha":1,
|
||||
"y":mc_tip.y - 70,
|
||||
"delay":1.3
|
||||
});
|
||||
TweenMax.to(container_star,0.2,{
|
||||
"alpha":1,
|
||||
"delay":1.3
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
package net.pixvi.myr.panel.equipexchange
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.ShopCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.cost.CostVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.panel.itemselect.ItemSelectPanel;
|
||||
import net.pixvi.myr.panel.reward.RewardShowPanel;
|
||||
import net.pixvi.myr.panel.story.StoryPanel;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EquipExchangePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EquipExchangePanelUI = new EquipExchangePanelUI();
|
||||
|
||||
public var exchangeId:String;
|
||||
|
||||
public var afterStory:String;
|
||||
|
||||
public function EquipExchangePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
buffMode = false;
|
||||
}
|
||||
|
||||
public static function getIns() : EquipExchangePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(EquipExchangePanel) as EquipExchangePanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
ui.btn_dazao.onClick(dazaoHandler);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.ui_after.mouseChildren = ui.ui_after.mouseEnabled = false;
|
||||
ui.btn_dazao.enabled = false;
|
||||
ui.btn_dazao.alpha = 0.5;
|
||||
ui.ui_before.alpha = 0.5;
|
||||
ui.ui_before.addEventListener(MobiEvent.CLICK,selectHandler);
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event = null) : void
|
||||
{
|
||||
var arr:Array = [];
|
||||
for each(var itemvo:ItemVo in Master.bag.items)
|
||||
{
|
||||
if(Table.dazao_info[itemvo.type] != null)
|
||||
{
|
||||
arr.push(itemvo);
|
||||
}
|
||||
}
|
||||
ItemSelectPanel.getIns().modeArray(arr);
|
||||
ItemSelectPanel.getIns().addEventListener("complete",selectCompleteHandler);
|
||||
ItemSelectPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
public function selectCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
var target:ItemVo = null;
|
||||
var dazaoData:Object = null;
|
||||
var equipVo:EquipVo = null;
|
||||
var cost:CostVo = null;
|
||||
var exchange:Object = null;
|
||||
var rws:Array = null;
|
||||
if(ItemSelectPanel.selectedComplete)
|
||||
{
|
||||
target = ItemSelectPanel.selectItem;
|
||||
dazaoData = Table.dazao_info[target.type];
|
||||
ui.ui_before.onItem(target);
|
||||
equipVo = new EquipVo();
|
||||
equipVo.type = int(dazaoData.rewardType);
|
||||
equipVo.buildAuto(0);
|
||||
ui.ui_after.onItem(equipVo);
|
||||
ui.ui_after.visible = true;
|
||||
cost = new CostVo();
|
||||
exchange = Table.exchange_info[dazaoData.exchangeId];
|
||||
exchangeId = dazaoData.exchangeId;
|
||||
afterStory = dazaoData.afterStory;
|
||||
cost.setByVo(exchange.need);
|
||||
if(BagCenter.getIns().checkCost(cost))
|
||||
{
|
||||
ui.btn_dazao.enabled = true;
|
||||
ui.btn_dazao.alpha = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_dazao.enabled = false;
|
||||
ui.btn_dazao.alpha = 0.5;
|
||||
}
|
||||
ui.ui_before.alpha = 1;
|
||||
ui.mc_put.visible = false;
|
||||
rws = cost.getShowArray(false,false,false,target.type.toString());
|
||||
ui.list_need.setDatas(rws);
|
||||
}
|
||||
}
|
||||
|
||||
public function dazaoHandler(e:Event = null) : void
|
||||
{
|
||||
ShopCenter.getIns().exchangeItem(exchangeId,1,dazaoOverHandler);
|
||||
}
|
||||
|
||||
public function dazaoOverHandler(reward:RewardResultVo) : void
|
||||
{
|
||||
RewardShowPanel.showByVo(reward,afterStoryHandler);
|
||||
exchangeId = null;
|
||||
ui.ui_after.resetAll();
|
||||
ui.ui_before.resetAll();
|
||||
ui.list_need.reset();
|
||||
ui.btn_dazao.enabled = false;
|
||||
ui.btn_dazao.alpha = 0.5;
|
||||
ui.ui_before.alpha = 0.5;
|
||||
ui.mc_put.visible = true;
|
||||
}
|
||||
|
||||
private function afterStoryHandler() : void
|
||||
{
|
||||
if(afterStory != null)
|
||||
{
|
||||
StoryPanel.getIns().start(afterStory);
|
||||
afterStory = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOutAndRemove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package net.pixvi.myr.panel.equipexchange
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.panel.build.CostShowMiddleItem;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EquipExchangePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var ui_before:EquipSelectCardUI;
|
||||
|
||||
public var ui_after:EquipSelectCardUI;
|
||||
|
||||
public var btn_dazao:PiLightButton;
|
||||
|
||||
public var list_need:PiDataList;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var mc_put:MovieClip;
|
||||
|
||||
public function EquipExchangePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EquipExchangePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_need.itemClass = CostShowMiddleItem;
|
||||
mc_put.mouseChildren = mc_put.mouseEnabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package net.pixvi.myr.panel.equipexchange
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.panel.task.ItemCardUI;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
|
||||
public class EquipSelectCardUI extends UIComponent
|
||||
{
|
||||
|
||||
public var ui_card:ItemCardUI;
|
||||
|
||||
public var text_para1:TextField;
|
||||
|
||||
public var text_para2:TextField;
|
||||
|
||||
public var text_para3:TextField;
|
||||
|
||||
public var text_para4:TextField;
|
||||
|
||||
public var text_name:TextField;
|
||||
|
||||
public function EquipSelectCardUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
ui_card.modeBig();
|
||||
ui_card.reset();
|
||||
}
|
||||
|
||||
public function resetAll() : void
|
||||
{
|
||||
ui_card.reset();
|
||||
text_name.text = "";
|
||||
text_para1.text = "";
|
||||
text_para2.text = "";
|
||||
text_para3.text = "";
|
||||
text_para4.text = "";
|
||||
}
|
||||
|
||||
public function onItem(vo:ItemVo) : void
|
||||
{
|
||||
var arr:Array = null;
|
||||
var i:int = 0;
|
||||
ui_card.onItemVo(vo);
|
||||
TipCenter.remove(ui_card);
|
||||
text_name.text = vo.name;
|
||||
if(vo is EquipVo)
|
||||
{
|
||||
arr = (vo as EquipVo).effectDes();
|
||||
}
|
||||
else
|
||||
{
|
||||
arr = [];
|
||||
}
|
||||
i = 1;
|
||||
while(i <= 4)
|
||||
{
|
||||
if(arr[i - 1] != null)
|
||||
{
|
||||
this["text_para" + i].htmlText = arr[i - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
this["text_para" + i].htmlText = "";
|
||||
}
|
||||
i++;
|
||||
}
|
||||
ui_card.text_num.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EventClickImgPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EventClickImgPanelUI = new EventClickImgPanelUI();
|
||||
|
||||
public function EventClickImgPanel(imgsrc:String, showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
buffMode = false;
|
||||
ondata(imgsrc);
|
||||
Caller.delayCall(delayAdd,100);
|
||||
}
|
||||
|
||||
public function delayAdd() : void
|
||||
{
|
||||
this.addEventListener(MobiEvent.CLICK,closeHandler);
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,closeHandler);
|
||||
}
|
||||
|
||||
public function ondata(data:Object) : void
|
||||
{
|
||||
if(data == null)
|
||||
{
|
||||
ui.container_img.loadNetImg("");
|
||||
return;
|
||||
}
|
||||
ui.container_img.loadNetImg(data.toString());
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
|
||||
public class EventClickImgPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public function EventClickImgPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.ActivityClickImgPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(640,960);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class EventImgPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EventImgPanelUI = new EventImgPanelUI();
|
||||
|
||||
public function EventImgPanel(data:Object, showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
buffMode = false;
|
||||
ondata(data);
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,closeHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function ondata(data:Object) : void
|
||||
{
|
||||
ui.container_img.loadNetImg(data.data.contentImg);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EventImgPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public function EventImgPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.ActivityImgPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.setSize(600,480);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.npc.ConditionVo;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myr.panel.noticepanel.NoticePanel;
|
||||
import net.pixvi.myr.panel.storeground.StoreGroundPanel;
|
||||
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 EventListPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:EventListPanelUI = new EventListPanelUI();
|
||||
|
||||
public function EventListPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
addChild(ui);
|
||||
super();
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_notice.onClick(noticeHandler);
|
||||
trace(Table.activity_info.events);
|
||||
}
|
||||
|
||||
public static function getIns() : EventListPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(EventListPanel) as EventListPanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var edata:Object = null;
|
||||
var vo:ConditionVo = null;
|
||||
var events:Array = [];
|
||||
for(i = 0; i < Table.activity_info.events.length; i++)
|
||||
{
|
||||
edata = Table.activity_info.events[i];
|
||||
if(edata.condition != null)
|
||||
{
|
||||
vo = new ConditionVo(edata.condition);
|
||||
if(!vo.check())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
events.push(edata);
|
||||
}
|
||||
ui.list_event.setDatas(events);
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskHandler);
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
public function noticeHandler(e:Event = null) : void
|
||||
{
|
||||
var p:NoticePanel = new NoticePanel();
|
||||
p.popInWith(this);
|
||||
this.visible = false;
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function maskHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
StoreGroundPanel.getIns().ground.resumeOrStart();
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
MainMenu.getIns().ui.ui_top.firstOpen = false;
|
||||
MainMenu.getIns().ui.ui_top.mc_huodong.visible = false;
|
||||
MainMenu.getIns().ui.ui_top.mc_huodong2.visible = false;
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,closeHandler);
|
||||
super.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.panel.noticepanel.NoticeXieyiPanel;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EventListPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var list_event:PiSliderList;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_notice:PiLightButton;
|
||||
|
||||
public var btn_zcxy:PiLightButton;
|
||||
|
||||
public var btn_ysxy:PiLightButton;
|
||||
|
||||
public var btn_etbh:PiLightButton;
|
||||
|
||||
public function EventListPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EventListPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
if(btn_zcxy != null)
|
||||
{
|
||||
btn_zcxy.onClick(zcxyHandler);
|
||||
btn_ysxy.onClick(ysxyHandler);
|
||||
btn_etbh.onClick(etbhHandler);
|
||||
if(MyrCenter.channel == "BLBL")
|
||||
{
|
||||
btn_zcxy.visible = btn_ysxy.visible = btn_etbh.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function zcxyHandler(e:Event = null) : void
|
||||
{
|
||||
NoticeXieyiPanel.pop(null,1);
|
||||
}
|
||||
|
||||
public function ysxyHandler(e:Event = null) : void
|
||||
{
|
||||
NoticeXieyiPanel.pop(null,2);
|
||||
}
|
||||
|
||||
public function etbhHandler(e:Event = null) : void
|
||||
{
|
||||
NoticeXieyiPanel.pop(null,0);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_event.setList(EventPanelSliderItem,6,false,170);
|
||||
super.onSkinComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package net.pixvi.myr.panel.event
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.myr.center.ActiCenter;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderListItem;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class EventPanelSliderItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var img:NetBitImg;
|
||||
|
||||
public function EventPanelSliderItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
super.onData(value);
|
||||
if(img != null)
|
||||
{
|
||||
removeChild(img);
|
||||
img = null;
|
||||
}
|
||||
img = new NetBitImg(value.img);
|
||||
addChild(img);
|
||||
img.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
ActiCenter.getIns().startEvent(data);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
package net.pixvi.myr.panel.event.dailygift
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.AchiCenter;
|
||||
import net.pixvi.myr.center.ActiCenter;
|
||||
import net.pixvi.myr.center.GuideCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.MasterCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.achi.AchiType;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.panel.pay.PayPackPanel;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.controls.PiButton;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ActiDailyGiftPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
private static var levelChecked:Boolean = false;
|
||||
|
||||
public var ui:ActiDailyGiftUI = new ActiDailyGiftUI();
|
||||
|
||||
public function ActiDailyGiftPanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
var i:int = 0;
|
||||
var rvo:RewardVo = null;
|
||||
buffMode = false;
|
||||
addChild(ui);
|
||||
super();
|
||||
for(i = 1; i <= 5; )
|
||||
{
|
||||
rvo = new RewardVo();
|
||||
rvo.setByObject(Table.activity_info.dailyGift[i]);
|
||||
rvo.buildRewards();
|
||||
(ui["btn_box" + i] as PiButton).setTip(rvo.toDesString("<br/>"));
|
||||
i++;
|
||||
}
|
||||
PiLightButton.btnTouchLight.setDisplay(ui.mc_box);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_check.onClick(startCheck);
|
||||
ui.btn_vipBuy.onClick(vipBuyHandler);
|
||||
ui.btn_vipCheck.onClick(vipCheckHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : ActiDailyGiftPanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(ActiDailyGiftPanel) as ActiDailyGiftPanel;
|
||||
}
|
||||
|
||||
public function vipBuyHandler(e:Event = null) : void
|
||||
{
|
||||
if(GameMath.OpenPay && Table.setting.closePay != true)
|
||||
{
|
||||
PayPackPanel.getIns().popByPayId("301");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.showMsg(lang("暂未开放的功能。"));
|
||||
}
|
||||
}
|
||||
|
||||
public function vipCheckHandler(e:Event) : void
|
||||
{
|
||||
ActiCenter.getIns().vipDailyGiftCheck(updateVip);
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
update();
|
||||
PopCenter.getIns().mask.addEventListener(MobiEvent.CLICK,maskHandler);
|
||||
var vipReward:RewardVo = new RewardVo();
|
||||
vipReward.setByObject(Table.game_setting.vipReward);
|
||||
ui.list_vipReward.setDatas(vipReward.getRewardShowArray());
|
||||
GlobalBroadcast.addEventListener(MYREvent.VIP_STATUS_CHANGE,updateVip);
|
||||
if(MasterCenter.getIns().getVipDay() > 0 && !GuideCenter.getIns().checkFin(GSub.ACHI_VIP))
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.ACHI_VIP);
|
||||
AchiCenter.getIns().autoCheck(AchiType.NONE,true);
|
||||
}
|
||||
updateLoopCheckReward();
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
public function updateLoopCheckReward() : void
|
||||
{
|
||||
var rewardvo:RewardVo = null;
|
||||
var curNum:int = 0;
|
||||
var targetNum:int = 0;
|
||||
if(ui.ui_loop != null)
|
||||
{
|
||||
if(Table.activity_info.loopCheckReward.open == true)
|
||||
{
|
||||
ui.ui_loop.visible = true;
|
||||
rewardvo = new RewardVo();
|
||||
rewardvo.setByObject(Table.activity_info.loopCheckReward.reward);
|
||||
ui.ui_loop.card_item.showMode = 1;
|
||||
ui.ui_loop.card_item.onAutoData(rewardvo.getRewardShowArray()[0]);
|
||||
curNum = int(Master.activityHistory.loopCheckRewardDayNum());
|
||||
targetNum = int(Table.activity_info.loopCheckReward.dayNum);
|
||||
ui.ui_loop.text_targetDay.text = targetNum.toString();
|
||||
ui.ui_loop.text_passDay.text = lang("{0}天",curNum.toString());
|
||||
if(curNum >= targetNum)
|
||||
{
|
||||
ui.ui_loop.btn_get.visible = true;
|
||||
ui.ui_loop.text_passDay.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_loop.btn_get.visible = false;
|
||||
ui.ui_loop.text_passDay.visible = true;
|
||||
}
|
||||
ui.ui_loop.btn_get.onClick(getLoopReward);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.ui_loop.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getLoopReward(e:Event = null) : void
|
||||
{
|
||||
ActiCenter.getIns().LoopCheckReward(getLoopRewardComplete);
|
||||
}
|
||||
|
||||
private function getLoopRewardComplete(re:Object = null) : void
|
||||
{
|
||||
updateLoopCheckReward();
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
private function maskHandler(e:Event = null) : void
|
||||
{
|
||||
if(this == PopCenter.getIns().topPanel)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
override public function showOut() : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
PopCenter.getIns().mask.removeEventListener(MobiEvent.CLICK,maskHandler);
|
||||
super.showOut();
|
||||
}
|
||||
|
||||
public function startCheck(e:Event = null) : void
|
||||
{
|
||||
this.mouseEnabled = this.mouseEnabled = false;
|
||||
ActiCenter.getIns().dailyGiftCheck(startCheckHandler);
|
||||
}
|
||||
|
||||
public function startCheckHandler(o:Object = null) : void
|
||||
{
|
||||
this.mouseEnabled = this.mouseEnabled = true;
|
||||
update();
|
||||
updateLoopCheckReward();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
var cha:int = 0;
|
||||
var reduceLevel:int = 0;
|
||||
if(!levelChecked && Master.activityHistory.dailyGiftCheckTime != 0)
|
||||
{
|
||||
cha = MyrCalendar.getDayNumber() - MyrCalendar.getDayNumber(Master.activityHistory.dailyGiftCheckTime * 1000);
|
||||
if(cha > 1)
|
||||
{
|
||||
trace("签到差:" + cha,"原签到等级:",Master.activityHistory.dailyGiftLevel);
|
||||
reduceLevel = Master.activityHistory.dailyGiftLevel - (cha - 1);
|
||||
if(reduceLevel < 1)
|
||||
{
|
||||
reduceLevel = 1;
|
||||
}
|
||||
if(Master.activityHistory.dailyGiftLevel != reduceLevel)
|
||||
{
|
||||
Alert.yes(lang("哎呀!"),lang("由于漏签 {0} 天,签到奖励等级降为:{1}",cha - 1,reduceLevel));
|
||||
Master.activityHistory.dailyGiftLevel = reduceLevel;
|
||||
}
|
||||
Master.activityHistory.dailyGiftCount = 0;
|
||||
}
|
||||
levelChecked = true;
|
||||
}
|
||||
var todaylevel:int = int(Master.activityHistory.dailyGiftLevel);
|
||||
if(ActiCenter.getIns().dailyGiftChecked())
|
||||
{
|
||||
todaylevel = Master.activityHistory.dailyGiftCount > 5 ? 5 : todaylevel - 1;
|
||||
if(todaylevel < 1)
|
||||
{
|
||||
todaylevel = 1;
|
||||
}
|
||||
ui.todaylevel(todaylevel,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.todaylevel(todaylevel,false);
|
||||
}
|
||||
ui.text_daynum.text = Master.activityHistory.dailyGiftCount.toString();
|
||||
ui.text_boxLevel.text = "LV:" + todaylevel.toString();
|
||||
var rvo:RewardVo = new RewardVo();
|
||||
rvo.setByObject(Table.activity_info.dailyGift[todaylevel]);
|
||||
rvo.buildRewards();
|
||||
ui.list_reward.setDatas(rvo.getRewardShowArray());
|
||||
var tiptext:String = rvo.toDesString("<br/>");
|
||||
TipCenter.registTextTip(ui.mc_box,tiptext);
|
||||
ui.text_signCount.text = lang("累计签到:{0}天",Master.activityHistory.dailyGiftSignCount.toString());
|
||||
updateVip();
|
||||
}
|
||||
|
||||
public function updateVip(e:Object = null) : void
|
||||
{
|
||||
var day:int = MasterCenter.getIns().getVipDay();
|
||||
if(day > 0)
|
||||
{
|
||||
ui.btn_vipBuy.visible = false;
|
||||
ui.text_vip.text = lang("剩余:{0}天",day);
|
||||
if(MasterCenter.getIns().getVipChecked())
|
||||
{
|
||||
ui.btn_vipCheck.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_vipCheck.visible = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_vip.visible = false;
|
||||
ui.btn_vipBuy.visible = GameMath.OpenPay;
|
||||
ui.btn_vipCheck.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
GlobalBroadcast.removeEventListener(MYREvent.VIP_STATUS_CHANGE,updateVip);
|
||||
TipCenter.remove(ui.mc_box);
|
||||
PiLightButton.btnTouchLight.removeDisplay(ui.mc_box);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package net.pixvi.myr.panel.event.dailygift
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.panel.stage.DropListItem;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ActiDailyGiftUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_box1:PiLightButton;
|
||||
|
||||
public var btn_box2:PiLightButton;
|
||||
|
||||
public var btn_box3:PiLightButton;
|
||||
|
||||
public var btn_box4:PiLightButton;
|
||||
|
||||
public var btn_box5:PiLightButton;
|
||||
|
||||
public var text_daynum:PiBitTextField;
|
||||
|
||||
public var list_reward:PiDataList;
|
||||
|
||||
public var list_vipReward:PiDataList;
|
||||
|
||||
public var mc_path:MovieClip;
|
||||
|
||||
public var mc_box:MovieClip;
|
||||
|
||||
public var mc_today:MovieClip;
|
||||
|
||||
public var text_checkDays:PiBitTextField;
|
||||
|
||||
public var text_boxLevel:PiBitTextField;
|
||||
|
||||
public var btn_check:PiLightButton;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var btn_vipCheck:PiLightButton;
|
||||
|
||||
public var btn_vipBuy:PiLightButton;
|
||||
|
||||
public var text_vip:PiBitTextField;
|
||||
|
||||
public var text_signCount:PiBitTextField;
|
||||
|
||||
public var ui_loop:ActiDailyLoopCheckRewardUI;
|
||||
|
||||
public function ActiDailyGiftUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.EventDailyGiftPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
mc_path.stop();
|
||||
mc_box.stop();
|
||||
list_reward.itemClass = DropListItem;
|
||||
list_reward.setItemPara("modeResult",true);
|
||||
list_vipReward.itemClass = DropListItem;
|
||||
list_vipReward.setItemPara("modeResult",true);
|
||||
if(!(GameMath.OpenPay && Table.setting.closePay != true))
|
||||
{
|
||||
text_vip.visible = list_vipReward.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function todaylevel(level:int = 1, checked:Boolean = false) : void
|
||||
{
|
||||
var tomorrowLevel:int = level;
|
||||
if(checked)
|
||||
{
|
||||
tomorrowLevel = level + 1 > 5 ? 5 : level + 1;
|
||||
mc_today.x = this["btn_box" + tomorrowLevel].x;
|
||||
mc_today.y = this["btn_box" + tomorrowLevel].y;
|
||||
mc_today.gotoAndStop(2);
|
||||
mc_path.gotoAndStop(tomorrowLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_today.x = this["btn_box" + level].x;
|
||||
mc_today.y = this["btn_box" + level].y;
|
||||
mc_today.gotoAndStop(1);
|
||||
mc_path.gotoAndStop(level);
|
||||
}
|
||||
mc_box.gotoAndStop(level);
|
||||
btn_check.visible = !checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package net.pixvi.myr.panel.event.dailygift
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.myr.panel.task.ItemCardUI;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ActiDailyLoopCheckRewardUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_get:PiLightButton;
|
||||
|
||||
public var text_passDay:PiBitTextField;
|
||||
|
||||
public var text_targetDay:TextField;
|
||||
|
||||
public var card_item:ItemCardUI;
|
||||
|
||||
public function ActiDailyLoopCheckRewardUI(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,117 @@
|
||||
package net.pixvi.myr.panel.exchange
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.ShopCenter;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.panel.bag.UseItemPanel;
|
||||
import net.pixvi.myr.panel.reward.RewardShowPanel;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class ExchangePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:ExchangePanelUI = new ExchangePanelUI();
|
||||
|
||||
public var mode:String = "shop";
|
||||
|
||||
private var rewardNum:int = 0;
|
||||
|
||||
public function ExchangePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
buffMode = false;
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
}
|
||||
|
||||
public static function getIns() : ExchangePanel
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(ExchangePanel) as ExchangePanel;
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
ui.list_list.setDatas(ShopCenter.getIns().getExchangeDatas(mode));
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
ui.list_list.addEventListener("piselect",selectHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function selectHandler(e:Event = null) : void
|
||||
{
|
||||
var hasNum:int = 0;
|
||||
var transNum:int = 0;
|
||||
var exchangeObj:Object = ui.list_list.curSelectedItemData;
|
||||
var maxNum:int = 2147483647;
|
||||
for each(var odata:Object in exchangeObj.need.items)
|
||||
{
|
||||
hasNum = BagCenter.getIns().getByType(odata.typeId).num;
|
||||
transNum = int(hasNum / odata.num);
|
||||
if(transNum < maxNum)
|
||||
{
|
||||
maxNum = transNum;
|
||||
}
|
||||
}
|
||||
if(maxNum > ShopCenter.getIns().getExchangeLeftNum(exchangeObj.id))
|
||||
{
|
||||
maxNum = ShopCenter.getIns().getExchangeLeftNum(exchangeObj.id);
|
||||
}
|
||||
var reward:RewardVo = new RewardVo();
|
||||
reward.setByObject(exchangeObj.reward);
|
||||
var rewardresults:Array = reward.buildRewards();
|
||||
var item:ItemVo = rewardresults[0];
|
||||
item.num = 1;
|
||||
rewardNum = rewardresults[0].num;
|
||||
UseItemPanel.getIns().useItem(item,true,maxNum,onNumChange,onNumComplete,0);
|
||||
UseItemPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
private function onNumChange(num:int) : void
|
||||
{
|
||||
UseItemPanel.getIns().ui.text_msg.text = lang("选择兑换次数");
|
||||
if(rewardNum > 1)
|
||||
{
|
||||
UseItemPanel.getIns().ui.text_name.text = UseItemPanel.getIns().cur.name + "×" + rewardNum;
|
||||
}
|
||||
}
|
||||
|
||||
private function onNumComplete(num:int) : void
|
||||
{
|
||||
ShopCenter.getIns().exchangeItem(ui.list_list.curSelectedItemData.id,num,exchangeHandler);
|
||||
}
|
||||
|
||||
public function exchangeHandler(rewardResultVo:RewardResultVo) : void
|
||||
{
|
||||
RewardShowPanel.showByVo(rewardResultVo);
|
||||
ui.list_list.refresh();
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
public function popInExchange(team:String) : void
|
||||
{
|
||||
mode = team;
|
||||
popIn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.panel.exchange
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ExchangePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var list_list:PiSliderList;
|
||||
|
||||
public function ExchangePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.ExchangePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_list.setList(ExchangeSliderListItem,5,false,128);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package net.pixvi.myr.panel.exchange
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.Event;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.ShopCenter;
|
||||
import net.pixvi.myr.element.cost.CostVo;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.panel.build.CostShowMiddleItem;
|
||||
import net.pixvi.myr.panel.task.ItemCardUI;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderListItem;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class ExchangeSliderListItem extends PiSliderListItem
|
||||
{
|
||||
|
||||
public var list_need:PiDataList;
|
||||
|
||||
public var ui_getItemCard:ItemCardUI;
|
||||
|
||||
public var text_numTitle:TextField;
|
||||
|
||||
public var text_num:TextField;
|
||||
|
||||
public var btn_exchange:PiLightButton;
|
||||
|
||||
public function ExchangeSliderListItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.ExchangeSliderListItemUI");
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_need.itemClass = CostShowMiddleItem;
|
||||
ui_getItemCard.modeBig();
|
||||
ui_getItemCard.showMode = 1;
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var leftNum:int = 0;
|
||||
var rewardData:RewardVo = new RewardVo();
|
||||
rewardData.setByObject(value.reward);
|
||||
var rewardArr:Array = rewardData.getRewardShowArray();
|
||||
ui_getItemCard.onAutoData(rewardArr[0]);
|
||||
var costVo:CostVo = new CostVo();
|
||||
costVo.setByVo(value.need);
|
||||
list_need.setDatas(costVo.getShowArray());
|
||||
var useAble:Boolean = true;
|
||||
if(value.exchangeCondition != null)
|
||||
{
|
||||
if(value.exchangeCondition.exchangeType == "GLOBAL")
|
||||
{
|
||||
text_numTitle.text = lang("可兑换次数:");
|
||||
}
|
||||
else if(value.exchangeCondition.exchangeType == "EVERYDAY")
|
||||
{
|
||||
text_numTitle.text = lang("每日兑换次数:");
|
||||
}
|
||||
leftNum = ShopCenter.getIns().getExchangeLeftNum(value.id);
|
||||
if(leftNum <= 0)
|
||||
{
|
||||
useAble = false;
|
||||
}
|
||||
text_num.text = leftNum + "/" + value.exchangeCondition.exchangeNum;
|
||||
text_num.visible = text_numTitle.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_num.visible = text_numTitle.visible = false;
|
||||
}
|
||||
if(!BagCenter.getIns().checkCost(costVo,true))
|
||||
{
|
||||
useAble = false;
|
||||
}
|
||||
btn_exchange.enabled = useAble;
|
||||
btn_exchange.alpha = useAble ? 1 : 0.5;
|
||||
btn_exchange.onClick(confirmHandler);
|
||||
}
|
||||
|
||||
public function confirmHandler(e:Event = null) : void
|
||||
{
|
||||
sendSelect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user