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