Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
package net.pixvi.myr.panel.noticepanel
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.manager.resource.RM;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.mobi.MobiTools;
|
||||
import net.pixvi.myr.net.NetSystem;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.net.PiStringLoader;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class NoticePanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var noticeData:Object;
|
||||
|
||||
public var ui:NoticePanelUI = new NoticePanelUI();
|
||||
|
||||
private var loader:PiStringLoader;
|
||||
|
||||
private var data:Object;
|
||||
|
||||
private var starty:int;
|
||||
|
||||
private var startRoll:int;
|
||||
|
||||
public function NoticePanel(showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
buffMode = false;
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.text_content.htmlText = "<center>Loading...</center>";
|
||||
if(noticeData != null)
|
||||
{
|
||||
update(noticeData);
|
||||
}
|
||||
else
|
||||
{
|
||||
NetSystem.getIns().getNotice(update);
|
||||
}
|
||||
}
|
||||
|
||||
public function update(notice:Object) : void
|
||||
{
|
||||
noticeData = notice;
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_rule.selected = true;
|
||||
ui.btn_rule.onClick(ui.btn_rule.switchSelectStatus);
|
||||
ui.btn_readRule.onClick(readRuleHandler);
|
||||
if(notice != null && notice.open)
|
||||
{
|
||||
if(notice.img == null || notice.img == "")
|
||||
{
|
||||
ui.container_img.loadNetImg("data/img/event/event_welcom.png");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.container_img.loadNetImg(notice.img);
|
||||
}
|
||||
ui.text_content.htmlText = notice.text;
|
||||
ui.text_content.mouseEnabled = true;
|
||||
ui.text_content.addEventListener(MobiEvent.MOUSE_DOWN,downDragHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
GlobalBroadcast.addEventListener("androidBack",AndroidBackHandler);
|
||||
}
|
||||
|
||||
private function AndroidBackHandler(e:Event = null) : void
|
||||
{
|
||||
if(PopCenter.getIns().topPanel == this)
|
||||
{
|
||||
closeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function readRuleHandler(e:Event = null) : void
|
||||
{
|
||||
ui.text_content.text = RM.TXT.getTxt("rule");
|
||||
}
|
||||
|
||||
private function downDragHandler(e:Event) : void
|
||||
{
|
||||
starty = e["stageY"];
|
||||
startRoll = ui.text_content.scrollV;
|
||||
ui.text_content.addEventListener(MobiEvent.MOUSE_MOVE,downDragMoveHandler);
|
||||
StageDriver.stage.addEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
}
|
||||
|
||||
private function downDragMoveHandler(e:Event) : void
|
||||
{
|
||||
var dt:int = e["stageY"] - starty;
|
||||
ui.text_content.scrollV = startRoll - dt / 10;
|
||||
}
|
||||
|
||||
private function upDragHandler(e:Event) : void
|
||||
{
|
||||
ui.text_content.removeEventListener(MobiEvent.MOUSE_MOVE,downDragMoveHandler);
|
||||
StageDriver.stage.removeEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
}
|
||||
|
||||
public function onyesHandler(e:Event = null) : void
|
||||
{
|
||||
StageDriver.stage.removeEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
MobiTools.getIns().exit();
|
||||
}
|
||||
|
||||
private function retry() : void
|
||||
{
|
||||
ui.btn_close.onClick(closeHandler,true);
|
||||
NetSystem.getIns().getNotice(update);
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
if(!ui.btn_rule.selected)
|
||||
{
|
||||
Alert.yes(lang("提示"),"同意 游戏许可及服务协议 后可进入游戏。");
|
||||
return;
|
||||
}
|
||||
if(data != null && data.close != null && data.close == true)
|
||||
{
|
||||
Alert.yes(lang("提示"),data.closeMsg,retry);
|
||||
return;
|
||||
}
|
||||
GlobalBroadcast.removeEventListener("androidBack",AndroidBackHandler);
|
||||
if(openPanel != null)
|
||||
{
|
||||
openPanel.visible = true;
|
||||
}
|
||||
this.showOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package net.pixvi.myr.panel.noticepanel
|
||||
{
|
||||
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.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class NoticePanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var text_content:TextField;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var btn_readRule:PiLightButton;
|
||||
|
||||
public var btn_rule:PiLightButton;
|
||||
|
||||
public function NoticePanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.NoticePanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_img.cryptoMode = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
package net.pixvi.myr.panel.noticepanel
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.mobi.MobiTools;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.net.PiStringLoader;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
import net.pixvi.pse.file.FileTools;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class NoticeXieyiPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public var ui:NoticeXieyiPanelUI = new NoticeXieyiPanelUI();
|
||||
|
||||
private var loader:PiStringLoader;
|
||||
|
||||
public var whenComplete:Function;
|
||||
|
||||
public var curFlag:int = 0;
|
||||
|
||||
public var singleModeFlag:int = -1;
|
||||
|
||||
private var starty:int;
|
||||
|
||||
private var startRoll:int;
|
||||
|
||||
public function NoticeXieyiPanel(onComplete:Function = null, showTime:Number = -1, hideTime:Number = -1, singleModeFlag:int = -1)
|
||||
{
|
||||
this.singleModeFlag = singleModeFlag;
|
||||
whenComplete = onComplete;
|
||||
buffMode = false;
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
showCur();
|
||||
ui.btn_no.onClick(noHandler);
|
||||
if(singleModeFlag != -1)
|
||||
{
|
||||
ui.btn_yes.onClick(singleYesHandler);
|
||||
ui.btn_no.visible = false;
|
||||
ui.btn_yes.visible = false;
|
||||
ui.mc_lock.visible = false;
|
||||
ui.mc_lock.alpha = 0;
|
||||
ui.btn_close.onClick(noHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ui.btn_close != null)
|
||||
{
|
||||
ui.btn_close.visible = false;
|
||||
}
|
||||
ui.btn_yes.onClick(yesHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public static function pop(whenComplete:Function, singleModeFlag:int = -1) : void
|
||||
{
|
||||
var pn:NoticeXieyiPanel = new NoticeXieyiPanel(null,-1,-1,singleModeFlag);
|
||||
pn.whenComplete = whenComplete;
|
||||
PopCenter.POP(pn);
|
||||
}
|
||||
|
||||
public static function needShow() : Boolean
|
||||
{
|
||||
var o:Object = Saver.get("myrzx","xieyi");
|
||||
if(o != null && o == true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(Table.setting.ys == null || Table.setting.ys[MyrCenter.channel] != true || Saver.getAuto("ysShowed") != null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function needOpen() : Boolean
|
||||
{
|
||||
if(Table.setting.xieyi != null && Table.setting.xieyi[MyrCenter.channel] != null && Table.setting.xieyi[MyrCenter.channel].length > 0)
|
||||
{
|
||||
var checked:Object = Saver.getAuto("firstOpenXieyi");
|
||||
if(checked != null && checked == "true")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function checkOver() : void
|
||||
{
|
||||
Saver.saveAuto("firstOpenXieyi","true");
|
||||
}
|
||||
|
||||
public function noHandler(e:Event = null) : void
|
||||
{
|
||||
if(singleModeFlag != -1)
|
||||
{
|
||||
this.showOut();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.yesno("提示","只有完成阅读并同意协议才能继续游戏,是否退出游戏?",MobiTools.getIns().exit);
|
||||
}
|
||||
}
|
||||
|
||||
public function yesHandler(e:Event = null) : void
|
||||
{
|
||||
curFlag++;
|
||||
var datas:Array = Table.setting.xieyi[MyrCenter.channel];
|
||||
if(datas[curFlag] != null)
|
||||
{
|
||||
showCur();
|
||||
}
|
||||
else
|
||||
{
|
||||
checkOver();
|
||||
this.showOut();
|
||||
whenComplete();
|
||||
}
|
||||
}
|
||||
|
||||
public function singleYesHandler(e:Event = null) : void
|
||||
{
|
||||
this.showOut();
|
||||
}
|
||||
|
||||
public function showCur() : void
|
||||
{
|
||||
if(singleModeFlag != -1)
|
||||
{
|
||||
curFlag = singleModeFlag;
|
||||
}
|
||||
var datas:Array = Table.setting.xieyi[MyrCenter.channel];
|
||||
TweenMax.fromTo(ui,0.3,{"alpha":0},{"alpha":1});
|
||||
ui.text_content.htmlText = "<center>Loading...</center>";
|
||||
ui.text_title.text = "";
|
||||
var cleanStr:String = "1.2您可通过添加在线客服QQ:2816985481与我们联系;";
|
||||
var cleanStr2:String = "二〇二一年五月";
|
||||
var cleanStr2Add:String = "二〇二一年五月";
|
||||
ui.text_content.text = FileTools.readFileText(FileTools.applicationDirectory.resolvePath(datas[curFlag].file)).replace(cleanStr,"");
|
||||
ui.text_content.text = ui.text_content.text.replace(cleanStr2,cleanStr2Add);
|
||||
ui.text_title.text = datas[curFlag].title;
|
||||
ui.text_content.scrollV = 0;
|
||||
ui.slider_bar.bindTextField(ui.text_content);
|
||||
ui.btn_yes.enabled = false;
|
||||
ui.mc_lock.visible = true;
|
||||
ui.text_content.mouseEnabled = true;
|
||||
ui.text_content.addEventListener(MobiEvent.MOUSE_DOWN,downDragHandler);
|
||||
ui.text_content.addEventListener("scroll",scrollHandler);
|
||||
if(ui.text_content.scrollV == ui.text_content.maxScrollV)
|
||||
{
|
||||
finishView();
|
||||
}
|
||||
}
|
||||
|
||||
public function scrollHandler(e:Event = null) : void
|
||||
{
|
||||
if(ui.text_content.scrollV == ui.text_content.maxScrollV)
|
||||
{
|
||||
finishView();
|
||||
}
|
||||
}
|
||||
|
||||
private function downDragHandler(e:Event) : void
|
||||
{
|
||||
starty = e["stageY"];
|
||||
startRoll = ui.text_content.scrollV;
|
||||
ui.text_content.addEventListener(MobiEvent.MOUSE_MOVE,downDragMoveHandler);
|
||||
StageDriver.stage.addEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
}
|
||||
|
||||
private function downDragMoveHandler(e:Event) : void
|
||||
{
|
||||
var dt:int = e["stageY"] - starty;
|
||||
ui.text_content.scrollV = startRoll - dt / 10;
|
||||
if(ui.text_content.scrollV == ui.text_content.maxScrollV)
|
||||
{
|
||||
finishView();
|
||||
}
|
||||
}
|
||||
|
||||
public function finishView() : void
|
||||
{
|
||||
ui.text_content.removeEventListener("scroll",scrollHandler);
|
||||
ui.btn_yes.enabled = true;
|
||||
ui.mc_lock.visible = false;
|
||||
}
|
||||
|
||||
private function upDragHandler(e:Event) : void
|
||||
{
|
||||
ui.text_content.removeEventListener(MobiEvent.MOUSE_MOVE,downDragMoveHandler);
|
||||
StageDriver.stage.removeEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
}
|
||||
|
||||
public function onyesHandler(e:Event = null) : void
|
||||
{
|
||||
StageDriver.stage.removeEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
MobiTools.getIns().exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package net.pixvi.myr.panel.noticepanel
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiSliderBar;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class NoticeXieyiPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_yes:PiLightButton;
|
||||
|
||||
public var btn_no:PiLightButton;
|
||||
|
||||
public var mc_lock:Sprite;
|
||||
|
||||
public var text_content:TextField;
|
||||
|
||||
public var text_title:TextField;
|
||||
|
||||
public var slider_bar:PiSliderBar;
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public function NoticeXieyiPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.NoticeXieyiPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package net.pixvi.myr.panel.noticepanel
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.manager.resource.RM;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.mobi.MobiTools;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.net.PiStringLoader;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
import net.pixvi.pse.file.FileTools;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class NoticeYSPanel extends PSGPopPanel
|
||||
{
|
||||
|
||||
public static var noticeData:Object;
|
||||
|
||||
public var ui:NoticeYSPanelUI = new NoticeYSPanelUI();
|
||||
|
||||
private var loader:PiStringLoader;
|
||||
|
||||
private var data:Object;
|
||||
|
||||
public var whenComplete:Function;
|
||||
|
||||
private var starty:int;
|
||||
|
||||
private var startRoll:int;
|
||||
|
||||
public function NoticeYSPanel(onComplete:Function = null, showTime:Number = -1, hideTime:Number = -1)
|
||||
{
|
||||
whenComplete = onComplete;
|
||||
buffMode = false;
|
||||
addChild(ui);
|
||||
super(showTime,hideTime);
|
||||
ui.text_content.htmlText = "<center>Loading...</center>";
|
||||
update();
|
||||
}
|
||||
|
||||
public static function needShow() : Boolean
|
||||
{
|
||||
if(Table.setting.ys == null || Table.setting.ys[MyrCenter.channel] != true || Saver.getAuto("ysShowed") != null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
ui.btn_close.onClick(closeHandler);
|
||||
ui.btn_rule.selected = false;
|
||||
ui.btn_rule.onClick(ui.btn_rule.switchSelectStatus);
|
||||
ui.btn_readRule.onClick(ui.btn_rule.switchSelectStatus);
|
||||
if(MyrCenter.channel == "MEIZU")
|
||||
{
|
||||
ui.text_content.text = FileTools.readFileText(FileTools.applicationDirectory.resolvePath("rule_ysxyBX.txt"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.text_content.text = RM.TXT.getTxt("rule2");
|
||||
}
|
||||
ui.text_content.mouseEnabled = true;
|
||||
ui.text_content.addEventListener(MobiEvent.MOUSE_DOWN,downDragHandler);
|
||||
}
|
||||
|
||||
private function downDragHandler(e:Event) : void
|
||||
{
|
||||
starty = e["stageY"];
|
||||
startRoll = ui.text_content.scrollV;
|
||||
ui.text_content.addEventListener(MobiEvent.MOUSE_MOVE,downDragMoveHandler);
|
||||
StageDriver.stage.addEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
}
|
||||
|
||||
private function downDragMoveHandler(e:Event) : void
|
||||
{
|
||||
var dt:int = e["stageY"] - starty;
|
||||
ui.text_content.scrollV = startRoll - dt / 10;
|
||||
}
|
||||
|
||||
private function upDragHandler(e:Event) : void
|
||||
{
|
||||
ui.text_content.removeEventListener(MobiEvent.MOUSE_MOVE,downDragMoveHandler);
|
||||
StageDriver.stage.removeEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
}
|
||||
|
||||
public function onyesHandler(e:Event = null) : void
|
||||
{
|
||||
StageDriver.stage.removeEventListener(MobiEvent.MOUSE_UP,upDragHandler);
|
||||
MobiTools.getIns().exit();
|
||||
}
|
||||
|
||||
public function closeHandler(e:Event = null) : void
|
||||
{
|
||||
if(!ui.btn_rule.selected)
|
||||
{
|
||||
Alert.yes(lang("提示"),"同意 游戏隐私协议 后可进入游戏。");
|
||||
return;
|
||||
}
|
||||
Saver.saveAuto("ysShowed",true);
|
||||
if(openPanel != null)
|
||||
{
|
||||
openPanel.visible = true;
|
||||
}
|
||||
this.showOut();
|
||||
if(whenComplete != null)
|
||||
{
|
||||
whenComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package net.pixvi.myr.panel.noticepanel
|
||||
{
|
||||
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.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class NoticeYSPanelUI extends UIComponent
|
||||
{
|
||||
|
||||
public var btn_close:PiLightButton;
|
||||
|
||||
public var text_content:TextField;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var btn_readRule:PiLightButton;
|
||||
|
||||
public var btn_rule:PiLightButton;
|
||||
|
||||
public function NoticeYSPanelUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.NoticeYSPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user