Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -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 + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user