mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-20 09:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,548 @@
|
||||
package
|
||||
{
|
||||
import com.sbi.corelib.Utils;
|
||||
import com.sbi.corelib.audio.SBAudio;
|
||||
import flash.net.SharedObject;
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
public class AJAudio
|
||||
{
|
||||
|
||||
private static var _hasLoadedDailySpinSfx:Boolean;
|
||||
|
||||
private static var _hasLoadedGiftUnwrapSfx:Boolean;
|
||||
|
||||
private static var _hasLoadedJourneyBookWorldSfx:Boolean;
|
||||
|
||||
private static var _hasLoadedJourneyBookBookSfx:Boolean;
|
||||
|
||||
private static var _hasLoadedTradeSfx:Boolean;
|
||||
|
||||
private static var _defaultVolumes:Dictionary;
|
||||
|
||||
public function AJAudio()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init(param1:Function = null) : void
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
if(!SBAudio.isInitialized)
|
||||
{
|
||||
_loc2_ = {};
|
||||
_loc2_["HudBtnRollover"] = {
|
||||
"className":Utils.getDefByName("HudBtnRollover") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["HudBtnClick"] = {
|
||||
"className":Utils.getDefByName("HudBtnClick") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["SubMenuBtnRollover"] = {
|
||||
"className":Utils.getDefByName("SubMenuBtnRollover") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["SubMenuBtnClick"] = {
|
||||
"className":Utils.getDefByName("SubMenuBtnClick") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["ExitBtnRollover"] = {
|
||||
"className":Utils.getDefByName("ExitBtnRollover") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["ExitBtnClick"] = {
|
||||
"className":Utils.getDefByName("ExitBtnClick") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["ScrollUpDown"] = {
|
||||
"className":Utils.getDefByName("ScrollUpDown") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["ScrollLeftRight"] = {
|
||||
"className":Utils.getDefByName("ScrollLeftRight") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["TextType"] = {
|
||||
"className":Utils.getDefByName("TextType") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["TextEnter"] = {
|
||||
"className":Utils.getDefByName("TextEnter") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["IdleWarningSound"] = {
|
||||
"className":Utils.getDefByName("IdleWarningSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["ShopCachingSound"] = {
|
||||
"className":Utils.getDefByName("ShopCachingSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["GemsEarnedSound"] = {
|
||||
"className":Utils.getDefByName("GemsEarnedSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["ItemRecycledSound"] = {
|
||||
"className":Utils.getDefByName("ItemRecycledSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["MailReceivedSound"] = {
|
||||
"className":Utils.getDefByName("MailReceivedSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["BuddyOnlineOfflineSound"] = {
|
||||
"className":Utils.getDefByName("BuddyOnlineOfflineSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["NewspaperSound"] = {
|
||||
"className":Utils.getDefByName("NewspaperSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["MailSentSound"] = {
|
||||
"className":Utils.getDefByName("MailSentSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["AchievementSound"] = {
|
||||
"className":Utils.getDefByName("AchievementSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["BuddyCardOpen"] = {
|
||||
"className":Utils.getDefByName("BuddyCardOpen") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["BuddyCardClose"] = {
|
||||
"className":Utils.getDefByName("BuddyCardClose") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["LimitedChatErrorSound"] = {
|
||||
"className":Utils.getDefByName("LimitedChatErrorSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["ChatOpenSound"] = {
|
||||
"className":Utils.getDefByName("ChatOpenSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["ChatCloseSound"] = {
|
||||
"className":Utils.getDefByName("ChatCloseSound") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["RandomLever"] = {
|
||||
"className":Utils.getDefByName("RandomLever") as Class,
|
||||
"volume":0.2
|
||||
};
|
||||
_loc2_["NameGenRotationSound"] = {
|
||||
"className":Utils.getDefByName("NameGenRotationSound") as Class,
|
||||
"volume":1
|
||||
};
|
||||
_loc2_["NameGenStopSound"] = {
|
||||
"className":Utils.getDefByName("NameGenStopSound") as Class,
|
||||
"volume":1
|
||||
};
|
||||
_loc2_["DoorBellSound"] = {
|
||||
"className":Utils.getDefByName("DoorBellSound") as Class,
|
||||
"volume":1
|
||||
};
|
||||
SBAudio.init(_loc2_,param1);
|
||||
_defaultVolumes = new Dictionary();
|
||||
_defaultVolumes["FW_TRAIL_1"] = 0.2;
|
||||
_defaultVolumes["FW_TRAIL_2"] = 0.2;
|
||||
_defaultVolumes["FW_TRAIL_3"] = 0.2;
|
||||
_defaultVolumes["FW_LAUNCH_1"] = 0.3;
|
||||
_defaultVolumes["FW_LAUNCH_2"] = 0.3;
|
||||
_defaultVolumes["FW_LAUNCH_3"] = 0.3;
|
||||
_defaultVolumes["FW_EXPLOSION_1"] = 0.3;
|
||||
_defaultVolumes["FW_EXPLOSION_2"] = 0.3;
|
||||
_defaultVolumes["FW_EXPLOSION_3"] = 0.3;
|
||||
_defaultVolumes["DOOR_WOOD_OPEN"] = 0.3;
|
||||
_defaultVolumes["DOOR_WOOD_CLOSE"] = 0.3;
|
||||
_defaultVolumes["DOOR_SLIDE"] = 0.3;
|
||||
_defaultVolumes["DOOR_STONE_SLIDE"] = 0.3;
|
||||
_defaultVolumes["aj_water_fs1"] = 0;
|
||||
_defaultVolumes["aj_water_fs2"] = 0;
|
||||
_defaultVolumes["aj_water_fs3"] = 0;
|
||||
_defaultVolumes["BOUNCE"] = 0.4;
|
||||
_defaultVolumes["aj_slideBounce1"] = 0.28;
|
||||
_defaultVolumes["aj_slideBounce2"] = 0.28;
|
||||
}
|
||||
}
|
||||
|
||||
public static function loadSfx(param1:String, param2:Class, param3:Number = 0.3) : void
|
||||
{
|
||||
if(_defaultVolumes[param1])
|
||||
{
|
||||
param3 = Number(_defaultVolumes[param1]);
|
||||
}
|
||||
SBAudio.addCachedSound(param1,param2,param3);
|
||||
}
|
||||
|
||||
public static function setupSharedObject(param1:SharedObject) : void
|
||||
{
|
||||
SBAudio.setupSharedObject(param1);
|
||||
}
|
||||
|
||||
public static function playSfx(param1:String, param2:int = 1) : void
|
||||
{
|
||||
SBAudio.playCachedSound(param1,param2);
|
||||
}
|
||||
|
||||
public static function stopSfx(param1:String) : void
|
||||
{
|
||||
SBAudio.stopCachedSound(param1);
|
||||
}
|
||||
|
||||
public static function playHudBtnRollover() : void
|
||||
{
|
||||
playSfx("HudBtnRollover");
|
||||
}
|
||||
|
||||
public static function playHudBtnClick() : void
|
||||
{
|
||||
playSfx("HudBtnClick");
|
||||
}
|
||||
|
||||
public static function playSubMenuBtnRollover() : void
|
||||
{
|
||||
playSfx("SubMenuBtnRollover");
|
||||
}
|
||||
|
||||
public static function playSubMenuBtnClick() : void
|
||||
{
|
||||
playSfx("SubMenuBtnClick");
|
||||
}
|
||||
|
||||
public static function playExitBtnRollover() : void
|
||||
{
|
||||
playSfx("ExitBtnRollover");
|
||||
}
|
||||
|
||||
public static function playExitBtnClick() : void
|
||||
{
|
||||
playSfx("ExitBtnClick");
|
||||
}
|
||||
|
||||
public static function playScrollUpDown() : void
|
||||
{
|
||||
playSfx("ScrollUpDown");
|
||||
}
|
||||
|
||||
public static function playScrollLeftRight() : void
|
||||
{
|
||||
playSfx("ScrollLeftRight");
|
||||
}
|
||||
|
||||
public static function playTextType() : void
|
||||
{
|
||||
playSfx("TextType");
|
||||
}
|
||||
|
||||
public static function playTextEnter() : void
|
||||
{
|
||||
playSfx("TextEnter");
|
||||
}
|
||||
|
||||
public static function playIdleWarningSound() : void
|
||||
{
|
||||
playSfx("IdleWarningSound");
|
||||
}
|
||||
|
||||
public static function playShopCachingSound() : void
|
||||
{
|
||||
playSfx("ShopCachingSound");
|
||||
}
|
||||
|
||||
public static function playGemsEarnedSound() : void
|
||||
{
|
||||
playSfx("GemsEarnedSound");
|
||||
}
|
||||
|
||||
public static function playItemRecycledSound() : void
|
||||
{
|
||||
playSfx("ItemRecycledSound");
|
||||
}
|
||||
|
||||
public static function playMailReceivedSound() : void
|
||||
{
|
||||
playSfx("MailReceivedSound");
|
||||
}
|
||||
|
||||
public static function playMailSentSound() : void
|
||||
{
|
||||
playSfx("MailSentSound");
|
||||
}
|
||||
|
||||
public static function playBuddyOnlineOfflineSound() : void
|
||||
{
|
||||
playSfx("BuddyOnlineOfflineSound");
|
||||
}
|
||||
|
||||
public static function playNewspaperSound() : void
|
||||
{
|
||||
playSfx("NewspaperSound");
|
||||
}
|
||||
|
||||
public static function playAchievementSound() : void
|
||||
{
|
||||
playSfx("AchievementSound");
|
||||
}
|
||||
|
||||
public static function playBuddyCardOpen() : void
|
||||
{
|
||||
playSfx("BuddyCardOpen");
|
||||
}
|
||||
|
||||
public static function playBuddyCardClose() : void
|
||||
{
|
||||
playSfx("BuddyCardClose");
|
||||
}
|
||||
|
||||
public static function playLimitedChatErrorSound() : void
|
||||
{
|
||||
playSfx("LimitedChatErrorSound");
|
||||
}
|
||||
|
||||
public static function playChatOpenSound() : void
|
||||
{
|
||||
playSfx("ChatOpenSound");
|
||||
}
|
||||
|
||||
public static function playChatCloseSound() : void
|
||||
{
|
||||
playSfx("ChatCloseSound");
|
||||
}
|
||||
|
||||
public static function playRandomLever() : void
|
||||
{
|
||||
playSfx("RandomLever");
|
||||
}
|
||||
|
||||
public static function playNameGenRotationSound(param1:int = 1) : void
|
||||
{
|
||||
playSfx("NameGenRotationSound",param1);
|
||||
}
|
||||
|
||||
public static function playNameGenStopSound() : void
|
||||
{
|
||||
playSfx("NameGenStopSound");
|
||||
}
|
||||
|
||||
public static function playDoorBellSound() : void
|
||||
{
|
||||
playSfx("DoorBellSound");
|
||||
}
|
||||
|
||||
public static function stopNameGenRotationSound() : void
|
||||
{
|
||||
stopSfx("NameGenRotationSound");
|
||||
}
|
||||
|
||||
public static function stopRandomLever() : void
|
||||
{
|
||||
stopSfx("RandomLever");
|
||||
}
|
||||
|
||||
public static function get hasLoadedDailySpinSfx() : Boolean
|
||||
{
|
||||
return _hasLoadedDailySpinSfx;
|
||||
}
|
||||
|
||||
public static function set hasLoadedDailySpinSfx(param1:Boolean) : void
|
||||
{
|
||||
_hasLoadedDailySpinSfx = param1;
|
||||
}
|
||||
|
||||
public static function playDailySpinSpin() : void
|
||||
{
|
||||
if(!_hasLoadedDailySpinSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("DailySpinSpin");
|
||||
}
|
||||
|
||||
public static function playDailySpinBub1() : void
|
||||
{
|
||||
if(!_hasLoadedDailySpinSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("DailySpinBub1");
|
||||
}
|
||||
|
||||
public static function playDailySpinBub2() : void
|
||||
{
|
||||
if(!_hasLoadedDailySpinSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("DailySpinBub2");
|
||||
}
|
||||
|
||||
public static function playDailySpinBub3() : void
|
||||
{
|
||||
if(!_hasLoadedDailySpinSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("DailySpinBub3");
|
||||
}
|
||||
|
||||
public static function get hasLoadedGiftUnwrapSfx() : Boolean
|
||||
{
|
||||
return _hasLoadedGiftUnwrapSfx;
|
||||
}
|
||||
|
||||
public static function set hasLoadedGiftUnwrapSfx(param1:Boolean) : void
|
||||
{
|
||||
_hasLoadedGiftUnwrapSfx = param1;
|
||||
}
|
||||
|
||||
public static function playGiftUnwrap() : void
|
||||
{
|
||||
if(!_hasLoadedGiftUnwrapSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("GiftUnwrap");
|
||||
}
|
||||
|
||||
public static function playTreasureUnwrap() : void
|
||||
{
|
||||
if(!_hasLoadedGiftUnwrapSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("TreasureUnwrap");
|
||||
}
|
||||
|
||||
public static function playTreasureBagUnwrap() : void
|
||||
{
|
||||
if(!_hasLoadedGiftUnwrapSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("TreasureBagUnwrap");
|
||||
}
|
||||
|
||||
public static function playTreasureLuckyUnwrap() : void
|
||||
{
|
||||
if(!_hasLoadedGiftUnwrapSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("EpicLuckyTreasureUnwrap");
|
||||
}
|
||||
|
||||
public static function playTreasureEggUnwrap() : void
|
||||
{
|
||||
if(!_hasLoadedGiftUnwrapSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("TreasureGoldenEgg");
|
||||
}
|
||||
|
||||
public static function get hasLoadedJourneyBookWorldSfx() : Boolean
|
||||
{
|
||||
return _hasLoadedJourneyBookWorldSfx;
|
||||
}
|
||||
|
||||
public static function set hasLoadedJourneyBookWorldSfx(param1:Boolean) : void
|
||||
{
|
||||
_hasLoadedJourneyBookWorldSfx = param1;
|
||||
}
|
||||
|
||||
public static function playJBPrizeEarned() : void
|
||||
{
|
||||
if(!_hasLoadedJourneyBookWorldSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("JBPrizeEarned");
|
||||
}
|
||||
|
||||
public static function playJBWorldFactClose() : void
|
||||
{
|
||||
if(!_hasLoadedJourneyBookWorldSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("JBWorldFactClose");
|
||||
}
|
||||
|
||||
public static function playJBWorldFactOpen() : void
|
||||
{
|
||||
if(!_hasLoadedJourneyBookWorldSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("JBWorldFactOpen");
|
||||
}
|
||||
|
||||
public static function get hasLoadedJourneyBookBookSfx() : Boolean
|
||||
{
|
||||
return _hasLoadedJourneyBookBookSfx;
|
||||
}
|
||||
|
||||
public static function set hasLoadedJourneyBookBookSfx(param1:Boolean) : void
|
||||
{
|
||||
_hasLoadedJourneyBookBookSfx = param1;
|
||||
}
|
||||
|
||||
public static function playJBBookFactClose() : void
|
||||
{
|
||||
if(!_hasLoadedJourneyBookBookSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("JBBookFactClose");
|
||||
}
|
||||
|
||||
public static function playJBBookFactOpen() : void
|
||||
{
|
||||
if(!_hasLoadedJourneyBookBookSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("JBBookFactOpen");
|
||||
}
|
||||
|
||||
public static function get hasLoadedTradeSfx() : Boolean
|
||||
{
|
||||
return _hasLoadedTradeSfx;
|
||||
}
|
||||
|
||||
public static function set hasLoadedTradeSfx(param1:Boolean) : void
|
||||
{
|
||||
_hasLoadedTradeSfx = param1;
|
||||
}
|
||||
|
||||
public static function playTradeSuccessSound() : void
|
||||
{
|
||||
if(!_hasLoadedTradeSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("TradeSuccessSound");
|
||||
}
|
||||
|
||||
public static function playTradeFailedSound() : void
|
||||
{
|
||||
if(!_hasLoadedTradeSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("TradeFailedSound");
|
||||
}
|
||||
|
||||
public static function playTradeRequestSound() : void
|
||||
{
|
||||
if(!_hasLoadedTradeSfx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
playSfx("TradeRequestSound");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
package
|
||||
{
|
||||
import com.sbi.analytics.SBTracker;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.loader.LoaderCache;
|
||||
import com.sbi.loader.ResourceStack;
|
||||
import com.sbi.popup.SBStandardPopup;
|
||||
import createAccountFlow.CreateAccount;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import flash.events.UncaughtErrorEvent;
|
||||
import flash.external.ExternalInterface;
|
||||
import flash.ui.Mouse;
|
||||
import gamePlayFlow.GamePlay;
|
||||
import gui.DarkenManager;
|
||||
import loader.DefPacksDefHelper;
|
||||
import localization.LocalizationManager;
|
||||
import resource.FetchClientIPResourceStackable;
|
||||
import resource.LoadAvatarCarouselResourceStackable;
|
||||
import resource.LoadCursorResourceStackable;
|
||||
import room.DebugGUITextbox;
|
||||
import waitingRoomFlow.WaitingRoom;
|
||||
|
||||
[SWF(width="900", height="550", backgroundColor="#393625", frameRate="24")]
|
||||
public class AJClient extends Sprite
|
||||
{
|
||||
|
||||
private static var _globalErrorDebugTxt:DebugGUITextbox;
|
||||
|
||||
private var _resourceStackLoader:ResourceStack;
|
||||
|
||||
public function AJClient()
|
||||
{
|
||||
super();
|
||||
addEventListener("addedToStage",addedToStageHandler);
|
||||
}
|
||||
|
||||
public static function get globalErrorDebugTxt() : DebugGUITextbox
|
||||
{
|
||||
return _globalErrorDebugTxt;
|
||||
}
|
||||
|
||||
private static function handleGlobalErrors(param1:UncaughtErrorEvent) : void
|
||||
{
|
||||
_globalErrorDebugTxt.text = GlobalErrorCatch.setupGlobalErrorListener(param1);
|
||||
}
|
||||
|
||||
private function addedToStageHandler(param1:Event) : void
|
||||
{
|
||||
var _loc3_:Object = null;
|
||||
var _loc5_:int = 0;
|
||||
removeEventListener("addedToStage",addedToStageHandler);
|
||||
var _loc2_:Boolean = ExternalInterface.available;
|
||||
if(_loc2_)
|
||||
{
|
||||
DebugUtility.debugTrace("addedToStageHandler - extIntAvail is true");
|
||||
DebugUtility.debugTrace("mrc dm init ctor starting up call returned:" + ExternalInterface.call("mrc",["dm","AJClient addedToStageHandler starting up"]));
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugUtility.debugTrace("addedToStageHandler - extIntAvail is false");
|
||||
}
|
||||
if(!MainFrame.isInitialized())
|
||||
{
|
||||
if(parent != null)
|
||||
{
|
||||
_loc3_ = parent.loaderInfo.parameters;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = loaderInfo.parameters;
|
||||
}
|
||||
DebugUtility.debugTrace("addedToStageHandler - printing loaderInfo parameters flashvars...");
|
||||
_loc5_ = 0;
|
||||
for(var _loc4_:String in _loc3_)
|
||||
{
|
||||
DebugUtility.debugTrace(" flashvar " + _loc4_ + ":" + _loc3_[_loc4_]);
|
||||
_loc5_++;
|
||||
}
|
||||
DebugUtility.debugTrace("addedToStageHandler - ...done printing loaderInfo parameters flashvars - i:" + _loc5_);
|
||||
MainFrame.handleLocalExternalCall = GamePlay.handleLocalExternalCall;
|
||||
MainFrame.getInstance(_loc3_,setupInit,"",this);
|
||||
_globalErrorDebugTxt = new DebugGUITextbox();
|
||||
_globalErrorDebugTxt.init(this,"Global Error Catcher Initialized",false,true,true,600);
|
||||
_globalErrorDebugTxt.txt.textColor = 2236962;
|
||||
_globalErrorDebugTxt.x = 222;
|
||||
_globalErrorDebugTxt.y = 300;
|
||||
if(loaderInfo.hasOwnProperty("uncaughtErrorEvents"))
|
||||
{
|
||||
loaderInfo["uncaughtErrorEvents"].addEventListener("uncaughtError",handleGlobalErrors);
|
||||
}
|
||||
}
|
||||
DebugUtility.debugTrace("AJClient addedToStageHandler finished");
|
||||
}
|
||||
|
||||
public function setupInit() : void
|
||||
{
|
||||
LoaderCache.clientIp = String(gMainFrame.clientInfo.clientIp);
|
||||
gMainFrame.stage.addEventListener("Localization",LocalizationManager.onLocalizationEvent,false,0,true);
|
||||
LocalizationManager.currentLanguage = LocalizationManager.accountLanguage = LocalizationManager.getLanguageIdForLocale(gMainFrame.clientInfo.locale);
|
||||
var _loc1_:DefPacksDefHelper = new DefPacksDefHelper();
|
||||
_loc1_.init(uint("1023" + LocalizationManager.currentLanguage),LocalizationXtCommManager.onLocalizationListResponse,loadResourceItems,2);
|
||||
DefPacksDefHelper.mediaArray["1023" + LocalizationManager.currentLanguage] = _loc1_;
|
||||
_loc1_ = new DefPacksDefHelper();
|
||||
_loc1_.init(uint("1055" + LocalizationManager.accountLanguage),LocalizationXtCommManager.onPreferredLocalizationListResponse,null,2);
|
||||
DefPacksDefHelper.mediaArray["1055" + LocalizationManager.accountLanguage] = _loc1_;
|
||||
}
|
||||
|
||||
public function loadResourceItems() : void
|
||||
{
|
||||
Utility.init(DarkenManager.showLoadingSpiral,DarkenManager.darken,DarkenManager.unDarken);
|
||||
_resourceStackLoader = new ResourceStack(gMainFrame.path,gMainFrame.loaderCache.openFile);
|
||||
_resourceStackLoader.pushClass(new FetchClientIPResourceStackable(),true);
|
||||
_resourceStackLoader.pushFile("assets/sharedFonts.swf",true);
|
||||
_resourceStackLoader.pushFile("assets/HUDAssets.swf",true);
|
||||
if(gMainFrame.clientInfo.isCreateAccount)
|
||||
{
|
||||
_resourceStackLoader.pushClass(new LoadAvatarCarouselResourceStackable());
|
||||
}
|
||||
if(Mouse["supportsNativeCursor"])
|
||||
{
|
||||
_resourceStackLoader.pushClass(new LoadCursorResourceStackable());
|
||||
}
|
||||
if("failedToInitiate" in gMainFrame.clientInfo && gMainFrame.clientInfo.failedToInitiate == true)
|
||||
{
|
||||
_resourceStackLoader.start(onInitiationFailure);
|
||||
}
|
||||
else if(gMainFrame.clientInfo.isCreateAccount)
|
||||
{
|
||||
_resourceStackLoader.start(setupCreateAccount);
|
||||
}
|
||||
else if(gMainFrame.clientInfo.waitingMode)
|
||||
{
|
||||
_resourceStackLoader.start(setupWaitingRoom);
|
||||
}
|
||||
else
|
||||
{
|
||||
_resourceStackLoader.start(setupGamePlay);
|
||||
}
|
||||
}
|
||||
|
||||
public function setupCreateAccount() : void
|
||||
{
|
||||
if(gMainFrame.clientInfo.landingPage != "undefined")
|
||||
{
|
||||
SBTracker.trackPageview("/game/play/homepage/" + gMainFrame.clientInfo.landingPage,0,1);
|
||||
}
|
||||
var _loc1_:CreateAccount = new CreateAccount(gMainFrame.clientInfo);
|
||||
addChild(_loc1_);
|
||||
gMainFrame.createAccount = _loc1_;
|
||||
_loc1_.loginCtorHelper();
|
||||
}
|
||||
|
||||
public function setupWaitingRoom() : void
|
||||
{
|
||||
var _loc1_:WaitingRoom = new WaitingRoom(gMainFrame.clientInfo);
|
||||
addChild(_loc1_);
|
||||
gMainFrame.waitingRoom = _loc1_;
|
||||
_loc1_.waitCtorHelper();
|
||||
}
|
||||
|
||||
public function setupGamePlay(param1:Event = null, param2:Event = null) : void
|
||||
{
|
||||
DebugUtility.debugTrace("setupGamePlay - loginEvt:" + param1 + " connectEvt:" + param2);
|
||||
if(gMainFrame.createAccount)
|
||||
{
|
||||
if(contains(gMainFrame.createAccount))
|
||||
{
|
||||
removeChild(gMainFrame.createAccount);
|
||||
}
|
||||
gMainFrame.createAccount = null;
|
||||
_resourceStackLoader = null;
|
||||
}
|
||||
DebugUtility.debugTrace("setupGamePlay - constructing GamePlay - gMainFrame.clientInfo:" + gMainFrame.clientInfo);
|
||||
var _loc3_:GamePlay = new GamePlay(gMainFrame.clientInfo,param1,param2);
|
||||
addChild(_loc3_);
|
||||
gMainFrame.gamePlay = _loc3_;
|
||||
DebugUtility.debugTrace("setupGamePlay - gp:" + _loc3_ + " calling worldCtorHelper");
|
||||
_loc3_.worldCtorHelper();
|
||||
}
|
||||
|
||||
private function onInitiationFailure() : void
|
||||
{
|
||||
new SBStandardPopup(gMainFrame.stage,LocalizationManager.translateIdOnly(11202),false);
|
||||
}
|
||||
|
||||
private function createAvatar() : void
|
||||
{
|
||||
}
|
||||
|
||||
private function shardSelection() : void
|
||||
{
|
||||
}
|
||||
|
||||
private function enterGame() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package
|
||||
{
|
||||
import flash.display.Sprite;
|
||||
|
||||
public dynamic class DisplayLayer extends Sprite
|
||||
{
|
||||
|
||||
public function DisplayLayer()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package
|
||||
{
|
||||
import flash.utils.getDefinitionByName;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public function GETDEFINITIONBYNAME(param1:String, param2:Boolean = true) : *
|
||||
{
|
||||
var _loc3_:Class = new (getDefinitionByName(param1) as Class)();
|
||||
if(param2)
|
||||
{
|
||||
LocalizationManager.findAllTextfields(_loc3_);
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package
|
||||
{
|
||||
import flash.compiler.embed.EmbeddedMovieClip;
|
||||
|
||||
public class Game_Sign_swf$fc23efb8027f30caf6134175c0e3ff65672977561 extends EmbeddedMovieClip
|
||||
{
|
||||
|
||||
public function Game_Sign_swf$fc23efb8027f30caf6134175c0e3ff65672977561()
|
||||
{
|
||||
super(new Game_Sign_swf$fc23efb8027f30caf6134175c0e3ff65672977561ByteArray(),100,150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
{
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
[Embed(source="/_assets/1_Game_Sign_swf$fc23efb8027f30caf6134175c0e3ff65672977561ByteArray.bin", mimeType="application/octet-stream")]
|
||||
public class Game_Sign_swf$fc23efb8027f30caf6134175c0e3ff65672977561ByteArray extends ByteArray
|
||||
{
|
||||
|
||||
public function Game_Sign_swf$fc23efb8027f30caf6134175c0e3ff65672977561ByteArray()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,959 @@
|
||||
package
|
||||
{
|
||||
import com.sbi.client.SFEvent;
|
||||
import den.DenItem;
|
||||
import den.DenRoomItem;
|
||||
import gui.GenericListGuiManager;
|
||||
import item.Item;
|
||||
import item.ItemXtCommManager;
|
||||
import loader.DefPacksDefHelper;
|
||||
|
||||
public class GenericListXtCommManager
|
||||
{
|
||||
|
||||
public static const AVAIL_LIST_ID:int = 1;
|
||||
|
||||
public static const AVAIL_TYPE_CLOTHING:int = 0;
|
||||
|
||||
public static const AVAIL_TYPE_DEN_ACC:int = 1;
|
||||
|
||||
public static const AVAIL_TYPE_PARTY:int = 2;
|
||||
|
||||
public static const AVAIL_TYPE_DEN_ROOM:int = 3;
|
||||
|
||||
public static const AVAIL_TYPE_ROOM:int = 4;
|
||||
|
||||
public static const AVAIL_TYPE_STREAM:int = 5;
|
||||
|
||||
public static const AVAIL_TYPE_DIAMOND:int = 6;
|
||||
|
||||
public static const ACC_JAMAA_SHOP_ID:int = 11;
|
||||
|
||||
public static const ACC_BAHARIBAY_SHOP_ID:int = 50;
|
||||
|
||||
public static const DEN_ITEM_MAIN_SHOP_ID:int = 12;
|
||||
|
||||
public static const DEN_ITEM_CRYSTALREEF_SHOP_ID:int = 51;
|
||||
|
||||
public static const DEN_ITEM_AUDIO_SHOP_ID:int = 56;
|
||||
|
||||
public static const DEN_ITEM_PET_LAND:int = 85;
|
||||
|
||||
public static const DEN_ITEM_PET_OCEAN:int = 89;
|
||||
|
||||
public static const DEN_ITEM_FIRST_TIME_SHOP_ID:int = 234;
|
||||
|
||||
public static const REDEMPTION_STORE_LIST_ID:int = 172;
|
||||
|
||||
public static const DEN_ROOM_SHOP_ID:int = 13;
|
||||
|
||||
public static const DEN_ROOM_FULL_SHOP_ID:int = 384;
|
||||
|
||||
public static const MEDIA_EBOOK_1_ID:int = 23;
|
||||
|
||||
public static const AVATAR_LIST_ID:int = 64;
|
||||
|
||||
public static const CURR_SHOP_DIAMOND_AVATAR_LIST:int = 166;
|
||||
|
||||
public static const DIAMOND_AVATAR_LIST_ID:int = 293;
|
||||
|
||||
public static const MEDIA_JAG_CARD_LIST_ID:int = 10;
|
||||
|
||||
public static const MEDIA_JAG_STAMP_LIST_ID:int = 44;
|
||||
|
||||
public static const DIAMOND_PET_LIST:int = 214;
|
||||
|
||||
private static var _requestCallbackQueue:Object;
|
||||
|
||||
private static var _requestPassbackQueue:Object;
|
||||
|
||||
private static var _streamQueue:Object;
|
||||
|
||||
private static var _cachedResponses:Object;
|
||||
|
||||
private static var _availDefs:Object;
|
||||
|
||||
private static var _availDefExpireTime:int = 0;
|
||||
|
||||
private static var _availUniqueListId:int;
|
||||
|
||||
public function GenericListXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init() : void
|
||||
{
|
||||
_cachedResponses = {};
|
||||
_requestCallbackQueue = {};
|
||||
_requestPassbackQueue = {};
|
||||
_streamQueue = {};
|
||||
}
|
||||
|
||||
public static function destroy() : void
|
||||
{
|
||||
}
|
||||
|
||||
public static function requestGenericList(param1:int, param2:Function = null, param3:Object = null, param4:Boolean = true) : void
|
||||
{
|
||||
if(param2 != null)
|
||||
{
|
||||
_requestCallbackQueue[param1] = param2;
|
||||
}
|
||||
if(param3 != null)
|
||||
{
|
||||
_requestPassbackQueue[param1] = param3;
|
||||
}
|
||||
if(_cachedResponses[param1] && param1 != 1)
|
||||
{
|
||||
handleNewData(_cachedResponses[param1].concat());
|
||||
}
|
||||
else
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("gl",[param1],param4);
|
||||
}
|
||||
}
|
||||
|
||||
public static function requestStreamList(param1:int, param2:Function, param3:Object = null) : void
|
||||
{
|
||||
_streamQueue[param1] = {
|
||||
"c":param2,
|
||||
"h":param3
|
||||
};
|
||||
if(_cachedResponses[param1])
|
||||
{
|
||||
handleNewData(_cachedResponses[param1].concat());
|
||||
}
|
||||
else
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("gl",[param1]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function handleXtReply(param1:SFEvent) : void
|
||||
{
|
||||
var _loc2_:Array = param1.obj;
|
||||
if(_loc2_[0] == "gl")
|
||||
{
|
||||
_cachedResponses[int(_loc2_[2])] = _loc2_;
|
||||
}
|
||||
handleNewData(_loc2_.concat());
|
||||
}
|
||||
|
||||
public static function isAvailListExpired() : Boolean
|
||||
{
|
||||
var _loc2_:Date = new Date();
|
||||
var _loc1_:uint = _loc2_.getTime() / 1000;
|
||||
if(_availDefExpireTime == 0 || _availDefExpireTime > 0 && _loc1_ >= _availDefExpireTime)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function getAvailListUniqueId() : int
|
||||
{
|
||||
return _availUniqueListId;
|
||||
}
|
||||
|
||||
public static function getDefIdFromDef(param1:Object) : int
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
if(param1)
|
||||
{
|
||||
if(param1 is Item)
|
||||
{
|
||||
_loc2_ = int(param1.defId);
|
||||
}
|
||||
else if(param1 is DenItem)
|
||||
{
|
||||
_loc2_ = int(param1.itemDefId);
|
||||
}
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
public static function filterList(param1:int, param2:Array, param3:Object = null) : void
|
||||
{
|
||||
var _loc14_:int = 0;
|
||||
var _loc12_:Object = null;
|
||||
var _loc5_:Array = null;
|
||||
var _loc15_:int = 0;
|
||||
var _loc6_:int = 0;
|
||||
var _loc10_:int = 0;
|
||||
var _loc13_:Boolean = false;
|
||||
var _loc11_:int = 0;
|
||||
var _loc9_:int = 0;
|
||||
switch(param1)
|
||||
{
|
||||
case 1000:
|
||||
_loc14_ = 0;
|
||||
break;
|
||||
case 1030:
|
||||
_loc14_ = 1;
|
||||
break;
|
||||
case 1040:
|
||||
_loc14_ = 3;
|
||||
break;
|
||||
case 1037:
|
||||
_loc14_ = 5;
|
||||
break;
|
||||
case 1054:
|
||||
_loc14_ = 6;
|
||||
break;
|
||||
case 1060:
|
||||
_loc12_ = {};
|
||||
_loc5_ = [];
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < param2.length)
|
||||
{
|
||||
if(param2[_loc10_] is DenItem)
|
||||
{
|
||||
_loc15_ = 1030;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!(param2[_loc10_] is DenRoomItem))
|
||||
{
|
||||
throw new Error("Did not find type when loading combined list");
|
||||
}
|
||||
_loc15_ = 1040;
|
||||
}
|
||||
if(_loc12_[_loc15_] == null)
|
||||
{
|
||||
_loc12_[_loc15_] = _loc6_;
|
||||
_loc5_[_loc6_] = {
|
||||
"defType":_loc15_,
|
||||
"items":[param2[_loc10_]]
|
||||
};
|
||||
_loc6_++;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_[_loc12_[_loc15_]].items.push(param2[_loc10_]);
|
||||
}
|
||||
_loc10_++;
|
||||
}
|
||||
_loc12_ = null;
|
||||
param2 = [];
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc5_.length)
|
||||
{
|
||||
filterList(int(_loc5_[_loc10_].defType),_loc5_[_loc10_].items);
|
||||
param2 = param2.concat(_loc5_[_loc10_].items);
|
||||
_loc10_++;
|
||||
}
|
||||
return;
|
||||
default:
|
||||
trace("filtering of gl is not setup for listDefType=" + param1 + ". Returning list passed in");
|
||||
return;
|
||||
}
|
||||
var _loc4_:Array = _availDefs[_loc14_];
|
||||
if(!_loc4_ || _loc4_.length <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var _loc7_:int = 0;
|
||||
while(_loc7_ < param2.length)
|
||||
{
|
||||
_loc13_ = false;
|
||||
switch(_loc14_)
|
||||
{
|
||||
case 0:
|
||||
_loc11_ = int(param2[_loc7_].defId);
|
||||
break;
|
||||
case 1:
|
||||
_loc11_ = int(param2[_loc7_].itemDefId);
|
||||
break;
|
||||
case 3:
|
||||
_loc11_ = int(param2[_loc7_].itemDefId);
|
||||
break;
|
||||
case 5:
|
||||
_loc11_ = int(param2[_loc7_]);
|
||||
break;
|
||||
case 6:
|
||||
_loc11_ = int(param2[_loc7_].diamondDefId);
|
||||
break;
|
||||
default:
|
||||
throw new Error("ERROR: Availability type=" + _loc14_ + " is not yet implemented!");
|
||||
}
|
||||
if(_loc11_ > 0)
|
||||
{
|
||||
_loc9_ = 0;
|
||||
while(_loc9_ < _loc4_.length)
|
||||
{
|
||||
if(_loc11_ == _loc4_[_loc9_].defId)
|
||||
{
|
||||
if(_loc14_ != 5)
|
||||
{
|
||||
param2[_loc7_].endTime = _loc4_[_loc9_].endTime;
|
||||
}
|
||||
if(!_loc4_[_loc9_].active)
|
||||
{
|
||||
param2.splice(_loc7_,1);
|
||||
if(param3)
|
||||
{
|
||||
if(_loc14_ == 5)
|
||||
{
|
||||
for each(var _loc8_:Array in param3)
|
||||
{
|
||||
_loc8_.splice(_loc7_,1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
param3.splice(_loc7_,1);
|
||||
}
|
||||
}
|
||||
_loc13_ = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
_loc9_++;
|
||||
}
|
||||
}
|
||||
if(!_loc13_)
|
||||
{
|
||||
_loc7_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleNewData(param1:Array) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
if(param1[0] == "gl")
|
||||
{
|
||||
_loc2_ = int(param1[3]);
|
||||
switch(_loc2_)
|
||||
{
|
||||
case 1000:
|
||||
case 1030:
|
||||
case 1040:
|
||||
case 1051:
|
||||
case 1054:
|
||||
case 1060:
|
||||
handleItemResponse(param1,_loc2_);
|
||||
break;
|
||||
case 1023:
|
||||
handleLocalizationResponse(param1);
|
||||
break;
|
||||
case 1033:
|
||||
handleMediaResponse(param1);
|
||||
break;
|
||||
case 1035:
|
||||
handleFactResponse(param1);
|
||||
break;
|
||||
case 1037:
|
||||
handleStreamResponse(param1);
|
||||
break;
|
||||
case 1003:
|
||||
handleAvatarResponse(param1);
|
||||
break;
|
||||
case 1048:
|
||||
handleAvailabilityResponse(param1);
|
||||
break;
|
||||
case 1049:
|
||||
handleNamebarBadgeResposne(param1);
|
||||
break;
|
||||
case 1052:
|
||||
handleScriptResponse(param1);
|
||||
break;
|
||||
case 1046:
|
||||
handlePetResponse(param1);
|
||||
break;
|
||||
case 1058:
|
||||
handleEBookResponse(param1);
|
||||
break;
|
||||
case 1024:
|
||||
case 1047:
|
||||
handleSimpleResponse(param1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new Error("GenericListXtCommManager illegal data cmd:" + param1[0]);
|
||||
}
|
||||
|
||||
public static function genericListTypeResponse(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
var _loc4_:Object = null;
|
||||
var _loc3_:Object = param1.def;
|
||||
DefPacksDefHelper.mediaArray[1038] = null;
|
||||
var _loc2_:Object = {};
|
||||
for each(var _loc5_:Object in _loc3_)
|
||||
{
|
||||
_loc4_ = {
|
||||
"defId":int(_loc5_.id),
|
||||
"typeId":int(_loc5_.typeId)
|
||||
};
|
||||
_loc2_[_loc5_.id] = _loc4_;
|
||||
}
|
||||
gMainFrame.userInfo.genericListDefs = _loc2_;
|
||||
}
|
||||
|
||||
private static function handleItemResponse(param1:Array, param2:int) : void
|
||||
{
|
||||
var _loc7_:int = int(param1[2]);
|
||||
var _loc5_:Function = _requestCallbackQueue[_loc7_];
|
||||
var _loc4_:Object = _requestPassbackQueue[_loc7_];
|
||||
if(_loc5_ != null)
|
||||
{
|
||||
if(_loc4_)
|
||||
{
|
||||
_loc5_(_loc7_,param1,_loc4_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_(_loc7_,param1);
|
||||
}
|
||||
for each(var _loc3_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc3_ == _loc5_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc7_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc4_ != null)
|
||||
{
|
||||
for each(var _loc6_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc6_ == _loc4_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc7_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemXtCommManager.shopListResponse(param1,param2);
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleLocalizationResponse(param1:Array) : void
|
||||
{
|
||||
var _loc10_:int = 0;
|
||||
var _loc7_:int = 6;
|
||||
var _loc9_:int = int(param1[_loc7_++]);
|
||||
var _loc2_:Array = new Array(_loc9_);
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc9_)
|
||||
{
|
||||
_loc2_[_loc10_] = param1[_loc7_++];
|
||||
_loc10_++;
|
||||
}
|
||||
var _loc8_:int = int(param1[2]);
|
||||
var _loc5_:Function = _requestCallbackQueue[_loc8_];
|
||||
var _loc4_:Object = _requestPassbackQueue[_loc8_];
|
||||
if(_loc5_ != null)
|
||||
{
|
||||
if(_loc4_)
|
||||
{
|
||||
_loc5_(_loc8_,_loc2_,_loc4_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_(_loc8_,_loc2_);
|
||||
}
|
||||
for each(var _loc3_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc3_ == _loc5_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc8_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc4_ != null)
|
||||
{
|
||||
for each(var _loc6_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc6_ == _loc4_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc8_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleMediaResponse(param1:Array) : void
|
||||
{
|
||||
var _loc11_:int = 0;
|
||||
var _loc9_:int = 6;
|
||||
var _loc6_:int = int(param1[_loc9_++]);
|
||||
var _loc2_:Array = new Array(_loc6_);
|
||||
var _loc3_:Array = new Array(_loc6_);
|
||||
_loc11_ = 0;
|
||||
while(_loc11_ < _loc6_)
|
||||
{
|
||||
_loc2_[_loc11_] = int(param1[_loc9_++]);
|
||||
_loc3_[_loc11_] = param1[_loc9_++];
|
||||
_loc11_++;
|
||||
}
|
||||
var _loc10_:int = int(param1[2]);
|
||||
var _loc7_:Function = _requestCallbackQueue[_loc10_];
|
||||
var _loc5_:Object = _requestPassbackQueue[_loc10_];
|
||||
if(_loc7_ != null)
|
||||
{
|
||||
_loc7_(_loc10_,_loc2_,_loc3_);
|
||||
for each(var _loc4_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc4_ == _loc7_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc10_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc5_ != null)
|
||||
{
|
||||
for each(var _loc8_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc8_ == _loc5_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc10_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleFactResponse(param1:Array) : void
|
||||
{
|
||||
var _loc11_:int = 0;
|
||||
var _loc3_:Object = null;
|
||||
var _loc9_:int = 6;
|
||||
var _loc2_:int = int(param1[_loc9_++]);
|
||||
var _loc4_:Array = [];
|
||||
_loc11_ = 0;
|
||||
while(_loc11_ < _loc2_)
|
||||
{
|
||||
_loc3_ = {
|
||||
"id":int(param1[_loc9_++]),
|
||||
"media":int(param1[_loc9_++]),
|
||||
"title":int(param1[_loc9_++]),
|
||||
"description":int(param1[_loc9_++]),
|
||||
"type":int(param1[_loc9_++]),
|
||||
"userVarId":int(param1[_loc9_++]),
|
||||
"bitIdx":int(param1[_loc9_++])
|
||||
};
|
||||
_loc4_.push(_loc3_);
|
||||
_loc11_++;
|
||||
}
|
||||
var _loc10_:int = int(param1[2]);
|
||||
var _loc7_:Function = _requestCallbackQueue[_loc10_];
|
||||
var _loc6_:Object = _requestPassbackQueue[_loc10_];
|
||||
if(_loc7_ != null)
|
||||
{
|
||||
_loc7_(_loc4_);
|
||||
for each(var _loc5_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc5_ == _loc7_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc10_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc6_ != null)
|
||||
{
|
||||
for each(var _loc8_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc8_ == _loc6_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc10_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleStreamResponse(param1:Array) : void
|
||||
{
|
||||
var _loc14_:Array = null;
|
||||
var _loc11_:int = 0;
|
||||
if(GenericListXtCommManager.isAvailListExpired())
|
||||
{
|
||||
if(GenericListGuiManager && GenericListGuiManager.movieSelector)
|
||||
{
|
||||
GenericListGuiManager.movieSelector.destroy();
|
||||
GenericListGuiManager.movieSelector = null;
|
||||
}
|
||||
GenericListXtCommManager.requestGenericList(1,handleStreamResponse,param1);
|
||||
return;
|
||||
}
|
||||
var _loc10_:int = 6;
|
||||
var _loc9_:String = param1[4];
|
||||
var _loc12_:int = int(param1[_loc10_++]);
|
||||
var _loc5_:Array = new Array(_loc12_);
|
||||
var _loc2_:Array = new Array(_loc12_);
|
||||
var _loc13_:Array = new Array(_loc12_);
|
||||
var _loc6_:Array = new Array(_loc12_);
|
||||
var _loc4_:Array = new Array(_loc12_);
|
||||
var _loc3_:Array = new Array(_loc12_);
|
||||
_loc11_ = 0;
|
||||
while(_loc11_ < _loc12_)
|
||||
{
|
||||
_loc5_[_loc11_] = int(param1[_loc10_++]);
|
||||
_loc2_[_loc11_] = int(param1[_loc10_++]);
|
||||
_loc14_ = param1[_loc10_++].split("|");
|
||||
_loc13_[_loc11_] = _loc14_[0];
|
||||
if(_loc14_[1])
|
||||
{
|
||||
_loc6_[_loc11_] = _loc14_[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_[_loc11_] = _loc14_[0];
|
||||
}
|
||||
_loc4_[_loc11_] = int(param1[_loc10_++]);
|
||||
_loc3_[_loc11_] = int(param1[_loc10_++]);
|
||||
_loc11_++;
|
||||
}
|
||||
var _loc15_:int = int(param1[2]);
|
||||
var _loc8_:Object = _streamQueue[_loc15_];
|
||||
if(_loc8_)
|
||||
{
|
||||
if(_loc8_.h)
|
||||
{
|
||||
_loc8_.h.titleTxt = _loc9_;
|
||||
_loc8_.c(_loc15_,_loc5_,_loc2_,_loc13_,_loc6_,_loc4_,_loc3_,_loc8_.h);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc8_.c(_loc15_,_loc5_,_loc2_,_loc13_,_loc6_,_loc4_,_loc3_);
|
||||
}
|
||||
for each(var _loc7_:Object in _streamQueue)
|
||||
{
|
||||
if(_loc7_ == _streamQueue[_loc15_])
|
||||
{
|
||||
delete _streamQueue[_loc15_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleAvatarResponse(param1:Array) : void
|
||||
{
|
||||
var _loc10_:int = 0;
|
||||
var _loc8_:int = 6;
|
||||
var _loc6_:int = int(param1[_loc8_++]);
|
||||
var _loc5_:Array = new Array(_loc6_);
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc6_)
|
||||
{
|
||||
_loc5_[_loc10_] = int(param1[_loc8_++]);
|
||||
_loc10_++;
|
||||
}
|
||||
var _loc9_:int = int(param1[2]);
|
||||
var _loc4_:Function = _requestCallbackQueue[_loc9_];
|
||||
var _loc3_:Object = _requestPassbackQueue[_loc9_];
|
||||
if(_loc4_ != null)
|
||||
{
|
||||
_loc4_(_loc5_);
|
||||
for each(var _loc2_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc2_ == _loc4_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc9_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
for each(var _loc7_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc7_ == _loc3_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc9_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleAvailabilityResponse(param1:Array) : void
|
||||
{
|
||||
var _loc9_:Date = null;
|
||||
var _loc8_:int = 0;
|
||||
var _loc12_:int = 0;
|
||||
var _loc11_:int = int(param1[2]);
|
||||
var _loc10_:int = 4;
|
||||
_availUniqueListId = int(param1[_loc10_++]);
|
||||
var _loc3_:int = int(param1[_loc10_++]);
|
||||
var _loc2_:int = int(param1[_loc10_++]);
|
||||
if(_loc3_ < 0)
|
||||
{
|
||||
_availDefExpireTime = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc9_ = new Date();
|
||||
_availDefExpireTime = _loc9_.getTime() / 1000 + _loc3_;
|
||||
}
|
||||
_availDefs = {};
|
||||
_loc12_ = 0;
|
||||
while(_loc12_ < _loc2_)
|
||||
{
|
||||
_loc8_ = int(param1[_loc10_++]);
|
||||
if(!_availDefs[_loc8_])
|
||||
{
|
||||
_availDefs[_loc8_] = [];
|
||||
}
|
||||
_availDefs[_loc8_].push({
|
||||
"defId":int(param1[_loc10_++]),
|
||||
"endTime":uint(param1[_loc10_++]),
|
||||
"active":param1[_loc10_++] == "1"
|
||||
});
|
||||
_loc12_++;
|
||||
}
|
||||
var _loc6_:Function = _requestCallbackQueue[_loc11_];
|
||||
var _loc5_:Object = _requestPassbackQueue[_loc11_];
|
||||
if(_loc6_ != null)
|
||||
{
|
||||
if(_loc5_)
|
||||
{
|
||||
_loc6_(_loc5_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_();
|
||||
}
|
||||
for each(var _loc4_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc4_ == _loc6_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc11_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc5_ != null)
|
||||
{
|
||||
for each(var _loc7_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc7_ == _loc5_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc11_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleNamebarBadgeResposne(param1:Array) : void
|
||||
{
|
||||
var _loc10_:int = 0;
|
||||
var _loc8_:int = 6;
|
||||
var _loc2_:int = int(param1[_loc8_++]);
|
||||
var _loc3_:Array = new Array(_loc2_);
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc2_)
|
||||
{
|
||||
_loc3_[_loc10_] = int(param1[_loc8_++]);
|
||||
_loc10_++;
|
||||
}
|
||||
var _loc9_:int = int(param1[2]);
|
||||
var _loc6_:Function = _requestCallbackQueue[_loc9_];
|
||||
var _loc5_:Object = _requestPassbackQueue[_loc9_];
|
||||
if(_loc6_ != null)
|
||||
{
|
||||
_loc6_(_loc3_);
|
||||
for each(var _loc4_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc4_ == _loc6_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc9_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc5_ != null)
|
||||
{
|
||||
for each(var _loc7_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc7_ == _loc5_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc9_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleScriptResponse(param1:Array) : void
|
||||
{
|
||||
var _loc9_:int = 0;
|
||||
var _loc7_:int = 6;
|
||||
var _loc10_:int = int(param1[_loc7_++]);
|
||||
var _loc5_:Array = new Array(_loc10_);
|
||||
_loc9_ = 0;
|
||||
while(_loc9_ < _loc10_)
|
||||
{
|
||||
_loc5_[_loc9_] = int(param1[_loc7_++]);
|
||||
_loc9_++;
|
||||
}
|
||||
var _loc8_:int = int(param1[2]);
|
||||
var _loc4_:Function = _requestCallbackQueue[_loc8_];
|
||||
var _loc3_:Object = _requestPassbackQueue[_loc8_];
|
||||
if(_loc4_ != null)
|
||||
{
|
||||
_loc4_(_loc8_,_loc5_,_loc3_);
|
||||
for each(var _loc2_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc2_ == _loc4_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc8_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
for each(var _loc6_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc6_ == _loc3_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc8_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handlePetResponse(param1:Array) : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc10_:int = 0;
|
||||
var _loc8_:int = 6;
|
||||
var _loc11_:int = int(param1[_loc8_++]);
|
||||
var _loc2_:Array = [];
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc11_)
|
||||
{
|
||||
_loc3_ = int(param1[_loc8_++]);
|
||||
if(param1[_loc8_++] == "1")
|
||||
{
|
||||
_loc2_.push(_loc3_);
|
||||
}
|
||||
_loc10_++;
|
||||
}
|
||||
var _loc9_:int = int(param1[2]);
|
||||
var _loc6_:Function = _requestCallbackQueue[_loc9_];
|
||||
var _loc5_:Object = _requestPassbackQueue[_loc9_];
|
||||
if(_loc6_ != null)
|
||||
{
|
||||
_loc6_(_loc9_,_loc2_,_loc5_);
|
||||
for each(var _loc4_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc4_ == _loc6_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc9_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc5_ != null)
|
||||
{
|
||||
for each(var _loc7_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc7_ == _loc5_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc9_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleEBookResponse(param1:Array) : void
|
||||
{
|
||||
var _loc12_:int = 0;
|
||||
var _loc11_:int = int(param1[2]);
|
||||
var _loc7_:Function = _requestCallbackQueue[_loc11_];
|
||||
var _loc4_:Object = _requestPassbackQueue[_loc11_];
|
||||
var _loc10_:int = 6;
|
||||
var _loc6_:int = int(param1[_loc10_++]);
|
||||
var _loc3_:Array = new Array(_loc6_);
|
||||
var _loc5_:Array = new Array(_loc6_);
|
||||
var _loc8_:Array = new Array(_loc6_);
|
||||
_loc12_ = 0;
|
||||
while(_loc12_ < _loc6_)
|
||||
{
|
||||
_loc3_[_loc12_] = int(param1[_loc10_++]);
|
||||
_loc5_[_loc12_] = int(param1[_loc10_++]);
|
||||
_loc8_[_loc12_] = int(param1[_loc10_++]);
|
||||
_loc12_++;
|
||||
}
|
||||
if(_loc7_ != null)
|
||||
{
|
||||
_loc7_(_loc11_,_loc3_,_loc5_,_loc8_,_loc4_);
|
||||
for each(var _loc2_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc2_ == _loc7_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc11_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc4_ != null)
|
||||
{
|
||||
for each(var _loc9_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc9_ == _loc4_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc11_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleSimpleResponse(param1:Array) : void
|
||||
{
|
||||
var _loc10_:int = 0;
|
||||
var _loc9_:int = int(param1[2]);
|
||||
var _loc5_:Function = _requestCallbackQueue[_loc9_];
|
||||
var _loc3_:Object = _requestPassbackQueue[_loc9_];
|
||||
var _loc7_:int = 6;
|
||||
var _loc4_:int = int(param1[_loc7_++]);
|
||||
var _loc8_:Array = new Array(_loc4_);
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc4_)
|
||||
{
|
||||
_loc8_[_loc10_] = int(param1[_loc7_++]);
|
||||
_loc10_++;
|
||||
}
|
||||
if(_loc5_ != null)
|
||||
{
|
||||
_loc5_(_loc9_,_loc8_,_loc3_);
|
||||
for each(var _loc2_:Object in _requestCallbackQueue)
|
||||
{
|
||||
if(_loc2_ == _loc5_)
|
||||
{
|
||||
delete _requestCallbackQueue[_loc9_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
for each(var _loc6_:Object in _requestPassbackQueue)
|
||||
{
|
||||
if(_loc6_ == _loc3_)
|
||||
{
|
||||
delete _requestPassbackQueue[_loc9_];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package
|
||||
{
|
||||
import flash.events.ErrorEvent;
|
||||
import flash.events.UncaughtErrorEvent;
|
||||
import flash.system.Capabilities;
|
||||
|
||||
public class GlobalErrorCatch
|
||||
{
|
||||
|
||||
public function GlobalErrorCatch()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function setupGlobalErrorListener(param1:UncaughtErrorEvent) : String
|
||||
{
|
||||
var _loc2_:String = null;
|
||||
var _loc3_:UncaughtErrorEvent = UncaughtErrorEvent(param1);
|
||||
var _loc4_:Boolean = gMainFrame.clientInfo.accountType == 4;
|
||||
if(_loc3_)
|
||||
{
|
||||
if(!_loc4_)
|
||||
{
|
||||
_loc3_.preventDefault();
|
||||
}
|
||||
if(_loc3_.error is Error)
|
||||
{
|
||||
if(Capabilities.isDebugger)
|
||||
{
|
||||
_loc2_ = Error(_loc3_.error).getStackTrace();
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = Error(_loc3_.error).message;
|
||||
}
|
||||
}
|
||||
else if(_loc3_.error is ErrorEvent)
|
||||
{
|
||||
_loc2_ = ErrorEvent(_loc3_.error).text;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = _loc3_.error.toString();
|
||||
}
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package
|
||||
{
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.loader.LoaderCacheEntry_Base;
|
||||
import com.sbi.loader.LoaderEvent;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import flash.display.Loader;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import flash.utils.ByteArray;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class LoadProgress
|
||||
{
|
||||
|
||||
public static const INITIALIZING:int = 1;
|
||||
|
||||
public static const LOADING_GAMES:int = 2;
|
||||
|
||||
public static const LOADING_ANIMALS:int = 3;
|
||||
|
||||
public static const LOADING_WORLDMAP:int = 4;
|
||||
|
||||
public static const FINDING_ROOM:int = 5;
|
||||
|
||||
public static const LOADING_ROOM:int = 6;
|
||||
|
||||
public static const JOINING_SERVER:int = 7;
|
||||
|
||||
private static var _entry:LoaderCacheEntry_Base;
|
||||
|
||||
private static var _loadScreen:Loader;
|
||||
|
||||
private static var _loadLayer:DisplayObjectContainer;
|
||||
|
||||
private static var _completeCallback:Function;
|
||||
|
||||
private static var _target:String;
|
||||
|
||||
private static var _displayTarget:String;
|
||||
|
||||
private static var _bChangeLoadingScreen:Boolean;
|
||||
|
||||
private static var _progressCounter:int;
|
||||
|
||||
private static var _visible:Boolean;
|
||||
|
||||
private static const LoadScreenSWF:Class = Load_Screen_swf$fe826a97499aa72bf61f7d24347a39f32024164499;
|
||||
|
||||
public function LoadProgress()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function get loadScreen() : Loader
|
||||
{
|
||||
return _loadScreen;
|
||||
}
|
||||
|
||||
public static function get entry() : LoaderCacheEntry_Base
|
||||
{
|
||||
return _entry;
|
||||
}
|
||||
|
||||
public static function get loadLayer() : DisplayObjectContainer
|
||||
{
|
||||
return _loadLayer;
|
||||
}
|
||||
|
||||
public static function get visible() : Boolean
|
||||
{
|
||||
return _visible;
|
||||
}
|
||||
|
||||
public static function init(param1:DisplayObjectContainer) : void
|
||||
{
|
||||
var _loc2_:ByteArray = null;
|
||||
if(_loadScreen == null)
|
||||
{
|
||||
_bChangeLoadingScreen = true;
|
||||
_progressCounter = 0;
|
||||
_loadLayer = param1;
|
||||
_loadScreen = new Loader();
|
||||
_loadScreen.contentLoaderInfo.addEventListener("complete",onLoadScreenComplete);
|
||||
_loc2_ = ByteArray(new LoadScreenSWF());
|
||||
_loadScreen.loadBytes(_loc2_);
|
||||
}
|
||||
}
|
||||
|
||||
public static function show(param1:Boolean, param2:Object = null) : void
|
||||
{
|
||||
var _loc3_:MovieClip = null;
|
||||
if(param1)
|
||||
{
|
||||
_visible = true;
|
||||
_loc3_ = MovieClip(_loadScreen.content);
|
||||
if(!loadLayer.contains(_loadScreen))
|
||||
{
|
||||
loadLayer.addChild(_loadScreen);
|
||||
}
|
||||
if(_loc3_ && _bChangeLoadingScreen)
|
||||
{
|
||||
_loc3_.showScreen(true);
|
||||
_loc3_.setProgress(_progressCounter);
|
||||
if(!LocalizationManager.hasLocalizations)
|
||||
{
|
||||
_loc3_.setCallback(onLoadProgressTextChange);
|
||||
_loc3_.textBox.visible = false;
|
||||
_loc3_.loadText.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_.setCallback(null);
|
||||
_loc3_.textBox.visible = true;
|
||||
_loc3_.loadText.visible = true;
|
||||
}
|
||||
_bChangeLoadingScreen = false;
|
||||
}
|
||||
}
|
||||
else if(loadLayer.contains(_loadScreen))
|
||||
{
|
||||
_visible = false;
|
||||
loadLayer.removeChild(_loadScreen);
|
||||
_bChangeLoadingScreen = true;
|
||||
_progressCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static function load(param1:String, param2:int, param3:Function) : void
|
||||
{
|
||||
_entry = null;
|
||||
_completeCallback = param3;
|
||||
_target = gMainFrame.path + param1;
|
||||
_progressCounter = param2;
|
||||
var _loc4_:MovieClip = MovieClip(_loadScreen.content);
|
||||
if(_loc4_)
|
||||
{
|
||||
_loc4_.setProgress(param2);
|
||||
}
|
||||
DebugUtility.debugTrace("loading target:" + _target);
|
||||
if(_loadScreen)
|
||||
{
|
||||
startLoad();
|
||||
return;
|
||||
}
|
||||
throw new Error("preloader was not embedded?!");
|
||||
}
|
||||
|
||||
private static function onLoadProgressTextChange() : void
|
||||
{
|
||||
var _loc1_:MovieClip = null;
|
||||
if(LocalizationManager.hasLocalizations)
|
||||
{
|
||||
_loc1_ = MovieClip(_loadScreen.content);
|
||||
if(_loadScreen.content)
|
||||
{
|
||||
_loc1_.relocalize();
|
||||
_loc1_.setCallback(null);
|
||||
_loc1_.textBox.visible = true;
|
||||
_loc1_.loadText.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function onLoadScreenComplete(param1:Event) : void
|
||||
{
|
||||
show(true);
|
||||
}
|
||||
|
||||
private static function startLoad() : void
|
||||
{
|
||||
show(true);
|
||||
gMainFrame.loaderCache.openFile(_target,loadCompleteHandler,loadProgressHandler);
|
||||
}
|
||||
|
||||
private static function loadCompleteHandler(param1:LoaderEvent) : void
|
||||
{
|
||||
_entry = param1.entry;
|
||||
if(_completeCallback != null)
|
||||
{
|
||||
_completeCallback();
|
||||
}
|
||||
}
|
||||
|
||||
private static function loadProgressHandler(param1:LoaderEvent) : void
|
||||
{
|
||||
if(!(param1.status && _loadScreen))
|
||||
{
|
||||
throw new Error("ERROR: Unable to show loading progress! status:" + param1.status + " preloader:" + _loadScreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
{
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
[Embed(source="/_assets/4_Load_Screen_swf$fe826a97499aa72bf61f7d24347a39f32024164499.bin", mimeType="application/octet-stream")]
|
||||
public class Load_Screen_swf$fe826a97499aa72bf61f7d24347a39f32024164499 extends ByteArray
|
||||
{
|
||||
|
||||
public function Load_Screen_swf$fe826a97499aa72bf61f7d24347a39f32024164499()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package
|
||||
{
|
||||
import avatar.AvatarManager;
|
||||
import gui.GuiManager;
|
||||
import loader.DefPacksDefHelper;
|
||||
import localization.LocalizationManager;
|
||||
import room.RoomXtCommManager;
|
||||
|
||||
public class LocalizationXtCommManager
|
||||
{
|
||||
|
||||
public function LocalizationXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function onLocalizationShardResponse(param1:String) : void
|
||||
{
|
||||
var _loc3_:Array = null;
|
||||
var _loc2_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
var _loc6_:Array = param1.split(",");
|
||||
var _loc8_:int = 0;
|
||||
var _loc7_:Array = _loc6_;
|
||||
for each(var _loc5_:String in _loc7_)
|
||||
{
|
||||
_loc3_ = _loc5_.split(":");
|
||||
_loc2_ = int(_loc3_[0]);
|
||||
_loc4_ = int(_loc3_[1]);
|
||||
requestLocalizationPack(_loc4_);
|
||||
}
|
||||
}
|
||||
|
||||
public static function requestLocalizationPack(param1:int) : void
|
||||
{
|
||||
var _loc2_:DefPacksDefHelper = new DefPacksDefHelper();
|
||||
LocalizationManager.currentLanguage = param1;
|
||||
LocalizationManager.hasLocalizations = false;
|
||||
RoomXtCommManager.waitForLangPack = true;
|
||||
AvatarManager.waitForLangPack = true;
|
||||
_loc2_.init(uint("1023" + param1),onLocalizationListResponse,RoomXtCommManager.startRoomLoadIfReady,2);
|
||||
DefPacksDefHelper.mediaArray["1023" + param1] = _loc2_;
|
||||
}
|
||||
|
||||
public static function onLocalizationListResponse(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
DefPacksDefHelper.mediaArray["1023." + LocalizationManager.currentLanguage] = null;
|
||||
LocalizationManager.setLocalizations(param1.def,GuiManager.mainHud != null ? GuiManager.rebuildMainHud : null);
|
||||
if(param1.passback)
|
||||
{
|
||||
param1.passback();
|
||||
}
|
||||
}
|
||||
|
||||
public static function onPreferredLocalizationListResponse(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
DefPacksDefHelper.mediaArray["1055." + LocalizationManager.accountLanguage] = null;
|
||||
LocalizationManager.setPreferredLocalizations(param1.def);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,567 @@
|
||||
package
|
||||
{
|
||||
import avatar.UserInfoCache;
|
||||
import com.sbi.analytics.SBTracker;
|
||||
import com.sbi.client.SFClient;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.graphics.LayerAnim;
|
||||
import com.sbi.loader.ImageServerURL;
|
||||
import com.sbi.loader.LoaderCache;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Shape;
|
||||
import flash.display.Sprite;
|
||||
import flash.display.Stage;
|
||||
import flash.events.Event;
|
||||
import flash.events.IOErrorEvent;
|
||||
import flash.events.KeyboardEvent;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.external.ExternalInterface;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLRequest;
|
||||
import gamePlayFlow.GamePlay;
|
||||
import room.LayerManager;
|
||||
|
||||
public class MainFrame extends Sprite
|
||||
{
|
||||
|
||||
public static const VIEW_WIDTH:int = 900;
|
||||
|
||||
public static const VIEW_HEIGHT:int = 550;
|
||||
|
||||
public static const ROOMS_FOLDER:String = "roomDefs/";
|
||||
|
||||
public static const CDN_SALT:String = "J@mnim4L";
|
||||
|
||||
public static const MSG_ID_LOGIN_IN_USE:int = -11;
|
||||
|
||||
public static const MSG_ID_LOGIN_ACCT_MAINT:int = -12;
|
||||
|
||||
public static const MSG_ID_LOGIN_CONNECTION:int = -14;
|
||||
|
||||
public static const MSG_ID_LOGIN_BANNED:int = -15;
|
||||
|
||||
public static const MSG_ID_LOGIN_SERVER_MAINT:int = -16;
|
||||
|
||||
public static const MSG_ID_LOGIN_CLIENT_MISMATCH:int = -24;
|
||||
|
||||
public static var avatarCreationLogin:MovieClip;
|
||||
|
||||
public static var avatarCreationVO:MovieClip;
|
||||
|
||||
public static var handleLocalExternalCall:Function;
|
||||
|
||||
private static const _configDebugFile:String = "clientdevtest.xml";
|
||||
|
||||
private static const _configDebugTemplateFile:String = "clientdevtest.template.xml";
|
||||
|
||||
private static var _configLoadedCallback:Function;
|
||||
|
||||
private static var m:MainFrame;
|
||||
|
||||
private static var _flashVarUserName:String;
|
||||
|
||||
private static var _client:SFClient = null;
|
||||
|
||||
private static var _path:String = null;
|
||||
|
||||
private static var _stage:Stage;
|
||||
|
||||
private static var _gamePlay:DisplayObjectContainer;
|
||||
|
||||
private static var _waitingRoom:DisplayObjectContainer;
|
||||
|
||||
private static var _createAccount:DisplayObjectContainer;
|
||||
|
||||
private static var _loaderCache:LoaderCache;
|
||||
|
||||
public var userInfo:UserInfoCache;
|
||||
|
||||
public var clientInfo:Object;
|
||||
|
||||
public var classNames:Array;
|
||||
|
||||
private var _layerInfo:Object;
|
||||
|
||||
public function MainFrame()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getInstance(param1:Object = null, param2:Function = null, param3:String = "", param4:DisplayObjectContainer = null) : MainFrame
|
||||
{
|
||||
var _loc6_:Stage = null;
|
||||
var _loc5_:Boolean = false;
|
||||
var _loc8_:Shape = null;
|
||||
var _loc7_:Boolean = false;
|
||||
var _loc9_:URLLoader = null;
|
||||
if(m == null)
|
||||
{
|
||||
if(param3 == null || param4 == null || param4.stage == null)
|
||||
{
|
||||
throw new Error("ERROR: Attempted to call initial getInstance on MainFrame without correct parameters!");
|
||||
}
|
||||
_loc6_ = param4.stage;
|
||||
LoadProgress.init(_loc6_);
|
||||
LoadProgress.show(true,1);
|
||||
LoaderCache.cdnSalt = "J@mnim4L";
|
||||
_loc5_ = ExternalInterface.available;
|
||||
if(_loc5_)
|
||||
{
|
||||
DebugUtility.debugTrace("extIntAvail is true");
|
||||
DebugUtility.debugTrace("mrc dm init starting up call returned:" + ExternalInterface.call("mrc",["dm","init:starting up"]));
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugUtility.debugTrace("extIntAvail is false");
|
||||
}
|
||||
_loc8_ = new Shape();
|
||||
_loc8_.graphics.clear();
|
||||
_loc8_.graphics.lineStyle(1,16777215);
|
||||
_loc8_.graphics.beginFill(16777215);
|
||||
_loc8_.graphics.drawRect(0,0,900,550);
|
||||
_loc8_.graphics.endFill();
|
||||
param4.addChild(_loc8_);
|
||||
param4.mask = _loc8_;
|
||||
_loc6_.showDefaultContextMenu = false;
|
||||
_loc6_.scaleMode = "noScale";
|
||||
m = new MainFrame();
|
||||
m.init(new Singleton(),param3,_loc6_);
|
||||
gMainFrame = m;
|
||||
_loc6_.addEventListener("keyDown",keyDownListener,false,0,true);
|
||||
_loc6_.addEventListener("rightMouseDown",onRightMouseDown,false,0,true);
|
||||
if(_loc5_)
|
||||
{
|
||||
try
|
||||
{
|
||||
DebugUtility.debugTrace("init:adding mec callback");
|
||||
ExternalInterface.addCallback("mec",handleLocalExternalCall);
|
||||
DebugUtility.debugTrace("init:mec added, calling lc...");
|
||||
ExternalInterface.call("mrc",["lc"]);
|
||||
DebugUtility.debugTrace("init:... lc called, waiting for ixm...");
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
DebugUtility.debugTrace("init:ERROR hit during AJC ext mod setup! msg:" + e.message + " stack:" + e.getStackTrace());
|
||||
}
|
||||
}
|
||||
DebugUtility.debugTrace("init: setting extCallsActive to false");
|
||||
gMainFrame.clientInfo.extCallsActive = false;
|
||||
DebugUtility.debugTrace("init: set extCallsActive to false");
|
||||
_configLoadedCallback = param2;
|
||||
_loc7_ = param1 && param1.smartfoxServer;
|
||||
DebugUtility.debugTrace("MainFrame.getInstance - haveFlashVars:" + _loc7_);
|
||||
gMainFrame.clientInfo.devMode = !_loc7_;
|
||||
if(_loc7_)
|
||||
{
|
||||
if("username" in param1 && param1.username != undefined)
|
||||
{
|
||||
_flashVarUserName = param1.username;
|
||||
}
|
||||
else
|
||||
{
|
||||
_flashVarUserName = "";
|
||||
}
|
||||
DebugUtility.debugTrace("MainFrame.getInstance - flashVars.smartfoxServer:" + param1.smartfoxServer + " flashVars.smartfoxPort:" + param1.smartfoxPort + " flashVars.blueboxServer:" + param1.blueboxServer + " flashVars.blueboxPort:" + param1.blueboxPort + " flashVars.content:" + param1.content + " flashVars.website:" + param1.website);
|
||||
if(!(param1.smartfoxServer && param1.smartfoxPort && param1.blueboxServer && param1.blueboxPort && param1.content && param1.website))
|
||||
{
|
||||
DebugUtility.debugTrace("MainFrame.getInstance - Invalid FlashVars! Throwing error...");
|
||||
throw new Error("Invalid FlashVars!");
|
||||
}
|
||||
if(!param1.hasOwnProperty("startupRoom"))
|
||||
{
|
||||
param1.startupRoom = "jamaa_township.room_main";
|
||||
}
|
||||
if(!param1.hasOwnProperty("worldmapRoom"))
|
||||
{
|
||||
param1.worldmapRoom = "world_map/room_main.xroom";
|
||||
}
|
||||
if(!param1.hasOwnProperty("dangermapRoom"))
|
||||
{
|
||||
param1.dangermapRoom = "danger_map/room_main.xroom";
|
||||
}
|
||||
if(!param1.hasOwnProperty("clientDebug"))
|
||||
{
|
||||
param1.clientDebug = "false";
|
||||
}
|
||||
if(!param1.hasOwnProperty("forceHttpProxy"))
|
||||
{
|
||||
param1.forceHttpProxy = "false";
|
||||
}
|
||||
if(!param1.hasOwnProperty("build_version"))
|
||||
{
|
||||
param1.build_version = "0";
|
||||
}
|
||||
if(!param1.hasOwnProperty("deploy_version"))
|
||||
{
|
||||
param1.deploy_version = "0";
|
||||
}
|
||||
if(!param1.hasOwnProperty("locale"))
|
||||
{
|
||||
param1.locale = "en-US";
|
||||
}
|
||||
if(!param1.hasOwnProperty("sg_params"))
|
||||
{
|
||||
param1.sg_params = "";
|
||||
}
|
||||
if(!param1.hasOwnProperty("buddyRoomTimerInterval"))
|
||||
{
|
||||
param1.buddyRoomTimerInterval = "30000";
|
||||
}
|
||||
if(!param1.hasOwnProperty("countryCode"))
|
||||
{
|
||||
param1.countryCode = "";
|
||||
}
|
||||
if(String(param1.sg_params).indexOf("%") >= 0)
|
||||
{
|
||||
throw new Error("Invalid sg_params!");
|
||||
}
|
||||
gMainFrame.clientInfo.localMode = false;
|
||||
LoaderCache.localMode = false;
|
||||
applyConfigVars(param1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc9_ = new URLLoader();
|
||||
_loc9_.dataFormat = "text";
|
||||
_loc9_.addEventListener("complete",configDebugLoadCompleteHandler);
|
||||
_loc9_.addEventListener("ioError",configDebugLoadIOErrorHandler);
|
||||
_loc9_.load(new URLRequest("clientdevtest.xml"));
|
||||
}
|
||||
}
|
||||
SBTracker.create();
|
||||
return m;
|
||||
}
|
||||
|
||||
public static function isInitialized() : Boolean
|
||||
{
|
||||
return m != null;
|
||||
}
|
||||
|
||||
private static function keyDownListener(param1:KeyboardEvent) : void
|
||||
{
|
||||
if(gMainFrame.clientInfo.accountType == 4 || gMainFrame.clientInfo.accountType == 5)
|
||||
{
|
||||
if(!param1.ctrlKey && param1.shiftKey && !param1.altKey && param1.keyCode == 123)
|
||||
{
|
||||
if(!_client.isConnected)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(_gamePlay)
|
||||
{
|
||||
_gamePlay["reconnecting"] = true;
|
||||
_gamePlay["showLoadProgress"](true,7);
|
||||
}
|
||||
gMainFrame.clientInfo.forceHttpProxy = true;
|
||||
_client.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function onRightMouseDown(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
param1.preventDefault();
|
||||
}
|
||||
|
||||
private static function applyConfigVars(param1:Object) : void
|
||||
{
|
||||
for(var _loc10_:String in param1)
|
||||
{
|
||||
gMainFrame.clientInfo[_loc10_] = param1[_loc10_];
|
||||
}
|
||||
var _loc4_:Array = [param1.smartfoxServer];
|
||||
var _loc5_:int = 1;
|
||||
while(param1.hasOwnProperty("smartfoxServer" + _loc5_))
|
||||
{
|
||||
_loc4_.push(param1["smartfoxServer" + _loc5_]);
|
||||
_loc5_++;
|
||||
}
|
||||
var _loc7_:Array = [param1.blueboxServer];
|
||||
var _loc13_:int = 1;
|
||||
while(param1.hasOwnProperty("blueboxServer" + _loc13_))
|
||||
{
|
||||
_loc7_.push(param1["blueboxServer" + _loc13_]);
|
||||
_loc13_++;
|
||||
}
|
||||
gMainFrame.server.setServerConfig(_loc4_,param1.smartfoxPort,_loc7_,param1.blueboxPort,param1.clientDebug);
|
||||
var _loc3_:String = param1.forceHttpProxy;
|
||||
gMainFrame.clientInfo.forceHttpProxy = _loc3_ == "true";
|
||||
var _loc12_:String = param1.build_version;
|
||||
gMainFrame.clientInfo.buildVersion = _loc12_;
|
||||
LoaderCache.buildVersion = _loc12_;
|
||||
var _loc14_:String = param1.deploy_version;
|
||||
gMainFrame.clientInfo.deployVersion = _loc14_;
|
||||
LoaderCache.deployVersion = _loc14_;
|
||||
var _loc6_:String = param1.locale;
|
||||
gMainFrame.clientInfo.locale = _loc6_;
|
||||
var _loc2_:String = param1.myExternalIp;
|
||||
gMainFrame.clientInfo.clientIp = _loc2_;
|
||||
gMainFrame.clientInfo.websiteURL = param1.website;
|
||||
var _loc9_:String = param1.content;
|
||||
gMainFrame.clientInfo.contentURL = _loc9_;
|
||||
LoaderCache.contentURL = _loc9_;
|
||||
var _loc8_:Boolean = param1.webRefPath == "create_account";
|
||||
gMainFrame.clientInfo.isCreateAccount = _loc8_;
|
||||
var _loc15_:Boolean = param1.waitingMode == "true";
|
||||
gMainFrame.clientInfo.waitingMode = _loc15_;
|
||||
var _loc11_:int = int(param1.buddyRoomTimerInterval);
|
||||
gMainFrame.clientInfo.buddyRoomTimerInterval = _loc11_;
|
||||
gMainFrame.clientInfo.startUpRoom = String(param1.startupRoom);
|
||||
gMainFrame.clientInfo.worldMapRoom = "roomDefs/" + param1.worldmapRoom;
|
||||
gMainFrame.clientInfo.dangerMapRoom = "roomDefs/" + param1.dangermapRoom;
|
||||
gMainFrame.clientInfo.clientDebug = param1.clientDebug;
|
||||
gMainFrame.clientInfo.sgParams = String(param1.sg_params);
|
||||
gMainFrame.clientInfo.mdUrl = String(param1.mdUrl);
|
||||
gMainFrame.clientInfo.currentTimestamp = Number(param1.currentTimestamp);
|
||||
gMainFrame.clientInfo.sbTrackerIp = String(param1.sbStatTrackerIp);
|
||||
gMainFrame.clientInfo.sbTrackerModulator = param1.sbStatModulator;
|
||||
gMainFrame.clientInfo.landingPage = String(param1.landingPage);
|
||||
gMainFrame.clientInfo.authToken = param1.auth_token;
|
||||
gMainFrame.clientInfo.countryCode = param1.countryCode;
|
||||
gMainFrame.clientInfo.playerWallHost = String(param1.playerWallHost);
|
||||
if(gMainFrame.clientInfo.countryCode == undefined)
|
||||
{
|
||||
gMainFrame.clientInfo.countryCode = "";
|
||||
}
|
||||
DebugUtility.debugTrace("-configXml/flashVars info-");
|
||||
DebugUtility.debugTrace("smartfoxAddress:" + param1.smartfoxServer);
|
||||
DebugUtility.debugTrace("smartfoxPort:" + param1.smartfoxPort);
|
||||
DebugUtility.debugTrace("blueboxAddress:" + param1.blueboxServer);
|
||||
DebugUtility.debugTrace("blueboxPort:" + param1.blueboxPort);
|
||||
DebugUtility.debugTrace("buildVersionStr:" + _loc12_);
|
||||
DebugUtility.debugTrace("deployVersionStr:" + _loc14_);
|
||||
DebugUtility.debugTrace("localeStr:" + _loc6_);
|
||||
DebugUtility.debugTrace("clientIpStr:" + _loc2_);
|
||||
DebugUtility.debugTrace("contentURL:" + gMainFrame.clientInfo.contentURL);
|
||||
DebugUtility.debugTrace("websiteURL:" + gMainFrame.clientInfo.websiteURL);
|
||||
DebugUtility.debugTrace("isCreateAccount:" + _loc8_ + " webRefPath:" + param1.webRefPath);
|
||||
DebugUtility.debugTrace("isWaitingMode:" + _loc15_ + " cfgVars.waitingMode:" + param1.waitingMode);
|
||||
DebugUtility.debugTrace("startUpRoom:" + gMainFrame.clientInfo.startUpRoom);
|
||||
DebugUtility.debugTrace("worldMapRoom:" + gMainFrame.clientInfo.worldMapRoom);
|
||||
DebugUtility.debugTrace("dangerMapRoom:" + gMainFrame.clientInfo.dangerMapRoom);
|
||||
DebugUtility.debugTrace("clientDebug:" + param1.clientDebug);
|
||||
DebugUtility.debugTrace("forceHttpProxy:" + param1.forceHttpProxy);
|
||||
DebugUtility.debugTrace("sgParams:" + gMainFrame.clientInfo.sgParams);
|
||||
DebugUtility.debugTrace("buddyRoomTimerInterval:" + gMainFrame.clientInfo.buddyRoomTimerInterval);
|
||||
_loaderCache = new LoaderCache();
|
||||
if(!gMainFrame.clientInfo.devMode && !gMainFrame.clientInfo.isCreateAccount && (_flashVarUserName == "" || !("auth_token" in param1) || param1.auth_token == null || param1.auth_token == undefined || param1.auth_token == ""))
|
||||
{
|
||||
gMainFrame.clientInfo.failedToInitiate = true;
|
||||
}
|
||||
_configLoadedCallback();
|
||||
}
|
||||
|
||||
private static function configDebugLoadIOErrorHandler(param1:IOErrorEvent) : void
|
||||
{
|
||||
var _loc2_:URLLoader = new URLLoader();
|
||||
_loc2_.dataFormat = "text";
|
||||
_loc2_.addEventListener("complete",configDebugLoadCompleteHandler);
|
||||
_loc2_.addEventListener("ioError",configDebugTemplateLoadIOErrorHandler);
|
||||
_loc2_.load(new URLRequest("clientdevtest.template.xml"));
|
||||
}
|
||||
|
||||
private static function configDebugTemplateLoadIOErrorHandler(param1:IOErrorEvent) : void
|
||||
{
|
||||
throw new Error("IOError reading clientdevtest.xml or clientdevtest.template.xml! ioe:" + param1);
|
||||
}
|
||||
|
||||
private static function configDebugLoadCompleteHandler(param1:Event) : void
|
||||
{
|
||||
var _loc2_:XML = new XML(param1.target.data);
|
||||
var _loc4_:XMLList = _loc2_.autoLogins.children();
|
||||
var _loc7_:int = 0;
|
||||
for each(var _loc3_:XML in _loc4_)
|
||||
{
|
||||
gMainFrame.clientInfo["autoLogin" + ++_loc7_] = [String(_loc3_.name.text()),String(_loc3_.token.text())];
|
||||
}
|
||||
var _loc10_:String = _loc2_.local.text();
|
||||
if(_loc10_ == "false")
|
||||
{
|
||||
gMainFrame.clientInfo.localMode = false;
|
||||
LoaderCache.localMode = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
gMainFrame.clientInfo.localMode = true;
|
||||
}
|
||||
var _loc6_:String = _loc2_.clientDebug.text();
|
||||
if(_loc6_ != "true")
|
||||
{
|
||||
_loc6_ = "false";
|
||||
}
|
||||
var _loc11_:String = "false";
|
||||
if(_loc2_.hasOwnProperty("forceHttpProxy"))
|
||||
{
|
||||
_loc11_ = _loc2_.forceHttpProxy.text();
|
||||
}
|
||||
var _loc12_:String = "false";
|
||||
if(_loc2_.hasOwnProperty("waitingMode"))
|
||||
{
|
||||
_loc12_ = _loc2_.waitingMode.text();
|
||||
}
|
||||
var _loc9_:Object = {
|
||||
"smartfoxServer":_loc2_.smartfoxServer.text(),
|
||||
"smartfoxPort":_loc2_.smartfoxPort.text(),
|
||||
"blueboxServer":_loc2_.blueboxServer.text(),
|
||||
"blueboxPort":_loc2_.blueboxPort.text(),
|
||||
"content":_loc2_.content.text(),
|
||||
"website":_loc2_.website.text(),
|
||||
"startupRoom":_loc2_.startupRoom.text(),
|
||||
"worldmapRoom":_loc2_.worldmapRoom.text(),
|
||||
"dangermapRoom":_loc2_.dangermapRoom.text(),
|
||||
"clientDebug":_loc6_,
|
||||
"forceHttpProxy":_loc11_,
|
||||
"waitingMode":_loc12_,
|
||||
"sg_params":"",
|
||||
"mdUrl":_loc2_.mdUrl,
|
||||
"playerWallHost":_loc2_.playerWallHost.text()
|
||||
};
|
||||
var _loc13_:int = 1;
|
||||
while(_loc2_.hasOwnProperty("smartfoxServer" + _loc13_))
|
||||
{
|
||||
_loc9_["smartfoxServer" + _loc13_] = _loc2_["smartfoxServer" + _loc13_].text();
|
||||
_loc13_++;
|
||||
}
|
||||
var _loc5_:int = 1;
|
||||
while(_loc2_.hasOwnProperty("blueboxServer" + _loc5_))
|
||||
{
|
||||
_loc9_["blueboxServer" + _loc5_] = _loc2_["blueboxServer" + _loc5_].text();
|
||||
_loc5_++;
|
||||
}
|
||||
_loc9_["build_version"] = _loc2_.hasOwnProperty("build_version") ? _loc2_.build_version.text() : "0";
|
||||
_loc9_["deploy_version"] = _loc2_.hasOwnProperty("deploy_version") ? _loc2_.deploy_version.text() : "0";
|
||||
_loc9_["locale"] = _loc2_.hasOwnProperty("locale") ? _loc2_.locale.text() : "en";
|
||||
_loc9_["myExternalIp"] = _loc2_.hasOwnProperty("myExternalIp") ? _loc2_.myExternalIp.text() : "";
|
||||
_loc9_["webRefPath"] = _loc2_.hasOwnProperty("webRefPath") ? _loc2_.webRefPath.text() : "";
|
||||
_loc9_["buddyRoomTimerInterval"] = _loc2_.hasOwnProperty("buddyRoomTimerInterval") ? _loc2_.buddyRoomTimerInterval.text() : "30000";
|
||||
for(var _loc8_:String in _loc9_)
|
||||
{
|
||||
if(_loc9_[_loc8_] is XMLList && XMLList(_loc9_[_loc8_]).length() > 1)
|
||||
{
|
||||
throw new Error("Invalid clientdevtest xml config! Found multiple tags of same name:" + _loc8_);
|
||||
}
|
||||
}
|
||||
applyConfigVars(_loc9_);
|
||||
}
|
||||
|
||||
public function init(param1:Singleton, param2:String, param3:Stage) : void
|
||||
{
|
||||
_path = param2;
|
||||
_stage = param3;
|
||||
_client = new SFClient();
|
||||
userInfo = new UserInfoCache();
|
||||
userInfo.init();
|
||||
clientInfo = {};
|
||||
clientInfo.invisMode = false;
|
||||
classNames = null;
|
||||
}
|
||||
|
||||
public function get server() : SFClient
|
||||
{
|
||||
return _client;
|
||||
}
|
||||
|
||||
public function get path() : String
|
||||
{
|
||||
return _path;
|
||||
}
|
||||
|
||||
override public function get stage() : Stage
|
||||
{
|
||||
return _stage;
|
||||
}
|
||||
|
||||
public function set createAccount(param1:DisplayObjectContainer) : void
|
||||
{
|
||||
_createAccount = param1;
|
||||
}
|
||||
|
||||
public function get createAccount() : DisplayObjectContainer
|
||||
{
|
||||
return _createAccount;
|
||||
}
|
||||
|
||||
public function set waitingRoom(param1:DisplayObjectContainer) : void
|
||||
{
|
||||
_waitingRoom = param1;
|
||||
}
|
||||
|
||||
public function get waitingRoom() : DisplayObjectContainer
|
||||
{
|
||||
return _waitingRoom;
|
||||
}
|
||||
|
||||
public function set gamePlay(param1:DisplayObjectContainer) : void
|
||||
{
|
||||
_gamePlay = param1;
|
||||
}
|
||||
|
||||
public function get gamePlay() : DisplayObjectContainer
|
||||
{
|
||||
return _gamePlay;
|
||||
}
|
||||
|
||||
public function get layerManager() : LayerManager
|
||||
{
|
||||
return (_gamePlay as GamePlay).layerManager;
|
||||
}
|
||||
|
||||
public function get loaderCache() : LoaderCache
|
||||
{
|
||||
return _loaderCache;
|
||||
}
|
||||
|
||||
public function set layerInfo(param1:Object) : void
|
||||
{
|
||||
_layerInfo = param1;
|
||||
ImageServerURL.instance.layerInfo = param1;
|
||||
}
|
||||
|
||||
public function get myFlashVarUserName() : String
|
||||
{
|
||||
return _flashVarUserName;
|
||||
}
|
||||
|
||||
public function set myFlashVarUserName(param1:String) : void
|
||||
{
|
||||
_flashVarUserName = param1;
|
||||
}
|
||||
|
||||
public function isInMinigame() : Boolean
|
||||
{
|
||||
return _gamePlay != null && _gamePlay["isInMinigame"]();
|
||||
}
|
||||
|
||||
public function setAvatarOffsets(param1:Array) : void
|
||||
{
|
||||
LayerAnim.avOffsets = param1;
|
||||
}
|
||||
|
||||
public function switchServersIfNeeded(param1:String) : Boolean
|
||||
{
|
||||
DebugUtility.debugTrace("switchServersIfNeeded called with newNode:" + param1);
|
||||
var _loc2_:String = param1;
|
||||
DebugUtility.debugTrace("checking new node:" + _loc2_ + " vs old node:" + _client.serverIp);
|
||||
if(_client.serverIp == _loc2_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_gamePlay["reconnecting"] = true;
|
||||
_gamePlay["showLoadProgress"](true,7);
|
||||
_client.switchServerNode(_loc2_);
|
||||
_client.disconnect();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Singleton
|
||||
{
|
||||
|
||||
public function Singleton()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,551 @@
|
||||
package Party
|
||||
{
|
||||
import avatar.Avatar;
|
||||
import avatar.AvatarManager;
|
||||
import avatar.UserInfo;
|
||||
import com.sbi.analytics.SBTracker;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.popup.SBOkPopup;
|
||||
import com.sbi.popup.SBStandardPopup;
|
||||
import currency.UserCurrency;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.MouseEvent;
|
||||
import gui.DarkenManager;
|
||||
import gui.GuiManager;
|
||||
import loader.DefPacksDefHelper;
|
||||
import loader.MediaHelper;
|
||||
import localization.LocalizationManager;
|
||||
import pet.PetManager;
|
||||
import room.RoomManagerWorld;
|
||||
import room.RoomXtCommManager;
|
||||
|
||||
public class PartyManager
|
||||
{
|
||||
|
||||
public static const RESTRICTIONS_NONE:int = 0;
|
||||
|
||||
public static const RESTRICTIONS_AVATAR:int = 1;
|
||||
|
||||
public static const RESTRICTIONS_MEMBERONLY:int = 2;
|
||||
|
||||
public static const RESTRICTIONS_PET:int = 4;
|
||||
|
||||
public static const RESTRICTIONS_BEYOURPET:int = 8;
|
||||
|
||||
private static const PARTY_POPUP_MEDIA_ID:int = 1215;
|
||||
|
||||
private static const PARTY_BARRIER_MEDIA_ID:int = 1299;
|
||||
|
||||
private static var _partyDefs:Object;
|
||||
|
||||
private static var _partyPopup:PartyPopup;
|
||||
|
||||
private static var _partyBarrier:MovieClip;
|
||||
|
||||
private static var _loadingMediaHelper:MediaHelper;
|
||||
|
||||
private static var _timeOffset:int;
|
||||
|
||||
public function PartyManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init() : void
|
||||
{
|
||||
_timeOffset = Math.abs(RoomManagerWorld.instance.shardId) * 10 % 60;
|
||||
requestPartyDefs(null);
|
||||
}
|
||||
|
||||
public static function openPartyPopup() : void
|
||||
{
|
||||
if(_partyPopup)
|
||||
{
|
||||
_partyPopup.destroy();
|
||||
}
|
||||
_partyPopup = new PartyPopup(onPartyPopupClose,_timeOffset);
|
||||
}
|
||||
|
||||
public static function showPartyPopup(param1:Boolean) : void
|
||||
{
|
||||
if(_partyPopup)
|
||||
{
|
||||
_partyPopup.showPopup(param1);
|
||||
}
|
||||
else
|
||||
{
|
||||
openPartyPopup();
|
||||
}
|
||||
}
|
||||
|
||||
public static function closePartyPopup(param1:Boolean = false) : void
|
||||
{
|
||||
if(param1 && _partyPopup)
|
||||
{
|
||||
_partyPopup.showPopup(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
onPartyPopupClose();
|
||||
}
|
||||
}
|
||||
|
||||
public static function updateTime(param1:int) : void
|
||||
{
|
||||
if(_partyPopup)
|
||||
{
|
||||
_partyPopup.updateTime(param1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function get partyDefs() : Object
|
||||
{
|
||||
return _partyDefs;
|
||||
}
|
||||
|
||||
public static function getPartyDef(param1:int) : Object
|
||||
{
|
||||
return _partyDefs[param1];
|
||||
}
|
||||
|
||||
public static function roomSoireeResponse(param1:Object) : void
|
||||
{
|
||||
var _loc2_:String = null;
|
||||
var _loc3_:int = 2;
|
||||
if(param1[_loc3_++] == "0")
|
||||
{
|
||||
_loc2_ = param1[_loc3_++];
|
||||
RoomXtCommManager.loadingNewRoom = false;
|
||||
if(_loc2_ == "NM")
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14779));
|
||||
}
|
||||
else if(_loc2_ == "NA")
|
||||
{
|
||||
showPartyBarrier(false,false,param1[_loc3_++]);
|
||||
}
|
||||
else if(_loc2_ == "NP")
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
showPartyBarrier(false,false,param1[_loc3_++]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function partyListResponse(param1:Object) : void
|
||||
{
|
||||
if(_partyPopup)
|
||||
{
|
||||
_partyPopup.partyListResponse(param1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function customPartyListResponse(param1:Object) : void
|
||||
{
|
||||
if(_partyPopup)
|
||||
{
|
||||
_partyPopup.customPartyListResponse(param1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function customPartyCreateResponse(param1:Object) : void
|
||||
{
|
||||
var _loc2_:UserInfo = null;
|
||||
var _loc3_:Boolean = false;
|
||||
var _loc4_:int = 0;
|
||||
var _loc5_:int = 2;
|
||||
var _loc6_:Boolean = param1[_loc5_++] == "1";
|
||||
if(_loc6_)
|
||||
{
|
||||
_loc3_ = param1[_loc5_++] == "1";
|
||||
if(_loc3_)
|
||||
{
|
||||
_loc2_ = gMainFrame.userInfo.playerUserInfo;
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc2_.timeLeftHostingCustomParty = int(param1[_loc5_++]);
|
||||
gMainFrame.userInfo.playerUserInfo = _loc2_;
|
||||
AvatarManager.updateCustomPartyHostingDataForMyself();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = gMainFrame.userInfo.playerUserInfo;
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc2_.timeLeftHostingCustomParty = -1;
|
||||
gMainFrame.userInfo.playerUserInfo = _loc2_;
|
||||
AvatarManager.updateCustomPartyHostingDataForMyself();
|
||||
}
|
||||
switch(param1[_loc5_++])
|
||||
{
|
||||
case "ND":
|
||||
_loc4_ = 24247;
|
||||
break;
|
||||
case "EXISTS":
|
||||
_loc4_ = 24249;
|
||||
break;
|
||||
case "NM":
|
||||
_loc4_ = 24236;
|
||||
break;
|
||||
case "INV":
|
||||
case "NR":
|
||||
case "DIS":
|
||||
default:
|
||||
_loc4_ = 24248;
|
||||
}
|
||||
onPartyPopupClose(true);
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(_loc4_));
|
||||
}
|
||||
}
|
||||
|
||||
public static function customPartyJoinResponse(param1:Object) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:int = 2;
|
||||
var _loc4_:Boolean = param1[_loc3_++] == "1";
|
||||
if(!_loc4_)
|
||||
{
|
||||
switch(param1[_loc3_++])
|
||||
{
|
||||
case "NPP":
|
||||
case "BLK":
|
||||
case "DIS":
|
||||
_loc2_ = 24251;
|
||||
break;
|
||||
default:
|
||||
_loc2_ = 24251;
|
||||
}
|
||||
onPartyPopupClose(true);
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(_loc2_));
|
||||
}
|
||||
}
|
||||
|
||||
public static function customPartyIsHostingResponse(param1:Object, param2:String, param3:Function) : void
|
||||
{
|
||||
var _loc4_:UserInfo = null;
|
||||
var _loc5_:int = int(param1[2]);
|
||||
if(param2 != null && param2 != "")
|
||||
{
|
||||
_loc4_ = gMainFrame.userInfo.getUserInfoByUserName(param2);
|
||||
if(_loc4_)
|
||||
{
|
||||
_loc4_.timeLeftHostingCustomParty = _loc5_;
|
||||
}
|
||||
}
|
||||
if(param3 != null)
|
||||
{
|
||||
param3(_loc5_,_loc4_);
|
||||
}
|
||||
}
|
||||
|
||||
public static function customPartyKillResponse(param1:Object) : void
|
||||
{
|
||||
var _loc2_:UserInfo = gMainFrame.userInfo.playerUserInfo;
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc2_.timeLeftHostingCustomParty = -1;
|
||||
gMainFrame.userInfo.playerUserInfo = _loc2_;
|
||||
AvatarManager.updateCustomPartyHostingDataForMyself();
|
||||
}
|
||||
onPartyPopupClose(true);
|
||||
var _loc3_:int = int(param1[2]);
|
||||
Utility.setupDiamondRefundPopup(GuiManager.guiLayer,_loc3_,null);
|
||||
UserCurrency.setCurrency(UserCurrency.getCurrency(3) + _loc3_,3);
|
||||
}
|
||||
|
||||
public static function requestPartyDefs(param1:Function) : void
|
||||
{
|
||||
var _loc2_:DefPacksDefHelper = new DefPacksDefHelper();
|
||||
_loc2_.init(1047,onPartyDataResponse,param1,2);
|
||||
DefPacksDefHelper.mediaArray[1047] = _loc2_;
|
||||
}
|
||||
|
||||
public static function sendCustomPartyJoin(param1:String, param2:String, param3:String) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
if(param3 == null)
|
||||
{
|
||||
PartyXtCommManager.sendCustomPartyNodeId(param1,param2,onGetPartyNodeId);
|
||||
}
|
||||
else if(param3 == gMainFrame.server.serverIp)
|
||||
{
|
||||
PartyXtCommManager.sendCustomPartyJoinRequest(param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
gMainFrame.clientInfo.autoStartRoom = param2;
|
||||
gMainFrame.clientInfo.autoStartRoomShardId = -4;
|
||||
DebugUtility.debugTrace("using autoStartRoom to prep resend custom party join request after switching server nodes - customPartyCreatorUUID:" + gMainFrame.clientInfo.autoStartRoom + " autoStartRoomShardId:" + gMainFrame.clientInfo.autoStartRoomShardId);
|
||||
if(!gMainFrame.switchServersIfNeeded(param3))
|
||||
{
|
||||
new SBStandardPopup(LoadProgress.loadLayer,LocalizationManager.translateIdOnly(14835),false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function isBeYourPetParty() : Boolean
|
||||
{
|
||||
var _loc1_:Object = null;
|
||||
if(gMainFrame.clientInfo.roomType == 5)
|
||||
{
|
||||
_loc1_ = _partyDefs[gMainFrame.clientInfo.secondaryDefId];
|
||||
if(_loc1_ != null && _loc1_.restrictions == 8)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function canSwitchToAvatar(param1:Avatar, param2:Boolean = false) : Boolean
|
||||
{
|
||||
var _loc3_:Object = null;
|
||||
if(gMainFrame.clientInfo.roomType == 5)
|
||||
{
|
||||
_loc3_ = _partyDefs[gMainFrame.clientInfo.secondaryDefId];
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
if(_loc3_.restrictions == 1)
|
||||
{
|
||||
if((_loc3_.avatarDefFlags & 1 << param1.avTypeId - 1) == 0)
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
showPartyBarrier(true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if(_loc3_.restrictions == 4)
|
||||
{
|
||||
if(!PetManager.checkIfHasPet(param1.enviroTypeFlag))
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
showPartyBarrier(true,true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function canSwitchPet(param1:Boolean = false) : Boolean
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
if(gMainFrame.clientInfo.roomType == 5)
|
||||
{
|
||||
_loc2_ = _partyDefs[gMainFrame.clientInfo.secondaryDefId];
|
||||
if(_loc2_ != null && (_loc2_.restrictions == 4 || _loc2_.restrictions == 8))
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
showPartyBarrier(true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function showPartyBarrier(param1:Boolean = false, param2:Boolean = false, param3:int = -1) : void
|
||||
{
|
||||
var _loc4_:Object = null;
|
||||
if(param3 == -1)
|
||||
{
|
||||
param3 = int(gMainFrame.clientInfo.secondaryDefId);
|
||||
}
|
||||
if(_partyBarrier)
|
||||
{
|
||||
_loc4_ = _partyDefs[param3];
|
||||
if(_loc4_ != null)
|
||||
{
|
||||
if(int(_loc4_.restrictions) == 4 || int(_loc4_.restrictions) == 8)
|
||||
{
|
||||
setupBarrierTextForPets({
|
||||
"isTryingToSwitch":param1,
|
||||
"doesNotHaveRequiredPet":param2
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
onAvatarNameLocalization(_loc4_.avatarDefFlags,param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
_loadingMediaHelper = new MediaHelper();
|
||||
_loadingMediaHelper.init(1299,onMediaItemLoaded,{
|
||||
"isTryingToSwitch":param1,
|
||||
"doesNotHaveRequiredPet":param2,
|
||||
"secondaryDefId":param3
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static function onPopup(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
}
|
||||
|
||||
private static function onBarrierClose(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
DarkenManager.unDarken(_partyBarrier);
|
||||
_partyBarrier.visible = false;
|
||||
}
|
||||
|
||||
private static function onPartyDataResponse(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
DefPacksDefHelper.mediaArray[1047] = null;
|
||||
_partyDefs = param1.def;
|
||||
if(param1.passback != null)
|
||||
{
|
||||
param1.passback();
|
||||
}
|
||||
}
|
||||
|
||||
private static function onMediaItemLoaded(param1:MovieClip) : void
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
if(param1)
|
||||
{
|
||||
_partyBarrier = MovieClip(param1.getChildAt(0));
|
||||
_partyBarrier.addEventListener("mouseDown",onPopup,false,0,true);
|
||||
_partyBarrier.bx.addEventListener("mouseDown",onBarrierClose,false,0,true);
|
||||
_partyBarrier.x = 900 * 0.5;
|
||||
_partyBarrier.y = 550 * 0.5;
|
||||
_partyBarrier.visible = false;
|
||||
GuiManager.guiLayer.addChild(_partyBarrier);
|
||||
_loc2_ = _partyDefs[param1.passback.secondaryDefId];
|
||||
if(_loc2_ != null)
|
||||
{
|
||||
if(int(_loc2_.restrictions) == 4 || int(_loc2_.restrictions) == 8)
|
||||
{
|
||||
setupBarrierTextForPets(param1.passback);
|
||||
}
|
||||
else
|
||||
{
|
||||
onAvatarNameLocalization(_loc2_.avatarDefFlags,param1.passback.isTryingToSwitch);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function onPartyPopupClose(param1:Boolean = false) : void
|
||||
{
|
||||
if(_partyPopup)
|
||||
{
|
||||
_partyPopup.destroy(param1);
|
||||
_partyPopup = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static function onAvatarNameLocalization(param1:Number, param2:Object = null) : void
|
||||
{
|
||||
var _loc5_:String = param1.toString(2);
|
||||
var _loc3_:int = _loc5_.length - 1;
|
||||
_loc3_;
|
||||
while(_loc3_ >= 0)
|
||||
{
|
||||
if(_loc5_.charAt(_loc3_) == "1")
|
||||
{
|
||||
_loc3_ = _loc5_.length - 1 - _loc3_ + 1;
|
||||
break;
|
||||
}
|
||||
_loc3_--;
|
||||
}
|
||||
var _loc4_:String = "Avatar" + _loc3_;
|
||||
if(_partyBarrier.currentFrameLabel != _loc4_)
|
||||
{
|
||||
_partyBarrier.gotoAndStop(_loc4_);
|
||||
}
|
||||
if(gMainFrame.userInfo.isMember)
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
SBTracker.trackPageview("/game/play/popup/barrier/#" + _loc4_ + "/member/switch");
|
||||
}
|
||||
else
|
||||
{
|
||||
SBTracker.trackPageview("/game/play/popup/barrier/#" + _loc4_ + "/member");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SBTracker.trackPageview("/game/play/popup/barrier/#" + _loc4_ + "/nonMember");
|
||||
}
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
_partyBarrier.parent.setChildIndex(_partyBarrier,_partyBarrier.parent.numChildren - 1);
|
||||
DarkenManager.darken(_partyBarrier);
|
||||
_partyBarrier.visible = true;
|
||||
}
|
||||
|
||||
private static function setupBarrierTextForPets(param1:Object = null) : void
|
||||
{
|
||||
if(_partyBarrier.currentFrameLabel != "Pets")
|
||||
{
|
||||
_partyBarrier.gotoAndStop("Pets");
|
||||
}
|
||||
if(param1)
|
||||
{
|
||||
if(param1.doesNotHaveRequiredPet)
|
||||
{
|
||||
LocalizationManager.translateId(_partyBarrier.Message_txt,18790);
|
||||
}
|
||||
else
|
||||
{
|
||||
LocalizationManager.translateId(_partyBarrier.Message_txt,11407);
|
||||
}
|
||||
}
|
||||
else if(AvatarManager.roomEnviroType == 1)
|
||||
{
|
||||
LocalizationManager.translateId(_partyBarrier.Message_txt,11366);
|
||||
}
|
||||
else
|
||||
{
|
||||
LocalizationManager.translateId(_partyBarrier.Message_txt,11367);
|
||||
}
|
||||
if(gMainFrame.userInfo.isMember)
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
SBTracker.trackPageview("/game/play/popup/barrier/#petParty/member/switch");
|
||||
}
|
||||
else
|
||||
{
|
||||
SBTracker.trackPageview("/game/play/popup/barrier/#petParty/member");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SBTracker.trackPageview("/game/play/popup/barrier/#petParty/nonMember");
|
||||
}
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
_partyBarrier.parent.setChildIndex(_partyBarrier,_partyBarrier.parent.numChildren - 1);
|
||||
DarkenManager.darken(_partyBarrier);
|
||||
_partyBarrier.visible = true;
|
||||
}
|
||||
|
||||
private static function onGetPartyNodeId(param1:String, param2:Object) : void
|
||||
{
|
||||
if(param2[2] == "1")
|
||||
{
|
||||
sendCustomPartyJoin(param1,param2[3],param2[4]);
|
||||
}
|
||||
else
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,963 @@
|
||||
package Party
|
||||
{
|
||||
import avatar.AvatarManager;
|
||||
import avatar.UserInfo;
|
||||
import com.greensock.TimelineLite;
|
||||
import com.greensock.TweenLite;
|
||||
import com.greensock.easing.Expo;
|
||||
import com.sbi.popup.SBOkPopup;
|
||||
import customParty.CustomPartyCreatePopup;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.text.TextField;
|
||||
import flash.utils.getTimer;
|
||||
import game.MinigameManager;
|
||||
import game.MinigameXtCommManager;
|
||||
import gui.DarkenManager;
|
||||
import gui.GuiManager;
|
||||
import gui.ItemWindowParty;
|
||||
import gui.LoadingSpiral;
|
||||
import gui.WindowAndScrollbarGenerator;
|
||||
import loader.MediaHelper;
|
||||
import localization.LocalizationManager;
|
||||
import quest.QuestXtCommManager;
|
||||
import room.RoomManagerWorld;
|
||||
import room.RoomXtCommManager;
|
||||
|
||||
public class PartyPopup
|
||||
{
|
||||
|
||||
private const PARTY_POPUP_MEDIA_ID:int = 1215;
|
||||
|
||||
private const REQUEST_INTERVAL:Number = 10000;
|
||||
|
||||
private const ADDITIONAL_ADVENTURE_SCRIPT_ID:int = 283;
|
||||
|
||||
private var _mediaHelper:MediaHelper;
|
||||
|
||||
private var _partyPopup:MovieClip;
|
||||
|
||||
private var _closeCallback:Function;
|
||||
|
||||
private var _customPartiesLoadingSpiral:LoadingSpiral;
|
||||
|
||||
private var _ajPartiesLoadingSpiral:LoadingSpiral;
|
||||
|
||||
private var _ajPartySingleLoadingSpiral:LoadingSpiral;
|
||||
|
||||
private var _headersLoadingSpiral:LoadingSpiral;
|
||||
|
||||
private var _partyDefIds:Array;
|
||||
|
||||
private var _secToStart:Array;
|
||||
|
||||
private var _additionalScriptDefs:Array;
|
||||
|
||||
private var _additionalHeaderData:Array;
|
||||
|
||||
private var _partyMediaIds:Array;
|
||||
|
||||
private var _secToEnd:Array;
|
||||
|
||||
private var _partyDefs:Object;
|
||||
|
||||
private var _mins:Array;
|
||||
|
||||
private var _hours:Array;
|
||||
|
||||
private var _customPartyData:Array;
|
||||
|
||||
private var _adventureHeaderWindow:ItemWindowParty;
|
||||
|
||||
private var _additionalHeaderWindow1:ItemWindowParty;
|
||||
|
||||
private var _additionalHeaderWindow2:ItemWindowParty;
|
||||
|
||||
private var _ajItemWindows:WindowAndScrollbarGenerator;
|
||||
|
||||
private var _ajItemWindowSingle:ItemWindowParty;
|
||||
|
||||
private var _customPartyItemWindows:WindowAndScrollbarGenerator;
|
||||
|
||||
private var _adventureHeaderMediaId:int;
|
||||
|
||||
private var _timeOffset:int;
|
||||
|
||||
private var _initialTime:int;
|
||||
|
||||
private var _numSecPassed:int;
|
||||
|
||||
private var _hadReceivedPartyList:Boolean;
|
||||
|
||||
private var _partiesListLoaded:Boolean;
|
||||
|
||||
private var _tabTimeLine:TimelineLite;
|
||||
|
||||
private var _customPartyCreatePopup:CustomPartyCreatePopup;
|
||||
|
||||
public function PartyPopup(param1:Function, param2:int)
|
||||
{
|
||||
super();
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
_timeOffset = param2;
|
||||
_closeCallback = param1;
|
||||
_mediaHelper = new MediaHelper();
|
||||
_mediaHelper.init(1215,onPartyPopupLoaded);
|
||||
}
|
||||
|
||||
public function destroy(param1:Boolean = false) : void
|
||||
{
|
||||
_closeCallback = null;
|
||||
_hadReceivedPartyList = false;
|
||||
if(_mediaHelper)
|
||||
{
|
||||
_mediaHelper.destroy();
|
||||
_mediaHelper = null;
|
||||
}
|
||||
if(_adventureHeaderWindow)
|
||||
{
|
||||
_adventureHeaderWindow.destroy();
|
||||
_adventureHeaderWindow = null;
|
||||
}
|
||||
if(_additionalHeaderWindow1)
|
||||
{
|
||||
_additionalHeaderWindow1.destroy();
|
||||
_additionalHeaderWindow1 = null;
|
||||
}
|
||||
if(_additionalHeaderWindow2)
|
||||
{
|
||||
_additionalHeaderWindow2.destroy();
|
||||
_additionalHeaderWindow2 = null;
|
||||
}
|
||||
if(_ajItemWindowSingle)
|
||||
{
|
||||
_ajItemWindowSingle.destroy();
|
||||
_ajItemWindowSingle = null;
|
||||
}
|
||||
if(_ajItemWindows)
|
||||
{
|
||||
_ajItemWindows.destroy();
|
||||
_ajItemWindows = null;
|
||||
}
|
||||
if(_customPartiesLoadingSpiral)
|
||||
{
|
||||
_customPartiesLoadingSpiral.destroy();
|
||||
_customPartiesLoadingSpiral = null;
|
||||
}
|
||||
if(_ajPartiesLoadingSpiral)
|
||||
{
|
||||
_ajPartiesLoadingSpiral.destroy();
|
||||
_ajPartiesLoadingSpiral = null;
|
||||
}
|
||||
if(_ajPartySingleLoadingSpiral)
|
||||
{
|
||||
_ajPartySingleLoadingSpiral.destroy();
|
||||
_ajPartySingleLoadingSpiral = null;
|
||||
}
|
||||
if(_headersLoadingSpiral)
|
||||
{
|
||||
_headersLoadingSpiral.destroy();
|
||||
_headersLoadingSpiral = null;
|
||||
}
|
||||
if(_tabTimeLine)
|
||||
{
|
||||
_tabTimeLine.kill();
|
||||
_tabTimeLine = null;
|
||||
}
|
||||
onCustomPartyCreateClose(param1);
|
||||
DarkenManager.unDarken(_partyPopup.parent);
|
||||
if(GuiManager.guiLayer.contains(_partyPopup.parent))
|
||||
{
|
||||
GuiManager.guiLayer.removeChild(_partyPopup.parent);
|
||||
}
|
||||
_partyPopup = null;
|
||||
}
|
||||
|
||||
public function showPopup(param1:Boolean) : void
|
||||
{
|
||||
if(_partyPopup)
|
||||
{
|
||||
if(_customPartyCreatePopup)
|
||||
{
|
||||
_customPartyCreatePopup.showPopup(false);
|
||||
}
|
||||
_partyPopup.parent.visible = param1;
|
||||
if(param1)
|
||||
{
|
||||
DarkenManager.darken(_partyPopup.parent);
|
||||
}
|
||||
else
|
||||
{
|
||||
DarkenManager.unDarken(_partyPopup.parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function updateTime(param1:int) : void
|
||||
{
|
||||
if(_hadReceivedPartyList && param1 - _initialTime >= 10000)
|
||||
{
|
||||
_initialTime = param1;
|
||||
onHeartbeat();
|
||||
}
|
||||
}
|
||||
|
||||
public function partyListResponse(param1:Object) : void
|
||||
{
|
||||
var _loc4_:int = 0;
|
||||
var _loc6_:Array = null;
|
||||
var _loc3_:int = 0;
|
||||
var _loc5_:int = 0;
|
||||
var _loc8_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
var _loc7_:Object = null;
|
||||
if(_partyPopup)
|
||||
{
|
||||
_partyDefIds = [];
|
||||
_secToStart = [];
|
||||
_secToEnd = [];
|
||||
_partyMediaIds = [];
|
||||
_additionalHeaderData = [];
|
||||
_loc6_ = [];
|
||||
_loc3_ = int(param1[3]);
|
||||
_loc5_ = 4;
|
||||
if(_additionalScriptDefs == null)
|
||||
{
|
||||
GenericListXtCommManager.requestGenericList(283,OnAddionalAdventureScriptDefLoaded,param1);
|
||||
return;
|
||||
}
|
||||
_adventureHeaderMediaId = 2253;
|
||||
_loc2_ = int(param1[2]);
|
||||
if(_loc2_ != -1)
|
||||
{
|
||||
_additionalHeaderData.push({
|
||||
"isParty":true,
|
||||
"defId":_loc2_,
|
||||
"mediaId":int(_partyDefs[_loc2_].mediaRefId),
|
||||
"secToStart":0,
|
||||
"secToEnd":0,
|
||||
"headerTime":Utility.calculateTime(0)
|
||||
});
|
||||
}
|
||||
if(_additionalScriptDefs.length > 0)
|
||||
{
|
||||
_loc8_ = 0;
|
||||
while(_loc8_ < _additionalScriptDefs.length)
|
||||
{
|
||||
_loc7_ = QuestXtCommManager.getScriptDef(_additionalScriptDefs[_loc8_]);
|
||||
if(_loc7_)
|
||||
{
|
||||
_additionalHeaderData.push({
|
||||
"isParty":false,
|
||||
"defId":_loc7_.defId,
|
||||
"mediaId":_loc7_.bannerMediaRefId,
|
||||
"secToStart":0,
|
||||
"secToEnd":0,
|
||||
"headerTime":Utility.calculateTime(0)
|
||||
});
|
||||
}
|
||||
_loc8_++;
|
||||
}
|
||||
}
|
||||
initializePartyPopup();
|
||||
switch(int(_additionalHeaderData.length))
|
||||
{
|
||||
case 0:
|
||||
_partyPopup.gotoAndStop("header");
|
||||
break;
|
||||
case 1:
|
||||
_partyPopup.gotoAndStop("twoHeader");
|
||||
break;
|
||||
default:
|
||||
_partyPopup.gotoAndStop("threeHeader");
|
||||
}
|
||||
setupCreateJoinButtonText();
|
||||
addEventListeners();
|
||||
setupLoadingSpirals();
|
||||
buildHeaderPartyWindows();
|
||||
_loc8_ = 0;
|
||||
while(_loc8_ < _loc3_)
|
||||
{
|
||||
_partyDefIds[_loc8_] = int(param1[_loc5_]);
|
||||
if(_partyDefs[int(param1[_loc5_])])
|
||||
{
|
||||
_loc4_ = int(_partyDefs[int(param1[_loc5_])].titleStrId);
|
||||
if(!_loc6_[_loc4_])
|
||||
{
|
||||
_loc6_[_loc4_] = true;
|
||||
}
|
||||
_partyMediaIds[_loc8_] = int(_partyDefs[int(param1[_loc5_++])].mediaRefId);
|
||||
_secToStart[_loc8_] = Number(param1[_loc5_++]);
|
||||
if(_secToStart[_loc8_] != 0)
|
||||
{
|
||||
var _loc9_:int = _loc8_;
|
||||
var _loc10_:Number = _secToStart[_loc9_] + _timeOffset;
|
||||
_secToStart[_loc9_] = _loc10_;
|
||||
}
|
||||
_secToEnd[_loc8_] = Number(param1[_loc5_++]);
|
||||
}
|
||||
_loc8_++;
|
||||
}
|
||||
_loc6_ = null;
|
||||
calculateTime();
|
||||
_initialTime = getTimer();
|
||||
buildAJSinglePartyWindow();
|
||||
_hadReceivedPartyList = true;
|
||||
PartyXtCommManager.sendCustomPartyListRequest(0,200);
|
||||
}
|
||||
}
|
||||
|
||||
public function customPartyListResponse(param1:Object) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
var _loc5_:int = 0;
|
||||
var _loc8_:int = 0;
|
||||
_customPartyData = [];
|
||||
var _loc6_:int = 2;
|
||||
var _loc7_:Boolean = param1[_loc6_++] == "1";
|
||||
var _loc3_:int = int(param1[_loc6_++]);
|
||||
if(_loc3_ > 0)
|
||||
{
|
||||
_loc2_ = int(param1[_loc6_++]);
|
||||
_loc4_ = int(param1[_loc6_++]);
|
||||
_loc5_ = int(param1[_loc6_++]);
|
||||
if(_loc5_ > 0)
|
||||
{
|
||||
_loc8_ = 0;
|
||||
while(_loc8_ < _loc5_)
|
||||
{
|
||||
_customPartyData.push({
|
||||
"creator":param1[_loc6_++],
|
||||
"name":param1[_loc6_++],
|
||||
"nodeId":param1[_loc6_++],
|
||||
"defId":int(param1[_loc6_++]),
|
||||
"timeLeft":Number(param1[_loc6_++])
|
||||
});
|
||||
_loc8_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
buildCustomPartyWindows();
|
||||
}
|
||||
|
||||
private function onPartyPopupLoaded(param1:MovieClip) : void
|
||||
{
|
||||
_partyPopup = (param1.getChildAt(0) as MovieClip).partyFrames;
|
||||
_mins = [];
|
||||
_hours = [];
|
||||
requestData();
|
||||
}
|
||||
|
||||
private function initializePartyPopup() : void
|
||||
{
|
||||
if(!GuiManager.guiLayer.contains(_partyPopup.parent))
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
_partyPopup.parent.x = 900 * 0.5;
|
||||
_partyPopup.parent.y = 550 * 0.5;
|
||||
GuiManager.guiLayer.addChild(_partyPopup.parent);
|
||||
DarkenManager.darken(_partyPopup.parent);
|
||||
}
|
||||
}
|
||||
|
||||
private function requestData() : void
|
||||
{
|
||||
if(PartyManager.partyDefs != null)
|
||||
{
|
||||
_partyDefs = PartyManager.partyDefs;
|
||||
PartyXtCommManager.sendPartyListRequest();
|
||||
}
|
||||
else
|
||||
{
|
||||
PartyManager.requestPartyDefs(requestData);
|
||||
}
|
||||
}
|
||||
|
||||
private function setupLoadingSpirals() : void
|
||||
{
|
||||
if(_partyPopup.itemWindowSpiral)
|
||||
{
|
||||
_headersLoadingSpiral = new LoadingSpiral(_partyPopup.itemWindowSpiral,_partyPopup.itemWindowSpiral.width * 0.5,_partyPopup.itemWindowSpiral.height * 0.5);
|
||||
}
|
||||
_customPartiesLoadingSpiral = new LoadingSpiral(_partyPopup.itemWindow,_partyPopup.itemWindow.width * 0.5,_partyPopup.itemWindow.height * 0.5);
|
||||
_ajPartiesLoadingSpiral = new LoadingSpiral(_partyPopup.frameDrawerCont.itemWindow,_partyPopup.frameDrawerCont.itemWindow.width * 0.5,_partyPopup.frameDrawerCont.itemWindow.height * 0.5);
|
||||
_ajPartySingleLoadingSpiral = new LoadingSpiral(_partyPopup.itemWindowAJ,_partyPopup.itemWindowAJ.width * 0.5,_partyPopup.itemWindowAJ.height * 0.5);
|
||||
}
|
||||
|
||||
private function buildAJSinglePartyWindow() : void
|
||||
{
|
||||
if(_ajItemWindowSingle)
|
||||
{
|
||||
_ajItemWindowSingle.destroy();
|
||||
}
|
||||
_ajItemWindowSingle = new ItemWindowParty(onSinglePartyWindowLoaded,_partyDefIds[0],"",0,ajWinMouseDown,null,null,null,{
|
||||
"mediaRefId":_partyMediaIds,
|
||||
"printTimeFunc":getAJWindowPrintTime
|
||||
});
|
||||
}
|
||||
|
||||
private function buildAJPartyWindows() : void
|
||||
{
|
||||
if(_ajItemWindows)
|
||||
{
|
||||
_ajItemWindows.destroy();
|
||||
}
|
||||
_ajItemWindows = new WindowAndScrollbarGenerator();
|
||||
_ajItemWindows.init(_partyPopup.frameDrawerCont.itemWindow.width,_partyPopup.frameDrawerCont.itemWindow.height,3,0,1,6,0,0,2,0,ItemWindowParty,_partyDefIds,"",0,{"mouseDown":ajWinMouseDown},{
|
||||
"mediaRefId":_partyMediaIds,
|
||||
"printTimeFunc":getAJWindowPrintTime
|
||||
},onAjPartiesLoaded,true,false,false);
|
||||
}
|
||||
|
||||
private function buildCustomPartyWindows() : void
|
||||
{
|
||||
if(_customPartyItemWindows)
|
||||
{
|
||||
_customPartyItemWindows.destroy();
|
||||
}
|
||||
_customPartyItemWindows = new WindowAndScrollbarGenerator();
|
||||
_customPartyItemWindows.init(_partyPopup.itemWindow.width,_partyPopup.itemWindow.height,4,0,1,4,0,0,2,0,ItemWindowParty,_customPartyData,"",0,{"mouseDown":customWinMouseDown},{"printTimeFunc":getCustomWindowPrintTime},onCustomPartiesLoaded,true,false,false);
|
||||
}
|
||||
|
||||
private function buildHeaderPartyWindows() : void
|
||||
{
|
||||
if(_adventureHeaderWindow)
|
||||
{
|
||||
_adventureHeaderWindow.destroy();
|
||||
_adventureHeaderWindow = null;
|
||||
}
|
||||
_adventureHeaderWindow = new ItemWindowParty(onSinglePartyWindowLoaded,null,"",0,singleWinMouseDown,null,null,null,{"mediaRefId":[_adventureHeaderMediaId]});
|
||||
if(_additionalHeaderData.length > 0)
|
||||
{
|
||||
if(_additionalHeaderWindow1)
|
||||
{
|
||||
_additionalHeaderWindow1.destroy();
|
||||
_additionalHeaderWindow1 = null;
|
||||
}
|
||||
_additionalHeaderWindow1 = new ItemWindowParty(onSinglePartyWindowLoaded,null,"",0,singleWinMouseDown,null,null,null,{
|
||||
"mediaRefId":[_additionalHeaderData[0].mediaId],
|
||||
"additionalIndex":0
|
||||
});
|
||||
if(_additionalHeaderData.length == 2)
|
||||
{
|
||||
if(_additionalHeaderWindow2)
|
||||
{
|
||||
_additionalHeaderWindow2.destroy();
|
||||
_additionalHeaderWindow2 = null;
|
||||
}
|
||||
_additionalHeaderWindow2 = new ItemWindowParty(onSinglePartyWindowLoaded,null,"",0,singleWinMouseDown,null,null,null,{
|
||||
"mediaRefId":[_additionalHeaderData[1].mediaId],
|
||||
"additionalIndex":1
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function calculatePrintTime(param1:int, param2:Boolean = false) : String
|
||||
{
|
||||
return Utility.calculatePrintTime(_mins[param1],_hours[param1],param2);
|
||||
}
|
||||
|
||||
private function calculateTime() : void
|
||||
{
|
||||
var _loc1_:Object = null;
|
||||
var _loc2_:int = 0;
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _secToStart.length)
|
||||
{
|
||||
_loc1_ = Utility.calculateTime(_secToStart[_loc2_]);
|
||||
_mins[_loc2_] = _loc1_.mins;
|
||||
_hours[_loc2_] = _loc1_.hours;
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
|
||||
private function rebuildList() : void
|
||||
{
|
||||
var _loc1_:int = 0;
|
||||
var _loc3_:int = 0;
|
||||
var _loc2_:Array = [];
|
||||
_partyMediaIds = [];
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _partyDefIds.length)
|
||||
{
|
||||
_loc1_ = int(_partyDefs[_partyDefIds[_loc3_]].titleStrId);
|
||||
if(!_loc2_[_loc1_])
|
||||
{
|
||||
_loc2_[_loc1_] = true;
|
||||
}
|
||||
_partyMediaIds[_loc3_] = int(_partyDefs[_partyDefIds[_loc3_]].mediaRefId);
|
||||
_loc3_++;
|
||||
}
|
||||
buildAJPartyWindows();
|
||||
}
|
||||
|
||||
private function getAJWindowPrintTime(param1:int) : String
|
||||
{
|
||||
return _secToStart[param1] > 0 ? calculatePrintTime(param1) : "";
|
||||
}
|
||||
|
||||
private function getCustomWindowPrintTime(param1:int) : String
|
||||
{
|
||||
return Utility.calculatePrintTimeForCustomParties(param1);
|
||||
}
|
||||
|
||||
private function addEventListeners() : void
|
||||
{
|
||||
_partyPopup.addEventListener("mouseDown",onPopup,false,0,true);
|
||||
_partyPopup.bx.addEventListener("mouseDown",onCloseBtn,false,0,true);
|
||||
_partyPopup.frameDrawerCont.ajhqPartyTab_btn.addEventListener("mouseDown",onOpenPartyTab,false,0,true);
|
||||
_partyPopup.frameDrawerCont.backTab_btn.addEventListener("mouseDown",onClosePartyTab,false,0,true);
|
||||
_partyPopup.throwParty_btn.addEventListener("mouseDown",onThrowPartyBtn,false,0,true);
|
||||
_partyPopup.goToParty_btn.addEventListener("mouseDown",onHostPartyBtn,false,0,true);
|
||||
}
|
||||
|
||||
private function removeEventListeners() : void
|
||||
{
|
||||
_partyPopup.removeEventListener("mouseDown",onPopup);
|
||||
_partyPopup.bx.removeEventListener("mouseDown",onCloseBtn);
|
||||
_partyPopup.frameDrawerCont.ajhqPartyTab_btn.removeEventListener("mouseDown",onOpenPartyTab);
|
||||
_partyPopup.frameDrawerCont.backTab_btn.removeEventListener("mouseDown",onClosePartyTab);
|
||||
_partyPopup.throwParty_btn.removeEventListener("mouseDown",onThrowPartyBtn);
|
||||
_partyPopup.goToParty_btn.removeEventListener("mouseDown",onHostPartyBtn);
|
||||
}
|
||||
|
||||
private function setupCreateJoinButtonText() : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc1_:UserInfo = gMainFrame.userInfo.playerUserInfo;
|
||||
if(_loc1_)
|
||||
{
|
||||
if(_loc1_.isStillHosting)
|
||||
{
|
||||
_partyPopup.goToParty_btn.visible = true;
|
||||
_partyPopup.throwParty_btn.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_partyPopup.goToParty_btn.visible = false;
|
||||
_partyPopup.throwParty_btn.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function OnAddionalAdventureScriptDefLoaded(param1:int, param2:Array, param3:Object) : void
|
||||
{
|
||||
_additionalScriptDefs = param2;
|
||||
partyListResponse(param3);
|
||||
}
|
||||
|
||||
private function onSinglePartyWindowLoaded(param1:ItemWindowParty, param2:int = -1) : void
|
||||
{
|
||||
var _loc3_:Object = null;
|
||||
if(param1 == _adventureHeaderWindow)
|
||||
{
|
||||
param1.setupTextAndAnims("");
|
||||
_partyPopup.itemWindowHeader.addChild(param1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(param1 == _ajItemWindowSingle)
|
||||
{
|
||||
_ajPartySingleLoadingSpiral.visible = false;
|
||||
(_ajItemWindowSingle.txt.timeTxt as TextField).gridFitType = "subpixel";
|
||||
(_ajItemWindowSingle.txt.titleTxtCont.titleTxt as TextField).gridFitType = "subpixel";
|
||||
_partyPopup.itemWindowAJ.addChild(param1);
|
||||
return;
|
||||
}
|
||||
_loc3_ = param1 == _additionalHeaderWindow1 ? _additionalHeaderData[0] : _additionalHeaderData[1];
|
||||
param1.defId = _loc3_.defId;
|
||||
param1.setupTextAndAnims(_loc3_.secToStart > 0 ? Utility.calculatePrintTime(_loc3_.headerTime.mins,_loc3_.headerTime.hours) : "");
|
||||
if(_loc3_.isParty)
|
||||
{
|
||||
param1.titleText = _partyDefs[_loc3_.defId].titleStrId;
|
||||
}
|
||||
if(param1 == _additionalHeaderWindow1)
|
||||
{
|
||||
_partyPopup.itemWindowHeader2.addChild(param1);
|
||||
}
|
||||
else if(param1 == _additionalHeaderWindow2)
|
||||
{
|
||||
_partyPopup.itemWindowHeader3.addChild(param1);
|
||||
}
|
||||
}
|
||||
if(_additionalHeaderData.length == 2)
|
||||
{
|
||||
if(_additionalHeaderWindow2.parent != null && _additionalHeaderWindow1.parent != null && _adventureHeaderWindow.parent != null)
|
||||
{
|
||||
_headersLoadingSpiral.visible = false;
|
||||
}
|
||||
}
|
||||
else if(_additionalHeaderWindow1 && _additionalHeaderWindow1.parent != null && _adventureHeaderWindow.parent != null)
|
||||
{
|
||||
_headersLoadingSpiral.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private function onAjPartiesLoaded() : void
|
||||
{
|
||||
_ajPartiesLoadingSpiral.visible = false;
|
||||
_partyPopup.frameDrawerCont.itemWindow.addChild(_ajItemWindows);
|
||||
_partiesListLoaded = true;
|
||||
}
|
||||
|
||||
private function onCustomPartiesLoaded() : void
|
||||
{
|
||||
_customPartiesLoadingSpiral.visible = false;
|
||||
_partyPopup.itemWindow.addChild(_customPartyItemWindows);
|
||||
}
|
||||
|
||||
private function onMinigameInfoResponse() : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
MinigameManager.handleGameClick({"typeDefId":102},null,true);
|
||||
}
|
||||
|
||||
private function onHeartbeat() : void
|
||||
{
|
||||
var _loc6_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
var _loc1_:ItemWindowParty = null;
|
||||
var _loc3_:int = 0;
|
||||
var _loc5_:int = 10;
|
||||
_numSecPassed += _loc5_;
|
||||
_loc6_ = 0;
|
||||
while(_loc6_ < _secToStart.length)
|
||||
{
|
||||
_loc4_ = int(_hours[_loc6_]);
|
||||
_loc2_ = int(_mins[_loc6_]);
|
||||
if(_loc4_ > 0 || _loc2_ > 0)
|
||||
{
|
||||
var _loc7_:* = _loc6_;
|
||||
var _loc8_:* = _secToStart[_loc7_] - _loc5_;
|
||||
_secToStart[_loc7_] = _loc8_;
|
||||
if(_secToStart[_loc6_] <= 0)
|
||||
{
|
||||
_loc4_ = 0;
|
||||
_loc2_ = 0;
|
||||
}
|
||||
else if(_numSecPassed == 60)
|
||||
{
|
||||
if(_loc4_ > 0 && _loc2_ == 0)
|
||||
{
|
||||
_loc4_--;
|
||||
}
|
||||
if(_loc2_ == 0)
|
||||
{
|
||||
_loc2_ = 59;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_--;
|
||||
}
|
||||
}
|
||||
_hours[_loc6_] = _loc4_;
|
||||
_mins[_loc6_] = _loc2_;
|
||||
if(_partiesListLoaded)
|
||||
{
|
||||
_loc1_ = ItemWindowParty(_ajItemWindows.mediaWindows[_loc6_]);
|
||||
_loc1_.setupTextAndAnims(_loc4_ > 0 || _loc2_ > 0 ? calculatePrintTime(_loc6_) : "");
|
||||
}
|
||||
if(_loc6_ == 0)
|
||||
{
|
||||
_ajItemWindowSingle.setupTextAndAnims(_loc4_ > 0 || _loc2_ > 0 ? calculatePrintTime(_loc6_) : "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc8_ = _loc6_;
|
||||
_loc7_ = _secToEnd[_loc8_] - _loc5_;
|
||||
_secToEnd[_loc8_] = _loc7_;
|
||||
if(_secToEnd[_loc6_] <= 0)
|
||||
{
|
||||
if(_partiesListLoaded)
|
||||
{
|
||||
_ajItemWindows.deleteItem(_loc6_,_partyDefIds);
|
||||
}
|
||||
else
|
||||
{
|
||||
_partyDefIds.splice(_loc6_,1);
|
||||
}
|
||||
_partyMediaIds.splice(_loc6_,1);
|
||||
_secToStart.splice(_loc6_,1);
|
||||
_secToEnd.splice(_loc6_,1);
|
||||
_hours.splice(_loc6_,1);
|
||||
_mins.splice(_loc6_,1);
|
||||
if(_loc6_ == 0)
|
||||
{
|
||||
_ajItemWindowSingle.destroy();
|
||||
_ajItemWindowSingle = new ItemWindowParty(onSinglePartyWindowLoaded,null,"",0,ajWinMouseDown,null,null,null,{
|
||||
"mediaRefId":_partyMediaIds,
|
||||
"printTimeFunc":getAJWindowPrintTime
|
||||
});
|
||||
}
|
||||
_loc6_--;
|
||||
}
|
||||
}
|
||||
_loc6_++;
|
||||
}
|
||||
if(_customPartyData)
|
||||
{
|
||||
_loc6_ = 0;
|
||||
while(_loc6_ < _customPartyData.length)
|
||||
{
|
||||
_customPartyData[_loc6_].timeLeft -= _loc5_;
|
||||
_loc3_ = int(_customPartyData[_loc6_].timeLeft);
|
||||
if(_loc3_ <= 0)
|
||||
{
|
||||
_customPartyItemWindows.deleteItem(_loc6_,_customPartyData);
|
||||
setupCreateJoinButtonText();
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc1_ = ItemWindowParty(_customPartyItemWindows.mediaWindows[_loc6_]);
|
||||
_loc1_.setupTextAndAnims(getCustomWindowPrintTime(_loc3_));
|
||||
}
|
||||
_loc6_++;
|
||||
}
|
||||
}
|
||||
if(_numSecPassed == 60)
|
||||
{
|
||||
_numSecPassed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private function onCustomPartyCreateClose(param1:Boolean = false) : void
|
||||
{
|
||||
if(_customPartyCreatePopup)
|
||||
{
|
||||
_customPartyCreatePopup.destroy(param1);
|
||||
_customPartyCreatePopup = null;
|
||||
}
|
||||
}
|
||||
|
||||
private function onPopup(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
}
|
||||
|
||||
private function onCloseBtn(param1:MouseEvent) : void
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
param1.stopPropagation();
|
||||
}
|
||||
if(_closeCallback != null)
|
||||
{
|
||||
_closeCallback();
|
||||
}
|
||||
else
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
||||
private function onOpenPartyTab(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
if(_tabTimeLine)
|
||||
{
|
||||
if(_tabTimeLine.reversed())
|
||||
{
|
||||
_tabTimeLine.reversed(false);
|
||||
_tabTimeLine.resume();
|
||||
}
|
||||
else
|
||||
{
|
||||
_tabTimeLine.reversed(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_tabTimeLine = new TimelineLite();
|
||||
_tabTimeLine.add(new TweenLite(_partyPopup.frameDrawerCont,1,{
|
||||
"x":"+=370",
|
||||
"ease":Expo.easeInOut
|
||||
}),0);
|
||||
_tabTimeLine.add(new TweenLite(_partyPopup,1,{
|
||||
"x":"-=170",
|
||||
"ease":Expo.easeInOut
|
||||
}),0);
|
||||
}
|
||||
if(_ajItemWindows == null)
|
||||
{
|
||||
buildAJPartyWindows();
|
||||
}
|
||||
}
|
||||
|
||||
private function onClosePartyTab(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
if(!_tabTimeLine.reversed())
|
||||
{
|
||||
_tabTimeLine.reverse();
|
||||
}
|
||||
}
|
||||
|
||||
private function onThrowPartyBtn(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
if(_customPartyCreatePopup)
|
||||
{
|
||||
_customPartyCreatePopup.destroy();
|
||||
}
|
||||
_customPartyCreatePopup = new CustomPartyCreatePopup(onCustomPartyCreateClose);
|
||||
}
|
||||
|
||||
private function onHostPartyBtn(param1:MouseEvent) : void
|
||||
{
|
||||
var _loc3_:String = null;
|
||||
var _loc2_:UserInfo = gMainFrame.userInfo.playerUserInfo;
|
||||
if(_loc2_)
|
||||
{
|
||||
if(_loc2_.isStillHosting)
|
||||
{
|
||||
_loc3_ = gMainFrame.server.getCurrentRoomName();
|
||||
if(_loc3_.indexOf("pparty") == -1 || _loc3_.indexOf(_loc2_.userName) == -1)
|
||||
{
|
||||
PartyManager.sendCustomPartyJoin(_loc2_.userName,_loc2_.uuid,null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function singleWinMouseDown(param1:MouseEvent) : void
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
param1.stopPropagation();
|
||||
if(param1.currentTarget == _adventureHeaderWindow)
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
if(AvatarManager.roomEnviroType == 1)
|
||||
{
|
||||
RoomXtCommManager.sendNonDenRoomJoinRequest("adventures.queststaging_0_461#" + RoomManagerWorld.instance.shardId);
|
||||
}
|
||||
else
|
||||
{
|
||||
RoomXtCommManager.sendNonDenRoomJoinRequest("adventures.queststaging_0_360#" + RoomManagerWorld.instance.shardId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = _additionalHeaderData[param1.currentTarget.additionalIndex];
|
||||
if(_loc2_)
|
||||
{
|
||||
if(_loc2_.isParty)
|
||||
{
|
||||
if(_loc2_.secToStart <= 0)
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
PartyXtCommManager.sendJoinPartyRequest(param1.currentTarget.defId);
|
||||
onCloseBtn(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdAndInsertOnly(14778,Utility.calculatePrintTime(_loc2_.headerTime.mins,_loc2_.headerTime.hours,true)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
QuestXtCommManager.sendQuestCreateJoinPublic(param1.currentTarget.defId);
|
||||
onCloseBtn(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function ajWinMouseDown(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
var _loc2_:int = int(param1.currentTarget.index);
|
||||
if(_secToStart[_loc2_] - _timeOffset <= 0)
|
||||
{
|
||||
if(_secToEnd[_loc2_] <= (getTimer() - _initialTime) / 1000)
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14777));
|
||||
if(_partiesListLoaded)
|
||||
{
|
||||
_ajItemWindows.deleteItem(_loc2_,_partyDefIds);
|
||||
}
|
||||
else
|
||||
{
|
||||
_partyDefIds.splice(_loc2_,1);
|
||||
}
|
||||
_partyMediaIds.splice(_loc2_,1);
|
||||
_secToStart.splice(_loc2_,1);
|
||||
_secToEnd.splice(_loc2_,1);
|
||||
_hours.splice(_loc2_,1);
|
||||
_mins.splice(_loc2_,1);
|
||||
if(_loc2_ == 0)
|
||||
{
|
||||
_ajItemWindowSingle.destroy();
|
||||
_ajItemWindowSingle = new ItemWindowParty(onSinglePartyWindowLoaded,null,"",0,ajWinMouseDown,null,null,null,{
|
||||
"mediaRefId":_partyMediaIds,
|
||||
"printTimeFunc":getAJWindowPrintTime
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
if(param1.currentTarget.isGame)
|
||||
{
|
||||
if(MinigameManager.minigameInfoCache.getMinigameInfo(102) == null)
|
||||
{
|
||||
MinigameXtCommManager.sendMinigameInfoRequest([102],false,onMinigameInfoResponse);
|
||||
}
|
||||
else
|
||||
{
|
||||
MinigameManager.handleGameClick({"typeDefId":102},null,true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PartyXtCommManager.sendJoinPartyRequest(param1.currentTarget.defId);
|
||||
}
|
||||
onCloseBtn(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdAndInsertOnly(14778,calculatePrintTime(_loc2_,true)));
|
||||
}
|
||||
}
|
||||
|
||||
private function customWinMouseDown(param1:MouseEvent) : void
|
||||
{
|
||||
var _loc3_:String = null;
|
||||
var _loc5_:Object = null;
|
||||
var _loc2_:UserInfo = null;
|
||||
param1.stopPropagation();
|
||||
var _loc4_:int = int(param1.currentTarget.index);
|
||||
if(param1.currentTarget.timeLeft <= 0)
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14777));
|
||||
if(_customPartyItemWindows)
|
||||
{
|
||||
_customPartyItemWindows.deleteItem(_loc4_,_customPartyData);
|
||||
}
|
||||
else
|
||||
{
|
||||
_customPartyData.splice(_loc4_,1);
|
||||
}
|
||||
setupCreateJoinButtonText();
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = gMainFrame.server.getCurrentRoomName();
|
||||
_loc5_ = _customPartyData[_loc4_];
|
||||
_loc2_ = gMainFrame.userInfo.playerUserInfo;
|
||||
if(_loc3_.indexOf("pparty") == -1 || _loc3_.indexOf(_loc2_.userName) == -1)
|
||||
{
|
||||
PartyManager.sendCustomPartyJoin("",_loc5_.creator,_loc5_.nodeId);
|
||||
}
|
||||
else if(_loc2_.uuid != _loc5_.creator)
|
||||
{
|
||||
PartyManager.sendCustomPartyJoin("",_loc5_.creator,_loc5_.nodeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
package Party
|
||||
{
|
||||
import com.sbi.client.SFEvent;
|
||||
import gui.DarkenManager;
|
||||
|
||||
public class PartyXtCommManager
|
||||
{
|
||||
|
||||
private static var _sphpUsername:String;
|
||||
|
||||
private static var _sphpCallback:Function;
|
||||
|
||||
private static var _spnCallback:Function;
|
||||
|
||||
private static var _spnUsername:String;
|
||||
|
||||
public function PartyXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
public static function destroy() : void
|
||||
{
|
||||
}
|
||||
|
||||
public static function sendJoinPartyRequest(param1:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("sj",[param1]);
|
||||
}
|
||||
|
||||
public static function sendPartyListRequest() : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("sl",[]);
|
||||
}
|
||||
|
||||
public static function sendCustomPartyListRequest(param1:int, param2:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("slp",[param1,param2]);
|
||||
}
|
||||
|
||||
public static function sendCustomPartyJoinRequest(param1:String) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
gMainFrame.server.setXtObject_Str("sjp",[param1]);
|
||||
}
|
||||
|
||||
public static function sendCustomPartyHostRequest(param1:int, param2:String) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
gMainFrame.server.setXtObject_Str("scp",[param1,param2]);
|
||||
}
|
||||
|
||||
public static function sendCustomPartyIsHosting(param1:String, param2:String, param3:Function) : void
|
||||
{
|
||||
_sphpUsername = param1;
|
||||
_sphpCallback = param3;
|
||||
gMainFrame.server.setXtObject_Str("sphp",[param2]);
|
||||
}
|
||||
|
||||
public static function sendCustomPartyNodeId(param1:String, param2:String, param3:Function) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
_spnUsername = param1;
|
||||
_spnCallback = param3;
|
||||
gMainFrame.server.setXtObject_Str("spn",[param2]);
|
||||
}
|
||||
|
||||
public static function handleXtReply(param1:SFEvent) : void
|
||||
{
|
||||
var _loc2_:Object = param1.obj;
|
||||
switch(_loc2_[0])
|
||||
{
|
||||
case "sl":
|
||||
PartyManager.partyListResponse(_loc2_);
|
||||
break;
|
||||
case "sj":
|
||||
PartyManager.roomSoireeResponse(_loc2_);
|
||||
break;
|
||||
case "slp":
|
||||
PartyManager.customPartyListResponse(_loc2_);
|
||||
break;
|
||||
case "scp":
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
PartyManager.customPartyCreateResponse(_loc2_);
|
||||
break;
|
||||
case "sphp":
|
||||
PartyManager.customPartyIsHostingResponse(_loc2_,_sphpUsername,_sphpCallback);
|
||||
_sphpCallback = null;
|
||||
_sphpUsername = "";
|
||||
break;
|
||||
case "sjp":
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
PartyManager.customPartyJoinResponse(_loc2_);
|
||||
break;
|
||||
case "spk":
|
||||
PartyManager.customPartyKillResponse(_loc2_);
|
||||
break;
|
||||
case "spn":
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
if(_spnCallback != null)
|
||||
{
|
||||
_spnCallback(_spnUsername,_loc2_);
|
||||
_spnCallback = null;
|
||||
_spnUsername = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
package
|
||||
{
|
||||
public class SbiConstants
|
||||
{
|
||||
|
||||
public static const ACCOUNT_TYPE_ARCHIVED:int = -2;
|
||||
|
||||
public static const ACCOUNT_TYPE_NEW:int = -1;
|
||||
|
||||
public static const ACCOUNT_TYPE_NONE:int = 0;
|
||||
|
||||
public static const NON_MEMBER:int = 1;
|
||||
|
||||
public static const PREMIUM_MEMBER:int = 2;
|
||||
|
||||
public static const BETA_MEMBER:int = 3;
|
||||
|
||||
public static const INTERNAL:int = 4;
|
||||
|
||||
public static const COMMUNITY:int = 5;
|
||||
|
||||
public static const INTERACTION_TYPE_BUDDY:int = 0;
|
||||
|
||||
public static const INTERACTION_TYPE_TRADE:int = 1;
|
||||
|
||||
public static const INTERACTION_TYPE_GIFT:int = 2;
|
||||
|
||||
public static const INTERACTION_TYPE_CHAT:int = 3;
|
||||
|
||||
public static const INTERACTION_TYPE_JAG:int = 4;
|
||||
|
||||
public static const INTERACTION_TYPE_MULTIPLAYER:int = 5;
|
||||
|
||||
public static const INTERACTION_TYPE_PVP:int = 6;
|
||||
|
||||
public static const INTERACTION_TYPE_QUEST:int = 7;
|
||||
|
||||
public static const ENVIRO_LAND:int = 0;
|
||||
|
||||
public static const ENVIRO_OCEAN:int = 1;
|
||||
|
||||
public static const ENVIRO_AIR:int = 2;
|
||||
|
||||
public static const ROOMTYPE_WORLD:int = 0;
|
||||
|
||||
public static const ROOMTYPE_GAME:int = 1;
|
||||
|
||||
public static const ROOMTYPE_DEN:int = 2;
|
||||
|
||||
public static const ROOMTYPE_LOBBY:int = 3;
|
||||
|
||||
public static const ROOMTYPE_FFM:int = 4;
|
||||
|
||||
public static const ROOMTYPE_PARTY:int = 5;
|
||||
|
||||
public static const ROOMTYPE_WORLDGAME:int = 6;
|
||||
|
||||
public static const ROOMTYPE_QUEST:int = 7;
|
||||
|
||||
public static const ROOMTYPE_QUEST_STAGING:int = 8;
|
||||
|
||||
public static const CHAT_TYPE_TYPED:int = 0;
|
||||
|
||||
public static const CHAT_TYPE_SAFE:int = 1;
|
||||
|
||||
public static const CHAT_TYPE_EMOTE:int = 2;
|
||||
|
||||
public static const CHAT_TYPE_ACTION:int = 3;
|
||||
|
||||
public static const CHAT_TYPE_ATTACHMENT:int = 4;
|
||||
|
||||
public static const CHAT_TYPE_PERM_EMOTE:int = 5;
|
||||
|
||||
public static const CHAT_TYPE_SLIDE:int = 6;
|
||||
|
||||
public static const CHAT_TYPE_PET_ACTION:int = 7;
|
||||
|
||||
public static const CHAT_TYPE_BLEND_COLOR:int = 8;
|
||||
|
||||
public static const CHAT_TYPE_LIMITED:int = 9;
|
||||
|
||||
public static const CHAT_TYPE_ALPHA_LEVEL:int = 10;
|
||||
|
||||
public static const CHAT_TYPE_CUST_ADVENTURE:int = 11;
|
||||
|
||||
public static const CHAT_TYPE_CUST_PVP:int = 12;
|
||||
|
||||
public static const PLAYER_WALL_LOCKED:int = 0;
|
||||
|
||||
public static const PLAYER_WALL_BUDDIES:int = 1;
|
||||
|
||||
public static const PLAYER_WALL_EVERYONE:int = 2;
|
||||
|
||||
public static const PLAYER_WALL_WEB_DISABLED:int = 0;
|
||||
|
||||
public static const PLAYER_WALL_WEB_ENABLED:int = 1;
|
||||
|
||||
public static const PLAYER_WALL_TOKEN_LOCKED_FAILURE:int = -1;
|
||||
|
||||
public static const PLAYER_WALL_TOKEN_BUDDIES_FAILURE:int = -2;
|
||||
|
||||
public static const PLAYER_WALL_FAILURE_TOKEN:String = "token";
|
||||
|
||||
public static const PLAYER_WALL_FAILURE_UNAVAILABLE:String = "unavailable";
|
||||
|
||||
public static const MAX_CONCURRENT_PLAYER_WALL_POSTS:int = 5;
|
||||
|
||||
public static const LAYER_BASE_ID:int = 1;
|
||||
|
||||
public static const LAYER_PATTERN_ID:int = 2;
|
||||
|
||||
public static const LAYER_EYE_ID:int = 3;
|
||||
|
||||
public static const GEM_CURRENCY:int = 0;
|
||||
|
||||
public static const TICKET_CURRENCY:int = 1;
|
||||
|
||||
public static const CRYSTAL_CURRENCY:int = 2;
|
||||
|
||||
public static const DIAMOND_CURRENCY:int = 3;
|
||||
|
||||
public static const STRAW_CURRENCY:int = 4;
|
||||
|
||||
public static const BAMBOO_CURRENCY:int = 5;
|
||||
|
||||
public static const WOOD_CURRENCY:int = 6;
|
||||
|
||||
public static const STONE_CURRENCY:int = 7;
|
||||
|
||||
public static const SILVER_CURRENCY:int = 8;
|
||||
|
||||
public static const GOLD_CURRENCY:int = 9;
|
||||
|
||||
public static const GEM_STONE_CURRENCY:int = 10;
|
||||
|
||||
public static const NUM_CURRENCY_TYPES:int = 11;
|
||||
|
||||
public static const COMBINED_CURRENCY:int = 100;
|
||||
|
||||
public static const TRADE_OFFER_MAX:int = 20;
|
||||
|
||||
public static const CURRENCY_NAMES:Vector.<String> = Vector.<String>(["gems","tickets","orbs","diamonds","straw","bamboo","wood","stone","silver","gold","gemstone"]);
|
||||
|
||||
public static const ACHIEVEMENT_TYPE_NAMES:Array = [23527,22833,22834,22835,22836,22825,22837,22826,22838,22854,22856,22839,22840,22859,22850,22841,22857,22842,22827,22851,22843,22852,22844,22853,22828,22855,22829,22845,22858,23528,22830,22846,22847,22831,22832,22848,22849];
|
||||
|
||||
public static const USERNAME_REGEX:RegExp = /^[a-zA-z0-9À-ÖØ-öø-ÿ][a-z0-9ß-öø-ÿ]+$/i;
|
||||
|
||||
public static const EMAIL_REGEX:RegExp = new RegExp(/^[\w%+\.-]+@(?:[a-zA-Z0-9-]+[\.{1}])+[a-zA-Z]{2,}$/i);
|
||||
|
||||
public function SbiConstants()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package
|
||||
{
|
||||
import flash.display.Bitmap;
|
||||
|
||||
[Embed(source="/_assets/6_Shadow_png.png")]
|
||||
public class Shadow_png extends Bitmap
|
||||
{
|
||||
|
||||
public function Shadow_png()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package
|
||||
{
|
||||
import flash.compiler.embed.EmbeddedMovieClip;
|
||||
|
||||
public class SpringFlower_3_swf$6de89290a5c709e78b2080105104cfc61916305515 extends EmbeddedMovieClip
|
||||
{
|
||||
|
||||
public function SpringFlower_3_swf$6de89290a5c709e78b2080105104cfc61916305515()
|
||||
{
|
||||
super(new SpringFlower_3_swf$6de89290a5c709e78b2080105104cfc61916305515ByteArray(),142,130);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
{
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
[Embed(source="/_assets/2_SpringFlower_3_swf$6de89290a5c709e78b2080105104cfc61916305515ByteArray.bin", mimeType="application/octet-stream")]
|
||||
public class SpringFlower_3_swf$6de89290a5c709e78b2080105104cfc61916305515ByteArray extends ByteArray
|
||||
{
|
||||
|
||||
public function SpringFlower_3_swf$6de89290a5c709e78b2080105104cfc61916305515ByteArray()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,44 @@
|
||||
package
|
||||
{
|
||||
import com.sbi.client.SFEvent;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import gui.GuiManager;
|
||||
|
||||
public class VersionXtCommManager
|
||||
{
|
||||
|
||||
public function VersionXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function handleXtReply(param1:SFEvent) : void
|
||||
{
|
||||
if(!param1.status)
|
||||
{
|
||||
DebugUtility.debugTrace("ERROR: VersionXtCommManager handleXtReply was called with bad evt.status:" + param1.status);
|
||||
return;
|
||||
}
|
||||
var _loc2_:Array = param1.obj;
|
||||
var _loc3_:* = _loc2_[0];
|
||||
if("v" !== _loc3_)
|
||||
{
|
||||
throw new Error("VersionXtCommManager illegal data:" + _loc2_[0]);
|
||||
}
|
||||
avatarVersionResponse(_loc2_);
|
||||
}
|
||||
|
||||
private static function avatarVersionResponse(param1:Array) : void
|
||||
{
|
||||
GuiManager.openVersionPopup(param1[2] == "1");
|
||||
}
|
||||
|
||||
private static function onConfirmDenyJumpVersions(param1:Object) : void
|
||||
{
|
||||
if(param1.status)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package
|
||||
{
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
[Embed(source="/_assets/7_WaterSplash_swf.bin", mimeType="application/octet-stream")]
|
||||
public class WaterSplash_swf extends ByteArray
|
||||
{
|
||||
|
||||
public function WaterSplash_swf()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package
|
||||
{
|
||||
import com.sbi.client.SFEvent;
|
||||
import flash.events.TimerEvent;
|
||||
import flash.utils.Timer;
|
||||
import flash.utils.getTimer;
|
||||
|
||||
public class XtReplyDemuxer
|
||||
{
|
||||
|
||||
private static var MSG_DELAY_MS:int = 0;
|
||||
|
||||
private static var _delayList:Array;
|
||||
|
||||
private static var _delayTimer:Timer;
|
||||
|
||||
private static var _xtReplyCallbacks:Array;
|
||||
|
||||
private static var _xtReplyCommands:Array;
|
||||
|
||||
public function XtReplyDemuxer()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init() : void
|
||||
{
|
||||
if(MSG_DELAY_MS > 0)
|
||||
{
|
||||
_delayList = [];
|
||||
_delayTimer = new Timer(10);
|
||||
_delayTimer.addEventListener("timer",delayTimerHandler,false,0,true);
|
||||
_delayTimer.start();
|
||||
}
|
||||
_xtReplyCallbacks = [];
|
||||
_xtReplyCommands = [];
|
||||
gMainFrame.server.addEventListener("OnXtReply",xtReplyHandler,false,0,true);
|
||||
}
|
||||
|
||||
public static function destroy() : void
|
||||
{
|
||||
_delayList = null;
|
||||
if(_delayTimer)
|
||||
{
|
||||
if(_delayTimer.running)
|
||||
{
|
||||
_delayTimer.stop();
|
||||
}
|
||||
_delayTimer = null;
|
||||
}
|
||||
_xtReplyCallbacks = null;
|
||||
_xtReplyCommands = null;
|
||||
gMainFrame.server.removeEventListener("OnXtReply",xtReplyHandler);
|
||||
}
|
||||
|
||||
public static function addModule(param1:Function, param2:String) : void
|
||||
{
|
||||
_xtReplyCallbacks.push(param1);
|
||||
_xtReplyCommands.push(param2);
|
||||
}
|
||||
|
||||
public static function removeModule(param1:Function) : void
|
||||
{
|
||||
var _loc2_:int = _xtReplyCallbacks.indexOf(param1);
|
||||
if(_loc2_ >= 0)
|
||||
{
|
||||
_xtReplyCallbacks.splice(_loc2_,1);
|
||||
_xtReplyCommands.splice(_loc2_,1);
|
||||
return;
|
||||
}
|
||||
throw new Error("module not found! callback:" + param1);
|
||||
}
|
||||
|
||||
public static function xtReplyHandler(param1:SFEvent) : void
|
||||
{
|
||||
if(_xtReplyCallbacks[_xtReplyCommands.indexOf(param1.obj[0].charAt(0))] == undefined)
|
||||
{
|
||||
throw new Error("ERROR: undefined module command:" + param1.obj[0]);
|
||||
}
|
||||
var _loc2_:Function = _xtReplyCallbacks[_xtReplyCommands.indexOf(param1.obj[0].charAt(0))];
|
||||
if(MSG_DELAY_MS == 0)
|
||||
{
|
||||
_loc2_(param1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_delayList.push({
|
||||
"f":_loc2_,
|
||||
"e":param1,
|
||||
"ts":getTimer() + MSG_DELAY_MS
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static function delayTimerHandler(param1:TimerEvent) : void
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
var _loc4_:int = 0;
|
||||
var _loc3_:uint = uint(getTimer());
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _delayList.length)
|
||||
{
|
||||
_loc2_ = _delayList[_loc4_];
|
||||
if(_loc2_.ts >= _loc3_)
|
||||
{
|
||||
break;
|
||||
}
|
||||
_loc2_.f(_loc2_.e);
|
||||
_delayList.splice(0,1);
|
||||
_loc4_--;
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,278 @@
|
||||
package achievement
|
||||
{
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import loader.MediaHelper;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class Achievement
|
||||
{
|
||||
|
||||
public static var GEMS_EARNED:int = 1;
|
||||
|
||||
public static var GEMS_SPENT:int = 2;
|
||||
|
||||
public static var SHOP_DEN_ITEM:int = 3;
|
||||
|
||||
public static var SHOP_ACCESSORY:int = 4;
|
||||
|
||||
public static var MAIL_SEND:int = 38;
|
||||
|
||||
public static var MAIL_GIFT:int = 39;
|
||||
|
||||
public static var BUDDY_ADDED:int = 40;
|
||||
|
||||
public static var MEMBER_NEW:int = 66;
|
||||
|
||||
public static var HOLIDAY_BANNER:int = 409;
|
||||
|
||||
public static var BASE_MEDAL_ID:int = 289;
|
||||
|
||||
public static var BASE_RIBBON_ID:int = 290;
|
||||
|
||||
public static var BASE_TROPHY_ID:int = 291;
|
||||
|
||||
private var _invId:int;
|
||||
|
||||
private var _baseImageMediaId:int;
|
||||
|
||||
private var _iconMediaId:int;
|
||||
|
||||
private var _name:String;
|
||||
|
||||
private var _descr:String;
|
||||
|
||||
private var _mediaText:String;
|
||||
|
||||
private var _nameId:int;
|
||||
|
||||
private var _descId:int;
|
||||
|
||||
private var _type:int;
|
||||
|
||||
private var _defId:int;
|
||||
|
||||
private var _userVarId:int;
|
||||
|
||||
private var _baseImage:Sprite;
|
||||
|
||||
private var _baseImageHelper:MediaHelper;
|
||||
|
||||
private var _icon:Sprite;
|
||||
|
||||
private var _iconHelper:MediaHelper;
|
||||
|
||||
private var _baseImageReceived:Boolean;
|
||||
|
||||
private var _iconReceived:Boolean;
|
||||
|
||||
private var _shouldUseFullScale:Boolean;
|
||||
|
||||
private var _scalePercent:Number = 1;
|
||||
|
||||
private var _xPos:Number = 0;
|
||||
|
||||
private var _yPos:Number = 0;
|
||||
|
||||
public function Achievement()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:int, param2:int, param3:Boolean = false) : void
|
||||
{
|
||||
var _loc4_:Array = null;
|
||||
_invId = param1;
|
||||
_defId = param2;
|
||||
var _loc5_:Object = AchievementManager.getAchievementDef(_defId);
|
||||
if(_loc5_)
|
||||
{
|
||||
_userVarId = _loc5_.userVarRef;
|
||||
_baseImageMediaId = _loc5_.baseMediaRef;
|
||||
_iconMediaId = _loc5_.iconMediaRef;
|
||||
_nameId = _loc5_.titleStrRef;
|
||||
_name = LocalizationManager.translateIdOnly(_nameId);
|
||||
_mediaText = _loc5_.extraText;
|
||||
if(_mediaText != "")
|
||||
{
|
||||
_loc4_ = _mediaText.split(",");
|
||||
if(_loc4_.length > 1)
|
||||
{
|
||||
_mediaText = Utility.convertNumberToString(int(_loc4_.join("")));
|
||||
}
|
||||
}
|
||||
_descId = _loc5_.descStrRef;
|
||||
_descr = LocalizationManager.translateIdOnly(_descId);
|
||||
_type = _loc5_.type;
|
||||
_shouldUseFullScale = param3;
|
||||
_baseImage = new Sprite();
|
||||
_baseImageHelper = new MediaHelper();
|
||||
_baseImageHelper.init(_baseImageMediaId,baseImageReceived);
|
||||
_icon = new Sprite();
|
||||
_iconHelper = new MediaHelper();
|
||||
_iconHelper.init(_iconMediaId,iconReceived);
|
||||
return;
|
||||
}
|
||||
throw new Error("Could not find achievement def");
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
if(_iconHelper)
|
||||
{
|
||||
_iconHelper.destroy();
|
||||
}
|
||||
if(_baseImageHelper)
|
||||
{
|
||||
_baseImageHelper.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
public function clone() : Achievement
|
||||
{
|
||||
var _loc1_:Achievement = null;
|
||||
_loc1_ = new Achievement();
|
||||
_loc1_.init(_invId,_defId,_shouldUseFullScale);
|
||||
return _loc1_;
|
||||
}
|
||||
|
||||
public function setScale(param1:Number) : void
|
||||
{
|
||||
_scalePercent = param1;
|
||||
if(_iconReceived && _baseImageReceived)
|
||||
{
|
||||
_baseImage.scaleX = _scalePercent;
|
||||
_baseImage.scaleY = _scalePercent;
|
||||
}
|
||||
}
|
||||
|
||||
public function setPosition(param1:Number, param2:Number) : void
|
||||
{
|
||||
_xPos = param1;
|
||||
_yPos = param2;
|
||||
if(_iconReceived && _baseImageReceived)
|
||||
{
|
||||
_baseImage.x = -_baseImage.width * _xPos;
|
||||
_baseImage.y = -_baseImage.height * _yPos;
|
||||
}
|
||||
}
|
||||
|
||||
private function baseImageReceived(param1:MovieClip) : void
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
if(param1)
|
||||
{
|
||||
param1 = MovieClip(param1.getChildAt(0));
|
||||
_baseImage.addChild(param1);
|
||||
if(_iconReceived)
|
||||
{
|
||||
param1.itemBlock.addChild(_icon);
|
||||
allImagesLoaded();
|
||||
}
|
||||
if(_mediaText == "")
|
||||
{
|
||||
param1.num.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
param1.num.txt.text = _mediaText;
|
||||
_loc2_ = Number(param1.num.txt.textWidth);
|
||||
if(_loc2_ > 15)
|
||||
{
|
||||
if(_loc2_ > 25)
|
||||
{
|
||||
param1.num.gotoAndStop(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
param1.num.gotoAndStop(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
_baseImageHelper.destroy();
|
||||
_baseImageHelper = null;
|
||||
_baseImageReceived = true;
|
||||
}
|
||||
}
|
||||
|
||||
private function iconReceived(param1:MovieClip) : void
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
_icon.addChild(param1);
|
||||
if(_baseImageReceived)
|
||||
{
|
||||
MovieClip(_baseImage.getChildAt(0)).itemBlock.addChild(_icon);
|
||||
allImagesLoaded();
|
||||
}
|
||||
_iconHelper.destroy();
|
||||
_iconHelper = null;
|
||||
_iconReceived = true;
|
||||
}
|
||||
}
|
||||
|
||||
private function allImagesLoaded() : void
|
||||
{
|
||||
var _loc1_:Number = 0.9;
|
||||
if(_shouldUseFullScale)
|
||||
{
|
||||
_loc1_ = 1;
|
||||
}
|
||||
_baseImage.scaleX = _loc1_ * _scalePercent;
|
||||
_baseImage.scaleY = _loc1_ * _scalePercent;
|
||||
_baseImage.x = -_baseImage.width * _xPos;
|
||||
_baseImage.y = -_baseImage.height * _yPos;
|
||||
}
|
||||
|
||||
public function get invId() : int
|
||||
{
|
||||
return _invId;
|
||||
}
|
||||
|
||||
public function get baseImageMediaId() : int
|
||||
{
|
||||
return _baseImageMediaId;
|
||||
}
|
||||
|
||||
public function get iconMediaId() : int
|
||||
{
|
||||
return _iconMediaId;
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
public function get descr() : String
|
||||
{
|
||||
return _descr;
|
||||
}
|
||||
|
||||
public function get mediaText() : String
|
||||
{
|
||||
return _mediaText;
|
||||
}
|
||||
|
||||
public function get image() : Sprite
|
||||
{
|
||||
return _baseImage;
|
||||
}
|
||||
|
||||
public function get type() : int
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
|
||||
public function get defId() : int
|
||||
{
|
||||
return _defId;
|
||||
}
|
||||
|
||||
public function get userVarId() : int
|
||||
{
|
||||
return _userVarId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
package achievement
|
||||
{
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.events.TimerEvent;
|
||||
import flash.utils.Timer;
|
||||
import loader.MediaHelper;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class AchievementManager
|
||||
{
|
||||
|
||||
private static const ACHIEVEMENT_POPUP_MEDIA_ID:int = 2721;
|
||||
|
||||
private static const STATE_IDLE:int = 0;
|
||||
|
||||
private static const STATE_DISPLAYING:int = 1;
|
||||
|
||||
private static var _newAchievements:Array;
|
||||
|
||||
private static var _finishedCallbacks:Array;
|
||||
|
||||
private static var _achievementDefs:Object;
|
||||
|
||||
private static var _achievementDefsIndexed:Object;
|
||||
|
||||
private static var _sortedTypeNames:Array;
|
||||
|
||||
private static var _allAchievements:Object;
|
||||
|
||||
private static var _allAchievementsIndexed:Object;
|
||||
|
||||
private static var _popupMediaHelper:MediaHelper;
|
||||
|
||||
private static var _achievementPopup:MovieClip;
|
||||
|
||||
private static var _achievementImg:Sprite;
|
||||
|
||||
private static var _popupDisplayTimer:Timer;
|
||||
|
||||
private static var _popupDelayTimer:Timer;
|
||||
|
||||
private static var _state:int;
|
||||
|
||||
private static var _fpsLayer:DisplayObjectContainer;
|
||||
|
||||
public function AchievementManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init(param1:DisplayObjectContainer) : void
|
||||
{
|
||||
_fpsLayer = param1;
|
||||
_finishedCallbacks = [];
|
||||
_newAchievements = [];
|
||||
_popupDisplayTimer = new Timer(3000);
|
||||
_popupDelayTimer = new Timer(500);
|
||||
_state = 0;
|
||||
}
|
||||
|
||||
public static function destroy() : void
|
||||
{
|
||||
_newAchievements.splice(0,_newAchievements.length);
|
||||
_newAchievements = null;
|
||||
_finishedCallbacks.splice(0,_finishedCallbacks.length);
|
||||
_finishedCallbacks = null;
|
||||
if(_popupDisplayTimer)
|
||||
{
|
||||
_popupDisplayTimer.stop();
|
||||
_popupDisplayTimer = null;
|
||||
}
|
||||
if(_popupDelayTimer)
|
||||
{
|
||||
_popupDelayTimer.stop();
|
||||
_popupDelayTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static function hasAchievement() : Boolean
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function displayNewAchievements(param1:Function = null) : void
|
||||
{
|
||||
if(param1 != null)
|
||||
{
|
||||
if(_finishedCallbacks.indexOf(param1) < 0 && _newAchievements.length > 0)
|
||||
{
|
||||
_finishedCallbacks.push(param1);
|
||||
}
|
||||
else
|
||||
{
|
||||
param1();
|
||||
}
|
||||
}
|
||||
if(_state == 0 && _newAchievements.length > 0)
|
||||
{
|
||||
_state = 1;
|
||||
displayNextAchievement();
|
||||
}
|
||||
}
|
||||
|
||||
public static function set achievementDefs(param1:Object) : void
|
||||
{
|
||||
_achievementDefs = param1;
|
||||
}
|
||||
|
||||
public static function set achievementDefsIndexed(param1:Object) : void
|
||||
{
|
||||
_achievementDefsIndexed = param1;
|
||||
for each(var _loc2_:Array in _achievementDefsIndexed)
|
||||
{
|
||||
_loc2_.sortOn(["sortIndex"],16);
|
||||
}
|
||||
}
|
||||
|
||||
public static function get achievementDefs() : Object
|
||||
{
|
||||
return _achievementDefs;
|
||||
}
|
||||
|
||||
public static function get achievementDefsIndexed() : Object
|
||||
{
|
||||
return _achievementDefsIndexed;
|
||||
}
|
||||
|
||||
public static function getAchievementDef(param1:int) : Object
|
||||
{
|
||||
return _achievementDefs[param1];
|
||||
}
|
||||
|
||||
public static function getAchievementDefsByType(param1:int) : Object
|
||||
{
|
||||
return _achievementDefsIndexed[param1];
|
||||
}
|
||||
|
||||
public static function get typeNamesTranslatedAndSorted() : Array
|
||||
{
|
||||
var _loc1_:Array = null;
|
||||
var _loc2_:int = 0;
|
||||
if(_sortedTypeNames == null)
|
||||
{
|
||||
_sortedTypeNames = [];
|
||||
_loc1_ = SbiConstants.ACHIEVEMENT_TYPE_NAMES;
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _loc1_.length)
|
||||
{
|
||||
_sortedTypeNames.push({
|
||||
"typeIndex":_loc2_,
|
||||
"name":LocalizationManager.translateIdOnly(_loc1_[_loc2_])
|
||||
});
|
||||
_loc2_++;
|
||||
}
|
||||
_sortedTypeNames.sortOn(["name"],[2,1]);
|
||||
}
|
||||
return _sortedTypeNames;
|
||||
}
|
||||
|
||||
public static function getAllAchievements() : Object
|
||||
{
|
||||
var _loc2_:Achievement = null;
|
||||
if(_allAchievements == null)
|
||||
{
|
||||
_allAchievements = [];
|
||||
for each(var _loc1_:Object in _achievementDefs)
|
||||
{
|
||||
_loc2_ = new Achievement();
|
||||
_allAchievements.push(_loc2_.init(0,_loc1_.defId,true));
|
||||
}
|
||||
}
|
||||
return _allAchievements;
|
||||
}
|
||||
|
||||
public static function getAllAchievementsIndexed() : Object
|
||||
{
|
||||
var _loc5_:Achievement = null;
|
||||
var _loc3_:Object = null;
|
||||
var _loc1_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
if(_allAchievementsIndexed == null)
|
||||
{
|
||||
_allAchievementsIndexed = [];
|
||||
for each(var _loc2_:Array in _achievementDefsIndexed)
|
||||
{
|
||||
_allAchievementsIndexed.push([]);
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _loc2_.length)
|
||||
{
|
||||
_loc3_ = _loc2_[_loc4_];
|
||||
if(_loc3_.iconMediaRef != 0 && _loc3_.descStrRef != 0 && _loc3_.descStrRef != 15476)
|
||||
{
|
||||
_loc5_ = new Achievement();
|
||||
_loc5_.init(0,_loc3_.id,true);
|
||||
_allAchievementsIndexed[_loc1_].push(_loc5_);
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
_loc1_++;
|
||||
}
|
||||
}
|
||||
return _allAchievementsIndexed;
|
||||
}
|
||||
|
||||
private static function finishedDisplayingNewAchievements() : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc1_:int = int(_finishedCallbacks.length);
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _loc1_)
|
||||
{
|
||||
_finishedCallbacks[_loc2_]();
|
||||
_loc2_++;
|
||||
}
|
||||
_finishedCallbacks.splice(0,_finishedCallbacks.length);
|
||||
}
|
||||
|
||||
private static function displayNextAchievement() : void
|
||||
{
|
||||
var _loc1_:Achievement = _newAchievements[0];
|
||||
_achievementImg = _loc1_.image;
|
||||
_loc1_.setScale(2);
|
||||
_loc1_.setPosition(0.5,0.5);
|
||||
if(_achievementPopup)
|
||||
{
|
||||
_achievementPopup.achievementWindow.itemBlock.addChild(_achievementImg);
|
||||
LocalizationManager.updateToFit(_achievementPopup.achievementWindow.acmtNameTxt,_loc1_.name,false,false,false);
|
||||
_fpsLayer.addChild(_achievementPopup);
|
||||
_achievementPopup.gotoAndPlay(1);
|
||||
_achievementPopup.achievementWindow.gotoAndPlay(1);
|
||||
AJAudio.playAchievementSound();
|
||||
_popupDisplayTimer.start();
|
||||
_popupDisplayTimer.addEventListener("timer",onDisplayTimerFinished,false,0,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_popupMediaHelper = new MediaHelper();
|
||||
_popupMediaHelper.init(2721,popupHelperCallback);
|
||||
}
|
||||
}
|
||||
|
||||
private static function onDisplayTimerFinished(param1:TimerEvent) : void
|
||||
{
|
||||
_popupDisplayTimer.stop();
|
||||
_fpsLayer.removeChild(_achievementPopup);
|
||||
_achievementPopup.achievementWindow.itemBlock.removeChild(_achievementImg);
|
||||
_newAchievements.splice(0,1);
|
||||
if(_newAchievements.length > 0)
|
||||
{
|
||||
_popupDelayTimer.start();
|
||||
_popupDelayTimer.addEventListener("timer",onDelayTimerFinished,false,0,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_state = 0;
|
||||
finishedDisplayingNewAchievements();
|
||||
}
|
||||
}
|
||||
|
||||
private static function onDelayTimerFinished(param1:TimerEvent) : void
|
||||
{
|
||||
_popupDelayTimer.stop();
|
||||
displayNextAchievement();
|
||||
}
|
||||
|
||||
private static function popupHelperCallback(param1:MovieClip) : void
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
_achievementPopup = new MovieClip();
|
||||
_achievementPopup = param1;
|
||||
_achievementPopup.visible = true;
|
||||
_achievementPopup.addEventListener("mouseDown",onPopupDown,false,0,true);
|
||||
_popupMediaHelper.destroy();
|
||||
_popupMediaHelper = null;
|
||||
displayNextAchievement();
|
||||
}
|
||||
}
|
||||
|
||||
private static function onPopupDown(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
}
|
||||
|
||||
public static function addAchievement(param1:Achievement) : void
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
_newAchievements.push(param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,332 @@
|
||||
package achievement
|
||||
{
|
||||
import avatar.AvatarManager;
|
||||
import avatar.UserInfo;
|
||||
import com.sbi.client.SFEvent;
|
||||
import gui.MySettings;
|
||||
import loader.DefPacksDefHelper;
|
||||
|
||||
public class AchievementXtCommManager
|
||||
{
|
||||
|
||||
public static const UV_JAMAA_JOURNAL_TIMESTAMP:int = 112;
|
||||
|
||||
public static const UV_JAMAA_JOURNAL_TIMESTAMP_STARTUP:int = 158;
|
||||
|
||||
public static const UV_BRADY_BARR_COUNT:int = 128;
|
||||
|
||||
public static const UV_TRADING:int = 129;
|
||||
|
||||
public static const UV_PET_COUNTER:int = 212;
|
||||
|
||||
public static const UV_DAILY_GEM_BONUS:int = 214;
|
||||
|
||||
public static const UV_AVT_VIEWABLE_FLAG:int = 287;
|
||||
|
||||
public static const UV_TIERNEY_THYS_COUNT:int = 297;
|
||||
|
||||
public static const UV_PLAYER_WALL_COUNT:int = 414;
|
||||
|
||||
public static const UV_PET_INVENTORY_MAX:int = 338;
|
||||
|
||||
public static const UV_PET_VIEWABLE_FLAG:int = 342;
|
||||
|
||||
public static const UV_SETTINGS:int = 363;
|
||||
|
||||
public static const UV_PARTY_JB_ENTER:int = 366;
|
||||
|
||||
public static const UV_TUTORIALS:int = 379;
|
||||
|
||||
public static const UV_CUSTOM_AVT_VIEWABLE_FLAG:int = 410;
|
||||
|
||||
public static const UV_COLOR_ME_RAD:int = 146;
|
||||
|
||||
public static const UV_WALL_FLOORING_FIRST_BUY:int = 420;
|
||||
|
||||
public static const UV_DEN_ITEM_BUY_COUNT:int = 3;
|
||||
|
||||
public static const ACHIEVEMENT_REQUEST_INTERVAL:int = 10000;
|
||||
|
||||
private static var _zaCallback:Function;
|
||||
|
||||
private static var _inMinigame:Function;
|
||||
|
||||
private static var _onUserVarsReceived:Function;
|
||||
|
||||
private static var _setGemBonusValues:Function;
|
||||
|
||||
private static var _bMyUserVarsReceived:Boolean;
|
||||
|
||||
private static var _zsCallbacks:Object;
|
||||
|
||||
private static var _achievementRequestUsername:String;
|
||||
|
||||
public static const UV_PARTY_JB_ENTER_BIT_ARRAY:Array = [27];
|
||||
|
||||
public function AchievementXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init(param1:Function, param2:Function, param3:Function) : void
|
||||
{
|
||||
_inMinigame = param1;
|
||||
_onUserVarsReceived = param2;
|
||||
_setGemBonusValues = param3;
|
||||
_zsCallbacks = {};
|
||||
}
|
||||
|
||||
public static function destroy() : void
|
||||
{
|
||||
_zsCallbacks = null;
|
||||
}
|
||||
|
||||
public static function requestAchievements(param1:String, param2:Function = null) : void
|
||||
{
|
||||
var _loc3_:Number = NaN;
|
||||
var _loc5_:Number = NaN;
|
||||
var _loc4_:UserInfo = gMainFrame.userInfo.getUserInfoByUserName(param1);
|
||||
if(_loc4_)
|
||||
{
|
||||
_loc3_ = _loc4_.getTimeOfLastAchievementRequest();
|
||||
_loc5_ = new Date().getTime();
|
||||
if(_loc5_ - _loc3_ > 10000)
|
||||
{
|
||||
_zaCallback = param2;
|
||||
_loc4_.setTimeOfLastAchievementRequest(_loc5_);
|
||||
if(_loc3_ == 0)
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("za",[param1,-1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("za",[param1,int((_loc5_ - _loc3_) / 1000)]);
|
||||
}
|
||||
}
|
||||
else if(param2 != null)
|
||||
{
|
||||
param2(_loc4_.achievements,_loc4_.achievementsIndexed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function requestSetUserVar(param1:int, param2:int, param3:Function = null, param4:Boolean = true) : void
|
||||
{
|
||||
if(!gMainFrame.clientInfo.invisMode)
|
||||
{
|
||||
if(param1 <= 0)
|
||||
{
|
||||
trace("ERROR: Illegal userVarId=" + param1);
|
||||
return;
|
||||
}
|
||||
if(param3 != null)
|
||||
{
|
||||
_zsCallbacks[param1] = {
|
||||
"uv":param1,
|
||||
"c":param3
|
||||
};
|
||||
}
|
||||
gMainFrame.server.setXtObject_Str("zs",[param1,param2,param4 ? 1 : 0]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function requestAllUserVars() : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("zg",[]);
|
||||
}
|
||||
|
||||
public static function requestDeleteAllAchievementsAndUserVars() : void
|
||||
{
|
||||
}
|
||||
|
||||
public static function handleXtReply(param1:SFEvent) : void
|
||||
{
|
||||
var _loc2_:Object = param1.obj;
|
||||
switch(_loc2_[0])
|
||||
{
|
||||
case "za":
|
||||
getAchievementsResponse(_loc2_);
|
||||
break;
|
||||
case "zs":
|
||||
setUserVarResponse(_loc2_);
|
||||
break;
|
||||
case "zg":
|
||||
getUserVarsResponse(_loc2_);
|
||||
break;
|
||||
default:
|
||||
throw new Error("Did not expect ext cmd=" + _loc2_[0]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function onAchievementDefPacksResponse(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
DefPacksDefHelper.mediaArray[1042] = null;
|
||||
var _loc3_:Object = param1.def;
|
||||
var _loc6_:Object = {};
|
||||
var _loc5_:Object = {};
|
||||
for each(var _loc4_:Object in _loc3_)
|
||||
{
|
||||
_loc6_[int(_loc4_.id)] = {
|
||||
"id":int(_loc4_.id),
|
||||
"baseMediaRef":int(_loc4_.baseMediaRef),
|
||||
"descStrRef":int(_loc4_.descStrRef),
|
||||
"extraText":_loc4_.extraText,
|
||||
"iconMediaRef":int(_loc4_.iconMediaRef),
|
||||
"titleStrRef":int(_loc4_.titleStrRef),
|
||||
"type":int(_loc4_.type),
|
||||
"triggeredAmount":int(_loc4_.triggerAmount),
|
||||
"userVarRef":int(_loc4_.userVarRef),
|
||||
"sortIndex":int(_loc4_.name.split("_")[0])
|
||||
};
|
||||
if(_loc5_[int(_loc4_.type)])
|
||||
{
|
||||
_loc5_[int(_loc4_.type)].push(_loc6_[int(_loc4_.id)]);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_[int(_loc4_.type)] = [_loc6_[int(_loc4_.id)]];
|
||||
}
|
||||
}
|
||||
AchievementManager.achievementDefs = _loc6_;
|
||||
AchievementManager.achievementDefsIndexed = _loc5_;
|
||||
}
|
||||
|
||||
private static function setUserVarResponse(param1:Object) : void
|
||||
{
|
||||
var _loc11_:int = 0;
|
||||
var _loc12_:int = 0;
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc2_:Boolean = false;
|
||||
var _loc7_:Array = null;
|
||||
var _loc5_:Achievement = null;
|
||||
var _loc4_:* = null;
|
||||
var _loc9_:int = 2;
|
||||
var _loc3_:int = 1;
|
||||
_loc12_ = 0;
|
||||
while(_loc12_ < _loc3_)
|
||||
{
|
||||
_loc11_ = int(param1[_loc9_++]);
|
||||
_loc8_ = Number(param1[_loc9_++]);
|
||||
gMainFrame.userInfo.userVarCache.updateUserVar(_loc11_,_loc8_);
|
||||
if(_loc11_ == 214)
|
||||
{
|
||||
_setGemBonusValues(_loc8_);
|
||||
}
|
||||
if(_loc11_ == 363 && (_loc8_ == 1 << MySettings.SETTINGS_USERNAME_BADGE || _loc8_ == 0))
|
||||
{
|
||||
AvatarManager.updateAvatarNameBarNames();
|
||||
}
|
||||
_loc12_++;
|
||||
}
|
||||
var _loc6_:int = int(param1[_loc9_++]);
|
||||
if(_loc6_ > 0)
|
||||
{
|
||||
_loc7_ = [];
|
||||
if(!gMainFrame.userInfo.playerUserInfo.achievements)
|
||||
{
|
||||
_loc2_ = true;
|
||||
}
|
||||
_loc12_ = _loc6_ - 1;
|
||||
while(_loc12_ >= 0)
|
||||
{
|
||||
_loc5_ = new Achievement();
|
||||
_loc5_.init(int(param1[_loc9_++]),int(param1[_loc9_++]),true);
|
||||
_loc7_[_loc12_] = _loc5_;
|
||||
AchievementManager.addAchievement(_loc5_.clone());
|
||||
_loc12_--;
|
||||
}
|
||||
}
|
||||
if(_loc2_)
|
||||
{
|
||||
requestAchievements(gMainFrame.userInfo.playerUserInfo.userName);
|
||||
}
|
||||
else if(_loc7_)
|
||||
{
|
||||
gMainFrame.userInfo.playerUserInfo.addAchievementsTolist(_loc7_);
|
||||
}
|
||||
if(!_inMinigame())
|
||||
{
|
||||
AchievementManager.displayNewAchievements();
|
||||
}
|
||||
var _loc10_:Object = _zsCallbacks[_loc11_];
|
||||
if(_loc10_)
|
||||
{
|
||||
_loc10_.c(_loc11_,_loc8_);
|
||||
}
|
||||
}
|
||||
|
||||
private static function getUserVarsResponse(param1:Object) : void
|
||||
{
|
||||
var _loc5_:int = 0;
|
||||
var _loc4_:int = 2;
|
||||
var _loc2_:int = int(param1[_loc4_++]);
|
||||
var _loc3_:Object = {};
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < _loc2_)
|
||||
{
|
||||
_loc3_[int(param1[_loc4_++])] = {
|
||||
"type":int(param1[_loc4_++]),
|
||||
"value":Number(param1[_loc4_++])
|
||||
};
|
||||
_loc5_++;
|
||||
}
|
||||
gMainFrame.userInfo.userVarCache.playerUserVars = _loc3_;
|
||||
if(!_bMyUserVarsReceived)
|
||||
{
|
||||
_onUserVarsReceived();
|
||||
}
|
||||
}
|
||||
|
||||
private static function getAchievementsResponse(param1:Object) : void
|
||||
{
|
||||
var _loc4_:Array = null;
|
||||
var _loc7_:int = 0;
|
||||
var _loc3_:Achievement = null;
|
||||
var _loc6_:int = 2;
|
||||
var _loc5_:String = param1[_loc6_++];
|
||||
var _loc8_:int = int(param1[_loc6_++]);
|
||||
var _loc2_:UserInfo = gMainFrame.userInfo.getUserInfoByUserName(_loc5_);
|
||||
if(_loc8_ > 0)
|
||||
{
|
||||
_loc4_ = new Array(_loc8_);
|
||||
_loc7_ = 0;
|
||||
while(_loc7_ < _loc8_)
|
||||
{
|
||||
_loc3_ = new Achievement();
|
||||
_loc3_.init(int(param1[_loc6_++]),int(param1[_loc6_++]),_loc5_.toLowerCase() == gMainFrame.userInfo.playerUserInfo.userName.toLowerCase());
|
||||
_loc4_[_loc7_] = _loc3_;
|
||||
_loc7_++;
|
||||
}
|
||||
_loc4_.sortOn("invId",0x10 | 2);
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc2_.addAchievementsTolist(_loc4_);
|
||||
}
|
||||
}
|
||||
if(_zaCallback != null)
|
||||
{
|
||||
if(_loc5_.toLowerCase() == gMainFrame.userInfo.myUserName.toLowerCase())
|
||||
{
|
||||
if(_loc2_)
|
||||
{
|
||||
_zaCallback(_loc2_.achievements,_loc2_.achievementsIndexed);
|
||||
}
|
||||
else
|
||||
{
|
||||
_zaCallback(null,null);
|
||||
}
|
||||
}
|
||||
else if(_loc2_)
|
||||
{
|
||||
_zaCallback(_loc2_.achievements,_loc2_.achievementsIndexed,_loc8_ == -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_zaCallback(null,null,_loc8_ == -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,447 @@
|
||||
package avatar
|
||||
{
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import item.Item;
|
||||
|
||||
public class AccessoryState
|
||||
{
|
||||
|
||||
private var _accShownItems:Array;
|
||||
|
||||
private var _accShownLayers:Array;
|
||||
|
||||
public var ownerAvatar:Avatar;
|
||||
|
||||
public function AccessoryState()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:Avatar) : void
|
||||
{
|
||||
_accShownItems = [];
|
||||
_accShownLayers = [];
|
||||
ownerAvatar = param1;
|
||||
if(ownerAvatar.avName == null)
|
||||
{
|
||||
DebugUtility.debugTrace("break here");
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
if(_accShownItems)
|
||||
{
|
||||
_accShownItems = null;
|
||||
}
|
||||
if(_accShownLayers)
|
||||
{
|
||||
_accShownLayers = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function copyShownAccRef(param1:AccessoryState) : void
|
||||
{
|
||||
DebugUtility.debugTrace("AccState copyAcc - ownerAvatar:" + ownerAvatar + (ownerAvatar ? " name:" + ownerAvatar.avName : "") + " copyFrom avatar:" + param1.ownerAvatar + " name:" + param1.ownerAvatar.avName);
|
||||
accShownItems = param1.accShownItems;
|
||||
accShownLayers = param1.accShownLayers;
|
||||
}
|
||||
|
||||
public function cloneShownAcc(param1:AccessoryState) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
accShownItems = param1.accShownItems;
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < accShownItems.length)
|
||||
{
|
||||
accShownItems[_loc2_] = accShownItems[_loc2_].clone();
|
||||
_loc2_++;
|
||||
}
|
||||
accShownLayers = param1.accShownLayers;
|
||||
}
|
||||
|
||||
public function matchShownItems(param1:AccessoryState, param2:Array, param3:Array) : void
|
||||
{
|
||||
var _loc7_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
var _loc5_:int = 0;
|
||||
var _loc6_:int = int(param1.accShownItems.length);
|
||||
accShownLayers = param1.accShownLayers;
|
||||
_loc7_ = 0;
|
||||
while(_loc7_ < _loc6_)
|
||||
{
|
||||
if(param1.accShownItems[_loc7_].type == 1)
|
||||
{
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < param2.length)
|
||||
{
|
||||
if(param1.accShownItems[_loc7_].invIdx == param2[_loc4_].invIdx)
|
||||
{
|
||||
accShownItems[_loc7_] = param2[_loc4_];
|
||||
break;
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
else if(param1.accShownItems[_loc7_].type == 0)
|
||||
{
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < param3.length)
|
||||
{
|
||||
if(param1.accShownItems[_loc7_].invIdx == param3[_loc5_].invIdx)
|
||||
{
|
||||
accShownItems[_loc7_] = param3[_loc5_];
|
||||
break;
|
||||
}
|
||||
_loc5_++;
|
||||
}
|
||||
}
|
||||
_loc7_++;
|
||||
}
|
||||
}
|
||||
|
||||
public function get accShownItems() : Array
|
||||
{
|
||||
return _accShownItems;
|
||||
}
|
||||
|
||||
public function set accShownItems(param1:Array) : void
|
||||
{
|
||||
_accShownItems = param1.concat();
|
||||
}
|
||||
|
||||
public function get accShownLayers() : Array
|
||||
{
|
||||
return _accShownLayers;
|
||||
}
|
||||
|
||||
public function set accShownLayers(param1:Array) : void
|
||||
{
|
||||
_accShownLayers = param1.concat();
|
||||
}
|
||||
|
||||
public function showAccessory(param1:Item) : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
if(param1)
|
||||
{
|
||||
_loc3_ = 0;
|
||||
_loc2_ = int(_accShownItems.length);
|
||||
while(_loc3_ < _loc2_)
|
||||
{
|
||||
if(_accShownItems[_loc3_].invIdx == param1.invIdx)
|
||||
{
|
||||
DebugUtility.debugTrace("accessory showId:" + _accShownItems[_loc3_].invIdx + " is already visible!");
|
||||
break;
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
if(_loc3_ == _loc2_)
|
||||
{
|
||||
param1.setInUse(ownerAvatar.perUserAvId,true);
|
||||
adjustAvatarQuestValues(true,param1);
|
||||
_accShownItems.push(param1);
|
||||
_accShownLayers.push(param1.layerId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugUtility.debugTrace("WARNING: showAccessory received a null item");
|
||||
}
|
||||
}
|
||||
|
||||
public function replaceAccessory(param1:Item, param2:Item) : void
|
||||
{
|
||||
var _loc4_:int = 0;
|
||||
if(param1.accId != param2.accId)
|
||||
{
|
||||
throw new Error("Tried to replace accessory with different accId! Layers may not match! oldId:" + param1.accId + " newId:" + param2.accId);
|
||||
}
|
||||
var _loc3_:int = int(_accShownItems.length);
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _loc3_)
|
||||
{
|
||||
if(_accShownItems[_loc4_] == param1)
|
||||
{
|
||||
_accShownItems[_loc4_] = param2;
|
||||
if(!param2.getInUse(ownerAvatar.perUserAvId))
|
||||
{
|
||||
_accShownItems.splice(_loc4_,1);
|
||||
_accShownLayers.splice(_loc4_,1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
|
||||
public function isAccessoryVisibleByItemId(param1:int) : Boolean
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc2_:int = int(_accShownItems.length);
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _loc2_)
|
||||
{
|
||||
if(_accShownItems[_loc3_].invIdx == param1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isAccessoryVisibleByAccId(param1:int) : Boolean
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc2_:int = int(_accShownItems.length);
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _loc2_)
|
||||
{
|
||||
if(_accShownItems[_loc3_].accId == param1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isAccessoryVisibleByLayer(param1:int) : Boolean
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:int = int(_accShownLayers.length);
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _loc3_)
|
||||
{
|
||||
if(_accShownLayers[_loc2_] == param1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getAccessoryVisibleDefIdByLayer(param1:int) : int
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:int = int(_accShownLayers.length);
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _loc3_)
|
||||
{
|
||||
if(_accShownLayers[_loc2_] == param1)
|
||||
{
|
||||
return _accShownItems[_loc2_].defId;
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function hideAccessory(param1:Item) : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
if(param1)
|
||||
{
|
||||
_loc3_ = 0;
|
||||
_loc2_ = int(_accShownItems.length);
|
||||
while(_loc3_ < _loc2_)
|
||||
{
|
||||
if(_accShownItems[_loc3_].invIdx == param1.invIdx)
|
||||
{
|
||||
param1.setInUse(ownerAvatar.perUserAvId,false);
|
||||
adjustAvatarQuestValues(false,param1);
|
||||
_accShownItems.splice(_loc3_,1);
|
||||
_accShownLayers.splice(_loc3_,1);
|
||||
break;
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
if(_loc3_ == _accShownItems.length)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function hideAll() : void
|
||||
{
|
||||
while(_accShownItems.length > 0)
|
||||
{
|
||||
hideAccessory(_accShownItems[0]);
|
||||
}
|
||||
}
|
||||
|
||||
public function removeAllItems() : void
|
||||
{
|
||||
_accShownItems = [];
|
||||
_accShownLayers = [];
|
||||
ownerAvatar.meleeAttack = [0,0];
|
||||
ownerAvatar.rangedAttack = [0,0];
|
||||
ownerAvatar.fierceAttack = [0,0];
|
||||
ownerAvatar.healingPower = [0,0];
|
||||
ownerAvatar.defense = [0,0];
|
||||
}
|
||||
|
||||
public function hideAllExceptBase() : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc1_:int = int(_accShownItems.length);
|
||||
while(_loc2_ < _loc1_)
|
||||
{
|
||||
if(_accShownLayers[_loc2_] != 1)
|
||||
{
|
||||
hideAccessory(_accShownItems[_loc2_]);
|
||||
_loc1_--;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function hideAllClothingArticles(param1:Array = null) : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
var _loc2_:int = int(_accShownItems.length);
|
||||
while(_loc4_ < _loc2_)
|
||||
{
|
||||
_loc3_ = int(_accShownItems[_loc4_].layerId);
|
||||
if(_loc3_ > 3)
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
param1.push(_accShownItems[_loc4_].invIdx);
|
||||
}
|
||||
hideAccessory(_accShownItems[_loc4_]);
|
||||
_loc2_--;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function adjustAvatarQuestValues(param1:Boolean, param2:Item) : void
|
||||
{
|
||||
if(param2.attack < 0)
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
var _loc3_:* = 0;
|
||||
var _loc4_:* = ownerAvatar.healingPower[_loc3_] + param2.attack * -1;
|
||||
ownerAvatar.healingPower[_loc3_] = _loc4_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc4_ = 0;
|
||||
_loc3_ = ownerAvatar.healingPower[_loc4_] - param2.attack * -1;
|
||||
ownerAvatar.healingPower[_loc4_] = _loc3_;
|
||||
}
|
||||
}
|
||||
else if(param2.combatType == 1)
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
_loc3_ = 0;
|
||||
_loc4_ = ownerAvatar.rangedAttack[_loc3_] + param2.attack;
|
||||
ownerAvatar.rangedAttack[_loc3_] = _loc4_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc4_ = 0;
|
||||
_loc3_ = ownerAvatar.rangedAttack[_loc4_] - param2.attack;
|
||||
ownerAvatar.rangedAttack[_loc4_] = _loc3_;
|
||||
}
|
||||
}
|
||||
else if(param1)
|
||||
{
|
||||
_loc3_ = 0;
|
||||
_loc4_ = ownerAvatar.meleeAttack[_loc3_] + param2.attack;
|
||||
ownerAvatar.meleeAttack[_loc3_] = _loc4_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc4_ = 0;
|
||||
_loc3_ = ownerAvatar.meleeAttack[_loc4_] - param2.attack;
|
||||
ownerAvatar.meleeAttack[_loc4_] = _loc3_;
|
||||
}
|
||||
if(param1)
|
||||
{
|
||||
_loc3_ = 0;
|
||||
_loc4_ = ownerAvatar.fierceAttack[_loc3_] + param2.fierceAttack;
|
||||
ownerAvatar.fierceAttack[_loc3_] = _loc4_;
|
||||
ownerAvatar.defense[0] += param2.defense;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = 0;
|
||||
_loc4_ = ownerAvatar.fierceAttack[_loc3_] - param2.fierceAttack;
|
||||
ownerAvatar.fierceAttack[_loc3_] = _loc4_;
|
||||
ownerAvatar.defense[0] -= param2.defense;
|
||||
}
|
||||
switch(param2.modifierType - 1)
|
||||
{
|
||||
case 0:
|
||||
if(param1)
|
||||
{
|
||||
_loc3_ = 1;
|
||||
_loc4_ = ownerAvatar.rangedAttack[_loc3_] + param2.modifierValue;
|
||||
ownerAvatar.rangedAttack[_loc3_] = _loc4_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc4_ = 1;
|
||||
_loc3_ = ownerAvatar.rangedAttack[_loc4_] - param2.modifierValue;
|
||||
ownerAvatar.rangedAttack[_loc4_] = _loc3_;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(param1)
|
||||
{
|
||||
_loc3_ = 1;
|
||||
_loc4_ = ownerAvatar.meleeAttack[_loc3_] + param2.modifierValue;
|
||||
ownerAvatar.meleeAttack[_loc3_] = _loc4_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc4_ = 1;
|
||||
_loc3_ = ownerAvatar.meleeAttack[_loc4_] - param2.modifierValue;
|
||||
ownerAvatar.meleeAttack[_loc4_] = _loc3_;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(param1)
|
||||
{
|
||||
_loc3_ = 1;
|
||||
_loc4_ = ownerAvatar.defense[_loc3_] + param2.modifierValue;
|
||||
ownerAvatar.defense[_loc3_] = _loc4_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc4_ = 1;
|
||||
_loc3_ = ownerAvatar.defense[_loc4_] - param2.modifierValue;
|
||||
ownerAvatar.defense[_loc4_] = _loc3_;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(param1)
|
||||
{
|
||||
_loc3_ = 1;
|
||||
_loc4_ = ownerAvatar.healingPower[_loc3_] + param2.modifierValue;
|
||||
ownerAvatar.healingPower[_loc3_] = _loc4_;
|
||||
break;
|
||||
}
|
||||
_loc4_ = 1;
|
||||
_loc3_ = ownerAvatar.healingPower[_loc4_] - param2.modifierValue;
|
||||
ownerAvatar.healingPower[_loc4_] = _loc3_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,412 @@
|
||||
package avatar
|
||||
{
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import flash.events.EventDispatcher;
|
||||
import item.Inventory;
|
||||
import item.Item;
|
||||
import item.ItemXtCommManager;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class Avatar extends EventDispatcher
|
||||
{
|
||||
|
||||
private var _avName:String;
|
||||
|
||||
private var _userName:String;
|
||||
|
||||
private var _uuid:String;
|
||||
|
||||
private var _sfsUserId:int;
|
||||
|
||||
private var _perUserAvId:int;
|
||||
|
||||
private var _avTypeId:int;
|
||||
|
||||
private var _roomType:int;
|
||||
|
||||
private var _customAvId:int;
|
||||
|
||||
private var _enviroTypeFlag:int;
|
||||
|
||||
private var _colors:Array;
|
||||
|
||||
private var _accState:AccessoryState;
|
||||
|
||||
public var inventoryClothing:Inventory;
|
||||
|
||||
public var inventoryBodyMod:Inventory;
|
||||
|
||||
public var inventoryDenFull:Inventory;
|
||||
|
||||
public var inventoryDenPartial:Inventory;
|
||||
|
||||
public var isShaman:Boolean;
|
||||
|
||||
public var shamanName:String;
|
||||
|
||||
public var shamanText:String;
|
||||
|
||||
public var rangedAttack:Array;
|
||||
|
||||
public var meleeAttack:Array;
|
||||
|
||||
public var fierceAttack:Array;
|
||||
|
||||
public var healingPower:Array;
|
||||
|
||||
public var defense:Array;
|
||||
|
||||
public function Avatar()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:int, param2:String, param3:int, param4:Array, param5:int = -1, param6:AccessoryState = null, param7:String = "", param8:int = -1, param9:int = 0, param10:Array = null, param11:Array = null, param12:Array = null, param13:Array = null, param14:Array = null) : void
|
||||
{
|
||||
avTypeId = param3;
|
||||
_perUserAvId = param1;
|
||||
_roomType = param9;
|
||||
_customAvId = param5;
|
||||
_avName = param2;
|
||||
rangedAttack = param10 == null ? [0,0] : param10;
|
||||
meleeAttack = param11 == null ? [0,0] : param11;
|
||||
fierceAttack = param12 == null ? [0,0] : param12;
|
||||
healingPower = param13 == null ? [0,0] : param13;
|
||||
defense = param14 == null ? [0,0] : param14;
|
||||
if(param7 != "")
|
||||
{
|
||||
userName = param7;
|
||||
}
|
||||
_sfsUserId = param8;
|
||||
_accState = new AccessoryState();
|
||||
if(param6)
|
||||
{
|
||||
DebugUtility.debugTrace("Avatar init - copying accState");
|
||||
_accState.copyShownAccRef(param6);
|
||||
DebugUtility.debugTrace("old ownerAvatar:" + (_accState.ownerAvatar ? _accState.ownerAvatar.avName : _accState.ownerAvatar));
|
||||
_accState.ownerAvatar = this;
|
||||
DebugUtility.debugTrace("new ownerAvatar:" + _accState.ownerAvatar.avName);
|
||||
}
|
||||
else
|
||||
{
|
||||
_accState.init(this);
|
||||
}
|
||||
if(param4)
|
||||
{
|
||||
copyColors(param4);
|
||||
}
|
||||
else
|
||||
{
|
||||
_colors = null;
|
||||
}
|
||||
inventoryClothing = new Inventory();
|
||||
inventoryBodyMod = new Inventory();
|
||||
inventoryDenFull = new Inventory();
|
||||
inventoryDenPartial = new Inventory();
|
||||
inventoryClothing.init(_accState);
|
||||
inventoryBodyMod.init(_accState);
|
||||
inventoryDenFull.init(_accState);
|
||||
inventoryDenPartial.init(_accState);
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
if(_accState)
|
||||
{
|
||||
_accState.destroy();
|
||||
_accState = null;
|
||||
}
|
||||
if(inventoryClothing)
|
||||
{
|
||||
inventoryClothing.destroy();
|
||||
inventoryClothing = null;
|
||||
}
|
||||
if(inventoryBodyMod)
|
||||
{
|
||||
inventoryBodyMod.destroy();
|
||||
inventoryBodyMod = null;
|
||||
}
|
||||
if(inventoryDenFull)
|
||||
{
|
||||
inventoryDenFull.destroy();
|
||||
inventoryDenFull = null;
|
||||
}
|
||||
if(inventoryDenPartial)
|
||||
{
|
||||
inventoryDenPartial.destroy();
|
||||
inventoryDenPartial = null;
|
||||
}
|
||||
_colors = null;
|
||||
}
|
||||
|
||||
public function get perUserAvId() : int
|
||||
{
|
||||
return _perUserAvId;
|
||||
}
|
||||
|
||||
public function set perUserAvId(param1:int) : void
|
||||
{
|
||||
_perUserAvId = param1;
|
||||
}
|
||||
|
||||
public function get avName() : String
|
||||
{
|
||||
return LocalizationManager.translateAvatarName(_avName);
|
||||
}
|
||||
|
||||
public function set avName(param1:String) : void
|
||||
{
|
||||
_avName = param1;
|
||||
}
|
||||
|
||||
public function get userName() : String
|
||||
{
|
||||
return _userName;
|
||||
}
|
||||
|
||||
public function set userName(param1:String) : void
|
||||
{
|
||||
_userName = param1;
|
||||
}
|
||||
|
||||
public function get uuid() : String
|
||||
{
|
||||
return _uuid;
|
||||
}
|
||||
|
||||
public function set uuid(param1:String) : void
|
||||
{
|
||||
_uuid = param1;
|
||||
}
|
||||
|
||||
public function get sfsUserId() : int
|
||||
{
|
||||
return _sfsUserId;
|
||||
}
|
||||
|
||||
public function set avTypeId(param1:int) : void
|
||||
{
|
||||
_avTypeId = param1;
|
||||
_enviroTypeFlag = gMainFrame.userInfo.getAvatarEnviroTypeFlagByAvType(_avTypeId);
|
||||
}
|
||||
|
||||
public function get avTypeId() : int
|
||||
{
|
||||
return _avTypeId;
|
||||
}
|
||||
|
||||
public function get enviroTypeFlag() : int
|
||||
{
|
||||
return _enviroTypeFlag;
|
||||
}
|
||||
|
||||
public function set colors(param1:Array) : void
|
||||
{
|
||||
setColors(param1[0],param1[1],param1[2]);
|
||||
}
|
||||
|
||||
public function get colors() : Array
|
||||
{
|
||||
return _colors;
|
||||
}
|
||||
|
||||
public function get accShownItems() : Array
|
||||
{
|
||||
return _accState.accShownItems;
|
||||
}
|
||||
|
||||
public function set roomType(param1:int) : void
|
||||
{
|
||||
_roomType = param1;
|
||||
}
|
||||
|
||||
public function get customAvId() : int
|
||||
{
|
||||
return _customAvId;
|
||||
}
|
||||
|
||||
public function set customAvId(param1:int) : void
|
||||
{
|
||||
_customAvId = param1;
|
||||
}
|
||||
|
||||
public function get inUsePatternId() : int
|
||||
{
|
||||
return _accState.getAccessoryVisibleDefIdByLayer(2);
|
||||
}
|
||||
|
||||
public function get inUseEyeId() : int
|
||||
{
|
||||
return _accState.getAccessoryVisibleDefIdByLayer(3);
|
||||
}
|
||||
|
||||
public function copyShownAccRefsFromAvatar(param1:Avatar) : void
|
||||
{
|
||||
_accState.copyShownAccRef(param1._accState);
|
||||
inventoryBodyMod.itemArray = param1.inventoryBodyMod.itemArray.concat();
|
||||
if(param1.inventoryClothing)
|
||||
{
|
||||
inventoryClothing.itemArray = param1.inventoryClothing.itemArray.concat();
|
||||
}
|
||||
}
|
||||
|
||||
public function cloneShownAccFromAvatar(param1:Avatar) : void
|
||||
{
|
||||
_accState.cloneShownAcc(param1._accState);
|
||||
inventoryBodyMod.itemArray = param1.inventoryBodyMod.itemArray.concat();
|
||||
if(param1.inventoryClothing)
|
||||
{
|
||||
inventoryClothing.itemArray = param1.inventoryClothing.itemArray.concat();
|
||||
}
|
||||
}
|
||||
|
||||
public function matchShownAcc(param1:AccessoryState) : void
|
||||
{
|
||||
_accState.matchShownItems(param1,inventoryClothing.itemArray,inventoryBodyMod.itemArray);
|
||||
}
|
||||
|
||||
public function setColors(param1:uint, param2:uint, param3:uint) : void
|
||||
{
|
||||
if(_colors == null)
|
||||
{
|
||||
_colors = new Array(3);
|
||||
}
|
||||
var _loc13_:uint = uint(gMainFrame.userInfo.getAvatarColorLayer1InfoByAvType(_avTypeId));
|
||||
var _loc11_:int = param1 >> 24 & 0xFF;
|
||||
var _loc12_:int = param1 >> 16 & 0xFF;
|
||||
var _loc9_:int = _loc13_ >> 8 & 0xFF;
|
||||
var _loc10_:int = _loc13_ & 0xFF;
|
||||
var _loc4_:uint = uint(gMainFrame.userInfo.getAvatarColorLayer3InfoByAvType(_avTypeId));
|
||||
var _loc5_:int = param3 >> 24 & 0xFF;
|
||||
var _loc7_:int = _loc4_ >> 16 & 0xFF;
|
||||
var _loc8_:int = _loc4_ >> 8 & 0xFF;
|
||||
var _loc6_:int = _loc4_ & 0xFF;
|
||||
_colors[0] = uint(_loc11_ << 24 | _loc12_ << 16 | _loc9_ << 8 | _loc10_);
|
||||
_colors[1] = param2;
|
||||
_colors[2] = uint(_loc5_ << 24 | _loc7_ << 16 | _loc8_ << 8 | _loc6_);
|
||||
dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||
}
|
||||
|
||||
public function copyColors(param1:Array) : void
|
||||
{
|
||||
colors = param1.concat();
|
||||
}
|
||||
|
||||
public function itemResponseIntegrate(param1:Array) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:Item = null;
|
||||
var _loc5_:Boolean = false;
|
||||
var _loc4_:int = 0;
|
||||
if(inventoryBodyMod && inventoryClothing)
|
||||
{
|
||||
removeAllItems();
|
||||
_loc2_ = int(param1.length);
|
||||
_loc5_ = _customAvId != -1;
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _loc2_)
|
||||
{
|
||||
_loc3_ = param1[_loc4_];
|
||||
if(_loc3_.type == 0)
|
||||
{
|
||||
if(ItemXtCommManager.canUseItem(_loc3_.defId,this,_loc5_))
|
||||
{
|
||||
inventoryBodyMod.addItem(_loc3_);
|
||||
if(_loc3_.getInUse(_perUserAvId))
|
||||
{
|
||||
_accState.showAccessory(_loc3_);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(_loc3_.type == 1)
|
||||
{
|
||||
if(_enviroTypeFlag == 1 << 0 || _enviroTypeFlag == 1 << 1 || _enviroTypeFlag == true || _loc3_.enviroType == _roomType)
|
||||
{
|
||||
inventoryClothing.addItem(_loc3_);
|
||||
if(_loc3_.getInUse(_perUserAvId))
|
||||
{
|
||||
_accState.showAccessory(_loc3_);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugUtility.debugTrace("ERROR: Bad item type: " + _loc3_.type);
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||
}
|
||||
}
|
||||
|
||||
public function accStateShowAccessory(param1:Item, param2:Function = null) : void
|
||||
{
|
||||
var _loc4_:Item = null;
|
||||
var _loc5_:int = 0;
|
||||
var _loc3_:Array = param1.type == 0 ? inventoryBodyMod.itemArray : inventoryClothing.itemArray;
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < _loc3_.length)
|
||||
{
|
||||
_loc4_ = _loc3_[_loc5_];
|
||||
if(_loc4_.layerId == param1.layerId && _loc4_.getInUse(_perUserAvId))
|
||||
{
|
||||
if(_loc4_ != param1)
|
||||
{
|
||||
accStateHideAccessory(_loc4_,false);
|
||||
if(param2 != null)
|
||||
{
|
||||
param2(_loc4_);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
_loc5_++;
|
||||
}
|
||||
_accState.showAccessory(param1);
|
||||
dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||
}
|
||||
|
||||
public function accStateHideAccessory(param1:Item, param2:Boolean = true) : void
|
||||
{
|
||||
_accState.hideAccessory(param1);
|
||||
if(param2)
|
||||
{
|
||||
dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||
}
|
||||
}
|
||||
|
||||
public function removeAllItems() : void
|
||||
{
|
||||
inventoryBodyMod.itemArray = [];
|
||||
inventoryClothing.itemArray = [];
|
||||
_accState.removeAllItems();
|
||||
}
|
||||
|
||||
public function get accState() : AccessoryState
|
||||
{
|
||||
return _accState;
|
||||
}
|
||||
|
||||
public function clone(param1:Avatar) : void
|
||||
{
|
||||
_avTypeId = param1.avTypeId;
|
||||
_perUserAvId = param1.perUserAvId;
|
||||
_avName = param1.avName;
|
||||
userName = param1.userName;
|
||||
_sfsUserId = param1._sfsUserId;
|
||||
_accState = new AccessoryState();
|
||||
_accState.cloneShownAcc(param1.accState);
|
||||
_accState.ownerAvatar = this;
|
||||
copyColors(param1.colors);
|
||||
inventoryClothing = new Inventory();
|
||||
inventoryClothing.clone(param1.inventoryClothing);
|
||||
inventoryBodyMod = new Inventory();
|
||||
inventoryBodyMod.clone(param1.inventoryBodyMod);
|
||||
inventoryDenFull = new Inventory();
|
||||
inventoryDenFull.clone(param1.inventoryDenFull);
|
||||
inventoryDenPartial = new Inventory();
|
||||
inventoryDenPartial.clone(param1.inventoryDenPartial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package avatar
|
||||
{
|
||||
import com.sbi.graphics.LayerAnim;
|
||||
import item.Item;
|
||||
|
||||
public class AvatarEditorView extends AvatarView
|
||||
{
|
||||
|
||||
public function AvatarEditorView()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init(param1:Avatar, param2:Function = null) : void
|
||||
{
|
||||
var _loc4_:int = 0;
|
||||
var _loc3_:int = 0;
|
||||
_avatar = new Avatar();
|
||||
_avatar.init(param1.perUserAvId,"editorAvatar",param1.avTypeId,param1.colors,param1.customAvId,null,"",-1,0,param1.rangedAttack,param1.meleeAttack,param1.fierceAttack,param1.healingPower,param1.defense);
|
||||
if(param1.inventoryClothing.itemArray)
|
||||
{
|
||||
_avatar.inventoryClothing.itemArray = param1.inventoryClothing.itemArray.concat();
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _avatar.inventoryClothing.itemArray.length)
|
||||
{
|
||||
_avatar.inventoryClothing.itemArray[_loc4_].makeSmallIcon();
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
if(param1.inventoryBodyMod.itemArray)
|
||||
{
|
||||
_avatar.inventoryBodyMod.itemArray = param1.inventoryBodyMod.itemArray.concat();
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _avatar.inventoryBodyMod.itemArray.length)
|
||||
{
|
||||
_avatar.inventoryBodyMod.itemArray[_loc3_].makeSmallIcon();
|
||||
_loc3_++;
|
||||
}
|
||||
}
|
||||
_avatar.matchShownAcc(param1.accState);
|
||||
_avatar.addEventListener("OnAvatarChanged",avatarChanged,false,0,true);
|
||||
_layerAnim = LayerAnim.getNew();
|
||||
_layerAnim.avDefId = _avatar.avTypeId;
|
||||
_layerAnim.layers = AvatarUtility.layerArrayForItemsAndColors(param1.inventoryClothing.itemArray.concat(param1.inventoryBodyMod.itemArray.concat()),param1.colors,param1.perUserAvId);
|
||||
this.addChild(_layerAnim.bitmap);
|
||||
}
|
||||
|
||||
override public function destroy(param1:Boolean = true) : void
|
||||
{
|
||||
if(param1 && _avatar)
|
||||
{
|
||||
_avatar.removeEventListener("OnAvatarChanged",avatarChanged);
|
||||
_avatar.destroy();
|
||||
_avatar = null;
|
||||
}
|
||||
avTypeChangedCallback = null;
|
||||
LayerAnim.destroy(_layerAnim);
|
||||
_layerAnim = null;
|
||||
}
|
||||
|
||||
public function get colors() : Array
|
||||
{
|
||||
return _avatar.colors;
|
||||
}
|
||||
|
||||
public function set colors(param1:Array) : void
|
||||
{
|
||||
_avatar.colors = param1;
|
||||
}
|
||||
|
||||
public function get accState() : AccessoryState
|
||||
{
|
||||
return _avatar.accState;
|
||||
}
|
||||
|
||||
public function showAccessory(param1:Item, param2:Function = null) : void
|
||||
{
|
||||
_avatar.accStateShowAccessory(param1,param2);
|
||||
}
|
||||
|
||||
public function hideAccessory(param1:Item) : void
|
||||
{
|
||||
_avatar.accStateHideAccessory(param1);
|
||||
}
|
||||
|
||||
public function get viewAvatar() : Avatar
|
||||
{
|
||||
return _avatar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package avatar
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class AvatarEvent extends Event
|
||||
{
|
||||
|
||||
public static const AVATAR_CHANGED:String = "OnAvatarChanged";
|
||||
|
||||
public function AvatarEvent(param1:String)
|
||||
{
|
||||
super(param1);
|
||||
}
|
||||
|
||||
override public function clone() : Event
|
||||
{
|
||||
return new AvatarEvent(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
package avatar
|
||||
{
|
||||
import localization.LocalizationManager;
|
||||
import pet.PetManager;
|
||||
|
||||
public class AvatarInfo
|
||||
{
|
||||
|
||||
public var perUserAvId:int;
|
||||
|
||||
public var uuid:String;
|
||||
|
||||
public var type:int;
|
||||
|
||||
public var colors:Array;
|
||||
|
||||
public var currEnviroType:int;
|
||||
|
||||
public var landPetInvId:int;
|
||||
|
||||
public var oceanPetInvId:int;
|
||||
|
||||
public var questXp:int;
|
||||
|
||||
public var questLevel:int;
|
||||
|
||||
public var questXPPercentage:int;
|
||||
|
||||
public var questHealthPercentage:int;
|
||||
|
||||
public var questTorchStatus:Boolean;
|
||||
|
||||
public var isDead:Boolean;
|
||||
|
||||
public var healthBase:int;
|
||||
|
||||
public var attackBase:int;
|
||||
|
||||
public var attackMax:int;
|
||||
|
||||
public var defenseBase:int;
|
||||
|
||||
public var defenseMax:int;
|
||||
|
||||
public var customAvId:int;
|
||||
|
||||
private var _userName:String;
|
||||
|
||||
private var _currPet:Object;
|
||||
|
||||
private var _avName:String;
|
||||
|
||||
public function AvatarInfo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:int = -1, param2:String = "", param3:String = "", param4:String = "", param5:int = -1, param6:Array = null, param7:int = 0, param8:Object = null, param9:int = -1, param10:int = 0, param11:int = 0, param12:int = 0, param13:int = 0, param14:int = 0, param15:int = 0, param16:int = 0, param17:int = 0, param18:int = 0, param19:int = 0, param20:int = 100, param21:Boolean = false) : void
|
||||
{
|
||||
isDead = false;
|
||||
perUserAvId = param1;
|
||||
_avName = param2;
|
||||
_userName = param3;
|
||||
uuid = param4;
|
||||
type = param5;
|
||||
colors = param6 == null ? [286331153,286331153,286331153] : param6;
|
||||
currEnviroType = param7;
|
||||
landPetInvId = param10;
|
||||
oceanPetInvId = param11;
|
||||
questXp = param12;
|
||||
questLevel = param13;
|
||||
questXPPercentage = param14;
|
||||
questHealthPercentage = param20;
|
||||
questTorchStatus = param21;
|
||||
attackBase = param16;
|
||||
attackMax = param17;
|
||||
defenseBase = param19;
|
||||
defenseMax = param18;
|
||||
healthBase = param15;
|
||||
_currPet = param8;
|
||||
customAvId = param9;
|
||||
}
|
||||
|
||||
public function get currPet() : Object
|
||||
{
|
||||
if(_userName.toLowerCase() == gMainFrame.userInfo.myUserName.toLowerCase())
|
||||
{
|
||||
return PetManager.myActivePet;
|
||||
}
|
||||
return _currPet;
|
||||
}
|
||||
|
||||
public function set currPet(param1:Object) : void
|
||||
{
|
||||
if(_userName.toLowerCase() != gMainFrame.userInfo.myUserName.toLowerCase())
|
||||
{
|
||||
_currPet = param1;
|
||||
}
|
||||
}
|
||||
|
||||
public function getItems(param1:Boolean = false) : Array
|
||||
{
|
||||
var _loc2_:UserInfo = gMainFrame.userInfo.getUserInfoByUserName(_userName);
|
||||
if(_loc2_)
|
||||
{
|
||||
return _loc2_.getPartialItemList(type,param1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getFullItems(param1:Boolean = false) : Array
|
||||
{
|
||||
var _loc2_:UserInfo = gMainFrame.userInfo.getUserInfoByUserName(_userName);
|
||||
if(_loc2_)
|
||||
{
|
||||
return _loc2_.getFullItemList(param1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function set fullItemList(param1:Array) : void
|
||||
{
|
||||
var _loc2_:UserInfo = gMainFrame.userInfo.getUserInfoByUserName(_userName);
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc2_.fullItemList = param1;
|
||||
}
|
||||
}
|
||||
|
||||
public function get denItems() : Array
|
||||
{
|
||||
var _loc1_:UserInfo = gMainFrame.userInfo.getUserInfoByUserName(_userName);
|
||||
if(_loc1_)
|
||||
{
|
||||
return _loc1_.denItemsFull;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get achievements() : Array
|
||||
{
|
||||
var _loc1_:UserInfo = gMainFrame.userInfo.getUserInfoByUserName(_userName);
|
||||
if(_loc1_)
|
||||
{
|
||||
return _loc1_.achievements;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function set denItems(param1:Array) : void
|
||||
{
|
||||
var _loc2_:UserInfo = null;
|
||||
if(param1)
|
||||
{
|
||||
_loc2_ = gMainFrame.userInfo.getUserInfoByUserName(_userName);
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc2_.denItemsFull = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get accountType() : int
|
||||
{
|
||||
var _loc1_:UserInfo = gMainFrame.userInfo.getUserInfoByUserName(_userName);
|
||||
if(_loc1_)
|
||||
{
|
||||
return _loc1_.accountType;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function get isMember() : Boolean
|
||||
{
|
||||
return Utility.isMember(accountType);
|
||||
}
|
||||
|
||||
public function get avName() : String
|
||||
{
|
||||
return LocalizationManager.translateAvatarName(_avName);
|
||||
}
|
||||
|
||||
public function set avName(param1:String) : void
|
||||
{
|
||||
_avName = param1;
|
||||
}
|
||||
|
||||
public function get userName() : String
|
||||
{
|
||||
return _userName;
|
||||
}
|
||||
|
||||
public function set userName(param1:String) : void
|
||||
{
|
||||
_userName = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,349 @@
|
||||
package avatar
|
||||
{
|
||||
import com.sbi.graphics.LayerAnim;
|
||||
import flash.display.Sprite;
|
||||
import flash.filters.ColorMatrixFilter;
|
||||
import item.Item;
|
||||
|
||||
public class AvatarView extends Sprite
|
||||
{
|
||||
|
||||
protected var _layerAnim:LayerAnim;
|
||||
|
||||
protected var _avatar:Avatar;
|
||||
|
||||
public var avTypeChangedCallback:Function;
|
||||
|
||||
private var _isOffScreen:Boolean;
|
||||
|
||||
private var _holdAnimId:int;
|
||||
|
||||
private var _lastAnimToHappen:int;
|
||||
|
||||
public function AvatarView()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function set lastAnimToHappen(param1:int) : void
|
||||
{
|
||||
_lastAnimToHappen = param1;
|
||||
}
|
||||
|
||||
public function get lastAnimToHappen() : int
|
||||
{
|
||||
return _lastAnimToHappen;
|
||||
}
|
||||
|
||||
public function set holdAnimId(param1:int) : void
|
||||
{
|
||||
_holdAnimId = param1;
|
||||
}
|
||||
|
||||
public function init(param1:Avatar, param2:Function = null) : void
|
||||
{
|
||||
_holdAnimId = 0;
|
||||
_avatar = param1;
|
||||
_avatar.addEventListener("OnAvatarChanged",avatarChanged,false,0,true);
|
||||
avTypeChangedCallback = param2;
|
||||
_layerAnim = LayerAnim.getNew();
|
||||
_layerAnim.avDefId = _avatar.avTypeId;
|
||||
if(_avatar.colors)
|
||||
{
|
||||
_layerAnim.layers = setLayerHelper();
|
||||
}
|
||||
this.addChild(_layerAnim.bitmap);
|
||||
}
|
||||
|
||||
public function destroy(param1:Boolean = false) : void
|
||||
{
|
||||
if(param1 && _avatar)
|
||||
{
|
||||
_avatar.removeEventListener("OnAvatarChanged",avatarChanged);
|
||||
_avatar.destroy();
|
||||
_avatar = null;
|
||||
}
|
||||
avTypeChangedCallback = null;
|
||||
LayerAnim.destroy(_layerAnim);
|
||||
_layerAnim = null;
|
||||
}
|
||||
|
||||
public function resetAvatar(param1:Avatar) : void
|
||||
{
|
||||
if(_avatar && _avatar.hasEventListener("OnAvatarChanged"))
|
||||
{
|
||||
_avatar.removeEventListener("OnAvatarChanged",avatarChanged);
|
||||
}
|
||||
_avatar = param1;
|
||||
_avatar.addEventListener("OnAvatarChanged",avatarChanged,false,0,true);
|
||||
if(_layerAnim)
|
||||
{
|
||||
_layerAnim.avDefId = _avatar.avTypeId;
|
||||
if(_avatar.colors)
|
||||
{
|
||||
_layerAnim.layers = setLayerHelper();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function isValid() : Boolean
|
||||
{
|
||||
return _layerAnim != null;
|
||||
}
|
||||
|
||||
public function hideAvatar() : void
|
||||
{
|
||||
if(_layerAnim != null)
|
||||
{
|
||||
_layerAnim.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function showAvatar() : void
|
||||
{
|
||||
if(_layerAnim != null)
|
||||
{
|
||||
_layerAnim.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function set isOffScreen(param1:Boolean) : void
|
||||
{
|
||||
_isOffScreen = param1;
|
||||
}
|
||||
|
||||
public function get isOffScreen() : Boolean
|
||||
{
|
||||
return _isOffScreen;
|
||||
}
|
||||
|
||||
public function pauseAnim(param1:Boolean) : void
|
||||
{
|
||||
_layerAnim.pause = param1;
|
||||
}
|
||||
|
||||
public function advanceFrame() : void
|
||||
{
|
||||
_layerAnim.frame++;
|
||||
}
|
||||
|
||||
public function get frame() : int
|
||||
{
|
||||
return _layerAnim.frame;
|
||||
}
|
||||
|
||||
public function set frame(param1:int) : void
|
||||
{
|
||||
_layerAnim.frame = param1;
|
||||
}
|
||||
|
||||
public function get flip() : Boolean
|
||||
{
|
||||
return _layerAnim.hFlip;
|
||||
}
|
||||
|
||||
public function get animId() : int
|
||||
{
|
||||
return _layerAnim.animId;
|
||||
}
|
||||
|
||||
protected function avatarChanged(param1:AvatarEvent) : void
|
||||
{
|
||||
if(_layerAnim)
|
||||
{
|
||||
if(_layerAnim.avDefId != _avatar.avTypeId)
|
||||
{
|
||||
_layerAnim.avDefId = _avatar.avTypeId;
|
||||
if(avTypeChangedCallback != null)
|
||||
{
|
||||
avTypeChangedCallback(this);
|
||||
}
|
||||
}
|
||||
_layerAnim.layers = setLayerHelper();
|
||||
}
|
||||
}
|
||||
|
||||
protected function setLayerHelper() : Array
|
||||
{
|
||||
var _loc3_:AvatarInfo = null;
|
||||
var _loc1_:Array = null;
|
||||
var _loc2_:Array = null;
|
||||
if(_avatar.inventoryBodyMod && _avatar.inventoryBodyMod.itemArray && _avatar.inventoryBodyMod.itemArray.length >= 1)
|
||||
{
|
||||
_loc2_ = _avatar.inventoryBodyMod.itemArray.concat(_avatar.inventoryClothing.itemArray.concat());
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = gMainFrame.userInfo.getAvatarInfoByUsernamePerUserAvId(_avatar.userName,_avatar.perUserAvId);
|
||||
if(_loc3_)
|
||||
{
|
||||
_loc1_ = _loc3_.getItems(true);
|
||||
if(_loc1_)
|
||||
{
|
||||
_loc2_ = _loc1_;
|
||||
}
|
||||
}
|
||||
}
|
||||
return AvatarUtility.layerArrayForItemsAndColors(_loc2_,_avatar.colors,_avatar.perUserAvId);
|
||||
}
|
||||
|
||||
public function playAnim(param1:int, param2:Boolean = false, param3:int = 0, param4:Function = null) : void
|
||||
{
|
||||
var _loc12_:Boolean = false;
|
||||
var _loc14_:Array = null;
|
||||
var _loc11_:int = 0;
|
||||
var _loc9_:int = 0;
|
||||
var _loc8_:Array = null;
|
||||
var _loc5_:Array = null;
|
||||
var _loc13_:Object = null;
|
||||
var _loc7_:Array = null;
|
||||
var _loc10_:* = 0;
|
||||
if(_layerAnim && _layerAnim.visible && (_holdAnimId == 0 || param1 == _holdAnimId))
|
||||
{
|
||||
if(!_isOffScreen)
|
||||
{
|
||||
_loc12_ = false;
|
||||
_loc14_ = _avatar.accShownItems;
|
||||
if(!_layerAnim.layers)
|
||||
{
|
||||
_loc12_ = true;
|
||||
}
|
||||
else if(_layerAnim.layers.length != _loc14_.length)
|
||||
{
|
||||
_loc12_ = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc11_ = int(_loc14_.length);
|
||||
_loc9_ = 0;
|
||||
while(_loc9_ < _loc11_)
|
||||
{
|
||||
if(_layerAnim.layers.indexOf(_loc14_[_loc9_].accId) == -1)
|
||||
{
|
||||
_loc12_ = true;
|
||||
break;
|
||||
}
|
||||
_loc9_++;
|
||||
}
|
||||
}
|
||||
if(_loc12_)
|
||||
{
|
||||
_loc8_ = [];
|
||||
_loc5_ = _loc14_;
|
||||
_loc7_ = _avatar.colors;
|
||||
for each(var _loc6_:Item in _loc5_)
|
||||
{
|
||||
if(_loc6_.getInUse(_avatar.perUserAvId))
|
||||
{
|
||||
if(_loc6_.layerId == 1)
|
||||
{
|
||||
_loc10_ = uint(_loc7_[0]);
|
||||
}
|
||||
else if(_loc6_.layerId == 2)
|
||||
{
|
||||
_loc10_ = uint(_loc7_[1]);
|
||||
}
|
||||
else if(_loc6_.layerId == 3)
|
||||
{
|
||||
_loc10_ = uint(_loc7_[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc10_ = _loc6_.color;
|
||||
}
|
||||
_loc13_ = {
|
||||
"l":_loc6_.accId,
|
||||
"c":_loc10_
|
||||
};
|
||||
_loc8_.push(_loc13_);
|
||||
}
|
||||
}
|
||||
_layerAnim.layers = _loc8_;
|
||||
}
|
||||
_layerAnim.hFlip = param2;
|
||||
_layerAnim.playAnim(param1,param3,param4);
|
||||
}
|
||||
else
|
||||
{
|
||||
_lastAnimToHappen = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function reloadItemsFromCache() : void
|
||||
{
|
||||
var _loc1_:Array = gMainFrame.userInfo.getAvatarInfoByUsernamePerUserAvId(_avatar.userName,_avatar.perUserAvId).getItems(true);
|
||||
_avatar.itemResponseIntegrate(_loc1_);
|
||||
}
|
||||
|
||||
public function preloadAnims(param1:Array, param2:Function = null) : void
|
||||
{
|
||||
_layerAnim.preload(param1,param2);
|
||||
}
|
||||
|
||||
public function blackOut() : void
|
||||
{
|
||||
var _loc1_:Array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0];
|
||||
_layerAnim.bitmap.filters = [new ColorMatrixFilter(_loc1_)];
|
||||
}
|
||||
|
||||
public function get avatarData() : Avatar
|
||||
{
|
||||
return _avatar;
|
||||
}
|
||||
|
||||
public function get userName() : String
|
||||
{
|
||||
if(_avatar != null)
|
||||
{
|
||||
return _avatar.userName;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get userId() : int
|
||||
{
|
||||
if(_avatar == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return _avatar.sfsUserId;
|
||||
}
|
||||
|
||||
public function get avTypeId() : int
|
||||
{
|
||||
return _avatar.avTypeId;
|
||||
}
|
||||
|
||||
public function get customAvId() : int
|
||||
{
|
||||
return _avatar.customAvId;
|
||||
}
|
||||
|
||||
public function get perUserAvId() : int
|
||||
{
|
||||
return _avatar.perUserAvId;
|
||||
}
|
||||
|
||||
public function get inventoryBodyModItems() : Array
|
||||
{
|
||||
return _avatar.inventoryBodyMod.itemArray;
|
||||
}
|
||||
|
||||
public function get inventoryClothingItems() : Array
|
||||
{
|
||||
return _avatar.inventoryClothing.itemArray;
|
||||
}
|
||||
|
||||
public function setAvtColors(param1:Array) : void
|
||||
{
|
||||
_avatar.colors = param1;
|
||||
}
|
||||
|
||||
public function get avName() : String
|
||||
{
|
||||
return _avatar.avName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
package avatar
|
||||
{
|
||||
import flash.display.Bitmap;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Loader;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Shape;
|
||||
import flash.display.Sprite;
|
||||
import flash.geom.Matrix;
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
public class AvatarViewExt_Splash
|
||||
{
|
||||
|
||||
private static const SHADOW_X_OFFSET:int = -100;
|
||||
|
||||
private static const SHADOW_Y_OFFSET:int = -20;
|
||||
|
||||
private static const Shadow:Class = Shadow_png;
|
||||
|
||||
private static const WaterSplashSWF:Class = WaterSplash_swf;
|
||||
|
||||
private const _constSplash:ByteArray = new WaterSplashSWF();
|
||||
|
||||
private var _mask:Shape;
|
||||
|
||||
private var _shadow:Bitmap;
|
||||
|
||||
private var _splash:Loader;
|
||||
|
||||
private var _parent:Sprite;
|
||||
|
||||
private var _maskLayer:DisplayObject;
|
||||
|
||||
private var _bLastSplashVolume:Boolean;
|
||||
|
||||
private var _bSplashInProgress:Boolean;
|
||||
|
||||
private var _lastSplashLiquid:String;
|
||||
|
||||
private var _shadowChildIndex:int;
|
||||
|
||||
public function AvatarViewExt_Splash(param1:Sprite, param2:DisplayObject)
|
||||
{
|
||||
super();
|
||||
_parent = param1;
|
||||
_bSplashInProgress = false;
|
||||
_bLastSplashVolume = false;
|
||||
createShadow();
|
||||
createMask(param2);
|
||||
_parent.addChild(param2);
|
||||
createSplash();
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
if(_shadow && _shadow.parent != null)
|
||||
{
|
||||
_shadow.parent.removeChild(_shadow);
|
||||
_shadow = null;
|
||||
}
|
||||
if(_splash)
|
||||
{
|
||||
_parent.removeChild(_splash);
|
||||
_splash.unloadAndStop();
|
||||
_splash = null;
|
||||
}
|
||||
if(_mask)
|
||||
{
|
||||
_parent.removeChild(_mask);
|
||||
_mask = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function showShadow(param1:Boolean = true) : void
|
||||
{
|
||||
_shadow.visible = param1;
|
||||
}
|
||||
|
||||
private function createShadow() : void
|
||||
{
|
||||
_shadow = new Shadow();
|
||||
_shadow.x = -100;
|
||||
_shadow.y = -20;
|
||||
_parent.addChild(_shadow);
|
||||
}
|
||||
|
||||
private function createMask(param1:DisplayObject) : void
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc3_:Number = NaN;
|
||||
_maskLayer = param1;
|
||||
_mask = new Shape();
|
||||
_parent.addChild(_mask);
|
||||
_mask.graphics.lineStyle();
|
||||
_mask.graphics.beginFill(16777215,1);
|
||||
_loc3_ = -150;
|
||||
_loc2_ = -275;
|
||||
_mask.graphics.moveTo(_loc3_,_loc2_);
|
||||
_mask.graphics.lineTo(_loc3_ + 245,_loc2_);
|
||||
_mask.graphics.lineTo(_loc3_ + 245,_loc2_ + 235);
|
||||
_mask.graphics.curveTo(_loc3_ + 122.5,_loc2_ + 260,_loc3_,_loc2_ + 235);
|
||||
_mask.graphics.lineTo(_loc3_,_loc2_);
|
||||
_mask.graphics.endFill();
|
||||
_maskLayer.mask = null;
|
||||
_mask.visible = false;
|
||||
}
|
||||
|
||||
private function createSplash() : void
|
||||
{
|
||||
_splash = new Loader();
|
||||
_splash.loadBytes(_constSplash);
|
||||
_splash.x = -18;
|
||||
_splash.y = -28;
|
||||
_parent.addChild(_splash);
|
||||
_splash.visible = false;
|
||||
}
|
||||
|
||||
public function flipSplash(param1:Boolean) : void
|
||||
{
|
||||
var _loc2_:Matrix = _shadow.transform.matrix;
|
||||
if(param1)
|
||||
{
|
||||
if(_loc2_.a != -1)
|
||||
{
|
||||
_loc2_.scale(-1,1);
|
||||
_shadow.transform.matrix = _loc2_;
|
||||
_loc2_ = _splash.content.transform.matrix;
|
||||
_loc2_.scale(-1,1);
|
||||
_splash.content.transform.matrix = _loc2_;
|
||||
}
|
||||
}
|
||||
else if(_loc2_.a == -1)
|
||||
{
|
||||
_loc2_.scale(-1,1);
|
||||
_shadow.transform.matrix = _loc2_;
|
||||
_loc2_ = _splash.content.transform.matrix;
|
||||
_loc2_.scale(-1,1);
|
||||
_splash.content.transform.matrix = _loc2_;
|
||||
}
|
||||
}
|
||||
|
||||
public function heartbeat(param1:Boolean, param2:Boolean, param3:String, param4:Boolean) : void
|
||||
{
|
||||
if(_shadow)
|
||||
{
|
||||
if(param4)
|
||||
{
|
||||
if(_shadow.parent != null)
|
||||
{
|
||||
_shadowChildIndex = _shadow.parent.getChildIndex(_shadow);
|
||||
_shadow.parent.removeChild(_shadow);
|
||||
}
|
||||
}
|
||||
else if(_shadow.parent == null)
|
||||
{
|
||||
_parent.addChildAt(_shadow,_shadowChildIndex);
|
||||
}
|
||||
}
|
||||
var _loc5_:MovieClip = MovieClip(_splash.content);
|
||||
if(_loc5_)
|
||||
{
|
||||
if(param3 == "ice" || param3 == "fire" || param3 == "ghost")
|
||||
{
|
||||
param1 = false;
|
||||
}
|
||||
if(param1)
|
||||
{
|
||||
_loc5_.setState(param2 ? 1 : 2);
|
||||
}
|
||||
else if(_loc5_.currentFrame == 1 && _splash.visible == true)
|
||||
{
|
||||
_splash.visible = false;
|
||||
}
|
||||
if(param1 != _bLastSplashVolume || param3 != _lastSplashLiquid)
|
||||
{
|
||||
_loc5_.setLiquid(param3);
|
||||
_bLastSplashVolume = param1;
|
||||
_lastSplashLiquid = param3;
|
||||
showMask(param3 == "fallleaves" ? false : param1);
|
||||
if(param1)
|
||||
{
|
||||
if(_splash.visible == false)
|
||||
{
|
||||
_splash.visible = true;
|
||||
}
|
||||
_loc5_.setState(param2 ? 1 : 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_.setState(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function showMask(param1:Boolean = true) : void
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
_maskLayer.mask = _mask;
|
||||
showShadow(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_maskLayer.mask = null;
|
||||
showShadow(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,906 @@
|
||||
package avatar
|
||||
{
|
||||
import com.sbi.client.SFEvent;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import flash.geom.Point;
|
||||
import flash.utils.Dictionary;
|
||||
import gui.GuiManager;
|
||||
import item.Item;
|
||||
import item.ItemXtCommManager;
|
||||
import loader.DefPacksDefHelper;
|
||||
import pet.PetManager;
|
||||
|
||||
public class AvatarXtCommManager
|
||||
{
|
||||
|
||||
public static var avSlotInfo:Object;
|
||||
|
||||
private static var _adAvatarQueue:Array;
|
||||
|
||||
private static var _agQueue:Dictionary;
|
||||
|
||||
private static var _agsQueue:Dictionary;
|
||||
|
||||
private static var _avatarCreateResponse:Function;
|
||||
|
||||
private static var _avatarUpdateResponse:Function;
|
||||
|
||||
private static var _avatarPaintResponse:Function;
|
||||
|
||||
private static var _avatarRemoveResponse:Function;
|
||||
|
||||
private static var _avatarListResponse:Function;
|
||||
|
||||
private static var _getAvatarByUsername:Function;
|
||||
|
||||
private static var _buddyCardUpdateDropDownHandler:Function;
|
||||
|
||||
private static var _avatarInfoCallback:Function;
|
||||
|
||||
private static var _abCallback:Function;
|
||||
|
||||
private static var _asCallback:Function;
|
||||
|
||||
private static var _aaCallback:Function;
|
||||
|
||||
private static var _alCallback:Function;
|
||||
|
||||
private static var _handleCreateAvatarData:Function;
|
||||
|
||||
private static var _akCallback:Function;
|
||||
|
||||
private static var _aoCallback:Function;
|
||||
|
||||
private static var _photoTakeCallback:Function;
|
||||
|
||||
private static var _afpCallback:Function;
|
||||
|
||||
private static var _avatarsInRoom:Object;
|
||||
|
||||
public function AvatarXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init(param1:Function = null, param2:Function = null, param3:Function = null, param4:Function = null, param5:Function = null, param6:Object = null, param7:Function = null, param8:Function = null, param9:Function = null) : void
|
||||
{
|
||||
_avatarCreateResponse = param1;
|
||||
_avatarUpdateResponse = param2;
|
||||
_avatarPaintResponse = param3;
|
||||
_avatarRemoveResponse = param4;
|
||||
_avatarListResponse = param5;
|
||||
_getAvatarByUsername = param7;
|
||||
_asCallback = param8;
|
||||
_buddyCardUpdateDropDownHandler = param9;
|
||||
_adAvatarQueue = [];
|
||||
avSlotInfo = {};
|
||||
_agQueue = new Dictionary(false);
|
||||
_agsQueue = new Dictionary(false);
|
||||
_avatarsInRoom = param6;
|
||||
XtReplyDemuxer.addModule(handleXtReply,"a");
|
||||
}
|
||||
|
||||
public static function destroy() : void
|
||||
{
|
||||
_adAvatarQueue = null;
|
||||
XtReplyDemuxer.removeModule(handleXtReply);
|
||||
}
|
||||
|
||||
public static function requestAvatarMake(param1:Function) : void
|
||||
{
|
||||
_handleCreateAvatarData = param1;
|
||||
gMainFrame.server.setXtObject_Str("am",[],gMainFrame.server.isWorldZone);
|
||||
}
|
||||
|
||||
public static function requestAvatarInfo(param1:Function) : void
|
||||
{
|
||||
var _loc2_:DefPacksDefHelper = null;
|
||||
_avatarInfoCallback = param1;
|
||||
if(gMainFrame.userInfo.avtDefsCached)
|
||||
{
|
||||
if(_avatarInfoCallback != null)
|
||||
{
|
||||
_avatarInfoCallback();
|
||||
_avatarInfoCallback = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = new DefPacksDefHelper();
|
||||
_loc2_.init(1003,avatarInfoResponse,null,2);
|
||||
DefPacksDefHelper.mediaArray[1003] = _loc2_;
|
||||
}
|
||||
}
|
||||
|
||||
public static function requestADForAvatar(param1:int, param2:Boolean, param3:Function, param4:Avatar) : void
|
||||
{
|
||||
_adAvatarQueue.push({
|
||||
"a":param4,
|
||||
"c":(param2 ? null : param3)
|
||||
});
|
||||
var _loc6_:Boolean = gMainFrame.userInfo.myUserName.toLowerCase() == param4.userName.toLowerCase() ? ItemXtCommManager.hasRequestedFullItemList : true;
|
||||
var _loc5_:AvatarInfo = gMainFrame.userInfo.getAvatarInfoByUsernamePerUserAvId(param4.userName,param1);
|
||||
if(_loc5_ && _loc5_.type != -1)
|
||||
{
|
||||
avatarDataResponseIntegrate([_loc5_.perUserAvId,_loc5_.avName,_loc5_.userName,_loc5_.uuid,_loc5_.type,_loc5_.customAvId,_loc5_.colors[0],_loc5_.colors[1],_loc5_.colors[2]]);
|
||||
if(param2)
|
||||
{
|
||||
if(param4 == null)
|
||||
{
|
||||
throw new Error("requestAvatarData got requestItemList=true but getAvDataAvatar=null!");
|
||||
}
|
||||
if(param4.userName != gMainFrame.userInfo.myUserName)
|
||||
{
|
||||
ItemXtCommManager.requestItemListForAvatar(param3,param4,!_loc6_);
|
||||
}
|
||||
else
|
||||
{
|
||||
param3();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
ItemXtCommManager.insertIntoILAvatarQueue(param1,param3,param4);
|
||||
}
|
||||
sendAvatarDataRequest([param4.userName,param1,param2 ? (_loc6_ ? "2" : "1") : "0"]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function requestAvatarList(param1:Array, param2:Function = null) : void
|
||||
{
|
||||
_alCallback = param2;
|
||||
gMainFrame.server.setXtObject_Str("al",param1,gMainFrame.server.isWorldZone);
|
||||
}
|
||||
|
||||
public static function requestAvatarBuy(param1:Function) : void
|
||||
{
|
||||
_abCallback = param1;
|
||||
gMainFrame.server.setXtObject_Str("ab",[]);
|
||||
}
|
||||
|
||||
public static function requestAvatarSwitch(param1:Array) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("as",param1);
|
||||
}
|
||||
|
||||
public static function requestAvatarAdd(param1:Array, param2:Function) : void
|
||||
{
|
||||
_aaCallback = param2;
|
||||
gMainFrame.server.setXtObject_Str("aa",param1,gMainFrame.server.isWorldZone);
|
||||
}
|
||||
|
||||
public static function requestAvatarKill(param1:Array, param2:Function) : void
|
||||
{
|
||||
_akCallback = param2;
|
||||
gMainFrame.server.setXtObject_Str("ak",param1);
|
||||
}
|
||||
|
||||
public static function requestAvatarOrdain(param1:Array, param2:Function) : void
|
||||
{
|
||||
_aoCallback = param2;
|
||||
gMainFrame.server.setXtObject_Str("ao",param1);
|
||||
}
|
||||
|
||||
public static function requestAvatarGet(param1:String, param2:Function, param3:Boolean = false) : void
|
||||
{
|
||||
_agQueue[param1.toLowerCase()] = param2;
|
||||
gMainFrame.server.setXtObject_Str("ag",[param1,param3 ? "1" : "0"]);
|
||||
}
|
||||
|
||||
public static function requestAvatarGetBySfsId(param1:int, param2:Function) : void
|
||||
{
|
||||
_agsQueue[param1] = param2;
|
||||
gMainFrame.server.setXtObject_Str("ags",[param1,"0"]);
|
||||
}
|
||||
|
||||
public static function requestColorChange(param1:Array, param2:int, param3:Function = null) : void
|
||||
{
|
||||
if(param3 != null)
|
||||
{
|
||||
_avatarPaintResponse = param3;
|
||||
}
|
||||
gMainFrame.server.setXtObject_Str("ap",[param1[0],param1[1],param1[2],param2],gMainFrame.server.isWorldZone);
|
||||
}
|
||||
|
||||
public static function sendAvatarPendingFlagsUpdate(param1:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("af",[param1]);
|
||||
gMainFrame.userInfo.pendingFlags |= 1 << param1;
|
||||
}
|
||||
|
||||
public static function sendAvatarPhotoTakeCheck(param1:Function) : void
|
||||
{
|
||||
_photoTakeCallback = param1;
|
||||
gMainFrame.server.setXtObject_Str("apc",[]);
|
||||
}
|
||||
|
||||
public static function sendAvatarPhotoTake(param1:Function) : void
|
||||
{
|
||||
_photoTakeCallback = param1;
|
||||
gMainFrame.server.setXtObject_Str("apb",[]);
|
||||
}
|
||||
|
||||
public static function requestAvatarFastPassAdd(param1:Array, param2:Function) : void
|
||||
{
|
||||
_afpCallback = param2;
|
||||
gMainFrame.server.setXtObject_Str("afp",param1,gMainFrame.server.isWorldZone);
|
||||
}
|
||||
|
||||
private static function sendAvatarDataRequest(param1:Array) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("ad",param1,gMainFrame.server.isWorldZone);
|
||||
}
|
||||
|
||||
public static function handleXtReply(param1:SFEvent) : void
|
||||
{
|
||||
if(!param1.status)
|
||||
{
|
||||
DebugUtility.debugTrace("ERROR: AvatarXtCommManager handleXtReply was called with bad evt.status:" + param1.status);
|
||||
return;
|
||||
}
|
||||
var _loc2_:Array = param1.obj;
|
||||
switch(_loc2_[0])
|
||||
{
|
||||
case "au":
|
||||
if(_avatarUpdateResponse != null)
|
||||
{
|
||||
_avatarUpdateResponse(_loc2_);
|
||||
}
|
||||
break;
|
||||
case "ad":
|
||||
avatarDataResponse(_loc2_);
|
||||
break;
|
||||
case "ac":
|
||||
if(_avatarCreateResponse != null)
|
||||
{
|
||||
_avatarCreateResponse(_loc2_);
|
||||
}
|
||||
break;
|
||||
case "ap":
|
||||
if(_avatarPaintResponse != null)
|
||||
{
|
||||
_avatarPaintResponse(_loc2_);
|
||||
}
|
||||
break;
|
||||
case "ag":
|
||||
avatarGetResponse(_loc2_);
|
||||
break;
|
||||
case "ar":
|
||||
if(_avatarRemoveResponse != null)
|
||||
{
|
||||
_avatarRemoveResponse(_loc2_);
|
||||
}
|
||||
break;
|
||||
case "al":
|
||||
avatarListResponse(_loc2_);
|
||||
break;
|
||||
case "ab":
|
||||
avatarBuyResponse(_loc2_);
|
||||
break;
|
||||
case "as":
|
||||
avatarSwitchResponse(_loc2_);
|
||||
break;
|
||||
case "aa":
|
||||
avatarAddResponse(_loc2_);
|
||||
break;
|
||||
case "ak":
|
||||
avatarKillResponse(_loc2_);
|
||||
break;
|
||||
case "am":
|
||||
_handleCreateAvatarData(_loc2_);
|
||||
break;
|
||||
case "ao":
|
||||
avatarOrdainResponse(_loc2_);
|
||||
break;
|
||||
case "apb":
|
||||
case "apc":
|
||||
if(_photoTakeCallback != null)
|
||||
{
|
||||
_photoTakeCallback(_loc2_);
|
||||
_photoTakeCallback = null;
|
||||
}
|
||||
break;
|
||||
case "afp":
|
||||
avatarFastPassResponse(_loc2_);
|
||||
break;
|
||||
case "an":
|
||||
avatarNamebarUpdateResponse(_loc2_);
|
||||
break;
|
||||
default:
|
||||
throw new Error("AvatarXtCommManager illegal data:" + _loc2_[0]);
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarInfoResponse(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
DefPacksDefHelper.mediaArray[1003] = null;
|
||||
var _loc6_:Object = param1.def;
|
||||
var _loc4_:Object = {};
|
||||
var _loc7_:Array = [];
|
||||
for each(var _loc2_:Object in _loc6_)
|
||||
{
|
||||
_loc7_[int(_loc2_.id)] = new Point(_loc2_.x,_loc2_.y);
|
||||
_loc4_[int(_loc2_.id)] = {
|
||||
"colorLayer1":uint(_loc2_.colorLayer1),
|
||||
"colorLayer2":uint(_loc2_.colorLayer2),
|
||||
"colorLayer3":uint(_loc2_.colorLayer3),
|
||||
"defPattern":int(_loc2_.basePatternId),
|
||||
"defEyes":int(_loc2_.baseEyesId),
|
||||
"isMemOnly":_loc2_.membersOnly == "1",
|
||||
"enviroTypeFlag":int(_loc2_.enviroTypeFlags),
|
||||
"cost":int(_loc2_.cost),
|
||||
"titleStrRef":int(_loc2_.titleStrRef),
|
||||
"availability":int(_loc2_.availability),
|
||||
"attackItemRefId":int(_loc2_.attackItemRefId),
|
||||
"iconMediaId":int(_loc2_.iconMediaRefId),
|
||||
"status":int(_loc2_.status)
|
||||
};
|
||||
}
|
||||
if(!gMainFrame.userInfo.avtDefsCached)
|
||||
{
|
||||
gMainFrame.setAvatarOffsets(_loc7_);
|
||||
gMainFrame.userInfo.setAvatarDefs(_loc4_);
|
||||
}
|
||||
var _loc5_:DefPacksDefHelper = new DefPacksDefHelper();
|
||||
_loc5_.init(1057,customAvatarDefPacksResponse,null,2);
|
||||
DefPacksDefHelper.mediaArray[1057] = _loc5_;
|
||||
}
|
||||
|
||||
private static function customAvatarDefPacksResponse(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
DefPacksDefHelper.mediaArray[1057] = null;
|
||||
var _loc5_:Object = param1.def;
|
||||
var _loc3_:Object = {};
|
||||
for each(var _loc6_:Object in _loc5_)
|
||||
{
|
||||
if(_loc6_.avatarIconRefId != "0")
|
||||
{
|
||||
_loc3_[int(_loc6_.id)] = {
|
||||
"id":int(_loc6_.id),
|
||||
"avatarRefId":int(_loc6_.avatarRef),
|
||||
"iconRefId":int(_loc6_.iconRefId),
|
||||
"particleRefId":int(_loc6_.particleRefId),
|
||||
"patternRefId":int(_loc6_.patternRefId),
|
||||
"titleStrRef":int(_loc6_.titleStrRef),
|
||||
"iconMediaId":int(_loc6_.avatarIconRefId)
|
||||
};
|
||||
}
|
||||
}
|
||||
gMainFrame.userInfo.setCustomAvatarDefs(_loc3_);
|
||||
var _loc4_:DefPacksDefHelper = new DefPacksDefHelper();
|
||||
_loc4_.init(1027,liDefPacksResponse,null,2);
|
||||
DefPacksDefHelper.mediaArray[1027] = _loc4_;
|
||||
}
|
||||
|
||||
private static function liDefPacksResponse(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
DefPacksDefHelper.mediaArray[1027] = null;
|
||||
var _loc3_:Object = param1.def;
|
||||
var _loc4_:Object = {};
|
||||
for each(var _loc2_:Object in _loc3_)
|
||||
{
|
||||
_loc4_[int(_loc2_.id)] = int(_loc2_.layerId);
|
||||
}
|
||||
gMainFrame.layerInfo = _loc4_;
|
||||
if(_avatarInfoCallback != null)
|
||||
{
|
||||
_avatarInfoCallback();
|
||||
_avatarInfoCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarDataResponse(param1:Array) : void
|
||||
{
|
||||
var _loc12_:Boolean = false;
|
||||
var _loc5_:int = 0;
|
||||
var _loc3_:int = 0;
|
||||
var _loc35_:int = 0;
|
||||
var _loc16_:int = 0;
|
||||
var _loc17_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
var _loc29_:int = 0;
|
||||
var _loc28_:int = 0;
|
||||
var _loc7_:AvatarInfo = null;
|
||||
var _loc26_:UserInfo = null;
|
||||
var _loc10_:Array = null;
|
||||
var _loc8_:int = 2;
|
||||
var _loc34_:String = param1[_loc8_++];
|
||||
var _loc23_:String = param1[_loc8_++];
|
||||
var _loc22_:int = int(param1[_loc8_++]);
|
||||
var _loc37_:int = int(param1[_loc8_++]);
|
||||
var _loc24_:int = int(param1[_loc8_++]);
|
||||
var _loc27_:int = int(param1[_loc8_++]);
|
||||
var _loc4_:int = int(param1[_loc8_++]);
|
||||
var _loc18_:int = int(param1[_loc8_++]);
|
||||
var _loc21_:int = int(param1[_loc8_++]);
|
||||
var _loc33_:uint = uint(param1[_loc8_++]);
|
||||
var _loc31_:uint = uint(param1[_loc8_++]);
|
||||
var _loc32_:uint = uint(param1[_loc8_++]);
|
||||
var _loc13_:String = param1[_loc8_++];
|
||||
var _loc25_:int = int(param1[_loc8_++]);
|
||||
var _loc20_:int = -1;
|
||||
var _loc30_:int = 0;
|
||||
var _loc36_:int = 0;
|
||||
var _loc15_:int = 0;
|
||||
var _loc14_:int = 0;
|
||||
var _loc9_:String = "";
|
||||
if(_loc34_.toLowerCase() == gMainFrame.userInfo.myUserName.toLowerCase())
|
||||
{
|
||||
_loc12_ = true;
|
||||
_loc20_ = int(param1[_loc8_++]);
|
||||
_loc30_ = int(param1[_loc8_++]);
|
||||
_loc36_ = int(param1[_loc8_++]);
|
||||
_loc5_ = int(param1[_loc8_++]);
|
||||
_loc3_ = int(param1[_loc8_++]);
|
||||
_loc35_ = int(param1[_loc8_++]);
|
||||
_loc16_ = int(param1[_loc8_++]);
|
||||
_loc17_ = int(param1[_loc8_++]);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = int(param1[_loc8_++]);
|
||||
_loc29_ = int(param1[_loc8_++]);
|
||||
_loc28_ = int(param1[_loc8_++]);
|
||||
_loc9_ = param1[_loc8_++];
|
||||
}
|
||||
var _loc19_:UserInfo = gMainFrame.userInfo.getUserInfoByUserName(_loc34_);
|
||||
if(_loc19_)
|
||||
{
|
||||
for each(var _loc6_:AvatarInfo in _loc19_.avList)
|
||||
{
|
||||
if(_loc6_.perUserAvId == _loc4_)
|
||||
{
|
||||
_loc7_ = _loc6_;
|
||||
break;
|
||||
}
|
||||
}
|
||||
_loc19_.uuid = _loc23_;
|
||||
_loc19_.nameBarData = _loc22_;
|
||||
_loc19_.userNameModeratedFlag = _loc24_;
|
||||
_loc19_.timeLeftHostingCustomParty = _loc27_;
|
||||
}
|
||||
var _loc11_:Object = {
|
||||
"name":_loc9_,
|
||||
"lBits":_loc2_,
|
||||
"uBits":_loc29_,
|
||||
"eBits":_loc28_
|
||||
};
|
||||
_loc11_.defId = PetManager.getDefIdFromLBits(_loc11_.lBits);
|
||||
_loc11_.type = PetManager.petTypeForDefId(_loc11_.defId);
|
||||
_loc11_.isGround = PetManager.isGround(_loc11_.type);
|
||||
if(_loc7_)
|
||||
{
|
||||
_loc7_.avName = _loc13_;
|
||||
_loc7_.userName = _loc34_;
|
||||
_loc7_.uuid = _loc23_;
|
||||
_loc7_.type = _loc18_;
|
||||
_loc7_.colors = [_loc33_,_loc31_,_loc32_];
|
||||
_loc7_.currEnviroType = _loc37_;
|
||||
_loc7_.questLevel = _loc25_;
|
||||
_loc7_.currPet = _loc11_;
|
||||
_loc7_.customAvId = _loc21_;
|
||||
if(_loc12_)
|
||||
{
|
||||
if(_loc20_ >= 0)
|
||||
{
|
||||
avSlotInfo[_loc7_.perUserAvId].avInvId = _loc20_;
|
||||
}
|
||||
_loc7_.landPetInvId = _loc30_;
|
||||
_loc7_.oceanPetInvId = _loc36_;
|
||||
_loc7_.questXp = _loc15_;
|
||||
_loc7_.healthBase = _loc17_;
|
||||
_loc7_.attackBase = _loc5_;
|
||||
_loc7_.attackMax = _loc3_;
|
||||
_loc7_.defenseBase = _loc35_;
|
||||
_loc7_.defenseMax = _loc16_;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc7_ = new AvatarInfo();
|
||||
_loc7_.init(_loc4_,_loc13_,_loc34_,_loc23_,_loc18_,[_loc33_,_loc31_,_loc32_],0,_loc11_,_loc21_);
|
||||
_loc7_.questLevel = _loc25_;
|
||||
if(_loc12_)
|
||||
{
|
||||
if(_loc20_ >= 0)
|
||||
{
|
||||
avSlotInfo[_loc7_.perUserAvId] = {
|
||||
"slotId":-1,
|
||||
"avInvId":_loc20_
|
||||
};
|
||||
}
|
||||
_loc7_.landPetInvId = _loc30_;
|
||||
_loc7_.oceanPetInvId = _loc36_;
|
||||
_loc7_.questXp = _loc15_;
|
||||
_loc7_.healthBase = _loc17_;
|
||||
_loc7_.attackBase = _loc5_;
|
||||
_loc7_.attackMax = _loc3_;
|
||||
_loc7_.defenseBase = _loc35_;
|
||||
_loc7_.defenseMax = _loc16_;
|
||||
}
|
||||
if(_loc19_)
|
||||
{
|
||||
_loc19_.addAvatarToList(_loc7_);
|
||||
_loc19_.uuid = _loc23_;
|
||||
_loc19_.nameBarData = _loc22_;
|
||||
_loc19_.userNameModeratedFlag = _loc24_;
|
||||
_loc19_.timeLeftHostingCustomParty = _loc27_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc26_ = new UserInfo();
|
||||
_loc10_ = [];
|
||||
_loc10_[_loc7_.perUserAvId] = _loc7_;
|
||||
_loc26_.init(_loc34_,_loc23_,_loc10_,_loc7_.perUserAvId,1,_loc24_,_loc27_);
|
||||
_loc26_.nameBarData = _loc22_;
|
||||
gMainFrame.userInfo.setUserInfoByUserName(_loc34_,_loc26_);
|
||||
}
|
||||
}
|
||||
avatarDataResponseIntegrate([_loc4_,_loc13_,_loc34_,_loc23_,_loc18_,_loc21_,_loc33_,_loc31_,_loc32_]);
|
||||
}
|
||||
|
||||
private static function avatarDataResponseIntegrate(param1:Array) : void
|
||||
{
|
||||
var _loc3_:Boolean = false;
|
||||
var _loc8_:int = 0;
|
||||
var _loc7_:String = null;
|
||||
var _loc2_:Avatar = null;
|
||||
var _loc5_:int = 0;
|
||||
var _loc4_:Avatar = null;
|
||||
var _loc6_:Function = null;
|
||||
if(_adAvatarQueue && _adAvatarQueue.length > 0)
|
||||
{
|
||||
_loc8_ = 0;
|
||||
while(_loc8_ < _adAvatarQueue.length)
|
||||
{
|
||||
if(_adAvatarQueue[_loc8_].a.perUserAvId == param1[0])
|
||||
{
|
||||
_loc4_ = _adAvatarQueue[_loc8_].a;
|
||||
_loc6_ = _adAvatarQueue[_loc8_].c;
|
||||
_adAvatarQueue.splice(_loc8_,1);
|
||||
break;
|
||||
}
|
||||
_loc8_++;
|
||||
}
|
||||
}
|
||||
else if(_avatarsInRoom)
|
||||
{
|
||||
_loc7_ = param1[2];
|
||||
if(_getAvatarByUsername != null)
|
||||
{
|
||||
_loc2_ = _getAvatarByUsername(_loc7_);
|
||||
}
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc4_ = _loc2_;
|
||||
_loc3_ = true;
|
||||
}
|
||||
}
|
||||
if(_loc4_)
|
||||
{
|
||||
_loc5_ = 0;
|
||||
_loc4_.perUserAvId = param1[_loc5_++];
|
||||
_loc4_.avName = param1[_loc5_++];
|
||||
_loc4_.userName = param1[_loc5_++];
|
||||
_loc4_.uuid = param1[_loc5_++];
|
||||
_loc4_.avTypeId = int(param1[_loc5_++]);
|
||||
_loc4_.customAvId = int(param1[_loc5_++]);
|
||||
_loc4_.setColors(uint(param1[_loc5_++]),uint(param1[_loc5_++]),uint(param1[_loc5_++]));
|
||||
if(!_loc3_)
|
||||
{
|
||||
if(_loc6_ != null)
|
||||
{
|
||||
_loc6_(true);
|
||||
_loc6_ = null;
|
||||
}
|
||||
}
|
||||
_buddyCardUpdateDropDownHandler(_loc4_.userName);
|
||||
}
|
||||
else if(_loc6_ != null)
|
||||
{
|
||||
DebugUtility.debugTrace("calling loadDataAvatarResult even though dataAvatar was null...");
|
||||
_loc6_(false);
|
||||
_loc6_ = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarGetResponse(param1:Array) : void
|
||||
{
|
||||
var _loc31_:int = 0;
|
||||
var _loc21_:Boolean = false;
|
||||
var _loc28_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
var _loc12_:int = 0;
|
||||
var _loc17_:int = 0;
|
||||
var _loc22_:Array = null;
|
||||
var _loc16_:String = null;
|
||||
var _loc6_:int = 0;
|
||||
var _loc20_:int = 0;
|
||||
var _loc18_:int = 0;
|
||||
var _loc24_:int = 0;
|
||||
var _loc14_:int = 0;
|
||||
var _loc29_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
var _loc25_:int = 0;
|
||||
var _loc26_:int = 0;
|
||||
var _loc8_:String = null;
|
||||
var _loc3_:int = 0;
|
||||
var _loc30_:Array = null;
|
||||
var _loc27_:int = 0;
|
||||
var _loc11_:Item = null;
|
||||
var _loc10_:Object = null;
|
||||
var _loc15_:UserInfo = null;
|
||||
var _loc5_:AvatarInfo = null;
|
||||
var _loc9_:Array = null;
|
||||
var _loc23_:int = 2;
|
||||
var _loc13_:String = param1[_loc23_++];
|
||||
var _loc33_:String = param1[_loc23_++];
|
||||
var _loc19_:int = int(param1[_loc23_++]);
|
||||
var _loc7_:int = _loc19_ == 0 ? 0 : (_loc19_ == 1 ? 1 : (_loc19_ == 2 ? -1 : -2));
|
||||
if(_loc19_ >= 2 && GuiManager.isVersionPopupOpen())
|
||||
{
|
||||
_loc19_ = -2;
|
||||
_loc7_ = -3;
|
||||
}
|
||||
if(_loc19_ == 0 || _loc19_ == 1)
|
||||
{
|
||||
_loc31_ = int(param1[_loc23_++]);
|
||||
_loc21_ = param1[_loc23_++] == "1";
|
||||
_loc28_ = int(param1[_loc23_++]);
|
||||
_loc4_ = int(param1[_loc23_++]);
|
||||
_loc12_ = int(param1[_loc23_++]);
|
||||
_loc17_ = int(param1[_loc23_++]);
|
||||
_loc22_ = new Array(3);
|
||||
_loc22_[0] = uint(param1[_loc23_++]);
|
||||
_loc22_[1] = uint(param1[_loc23_++]);
|
||||
_loc22_[2] = uint(param1[_loc23_++]);
|
||||
_loc16_ = param1[_loc23_++];
|
||||
_loc6_ = int(param1[_loc23_++]);
|
||||
_loc20_ = int(param1[_loc23_++]);
|
||||
_loc18_ = int(param1[_loc23_++]);
|
||||
_loc24_ = int(param1[_loc23_++]);
|
||||
_loc14_ = int(param1[_loc23_++]);
|
||||
_loc29_ = int(param1[_loc23_++]);
|
||||
_loc2_ = int(param1[_loc23_++]);
|
||||
_loc25_ = int(param1[_loc23_++]);
|
||||
_loc26_ = int(param1[_loc23_++]);
|
||||
_loc8_ = param1[_loc23_++];
|
||||
_loc3_ = _loc20_ > 0 ? 3 : 2;
|
||||
_loc30_ = new Array(_loc24_ + _loc3_);
|
||||
_loc27_ = 0;
|
||||
_loc30_[_loc27_++] = ItemXtCommManager.getBodyModFromDefId(1,_loc28_,true);
|
||||
_loc30_[_loc27_++] = ItemXtCommManager.getBodyModFromDefId(_loc6_,_loc28_,true);
|
||||
if(_loc20_ > 0)
|
||||
{
|
||||
_loc30_[_loc27_++] = ItemXtCommManager.getBodyModFromDefId(_loc20_,_loc28_,true);
|
||||
}
|
||||
DebugUtility.debugTrace("avatarGetResponse userName:" + _loc13_ + " numClothingItems:" + _loc24_ + " numBodyModItems:" + _loc3_ + " pattDefId:" + _loc20_);
|
||||
while(_loc27_ < _loc24_ + _loc3_)
|
||||
{
|
||||
_loc11_ = new Item();
|
||||
_loc11_.init(int(param1[_loc23_++]),_loc27_,uint(param1[_loc23_++]));
|
||||
_loc11_.setInUse(_loc28_,true);
|
||||
_loc30_[_loc27_] = _loc11_;
|
||||
_loc27_++;
|
||||
}
|
||||
_loc10_ = {
|
||||
"name":_loc8_,
|
||||
"lBits":_loc2_,
|
||||
"uBits":_loc25_,
|
||||
"eBits":_loc26_
|
||||
};
|
||||
_loc10_.defId = PetManager.getDefIdFromLBits(_loc10_.lBits);
|
||||
_loc10_.type = PetManager.petTypeForDefId(_loc10_.defId);
|
||||
_loc10_.isGround = PetManager.isGround(_loc10_.type);
|
||||
_loc15_ = gMainFrame.userInfo.getUserInfoByUserName(_loc13_);
|
||||
_loc5_ = new AvatarInfo();
|
||||
_loc5_.init(_loc28_,_loc16_,_loc13_,_loc33_,_loc12_,_loc22_,0,_loc10_,_loc17_,0,0,0,_loc18_);
|
||||
if(!_loc15_)
|
||||
{
|
||||
_loc9_ = new Array(1);
|
||||
_loc9_[_loc28_] = _loc5_;
|
||||
_loc15_ = new UserInfo();
|
||||
_loc15_.init(_loc13_,_loc33_,_loc9_,_loc28_,_loc31_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc15_.currPerUserAvId = _loc28_;
|
||||
_loc15_.accountType = _loc31_;
|
||||
_loc15_.addAvatarToList(_loc5_);
|
||||
}
|
||||
_loc15_.userNameModeratedFlag = _loc29_;
|
||||
_loc15_.nameBarData = _loc4_;
|
||||
_loc15_.isGuide = _loc21_;
|
||||
gMainFrame.userInfo.setUserInfoByUserName(_loc13_,_loc15_);
|
||||
}
|
||||
var _loc32_:String = _loc13_.toLowerCase();
|
||||
if(_agQueue[_loc32_])
|
||||
{
|
||||
_agQueue[_loc32_](_loc13_,_loc19_ < 3,_loc7_);
|
||||
delete _agQueue[_loc32_];
|
||||
}
|
||||
if(_agsQueue[_loc14_])
|
||||
{
|
||||
_agsQueue[_loc14_](_loc13_,_loc19_ < 3,_loc7_,_loc14_);
|
||||
delete _agsQueue[_loc14_];
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarListResponse(param1:Array) : void
|
||||
{
|
||||
var _loc16_:String = null;
|
||||
var _loc11_:Boolean = false;
|
||||
var _loc8_:int = 0;
|
||||
var _loc15_:String = null;
|
||||
var _loc14_:int = 0;
|
||||
var _loc9_:Array = null;
|
||||
var _loc13_:int = 0;
|
||||
var _loc18_:UserInfo = null;
|
||||
var _loc6_:int = 0;
|
||||
var _loc10_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
var _loc17_:String = null;
|
||||
var _loc5_:AvatarInfo = null;
|
||||
var _loc7_:UserInfo = null;
|
||||
var _loc12_:int = 2;
|
||||
var _loc3_:int = int(param1[_loc12_++]);
|
||||
var _loc4_:uint = 0;
|
||||
_loc8_ = 0;
|
||||
while(_loc8_ < _loc3_)
|
||||
{
|
||||
_loc15_ = param1[_loc12_++];
|
||||
if(_loc15_.toLowerCase() == gMainFrame.server.userName.toLowerCase())
|
||||
{
|
||||
_loc11_ = true;
|
||||
_loc4_ = uint(param1[_loc12_++]);
|
||||
_loc16_ = param1[_loc12_++];
|
||||
}
|
||||
_loc14_ = int(param1[_loc12_++]);
|
||||
_loc9_ = [];
|
||||
_loc18_ = gMainFrame.userInfo.getUserInfoByUserName(_loc15_);
|
||||
_loc6_ = 0;
|
||||
while(_loc6_ < _loc14_)
|
||||
{
|
||||
_loc10_ = int(param1[_loc12_++]);
|
||||
if(_loc6_ == 0)
|
||||
{
|
||||
_loc13_ = _loc10_;
|
||||
}
|
||||
_loc2_ = int(param1[_loc12_++]);
|
||||
_loc17_ = param1[_loc12_++];
|
||||
if(_loc18_)
|
||||
{
|
||||
_loc5_ = _loc18_.getAvatarInfoByPerUserAvId(_loc10_);
|
||||
if(!_loc5_)
|
||||
{
|
||||
_loc5_ = new AvatarInfo();
|
||||
_loc5_.init(_loc10_,_loc17_,_loc15_);
|
||||
}
|
||||
_loc9_[_loc10_] = _loc5_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_ = new AvatarInfo();
|
||||
_loc5_.init(_loc10_,_loc17_,_loc15_);
|
||||
_loc9_[_loc10_] = _loc5_;
|
||||
}
|
||||
if(_loc11_)
|
||||
{
|
||||
avSlotInfo[_loc10_] = {
|
||||
"slotId":_loc6_,
|
||||
"avInvId":_loc2_
|
||||
};
|
||||
}
|
||||
_loc6_++;
|
||||
}
|
||||
_loc7_ = new UserInfo();
|
||||
if(_loc18_)
|
||||
{
|
||||
_loc18_.avList = _loc9_;
|
||||
_loc18_.currPerUserAvId = _loc13_;
|
||||
_loc18_.uuid = _loc16_;
|
||||
_loc7_ = _loc18_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc7_.init(_loc15_,_loc16_,_loc9_,_loc13_);
|
||||
}
|
||||
gMainFrame.userInfo.setUserInfoByUserName(_loc15_,_loc7_);
|
||||
_loc8_++;
|
||||
}
|
||||
if(_loc15_ != gMainFrame.server.userName)
|
||||
{
|
||||
if(_avatarListResponse != null)
|
||||
{
|
||||
_avatarListResponse();
|
||||
}
|
||||
}
|
||||
if(_alCallback != null)
|
||||
{
|
||||
if(_loc11_)
|
||||
{
|
||||
_alCallback(_loc4_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_alCallback(_loc3_ == -1);
|
||||
}
|
||||
_alCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarBuyResponse(param1:Array) : void
|
||||
{
|
||||
if(_abCallback != null)
|
||||
{
|
||||
_abCallback(Boolean(int(param1[2])));
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarSwitchResponse(param1:Array) : void
|
||||
{
|
||||
if(_asCallback != null)
|
||||
{
|
||||
_asCallback(param1);
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarAddResponse(param1:Array) : void
|
||||
{
|
||||
if(_aaCallback != null)
|
||||
{
|
||||
_aaCallback(int(param1[2]),int(param1[3]),int(param1[4]));
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarKillResponse(param1:Array) : void
|
||||
{
|
||||
if(_akCallback != null)
|
||||
{
|
||||
_akCallback(Boolean(int(param1[2])),int(param1[3]));
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarOrdainResponse(param1:Array) : void
|
||||
{
|
||||
if(_aoCallback != null)
|
||||
{
|
||||
_aoCallback(Boolean(int(param1[2])));
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarFastPassResponse(param1:Array) : void
|
||||
{
|
||||
if(_afpCallback != null)
|
||||
{
|
||||
_afpCallback(Boolean(int(param1[2])));
|
||||
}
|
||||
}
|
||||
|
||||
private static function avatarNamebarUpdateResponse(param1:Array) : void
|
||||
{
|
||||
var _loc3_:int = 2;
|
||||
var _loc5_:int = int(param1[_loc3_++]);
|
||||
var _loc4_:AvatarWorldView = AvatarManager.avatarViewList[_loc5_];
|
||||
if(_loc4_ == null)
|
||||
{
|
||||
DebugUtility.debugTrace("ERROR: invalid avatar worldview when updating namebar data");
|
||||
return;
|
||||
}
|
||||
var _loc2_:UserInfo = gMainFrame.userInfo.getUserInfoByUserName(_loc4_.userName);
|
||||
if(_loc2_ == null)
|
||||
{
|
||||
DebugUtility.debugTrace("ERROR: invalid user info when updating namebar data");
|
||||
return;
|
||||
}
|
||||
_loc2_.nameBarData = int(param1[_loc3_++]);
|
||||
_loc4_.currAvatar.dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package avatar
|
||||
{
|
||||
import flash.display.MovieClip;
|
||||
|
||||
public interface INewAvatar
|
||||
{
|
||||
|
||||
function screenInitCallback(param1:MovieClip) : void;
|
||||
|
||||
function get playSound() : Boolean;
|
||||
|
||||
function newAvatarData(param1:int, param2:String, param3:Array, param4:Function, param5:int = -1, param6:int = -1, param7:Boolean = false) : void;
|
||||
|
||||
function hideConnectingMsg() : void;
|
||||
|
||||
function logInForCreateAvatarData() : void;
|
||||
|
||||
function nameTypeScreenDone() : void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,881 @@
|
||||
package avatar
|
||||
{
|
||||
import com.sbi.graphics.LayerAnim;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.filters.GlowFilter;
|
||||
import flash.geom.Point;
|
||||
import flash.text.TextField;
|
||||
import flash.text.TextFormat;
|
||||
import gskinner.motion.GTween;
|
||||
import gskinner.motion.easing.Linear;
|
||||
import item.Item;
|
||||
import item.ItemXtCommManager;
|
||||
import loader.MediaHelper;
|
||||
import localization.LocalizationManager;
|
||||
import quest.QuestManager;
|
||||
import room.RoomManagerWorld;
|
||||
|
||||
public class NPCView extends Sprite
|
||||
{
|
||||
|
||||
public static const NPC_STATE_LOADING:int = -2;
|
||||
|
||||
public static const NPC_STATE_LOADED:int = -1;
|
||||
|
||||
public static const NPC_STATE_IDLE:int = 0;
|
||||
|
||||
public static const NPC_STATE_MOVE:int = 1;
|
||||
|
||||
public static const NPC_STATE_ATTACK:int = 2;
|
||||
|
||||
public static const NPC_STATE_RECOIL:int = 3;
|
||||
|
||||
public static const NPC_STATE_DEATH:int = 4;
|
||||
|
||||
public static const NPC_STATE_TREASURE_APPEAR:int = 5;
|
||||
|
||||
public static const NPC_STATE_TREASURE_OPEN:int = 6;
|
||||
|
||||
public static const NPC_STATE_TREASURE_DISAPPEAR:int = 7;
|
||||
|
||||
public static const NPC_STATE_DANCE:int = 8;
|
||||
|
||||
private var _npcDef:Object;
|
||||
|
||||
private var _npcMC:MovieClip;
|
||||
|
||||
private var _npcAvatarView:AvatarWorldView;
|
||||
|
||||
private var _playerId:int;
|
||||
|
||||
private var _namebar:NameBar;
|
||||
|
||||
private var _mediaHelperObj:MediaHelper;
|
||||
|
||||
private var _onLoadingCompleteCallback:Function;
|
||||
|
||||
private var _npcState:int;
|
||||
|
||||
private var _npcAngle:int;
|
||||
|
||||
private var _healthBar:MovieClip;
|
||||
|
||||
private var _hitText:TextField;
|
||||
|
||||
private var _hitTextTween:GTween;
|
||||
|
||||
private var _secondaryNpcMC:MovieClip;
|
||||
|
||||
public var _eye:MovieClip;
|
||||
|
||||
public var _beam:MovieClip;
|
||||
|
||||
public var _npcFacingSW:Boolean;
|
||||
|
||||
public function NPCView()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get npcState() : int
|
||||
{
|
||||
return _npcState;
|
||||
}
|
||||
|
||||
public function get npcStateComplete() : Boolean
|
||||
{
|
||||
switch(_npcState - -2)
|
||||
{
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
return true;
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
return _npcMC == null || _npcMC.finished;
|
||||
default:
|
||||
throw new Error("NPVView: npcStateComplete: Unsupported state");
|
||||
}
|
||||
}
|
||||
|
||||
public function get readyToLaunchAttack() : Boolean
|
||||
{
|
||||
if(_npcState == 2)
|
||||
{
|
||||
if(_npcMC != null)
|
||||
{
|
||||
if(_npcMC.attacking == true)
|
||||
{
|
||||
_npcMC.attacking = false;
|
||||
return true;
|
||||
}
|
||||
if(_npcMC.hasOwnProperty("counterAttacking") && _npcMC.counterAttacking == true)
|
||||
{
|
||||
_npcMC.counterAttacking = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get readyToAttack() : Boolean
|
||||
{
|
||||
var _loc3_:Array = null;
|
||||
var _loc1_:int = 0;
|
||||
var _loc2_:Object = null;
|
||||
if(_npcMC != null && _npcMC.hasOwnProperty("getCustomCollisionPoints"))
|
||||
{
|
||||
_loc3_ = _npcMC.getCustomCollisionPoints();
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
_loc1_ = 0;
|
||||
while(_loc1_ < _loc3_.length)
|
||||
{
|
||||
_loc2_ = _loc3_[_loc1_];
|
||||
if(_loc2_.Type == 2)
|
||||
{
|
||||
return !_npcMC.animActive && _npcMC.readyForAttack;
|
||||
}
|
||||
_loc1_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_npcState != 2 && _npcState != 4)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get isDead() : Boolean
|
||||
{
|
||||
if(_npcState == 4 && (_npcMC == null || _npcMC.animActive == false))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get isDying() : Boolean
|
||||
{
|
||||
return _npcState == 4;
|
||||
}
|
||||
|
||||
public function moveFaceAnim(param1:Number) : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc2_:Boolean = false;
|
||||
if(_npcAvatarView)
|
||||
{
|
||||
_loc3_ = 0;
|
||||
_loc2_ = false;
|
||||
while(param1 < 0)
|
||||
{
|
||||
param1 += 360;
|
||||
}
|
||||
while(param1 >= 360)
|
||||
{
|
||||
param1 -= 360;
|
||||
}
|
||||
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||
{
|
||||
if(param1 < 180)
|
||||
{
|
||||
if(param1 < 35)
|
||||
{
|
||||
_loc3_ = 7;
|
||||
}
|
||||
else if(param1 < 70)
|
||||
{
|
||||
_loc3_ = 8;
|
||||
}
|
||||
else if(param1 < 110)
|
||||
{
|
||||
_loc3_ = 9;
|
||||
}
|
||||
else if(param1 < 145)
|
||||
{
|
||||
_loc3_ = 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = 11;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = true;
|
||||
if(param1 < 215)
|
||||
{
|
||||
_loc3_ = 11;
|
||||
}
|
||||
else if(param1 < 250)
|
||||
{
|
||||
_loc3_ = 10;
|
||||
}
|
||||
else if(param1 < 290)
|
||||
{
|
||||
_loc3_ = 9;
|
||||
}
|
||||
else if(param1 < 325)
|
||||
{
|
||||
_loc3_ = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||
{
|
||||
if(param1 < 180)
|
||||
{
|
||||
_loc3_ = 29;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = true;
|
||||
_loc3_ = 29;
|
||||
}
|
||||
}
|
||||
_npcAvatarView.playAnim(_loc3_,_loc2_,2);
|
||||
}
|
||||
}
|
||||
|
||||
public function setNpcState(param1:int, param2:Number = 0) : void
|
||||
{
|
||||
if(_npcState != 4)
|
||||
{
|
||||
switch(param1)
|
||||
{
|
||||
case 0:
|
||||
if(_npcMC)
|
||||
{
|
||||
if(_npcMC.animActive == false)
|
||||
{
|
||||
_npcState = param1;
|
||||
_npcMC.idle(270);
|
||||
}
|
||||
if(_npcMC.hasOwnProperty("getSortHeight"))
|
||||
{
|
||||
if(_npcMC.parent.parent)
|
||||
{
|
||||
_npcMC.parent.parent.name = _npcMC.getSortHeight();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(_npcAvatarView)
|
||||
{
|
||||
if(_npcState != param1)
|
||||
{
|
||||
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||
{
|
||||
playAnimationState(14,false,0,null);
|
||||
}
|
||||
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||
{
|
||||
playAnimationState(32,false,0,null);
|
||||
}
|
||||
_npcState = param1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(_npcAvatarView != null)
|
||||
{
|
||||
_npcState = param1;
|
||||
if(_npcAngle != param2)
|
||||
{
|
||||
_npcAngle = param2;
|
||||
moveFaceAnim(_npcAngle);
|
||||
}
|
||||
}
|
||||
else if(_npcMC != null)
|
||||
{
|
||||
_npcAngle = param2;
|
||||
if(_npcMC.animActive == false)
|
||||
{
|
||||
_npcState = param1;
|
||||
_npcMC.moveCycle(_npcAngle);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(_npcMC != null)
|
||||
{
|
||||
_npcState = param1;
|
||||
_npcAngle = param2;
|
||||
_npcMC.attack(_npcAngle);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(_npcMC != null)
|
||||
{
|
||||
if(_npcState != 3 || _npcMC.hasOwnProperty("animActive") == false || _npcMC.animActive == false)
|
||||
{
|
||||
if(_npcState == 0 || _npcState == 1)
|
||||
{
|
||||
_npcState = param1;
|
||||
}
|
||||
_npcMC.recoil(_npcAngle);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if(_npcMC)
|
||||
{
|
||||
_npcState = param1;
|
||||
_npcMC.noHealth();
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if(_npcMC)
|
||||
{
|
||||
_npcMC.appear();
|
||||
_npcState = param1;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if(_npcMC)
|
||||
{
|
||||
_npcMC.openChest();
|
||||
_npcState = param1;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if(_npcMC)
|
||||
{
|
||||
_npcMC.disappear();
|
||||
_npcState = param1;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if(_npcAvatarView != null)
|
||||
{
|
||||
_npcState = param1;
|
||||
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||
{
|
||||
playAnimationState(23,false,0,null);
|
||||
break;
|
||||
}
|
||||
if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||
{
|
||||
playAnimationState(38,false,0,null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get collisionZapRadius() : Number
|
||||
{
|
||||
if(_npcMC != null)
|
||||
{
|
||||
return _npcMC.getCollisionRadius(0);
|
||||
}
|
||||
return 20;
|
||||
}
|
||||
|
||||
public function get collisionRadiusMoving() : Number
|
||||
{
|
||||
if(_npcMC != null)
|
||||
{
|
||||
if("getCollisionRadius" in _npcMC)
|
||||
{
|
||||
return _npcMC.getCollisionRadius(1);
|
||||
}
|
||||
}
|
||||
return 20;
|
||||
}
|
||||
|
||||
public function get collisionRadiusAttack() : Number
|
||||
{
|
||||
if(_npcMC != null)
|
||||
{
|
||||
if("getCollisionRadius" in _npcMC)
|
||||
{
|
||||
return _npcMC.getCollisionRadius(2);
|
||||
}
|
||||
}
|
||||
return 20;
|
||||
}
|
||||
|
||||
public function get collisionMovingPoint() : Point
|
||||
{
|
||||
if(_npcMC != null)
|
||||
{
|
||||
if("getCollisionPoint" in _npcMC)
|
||||
{
|
||||
return _npcMC.getCollisionPoint(1);
|
||||
}
|
||||
}
|
||||
return new Point(0,0);
|
||||
}
|
||||
|
||||
public function get collisionZapPoint() : Point
|
||||
{
|
||||
if(_npcMC != null)
|
||||
{
|
||||
if("getCollisionPoint" in _npcMC)
|
||||
{
|
||||
return _npcMC.getCollisionPoint(2);
|
||||
}
|
||||
}
|
||||
return new Point(0,0);
|
||||
}
|
||||
|
||||
public function get collisionPointAttack() : Point
|
||||
{
|
||||
if(_npcMC != null)
|
||||
{
|
||||
if("getCollisionPoint" in _npcMC)
|
||||
{
|
||||
return _npcMC.getCollisionPoint(0);
|
||||
}
|
||||
}
|
||||
return new Point(0,0);
|
||||
}
|
||||
|
||||
public function get currAvatar() : Avatar
|
||||
{
|
||||
if(_npcAvatarView != null)
|
||||
{
|
||||
return _npcAvatarView.avatarData;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get talkingHeadMediaId() : int
|
||||
{
|
||||
if(_npcDef != null)
|
||||
{
|
||||
return _npcDef.headMediaRefId;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function reset() : void
|
||||
{
|
||||
_npcState = -2;
|
||||
}
|
||||
|
||||
public function init(param1:int, param2:int, param3:int = -1, param4:int = 0, param5:Boolean = false, param6:Function = null) : void
|
||||
{
|
||||
var _loc13_:Avatar = null;
|
||||
var _loc8_:String = null;
|
||||
var _loc7_:Array = null;
|
||||
var _loc12_:int = 0;
|
||||
var _loc14_:Item = null;
|
||||
var _loc9_:int = 0;
|
||||
var _loc10_:Array = null;
|
||||
var _loc11_:Array = null;
|
||||
_npcFacingSW = false;
|
||||
_npcState = -2;
|
||||
_npcAngle = 0;
|
||||
_npcDef = QuestManager.getNPCDef(param1);
|
||||
_playerId = param2;
|
||||
_onLoadingCompleteCallback = param6;
|
||||
_hitText = new TextField();
|
||||
_hitText.selectable = false;
|
||||
_hitText.multiline = false;
|
||||
_hitText.autoSize = "center";
|
||||
_hitText.visible = false;
|
||||
_hitText.embedFonts = true;
|
||||
_hitText.defaultTextFormat = new TextFormat("TikiIsland-Regular",36,4286945);
|
||||
_hitText.filters = [new GlowFilter(0,1,3,3,10,2)];
|
||||
switch(_npcDef.type)
|
||||
{
|
||||
case 0:
|
||||
_mediaHelperObj = new MediaHelper();
|
||||
_mediaHelperObj.init(_npcDef.mediaRefId,onMediaLoaded);
|
||||
break;
|
||||
case 1:
|
||||
_loc13_ = new Avatar();
|
||||
_loc13_.avName = "";
|
||||
_loc13_.userName = "";
|
||||
_loc13_.isShaman = param4 == 32;
|
||||
_npcAvatarView = new AvatarWorldView();
|
||||
_npcAvatarView.initWorldView(_loc13_,QuestManager._layerManager.room_chat,1,true);
|
||||
_loc13_.init(-1,_loc13_.avName,_npcDef.avatarRefId,[_npcDef.baseColor,_npcDef.patternColor,_npcDef.eyesColor]);
|
||||
_loc13_.itemResponseIntegrate(ItemXtCommManager.generateBodyModList(_npcDef.avatarRefId,_npcDef.patternItemRefId,_npcDef.eyesItemRefId,false));
|
||||
if(param3 > 0)
|
||||
{
|
||||
if(_npcAvatarView != null && _npcAvatarView.avatarData != null)
|
||||
{
|
||||
_loc8_ = LocalizationManager.translateIdOnly(param3);
|
||||
_npcAvatarView.avatarData.avName = _loc8_;
|
||||
_npcAvatarView.avatarData.userName = _loc8_;
|
||||
if(_npcAvatarView.nameBar != null)
|
||||
{
|
||||
_npcAvatarView.nameBar.setAvName(_loc8_);
|
||||
_npcAvatarView.nameBar.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc7_ = [];
|
||||
_loc9_ = 100;
|
||||
_loc12_ = 0;
|
||||
while(_loc12_ < _npcAvatarView.avatarData.inventoryBodyMod.itemArray.length)
|
||||
{
|
||||
_loc7_.push(_npcAvatarView.avatarData.inventoryBodyMod.itemArray[_loc12_]);
|
||||
_loc12_++;
|
||||
}
|
||||
if(_npcDef.backItemRefId != 0)
|
||||
{
|
||||
_loc14_ = new Item();
|
||||
_loc10_ = ItemXtCommManager.getItemDef(_npcDef.backItemRefId).colors;
|
||||
_loc14_.init(_npcDef.backItemRefId,_loc9_++,_loc10_[Math.min(_npcDef.backColor,_loc10_.length - 1)],-1,-1);
|
||||
_loc7_.push(_loc14_);
|
||||
}
|
||||
if(_npcDef.headItemRefId != 0)
|
||||
{
|
||||
_loc14_ = new Item();
|
||||
_loc10_ = ItemXtCommManager.getItemDef(_npcDef.headItemRefId).colors;
|
||||
_loc14_.init(_npcDef.headItemRefId,_loc9_++,_loc10_[Math.min(_npcDef.headColor,_loc10_.length - 1)],-1,-1);
|
||||
_loc7_.push(_loc14_);
|
||||
}
|
||||
if(_npcDef.legItemRefId != 0)
|
||||
{
|
||||
_loc14_ = new Item();
|
||||
_loc10_ = ItemXtCommManager.getItemDef(_npcDef.legItemRefId).colors;
|
||||
_loc14_.init(_npcDef.legItemRefId,_loc9_++,_loc10_[Math.min(_npcDef.legColor,_loc10_.length - 1)],-1,-1);
|
||||
_loc7_.push(_loc14_);
|
||||
}
|
||||
if(_npcDef.neckItemRefId != 0)
|
||||
{
|
||||
_loc14_ = new Item();
|
||||
_loc10_ = ItemXtCommManager.getItemDef(_npcDef.neckItemRefId).colors;
|
||||
_loc14_.init(_npcDef.neckItemRefId,_loc9_++,_loc10_[Math.min(_npcDef.neckColor,_loc10_.length - 1)],-1,-1);
|
||||
_loc7_.push(_loc14_);
|
||||
}
|
||||
if(_npcDef.tailItemRefId != 0)
|
||||
{
|
||||
_loc14_ = new Item();
|
||||
_loc10_ = ItemXtCommManager.getItemDef(_npcDef.tailItemRefId).colors;
|
||||
_loc14_.init(_npcDef.tailItemRefId,_loc9_++,_loc10_[Math.min(_npcDef.tailColor,_loc10_.length - 1)],-1,-1);
|
||||
_loc7_.push(_loc14_);
|
||||
}
|
||||
_npcAvatarView.avatarData.itemResponseIntegrate(_loc7_);
|
||||
_loc11_ = new Array(15);
|
||||
redrawCallback(null);
|
||||
}
|
||||
if(param5)
|
||||
{
|
||||
_healthBar = GETDEFINITIONBYNAME("NPCHealth");
|
||||
_healthBar.x = -_healthBar.width * 0.5;
|
||||
_healthBar.y = 18;
|
||||
_healthBar.hpBar.width = _healthBar.hpEnemyBarContainer.width;
|
||||
addChild(_healthBar);
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
if(_mediaHelperObj)
|
||||
{
|
||||
_mediaHelperObj.destroy();
|
||||
_mediaHelperObj = null;
|
||||
}
|
||||
if(_npcMC)
|
||||
{
|
||||
if(_npcMC.hasOwnProperty("destroyPhantomNPC"))
|
||||
{
|
||||
_npcMC.destroyPhantomNPC();
|
||||
}
|
||||
if(_npcMC.parent != null)
|
||||
{
|
||||
_npcMC.parent.removeChild(_npcMC);
|
||||
}
|
||||
if(_eye && _eye.parent)
|
||||
{
|
||||
_eye.parent.removeChild(_eye);
|
||||
}
|
||||
}
|
||||
if(_secondaryNpcMC && _secondaryNpcMC.parent != null && _secondaryNpcMC.parent is MovieClip)
|
||||
{
|
||||
_secondaryNpcMC.parent.removeChild(_secondaryNpcMC);
|
||||
}
|
||||
if(_namebar)
|
||||
{
|
||||
_namebar.destroy();
|
||||
_namebar = null;
|
||||
}
|
||||
if(_healthBar)
|
||||
{
|
||||
_healthBar = null;
|
||||
}
|
||||
if(_npcAvatarView)
|
||||
{
|
||||
if(_npcAvatarView.parent != null)
|
||||
{
|
||||
_npcAvatarView.parent.removeChild(_npcAvatarView);
|
||||
}
|
||||
_npcAvatarView.destroy(true);
|
||||
}
|
||||
_hitTextTween = null;
|
||||
}
|
||||
|
||||
public function updateHealthBar(param1:int, param2:int, param3:Boolean, param4:Boolean) : void
|
||||
{
|
||||
var _loc5_:String = null;
|
||||
if(_healthBar)
|
||||
{
|
||||
if(param1 == 0)
|
||||
{
|
||||
_healthBar.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_healthBar.hpBar.width = _healthBar.hpEnemyBarContainer.width * (param1 / 100);
|
||||
}
|
||||
}
|
||||
if(param4)
|
||||
{
|
||||
if(param2 > 0 && _npcMC)
|
||||
{
|
||||
if(param3)
|
||||
{
|
||||
_loc5_ = "Fierce!\n" + Math.abs(param2) * -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_ = String(Math.abs(param2) * -1);
|
||||
}
|
||||
playHitText(_loc5_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function playHitText(param1:String) : void
|
||||
{
|
||||
var _loc2_:Point = null;
|
||||
_hitText.visible = true;
|
||||
_hitText.alpha = 2;
|
||||
_hitText.text = param1;
|
||||
try
|
||||
{
|
||||
_loc2_ = _npcMC.getAttachmentPoint();
|
||||
_hitText.x = _loc2_.x + this.x - _hitText.textWidth * 0.5;
|
||||
_hitText.y = _loc2_.y + this.y;
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
_hitText.x = this.x - _hitText.textWidth * 0.5;
|
||||
_hitText.y = this.y - _hitText.textHeight;
|
||||
}
|
||||
if(parent != null)
|
||||
{
|
||||
_hitText.x += parent.x;
|
||||
_hitText.y += parent.y;
|
||||
}
|
||||
if(_hitTextTween)
|
||||
{
|
||||
_hitTextTween.resetValues({
|
||||
"y":_hitText.y - 90,
|
||||
"alpha":0
|
||||
});
|
||||
_hitTextTween.beginning();
|
||||
_hitTextTween.paused = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_hitTextTween = new GTween(_hitText,1,{
|
||||
"y":_hitText.y - 90,
|
||||
"alpha":0
|
||||
},{"ease":Linear.easeNone});
|
||||
}
|
||||
}
|
||||
|
||||
public function playAnimationState(param1:int, param2:Boolean, param3:int, param4:Function) : void
|
||||
{
|
||||
if(_npcAvatarView)
|
||||
{
|
||||
_npcAvatarView.playAnim(param1,param2,param3,param4);
|
||||
}
|
||||
}
|
||||
|
||||
public function get npcMC() : MovieClip
|
||||
{
|
||||
return _npcMC;
|
||||
}
|
||||
|
||||
public function get defId() : int
|
||||
{
|
||||
return _npcDef.defId;
|
||||
}
|
||||
|
||||
public function get npcDef() : Object
|
||||
{
|
||||
return _npcDef;
|
||||
}
|
||||
|
||||
public function get secondaryNpcMC() : MovieClip
|
||||
{
|
||||
return _secondaryNpcMC;
|
||||
}
|
||||
|
||||
private function onMediaLoaded(param1:MovieClip) : void
|
||||
{
|
||||
_npcMC = param1;
|
||||
addChild(_npcMC);
|
||||
if(_npcMC.hasOwnProperty("eye"))
|
||||
{
|
||||
_eye = _npcMC.eye;
|
||||
}
|
||||
if(_npcDef.headMediaRefId != 0)
|
||||
{
|
||||
_mediaHelperObj = new MediaHelper();
|
||||
_mediaHelperObj.init(_npcDef.headMediaRefId,secondaryNPCLoaded);
|
||||
}
|
||||
else
|
||||
{
|
||||
loadingComplete();
|
||||
}
|
||||
}
|
||||
|
||||
private function secondaryNPCLoaded(param1:MovieClip) : void
|
||||
{
|
||||
if(param1.getChildAt(0) is MovieClip)
|
||||
{
|
||||
_secondaryNpcMC = MovieClip(param1.getChildAt(0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_secondaryNpcMC = param1;
|
||||
}
|
||||
_mediaHelperObj.destroy();
|
||||
_mediaHelperObj = null;
|
||||
loadingComplete();
|
||||
}
|
||||
|
||||
private function redrawCallback(param1:LayerAnim) : void
|
||||
{
|
||||
if(_npcAvatarView)
|
||||
{
|
||||
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||
{
|
||||
playAnimationState(14,false,0,null);
|
||||
}
|
||||
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||
{
|
||||
playAnimationState(32,false,32,null);
|
||||
}
|
||||
addChild(_npcAvatarView);
|
||||
loadingComplete();
|
||||
}
|
||||
}
|
||||
|
||||
private function loadingComplete() : void
|
||||
{
|
||||
_npcState = -1;
|
||||
if(_npcMC != null && _npcMC.hasOwnProperty("setInit"))
|
||||
{
|
||||
_npcMC.setInit(QuestManager._questDifficultyLevel);
|
||||
if(_npcMC.hasOwnProperty("watcher"))
|
||||
{
|
||||
_beam = _npcMC.watcher;
|
||||
}
|
||||
}
|
||||
QuestManager._layerManager.room_chat.addChild(_hitText);
|
||||
if(_onLoadingCompleteCallback != null)
|
||||
{
|
||||
_onLoadingCompleteCallback();
|
||||
}
|
||||
}
|
||||
|
||||
public function setSwfState(param1:String) : Number
|
||||
{
|
||||
if(_npcMC != null)
|
||||
{
|
||||
if(param1 == "facesw_k")
|
||||
{
|
||||
param1 = "facesw";
|
||||
}
|
||||
else if(param1 == "facese_k")
|
||||
{
|
||||
param1 = "facese";
|
||||
}
|
||||
return _npcMC.setStateByScript(param1);
|
||||
}
|
||||
if(_npcAvatarView != null)
|
||||
{
|
||||
if(param1 == "dance")
|
||||
{
|
||||
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||
{
|
||||
playAnimationState(23,_npcFacingSW,0,null);
|
||||
}
|
||||
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||
{
|
||||
playAnimationState(38,_npcFacingSW,0,null);
|
||||
}
|
||||
}
|
||||
else if(param1 == "hop")
|
||||
{
|
||||
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||
{
|
||||
playAnimationState(17,_npcFacingSW,0,null);
|
||||
}
|
||||
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||
{
|
||||
playAnimationState(41,_npcFacingSW,0,null);
|
||||
}
|
||||
}
|
||||
else if(param1 == "spin")
|
||||
{
|
||||
if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||
{
|
||||
playAnimationState(33,_npcFacingSW,0,null);
|
||||
}
|
||||
}
|
||||
else if(param1 == "idle" || param1 == "facese")
|
||||
{
|
||||
_npcFacingSW = false;
|
||||
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||
{
|
||||
playAnimationState(14,false,0,null);
|
||||
}
|
||||
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||
{
|
||||
playAnimationState(32,false,0,null);
|
||||
}
|
||||
}
|
||||
else if(param1 == "facesw")
|
||||
{
|
||||
_npcFacingSW = true;
|
||||
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||
{
|
||||
playAnimationState(14,true,0,null);
|
||||
}
|
||||
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||
{
|
||||
playAnimationState(32,true,0,null);
|
||||
}
|
||||
}
|
||||
else if(param1 == "facesw_k")
|
||||
{
|
||||
if(_npcFacingSW == false && _npcAvatarView)
|
||||
{
|
||||
_npcFacingSW = true;
|
||||
playAnimationState(_npcAvatarView.animId,true,0,null);
|
||||
}
|
||||
}
|
||||
else if(param1 == "facese_k")
|
||||
{
|
||||
if(_npcFacingSW == true && _npcAvatarView)
|
||||
{
|
||||
_npcFacingSW = false;
|
||||
playAnimationState(_npcAvatarView.animId,false,0,null);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,808 @@
|
||||
package avatar
|
||||
{
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import flash.events.MouseEvent;
|
||||
import loader.MediaHelper;
|
||||
|
||||
public class NameBar extends MovieClip
|
||||
{
|
||||
|
||||
public static var NON_BUDDY:String = "nonBuddy";
|
||||
|
||||
public static var BUDDY:String = "buddy";
|
||||
|
||||
public static var GUIDE:String = "guide";
|
||||
|
||||
public static const MAX_COLORS:int = 10;
|
||||
|
||||
private static var BADGE_ID_VIP_CAMERA:int = 31;
|
||||
|
||||
private static var _getNamebarIconsFunc:Function;
|
||||
|
||||
public static const LEVEL_SHAPES:Array = new Array(1851,1858,1853,1857);
|
||||
|
||||
private var _iconIdsArray:Array;
|
||||
|
||||
private var _isBlocked:Boolean;
|
||||
|
||||
private var _nubType:String;
|
||||
|
||||
private var _left:MovieClip;
|
||||
|
||||
private var _mid:MovieClip;
|
||||
|
||||
private var _right:MovieClip;
|
||||
|
||||
private var _avName:MovieClip;
|
||||
|
||||
private var _meter:MovieClip;
|
||||
|
||||
private var _shape:MovieClip;
|
||||
|
||||
private var _host:MovieClip;
|
||||
|
||||
private var _iconsMediaHelperArray:Array;
|
||||
|
||||
private var _iconImages:Array;
|
||||
|
||||
private var _nubDataArray:Array;
|
||||
|
||||
private var _nameBarDataToBeLoaded:int;
|
||||
|
||||
private var _currFrameName:String;
|
||||
|
||||
private var _packedNameBarData:int;
|
||||
|
||||
private var _badgeId:int;
|
||||
|
||||
private var _levelShapeHelper:MediaHelper;
|
||||
|
||||
private var _shapesMediaHelperArray:Array;
|
||||
|
||||
private var _currShapeMouse:MovieClip;
|
||||
|
||||
private var _currShapeUp:MovieClip;
|
||||
|
||||
private var _isMember:Boolean;
|
||||
|
||||
public function NameBar(param1:String = "nonBuddy", param2:Boolean = false)
|
||||
{
|
||||
super();
|
||||
if(this["e"].currentFrameLabel)
|
||||
{
|
||||
_left = this["e"][String(this["e"].currentFrameLabel)];
|
||||
}
|
||||
else
|
||||
{
|
||||
_left = this["e"];
|
||||
}
|
||||
if(this["n"].currentFrameLabel)
|
||||
{
|
||||
_mid = this["n"][String(this["n"].currentFrameLabel)];
|
||||
}
|
||||
else
|
||||
{
|
||||
_mid = this["n"];
|
||||
}
|
||||
if(this["meter"] != null)
|
||||
{
|
||||
if(this["meter"].currentFrameLabel)
|
||||
{
|
||||
_meter = this["meter"][String(this["meter"].currentFrameLabel)];
|
||||
}
|
||||
else
|
||||
{
|
||||
_meter = this["meter"];
|
||||
}
|
||||
}
|
||||
if(this["shape"] != null)
|
||||
{
|
||||
if(this["shape"].currentFrameLabel)
|
||||
{
|
||||
_shape = this["shape"][String(this["shape"].currentFrameLabel)];
|
||||
}
|
||||
else
|
||||
{
|
||||
_shape = this["shape"];
|
||||
}
|
||||
}
|
||||
if(this["hostTag"] != null)
|
||||
{
|
||||
if(this["hostTag"].currentFrameLabel)
|
||||
{
|
||||
_host = this["hostTag"][String(this["hostTag"].currentFrameLabel)];
|
||||
}
|
||||
else
|
||||
{
|
||||
_host = this["hostTag"];
|
||||
}
|
||||
}
|
||||
_right = this["selnub"];
|
||||
_avName = this["c"];
|
||||
if(!(_left && _mid && _right && _avName && _avName.txt))
|
||||
{
|
||||
throw new Error("NameBar is missing parts or parts are named improperly!");
|
||||
}
|
||||
_currFrameName = "black";
|
||||
isBlocked = param2;
|
||||
nubType = param1;
|
||||
isHostingCustomParty = false;
|
||||
_iconsMediaHelperArray = [];
|
||||
_shapesMediaHelperArray = [];
|
||||
_iconImages = [];
|
||||
_nubDataArray = [];
|
||||
if(_getNamebarIconsFunc != null)
|
||||
{
|
||||
_iconIdsArray = _getNamebarIconsFunc();
|
||||
}
|
||||
if(!_iconIdsArray)
|
||||
{
|
||||
_iconIdsArray = [];
|
||||
}
|
||||
_nameBarDataToBeLoaded = -1;
|
||||
this.cacheAsBitmap = true;
|
||||
addEventListener("rollOver",onOverHandler,false,0,true);
|
||||
addEventListener("rollOut",onOutHandler,false,0,true);
|
||||
}
|
||||
|
||||
public static function set getNamebarIconsFunc(param1:Function) : void
|
||||
{
|
||||
_getNamebarIconsFunc = param1;
|
||||
}
|
||||
|
||||
public static function isVIPBadge(param1:int) : Boolean
|
||||
{
|
||||
var _loc2_:int = param1 >> 8 & 0xFF;
|
||||
return _loc2_ + 1 == BADGE_ID_VIP_CAMERA;
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
removeListeners();
|
||||
}
|
||||
|
||||
public function set isBlocked(param1:Boolean) : void
|
||||
{
|
||||
_isBlocked = param1;
|
||||
if(_nubType != GUIDE)
|
||||
{
|
||||
_right.blocked.visible = _isBlocked;
|
||||
}
|
||||
}
|
||||
|
||||
public function set isHostingCustomParty(param1:Boolean) : void
|
||||
{
|
||||
if(_host)
|
||||
{
|
||||
this["hostTag"].visible = param1;
|
||||
}
|
||||
}
|
||||
|
||||
public function setColorAndBadge(param1:int) : void
|
||||
{
|
||||
_packedNameBarData = param1;
|
||||
var _loc2_:int = param1 & 0xFF;
|
||||
var _loc3_:int = param1 >> 8 & 0xFF;
|
||||
_badgeId = _loc3_ + 1;
|
||||
if(this["e"].currentFrameLabel)
|
||||
{
|
||||
setColor(_loc2_);
|
||||
setBadgeIcon(_loc3_);
|
||||
}
|
||||
}
|
||||
|
||||
public function setColorBadgeAndXp(param1:int, param2:int, param3:Boolean, param4:Boolean = false) : void
|
||||
{
|
||||
setColorAndBadge(param1);
|
||||
var _loc5_:Boolean = (param1 >> 16 & 0x0F) == 0 && param3;
|
||||
_isMember = param3;
|
||||
if(param2 > 0 && (param4 || _loc5_))
|
||||
{
|
||||
if(_currShapeMouse && _currShapeMouse.level != null && _currShapeMouse.level == param2)
|
||||
{
|
||||
setCurrShape();
|
||||
}
|
||||
else if(param2 > 0)
|
||||
{
|
||||
setShape(param2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while(_shape.mouse.up.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.up.icon.removeChildAt(0);
|
||||
}
|
||||
while(_shape.mouse.mouse.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.mouse.icon.removeChildAt(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setNubType(param1:String, param2:Boolean = true) : void
|
||||
{
|
||||
nubType = param1;
|
||||
resize(param2);
|
||||
}
|
||||
|
||||
public function setAvName(param1:Object, param2:Boolean = false, param3:Object = null, param4:Boolean = true) : void
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
if(param3 != null)
|
||||
{
|
||||
_avName.txt.text = param3.getModeratedUserName();
|
||||
}
|
||||
else if(param1 is String)
|
||||
{
|
||||
_avName.txt.text = param1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_avName.txt.text = param1.avName;
|
||||
}
|
||||
}
|
||||
else if(param1 is String)
|
||||
{
|
||||
_avName.txt.text = param1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_avName.txt.text = param1.avName;
|
||||
}
|
||||
resize(param4);
|
||||
}
|
||||
|
||||
public function removeShape() : void
|
||||
{
|
||||
while(_shape.mouse.up.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.up.icon.removeChildAt(0);
|
||||
}
|
||||
while(_shape.mouse.mouse.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.mouse.icon.removeChildAt(0);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateMeter(param1:int) : void
|
||||
{
|
||||
setMeter(param1);
|
||||
}
|
||||
|
||||
public function getMeterValue() : int
|
||||
{
|
||||
if(this["meter"])
|
||||
{
|
||||
return this["meter"].hpBar.width;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function removeListeners() : void
|
||||
{
|
||||
removeEventListener("rollOver",onOverHandler);
|
||||
removeEventListener("rollOut",onOutHandler);
|
||||
}
|
||||
|
||||
public function get nubData() : Array
|
||||
{
|
||||
return _nubDataArray;
|
||||
}
|
||||
|
||||
public function set nubData(param1:Array) : void
|
||||
{
|
||||
_nubDataArray = param1;
|
||||
}
|
||||
|
||||
public function get iconIds() : Array
|
||||
{
|
||||
return _iconIdsArray;
|
||||
}
|
||||
|
||||
public function set iconIds(param1:Array) : void
|
||||
{
|
||||
_iconIdsArray = param1;
|
||||
}
|
||||
|
||||
public function get packedNameBarData() : int
|
||||
{
|
||||
return _packedNameBarData;
|
||||
}
|
||||
|
||||
public function get xpShapeIcons() : Object
|
||||
{
|
||||
return {
|
||||
"mouseIcon":_currShapeMouse,
|
||||
"upIcon":_currShapeUp
|
||||
};
|
||||
}
|
||||
|
||||
public function set xpShapeIcons(param1:Object) : void
|
||||
{
|
||||
_currShapeMouse = param1.mouseIcon;
|
||||
_currShapeUp = param1.upIcon;
|
||||
if(_currShapeMouse && _currShapeMouse.level != null)
|
||||
{
|
||||
setShape(_currShapeMouse.level);
|
||||
}
|
||||
}
|
||||
|
||||
public function get currentLevel() : int
|
||||
{
|
||||
if(_currShapeMouse && _currShapeMouse.level != null)
|
||||
{
|
||||
return _currShapeMouse.level;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function setColor(param1:int) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
if(param1 == 0)
|
||||
{
|
||||
_loc2_ = 4;
|
||||
}
|
||||
else if(param1 > 3 && param1 < 10)
|
||||
{
|
||||
_loc2_ = param1 + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = Math.min(4,param1);
|
||||
}
|
||||
_currFrameName = this["e"].currentLabels[_loc2_ - 1].name;
|
||||
this["e"].gotoAndStop(_currFrameName);
|
||||
_left = this["e"][_currFrameName];
|
||||
this["n"].gotoAndStop(_currFrameName);
|
||||
_mid = this["n"][_currFrameName];
|
||||
if(_meter)
|
||||
{
|
||||
this["meter"].gotoAndStop(_currFrameName);
|
||||
_meter = this["meter"][_currFrameName];
|
||||
}
|
||||
if(_shape)
|
||||
{
|
||||
this["shape"].gotoAndStop(_currFrameName);
|
||||
_shape = this["shape"][_currFrameName];
|
||||
}
|
||||
if(_host)
|
||||
{
|
||||
this["hostTag"].gotoAndStop(_currFrameName);
|
||||
_host = this["hostTag"][_currFrameName];
|
||||
_host.mouse.gotoAndStop(1);
|
||||
}
|
||||
if(this["selnub"].nub.currentFrameLabel)
|
||||
{
|
||||
this["selnub"].nub.gotoAndStop(_currFrameName);
|
||||
_right = this["selnub"];
|
||||
}
|
||||
if(_avName.currentFrameLabel)
|
||||
{
|
||||
_avName.gotoAndStop(_currFrameName);
|
||||
}
|
||||
_left.mouse.gotoAndStop(1);
|
||||
_mid.mouse.gotoAndStop(1);
|
||||
if(_shape)
|
||||
{
|
||||
_shape.mouse.gotoAndStop(1);
|
||||
}
|
||||
if(_right.nub.currentFrameLabel)
|
||||
{
|
||||
_right.nub[_currFrameName].mouse.gotoAndStop(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_right.nub.mouse.gotoAndStop(1);
|
||||
}
|
||||
}
|
||||
|
||||
private function setBadgeIcon(param1:int) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
if(_iconIdsArray.length > 0)
|
||||
{
|
||||
if(this["selnub"].currentFrameLabel == "buddy")
|
||||
{
|
||||
while(_right.nub[String(_right.nub.currentFrameLabel)].mouse.mouse.icon.numChildren > 0)
|
||||
{
|
||||
_right.nub[String(_right.nub.currentFrameLabel)].mouse.mouse.icon.removeChildAt(0);
|
||||
}
|
||||
while(_right.nub[String(_right.nub.currentFrameLabel)].mouse.up.icon.numChildren > 0)
|
||||
{
|
||||
_right.nub[String(_right.nub.currentFrameLabel)].mouse.up.icon.removeChildAt(0);
|
||||
}
|
||||
_loc2_ = int(_iconIdsArray[param1]);
|
||||
param1 *= 2;
|
||||
if(param1 % 2 != 0)
|
||||
{
|
||||
param1++;
|
||||
}
|
||||
if(_iconImages[param1] && _iconImages[param1 + 1])
|
||||
{
|
||||
_right.nub[String(_right.nub.currentFrameLabel)].mouse.mouse.icon.addChild(_iconImages[param1]);
|
||||
_right.nub[String(_right.nub.currentFrameLabel)].mouse.up.icon.addChild(_iconImages[param1 + 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
_nubDataArray[param1] = _right.nub[String(_right.nub.currentFrameLabel)].mouse;
|
||||
loadIcon(_loc2_,param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_nameBarDataToBeLoaded = _packedNameBarData;
|
||||
}
|
||||
}
|
||||
|
||||
private function set nubType(param1:String) : void
|
||||
{
|
||||
if(param1 == "")
|
||||
{
|
||||
_right.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_right.visible = true;
|
||||
_nubType = param1;
|
||||
_right.gotoAndStop(_nubType);
|
||||
if(_right.nub.currentFrameLabel)
|
||||
{
|
||||
_right.nub.gotoAndStop(_currFrameName);
|
||||
_right.nub[_currFrameName].mouse.gotoAndStop(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_right.nub.mouse.gotoAndStop(1);
|
||||
}
|
||||
if(_isBlocked && _nubType != GUIDE)
|
||||
{
|
||||
_right.blocked.gotoAndStop(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function resize(param1:Boolean) : void
|
||||
{
|
||||
var _loc6_:int = 0;
|
||||
var _loc5_:MovieClip = null;
|
||||
var _loc3_:MovieClip = null;
|
||||
var _loc4_:MovieClip = null;
|
||||
var _loc2_:MovieClip = null;
|
||||
if(param1)
|
||||
{
|
||||
_loc5_ = _mid.parent != this ? MovieClip(_mid.parent) : _mid;
|
||||
_loc3_ = _left.parent != this ? MovieClip(_left.parent) : _left;
|
||||
_loc4_ = _shape && _shape.parent != this ? MovieClip(_shape.parent) : _shape;
|
||||
_loc2_ = _meter && _meter.parent != this ? MovieClip(_meter.parent) : _meter;
|
||||
if(_nubType == NON_BUDDY && !_isBlocked)
|
||||
{
|
||||
_loc6_ = 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_ = 20;
|
||||
}
|
||||
_avName.txt.width = 300;
|
||||
if(_avName.txt.textWidth + _loc6_ < 60)
|
||||
{
|
||||
_loc5_.width = 60 + 0.5 * _right.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_.width = Math.ceil(_avName.txt.textWidth + _loc6_);
|
||||
}
|
||||
_loc5_.x = _loc5_.width * 0.5 * -1;
|
||||
_avName.txt.width = _loc5_.width - _loc6_ + 5;
|
||||
_loc3_.x = _loc5_.x - _loc3_.width;
|
||||
_avName.x = _loc5_.x + (_isMember ? 2 : -2);
|
||||
_right.x = _loc5_.x + _loc5_.width - 1;
|
||||
if(_loc4_)
|
||||
{
|
||||
_loc4_.x = _loc3_.x;
|
||||
}
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc2_.width = _avName.txt.width + 18;
|
||||
_loc2_.x = _avName.x - 7;
|
||||
}
|
||||
}
|
||||
_left.mouse.gotoAndStop(1);
|
||||
_mid.mouse.gotoAndStop(1);
|
||||
if(_shape)
|
||||
{
|
||||
_shape.mouse.gotoAndStop(1);
|
||||
}
|
||||
if(_right.nub.currentFrameLabel)
|
||||
{
|
||||
_right.nub[_currFrameName].mouse.gotoAndStop(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_right.nub.mouse.gotoAndStop(1);
|
||||
}
|
||||
}
|
||||
|
||||
private function loadIcon(param1:int, param2:int) : void
|
||||
{
|
||||
var _loc3_:MediaHelper = new MediaHelper();
|
||||
_loc3_.init(param1,onIconsLoaded,param2);
|
||||
_iconsMediaHelperArray[param2] = _loc3_;
|
||||
_loc3_ = new MediaHelper();
|
||||
_loc3_.init(param1,onIconsLoaded,param2 + 1);
|
||||
_iconsMediaHelperArray[param2 + 1] = _loc3_;
|
||||
}
|
||||
|
||||
private function onIconsLoaded(param1:MovieClip) : void
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
var _loc3_:int = 0;
|
||||
if(param1)
|
||||
{
|
||||
param1.cacheAsBitmap = true;
|
||||
_loc3_ = int(param1.passback);
|
||||
_iconImages[_loc3_] = param1;
|
||||
if(param1.passback % 2 == 0)
|
||||
{
|
||||
_loc2_ = _nubDataArray[_loc3_].mouse.icon;
|
||||
while(_loc2_.numChildren > 0)
|
||||
{
|
||||
_loc2_.removeChildAt(0);
|
||||
}
|
||||
_loc2_.addChild(param1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = _nubDataArray[_loc3_ - 1].up.icon;
|
||||
while(_loc2_.numChildren > 0)
|
||||
{
|
||||
_loc2_.removeChildAt(0);
|
||||
}
|
||||
_loc2_.addChild(param1);
|
||||
}
|
||||
if(_iconsMediaHelperArray[_loc3_])
|
||||
{
|
||||
_iconsMediaHelperArray[_loc3_].destroy();
|
||||
_iconsMediaHelperArray[_loc3_] = null;
|
||||
delete _iconsMediaHelperArray[_loc3_];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function setCurrShape() : void
|
||||
{
|
||||
while(_shape.mouse.up.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.up.icon.removeChildAt(0);
|
||||
}
|
||||
_shape.mouse.up.icon.addChild(_currShapeUp);
|
||||
while(_shape.mouse.mouse.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.mouse.icon.removeChildAt(0);
|
||||
}
|
||||
_shape.mouse.mouse.icon.addChild(_currShapeMouse);
|
||||
}
|
||||
|
||||
private function setShape(param1:int) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
if(param1 > 0)
|
||||
{
|
||||
if(_currShapeMouse == null || _currShapeMouse.level != param1 && Math.floor(_currShapeMouse.level / 5) != Math.floor(param1 / 5))
|
||||
{
|
||||
_loc2_ = int(Math.floor(param1 / 5) > LEVEL_SHAPES.length - 1 ? LEVEL_SHAPES[LEVEL_SHAPES.length - 1] : LEVEL_SHAPES[Math.floor(param1 / 5)]);
|
||||
_levelShapeHelper = new MediaHelper();
|
||||
_levelShapeHelper.init(_loc2_,onLevelShapeLoaded,-1);
|
||||
_shapesMediaHelperArray.push(_levelShapeHelper);
|
||||
_levelShapeHelper = new MediaHelper();
|
||||
_levelShapeHelper.init(_loc2_,onLevelShapeLoaded,param1);
|
||||
_shapesMediaHelperArray.push(_levelShapeHelper);
|
||||
}
|
||||
else
|
||||
{
|
||||
while(_shape.mouse.up.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.up.icon.removeChildAt(0);
|
||||
}
|
||||
_shape.mouse.up.icon.addChild(_currShapeUp);
|
||||
while(_shape.mouse.mouse.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.mouse.icon.removeChildAt(0);
|
||||
}
|
||||
_shape.mouse.mouse.icon.addChild(_currShapeMouse);
|
||||
_currShapeMouse.text.text = param1;
|
||||
_currShapeUp.text.text = param1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while(_shape.mouse.up.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.up.icon.removeChildAt(0);
|
||||
}
|
||||
while(_shape.mouse.mouse.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.mouse.icon.removeChildAt(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function onLevelShapeLoaded(param1:MovieClip) : void
|
||||
{
|
||||
var _loc2_:MovieClip = null;
|
||||
if(param1)
|
||||
{
|
||||
_loc2_ = MovieClip(param1.getChildAt(0));
|
||||
if(param1.passback == -1)
|
||||
{
|
||||
_currShapeUp = _loc2_;
|
||||
if(_isMember)
|
||||
{
|
||||
_currShapeUp.gotoAndStop("member");
|
||||
}
|
||||
if(_currShapeMouse)
|
||||
{
|
||||
_currShapeUp.text.text = _currShapeMouse.level;
|
||||
}
|
||||
_shapesMediaHelperArray[0].destroy();
|
||||
_shapesMediaHelperArray.splice(0,1);
|
||||
while(_shape.mouse.up.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.up.icon.removeChildAt(0);
|
||||
}
|
||||
_shape.mouse.up.icon.addChild(_currShapeUp);
|
||||
}
|
||||
else
|
||||
{
|
||||
_currShapeMouse = _loc2_;
|
||||
if(_isMember)
|
||||
{
|
||||
_currShapeMouse.gotoAndStop("member");
|
||||
}
|
||||
_currShapeMouse.level = _currShapeMouse.text.text = param1.passback;
|
||||
if(_currShapeUp)
|
||||
{
|
||||
_currShapeUp.text.text = _currShapeMouse.level;
|
||||
}
|
||||
_shapesMediaHelperArray[_shapesMediaHelperArray.length - 1].destroy();
|
||||
_shapesMediaHelperArray.pop();
|
||||
while(_shape.mouse.mouse.icon.numChildren > 0)
|
||||
{
|
||||
_shape.mouse.mouse.icon.removeChildAt(0);
|
||||
}
|
||||
_shape.mouse.mouse.icon.addChild(_currShapeMouse);
|
||||
}
|
||||
_shape.mouse.gotoAndStop(1);
|
||||
}
|
||||
}
|
||||
|
||||
private function setMeter(param1:int) : void
|
||||
{
|
||||
if(this["meter"])
|
||||
{
|
||||
this["meter"].hpBar.width = this["meter"].hpBarContainer.width * (param1 / 100);
|
||||
}
|
||||
}
|
||||
|
||||
private function onOverHandler(param1:MouseEvent) : void
|
||||
{
|
||||
_left.mouse.gotoAndPlay(1);
|
||||
_mid.mouse.gotoAndPlay(1);
|
||||
if(_shape)
|
||||
{
|
||||
_shape.mouse.gotoAndPlay(1);
|
||||
}
|
||||
if(_host)
|
||||
{
|
||||
_host.mouse.gotoAndPlay(1);
|
||||
}
|
||||
if(_right.nub.currentFrameLabel)
|
||||
{
|
||||
_right.nub[String(_right.nub.currentFrameLabel)].mouse.gotoAndPlay(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_right.nub.mouse.gotoAndPlay(1);
|
||||
}
|
||||
if(_isBlocked && _nubType != GUIDE)
|
||||
{
|
||||
_right.blocked.mouse.gotoAndPlay(1);
|
||||
}
|
||||
}
|
||||
|
||||
private function onOutHandler(param1:MouseEvent) : void
|
||||
{
|
||||
var _loc2_:MovieClip = null;
|
||||
if(_right.nub[String(_right.nub.currentFrameLabel)])
|
||||
{
|
||||
_loc2_ = _right.nub[String(_right.nub.currentFrameLabel)];
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = _right.nub;
|
||||
}
|
||||
if(_left.mouse.currentFrame > 1)
|
||||
{
|
||||
playBackwards(_left.mouse);
|
||||
}
|
||||
else
|
||||
{
|
||||
_left.mouse.stop();
|
||||
}
|
||||
if(_mid.mouse.currentFrame > 1)
|
||||
{
|
||||
playBackwards(_mid.mouse);
|
||||
}
|
||||
else
|
||||
{
|
||||
_mid.mouse.stop();
|
||||
}
|
||||
if(_shape)
|
||||
{
|
||||
if(_shape.mouse.currentFrame > 1)
|
||||
{
|
||||
playBackwards(_shape.mouse);
|
||||
}
|
||||
else
|
||||
{
|
||||
_shape.mouse.stop();
|
||||
}
|
||||
}
|
||||
if(_host)
|
||||
{
|
||||
if(_host.mouse.currentFrame > 1)
|
||||
{
|
||||
playBackwards(_host.mouse);
|
||||
}
|
||||
else
|
||||
{
|
||||
_host.mouse.stop();
|
||||
}
|
||||
}
|
||||
if(_loc2_.mouse.currentFrame > 1)
|
||||
{
|
||||
playBackwards(_loc2_.mouse);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_.mouse.stop();
|
||||
}
|
||||
if(_isBlocked && _nubType != GUIDE)
|
||||
{
|
||||
if(_right.blocked.mouse.currentFrame > 1)
|
||||
{
|
||||
playBackwards(_right.blocked.mouse);
|
||||
}
|
||||
else
|
||||
{
|
||||
_right.blocked.mouse.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function playBackwards(param1:MovieClip) : void
|
||||
{
|
||||
param1.addEventListener("enterFrame",pbFrameHandler,false,0,true);
|
||||
}
|
||||
|
||||
private function pbFrameHandler(param1:Event) : void
|
||||
{
|
||||
var _loc2_:MovieClip = null;
|
||||
if(param1.target as MovieClip)
|
||||
{
|
||||
_loc2_ = MovieClip(param1.target);
|
||||
if(_loc2_.currentFrame == 1)
|
||||
{
|
||||
_loc2_.removeEventListener("enterFrame",pbFrameHandler);
|
||||
return;
|
||||
}
|
||||
_loc2_.prevFrame();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package avatar
|
||||
{
|
||||
import com.sbi.analytics.SBTracker;
|
||||
import flash.display.MovieClip;
|
||||
import gui.DarkenManager;
|
||||
import gui.GuiManager;
|
||||
|
||||
public class NewWorldAvatar implements INewAvatar
|
||||
{
|
||||
|
||||
public function NewWorldAvatar()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function screenInitCallback(param1:MovieClip) : void
|
||||
{
|
||||
param1.visible = false;
|
||||
}
|
||||
|
||||
public function get playSound() : Boolean
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function newAvatarData(param1:int, param2:String, param3:Array, param4:Function, param5:int = -1, param6:int = -1, param7:Boolean = false) : void
|
||||
{
|
||||
SBTracker.trackPageview("/game/play/popup/avatarSwitch/buyAnimal");
|
||||
var _loc8_:Boolean = param2 && param2 != "" && RegExp(/a-zA-Z0-9 /)["exec"](param2) == null;
|
||||
if(_loc8_)
|
||||
{
|
||||
AvatarSwitch.addNewWorldAvatar(param1,param2,param3,param5,param6,param7);
|
||||
}
|
||||
if(param4 != null && !AvatarSwitch.isAddingSlot && !param7)
|
||||
{
|
||||
param4(_loc8_);
|
||||
}
|
||||
if(_loc8_)
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
}
|
||||
}
|
||||
|
||||
public function hideConnectingMsg() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function nameTypeScreenDone() : void
|
||||
{
|
||||
GuiManager.closeAvatarCreator();
|
||||
}
|
||||
|
||||
public function logInForCreateAvatarData() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,840 @@
|
||||
package avatar
|
||||
{
|
||||
import com.adobe.utils.StringUtil;
|
||||
import com.sbi.client.SFEvent;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.popup.*;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.external.ExternalInterface;
|
||||
import flash.text.TextFormat;
|
||||
import flash.utils.setTimeout;
|
||||
import game.MinigameInfo;
|
||||
import game.MinigameManager;
|
||||
import gui.ActionManager;
|
||||
import gui.ChatHistory;
|
||||
import gui.EmoticonManager;
|
||||
import gui.EmoticonUtility;
|
||||
import gui.GuiManager;
|
||||
import gui.SafeChatManager;
|
||||
import loader.DefPacksDefHelper;
|
||||
import loader.JCDefHelper;
|
||||
import localization.LocalizationManager;
|
||||
import quest.QuestManager;
|
||||
import quest.QuestXtCommManager;
|
||||
import room.RoomManagerWorld;
|
||||
|
||||
public class UserCommXtCommManager
|
||||
{
|
||||
|
||||
public static var RAW_STR:String;
|
||||
|
||||
private static const BROADCAST_MESSAGE_LOC_ID_UPDATING_AJ_FULL_DEPLOY_IN_ONE_MINUTE:int = 22368;
|
||||
|
||||
private static const BROADCAST_MESSAGE_LOC_ID_UPDATING_AJ_FULL_DEPLOY_IN_N_MINUTES:int = 22367;
|
||||
|
||||
private static const BROADCAST_MESSAGE_LOC_ID_UPDATING_AJ_HOTFIX_IN_ONE_MINUTE:int = 22370;
|
||||
|
||||
private static const BROADCAST_MESSAGE_LOC_ID_UPDATING_AJ_HOTFIX_IN_N_MINUTES:int = 22369;
|
||||
|
||||
private static var _drainPopupDelay:Number;
|
||||
|
||||
private static var _playerSfsUserId:int = -1;
|
||||
|
||||
private static var _mainHud:MovieClip;
|
||||
|
||||
private static var _chatHist:ChatHistory;
|
||||
|
||||
private static var _emoteMgr:EmoticonManager;
|
||||
|
||||
private static var _actionMgr:ActionManager;
|
||||
|
||||
private static var _roomMgr:RoomManagerWorld;
|
||||
|
||||
private static var _spellingCorrections:Object;
|
||||
|
||||
private static var _emoteDefs:Object;
|
||||
|
||||
private static var _specialWords:Object;
|
||||
|
||||
private static var _replacedWords:Object;
|
||||
|
||||
private static var _customPVPMessageCallback:Object;
|
||||
|
||||
private static var _customPVPPassback:Object;
|
||||
|
||||
private static var _originalPermEmoteBeingDisplayed:int;
|
||||
|
||||
private static var _secondPermEmoteInUse:Boolean;
|
||||
|
||||
public function UserCommXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init() : void
|
||||
{
|
||||
DebugUtility.debugTrace("UserCommXtCommManager init - initializing");
|
||||
_mainHud = GuiManager.mainHud;
|
||||
_chatHist = GuiManager.chatHist;
|
||||
_emoteMgr = GuiManager.emoteMgr;
|
||||
_actionMgr = GuiManager.actionMgr;
|
||||
_roomMgr = RoomManagerWorld.instance;
|
||||
_drainPopupDelay = Math.random() * 10 * 60 * 1000;
|
||||
if(_drainPopupDelay < 300000)
|
||||
{
|
||||
_drainPopupDelay = Math.random() * 10 * 60 * 1000;
|
||||
}
|
||||
_playerSfsUserId = AvatarManager.playerSfsUserId;
|
||||
RAW_STR = gMainFrame.server.rawProtocolSeparator;
|
||||
var _loc1_:DefPacksDefHelper = new DefPacksDefHelper();
|
||||
_loc1_.init(1036,onEmoticonDefsLoaded,null,2);
|
||||
DefPacksDefHelper.mediaArray[1036] = _loc1_;
|
||||
_loc1_ = new DefPacksDefHelper();
|
||||
_loc1_.init(10,onAutoCorrectListLoaded,null,1);
|
||||
DefPacksDefHelper.mediaArray["10"] = _loc1_;
|
||||
_specialWords = {};
|
||||
_specialWords[LocalizationManager.translateIdOnly(14855)] = LocalizationManager.translateIdOnly(11142);
|
||||
_originalPermEmoteBeingDisplayed = -1;
|
||||
}
|
||||
|
||||
private static function onAutoCorrectListLoaded(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
var _loc4_:int = 0;
|
||||
DefPacksDefHelper.mediaArray["10"] = null;
|
||||
var _loc2_:String = param1.def.toString().toLowerCase() as String;
|
||||
_spellingCorrections = {};
|
||||
_spellingCorrections["constructor"] = "constructor";
|
||||
var _loc3_:Array = _loc2_.split("\r\n");
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _loc3_.length)
|
||||
{
|
||||
_loc3_[_loc4_] = _loc3_[_loc4_].split(",");
|
||||
if(!(_loc3_[_loc4_][0] == null || _loc3_[_loc4_][0].length == 0 || _loc3_[_loc4_][1] == null || _loc3_[_loc4_][1].length == 0))
|
||||
{
|
||||
_spellingCorrections[StringUtil.trim(_loc3_[_loc4_][0])] = StringUtil.trim(_loc3_[_loc4_][1]);
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
|
||||
private static function onEmoticonDefsLoaded(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
DefPacksDefHelper.mediaArray[1036] = null;
|
||||
var _loc4_:Object = param1.def;
|
||||
var _loc3_:Object = {};
|
||||
for each(var _loc2_:Object in _loc4_)
|
||||
{
|
||||
_loc3_[_loc2_.id] = int(_loc2_.mediaRef);
|
||||
}
|
||||
_emoteDefs = _loc3_;
|
||||
}
|
||||
|
||||
public static function destroy() : void
|
||||
{
|
||||
}
|
||||
|
||||
public static function set playerSfsUserId(param1:int) : void
|
||||
{
|
||||
_playerSfsUserId = param1;
|
||||
}
|
||||
|
||||
public static function getEmoticonMediaId(param1:int) : int
|
||||
{
|
||||
if(!_emoteDefs[param1])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return _emoteDefs[param1];
|
||||
}
|
||||
|
||||
public static function getEmoticonDefId(param1:int) : int
|
||||
{
|
||||
for(var _loc2_:String in _emoteDefs)
|
||||
{
|
||||
if(_emoteDefs[_loc2_] == param1)
|
||||
{
|
||||
return int(_loc2_);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function addChatMessage(param1:String) : void
|
||||
{
|
||||
_chatHist.addMessage(gMainFrame.userInfo.playerAvatarInfo.avName,gMainFrame.userInfo.playerAvatarInfo.userName,param1);
|
||||
}
|
||||
|
||||
public static function sendAvatarSafeChat(param1:String, param2:String, param3:Boolean = true) : void
|
||||
{
|
||||
if(gMainFrame.clientInfo.invisMode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AvatarManager.addAvatarMessage(param1,_playerSfsUserId,0);
|
||||
addChatMessage(param1);
|
||||
gMainFrame.server.sendMessage(param2 + RAW_STR + 1);
|
||||
if(_chatHist.enableFreeChatValue)
|
||||
{
|
||||
_chatHist.resetTreeSearch();
|
||||
_chatHist.chatMsgText.text = "";
|
||||
_chatHist.setFocusOnMsgText();
|
||||
}
|
||||
if(param3)
|
||||
{
|
||||
GuiManager.safeChatBtnDownHandler(null);
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendAvatarEmote(param1:Sprite) : void
|
||||
{
|
||||
if(gMainFrame.clientInfo.invisMode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AvatarManager.setAvatarEmote(param1);
|
||||
if(!EmoticonUtility.getEmoteString(param1))
|
||||
{
|
||||
throw new Error("setAvatarEmote: sent invalid emote sprite?!");
|
||||
}
|
||||
addChatMessage(EmoticonUtility.getEmoteString(param1));
|
||||
gMainFrame.server.sendMessage(EmoticonUtility.idForEmote(param1) + RAW_STR + 2);
|
||||
if(_chatHist.enableFreeChatValue)
|
||||
{
|
||||
_chatHist.resetTreeSearch();
|
||||
_chatHist.chatMsgText.text = "";
|
||||
_chatHist.setFocusOnMsgText();
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendAvatarAction(param1:Sprite) : void
|
||||
{
|
||||
if(gMainFrame.clientInfo.invisMode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AvatarManager.setAvatarAction(param1);
|
||||
if(!_actionMgr.getActionString(param1))
|
||||
{
|
||||
throw new Error("setAvatarAction: sent invalid action sprite?!");
|
||||
}
|
||||
addChatMessage(_actionMgr.getActionString(param1));
|
||||
var _loc3_:AvatarWorldView = AvatarManager.avatarViewList[AvatarManager.playerSfsUserId];
|
||||
var _loc2_:int = _loc3_.lastIdleAnim;
|
||||
gMainFrame.server.sendMessage(_actionMgr.getActionString(param1) + RAW_STR + 3 + RAW_STR + _loc2_);
|
||||
if(_chatHist.enableFreeChatValue)
|
||||
{
|
||||
_chatHist.resetTreeSearch();
|
||||
_chatHist.chatMsgText.text = "";
|
||||
_chatHist.setFocusOnMsgText();
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendAvatarAttachmentEmot(param1:int, param2:String = null) : void
|
||||
{
|
||||
if(gMainFrame.clientInfo.invisMode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(param2 == null)
|
||||
{
|
||||
param2 = "";
|
||||
}
|
||||
gMainFrame.server.sendMessage(param1 + "," + param2 + RAW_STR + 4);
|
||||
}
|
||||
|
||||
public static function sendAvatarBlendColor(param1:uint) : void
|
||||
{
|
||||
gMainFrame.server.sendMessage(int(param1) + RAW_STR + 8);
|
||||
}
|
||||
|
||||
public static function sendAvatarAlphaLevel(param1:uint) : void
|
||||
{
|
||||
gMainFrame.server.sendMessage(int(param1) + RAW_STR + 10);
|
||||
}
|
||||
|
||||
public static function sendChatMessage(param1:int, param2:String) : void
|
||||
{
|
||||
if(gMainFrame.clientInfo.invisMode || !Utility.canChat())
|
||||
{
|
||||
return;
|
||||
}
|
||||
param2 = fixMispellings(param2);
|
||||
param2 = adjustCamelCase(param2);
|
||||
AvatarManager.addAvatarMessage("...",param1,0);
|
||||
param2 = adjustSpecialWords(param2);
|
||||
var _loc3_:int = gMainFrame.userInfo.sgChatType == 1 ? 0 : 9;
|
||||
gMainFrame.server.sendMessage(param2 + RAW_STR + _loc3_);
|
||||
if(_chatHist.enableFreeChatValue)
|
||||
{
|
||||
_chatHist.resetTreeSearch();
|
||||
_chatHist.chatMsgText.text = "";
|
||||
gMainFrame.stage.focus = _chatHist.chatMsgText;
|
||||
}
|
||||
}
|
||||
|
||||
public static function adjustSpecialWords(param1:String) : String
|
||||
{
|
||||
var _loc7_:String = null;
|
||||
var _loc11_:String = null;
|
||||
var _loc10_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
var _loc9_:String = null;
|
||||
var _loc8_:String = null;
|
||||
var _loc3_:String = null;
|
||||
_replacedWords = {};
|
||||
var _loc5_:Array = param1.split(" ");
|
||||
var _loc2_:int = 0;
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc5_.length)
|
||||
{
|
||||
_loc11_ = _loc5_[_loc10_];
|
||||
_loc7_ = _loc11_.toLowerCase();
|
||||
for(var _loc6_:String in _specialWords)
|
||||
{
|
||||
_loc4_ = _loc7_.indexOf(_loc6_);
|
||||
if(_loc4_ >= 0)
|
||||
{
|
||||
_loc9_ = _loc11_.substr(0,_loc4_);
|
||||
_loc8_ = _loc11_.substr(_loc4_,_loc6_.length);
|
||||
_loc3_ = _loc11_.substr(_loc4_ + _loc6_.length);
|
||||
_loc2_ = getCaseType(_loc8_);
|
||||
_loc8_ = setCaseType(_specialWords[_loc6_],_loc2_);
|
||||
_loc5_[_loc10_] = _loc9_ + _loc8_ + _loc3_;
|
||||
_replacedWords[_loc5_[_loc10_]] = _loc11_;
|
||||
}
|
||||
}
|
||||
_loc10_++;
|
||||
}
|
||||
return _loc5_.join(" ");
|
||||
}
|
||||
|
||||
private static function getCaseType(param1:String) : int
|
||||
{
|
||||
if(param1.toLowerCase() == param1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var _loc2_:String = param1.charAt(0);
|
||||
var _loc3_:int = int(param1.match(/[A-Z]/g).length);
|
||||
if(_loc3_ == param1.length)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
private static function setCaseType(param1:String, param2:int) : String
|
||||
{
|
||||
if(param2 == 0)
|
||||
{
|
||||
return param1.toLowerCase();
|
||||
}
|
||||
if(param2 == 1)
|
||||
{
|
||||
return param1.toUpperCase();
|
||||
}
|
||||
param1 = param1.toLowerCase();
|
||||
var _loc3_:String = param1.charAt(0).toUpperCase();
|
||||
return _loc3_ + param1.substr(1);
|
||||
}
|
||||
|
||||
public static function reverseSpecialWords(param1:String) : String
|
||||
{
|
||||
var _loc4_:String = null;
|
||||
var _loc3_:int = 0;
|
||||
if(_replacedWords == null)
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
var _loc2_:Array = param1.split(" ");
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _loc2_.length)
|
||||
{
|
||||
_loc4_ = _loc2_[_loc3_].toLowerCase();
|
||||
if(!(_replacedWords[_loc4_] == null || _loc4_ == "constructor"))
|
||||
{
|
||||
_loc2_[_loc3_] = _replacedWords[_loc4_];
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
_replacedWords = null;
|
||||
return _loc2_.join(" ");
|
||||
}
|
||||
|
||||
public static function adjustCamelCase(param1:String) : String
|
||||
{
|
||||
var _loc4_:int = 0;
|
||||
var _loc6_:String = null;
|
||||
var _loc5_:String = null;
|
||||
var _loc2_:String = null;
|
||||
var _loc8_:int = 0;
|
||||
var _loc7_:int = 0;
|
||||
var _loc3_:Array = param1.split(" ");
|
||||
_loc8_ = 0;
|
||||
while(_loc8_ < _loc3_.length)
|
||||
{
|
||||
_loc5_ = _loc3_[_loc8_];
|
||||
_loc6_ = _loc5_.match(/[a-zA-Z]/g).join("");
|
||||
_loc2_ = _loc6_.charAt(0);
|
||||
_loc4_ = int(_loc6_.match(/[A-Z]/g).length);
|
||||
if(_loc4_ > 0 && _loc4_ != _loc6_.length)
|
||||
{
|
||||
if(_loc2_.match(/[A-z]/g).length == 1)
|
||||
{
|
||||
_loc7_ = getIndexOfFirstLetter(_loc5_,_loc6_);
|
||||
_loc3_[_loc8_] = _loc5_.substr(0,_loc7_) + _loc2_ + _loc5_.toLowerCase().substr(_loc7_ + 1,_loc5_.length);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_[_loc8_] = _loc5_.toLowerCase();
|
||||
}
|
||||
}
|
||||
_loc8_++;
|
||||
}
|
||||
return _loc3_.join(" ");
|
||||
}
|
||||
|
||||
public static function getFirstLetter(param1:String) : String
|
||||
{
|
||||
var _loc2_:String = param1.match(/[a-zA-Z]/g).join("");
|
||||
if(_loc2_.length > 0)
|
||||
{
|
||||
return _loc2_.charAt(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function getIndexOfFirstLetter(param1:String, param2:String) : int
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
if(param2 == "")
|
||||
{
|
||||
param2 = param1.match(/[a-zA-Z]/g).join();
|
||||
}
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < param1.length)
|
||||
{
|
||||
if(param1.charAt(_loc3_) == param2.charAt(0))
|
||||
{
|
||||
return _loc3_;
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static function fixMispellings(param1:String) : String
|
||||
{
|
||||
var _loc3_:String = null;
|
||||
var _loc4_:int = 0;
|
||||
if(!_spellingCorrections || LocalizationManager.currentLanguage != LocalizationManager.LANG_ENG)
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
var _loc2_:Array = param1.split(" ");
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _loc2_.length)
|
||||
{
|
||||
_loc3_ = _loc2_[_loc4_].toLowerCase();
|
||||
_loc3_ = stripPunctuation(_loc3_);
|
||||
if(_spellingCorrections[_loc3_] != null)
|
||||
{
|
||||
_loc3_ = _spellingCorrections[_loc3_];
|
||||
_loc2_[_loc4_] = _loc3_;
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
return _loc2_.join(" ");
|
||||
}
|
||||
|
||||
public static function stripPunctuation(param1:String) : String
|
||||
{
|
||||
return param1.replace(/[^A-Za-z0-9 ']+/g,"");
|
||||
}
|
||||
|
||||
public static function sendAvatarSlide(param1:String) : void
|
||||
{
|
||||
if(gMainFrame.clientInfo.invisMode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
gMainFrame.server.sendMessage(param1 + RAW_STR + 6);
|
||||
}
|
||||
|
||||
public static function sendPermEmote(param1:int) : void
|
||||
{
|
||||
if(_originalPermEmoteBeingDisplayed != -1)
|
||||
{
|
||||
if(param1 == -1)
|
||||
{
|
||||
if(_secondPermEmoteInUse)
|
||||
{
|
||||
param1 = _originalPermEmoteBeingDisplayed;
|
||||
_secondPermEmoteInUse = false;
|
||||
}
|
||||
_originalPermEmoteBeingDisplayed = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_secondPermEmoteInUse = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_originalPermEmoteBeingDisplayed = param1;
|
||||
}
|
||||
gMainFrame.server.sendMessage(param1 + RAW_STR + 5);
|
||||
}
|
||||
|
||||
public static function sendPetAction(param1:int, param2:int = 0) : void
|
||||
{
|
||||
gMainFrame.server.sendMessage(param1 + "," + param2 + RAW_STR + 7);
|
||||
}
|
||||
|
||||
public static function sendCustomAdventureMessage(param1:Boolean) : void
|
||||
{
|
||||
gMainFrame.server.sendMessage((param1 ? "on" : "off") + RAW_STR + 11);
|
||||
}
|
||||
|
||||
public static function sendCustomPVPMessage(param1:Boolean, param2:int, param3:Function = null, param4:Object = null) : void
|
||||
{
|
||||
_customPVPMessageCallback = param3;
|
||||
_customPVPPassback = param4;
|
||||
gMainFrame.server.sendMessage((param1 ? "on" : "off") + RAW_STR + 12 + RAW_STR + param2);
|
||||
}
|
||||
|
||||
public static function onSendMessage(param1:MouseEvent, param2:String = "") : void
|
||||
{
|
||||
var _loc4_:Sprite = null;
|
||||
var _loc3_:String = null;
|
||||
if(_playerSfsUserId == -1)
|
||||
{
|
||||
DebugUtility.debugTrace("WARNING - UserCommXtCommManager.init was never called or the playerAvatarId is bad");
|
||||
_playerSfsUserId = AvatarManager.playerSfsUserId;
|
||||
}
|
||||
var _loc6_:String = param2 == "" ? _mainHud.chatBar.text01_chat.text : param2;
|
||||
_loc6_ = _loc6_.split("\r").join("");
|
||||
_loc6_ = _loc6_.split(RAW_STR).join("");
|
||||
_loc6_ = StringUtil.trim(_loc6_);
|
||||
if(_loc6_.length <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var _loc5_:Object = EmoticonUtility.matchEmoteString(_loc6_);
|
||||
if(_loc5_.status)
|
||||
{
|
||||
if(_loc5_.sprite)
|
||||
{
|
||||
sendAvatarEmote(_loc5_.sprite);
|
||||
AvatarManager.setAvatarEmote(_loc5_.sprite,-2);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc4_ = _actionMgr.matchActionString(_loc6_);
|
||||
if(_loc4_)
|
||||
{
|
||||
sendAvatarAction(_loc4_);
|
||||
AvatarManager.setAvatarAction(_loc4_,-2);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = SafeChatManager.safeChatCodeForString(_loc6_,0);
|
||||
if(_loc3_)
|
||||
{
|
||||
sendAvatarSafeChat(_loc6_,_loc3_,false);
|
||||
AvatarManager.addAvatarMessage(_loc6_,_playerSfsUserId,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendChatMessage(_playerSfsUserId,_loc6_);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
_chatHist.resetTreeSearch();
|
||||
_chatHist.chatMsgText.text = "";
|
||||
gMainFrame.stage.focus = _chatHist.chatMsgText;
|
||||
}
|
||||
|
||||
public static function handleXtReply(param1:SFEvent) : void
|
||||
{
|
||||
var _loc2_:Array = param1.obj;
|
||||
switch(_loc2_[0])
|
||||
{
|
||||
case "uc":
|
||||
userCommChatResponse(_loc2_);
|
||||
break;
|
||||
case "ua":
|
||||
userCommAdminMessageResponse(_loc2_);
|
||||
break;
|
||||
default:
|
||||
throw new Error("UserCommXtCommManager illegal data:" + _loc2_[0]);
|
||||
}
|
||||
}
|
||||
|
||||
private static function userCommChatResponse(param1:Array) : void
|
||||
{
|
||||
var _loc7_:String = null;
|
||||
var _loc6_:int = 0;
|
||||
var _loc11_:Array = null;
|
||||
var _loc16_:Array = null;
|
||||
var _loc3_:Array = null;
|
||||
var _loc5_:Object = null;
|
||||
var _loc14_:Array = null;
|
||||
var _loc12_:MinigameInfo = null;
|
||||
var _loc20_:Boolean = false;
|
||||
var _loc19_:String = null;
|
||||
var _loc18_:Sprite = null;
|
||||
var _loc15_:Sprite = null;
|
||||
var _loc4_:Array = null;
|
||||
var _loc8_:int = 0;
|
||||
var _loc10_:Avatar = null;
|
||||
var _loc17_:Array = null;
|
||||
var _loc9_:int = int(param1[2]);
|
||||
var _loc2_:int = int(param1[4]);
|
||||
var _loc13_:Boolean = true;
|
||||
if(_loc13_)
|
||||
{
|
||||
if(_loc2_ == 5)
|
||||
{
|
||||
_loc6_ = int(param1[3]);
|
||||
if(_loc6_ >= 0)
|
||||
{
|
||||
AvatarManager.setAvatarEmote(null,_loc9_,_loc6_);
|
||||
}
|
||||
else
|
||||
{
|
||||
AvatarManager.setChatBalloonReadyForClear(_loc9_);
|
||||
}
|
||||
}
|
||||
else if(_loc2_ == 6)
|
||||
{
|
||||
if(_loc9_ != gMainFrame.server.userId)
|
||||
{
|
||||
_roomMgr.attachAvatarToSlide(AvatarManager.avatarViewList[_loc9_],param1[3]);
|
||||
}
|
||||
}
|
||||
else if(_loc2_ == 7)
|
||||
{
|
||||
_loc11_ = param1[3].split(",");
|
||||
AvatarManager.setPetAction(_loc9_,_loc11_[0],_loc11_[1]);
|
||||
}
|
||||
else if(_loc2_ == 11)
|
||||
{
|
||||
_loc7_ = param1[3];
|
||||
if(_loc7_ == "off")
|
||||
{
|
||||
AvatarManager.addCustomAdventureMessage("","off",_loc9_,0,0);
|
||||
QuestManager.privateAdventureJoinClose(false,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc16_ = _loc7_.split("|");
|
||||
_loc3_ = _loc16_[0].split(",");
|
||||
_loc5_ = QuestXtCommManager.getScriptDef(_loc3_[0]);
|
||||
if(_loc5_)
|
||||
{
|
||||
AvatarManager.addCustomAdventureMessage(LocalizationManager.translateIdOnly(_loc5_.titleStrId),_loc16_[1] + "|" + _loc3_[0],_loc9_,_loc3_[2],int(param1[5]));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(_loc2_ == 12)
|
||||
{
|
||||
_loc7_ = param1[3];
|
||||
_loc14_ = param1[3].split("|");
|
||||
if(_loc14_[0] == "off")
|
||||
{
|
||||
if(_loc9_ == AvatarManager.playerSfsUserId && _loc14_[1] && !MinigameManager.isInReadyModeForPVP())
|
||||
{
|
||||
MinigameManager.readySelfForPvpGame({"typeDefId":_loc14_[1]},_loc14_[2],true,true);
|
||||
}
|
||||
AvatarManager.addCustomPvpMessage("",_loc14_[0],_loc9_,0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc12_ = MinigameManager.minigameInfoCache.getMinigameInfo(_loc14_[1]);
|
||||
AvatarManager.addCustomPvpMessage(LocalizationManager.translateIdOnly(_loc12_.titleStrId),_loc7_,_loc9_,0,int(param1[5]));
|
||||
}
|
||||
if(_customPVPMessageCallback)
|
||||
{
|
||||
if(_customPVPPassback != null)
|
||||
{
|
||||
_customPVPMessageCallback(_customPVPPassback);
|
||||
}
|
||||
else
|
||||
{
|
||||
_customPVPMessageCallback();
|
||||
}
|
||||
_customPVPMessageCallback = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc7_ = param1[3];
|
||||
_loc20_ = false;
|
||||
if(_loc2_ == 1)
|
||||
{
|
||||
_loc19_ = SafeChatManager.safeChatStringForCode(_loc7_);
|
||||
if(_loc19_)
|
||||
{
|
||||
_loc7_ = _loc19_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc20_ = true;
|
||||
}
|
||||
}
|
||||
if(!_loc20_)
|
||||
{
|
||||
switch(_loc2_)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 9:
|
||||
_loc7_ = adjustCamelCase(_loc7_);
|
||||
if(_loc9_ == gMainFrame.server.userId)
|
||||
{
|
||||
_loc7_ = reverseSpecialWords(_loc7_);
|
||||
}
|
||||
AvatarManager.addAvatarMessage(_loc7_,_loc9_,int(param1[5]));
|
||||
break;
|
||||
case 2:
|
||||
_loc18_ = EmoticonUtility.emoteForId(int(_loc7_));
|
||||
if(_loc18_)
|
||||
{
|
||||
AvatarManager.setAvatarEmote(_loc18_,_loc9_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc20_ = true;
|
||||
}
|
||||
_loc7_ = EmoticonUtility.stringForId(int(_loc7_));
|
||||
break;
|
||||
case 3:
|
||||
_loc15_ = _actionMgr.matchActionString(_loc7_);
|
||||
if(_loc15_)
|
||||
{
|
||||
AvatarManager.setAvatarAction(_loc15_,_loc9_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc20_ = true;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
_loc4_ = _loc7_.split(",");
|
||||
_loc8_ = int(_loc4_[0]);
|
||||
AvatarManager._setAvatarAttachmentEmot(_loc8_,_loc4_[1],_loc9_);
|
||||
break;
|
||||
case 8:
|
||||
AvatarManager._setAvatarBlendColor(_loc9_,uint(param1[3]));
|
||||
return;
|
||||
case 10:
|
||||
AvatarManager._setAvatarAlphaLevel(_loc9_,uint(param1[3]));
|
||||
return;
|
||||
default:
|
||||
_loc20_ = true;
|
||||
}
|
||||
}
|
||||
if(_loc20_)
|
||||
{
|
||||
DebugUtility.debugTrace("WARNING - got bad chat! msg:" + _loc7_ + " chatType:" + _loc2_ + " from userId:" + _loc9_);
|
||||
return;
|
||||
}
|
||||
if(_loc2_ != 4)
|
||||
{
|
||||
if(gMainFrame.clientInfo.extCallsActive)
|
||||
{
|
||||
_loc10_ = AvatarManager.getAvatarBySfsUserId(_loc9_);
|
||||
DebugUtility.debugTrace("mrc:sending cm command - chattyUserId:" + _loc9_ + " chattyAv:" + _loc10_);
|
||||
if(int(param1[5]) == 2)
|
||||
{
|
||||
_loc17_ = _loc7_.split("|");
|
||||
_loc17_.splice(0,1);
|
||||
_loc7_ = _loc17_.join("|");
|
||||
}
|
||||
ExternalInterface.call("mrc",["cm",_loc10_.userName,_loc7_,int(param1[5])]);
|
||||
DebugUtility.debugTrace("mrc:cm command sent - chattyUserName:" + _loc10_.userName + " msg:" + _loc7_);
|
||||
}
|
||||
if((_loc9_ != gMainFrame.server.userId || _loc9_ == gMainFrame.server.userId && (_loc2_ == 0 || _loc2_ == 9)) && int(param1[5]) <= 1)
|
||||
{
|
||||
_chatHist.addMessageById(_loc9_,_loc7_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function userCommAdminMessageResponse(param1:Array) : void
|
||||
{
|
||||
var jcDefHelper:JCDefHelper;
|
||||
var msgId:int;
|
||||
var msgSplit:Array;
|
||||
var isSystemMsg:Boolean;
|
||||
var data:Array = param1;
|
||||
var adminMsg:String = data[1];
|
||||
if(adminMsg == "__ABSU_CBS__")
|
||||
{
|
||||
jcDefHelper = new JCDefHelper();
|
||||
jcDefHelper.deleteIndexFileFromCache();
|
||||
jcDefHelper.destroy();
|
||||
jcDefHelper = null;
|
||||
GuiManager.refreshJammerCentral();
|
||||
}
|
||||
else if(adminMsg == "__FORCE_RELOGIN__")
|
||||
{
|
||||
setTimeout(refreshPage,Math.abs(_roomMgr.shardId) * 911 % 5000,{"status":true});
|
||||
}
|
||||
else
|
||||
{
|
||||
msgSplit = adminMsg.split("|");
|
||||
if(msgSplit.length > 1)
|
||||
{
|
||||
msgId = int(msgSplit[0]);
|
||||
adminMsg = LocalizationManager.translateIdAndInsertOnly(msgId,msgSplit.slice(1));
|
||||
}
|
||||
isSystemMsg = data[2] == null || int(data[2]) == 1;
|
||||
if(!isSystemMsg)
|
||||
{
|
||||
gMainFrame.clientInfo.lastBroadcastMessage = adminMsg;
|
||||
GuiManager.updateSettingsMessage();
|
||||
}
|
||||
if(isSystemMsg || !gMainFrame.isInMinigame() && gMainFrame.clientInfo.roomType != 7)
|
||||
{
|
||||
if(msgId != 22367 && msgId != 22368 && msgId != 22369 && msgId != 22370)
|
||||
{
|
||||
new SBAJOkPopup(GuiManager.guiLayer,adminMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout(function():void
|
||||
{
|
||||
new SBYesNoPopup(GuiManager.guiLayer,adminMsg,true,refreshPage);
|
||||
},_drainPopupDelay);
|
||||
}
|
||||
}
|
||||
_chatHist.addPrivateMessage(LocalizationManager.translateIdOnly(15964),null,adminMsg);
|
||||
}
|
||||
}
|
||||
|
||||
private static function refreshPage(param1:Object) : void
|
||||
{
|
||||
if(param1["status"])
|
||||
{
|
||||
Utility.reloadSWFOrGetIp();
|
||||
}
|
||||
}
|
||||
|
||||
private static function getSpecialFormat() : TextFormat
|
||||
{
|
||||
var _loc1_:TextFormat = new TextFormat();
|
||||
_loc1_.color = 12845056;
|
||||
_loc1_.bold = true;
|
||||
return _loc1_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
package avatar
|
||||
{
|
||||
import achievement.Achievement;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class UserInfo
|
||||
{
|
||||
|
||||
public var currPerUserAvId:int;
|
||||
|
||||
public var avList:Object;
|
||||
|
||||
public var denItemsFull:Array;
|
||||
|
||||
public var denItemsPartial:Array;
|
||||
|
||||
public var accountType:int;
|
||||
|
||||
public var nameBarData:int;
|
||||
|
||||
public var isGuide:Boolean;
|
||||
|
||||
public var userNameModeratedFlag:int;
|
||||
|
||||
public var _userName:String;
|
||||
|
||||
private var _allItems:Array;
|
||||
|
||||
private var _achievements:Array;
|
||||
|
||||
private var _achievementsIndexed:Array;
|
||||
|
||||
private var _timeStampSinceLastRequest:Number;
|
||||
|
||||
private var _timeLeftHostingCustomParty:int;
|
||||
|
||||
private var _timeWhenHostingEnds:Number;
|
||||
|
||||
private var _uuid:String;
|
||||
|
||||
public function UserInfo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:String, param2:String, param3:Array = null, param4:int = -1, param5:int = 1, param6:int = 0, param7:int = -1) : void
|
||||
{
|
||||
_userName = param1;
|
||||
_uuid = param2;
|
||||
_timeStampSinceLastRequest = 0;
|
||||
_allItems = [];
|
||||
if(param3)
|
||||
{
|
||||
avList = param3;
|
||||
}
|
||||
else
|
||||
{
|
||||
avList = {};
|
||||
}
|
||||
if(param4 > 0)
|
||||
{
|
||||
currPerUserAvId = param4;
|
||||
}
|
||||
accountType = param5;
|
||||
userNameModeratedFlag = param6;
|
||||
_timeLeftHostingCustomParty = param7;
|
||||
}
|
||||
|
||||
public function addAvatarToList(param1:AvatarInfo) : void
|
||||
{
|
||||
avList[param1.perUserAvId] = param1;
|
||||
}
|
||||
|
||||
public function getAvatarInfoByPerUserAvId(param1:int) : AvatarInfo
|
||||
{
|
||||
if(param1 == -1)
|
||||
{
|
||||
return avList[currPerUserAvId];
|
||||
}
|
||||
if(avList[param1])
|
||||
{
|
||||
return avList[param1];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function addAchievementsTolist(param1:Array) : void
|
||||
{
|
||||
var _loc5_:Achievement = null;
|
||||
var _loc2_:Array = null;
|
||||
var _loc4_:int = 0;
|
||||
if(!_achievements)
|
||||
{
|
||||
_achievements = [];
|
||||
}
|
||||
if(!_achievementsIndexed)
|
||||
{
|
||||
_achievementsIndexed = [];
|
||||
}
|
||||
var _loc3_:int = int(_achievements.length);
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < param1.length)
|
||||
{
|
||||
_loc5_ = param1[_loc4_] as Achievement;
|
||||
_achievements[_loc3_++] = _loc5_;
|
||||
_loc2_ = _achievementsIndexed[_loc5_.type];
|
||||
if(!_loc2_)
|
||||
{
|
||||
_loc2_ = [];
|
||||
_achievementsIndexed[_loc5_.type] = _loc2_;
|
||||
}
|
||||
_loc2_.push(_loc5_);
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
|
||||
public function set fullItemList(param1:Array) : void
|
||||
{
|
||||
_allItems = param1;
|
||||
}
|
||||
|
||||
public function get fullItemList() : Array
|
||||
{
|
||||
return _allItems;
|
||||
}
|
||||
|
||||
public function getFullItemList(param1:Boolean) : Array
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc2_:Array = [];
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _allItems.length)
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
_loc2_.push(_allItems[_loc3_]);
|
||||
}
|
||||
else if(_allItems[_loc3_].invIdx >= 0)
|
||||
{
|
||||
_loc2_.push(_allItems[_loc3_]);
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
public function getPartialItemList(param1:int, param2:Boolean) : Array
|
||||
{
|
||||
var _loc4_:int = 0;
|
||||
var _loc3_:Array = [];
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _allItems.length)
|
||||
{
|
||||
if(_allItems[_loc4_].invIdx < 0 && param2 || Utility.isSameEnviroType(gMainFrame.userInfo.getAvatarEnviroTypeFlagByAvType(param1),_allItems[_loc4_].enviroType))
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
_loc3_.push(_allItems[_loc4_]);
|
||||
}
|
||||
else if(_allItems[_loc4_].invIdx >= 0)
|
||||
{
|
||||
_loc3_.push(_allItems[_loc4_]);
|
||||
}
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
public function allItemsInUseOff(param1:int) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _allItems.length)
|
||||
{
|
||||
_allItems[_loc2_].setInUse(param1,false);
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
|
||||
public function get userName() : String
|
||||
{
|
||||
return _userName;
|
||||
}
|
||||
|
||||
public function set userName(param1:String) : void
|
||||
{
|
||||
_userName = param1;
|
||||
}
|
||||
|
||||
public function get achievements() : Array
|
||||
{
|
||||
return _achievements;
|
||||
}
|
||||
|
||||
public function get achievementsIndexed() : Array
|
||||
{
|
||||
return _achievementsIndexed;
|
||||
}
|
||||
|
||||
public function get isMember() : Boolean
|
||||
{
|
||||
return Utility.isMember(accountType);
|
||||
}
|
||||
|
||||
public function resetAchievements() : void
|
||||
{
|
||||
_achievements = [];
|
||||
_achievementsIndexed = [];
|
||||
}
|
||||
|
||||
public function getTimeOfLastAchievementRequest() : Number
|
||||
{
|
||||
return _timeStampSinceLastRequest;
|
||||
}
|
||||
|
||||
public function setTimeOfLastAchievementRequest(param1:Number) : void
|
||||
{
|
||||
_timeStampSinceLastRequest = param1;
|
||||
}
|
||||
|
||||
public function getModeratedUserName() : String
|
||||
{
|
||||
if(userNameModeratedFlag > 0)
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
return LocalizationManager.translateIdOnly(11098);
|
||||
}
|
||||
|
||||
public function getAccountType() : int
|
||||
{
|
||||
return accountType;
|
||||
}
|
||||
|
||||
public function set timeLeftHostingCustomParty(param1:int) : void
|
||||
{
|
||||
_timeLeftHostingCustomParty = param1;
|
||||
_timeWhenHostingEnds = Math.floor(new Date().time / 1000) + param1;
|
||||
}
|
||||
|
||||
public function get isStillHosting() : Boolean
|
||||
{
|
||||
if(isNaN(_timeWhenHostingEnds))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return new Date().time / 1000 < _timeWhenHostingEnds;
|
||||
}
|
||||
|
||||
public function set uuid(param1:String) : void
|
||||
{
|
||||
_uuid = param1;
|
||||
}
|
||||
|
||||
public function get uuid() : String
|
||||
{
|
||||
return _uuid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,458 @@
|
||||
package avatar
|
||||
{
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import flash.utils.Dictionary;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class UserInfoCache
|
||||
{
|
||||
|
||||
public var myBuddyCount:int;
|
||||
|
||||
public var myUUID:String;
|
||||
|
||||
public var isMember:Boolean;
|
||||
|
||||
public var isModerator:Boolean;
|
||||
|
||||
public var isGuide:Boolean;
|
||||
|
||||
public var isSilenced:Boolean;
|
||||
|
||||
public var isMyDenPrivate:Boolean;
|
||||
|
||||
public var sgChatType:int;
|
||||
|
||||
public var sgChatTypeNonDegraded:int;
|
||||
|
||||
public var firstFiveMinutes:int;
|
||||
|
||||
public var needFastPass:Boolean;
|
||||
|
||||
public var pendingFlags:Number;
|
||||
|
||||
public var activeDenRoomInvId:int;
|
||||
|
||||
public var numLogins:int;
|
||||
|
||||
public var playerWallSettings:int;
|
||||
|
||||
public var webPlayerWallSettings:int;
|
||||
|
||||
public var worldMapRoomName:String;
|
||||
|
||||
public var avtDefsCached:Boolean;
|
||||
|
||||
private var _myUserName:String;
|
||||
|
||||
private var _userInfo:Object;
|
||||
|
||||
private var _perUserAvIdToUserName:Dictionary;
|
||||
|
||||
private var _myPerUserAvId:int;
|
||||
|
||||
private var _myUserVarCache:UserVarCache;
|
||||
|
||||
private var _avatarDefs:Object;
|
||||
|
||||
private var _customAvatarDefs:Object;
|
||||
|
||||
private var _denRoomDefs:Object;
|
||||
|
||||
private var _genericListDefsInfo:Object;
|
||||
|
||||
private var _myTradeList:Array;
|
||||
|
||||
private var _myPetsInDen:Array;
|
||||
|
||||
public function UserInfoCache()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
_userInfo = {};
|
||||
_myPerUserAvId = -1;
|
||||
_myUserName = "";
|
||||
avtDefsCached = false;
|
||||
_myUserVarCache = new UserVarCache();
|
||||
_myUserVarCache.init();
|
||||
_perUserAvIdToUserName = new Dictionary(true);
|
||||
_avatarDefs = {};
|
||||
_customAvatarDefs = {};
|
||||
_genericListDefsInfo = {};
|
||||
_myTradeList = [];
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
_userInfo = null;
|
||||
_avatarDefs = null;
|
||||
_customAvatarDefs = null;
|
||||
_denRoomDefs = null;
|
||||
_genericListDefsInfo = null;
|
||||
_myTradeList = null;
|
||||
}
|
||||
|
||||
public function getUserInfoByUserName(param1:String) : UserInfo
|
||||
{
|
||||
return _userInfo[param1];
|
||||
}
|
||||
|
||||
public function setUserInfoByUserName(param1:String, param2:UserInfo) : void
|
||||
{
|
||||
var _loc4_:UserInfo = null;
|
||||
var _loc3_:* = null;
|
||||
if(param1 && param1 != "")
|
||||
{
|
||||
_loc4_ = _userInfo[param1] = param2;
|
||||
for each(_loc3_ in _loc4_.avList)
|
||||
{
|
||||
_perUserAvIdToUserName[_loc3_.perUserAvId] = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getAvatarInfoByUsernamePerUserAvId(param1:String, param2:int) : AvatarInfo
|
||||
{
|
||||
if(param1 != null)
|
||||
{
|
||||
loop0:
|
||||
for each(var _loc4_:UserInfo in _userInfo)
|
||||
{
|
||||
var _loc6_:int = 0;
|
||||
var _loc5_:Object = _loc4_.avList;
|
||||
do
|
||||
{
|
||||
for each(var _loc3_:AvatarInfo in _loc5_)
|
||||
{
|
||||
}
|
||||
continue loop0;
|
||||
}
|
||||
while(!(_loc3_.userName.toLowerCase() == param1.toLowerCase() && _loc3_.perUserAvId == param2));
|
||||
return _loc3_;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function updateAllAvatarInfoQuestXPIfZeroByUserName(param1:String, param2:int, param3:int) : void
|
||||
{
|
||||
if(param1 != null)
|
||||
{
|
||||
for each(var _loc5_:UserInfo in _userInfo)
|
||||
{
|
||||
for each(var _loc4_:AvatarInfo in _loc5_.avList)
|
||||
{
|
||||
if(_loc4_.questLevel == 0)
|
||||
{
|
||||
_loc4_.questXp = param2;
|
||||
_loc4_.questLevel = param3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function changeUserName(param1:String, param2:String, param3:int) : void
|
||||
{
|
||||
var _loc5_:UserInfo = null;
|
||||
if(_userInfo.hasOwnProperty(param1))
|
||||
{
|
||||
_loc5_ = _userInfo[param1];
|
||||
_userInfo[param2] = _loc5_;
|
||||
_userInfo[param2].userName = param2;
|
||||
_userInfo[param2].userNameModeratedFlag = param3;
|
||||
for each(var _loc4_:AvatarInfo in _loc5_.avList)
|
||||
{
|
||||
_loc4_.userName = param2;
|
||||
_perUserAvIdToUserName[_loc4_.perUserAvId] = param2;
|
||||
}
|
||||
delete _userInfo[param1];
|
||||
}
|
||||
}
|
||||
|
||||
public function getAvatarInfoByUserName(param1:String) : AvatarInfo
|
||||
{
|
||||
param1 = param1;
|
||||
if(_userInfo.hasOwnProperty(param1))
|
||||
{
|
||||
return _userInfo[param1].avList[_userInfo[param1].currPerUserAvId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAvatarInfoByUserNameThenPerUserAvId(param1:String, param2:int) : AvatarInfo
|
||||
{
|
||||
var _loc3_:Object = null;
|
||||
if(_userInfo.hasOwnProperty(param1))
|
||||
{
|
||||
_loc3_ = _userInfo[param1];
|
||||
return _userInfo[param1].avList[param2];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get myPerUserAvId() : int
|
||||
{
|
||||
return _myPerUserAvId;
|
||||
}
|
||||
|
||||
public function setCurrAvDbId(param1:String, param2:int) : void
|
||||
{
|
||||
if(_userInfo.hasOwnProperty(param1))
|
||||
{
|
||||
_userInfo[param1].currPerUserAvId = param2;
|
||||
}
|
||||
}
|
||||
|
||||
public function set myPerUserAvId(param1:int) : void
|
||||
{
|
||||
_myPerUserAvId = param1;
|
||||
if(_userInfo.hasOwnProperty(myUserName) && _userInfo[myUserName])
|
||||
{
|
||||
UserInfo(_userInfo[myUserName]).currPerUserAvId = param1;
|
||||
}
|
||||
}
|
||||
|
||||
public function setAvatarInfoByUsernamePerUserAvId(param1:int, param2:AvatarInfo, param3:Boolean = false) : void
|
||||
{
|
||||
var _loc4_:String = param2.userName;
|
||||
if(!_userInfo.hasOwnProperty(_loc4_))
|
||||
{
|
||||
throw new Error("Invalid setAvatarInfo! Needs userName!");
|
||||
}
|
||||
_userInfo[_loc4_].avList[param1] = param2;
|
||||
if(param3)
|
||||
{
|
||||
_userInfo[_loc4_].currPerUserAvId = param1;
|
||||
_perUserAvIdToUserName[param1] = _loc4_;
|
||||
}
|
||||
}
|
||||
|
||||
public function setAccountTypeByUserName(param1:String, param2:int) : void
|
||||
{
|
||||
param1 = param1.toLowerCase();
|
||||
if(_userInfo.hasOwnProperty(param1))
|
||||
{
|
||||
_userInfo[param1].accountType = param2;
|
||||
}
|
||||
}
|
||||
|
||||
public function set playerAvatarInfo(param1:AvatarInfo) : void
|
||||
{
|
||||
_myPerUserAvId = param1.perUserAvId;
|
||||
myUserName = param1.userName;
|
||||
var _loc2_:UserInfo = UserInfo(_userInfo[myUserName]);
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc2_.avList[_myPerUserAvId] = param1;
|
||||
_loc2_.currPerUserAvId = _myPerUserAvId;
|
||||
}
|
||||
}
|
||||
|
||||
public function get playerAvatarInfo() : AvatarInfo
|
||||
{
|
||||
try
|
||||
{
|
||||
return _userInfo[myUserName].avList[_myPerUserAvId];
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
DebugUtility.debugTrace("Error trying to get playerAvatarInfo! msg:" + e.message);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get myUserName() : String
|
||||
{
|
||||
return _myUserName;
|
||||
}
|
||||
|
||||
public function set myUserName(param1:String) : void
|
||||
{
|
||||
_myUserName = param1;
|
||||
}
|
||||
|
||||
public function get playerUserInfo() : UserInfo
|
||||
{
|
||||
return getUserInfoByUserName(myUserName);
|
||||
}
|
||||
|
||||
public function set playerUserInfo(param1:UserInfo) : void
|
||||
{
|
||||
setUserInfoByUserName(myUserName,param1);
|
||||
}
|
||||
|
||||
public function get userVarCache() : UserVarCache
|
||||
{
|
||||
return _myUserVarCache;
|
||||
}
|
||||
|
||||
public function get userNameModerated() : String
|
||||
{
|
||||
if(gMainFrame.clientInfo.userNameModerated > 0)
|
||||
{
|
||||
return _myUserName;
|
||||
}
|
||||
return LocalizationManager.translateIdOnly(11098);
|
||||
}
|
||||
|
||||
public function setAvatarDefs(param1:Object) : void
|
||||
{
|
||||
_avatarDefs = param1;
|
||||
avtDefsCached = true;
|
||||
}
|
||||
|
||||
public function setCustomAvatarDefs(param1:Object) : void
|
||||
{
|
||||
_customAvatarDefs = param1;
|
||||
}
|
||||
|
||||
public function getAvatarColorLayer1InfoByAvType(param1:uint) : uint
|
||||
{
|
||||
if(_avatarDefs[param1])
|
||||
{
|
||||
return _avatarDefs[param1].colorLayer1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getAvatarColorLayer2InfoByAvType(param1:uint) : uint
|
||||
{
|
||||
if(_avatarDefs[param1])
|
||||
{
|
||||
return _avatarDefs[param1].colorLayer2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getAvatarColorLayer3InfoByAvType(param1:uint) : uint
|
||||
{
|
||||
if(_avatarDefs[param1])
|
||||
{
|
||||
return _avatarDefs[param1].colorLayer3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getAvatarDefEyesInfoByAvType(param1:int) : uint
|
||||
{
|
||||
if(_avatarDefs[param1])
|
||||
{
|
||||
return _avatarDefs[param1].defEyes;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getAvatarMemberInfoByAvType(param1:int) : Boolean
|
||||
{
|
||||
if(_avatarDefs[param1])
|
||||
{
|
||||
return _avatarDefs[param1].isMemOnly;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getAvatarEnviroTypeFlagByAvType(param1:int) : int
|
||||
{
|
||||
if(_avatarDefs[param1])
|
||||
{
|
||||
return _avatarDefs[param1].enviroTypeFlag;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getAllCustomAvatarDefsByAvType(param1:int) : Array
|
||||
{
|
||||
var _loc3_:Array = [];
|
||||
for each(var _loc2_:Object in _customAvatarDefs)
|
||||
{
|
||||
if(_loc2_.avatarRefId == param1)
|
||||
{
|
||||
_loc3_.push(_loc2_);
|
||||
}
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
public function getAvatarDefByAvType(param1:int, param2:Boolean) : Object
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
return _customAvatarDefs[param1];
|
||||
}
|
||||
return _avatarDefs[param1];
|
||||
}
|
||||
|
||||
public function getAvatarDefByAvatar(param1:Avatar) : Object
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
if(param1.customAvId != -1)
|
||||
{
|
||||
return _customAvatarDefs[param1.customAvId];
|
||||
}
|
||||
return _avatarDefs[param1.avTypeId];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function set denRoomDefs(param1:Object) : void
|
||||
{
|
||||
_denRoomDefs = param1;
|
||||
}
|
||||
|
||||
public function get denRoomDefs() : Object
|
||||
{
|
||||
return _denRoomDefs;
|
||||
}
|
||||
|
||||
public function getDenRoomDefByDefId(param1:int) : Object
|
||||
{
|
||||
return _denRoomDefs[param1];
|
||||
}
|
||||
|
||||
public function set genericListDefs(param1:Object) : void
|
||||
{
|
||||
_genericListDefsInfo = param1;
|
||||
}
|
||||
|
||||
public function getGenericListDefByDefId(param1:int) : Object
|
||||
{
|
||||
return _genericListDefsInfo[param1];
|
||||
}
|
||||
|
||||
public function getMyTradeList() : Array
|
||||
{
|
||||
return _myTradeList;
|
||||
}
|
||||
|
||||
public function set myTradeList(param1:Array) : void
|
||||
{
|
||||
_myTradeList = param1;
|
||||
}
|
||||
|
||||
public function removeFromMyTradeList(param1:int) : void
|
||||
{
|
||||
_myTradeList.splice(param1,1);
|
||||
}
|
||||
|
||||
public function set myPetsInDen(param1:Array) : void
|
||||
{
|
||||
_myPetsInDen = param1;
|
||||
}
|
||||
|
||||
public function get myPetsInDen() : Array
|
||||
{
|
||||
return _myPetsInDen;
|
||||
}
|
||||
|
||||
public function isPendingFlagSet(param1:int) : Boolean
|
||||
{
|
||||
return Utility.bitwiseAnd(pendingFlags,Utility.leftShiftNumbers(param1)) != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
package avatar
|
||||
{
|
||||
public class UserVarCache
|
||||
{
|
||||
|
||||
private var _cache:Object;
|
||||
|
||||
public function UserVarCache()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
_cache = {};
|
||||
}
|
||||
|
||||
public function set playerUserVars(param1:Object) : void
|
||||
{
|
||||
_cache = {};
|
||||
for(var _loc2_:String in param1)
|
||||
{
|
||||
_cache[_loc2_] = {
|
||||
"value":param1[_loc2_].value,
|
||||
"type":param1[_loc2_].type
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public function get playerUserVars() : Object
|
||||
{
|
||||
return _cache;
|
||||
}
|
||||
|
||||
public function getUserVarValueById(param1:int) : Number
|
||||
{
|
||||
if(_cache && _cache[param1])
|
||||
{
|
||||
return _cache[param1].value;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public function getUserVarTypeById(param1:int) : int
|
||||
{
|
||||
if(_cache && _cache[param1])
|
||||
{
|
||||
return _cache[param1].type;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public function isBitSet(param1:int, param2:int) : Boolean
|
||||
{
|
||||
if(_cache && _cache[param1])
|
||||
{
|
||||
return Utility.bitwiseAnd(_cache[param1].value,Utility.leftShiftNumbers(param2)) > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function numBitsSet(param1:int, param2:int) : int
|
||||
{
|
||||
var _loc4_:int = 0;
|
||||
if(param1 == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var _loc3_:int = 0;
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < param2)
|
||||
{
|
||||
if(Utility.bitwiseAnd(param1,Utility.leftShiftNumbers(_loc4_)) > 0)
|
||||
{
|
||||
_loc3_++;
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
public function updateUserVar(param1:int, param2:Number, param3:int = -1) : void
|
||||
{
|
||||
if(!_cache)
|
||||
{
|
||||
_cache = {};
|
||||
}
|
||||
if(_cache[param1])
|
||||
{
|
||||
_cache[param1].value = param2;
|
||||
}
|
||||
else
|
||||
{
|
||||
_cache[param1] = {
|
||||
"value":param2,
|
||||
"type":param3
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
package buddy
|
||||
{
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class Buddy
|
||||
{
|
||||
|
||||
private var _userName:String;
|
||||
|
||||
private var _uuid:String;
|
||||
|
||||
private var _onlineStatus:int;
|
||||
|
||||
private var _numDaysSinceLastLogin:int;
|
||||
|
||||
private var _userNameModerationFlag:int;
|
||||
|
||||
private var _accountType:int;
|
||||
|
||||
private var _timeLeftHostingCustomParty:int;
|
||||
|
||||
public function Buddy()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:String, param2:String, param3:int, param4:int, param5:int, param6:int = 0, param7:int = -1) : void
|
||||
{
|
||||
_userName = param1;
|
||||
_uuid = param2;
|
||||
_onlineStatus = param4;
|
||||
_numDaysSinceLastLogin = param6;
|
||||
_userNameModerationFlag = param3;
|
||||
_accountType = param5;
|
||||
_timeLeftHostingCustomParty = param7;
|
||||
}
|
||||
|
||||
public function get userName() : String
|
||||
{
|
||||
return _userName;
|
||||
}
|
||||
|
||||
public function get uuid() : String
|
||||
{
|
||||
return _uuid;
|
||||
}
|
||||
|
||||
public function get userNameModerated() : String
|
||||
{
|
||||
if(_userNameModerationFlag > 0)
|
||||
{
|
||||
return _userName;
|
||||
}
|
||||
return LocalizationManager.translateIdOnly(11098);
|
||||
}
|
||||
|
||||
public function get onlineStatus() : int
|
||||
{
|
||||
return _onlineStatus;
|
||||
}
|
||||
|
||||
public function get isOnline() : Boolean
|
||||
{
|
||||
return _onlineStatus == 1;
|
||||
}
|
||||
|
||||
public function get numDaysSinceLastLogin() : int
|
||||
{
|
||||
return _numDaysSinceLastLogin;
|
||||
}
|
||||
|
||||
public function get accountType() : int
|
||||
{
|
||||
return _accountType;
|
||||
}
|
||||
|
||||
public function get userNameModeratedFlag() : int
|
||||
{
|
||||
return _userNameModerationFlag;
|
||||
}
|
||||
|
||||
public function get timeLeftHostingCustomParty() : int
|
||||
{
|
||||
return _timeLeftHostingCustomParty;
|
||||
}
|
||||
|
||||
public function set userName(param1:String) : void
|
||||
{
|
||||
_userName = param1;
|
||||
}
|
||||
|
||||
public function set uuid(param1:String) : void
|
||||
{
|
||||
_uuid = param1;
|
||||
}
|
||||
|
||||
public function set userNameModeratedFlag(param1:int) : void
|
||||
{
|
||||
_userNameModerationFlag = param1;
|
||||
}
|
||||
|
||||
public function set onlineStatus(param1:int) : void
|
||||
{
|
||||
_onlineStatus = param1;
|
||||
}
|
||||
|
||||
public function set numDaysSinceLastLogin(param1:int) : void
|
||||
{
|
||||
_numDaysSinceLastLogin = param1;
|
||||
}
|
||||
|
||||
public function set timeLeftHostingCustomParty(param1:int) : void
|
||||
{
|
||||
_timeLeftHostingCustomParty = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package buddy
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class BuddyEvent extends Event
|
||||
{
|
||||
|
||||
public static const BUDDY_LIST:String = "OnBuddyList";
|
||||
|
||||
public static const BUDDY_CHANGED:String = "OnBuddyChanged";
|
||||
|
||||
public var userName:String;
|
||||
|
||||
public function BuddyEvent(param1:String)
|
||||
{
|
||||
super(param1);
|
||||
}
|
||||
|
||||
override public function clone() : Event
|
||||
{
|
||||
return new BuddyEvent(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package buddy
|
||||
{
|
||||
import flash.utils.Timer;
|
||||
|
||||
public class BuddyTimer extends Timer
|
||||
{
|
||||
|
||||
public var userName:String;
|
||||
|
||||
public function BuddyTimer(param1:Number, param2:int = 0)
|
||||
{
|
||||
super(param1,param2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
package buddy
|
||||
{
|
||||
import com.sbi.client.SFEvent;
|
||||
import gui.BuddyCard;
|
||||
import gui.BuddyManager;
|
||||
|
||||
public class BuddyXtCommManager
|
||||
{
|
||||
|
||||
private static var _searchCallback:Function;
|
||||
|
||||
private static var _requestCallback:Function;
|
||||
|
||||
private static var _buddyRoomCallback:Function;
|
||||
|
||||
private static var _buddyBlockInfoInProgress:Boolean;
|
||||
|
||||
public function BuddyXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function sendBuddyListRequest(param1:Function = null) : void
|
||||
{
|
||||
_requestCallback = param1;
|
||||
gMainFrame.server.setXtObject_Str("bl",[]);
|
||||
}
|
||||
|
||||
public static function sendBuddyAddRequest(param1:String) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("ba",[param1]);
|
||||
}
|
||||
|
||||
public static function sendBuddyFillRequest() : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("bf",[]);
|
||||
}
|
||||
|
||||
public static function sendBuddyConfirmRequest(param1:String, param2:Boolean) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("bc",[param1,param2 ? "1" : "0"]);
|
||||
}
|
||||
|
||||
public static function sendBuddyDeleteRequest(param1:String) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("bd",[param1]);
|
||||
}
|
||||
|
||||
public static function sendBuddyRoomRequest(param1:String, param2:Function = null) : void
|
||||
{
|
||||
_buddyRoomCallback = param2;
|
||||
gMainFrame.server.setXtObject_Str("br",[param1],true,false,false);
|
||||
}
|
||||
|
||||
public static function sendBuddyBlockRequest(param1:String) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("bb",[param1]);
|
||||
}
|
||||
|
||||
public static function sendBuddyUnblockRequest(param1:String) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("bu",[param1]);
|
||||
}
|
||||
|
||||
public static function sendBuddyBlockInfoRequest(param1:String) : void
|
||||
{
|
||||
if(!_buddyBlockInfoInProgress && param1 != null && param1 != "")
|
||||
{
|
||||
_buddyBlockInfoInProgress = true;
|
||||
gMainFrame.server.setXtObject_Str("bi",[param1]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendSearchRequest(param1:String, param2:Function) : void
|
||||
{
|
||||
_searchCallback = param2;
|
||||
userSearchResponse([false,-1]);
|
||||
}
|
||||
|
||||
public static function handleXtReply(param1:SFEvent) : void
|
||||
{
|
||||
var _loc2_:Array = param1.obj;
|
||||
switch(_loc2_[0])
|
||||
{
|
||||
case "bl":
|
||||
buddyListblockedListResponse(_loc2_);
|
||||
break;
|
||||
case "ba":
|
||||
buddyAddRequestResponse(int(_loc2_[2]),_loc2_[3],_loc2_[4]);
|
||||
break;
|
||||
case "bs":
|
||||
buddyStatusResponse(_loc2_);
|
||||
break;
|
||||
case "bd":
|
||||
buddyDeleteResponse(_loc2_[2]);
|
||||
break;
|
||||
case "br":
|
||||
buddyRoomResponse(_loc2_);
|
||||
break;
|
||||
case "bb":
|
||||
buddyBlockResponse(_loc2_);
|
||||
break;
|
||||
case "bu":
|
||||
buddyUnblockResponse(_loc2_);
|
||||
break;
|
||||
case "bi":
|
||||
buddyIsBlockingMeResponse(_loc2_);
|
||||
break;
|
||||
default:
|
||||
throw new Error("BuddyXtCommManager illegal data:" + _loc2_[0]);
|
||||
}
|
||||
}
|
||||
|
||||
private static function buddyListblockedListResponse(param1:Object) : void
|
||||
{
|
||||
if(param1[2] == "0")
|
||||
{
|
||||
BuddyManager.buddyListResponseHandler(param1);
|
||||
}
|
||||
else
|
||||
{
|
||||
BuddyManager.blockedListResponseHandler(param1);
|
||||
}
|
||||
if(_requestCallback != null)
|
||||
{
|
||||
_requestCallback();
|
||||
_requestCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static function buddyAddRequestResponse(param1:int, param2:String, param3:int) : void
|
||||
{
|
||||
BuddyManager.buddyAddRequestResponseHandler(param1,param2,param3);
|
||||
}
|
||||
|
||||
private static function buddyStatusResponse(param1:Object) : void
|
||||
{
|
||||
if(param1[2] == "1")
|
||||
{
|
||||
BuddyManager.buddyStatusResponseHandler(param1[3],param1[4],param1[5],param1[6] == "1",int(param1[7]),int(param1[8]),null,param1[9],param1[10],param1[11]);
|
||||
}
|
||||
else
|
||||
{
|
||||
BuddyManager.buddyStatusResponseHandler(param1[3],param1[4],param1[5],param1[6] == "1",int(param1[7]),int(param1[8]),param1[9]);
|
||||
}
|
||||
}
|
||||
|
||||
private static function buddyDeleteResponse(param1:String) : void
|
||||
{
|
||||
BuddyManager.buddyDeleteResponseHandler(param1);
|
||||
}
|
||||
|
||||
private static function buddyRoomResponse(param1:Object) : void
|
||||
{
|
||||
var _loc2_:String = param1[2];
|
||||
var _loc3_:String = param1[3];
|
||||
var _loc4_:Boolean = param1[5] == "1";
|
||||
BuddyCard.buddyRoomResponseHandler(_loc2_,_loc3_,param1[4],_loc4_);
|
||||
if(_buddyRoomCallback != null)
|
||||
{
|
||||
_buddyRoomCallback(_loc2_,_loc3_,_loc4_);
|
||||
_buddyRoomCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static function buddyBlockResponse(param1:Object) : void
|
||||
{
|
||||
BuddyManager.buddyBlockResponseHandler(param1[2],param1[3] == "1");
|
||||
}
|
||||
|
||||
private static function buddyUnblockResponse(param1:Object) : void
|
||||
{
|
||||
BuddyManager.buddyUnblockResponseHandler(param1[2],param1[3] == "1");
|
||||
}
|
||||
|
||||
private static function userSearchResponse(param1:Object) : void
|
||||
{
|
||||
_searchCallback(param1[0],param1[1]);
|
||||
}
|
||||
|
||||
private static function buddyIsBlockingMeResponse(param1:Object) : void
|
||||
{
|
||||
BuddyCard.buddyBlockInfoResponseHandler(param1[2],param1[3] == "1");
|
||||
_buddyBlockInfoInProgress = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.adobe.crypto
|
||||
{
|
||||
import com.adobe.utils.IntUtil;
|
||||
|
||||
public class MD5
|
||||
{
|
||||
|
||||
public function MD5()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function hash(param1:String) : String
|
||||
{
|
||||
var _loc7_:int = 0;
|
||||
var _loc9_:int = 0;
|
||||
var _loc10_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
var _loc11_:int = 0;
|
||||
var _loc6_:int = 1732584193;
|
||||
var _loc4_:int = -271733879;
|
||||
var _loc5_:int = -1732584194;
|
||||
var _loc3_:int = 271733878;
|
||||
var _loc12_:Array = createBlocks(param1);
|
||||
var _loc8_:int = int(_loc12_.length);
|
||||
_loc11_ = 0;
|
||||
while(_loc11_ < _loc8_)
|
||||
{
|
||||
_loc7_ = _loc6_;
|
||||
_loc9_ = _loc4_;
|
||||
_loc10_ = _loc5_;
|
||||
_loc2_ = _loc3_;
|
||||
_loc6_ = ff(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 0],7,-680876936);
|
||||
_loc3_ = ff(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 1],12,-389564586);
|
||||
_loc5_ = ff(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 2],17,606105819);
|
||||
_loc4_ = ff(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 3],22,-1044525330);
|
||||
_loc6_ = ff(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 4],7,-176418897);
|
||||
_loc3_ = ff(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 5],12,1200080426);
|
||||
_loc5_ = ff(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 6],17,-1473231341);
|
||||
_loc4_ = ff(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 7],22,-45705983);
|
||||
_loc6_ = ff(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 8],7,1770035416);
|
||||
_loc3_ = ff(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 9],12,-1958414417);
|
||||
_loc5_ = ff(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 10],17,-42063);
|
||||
_loc4_ = ff(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 11],22,-1990404162);
|
||||
_loc6_ = ff(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 12],7,1804603682);
|
||||
_loc3_ = ff(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 13],12,-40341101);
|
||||
_loc5_ = ff(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 14],17,-1502002290);
|
||||
_loc4_ = ff(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 15],22,1236535329);
|
||||
_loc6_ = gg(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 1],5,-165796510);
|
||||
_loc3_ = gg(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 6],9,-1069501632);
|
||||
_loc5_ = gg(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 11],14,643717713);
|
||||
_loc4_ = gg(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 0],20,-373897302);
|
||||
_loc6_ = gg(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 5],5,-701558691);
|
||||
_loc3_ = gg(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 10],9,38016083);
|
||||
_loc5_ = gg(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 15],14,-660478335);
|
||||
_loc4_ = gg(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 4],20,-405537848);
|
||||
_loc6_ = gg(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 9],5,568446438);
|
||||
_loc3_ = gg(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 14],9,-1019803690);
|
||||
_loc5_ = gg(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 3],14,-187363961);
|
||||
_loc4_ = gg(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 8],20,1163531501);
|
||||
_loc6_ = gg(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 13],5,-1444681467);
|
||||
_loc3_ = gg(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 2],9,-51403784);
|
||||
_loc5_ = gg(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 7],14,1735328473);
|
||||
_loc4_ = gg(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 12],20,-1926607734);
|
||||
_loc6_ = hh(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 5],4,-378558);
|
||||
_loc3_ = hh(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 8],11,-2022574463);
|
||||
_loc5_ = hh(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 11],16,1839030562);
|
||||
_loc4_ = hh(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 14],23,-35309556);
|
||||
_loc6_ = hh(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 1],4,-1530992060);
|
||||
_loc3_ = hh(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 4],11,1272893353);
|
||||
_loc5_ = hh(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 7],16,-155497632);
|
||||
_loc4_ = hh(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 10],23,-1094730640);
|
||||
_loc6_ = hh(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 13],4,681279174);
|
||||
_loc3_ = hh(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 0],11,-358537222);
|
||||
_loc5_ = hh(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 3],16,-722521979);
|
||||
_loc4_ = hh(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 6],23,76029189);
|
||||
_loc6_ = hh(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 9],4,-640364487);
|
||||
_loc3_ = hh(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 12],11,-421815835);
|
||||
_loc5_ = hh(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 15],16,530742520);
|
||||
_loc4_ = hh(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 2],23,-995338651);
|
||||
_loc6_ = ii(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 0],6,-198630844);
|
||||
_loc3_ = ii(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 7],10,1126891415);
|
||||
_loc5_ = ii(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 14],15,-1416354905);
|
||||
_loc4_ = ii(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 5],21,-57434055);
|
||||
_loc6_ = ii(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 12],6,1700485571);
|
||||
_loc3_ = ii(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 3],10,-1894986606);
|
||||
_loc5_ = ii(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 10],15,-1051523);
|
||||
_loc4_ = ii(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 1],21,-2054922799);
|
||||
_loc6_ = ii(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 8],6,1873313359);
|
||||
_loc3_ = ii(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 15],10,-30611744);
|
||||
_loc5_ = ii(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 6],15,-1560198380);
|
||||
_loc4_ = ii(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 13],21,1309151649);
|
||||
_loc6_ = ii(_loc6_,_loc4_,_loc5_,_loc3_,_loc12_[_loc11_ + 4],6,-145523070);
|
||||
_loc3_ = ii(_loc3_,_loc6_,_loc4_,_loc5_,_loc12_[_loc11_ + 11],10,-1120210379);
|
||||
_loc5_ = ii(_loc5_,_loc3_,_loc6_,_loc4_,_loc12_[_loc11_ + 2],15,718787259);
|
||||
_loc4_ = ii(_loc4_,_loc5_,_loc3_,_loc6_,_loc12_[_loc11_ + 9],21,-343485551);
|
||||
_loc6_ += _loc7_;
|
||||
_loc4_ += _loc9_;
|
||||
_loc5_ += _loc10_;
|
||||
_loc3_ += _loc2_;
|
||||
_loc11_ += 16;
|
||||
}
|
||||
return IntUtil.toHex(_loc6_) + IntUtil.toHex(_loc4_) + IntUtil.toHex(_loc5_) + IntUtil.toHex(_loc3_);
|
||||
}
|
||||
|
||||
private static function f(param1:int, param2:int, param3:int) : int
|
||||
{
|
||||
return param1 & param2 | ~param1 & param3;
|
||||
}
|
||||
|
||||
private static function g(param1:int, param2:int, param3:int) : int
|
||||
{
|
||||
return param1 & param3 | param2 & ~param3;
|
||||
}
|
||||
|
||||
private static function h(param1:int, param2:int, param3:int) : int
|
||||
{
|
||||
return param1 ^ param2 ^ param3;
|
||||
}
|
||||
|
||||
private static function i(param1:int, param2:int, param3:int) : int
|
||||
{
|
||||
return param2 ^ (param1 | ~param3);
|
||||
}
|
||||
|
||||
private static function transform(param1:Function, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int, param8:int) : int
|
||||
{
|
||||
var _loc9_:int = param2 + int(param1(param3,param4,param5)) + param6 + param8;
|
||||
return IntUtil.rol(_loc9_,param7) + param3;
|
||||
}
|
||||
|
||||
private static function ff(param1:int, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int) : int
|
||||
{
|
||||
return transform(f,param1,param2,param3,param4,param5,param6,param7);
|
||||
}
|
||||
|
||||
private static function gg(param1:int, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int) : int
|
||||
{
|
||||
return transform(g,param1,param2,param3,param4,param5,param6,param7);
|
||||
}
|
||||
|
||||
private static function hh(param1:int, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int) : int
|
||||
{
|
||||
return transform(h,param1,param2,param3,param4,param5,param6,param7);
|
||||
}
|
||||
|
||||
private static function ii(param1:int, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int) : int
|
||||
{
|
||||
return transform(i,param1,param2,param3,param4,param5,param6,param7);
|
||||
}
|
||||
|
||||
private static function createBlocks(param1:String) : Array
|
||||
{
|
||||
var _loc5_:int = 0;
|
||||
var _loc4_:Array = [];
|
||||
var _loc3_:int = param1.length * 8;
|
||||
var _loc2_:int = 255;
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < _loc3_)
|
||||
{
|
||||
var _loc6_:int = _loc5_ >> 5;
|
||||
var _loc7_:int = _loc4_[_loc6_] | (param1.charCodeAt(_loc5_ / 8) & _loc2_) << _loc5_ % 32;
|
||||
_loc4_[_loc6_] = _loc7_;
|
||||
_loc5_ += 8;
|
||||
}
|
||||
_loc7_ = _loc3_ >> 5;
|
||||
_loc6_ = _loc4_[_loc7_] | 128 << _loc3_ % 32;
|
||||
_loc4_[_loc7_] = _loc6_;
|
||||
_loc4_[(_loc3_ + 64 >>> 9 << 4) + 14] = _loc3_;
|
||||
return _loc4_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.adobe.utils
|
||||
{
|
||||
public class IntUtil
|
||||
{
|
||||
|
||||
private static var hexChars:String = "0123456789abcdef";
|
||||
|
||||
public function IntUtil()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function rol(param1:int, param2:int) : int
|
||||
{
|
||||
return param1 << param2 | param1 >>> 32 - param2;
|
||||
}
|
||||
|
||||
public static function ror(param1:int, param2:int) : uint
|
||||
{
|
||||
var _loc3_:int = 32 - param2;
|
||||
return param1 << _loc3_ | param1 >>> 32 - _loc3_;
|
||||
}
|
||||
|
||||
public static function toHex(param1:int, param2:Boolean = false) : String
|
||||
{
|
||||
var _loc5_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
var _loc3_:String = "";
|
||||
if(param2)
|
||||
{
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < 4)
|
||||
{
|
||||
_loc3_ += hexChars.charAt(param1 >> (3 - _loc5_) * 8 + 4 & 0x0F) + hexChars.charAt(param1 >> (3 - _loc5_) * 8 & 0x0F);
|
||||
_loc5_++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < 4)
|
||||
{
|
||||
_loc3_ += hexChars.charAt(param1 >> _loc4_ * 8 + 4 & 0x0F) + hexChars.charAt(param1 >> _loc4_ * 8 & 0x0F);
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.adobe.utils
|
||||
{
|
||||
public class StringUtil
|
||||
{
|
||||
|
||||
public function StringUtil()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function stringsAreEqual(param1:String, param2:String, param3:Boolean) : Boolean
|
||||
{
|
||||
if(param3)
|
||||
{
|
||||
return param1 == param2;
|
||||
}
|
||||
return param1.toUpperCase() == param2.toUpperCase();
|
||||
}
|
||||
|
||||
public static function trim(param1:String) : String
|
||||
{
|
||||
return StringUtil.ltrim(StringUtil.rtrim(param1));
|
||||
}
|
||||
|
||||
public static function ltrim(param1:String) : String
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc3_:Number = param1.length;
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _loc3_)
|
||||
{
|
||||
if(param1.charCodeAt(_loc2_) > 32)
|
||||
{
|
||||
return param1.substring(_loc2_);
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static function rtrim(param1:String) : String
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc3_:Number = param1.length;
|
||||
_loc2_ = _loc3_;
|
||||
while(_loc2_ > 0)
|
||||
{
|
||||
if(param1.charCodeAt(_loc2_ - 1) > 32)
|
||||
{
|
||||
return param1.substring(0,_loc2_);
|
||||
}
|
||||
_loc2_--;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static function beginsWith(param1:String, param2:String) : Boolean
|
||||
{
|
||||
return param2 == param1.substring(0,param2.length);
|
||||
}
|
||||
|
||||
public static function endsWith(param1:String, param2:String) : Boolean
|
||||
{
|
||||
return param2 == param1.substring(param1.length - param2.length);
|
||||
}
|
||||
|
||||
public static function remove(param1:String, param2:String) : String
|
||||
{
|
||||
return StringUtil.replace(param1,param2,"");
|
||||
}
|
||||
|
||||
public static function replace(param1:String, param2:String, param3:String) : String
|
||||
{
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc6_:Number = NaN;
|
||||
var _loc5_:String = new String();
|
||||
var _loc9_:Boolean = false;
|
||||
var _loc7_:Number = param1.length;
|
||||
var _loc4_:Number = param2.length;
|
||||
_loc8_ = 0;
|
||||
for(; _loc8_ < _loc7_; _loc8_++)
|
||||
{
|
||||
if(param1.charAt(_loc8_) == param2.charAt(0))
|
||||
{
|
||||
_loc9_ = true;
|
||||
_loc6_ = 0;
|
||||
while(_loc6_ < _loc4_)
|
||||
{
|
||||
if(param1.charAt(_loc8_ + _loc6_) != param2.charAt(_loc6_))
|
||||
{
|
||||
_loc9_ = false;
|
||||
break;
|
||||
}
|
||||
_loc6_++;
|
||||
}
|
||||
if(_loc9_)
|
||||
{
|
||||
_loc5_ += param3;
|
||||
_loc8_ += _loc4_ - 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
_loc5_ += param1.charAt(_loc8_);
|
||||
}
|
||||
return _loc5_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.baseoneonline.astar
|
||||
{
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
public class AStar
|
||||
{
|
||||
|
||||
private var graph:Graph;
|
||||
|
||||
private var g:Vector.<Number>;
|
||||
|
||||
private var h:Vector.<Number>;
|
||||
|
||||
private var f:Vector.<Number>;
|
||||
|
||||
private var parent:Vector.<int>;
|
||||
|
||||
private var open:Vector.<int>;
|
||||
|
||||
private var closed:Vector.<int>;
|
||||
|
||||
private var closedDict:Dictionary;
|
||||
|
||||
private var goalReached:Boolean = false;
|
||||
|
||||
public function AStar(param1:Graph = null)
|
||||
{
|
||||
super();
|
||||
if(param1)
|
||||
{
|
||||
setGraph(param1);
|
||||
}
|
||||
}
|
||||
|
||||
public function setGraph(param1:Graph) : void
|
||||
{
|
||||
this.graph = param1;
|
||||
updateGraph();
|
||||
}
|
||||
|
||||
private function updateGraph() : void
|
||||
{
|
||||
var _loc1_:int = graph.size();
|
||||
g = new Vector.<Number>(_loc1_,true);
|
||||
h = new Vector.<Number>(_loc1_,true);
|
||||
f = new Vector.<Number>(_loc1_,true);
|
||||
parent = new Vector.<int>(_loc1_,true);
|
||||
}
|
||||
|
||||
public function solve(param1:int, param2:int) : Vector.<int>
|
||||
{
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc14_:int = 0;
|
||||
var _loc9_:int = 0;
|
||||
var _loc5_:int = 0;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc11_:Boolean = false;
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc10_:Vector.<int> = new Vector.<int>();
|
||||
goalReached = false;
|
||||
open = new Vector.<int>();
|
||||
closed = new Vector.<int>();
|
||||
closedDict = new Dictionary(true);
|
||||
open.push(param1);
|
||||
g[param1] = 0;
|
||||
h[param1] = graph.distance(param1,param2);
|
||||
f[param1] = h[param1];
|
||||
parent[param1] = -1;
|
||||
graph.setStartGridPos(param1);
|
||||
while(open.length > 0)
|
||||
{
|
||||
_loc8_ = Infinity;
|
||||
_loc14_ = -1;
|
||||
_loc9_ = 0;
|
||||
while(_loc9_ < open.length)
|
||||
{
|
||||
_loc5_ = open[_loc9_];
|
||||
if(f[_loc5_] < _loc8_)
|
||||
{
|
||||
_loc8_ = f[_loc5_];
|
||||
_loc14_ = _loc5_;
|
||||
}
|
||||
_loc9_++;
|
||||
}
|
||||
if(_loc14_ == param2)
|
||||
{
|
||||
goalReached = true;
|
||||
return createPath(param2,param1);
|
||||
}
|
||||
open.splice(open.indexOf(_loc14_),1);
|
||||
closed.push(_loc14_);
|
||||
closedDict[_loc14_] = 1;
|
||||
for each(var _loc13_:int in graph.getNeighbors(_loc14_,_loc10_))
|
||||
{
|
||||
if(closedDict[_loc13_] != 1)
|
||||
{
|
||||
_loc7_ = g[_loc14_] + graph.distance(_loc14_,_loc13_);
|
||||
_loc11_ = false;
|
||||
if(open.indexOf(_loc13_) == -1)
|
||||
{
|
||||
open.push(_loc13_);
|
||||
_loc11_ = true;
|
||||
}
|
||||
else if(_loc7_ < g[_loc13_])
|
||||
{
|
||||
_loc11_ = true;
|
||||
}
|
||||
if(_loc11_)
|
||||
{
|
||||
parent[_loc13_] = _loc14_;
|
||||
g[_loc13_] = _loc7_;
|
||||
h[_loc13_] = graph.distance(_loc13_,param2);
|
||||
f[_loc13_] = g[_loc13_] + h[_loc13_];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var _loc3_:Number = Infinity;
|
||||
var _loc12_:int = -1;
|
||||
for each(var _loc6_:int in closed)
|
||||
{
|
||||
_loc4_ = h[_loc6_];
|
||||
if(_loc4_ < _loc3_)
|
||||
{
|
||||
_loc3_ = _loc4_;
|
||||
_loc12_ = _loc6_;
|
||||
}
|
||||
}
|
||||
return createPath(_loc12_,param1);
|
||||
}
|
||||
|
||||
public function hasReachedGoal() : Boolean
|
||||
{
|
||||
return goalReached;
|
||||
}
|
||||
|
||||
private function createPath(param1:int, param2:int) : Vector.<int>
|
||||
{
|
||||
var _loc3_:Vector.<int> = new Vector.<int>();
|
||||
while(parent[param1] != -1)
|
||||
{
|
||||
_loc3_.push(param1);
|
||||
param1 = parent[param1];
|
||||
}
|
||||
_loc3_.push(param2);
|
||||
return _loc3_.reverse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.baseoneonline.astar
|
||||
{
|
||||
public interface Graph
|
||||
{
|
||||
|
||||
function getNeighbors(param1:int, param2:Vector.<int>) : Vector.<int>;
|
||||
|
||||
function distance(param1:int, param2:int) : Number;
|
||||
|
||||
function size() : int;
|
||||
|
||||
function setStartGridPos(param1:int) : void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.carlcalderon.arthropod
|
||||
{
|
||||
import flash.display.BitmapData;
|
||||
import flash.display.Stage;
|
||||
import flash.events.StatusEvent;
|
||||
import flash.geom.Matrix;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.net.LocalConnection;
|
||||
import flash.system.System;
|
||||
|
||||
public class Debug
|
||||
{
|
||||
|
||||
public static const NAME:String = "Debug";
|
||||
|
||||
public static const VERSION:String = "0.74";
|
||||
|
||||
public static var password:String = "CDC309AF";
|
||||
|
||||
public static var RED:uint = 13369344;
|
||||
|
||||
public static var GREEN:uint = 52224;
|
||||
|
||||
public static var BLUE:uint = 6710988;
|
||||
|
||||
public static var PINK:uint = 13369548;
|
||||
|
||||
public static var YELLOW:uint = 13421568;
|
||||
|
||||
public static var LIGHT_BLUE:uint = 52428;
|
||||
|
||||
public static var ignoreStatus:Boolean = true;
|
||||
|
||||
public static var secure:Boolean = false;
|
||||
|
||||
public static var secureDomain:String = "*";
|
||||
|
||||
public static var allowLog:Boolean = true;
|
||||
|
||||
private static const DOMAIN:String = "com.carlcalderon.Arthropod";
|
||||
|
||||
private static const CHECK:String = ".161E714B6C1A76DE7B9865F88B32FCCE8FABA7B5.1";
|
||||
|
||||
private static const TYPE:String = "app";
|
||||
|
||||
private static const CONNECTION:String = "arthropod";
|
||||
|
||||
private static const LOG_OPERATION:String = "debug";
|
||||
|
||||
private static const ERROR_OPERATION:String = "debugError";
|
||||
|
||||
private static const WARNING_OPERATION:String = "debugWarning";
|
||||
|
||||
private static const ARRAY_OPERATION:String = "debugArray";
|
||||
|
||||
private static const BITMAP_OPERATION:String = "debugBitmapData";
|
||||
|
||||
private static const OBJECT_OPERATION:String = "debugObject";
|
||||
|
||||
private static const MEMORY_OPERATION:String = "debugMemory";
|
||||
|
||||
private static const CLEAR_OPERATION:String = "debugClear";
|
||||
|
||||
private static var hasEventListeners:Boolean = false;
|
||||
|
||||
private static var lc:LocalConnection = new LocalConnection();
|
||||
|
||||
public function Debug()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function log(param1:*, param2:uint = 16711422) : Boolean
|
||||
{
|
||||
return send("debug",String(param1),param2);
|
||||
}
|
||||
|
||||
public static function error(param1:*) : Boolean
|
||||
{
|
||||
return send("debugError",String(param1),13369344);
|
||||
}
|
||||
|
||||
public static function warning(param1:*) : Boolean
|
||||
{
|
||||
return send("debugWarning",String(param1),13421568);
|
||||
}
|
||||
|
||||
public static function clear() : Boolean
|
||||
{
|
||||
return send("debugClear",0,0);
|
||||
}
|
||||
|
||||
public static function array(param1:Array) : Boolean
|
||||
{
|
||||
return send("debugArray",param1,null);
|
||||
}
|
||||
|
||||
public static function bitmap(param1:*, param2:String = null) : Boolean
|
||||
{
|
||||
var _loc5_:BitmapData = new BitmapData(100,100,true,16777215);
|
||||
var _loc6_:Matrix = new Matrix();
|
||||
var _loc4_:Number = 100 / (param1.width >= param1.height ? param1.width : param1.height);
|
||||
_loc6_.scale(_loc4_,_loc4_);
|
||||
_loc5_.draw(param1,_loc6_,null,null,null,true);
|
||||
var _loc3_:Rectangle = new Rectangle(0,0,Math.floor(param1.width * _loc4_),Math.floor(param1.height * _loc4_));
|
||||
return send("debugBitmapData",_loc5_.getPixels(_loc3_),{
|
||||
"bounds":_loc3_,
|
||||
"lbl":param2
|
||||
});
|
||||
}
|
||||
|
||||
public static function snapshot(param1:Stage, param2:String = null) : Boolean
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
return bitmap(param1,param2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function object(param1:*) : Boolean
|
||||
{
|
||||
return send("debugObject",param1,null);
|
||||
}
|
||||
|
||||
public static function memory() : Boolean
|
||||
{
|
||||
return send("debugMemory",System.totalMemory,null);
|
||||
}
|
||||
|
||||
private static function send(param1:String, param2:*, param3:*) : Boolean
|
||||
{
|
||||
if(!secure)
|
||||
{
|
||||
lc.allowInsecureDomain("*");
|
||||
}
|
||||
else
|
||||
{
|
||||
lc.allowDomain(secureDomain);
|
||||
}
|
||||
if(!hasEventListeners)
|
||||
{
|
||||
if(ignoreStatus)
|
||||
{
|
||||
lc.addEventListener("status",ignore);
|
||||
}
|
||||
else
|
||||
{
|
||||
lc.addEventListener("status",status);
|
||||
}
|
||||
hasEventListeners = true;
|
||||
}
|
||||
if(allowLog)
|
||||
{
|
||||
try
|
||||
{
|
||||
lc.send("app#com.carlcalderon.Arthropod.161E714B6C1A76DE7B9865F88B32FCCE8FABA7B5.1:arthropod",param1,password,param2,param3);
|
||||
return true;
|
||||
}
|
||||
catch(e:*)
|
||||
{
|
||||
var _loc6_:Boolean = false;
|
||||
}
|
||||
return _loc6_;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static function status(param1:StatusEvent) : void
|
||||
{
|
||||
trace("Arthropod status:\n" + param1.toString());
|
||||
}
|
||||
|
||||
private static function ignore(param1:StatusEvent) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,825 @@
|
||||
package com.greensock
|
||||
{
|
||||
import flash.display.BitmapData;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Graphics;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.geom.ColorTransform;
|
||||
import flash.geom.Matrix;
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.geom.Transform;
|
||||
|
||||
public class BlitMask extends Sprite
|
||||
{
|
||||
|
||||
public static var version:Number = 0.62;
|
||||
|
||||
protected static var _tempContainer:Sprite = new Sprite();
|
||||
|
||||
protected static var _sliceRect:Rectangle = new Rectangle();
|
||||
|
||||
protected static var _drawRect:Rectangle = new Rectangle();
|
||||
|
||||
protected static var _destPoint:Point = new Point();
|
||||
|
||||
protected static var _tempMatrix:Matrix = new Matrix();
|
||||
|
||||
protected static var _emptyArray:Array = [];
|
||||
|
||||
protected static var _colorTransform:ColorTransform = new ColorTransform();
|
||||
|
||||
protected static var _mouseEvents:Array = ["click","doubleClick","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","mouseWheel","rollOut","rollOver","gesturePressAndTap","gesturePan","gestureRotate","gestureSwipe","gestureZoom","gestureTwoFingerTap","touchBegin","touchEnd","touchMove","touchOut","touchOver","touchRollOut","touchRollOver","touchTap"];
|
||||
|
||||
protected var _target:DisplayObject;
|
||||
|
||||
protected var _fillColor:uint;
|
||||
|
||||
protected var _smoothing:Boolean;
|
||||
|
||||
protected var _width:Number;
|
||||
|
||||
protected var _height:Number;
|
||||
|
||||
protected var _bd:BitmapData;
|
||||
|
||||
protected var _gridSize:int = 2879;
|
||||
|
||||
protected var _grid:Array;
|
||||
|
||||
protected var _bounds:Rectangle;
|
||||
|
||||
protected var _clipRect:Rectangle;
|
||||
|
||||
protected var _bitmapMode:Boolean;
|
||||
|
||||
protected var _rows:int;
|
||||
|
||||
protected var _columns:int;
|
||||
|
||||
protected var _scaleX:Number;
|
||||
|
||||
protected var _scaleY:Number;
|
||||
|
||||
protected var _prevMatrix:Matrix;
|
||||
|
||||
protected var _transform:Transform;
|
||||
|
||||
protected var _prevRotation:Number;
|
||||
|
||||
protected var _autoUpdate:Boolean;
|
||||
|
||||
protected var _wrap:Boolean;
|
||||
|
||||
protected var _wrapOffsetX:Number = 0;
|
||||
|
||||
protected var _wrapOffsetY:Number = 0;
|
||||
|
||||
public function BlitMask(param1:DisplayObject, param2:Number = 0, param3:Number = 0, param4:Number = 100, param5:Number = 100, param6:Boolean = false, param7:Boolean = false, param8:uint = 0, param9:Boolean = false)
|
||||
{
|
||||
super();
|
||||
if(param4 < 0 || param5 < 0)
|
||||
{
|
||||
throw new Error("A FlexBlitMask cannot have a negative width or height.");
|
||||
}
|
||||
_width = param4;
|
||||
_height = param5;
|
||||
_scaleX = _scaleY = 1;
|
||||
_smoothing = param6;
|
||||
_fillColor = param8;
|
||||
_autoUpdate = param7;
|
||||
_wrap = param9;
|
||||
_grid = [];
|
||||
_bounds = new Rectangle();
|
||||
if(_smoothing)
|
||||
{
|
||||
super.x = param2;
|
||||
super.y = param3;
|
||||
}
|
||||
else
|
||||
{
|
||||
super.x = param2 < 0 ? param2 - 0.5 >> 0 : param2 + 0.5 >> 0;
|
||||
super.y = param3 < 0 ? param3 - 0.5 >> 0 : param3 + 0.5 >> 0;
|
||||
}
|
||||
_clipRect = new Rectangle(0,0,_gridSize + 1,_gridSize + 1);
|
||||
_bd = new BitmapData(param4 + 1,param5 + 1,true,_fillColor);
|
||||
_bitmapMode = true;
|
||||
this.target = param1;
|
||||
}
|
||||
|
||||
protected function _captureTargetBitmap() : void
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc12_:BitmapData = null;
|
||||
var _loc5_:int = 0;
|
||||
var _loc8_:int = 0;
|
||||
if(_bd == null || _target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_disposeGrid();
|
||||
var _loc10_:DisplayObject = _target.mask;
|
||||
if(_loc10_ != null)
|
||||
{
|
||||
_target.mask = null;
|
||||
}
|
||||
var _loc9_:Rectangle = _target.scrollRect;
|
||||
if(_loc9_ != null)
|
||||
{
|
||||
_target.scrollRect = null;
|
||||
}
|
||||
var _loc13_:Array = _target.filters;
|
||||
if(_loc13_.length != 0)
|
||||
{
|
||||
_target.filters = _emptyArray;
|
||||
}
|
||||
_grid = [];
|
||||
if(_target.parent == null)
|
||||
{
|
||||
_tempContainer.addChild(_target);
|
||||
}
|
||||
_bounds = _target.getBounds(_target.parent);
|
||||
var _loc6_:Number = 0;
|
||||
var _loc4_:Number = 0;
|
||||
_columns = Math.ceil(_bounds.width / _gridSize);
|
||||
_rows = Math.ceil(_bounds.height / _gridSize);
|
||||
var _loc11_:Number = 0;
|
||||
var _loc3_:Matrix = _transform.matrix;
|
||||
var _loc7_:Number = _loc3_.tx - _bounds.x;
|
||||
var _loc1_:Number = _loc3_.ty - _bounds.y;
|
||||
if(!_smoothing)
|
||||
{
|
||||
_loc7_ = _loc7_ + 0.5 >> 0;
|
||||
_loc1_ = _loc1_ + 0.5 >> 0;
|
||||
}
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < _rows)
|
||||
{
|
||||
_loc4_ = Number(_bounds.height - _loc11_ > _gridSize ? _gridSize : _bounds.height - _loc11_);
|
||||
_loc3_.ty = -_loc11_ + _loc1_;
|
||||
_loc2_ = 0;
|
||||
_grid[_loc5_] = [];
|
||||
_loc8_ = 0;
|
||||
while(_loc8_ < _columns)
|
||||
{
|
||||
_loc6_ = Number(_bounds.width - _loc2_ > _gridSize ? _gridSize : _bounds.width - _loc2_);
|
||||
_grid[_loc5_][_loc8_] = _loc12_ = new BitmapData(_loc6_ + 1,_loc4_ + 1,true,_fillColor);
|
||||
_loc3_.tx = -_loc2_ + _loc7_;
|
||||
_loc12_.draw(_target,_loc3_,null,null,_clipRect,_smoothing);
|
||||
_loc2_ += _loc6_;
|
||||
_loc8_++;
|
||||
}
|
||||
_loc11_ += _loc4_;
|
||||
_loc5_++;
|
||||
}
|
||||
if(_target.parent == _tempContainer)
|
||||
{
|
||||
_tempContainer.removeChild(_target);
|
||||
}
|
||||
if(_loc10_ != null)
|
||||
{
|
||||
_target.mask = _loc10_;
|
||||
}
|
||||
if(_loc9_ != null)
|
||||
{
|
||||
_target.scrollRect = _loc9_;
|
||||
}
|
||||
if(_loc13_.length != 0)
|
||||
{
|
||||
_target.filters = _loc13_;
|
||||
}
|
||||
}
|
||||
|
||||
protected function _disposeGrid() : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc1_:Array = null;
|
||||
var _loc3_:int = int(_grid.length);
|
||||
while(--_loc3_ > -1)
|
||||
{
|
||||
_loc1_ = _grid[_loc3_];
|
||||
_loc2_ = int(_loc1_.length);
|
||||
while(--_loc2_ > -1)
|
||||
{
|
||||
BitmapData(_loc1_[_loc2_]).dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function update(param1:Event = null, param2:Boolean = false) : void
|
||||
{
|
||||
var _loc3_:Matrix = null;
|
||||
if(_bd == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(_target == null)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
else if(_target.parent)
|
||||
{
|
||||
_bounds = _target.getBounds(_target.parent);
|
||||
if(this.parent != _target.parent)
|
||||
{
|
||||
_target.parent.addChildAt(this,_target.parent.getChildIndex(_target));
|
||||
}
|
||||
}
|
||||
if(_bitmapMode || param2)
|
||||
{
|
||||
_loc3_ = _transform.matrix;
|
||||
if(param2 || _prevMatrix == null || _loc3_.a != _prevMatrix.a || _loc3_.b != _prevMatrix.b || _loc3_.c != _prevMatrix.c || _loc3_.d != _prevMatrix.d)
|
||||
{
|
||||
_captureTargetBitmap();
|
||||
_render();
|
||||
}
|
||||
else if(_loc3_.tx != _prevMatrix.tx || _loc3_.ty != _prevMatrix.ty)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
else if(_bitmapMode && _target != null)
|
||||
{
|
||||
this.filters = _target.filters;
|
||||
this.transform.colorTransform = _transform.colorTransform;
|
||||
}
|
||||
_prevMatrix = _loc3_;
|
||||
}
|
||||
}
|
||||
|
||||
protected function _render(param1:Number = 0, param2:Number = 0, param3:Boolean = true, param4:Boolean = false) : void
|
||||
{
|
||||
var _loc10_:Number = NaN;
|
||||
var _loc16_:Number = NaN;
|
||||
var _loc12_:int = 0;
|
||||
var _loc17_:BitmapData = null;
|
||||
if(param3)
|
||||
{
|
||||
_sliceRect.x = _sliceRect.y = 0;
|
||||
_sliceRect.width = _width + 1;
|
||||
_sliceRect.height = _height + 1;
|
||||
_bd.fillRect(_sliceRect,_fillColor);
|
||||
if(_bitmapMode && _target != null)
|
||||
{
|
||||
this.filters = _target.filters;
|
||||
this.transform.colorTransform = _transform.colorTransform;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.filters = _emptyArray;
|
||||
this.transform.colorTransform = _colorTransform;
|
||||
}
|
||||
}
|
||||
if(_bd == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(_rows == 0)
|
||||
{
|
||||
_captureTargetBitmap();
|
||||
}
|
||||
var _loc19_:Number = super.x + param1;
|
||||
var _loc18_:Number = super.y + param2;
|
||||
var _loc9_:int = _bounds.width + _wrapOffsetX + 0.5 >> 0;
|
||||
var _loc7_:int = _bounds.height + _wrapOffsetY + 0.5 >> 0;
|
||||
var _loc6_:Graphics = this.graphics;
|
||||
if(_bounds.width == 0 || _bounds.height == 0 || _wrap && (_loc9_ == 0 || _loc7_ == 0) || !_wrap && (_loc19_ + _width < _bounds.x || _loc18_ + _height < _bounds.y || _loc19_ > _bounds.right || _loc18_ > _bounds.bottom))
|
||||
{
|
||||
_loc6_.clear();
|
||||
_loc6_.beginBitmapFill(_bd);
|
||||
_loc6_.drawRect(0,0,_width,_height);
|
||||
_loc6_.endFill();
|
||||
return;
|
||||
}
|
||||
var _loc15_:int = (_loc19_ - _bounds.x) / _gridSize;
|
||||
if(_loc15_ < 0)
|
||||
{
|
||||
_loc15_ = 0;
|
||||
}
|
||||
var _loc13_:int = (_loc18_ - _bounds.y) / _gridSize;
|
||||
if(_loc13_ < 0)
|
||||
{
|
||||
_loc13_ = 0;
|
||||
}
|
||||
var _loc8_:int = (_loc19_ + _width - _bounds.x) / _gridSize;
|
||||
if(_loc8_ >= _columns)
|
||||
{
|
||||
_loc8_ = _columns - 1;
|
||||
}
|
||||
var _loc11_:uint = uint(int((_loc18_ + _height - _bounds.y) / _gridSize));
|
||||
if(_loc11_ >= _rows)
|
||||
{
|
||||
_loc11_ = _rows - 1;
|
||||
}
|
||||
var _loc14_:Number = (_bounds.x - _loc19_) % 1;
|
||||
var _loc5_:Number = (_bounds.y - _loc18_) % 1;
|
||||
if(_loc18_ <= _bounds.y)
|
||||
{
|
||||
_destPoint.y = _bounds.y - _loc18_ >> 0;
|
||||
_sliceRect.y = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_destPoint.y = 0;
|
||||
_sliceRect.y = Math.ceil(_loc18_ - _bounds.y) - _loc13_ * _gridSize - 1;
|
||||
if(param3 && _loc5_ != 0)
|
||||
{
|
||||
_loc5_ += 1;
|
||||
}
|
||||
}
|
||||
if(_loc19_ <= _bounds.x)
|
||||
{
|
||||
_destPoint.x = _bounds.x - _loc19_ >> 0;
|
||||
_sliceRect.x = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_destPoint.x = 0;
|
||||
_sliceRect.x = Math.ceil(_loc19_ - _bounds.x) - _loc15_ * _gridSize - 1;
|
||||
if(param3 && _loc14_ != 0)
|
||||
{
|
||||
_loc14_ += 1;
|
||||
}
|
||||
}
|
||||
if(_wrap && param3)
|
||||
{
|
||||
_render(Math.ceil((_bounds.x - _loc19_) / _loc9_) * _loc9_,Math.ceil((_bounds.y - _loc18_) / _loc7_) * _loc7_,false,false);
|
||||
}
|
||||
else if(_rows != 0)
|
||||
{
|
||||
_loc10_ = _destPoint.x;
|
||||
_loc16_ = _sliceRect.x;
|
||||
_loc12_ = _loc15_;
|
||||
while(_loc13_ <= _loc11_)
|
||||
{
|
||||
_loc17_ = _grid[_loc13_][0];
|
||||
_sliceRect.height = _loc17_.height - _sliceRect.y;
|
||||
_destPoint.x = _loc10_;
|
||||
_sliceRect.x = _loc16_;
|
||||
_loc15_ = _loc12_;
|
||||
while(_loc15_ <= _loc8_)
|
||||
{
|
||||
_loc17_ = _grid[_loc13_][_loc15_];
|
||||
_sliceRect.width = _loc17_.width - _sliceRect.x;
|
||||
_bd.copyPixels(_loc17_,_sliceRect,_destPoint);
|
||||
_destPoint.x += _sliceRect.width - 1;
|
||||
_sliceRect.x = 0;
|
||||
_loc15_++;
|
||||
}
|
||||
_destPoint.y += _sliceRect.height - 1;
|
||||
_sliceRect.y = 0;
|
||||
_loc13_++;
|
||||
}
|
||||
}
|
||||
if(param3)
|
||||
{
|
||||
_tempMatrix.tx = _loc14_ - 1;
|
||||
_tempMatrix.ty = _loc5_ - 1;
|
||||
_loc6_.clear();
|
||||
_loc6_.beginBitmapFill(_bd,_tempMatrix,false,_smoothing);
|
||||
_loc6_.drawRect(0,0,_width,_height);
|
||||
_loc6_.endFill();
|
||||
}
|
||||
else if(_wrap)
|
||||
{
|
||||
if(_loc19_ + _width > _bounds.right)
|
||||
{
|
||||
_render(param1 - _loc9_,param2,false,true);
|
||||
}
|
||||
if(!param4 && _loc18_ + _height > _bounds.bottom)
|
||||
{
|
||||
_render(param1,param2 - _loc7_,false,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setSize(param1:Number, param2:Number) : void
|
||||
{
|
||||
if(_width == param1 && _height == param2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(param1 < 0 || param2 < 0)
|
||||
{
|
||||
throw new Error("A BlitMask cannot have a negative width or height.");
|
||||
}
|
||||
if(_bd != null)
|
||||
{
|
||||
_bd.dispose();
|
||||
}
|
||||
_width = param1;
|
||||
_height = param2;
|
||||
_bd = new BitmapData(param1 + 1,param2 + 1,true,_fillColor);
|
||||
_render();
|
||||
}
|
||||
|
||||
protected function _mouseEventPassthrough(param1:Event) : void
|
||||
{
|
||||
if(this.mouseEnabled && (!_bitmapMode || param1 is MouseEvent && this.hitTestPoint(MouseEvent(param1).stageX,MouseEvent(param1).stageY,false)))
|
||||
{
|
||||
dispatchEvent(param1);
|
||||
}
|
||||
}
|
||||
|
||||
public function enableBitmapMode(param1:Event = null) : void
|
||||
{
|
||||
this.bitmapMode = true;
|
||||
}
|
||||
|
||||
public function disableBitmapMode(param1:Event = null) : void
|
||||
{
|
||||
this.bitmapMode = false;
|
||||
}
|
||||
|
||||
public function normalizePosition() : void
|
||||
{
|
||||
var _loc4_:int = 0;
|
||||
var _loc1_:int = 0;
|
||||
var _loc3_:Number = NaN;
|
||||
var _loc2_:Number = NaN;
|
||||
if(_target && _bounds)
|
||||
{
|
||||
_loc4_ = _bounds.width + _wrapOffsetX + 0.5 >> 0;
|
||||
_loc1_ = _bounds.height + _wrapOffsetY + 0.5 >> 0;
|
||||
_loc3_ = (_bounds.x - this.x) % _loc4_;
|
||||
_loc2_ = (_bounds.y - this.y) % _loc1_;
|
||||
if(_loc3_ > (_width + _wrapOffsetX) / 2)
|
||||
{
|
||||
_loc3_ -= _loc4_;
|
||||
}
|
||||
else if(_loc3_ < (_width + _wrapOffsetX) / -2)
|
||||
{
|
||||
_loc3_ += _loc4_;
|
||||
}
|
||||
if(_loc2_ > (_height + _wrapOffsetY) / 2)
|
||||
{
|
||||
_loc2_ -= _loc1_;
|
||||
}
|
||||
else if(_loc2_ < (_height + _wrapOffsetY) / -2)
|
||||
{
|
||||
_loc2_ += _loc1_;
|
||||
}
|
||||
_target.x += this.x + _loc3_ - _bounds.x;
|
||||
_target.y += this.y + _loc2_ - _bounds.y;
|
||||
}
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
if(_bd == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_disposeGrid();
|
||||
_bd.dispose();
|
||||
_bd = null;
|
||||
this.bitmapMode = false;
|
||||
this.autoUpdate = false;
|
||||
if(_target != null)
|
||||
{
|
||||
_target.mask = null;
|
||||
}
|
||||
if(this.parent != null)
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
this.target = null;
|
||||
}
|
||||
|
||||
public function get bitmapMode() : Boolean
|
||||
{
|
||||
return _bitmapMode;
|
||||
}
|
||||
|
||||
public function set bitmapMode(param1:Boolean) : void
|
||||
{
|
||||
if(_bitmapMode != param1)
|
||||
{
|
||||
_bitmapMode = param1;
|
||||
if(_target != null)
|
||||
{
|
||||
_target.visible = !_bitmapMode;
|
||||
update(null);
|
||||
if(_bitmapMode)
|
||||
{
|
||||
this.filters = _target.filters;
|
||||
this.transform.colorTransform = _transform.colorTransform;
|
||||
this.blendMode = _target.blendMode;
|
||||
_target.mask = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.filters = _emptyArray;
|
||||
this.transform.colorTransform = _colorTransform;
|
||||
this.blendMode = "normal";
|
||||
this.cacheAsBitmap = false;
|
||||
_target.mask = this;
|
||||
if(_wrap)
|
||||
{
|
||||
normalizePosition();
|
||||
}
|
||||
}
|
||||
if(_bitmapMode && _autoUpdate)
|
||||
{
|
||||
this.addEventListener("enterFrame",update,false,-10,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.removeEventListener("enterFrame",update);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get autoUpdate() : Boolean
|
||||
{
|
||||
return _autoUpdate;
|
||||
}
|
||||
|
||||
public function set autoUpdate(param1:Boolean) : void
|
||||
{
|
||||
if(_autoUpdate != param1)
|
||||
{
|
||||
_autoUpdate = param1;
|
||||
if(_bitmapMode && _autoUpdate)
|
||||
{
|
||||
this.addEventListener("enterFrame",update,false,-10,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.removeEventListener("enterFrame",update);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get target() : DisplayObject
|
||||
{
|
||||
return _target;
|
||||
}
|
||||
|
||||
public function set target(param1:DisplayObject) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
if(_target != param1)
|
||||
{
|
||||
_loc2_ = int(_mouseEvents.length);
|
||||
if(_target != null)
|
||||
{
|
||||
while(--_loc2_ > -1)
|
||||
{
|
||||
_target.removeEventListener(_mouseEvents[_loc2_],_mouseEventPassthrough);
|
||||
}
|
||||
}
|
||||
_target = param1;
|
||||
if(_target != null)
|
||||
{
|
||||
_loc2_ = int(_mouseEvents.length);
|
||||
while(--_loc2_ > -1)
|
||||
{
|
||||
_target.addEventListener(_mouseEvents[_loc2_],_mouseEventPassthrough,false,0,true);
|
||||
}
|
||||
_prevMatrix = null;
|
||||
_transform = _target.transform;
|
||||
_bitmapMode = !_bitmapMode;
|
||||
this.bitmapMode = !_bitmapMode;
|
||||
}
|
||||
else
|
||||
{
|
||||
_bounds = new Rectangle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function get x() : Number
|
||||
{
|
||||
return super.x;
|
||||
}
|
||||
|
||||
override public function set x(param1:Number) : void
|
||||
{
|
||||
if(_smoothing)
|
||||
{
|
||||
super.x = param1;
|
||||
}
|
||||
else if(param1 >= 0)
|
||||
{
|
||||
super.x = param1 + 0.5 >> 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
super.x = param1 - 0.5 >> 0;
|
||||
}
|
||||
if(_bitmapMode)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
}
|
||||
|
||||
override public function get y() : Number
|
||||
{
|
||||
return super.y;
|
||||
}
|
||||
|
||||
override public function set y(param1:Number) : void
|
||||
{
|
||||
if(_smoothing)
|
||||
{
|
||||
super.y = param1;
|
||||
}
|
||||
else if(param1 >= 0)
|
||||
{
|
||||
super.y = param1 + 0.5 >> 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
super.y = param1 - 0.5 >> 0;
|
||||
}
|
||||
if(_bitmapMode)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
}
|
||||
|
||||
override public function get width() : Number
|
||||
{
|
||||
return _width;
|
||||
}
|
||||
|
||||
override public function set width(param1:Number) : void
|
||||
{
|
||||
setSize(param1,_height);
|
||||
}
|
||||
|
||||
override public function get height() : Number
|
||||
{
|
||||
return _height;
|
||||
}
|
||||
|
||||
override public function set height(param1:Number) : void
|
||||
{
|
||||
setSize(_width,param1);
|
||||
}
|
||||
|
||||
override public function get scaleX() : Number
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
override public function set scaleX(param1:Number) : void
|
||||
{
|
||||
var _loc2_:Number = _scaleX;
|
||||
_scaleX = param1;
|
||||
setSize(_width * (_scaleX / _loc2_),_height);
|
||||
}
|
||||
|
||||
override public function get scaleY() : Number
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
override public function set scaleY(param1:Number) : void
|
||||
{
|
||||
var _loc2_:Number = _scaleY;
|
||||
_scaleY = param1;
|
||||
setSize(_width,_height * (_scaleY / _loc2_));
|
||||
}
|
||||
|
||||
override public function set rotation(param1:Number) : void
|
||||
{
|
||||
if(param1 != 0)
|
||||
{
|
||||
throw new Error("Cannot set the rotation of a BlitMask to a non-zero number. BlitMasks should remain unrotated.");
|
||||
}
|
||||
}
|
||||
|
||||
public function get scrollX() : Number
|
||||
{
|
||||
return (super.x - _bounds.x) / (_bounds.width - _width);
|
||||
}
|
||||
|
||||
public function set scrollX(param1:Number) : void
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
if(_target != null && _target.parent)
|
||||
{
|
||||
_bounds = _target.getBounds(_target.parent);
|
||||
_loc2_ = super.x - (_bounds.width - _width) * param1 - _bounds.x;
|
||||
_target.x += _loc2_;
|
||||
_bounds.x += _loc2_;
|
||||
if(_bitmapMode)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get scrollY() : Number
|
||||
{
|
||||
return (super.y - _bounds.y) / (_bounds.height - _height);
|
||||
}
|
||||
|
||||
public function set scrollY(param1:Number) : void
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
if(_target != null && _target.parent)
|
||||
{
|
||||
_bounds = _target.getBounds(_target.parent);
|
||||
_loc2_ = super.y - (_bounds.height - _height) * param1 - _bounds.y;
|
||||
_target.y += _loc2_;
|
||||
_bounds.y += _loc2_;
|
||||
if(_bitmapMode)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get smoothing() : Boolean
|
||||
{
|
||||
return _smoothing;
|
||||
}
|
||||
|
||||
public function set smoothing(param1:Boolean) : void
|
||||
{
|
||||
if(_smoothing != param1)
|
||||
{
|
||||
_smoothing = param1;
|
||||
_captureTargetBitmap();
|
||||
if(_bitmapMode)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get fillColor() : uint
|
||||
{
|
||||
return _fillColor;
|
||||
}
|
||||
|
||||
public function set fillColor(param1:uint) : void
|
||||
{
|
||||
if(_fillColor != param1)
|
||||
{
|
||||
_fillColor = param1;
|
||||
if(_bitmapMode)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get wrap() : Boolean
|
||||
{
|
||||
return _wrap;
|
||||
}
|
||||
|
||||
public function set wrap(param1:Boolean) : void
|
||||
{
|
||||
if(_wrap != param1)
|
||||
{
|
||||
_wrap = param1;
|
||||
if(_bitmapMode)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get wrapOffsetX() : Number
|
||||
{
|
||||
return _wrapOffsetX;
|
||||
}
|
||||
|
||||
public function set wrapOffsetX(param1:Number) : void
|
||||
{
|
||||
if(_wrapOffsetX != param1)
|
||||
{
|
||||
_wrapOffsetX = param1;
|
||||
if(_bitmapMode)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get wrapOffsetY() : Number
|
||||
{
|
||||
return _wrapOffsetY;
|
||||
}
|
||||
|
||||
public function set wrapOffsetY(param1:Number) : void
|
||||
{
|
||||
if(_wrapOffsetY != param1)
|
||||
{
|
||||
_wrapOffsetY = param1;
|
||||
if(_bitmapMode)
|
||||
{
|
||||
_render();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,851 @@
|
||||
package com.greensock
|
||||
{
|
||||
import com.greensock.core.Animation;
|
||||
import com.greensock.core.SimpleTimeline;
|
||||
|
||||
public class TimelineLite extends SimpleTimeline
|
||||
{
|
||||
|
||||
public static const version:String = "12.1.5";
|
||||
|
||||
protected var _labels:Object;
|
||||
|
||||
public function TimelineLite(param1:Object = null)
|
||||
{
|
||||
var _loc3_:String = null;
|
||||
var _loc2_:Object = null;
|
||||
super(param1);
|
||||
_labels = {};
|
||||
autoRemoveChildren = this.vars.autoRemoveChildren == true;
|
||||
smoothChildTiming = this.vars.smoothChildTiming == true;
|
||||
_sortChildren = true;
|
||||
_onUpdate = this.vars.onUpdate;
|
||||
for(_loc3_ in this.vars)
|
||||
{
|
||||
_loc2_ = this.vars[_loc3_];
|
||||
if(_loc2_ is Array)
|
||||
{
|
||||
if(_loc2_.join("").indexOf("{self}") !== -1)
|
||||
{
|
||||
this.vars[_loc3_] = _swapSelfInParams(_loc2_ as Array);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.vars.tweens is Array)
|
||||
{
|
||||
this.add(this.vars.tweens,0,this.vars.align || "normal",this.vars.stagger || 0);
|
||||
}
|
||||
}
|
||||
|
||||
protected static function _prepVars(param1:Object) : Object
|
||||
{
|
||||
return param1._isGSVars ? param1.vars : param1;
|
||||
}
|
||||
|
||||
protected static function _copy(param1:Object) : Object
|
||||
{
|
||||
var _loc2_:String = null;
|
||||
var _loc3_:Object = {};
|
||||
for(_loc2_ in param1)
|
||||
{
|
||||
_loc3_[_loc2_] = param1[_loc2_];
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
public static function exportRoot(param1:Object = null, param2:Boolean = true) : TimelineLite
|
||||
{
|
||||
var _loc4_:TimelineLite = null;
|
||||
var _loc6_:Animation = null;
|
||||
param1 ||= {};
|
||||
if(!("smoothChildTiming" in param1))
|
||||
{
|
||||
param1.smoothChildTiming = true;
|
||||
}
|
||||
_loc4_ = new TimelineLite(param1);
|
||||
var _loc5_:SimpleTimeline = _loc4_._timeline;
|
||||
_loc5_._remove(_loc4_,true);
|
||||
_loc4_._startTime = 0;
|
||||
_loc4_._rawPrevTime = _loc4_._time = _loc4_._totalTime = _loc5_._time;
|
||||
var _loc3_:Animation = _loc5_._first;
|
||||
while(_loc3_)
|
||||
{
|
||||
_loc6_ = _loc3_._next;
|
||||
if(!param2 || !(_loc3_ is TweenLite && TweenLite(_loc3_).target == _loc3_.vars.onComplete))
|
||||
{
|
||||
_loc4_.add(_loc3_,_loc3_._startTime - _loc3_._delay);
|
||||
}
|
||||
_loc3_ = _loc6_;
|
||||
}
|
||||
_loc5_.add(_loc4_,0);
|
||||
return _loc4_;
|
||||
}
|
||||
|
||||
public function to(param1:Object, param2:Number, param3:Object, param4:* = "+=0") : *
|
||||
{
|
||||
return param2 ? add(new TweenLite(param1,param2,param3),param4) : this.set(param1,param3,param4);
|
||||
}
|
||||
|
||||
public function from(param1:Object, param2:Number, param3:Object, param4:* = "+=0") : *
|
||||
{
|
||||
return add(TweenLite.from(param1,param2,param3),param4);
|
||||
}
|
||||
|
||||
public function fromTo(param1:Object, param2:Number, param3:Object, param4:Object, param5:* = "+=0") : *
|
||||
{
|
||||
return param2 ? add(TweenLite.fromTo(param1,param2,param3,param4),param5) : this.set(param1,param4,param5);
|
||||
}
|
||||
|
||||
public function staggerTo(param1:Array, param2:Number, param3:Object, param4:Number, param5:* = "+=0", param6:Function = null, param7:Array = null) : *
|
||||
{
|
||||
var _loc9_:int = 0;
|
||||
var _loc8_:TimelineLite = new TimelineLite({
|
||||
"onComplete":param6,
|
||||
"onCompleteParams":param7,
|
||||
"smoothChildTiming":this.smoothChildTiming
|
||||
});
|
||||
_loc9_ = 0;
|
||||
while(_loc9_ < param1.length)
|
||||
{
|
||||
if(param3.startAt != null)
|
||||
{
|
||||
param3.startAt = _copy(param3.startAt);
|
||||
}
|
||||
_loc8_.to(param1[_loc9_],param2,_copy(param3),_loc9_ * param4);
|
||||
_loc9_++;
|
||||
}
|
||||
return add(_loc8_,param5);
|
||||
}
|
||||
|
||||
public function staggerFrom(param1:Array, param2:Number, param3:Object, param4:Number = 0, param5:* = "+=0", param6:Function = null, param7:Array = null) : *
|
||||
{
|
||||
param3 = _prepVars(param3);
|
||||
if(!("immediateRender" in param3))
|
||||
{
|
||||
param3.immediateRender = true;
|
||||
}
|
||||
param3.runBackwards = true;
|
||||
return staggerTo(param1,param2,param3,param4,param5,param6,param7);
|
||||
}
|
||||
|
||||
public function staggerFromTo(param1:Array, param2:Number, param3:Object, param4:Object, param5:Number = 0, param6:* = "+=0", param7:Function = null, param8:Array = null) : *
|
||||
{
|
||||
param4 = _prepVars(param4);
|
||||
param3 = _prepVars(param3);
|
||||
param4.startAt = param3;
|
||||
param4.immediateRender = param4.immediateRender != false && param3.immediateRender != false;
|
||||
return staggerTo(param1,param2,param4,param5,param6,param7,param8);
|
||||
}
|
||||
|
||||
public function call(param1:Function, param2:Array = null, param3:* = "+=0") : *
|
||||
{
|
||||
return add(TweenLite.delayedCall(0,param1,param2),param3);
|
||||
}
|
||||
|
||||
public function set(param1:Object, param2:Object, param3:* = "+=0") : *
|
||||
{
|
||||
param3 = _parseTimeOrLabel(param3,0,true);
|
||||
param2 = _prepVars(param2);
|
||||
if(param2.immediateRender == null)
|
||||
{
|
||||
param2.immediateRender = param3 === _time && !_paused;
|
||||
}
|
||||
return add(new TweenLite(param1,0,param2),param3);
|
||||
}
|
||||
|
||||
public function addPause(param1:* = "+=0", param2:Function = null, param3:Array = null) : *
|
||||
{
|
||||
return call(_pauseCallback,["{self}",param2,param3],param1);
|
||||
}
|
||||
|
||||
protected function _pauseCallback(param1:TweenLite, param2:Function = null, param3:Array = null) : void
|
||||
{
|
||||
pause(param1._startTime);
|
||||
if(param2 != null)
|
||||
{
|
||||
param2.apply(null,param3);
|
||||
}
|
||||
}
|
||||
|
||||
override public function insert(param1:*, param2:* = 0) : *
|
||||
{
|
||||
return add(param1,param2 || 0);
|
||||
}
|
||||
|
||||
override public function add(param1:*, param2:* = "+=0", param3:String = "normal", param4:Number = 0) : *
|
||||
{
|
||||
var _loc5_:* = undefined;
|
||||
var _loc10_:int = 0;
|
||||
var _loc6_:SimpleTimeline = null;
|
||||
if(typeof param2 !== "number")
|
||||
{
|
||||
param2 = _parseTimeOrLabel(param2,0,true,param1);
|
||||
}
|
||||
if(!(param1 is Animation))
|
||||
{
|
||||
if(param1 is Array)
|
||||
{
|
||||
var _loc7_:Number = param2;
|
||||
var _loc8_:Number = Number(param1.length);
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc8_)
|
||||
{
|
||||
_loc5_ = param1[_loc10_];
|
||||
if(_loc5_ is Array)
|
||||
{
|
||||
_loc5_ = new TimelineLite({"tweens":_loc5_});
|
||||
}
|
||||
add(_loc5_,_loc7_);
|
||||
if(!(typeof _loc5_ === "string" || typeof _loc5_ === "function"))
|
||||
{
|
||||
switch(param3)
|
||||
{
|
||||
case "sequence":
|
||||
_loc7_ = _loc5_._startTime + _loc5_.totalDuration() / _loc5_._timeScale;
|
||||
break;
|
||||
case "start":
|
||||
_loc5_._startTime -= _loc5_.delay();
|
||||
}
|
||||
}
|
||||
_loc7_ += param4;
|
||||
_loc10_++;
|
||||
}
|
||||
return _uncache(true);
|
||||
}
|
||||
if(typeof param1 === "string")
|
||||
{
|
||||
return addLabel(String(param1),param2);
|
||||
}
|
||||
if(typeof param1 !== "function")
|
||||
{
|
||||
trace("Cannot add " + param1 + " into the TimelineLite/Max: it is not a tween, timeline, function, or string.");
|
||||
return this;
|
||||
}
|
||||
param1 = TweenLite.delayedCall(0,param1);
|
||||
}
|
||||
super.add(param1,param2);
|
||||
if(_gc || _time === _duration)
|
||||
{
|
||||
if(!_paused)
|
||||
{
|
||||
if(_duration < duration())
|
||||
{
|
||||
_loc6_ = this;
|
||||
var _loc9_:Boolean = _loc6_.rawTime() > param1._startTime;
|
||||
while(_loc6_._timeline)
|
||||
{
|
||||
if(_loc9_ && _loc6_._timeline.smoothChildTiming)
|
||||
{
|
||||
_loc6_.totalTime(_loc6_._totalTime,true);
|
||||
}
|
||||
else if(_loc6_._gc)
|
||||
{
|
||||
_loc6_._enabled(true,false);
|
||||
}
|
||||
_loc6_ = _loc6_._timeline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public function remove(param1:*) : *
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
if(param1 is Animation)
|
||||
{
|
||||
return _remove(param1,false);
|
||||
}
|
||||
if(param1 is Array)
|
||||
{
|
||||
_loc2_ = Number(param1.length);
|
||||
while(--_loc2_ > -1)
|
||||
{
|
||||
remove(param1[_loc2_]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
if(typeof param1 == "string")
|
||||
{
|
||||
return removeLabel(String(param1));
|
||||
}
|
||||
return kill(null,param1);
|
||||
}
|
||||
|
||||
override public function _remove(param1:Animation, param2:Boolean = false) : *
|
||||
{
|
||||
super._remove(param1,param2);
|
||||
if(_last == null)
|
||||
{
|
||||
_time = _totalTime = _duration = _totalDuration = 0;
|
||||
}
|
||||
else if(_time > _last._startTime + _last._totalDuration / _last._timeScale)
|
||||
{
|
||||
_time = duration();
|
||||
_totalTime = _totalDuration;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public function append(param1:*, param2:* = 0) : *
|
||||
{
|
||||
return add(param1,_parseTimeOrLabel(null,param2,true,param1));
|
||||
}
|
||||
|
||||
public function insertMultiple(param1:Array, param2:* = 0, param3:String = "normal", param4:Number = 0) : *
|
||||
{
|
||||
return add(param1,param2 || 0,param3,param4);
|
||||
}
|
||||
|
||||
public function appendMultiple(param1:Array, param2:* = 0, param3:String = "normal", param4:Number = 0) : *
|
||||
{
|
||||
return add(param1,_parseTimeOrLabel(null,param2,true,param1),param3,param4);
|
||||
}
|
||||
|
||||
public function addLabel(param1:String, param2:* = "+=0") : *
|
||||
{
|
||||
_labels[param1] = _parseTimeOrLabel(param2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public function removeLabel(param1:String) : *
|
||||
{
|
||||
delete _labels[param1];
|
||||
return this;
|
||||
}
|
||||
|
||||
public function getLabelTime(param1:String) : Number
|
||||
{
|
||||
return param1 in _labels ? Number(_labels[param1]) : -1;
|
||||
}
|
||||
|
||||
protected function _parseTimeOrLabel(param1:*, param2:* = 0, param3:Boolean = false, param4:Object = null) : Number
|
||||
{
|
||||
var _loc5_:int = 0;
|
||||
if(param4 is Animation && param4.timeline === this)
|
||||
{
|
||||
remove(param4);
|
||||
}
|
||||
else if(param4 is Array)
|
||||
{
|
||||
_loc5_ = int(param4.length);
|
||||
while(--_loc5_ > -1)
|
||||
{
|
||||
if(param4[_loc5_] is Animation && param4[_loc5_].timeline === this)
|
||||
{
|
||||
remove(param4[_loc5_]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(typeof param2 === "string")
|
||||
{
|
||||
return _parseTimeOrLabel(param2,param3 && typeof param1 === "number" && !(param2 in _labels) ? param1 - duration() : 0,param3);
|
||||
}
|
||||
param2 ||= 0;
|
||||
if(typeof param1 === "string" && (isNaN(param1) || param1 in _labels))
|
||||
{
|
||||
_loc5_ = int(param1.indexOf("="));
|
||||
if(_loc5_ === -1)
|
||||
{
|
||||
if(!(param1 in _labels))
|
||||
{
|
||||
return param3 ? (_labels[param1] = duration() + param2) : param2;
|
||||
}
|
||||
return _labels[param1] + param2;
|
||||
}
|
||||
param2 = parseInt(param1.charAt(_loc5_ - 1) + "1",10) * Number(param1.substr(_loc5_ + 1));
|
||||
param1 = _loc5_ > 1 ? _parseTimeOrLabel(param1.substr(0,_loc5_ - 1),0,param3) : duration();
|
||||
}
|
||||
else if(param1 == null)
|
||||
{
|
||||
param1 = duration();
|
||||
}
|
||||
return Number(param1) + param2;
|
||||
}
|
||||
|
||||
override public function seek(param1:*, param2:Boolean = true) : *
|
||||
{
|
||||
return totalTime(typeof param1 === "number" ? Number(param1) : _parseTimeOrLabel(param1),param2);
|
||||
}
|
||||
|
||||
public function stop() : *
|
||||
{
|
||||
return paused(true);
|
||||
}
|
||||
|
||||
public function gotoAndPlay(param1:*, param2:Boolean = true) : *
|
||||
{
|
||||
return play(param1,param2);
|
||||
}
|
||||
|
||||
public function gotoAndStop(param1:*, param2:Boolean = true) : *
|
||||
{
|
||||
return pause(param1,param2);
|
||||
}
|
||||
|
||||
override public function render(param1:Number, param2:Boolean = false, param3:Boolean = false) : void
|
||||
{
|
||||
var _loc6_:Animation = null;
|
||||
var _loc5_:Boolean = false;
|
||||
var _loc7_:Animation = null;
|
||||
var _loc12_:String = null;
|
||||
var _loc4_:Boolean = false;
|
||||
if(_gc)
|
||||
{
|
||||
_enabled(true,false);
|
||||
}
|
||||
var _loc9_:Number = Number(!_dirty ? _totalDuration : totalDuration());
|
||||
var _loc13_:Number = _time;
|
||||
var _loc11_:Number = _startTime;
|
||||
var _loc8_:Number = _timeScale;
|
||||
var _loc10_:Boolean = _paused;
|
||||
if(param1 >= _loc9_)
|
||||
{
|
||||
_totalTime = _time = _loc9_;
|
||||
if(!_reversed)
|
||||
{
|
||||
if(!_hasPausedChild())
|
||||
{
|
||||
_loc5_ = true;
|
||||
_loc12_ = "onComplete";
|
||||
if(_duration === 0)
|
||||
{
|
||||
if(param1 === 0 || _rawPrevTime < 0 || _rawPrevTime === _tinyNum)
|
||||
{
|
||||
if(_rawPrevTime !== param1 && _first != null)
|
||||
{
|
||||
_loc4_ = true;
|
||||
if(_rawPrevTime > _tinyNum)
|
||||
{
|
||||
_loc12_ = "onReverseComplete";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_rawPrevTime = _duration !== 0 || !param2 || param1 !== 0 || _rawPrevTime === param1 ? param1 : _tinyNum;
|
||||
param1 = _loc9_ + 0.0001;
|
||||
}
|
||||
else if(param1 < 1e-7)
|
||||
{
|
||||
_totalTime = _time = 0;
|
||||
if(_loc13_ !== 0 || _duration === 0 && _rawPrevTime !== _tinyNum && (_rawPrevTime > 0 || param1 < 0 && _rawPrevTime >= 0))
|
||||
{
|
||||
_loc12_ = "onReverseComplete";
|
||||
_loc5_ = _reversed;
|
||||
}
|
||||
if(param1 < 0)
|
||||
{
|
||||
_active = false;
|
||||
if(_rawPrevTime >= 0 && _first != null)
|
||||
{
|
||||
_loc4_ = true;
|
||||
}
|
||||
_rawPrevTime = param1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_rawPrevTime = _duration || !param2 || param1 !== 0 || _rawPrevTime === param1 ? param1 : _tinyNum;
|
||||
param1 = 0;
|
||||
if(!_initted)
|
||||
{
|
||||
_loc4_ = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_totalTime = _time = _rawPrevTime = param1;
|
||||
}
|
||||
if((_time == _loc13_ || !_first) && !param3 && !_loc4_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!_initted)
|
||||
{
|
||||
_initted = true;
|
||||
}
|
||||
if(!_active)
|
||||
{
|
||||
if(!_paused && _time !== _loc13_ && param1 > 0)
|
||||
{
|
||||
_active = true;
|
||||
}
|
||||
}
|
||||
if(_loc13_ == 0)
|
||||
{
|
||||
if(vars.onStart)
|
||||
{
|
||||
if(_time != 0)
|
||||
{
|
||||
if(!param2)
|
||||
{
|
||||
vars.onStart.apply(null,vars.onStartParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_time >= _loc13_)
|
||||
{
|
||||
_loc6_ = _first;
|
||||
while(_loc6_)
|
||||
{
|
||||
_loc7_ = _loc6_._next;
|
||||
if(_paused && !_loc10_)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if(_loc6_._active || _loc6_._startTime <= _time && !_loc6_._paused && !_loc6_._gc)
|
||||
{
|
||||
if(!_loc6_._reversed)
|
||||
{
|
||||
_loc6_.render((param1 - _loc6_._startTime) * _loc6_._timeScale,param2,param3);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_.render((!_loc6_._dirty ? _loc6_._totalDuration : _loc6_.totalDuration()) - (param1 - _loc6_._startTime) * _loc6_._timeScale,param2,param3);
|
||||
}
|
||||
}
|
||||
_loc6_ = _loc7_;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_ = _last;
|
||||
while(_loc6_)
|
||||
{
|
||||
_loc7_ = _loc6_._prev;
|
||||
if(_paused && !_loc10_)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if(_loc6_._active || _loc6_._startTime <= _loc13_ && !_loc6_._paused && !_loc6_._gc)
|
||||
{
|
||||
if(!_loc6_._reversed)
|
||||
{
|
||||
_loc6_.render((param1 - _loc6_._startTime) * _loc6_._timeScale,param2,param3);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_.render((!_loc6_._dirty ? _loc6_._totalDuration : _loc6_.totalDuration()) - (param1 - _loc6_._startTime) * _loc6_._timeScale,param2,param3);
|
||||
}
|
||||
}
|
||||
_loc6_ = _loc7_;
|
||||
}
|
||||
}
|
||||
if(_onUpdate != null)
|
||||
{
|
||||
if(!param2)
|
||||
{
|
||||
_onUpdate.apply(null,vars.onUpdateParams);
|
||||
}
|
||||
}
|
||||
if(_loc12_)
|
||||
{
|
||||
if(!_gc)
|
||||
{
|
||||
if(_loc11_ == _startTime || _loc8_ != _timeScale)
|
||||
{
|
||||
if(_time == 0 || _loc9_ >= totalDuration())
|
||||
{
|
||||
if(_loc5_)
|
||||
{
|
||||
if(_timeline.autoRemoveChildren)
|
||||
{
|
||||
_enabled(false,false);
|
||||
}
|
||||
_active = false;
|
||||
}
|
||||
if(!param2)
|
||||
{
|
||||
if(vars[_loc12_])
|
||||
{
|
||||
vars[_loc12_].apply(null,vars[_loc12_ + "Params"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function _hasPausedChild() : Boolean
|
||||
{
|
||||
var _loc1_:Animation = _first;
|
||||
while(_loc1_)
|
||||
{
|
||||
if(_loc1_._paused || _loc1_ is TimelineLite && Boolean(TimelineLite(_loc1_)._hasPausedChild()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
_loc1_ = _loc1_._next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getChildren(param1:Boolean = true, param2:Boolean = true, param3:Boolean = true, param4:Number = -9999999999) : Array
|
||||
{
|
||||
var _loc7_:Array = [];
|
||||
var _loc5_:Animation = _first;
|
||||
var _loc6_:int = 0;
|
||||
while(_loc5_)
|
||||
{
|
||||
if(_loc5_._startTime >= param4)
|
||||
{
|
||||
if(_loc5_ is TweenLite)
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
_loc7_[_loc6_++] = _loc5_;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(param3)
|
||||
{
|
||||
_loc7_[_loc6_++] = _loc5_;
|
||||
}
|
||||
if(param1)
|
||||
{
|
||||
_loc7_ = _loc7_.concat(TimelineLite(_loc5_).getChildren(true,param2,param3));
|
||||
_loc6_ = int(_loc7_.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc5_ = _loc5_._next;
|
||||
}
|
||||
return _loc7_;
|
||||
}
|
||||
|
||||
public function getTweensOf(param1:Object, param2:Boolean = true) : Array
|
||||
{
|
||||
var _loc5_:Array = null;
|
||||
var _loc7_:int = 0;
|
||||
var _loc6_:Boolean = this._gc;
|
||||
var _loc4_:Array = [];
|
||||
var _loc3_:int = 0;
|
||||
if(_loc6_)
|
||||
{
|
||||
_enabled(true,true);
|
||||
}
|
||||
_loc5_ = TweenLite.getTweensOf(param1);
|
||||
_loc7_ = int(_loc5_.length);
|
||||
while(--_loc7_ > -1)
|
||||
{
|
||||
if(_loc5_[_loc7_].timeline === this || param2 && _contains(_loc5_[_loc7_]))
|
||||
{
|
||||
_loc4_[_loc3_++] = _loc5_[_loc7_];
|
||||
}
|
||||
}
|
||||
if(_loc6_)
|
||||
{
|
||||
_enabled(false,true);
|
||||
}
|
||||
return _loc4_;
|
||||
}
|
||||
|
||||
private function _contains(param1:Animation) : Boolean
|
||||
{
|
||||
var _loc2_:SimpleTimeline = param1.timeline;
|
||||
while(_loc2_)
|
||||
{
|
||||
if(_loc2_ == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
_loc2_ = _loc2_.timeline;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function shiftChildren(param1:Number, param2:Boolean = false, param3:Number = 0) : *
|
||||
{
|
||||
var _loc4_:Animation = _first;
|
||||
while(_loc4_)
|
||||
{
|
||||
if(_loc4_._startTime >= param3)
|
||||
{
|
||||
_loc4_._startTime += param1;
|
||||
}
|
||||
_loc4_ = _loc4_._next;
|
||||
}
|
||||
if(param2)
|
||||
{
|
||||
for(var _loc5_:String in _labels)
|
||||
{
|
||||
if(_labels[_loc5_] >= param3)
|
||||
{
|
||||
var _loc6_:String = _loc5_;
|
||||
var _loc7_:Number = _labels[_loc6_] + param1;
|
||||
_labels[_loc6_] = _loc7_;
|
||||
}
|
||||
}
|
||||
}
|
||||
_uncache(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
override public function _kill(param1:Object = null, param2:Object = null) : Boolean
|
||||
{
|
||||
var _loc3_:Array = null;
|
||||
if(param1 == null)
|
||||
{
|
||||
if(param2 == null)
|
||||
{
|
||||
return _enabled(false,false);
|
||||
}
|
||||
}
|
||||
_loc3_ = param2 == null ? getChildren(true,true,false) : getTweensOf(param2);
|
||||
var _loc5_:int = int(_loc3_.length);
|
||||
var _loc4_:Boolean = false;
|
||||
while(--_loc5_ > -1)
|
||||
{
|
||||
if(_loc3_[_loc5_]._kill(param1,param2))
|
||||
{
|
||||
_loc4_ = true;
|
||||
}
|
||||
}
|
||||
return _loc4_;
|
||||
}
|
||||
|
||||
public function clear(param1:Boolean = true) : *
|
||||
{
|
||||
var _loc2_:Array = null;
|
||||
_loc2_ = getChildren(false,true,true);
|
||||
var _loc3_:int = int(_loc2_.length);
|
||||
_time = _totalTime = 0;
|
||||
while(--_loc3_ > -1)
|
||||
{
|
||||
_loc2_[_loc3_]._enabled(false,false);
|
||||
}
|
||||
if(param1)
|
||||
{
|
||||
_labels = {};
|
||||
}
|
||||
return _uncache(true);
|
||||
}
|
||||
|
||||
override public function invalidate() : *
|
||||
{
|
||||
var _loc1_:Animation = _first;
|
||||
while(_loc1_)
|
||||
{
|
||||
_loc1_.invalidate();
|
||||
_loc1_ = _loc1_._next;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
override public function _enabled(param1:Boolean, param2:Boolean = false) : Boolean
|
||||
{
|
||||
var _loc3_:Animation = null;
|
||||
if(param1 == _gc)
|
||||
{
|
||||
_loc3_ = _first;
|
||||
while(_loc3_)
|
||||
{
|
||||
_loc3_._enabled(param1,true);
|
||||
_loc3_ = _loc3_._next;
|
||||
}
|
||||
}
|
||||
return super._enabled(param1,param2);
|
||||
}
|
||||
|
||||
override public function duration(param1:Number = NaN) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
if(_dirty)
|
||||
{
|
||||
totalDuration();
|
||||
}
|
||||
return _duration;
|
||||
}
|
||||
if(duration() !== 0)
|
||||
{
|
||||
if(param1 !== 0)
|
||||
{
|
||||
timeScale(_duration / param1);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
override public function totalDuration(param1:Number = NaN) : *
|
||||
{
|
||||
var _loc7_:Animation = null;
|
||||
var _loc6_:Number = NaN;
|
||||
var _loc3_:Number = NaN;
|
||||
if(!arguments.length)
|
||||
{
|
||||
if(_dirty)
|
||||
{
|
||||
_loc3_ = 0;
|
||||
var _loc4_:Animation = _last;
|
||||
var _loc5_:Number = Infinity;
|
||||
while(_loc4_)
|
||||
{
|
||||
_loc7_ = _loc4_._prev;
|
||||
if(_loc4_._dirty)
|
||||
{
|
||||
_loc4_.totalDuration();
|
||||
}
|
||||
if(_loc4_._startTime > _loc5_ && _sortChildren && !_loc4_._paused)
|
||||
{
|
||||
add(_loc4_,_loc4_._startTime - _loc4_._delay);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_ = _loc4_._startTime;
|
||||
}
|
||||
if(_loc4_._startTime < 0 && !_loc4_._paused)
|
||||
{
|
||||
_loc3_ -= _loc4_._startTime;
|
||||
if(_timeline.smoothChildTiming)
|
||||
{
|
||||
_startTime += _loc4_._startTime / _timeScale;
|
||||
}
|
||||
shiftChildren(-_loc4_._startTime,false,-9999999999);
|
||||
_loc5_ = 0;
|
||||
}
|
||||
_loc6_ = _loc4_._startTime + _loc4_._totalDuration / _loc4_._timeScale;
|
||||
if(_loc6_ > _loc3_)
|
||||
{
|
||||
_loc3_ = _loc6_;
|
||||
}
|
||||
_loc4_ = _loc7_;
|
||||
}
|
||||
_duration = _totalDuration = _loc3_;
|
||||
_dirty = false;
|
||||
}
|
||||
return _totalDuration;
|
||||
}
|
||||
if(totalDuration() != 0)
|
||||
{
|
||||
if(param1 != 0)
|
||||
{
|
||||
timeScale(_totalDuration / param1);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public function usesFrames() : Boolean
|
||||
{
|
||||
var _loc1_:SimpleTimeline = _timeline;
|
||||
while(_loc1_._timeline)
|
||||
{
|
||||
_loc1_ = _loc1_._timeline;
|
||||
}
|
||||
return _loc1_ == _rootFramesTimeline;
|
||||
}
|
||||
|
||||
override public function rawTime() : Number
|
||||
{
|
||||
return _paused ? _totalTime : (_timeline.rawTime() - _startTime) * _timeScale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,917 @@
|
||||
package com.greensock
|
||||
{
|
||||
import com.greensock.core.Animation;
|
||||
import com.greensock.core.PropTween;
|
||||
import com.greensock.core.SimpleTimeline;
|
||||
import com.greensock.events.TweenEvent;
|
||||
import com.greensock.plugins.*;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import flash.display.Shape;
|
||||
import flash.events.Event;
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.events.IEventDispatcher;
|
||||
import flash.utils.getTimer;
|
||||
|
||||
public class TweenMax extends TweenLite implements IEventDispatcher
|
||||
{
|
||||
|
||||
public static const version:String = "12.1.5";
|
||||
|
||||
protected static var _listenerLookup:Object = {
|
||||
"onCompleteListener":"complete",
|
||||
"onUpdateListener":"change",
|
||||
"onStartListener":"start",
|
||||
"onRepeatListener":"repeat",
|
||||
"onReverseCompleteListener":"reverseComplete"
|
||||
};
|
||||
|
||||
public static var ticker:Shape = Animation.ticker;
|
||||
|
||||
public static var allTo:Function = staggerTo;
|
||||
|
||||
public static var allFrom:Function = staggerFrom;
|
||||
|
||||
public static var allFromTo:Function = staggerFromTo;
|
||||
|
||||
TweenPlugin.activate([AutoAlphaPlugin,EndArrayPlugin,FramePlugin,RemoveTintPlugin,TintPlugin,VisiblePlugin,VolumePlugin,BevelFilterPlugin,BezierPlugin,BezierThroughPlugin,BlurFilterPlugin,ColorMatrixFilterPlugin,ColorTransformPlugin,DropShadowFilterPlugin,FrameLabelPlugin,GlowFilterPlugin,HexColorsPlugin,RoundPropsPlugin,ShortRotationPlugin]);
|
||||
|
||||
protected var _dispatcher:EventDispatcher;
|
||||
|
||||
protected var _hasUpdateListener:Boolean;
|
||||
|
||||
protected var _repeat:int = 0;
|
||||
|
||||
protected var _repeatDelay:Number = 0;
|
||||
|
||||
protected var _cycle:int = 0;
|
||||
|
||||
public var _yoyo:Boolean;
|
||||
|
||||
public function TweenMax(param1:Object, param2:Number, param3:Object)
|
||||
{
|
||||
super(param1,param2,param3);
|
||||
_yoyo = this.vars.yoyo == true;
|
||||
_repeat = int(this.vars.repeat);
|
||||
_repeatDelay = this.vars.repeatDelay || 0;
|
||||
_dirty = true;
|
||||
if(this.vars.onCompleteListener || this.vars.onUpdateListener || this.vars.onStartListener || this.vars.onRepeatListener || this.vars.onReverseCompleteListener)
|
||||
{
|
||||
_initDispatcher();
|
||||
if(_duration == 0)
|
||||
{
|
||||
if(_delay == 0)
|
||||
{
|
||||
if(this.vars.immediateRender)
|
||||
{
|
||||
_dispatcher.dispatchEvent(new TweenEvent("change"));
|
||||
_dispatcher.dispatchEvent(new TweenEvent("complete"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function killTweensOf(param1:*, param2:* = false, param3:Object = null) : void
|
||||
{
|
||||
TweenLite.killTweensOf(param1,param2,param3);
|
||||
}
|
||||
|
||||
public static function killDelayedCallsTo(param1:Function) : void
|
||||
{
|
||||
TweenLite.killTweensOf(param1);
|
||||
}
|
||||
|
||||
public static function getTweensOf(param1:*, param2:Boolean = false) : Array
|
||||
{
|
||||
return TweenLite.getTweensOf(param1,param2);
|
||||
}
|
||||
|
||||
public static function to(param1:Object, param2:Number, param3:Object) : TweenMax
|
||||
{
|
||||
return new TweenMax(param1,param2,param3);
|
||||
}
|
||||
|
||||
public static function from(param1:Object, param2:Number, param3:Object) : TweenMax
|
||||
{
|
||||
param3 = _prepVars(param3,true);
|
||||
param3.runBackwards = true;
|
||||
return new TweenMax(param1,param2,param3);
|
||||
}
|
||||
|
||||
public static function fromTo(param1:Object, param2:Number, param3:Object, param4:Object) : TweenMax
|
||||
{
|
||||
param4 = _prepVars(param4,false);
|
||||
param3 = _prepVars(param3,false);
|
||||
param4.startAt = param3;
|
||||
param4.immediateRender = param4.immediateRender != false && param3.immediateRender != false;
|
||||
return new TweenMax(param1,param2,param4);
|
||||
}
|
||||
|
||||
public static function staggerTo(param1:Array, param2:Number, param3:Object, param4:Number = 0, param5:Function = null, param6:Array = null) : Array
|
||||
{
|
||||
var copy:Object;
|
||||
var p:String;
|
||||
var targets:Array = param1;
|
||||
var duration:Number = param2;
|
||||
var vars:Object = param3;
|
||||
var stagger:Number = param4;
|
||||
var onCompleteAll:Function = param5;
|
||||
var onCompleteAllParams:Array = param6;
|
||||
vars = _prepVars(vars,false);
|
||||
var a:Array = [];
|
||||
var l:int = int(targets.length);
|
||||
var delay:Number = Number(vars.delay || 0);
|
||||
var i:int = 0;
|
||||
while(i < l)
|
||||
{
|
||||
copy = {};
|
||||
for(p in vars)
|
||||
{
|
||||
copy[p] = vars[p];
|
||||
}
|
||||
copy.delay = delay;
|
||||
if(i == l - 1)
|
||||
{
|
||||
if(onCompleteAll != null)
|
||||
{
|
||||
copy.onComplete = function():void
|
||||
{
|
||||
if(vars.onComplete)
|
||||
{
|
||||
vars.onComplete.apply(null,arguments);
|
||||
}
|
||||
onCompleteAll.apply(null,onCompleteAllParams);
|
||||
};
|
||||
}
|
||||
}
|
||||
a[i] = new TweenMax(targets[i],duration,copy);
|
||||
delay += stagger;
|
||||
i = i + 1;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
public static function staggerFrom(param1:Array, param2:Number, param3:Object, param4:Number = 0, param5:Function = null, param6:Array = null) : Array
|
||||
{
|
||||
param3 = _prepVars(param3,true);
|
||||
param3.runBackwards = true;
|
||||
if(param3.immediateRender != false)
|
||||
{
|
||||
param3.immediateRender = true;
|
||||
}
|
||||
return staggerTo(param1,param2,param3,param4,param5,param6);
|
||||
}
|
||||
|
||||
public static function staggerFromTo(param1:Array, param2:Number, param3:Object, param4:Object, param5:Number = 0, param6:Function = null, param7:Array = null) : Array
|
||||
{
|
||||
param4 = _prepVars(param4,false);
|
||||
param3 = _prepVars(param3,false);
|
||||
param4.startAt = param3;
|
||||
param4.immediateRender = param4.immediateRender != false && param3.immediateRender != false;
|
||||
return staggerTo(param1,param2,param4,param5,param6,param7);
|
||||
}
|
||||
|
||||
public static function delayedCall(param1:Number, param2:Function, param3:Array = null, param4:Boolean = false) : TweenMax
|
||||
{
|
||||
return new TweenMax(param2,0,{
|
||||
"delay":param1,
|
||||
"onComplete":param2,
|
||||
"onCompleteParams":param3,
|
||||
"onReverseComplete":param2,
|
||||
"onReverseCompleteParams":param3,
|
||||
"immediateRender":false,
|
||||
"useFrames":param4,
|
||||
"overwrite":0
|
||||
});
|
||||
}
|
||||
|
||||
public static function set(param1:Object, param2:Object) : TweenMax
|
||||
{
|
||||
return new TweenMax(param1,0,param2);
|
||||
}
|
||||
|
||||
public static function isTweening(param1:Object) : Boolean
|
||||
{
|
||||
return TweenLite.getTweensOf(param1,true).length > 0;
|
||||
}
|
||||
|
||||
public static function getAllTweens(param1:Boolean = false) : Array
|
||||
{
|
||||
var _loc2_:Array = _getChildrenOf(_rootTimeline,param1);
|
||||
return _loc2_.concat(_getChildrenOf(_rootFramesTimeline,param1));
|
||||
}
|
||||
|
||||
protected static function _getChildrenOf(param1:SimpleTimeline, param2:Boolean) : Array
|
||||
{
|
||||
if(param1 == null)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
var _loc5_:Array = [];
|
||||
var _loc4_:int = 0;
|
||||
var _loc3_:Animation = param1._first;
|
||||
while(_loc3_)
|
||||
{
|
||||
if(_loc3_ is TweenLite)
|
||||
{
|
||||
_loc5_[_loc4_++] = _loc3_;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
_loc5_[_loc4_++] = _loc3_;
|
||||
}
|
||||
_loc5_ = _loc5_.concat(_getChildrenOf(SimpleTimeline(_loc3_),param2));
|
||||
_loc4_ = int(_loc5_.length);
|
||||
}
|
||||
_loc3_ = _loc3_._next;
|
||||
}
|
||||
return _loc5_;
|
||||
}
|
||||
|
||||
public static function killAll(param1:Boolean = false, param2:Boolean = true, param3:Boolean = true, param4:Boolean = true) : void
|
||||
{
|
||||
var _loc9_:Boolean = false;
|
||||
var _loc5_:Animation = null;
|
||||
var _loc10_:int = 0;
|
||||
var _loc7_:Array = null;
|
||||
_loc7_ = getAllTweens(param4);
|
||||
var _loc8_:int = int(_loc7_.length);
|
||||
var _loc6_:Boolean = param2 && param3 && param4;
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc8_)
|
||||
{
|
||||
_loc5_ = _loc7_[_loc10_];
|
||||
if(_loc6_ || _loc5_ is SimpleTimeline || _loc9_ == (TweenLite(_loc5_).target == TweenLite(_loc5_).vars.onComplete) && param3 || param2 && !_loc9_)
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
_loc5_.totalTime(_loc5_._reversed ? 0 : _loc5_.totalDuration());
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_._enabled(false,false);
|
||||
}
|
||||
}
|
||||
_loc10_++;
|
||||
}
|
||||
}
|
||||
|
||||
public static function killChildTweensOf(param1:DisplayObjectContainer, param2:Boolean = false) : void
|
||||
{
|
||||
var _loc5_:int = 0;
|
||||
var _loc3_:Array = null;
|
||||
_loc3_ = getAllTweens(false);
|
||||
var _loc4_:int = int(_loc3_.length);
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < _loc4_)
|
||||
{
|
||||
if(_containsChildOf(param1,_loc3_[_loc5_].target))
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
_loc3_[_loc5_].totalTime(_loc3_[_loc5_].totalDuration());
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_[_loc5_]._enabled(false,false);
|
||||
}
|
||||
}
|
||||
_loc5_++;
|
||||
}
|
||||
}
|
||||
|
||||
private static function _containsChildOf(param1:DisplayObjectContainer, param2:Object) : Boolean
|
||||
{
|
||||
var _loc3_:DisplayObjectContainer = null;
|
||||
var _loc4_:int = 0;
|
||||
if(param2 is Array)
|
||||
{
|
||||
_loc4_ = int(param2.length);
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
if(_containsChildOf(param1,param2[_loc4_]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(param2 is DisplayObject)
|
||||
{
|
||||
_loc3_ = param2.parent;
|
||||
while(_loc3_)
|
||||
{
|
||||
if(_loc3_ == param1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
_loc3_ = _loc3_.parent;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function pauseAll(param1:Boolean = true, param2:Boolean = true, param3:Boolean = true) : void
|
||||
{
|
||||
_changePause(true,param1,param2,param3);
|
||||
}
|
||||
|
||||
public static function resumeAll(param1:Boolean = true, param2:Boolean = true, param3:Boolean = true) : void
|
||||
{
|
||||
_changePause(false,param1,param2,param3);
|
||||
}
|
||||
|
||||
private static function _changePause(param1:Boolean, param2:Boolean = true, param3:Boolean = false, param4:Boolean = true) : void
|
||||
{
|
||||
var _loc8_:Boolean = false;
|
||||
var _loc6_:Animation = null;
|
||||
var _loc7_:Array = null;
|
||||
_loc7_ = getAllTweens(param4);
|
||||
var _loc5_:Boolean = param2 && param3 && param4;
|
||||
var _loc9_:int = int(_loc7_.length);
|
||||
while(--_loc9_ > -1)
|
||||
{
|
||||
_loc6_ = _loc7_[_loc9_];
|
||||
_loc8_ = _loc6_ is TweenLite && TweenLite(_loc6_).target == _loc6_.vars.onComplete;
|
||||
if(_loc5_ || _loc6_ is SimpleTimeline || _loc8_ && param3 || param2 && !_loc8_)
|
||||
{
|
||||
_loc6_.paused(param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function globalTimeScale(param1:Number = NaN) : Number
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _rootTimeline == null ? 1 : _rootTimeline._timeScale;
|
||||
}
|
||||
param1 ||= 0.0001;
|
||||
if(_rootTimeline == null)
|
||||
{
|
||||
TweenLite.to({},0,{});
|
||||
}
|
||||
var _loc3_:SimpleTimeline = _rootTimeline;
|
||||
var _loc4_:Number = getTimer() / 1000;
|
||||
_loc3_._startTime = _loc4_ - (_loc4_ - _loc3_._startTime) * _loc3_._timeScale / param1;
|
||||
_loc3_ = _rootFramesTimeline;
|
||||
_loc4_ = _rootFrame;
|
||||
_loc3_._startTime = _loc4_ - (_loc4_ - _loc3_._startTime) * _loc3_._timeScale / param1;
|
||||
_rootFramesTimeline._timeScale = _rootTimeline._timeScale = param1;
|
||||
return param1;
|
||||
}
|
||||
|
||||
override public function invalidate() : *
|
||||
{
|
||||
_yoyo = this.vars.yoyo == true;
|
||||
_repeat = this.vars.repeat || 0;
|
||||
_repeatDelay = this.vars.repeatDelay || 0;
|
||||
_hasUpdateListener = false;
|
||||
_initDispatcher();
|
||||
_uncache(true);
|
||||
return super.invalidate();
|
||||
}
|
||||
|
||||
public function updateTo(param1:Object, param2:Boolean = false) : *
|
||||
{
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc3_:Number = NaN;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc4_:Number = ratio;
|
||||
if(param2)
|
||||
{
|
||||
if(_startTime < _timeline._time)
|
||||
{
|
||||
_startTime = _timeline._time;
|
||||
_uncache(false);
|
||||
if(_gc)
|
||||
{
|
||||
_enabled(true,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_timeline.insert(this,_startTime - _delay);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(var _loc5_:String in param1)
|
||||
{
|
||||
this.vars[_loc5_] = param1[_loc5_];
|
||||
}
|
||||
if(_initted)
|
||||
{
|
||||
if(param2)
|
||||
{
|
||||
_initted = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_gc)
|
||||
{
|
||||
_enabled(true,false);
|
||||
}
|
||||
if(_notifyPluginsOfEnabled)
|
||||
{
|
||||
if(_firstPT != null)
|
||||
{
|
||||
_onPluginEvent("_onDisable",this);
|
||||
}
|
||||
}
|
||||
if(_time / _duration > 0.998)
|
||||
{
|
||||
_loc8_ = _time;
|
||||
render(0,true,false);
|
||||
_initted = false;
|
||||
render(_loc8_,true,false);
|
||||
}
|
||||
else if(_time > 0)
|
||||
{
|
||||
_initted = false;
|
||||
_init();
|
||||
_loc7_ = 1 / (1 - _loc4_);
|
||||
var _loc6_:PropTween = _firstPT;
|
||||
while(_loc6_)
|
||||
{
|
||||
_loc3_ = _loc6_.s + _loc6_.c;
|
||||
_loc6_.c *= _loc7_;
|
||||
_loc6_.s = _loc3_ - _loc6_.c;
|
||||
_loc6_ = _loc6_._next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
override public function render(param1:Number, param2:Boolean = false, param3:Boolean = false) : void
|
||||
{
|
||||
var _loc5_:Boolean = false;
|
||||
var _loc10_:String = null;
|
||||
var _loc9_:PropTween = null;
|
||||
var _loc11_:Number = NaN;
|
||||
var _loc14_:Number = NaN;
|
||||
var _loc8_:Number = NaN;
|
||||
if(!_initted)
|
||||
{
|
||||
if(_duration === 0 && vars.repeat)
|
||||
{
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
var _loc12_:Number = Number(!_dirty ? _totalDuration : totalDuration());
|
||||
var _loc15_:Number = _time;
|
||||
var _loc4_:Number = _totalTime;
|
||||
var _loc7_:Number = _cycle;
|
||||
if(param1 >= _loc12_)
|
||||
{
|
||||
_totalTime = _loc12_;
|
||||
_cycle = _repeat;
|
||||
if(_yoyo && (_cycle & 1) != 0)
|
||||
{
|
||||
_time = 0;
|
||||
ratio = _ease._calcEnd ? _ease.getRatio(0) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_time = _duration;
|
||||
ratio = _ease._calcEnd ? _ease.getRatio(1) : 1;
|
||||
}
|
||||
if(!_reversed)
|
||||
{
|
||||
_loc5_ = true;
|
||||
_loc10_ = "onComplete";
|
||||
}
|
||||
if(_duration == 0)
|
||||
{
|
||||
_loc11_ = _rawPrevTime;
|
||||
if(_startTime === _timeline._duration)
|
||||
{
|
||||
param1 = 0;
|
||||
}
|
||||
if(param1 === 0 || _loc11_ < 0 || _loc11_ === _tinyNum)
|
||||
{
|
||||
if(_loc11_ !== param1)
|
||||
{
|
||||
param3 = true;
|
||||
if(_loc11_ > _tinyNum)
|
||||
{
|
||||
_loc10_ = "onReverseComplete";
|
||||
}
|
||||
}
|
||||
}
|
||||
_rawPrevTime = _loc11_ = !param2 || param1 !== 0 || _rawPrevTime === param1 ? param1 : _tinyNum;
|
||||
}
|
||||
}
|
||||
else if(param1 < 1e-7)
|
||||
{
|
||||
_totalTime = _time = _cycle = 0;
|
||||
ratio = _ease._calcEnd ? _ease.getRatio(0) : 0;
|
||||
if(_loc4_ !== 0 || _duration === 0 && _rawPrevTime > 0 && _rawPrevTime !== _tinyNum)
|
||||
{
|
||||
_loc10_ = "onReverseComplete";
|
||||
_loc5_ = _reversed;
|
||||
}
|
||||
if(param1 < 0)
|
||||
{
|
||||
_active = false;
|
||||
if(_duration == 0)
|
||||
{
|
||||
if(_rawPrevTime >= 0)
|
||||
{
|
||||
param3 = true;
|
||||
}
|
||||
_rawPrevTime = _loc11_ = !param2 || param1 !== 0 || _rawPrevTime === param1 ? param1 : _tinyNum;
|
||||
}
|
||||
}
|
||||
else if(!_initted)
|
||||
{
|
||||
param3 = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_totalTime = _time = param1;
|
||||
if(_repeat != 0)
|
||||
{
|
||||
_loc14_ = _duration + _repeatDelay;
|
||||
_cycle = _totalTime / _loc14_ >> 0;
|
||||
if(_cycle !== 0)
|
||||
{
|
||||
if(_cycle === _totalTime / _loc14_)
|
||||
{
|
||||
_cycle = _cycle - 1;
|
||||
}
|
||||
}
|
||||
_time = _totalTime - _cycle * _loc14_;
|
||||
if(_yoyo)
|
||||
{
|
||||
if((_cycle & 1) != 0)
|
||||
{
|
||||
_time = _duration - _time;
|
||||
}
|
||||
}
|
||||
if(_time > _duration)
|
||||
{
|
||||
_time = _duration;
|
||||
}
|
||||
else if(_time < 0)
|
||||
{
|
||||
_time = 0;
|
||||
}
|
||||
}
|
||||
if(_easeType)
|
||||
{
|
||||
_loc8_ = _time / _duration;
|
||||
var _loc13_:int = _easeType;
|
||||
var _loc6_:int = _easePower;
|
||||
if(_loc13_ == 1 || _loc13_ == 3 && _loc8_ >= 0.5)
|
||||
{
|
||||
_loc8_ = 1 - _loc8_;
|
||||
}
|
||||
if(_loc13_ == 3)
|
||||
{
|
||||
_loc8_ *= 2;
|
||||
}
|
||||
if(_loc6_ == 1)
|
||||
{
|
||||
_loc8_ *= _loc8_;
|
||||
}
|
||||
else if(_loc6_ == 2)
|
||||
{
|
||||
_loc8_ *= _loc8_ * _loc8_;
|
||||
}
|
||||
else if(_loc6_ == 3)
|
||||
{
|
||||
_loc8_ *= _loc8_ * _loc8_ * _loc8_;
|
||||
}
|
||||
else if(_loc6_ == 4)
|
||||
{
|
||||
_loc8_ *= _loc8_ * _loc8_ * _loc8_ * _loc8_;
|
||||
}
|
||||
if(_loc13_ == 1)
|
||||
{
|
||||
ratio = 1 - _loc8_;
|
||||
}
|
||||
else if(_loc13_ == 2)
|
||||
{
|
||||
ratio = _loc8_;
|
||||
}
|
||||
else if(_time / _duration < 0.5)
|
||||
{
|
||||
ratio = _loc8_ / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
ratio = 1 - _loc8_ / 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ratio = _ease.getRatio(_time / _duration);
|
||||
}
|
||||
}
|
||||
if(_loc15_ == _time && !param3 && _cycle === _loc7_)
|
||||
{
|
||||
if(_loc4_ !== _totalTime)
|
||||
{
|
||||
if(_onUpdate != null)
|
||||
{
|
||||
if(!param2)
|
||||
{
|
||||
_onUpdate.apply(vars.onUpdateScope || this,vars.onUpdateParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(!_initted)
|
||||
{
|
||||
_init();
|
||||
if(!_initted || _gc)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(_time && !_loc5_)
|
||||
{
|
||||
ratio = _ease.getRatio(_time / _duration);
|
||||
}
|
||||
else if(_loc5_ && _ease._calcEnd)
|
||||
{
|
||||
ratio = _ease.getRatio(_time === 0 ? 0 : 1);
|
||||
}
|
||||
}
|
||||
if(!_active)
|
||||
{
|
||||
if(!_paused && _time !== _loc15_ && param1 >= 0)
|
||||
{
|
||||
_active = true;
|
||||
}
|
||||
}
|
||||
if(_loc4_ == 0)
|
||||
{
|
||||
if(_startAt != null)
|
||||
{
|
||||
if(param1 >= 0)
|
||||
{
|
||||
_startAt.render(param1,param2,param3);
|
||||
}
|
||||
else if(!_loc10_)
|
||||
{
|
||||
_loc10_ = "_dummyGS";
|
||||
}
|
||||
}
|
||||
if(_totalTime != 0 || _duration == 0)
|
||||
{
|
||||
if(!param2)
|
||||
{
|
||||
if(vars.onStart)
|
||||
{
|
||||
vars.onStart.apply(null,vars.onStartParams);
|
||||
}
|
||||
if(_dispatcher)
|
||||
{
|
||||
_dispatcher.dispatchEvent(new TweenEvent("start"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc9_ = _firstPT;
|
||||
while(_loc9_)
|
||||
{
|
||||
if(_loc9_.f)
|
||||
{
|
||||
_loc9_.t[_loc9_.p](_loc9_.c * ratio + _loc9_.s);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc9_.t[_loc9_.p] = _loc9_.c * ratio + _loc9_.s;
|
||||
}
|
||||
_loc9_ = _loc9_._next;
|
||||
}
|
||||
if(_onUpdate != null)
|
||||
{
|
||||
if(param1 < 0 && _startAt != null && _startTime != 0)
|
||||
{
|
||||
_startAt.render(param1,param2,param3);
|
||||
}
|
||||
if(!param2)
|
||||
{
|
||||
if(_totalTime !== _loc4_ || _loc5_)
|
||||
{
|
||||
_onUpdate.apply(null,vars.onUpdateParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_hasUpdateListener)
|
||||
{
|
||||
if(param1 < 0 && _startAt != null && _onUpdate == null && _startTime != 0)
|
||||
{
|
||||
_startAt.render(param1,param2,param3);
|
||||
}
|
||||
if(!param2)
|
||||
{
|
||||
_dispatcher.dispatchEvent(new TweenEvent("change"));
|
||||
}
|
||||
}
|
||||
if(_cycle != _loc7_)
|
||||
{
|
||||
if(!param2)
|
||||
{
|
||||
if(!_gc)
|
||||
{
|
||||
if(vars.onRepeat)
|
||||
{
|
||||
vars.onRepeat.apply(null,vars.onRepeatParams);
|
||||
}
|
||||
if(_dispatcher)
|
||||
{
|
||||
_dispatcher.dispatchEvent(new TweenEvent("repeat"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_loc10_)
|
||||
{
|
||||
if(!_gc)
|
||||
{
|
||||
if(param1 < 0 && _startAt != null && _onUpdate == null && !_hasUpdateListener && _startTime != 0)
|
||||
{
|
||||
_startAt.render(param1,param2,true);
|
||||
}
|
||||
if(_loc5_)
|
||||
{
|
||||
if(_timeline.autoRemoveChildren)
|
||||
{
|
||||
_enabled(false,false);
|
||||
}
|
||||
_active = false;
|
||||
}
|
||||
if(!param2)
|
||||
{
|
||||
if(vars[_loc10_])
|
||||
{
|
||||
vars[_loc10_].apply(null,vars[_loc10_ + "Params"]);
|
||||
}
|
||||
if(_dispatcher)
|
||||
{
|
||||
_dispatcher.dispatchEvent(new TweenEvent(_loc10_ == "onComplete" ? "complete" : "reverseComplete"));
|
||||
}
|
||||
}
|
||||
if(_duration === 0 && _rawPrevTime === _tinyNum && _loc11_ !== _tinyNum)
|
||||
{
|
||||
_rawPrevTime = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function _initDispatcher() : Boolean
|
||||
{
|
||||
var _loc1_:String = null;
|
||||
var _loc2_:Boolean = false;
|
||||
for(_loc1_ in _listenerLookup)
|
||||
{
|
||||
if(_loc1_ in vars)
|
||||
{
|
||||
if(vars[_loc1_] is Function)
|
||||
{
|
||||
if(_dispatcher == null)
|
||||
{
|
||||
_dispatcher = new EventDispatcher(this);
|
||||
}
|
||||
_dispatcher.addEventListener(_listenerLookup[_loc1_],vars[_loc1_],false,0,true);
|
||||
_loc2_ = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
public function addEventListener(param1:String, param2:Function, param3:Boolean = false, param4:int = 0, param5:Boolean = false) : void
|
||||
{
|
||||
if(_dispatcher == null)
|
||||
{
|
||||
_dispatcher = new EventDispatcher(this);
|
||||
}
|
||||
if(param1 == "change")
|
||||
{
|
||||
_hasUpdateListener = true;
|
||||
}
|
||||
_dispatcher.addEventListener(param1,param2,param3,param4,param5);
|
||||
}
|
||||
|
||||
public function removeEventListener(param1:String, param2:Function, param3:Boolean = false) : void
|
||||
{
|
||||
if(_dispatcher)
|
||||
{
|
||||
_dispatcher.removeEventListener(param1,param2,param3);
|
||||
}
|
||||
}
|
||||
|
||||
public function hasEventListener(param1:String) : Boolean
|
||||
{
|
||||
return _dispatcher == null ? false : _dispatcher.hasEventListener(param1);
|
||||
}
|
||||
|
||||
public function willTrigger(param1:String) : Boolean
|
||||
{
|
||||
return _dispatcher == null ? false : _dispatcher.willTrigger(param1);
|
||||
}
|
||||
|
||||
public function dispatchEvent(param1:Event) : Boolean
|
||||
{
|
||||
return _dispatcher == null ? false : _dispatcher.dispatchEvent(param1);
|
||||
}
|
||||
|
||||
override public function progress(param1:Number = NaN, param2:Boolean = false) : *
|
||||
{
|
||||
return !arguments.length ? _time / duration() : totalTime(duration() * (_yoyo && (_cycle & 1) !== 0 ? 1 - param1 : param1) + _cycle * (_duration + _repeatDelay),param2);
|
||||
}
|
||||
|
||||
override public function totalProgress(param1:Number = NaN, param2:Boolean = false) : *
|
||||
{
|
||||
return !arguments.length ? _totalTime / totalDuration() : totalTime(totalDuration() * param1,param2);
|
||||
}
|
||||
|
||||
override public function time(param1:Number = NaN, param2:Boolean = false) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _time;
|
||||
}
|
||||
if(_dirty)
|
||||
{
|
||||
totalDuration();
|
||||
}
|
||||
if(param1 > _duration)
|
||||
{
|
||||
param1 = _duration;
|
||||
}
|
||||
if(_yoyo && (_cycle & 1) !== 0)
|
||||
{
|
||||
param1 = _duration - param1 + _cycle * (_duration + _repeatDelay);
|
||||
}
|
||||
else if(_repeat != 0)
|
||||
{
|
||||
param1 += _cycle * (_duration + _repeatDelay);
|
||||
}
|
||||
return totalTime(param1,param2);
|
||||
}
|
||||
|
||||
override public function duration(param1:Number = NaN) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
return this._duration;
|
||||
}
|
||||
return super.duration(param1);
|
||||
}
|
||||
|
||||
override public function totalDuration(param1:Number = NaN) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
if(_dirty)
|
||||
{
|
||||
_totalDuration = _repeat == -1 ? 999999999999 : _duration * (_repeat + 1) + _repeatDelay * _repeat;
|
||||
_dirty = false;
|
||||
}
|
||||
return _totalDuration;
|
||||
}
|
||||
return _repeat == -1 ? this : duration((param1 - _repeat * _repeatDelay) / (_repeat + 1));
|
||||
}
|
||||
|
||||
public function repeat(param1:int = 0) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _repeat;
|
||||
}
|
||||
_repeat = param1;
|
||||
return _uncache(true);
|
||||
}
|
||||
|
||||
public function repeatDelay(param1:Number = NaN) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _repeatDelay;
|
||||
}
|
||||
_repeatDelay = param1;
|
||||
return _uncache(true);
|
||||
}
|
||||
|
||||
public function yoyo(param1:Boolean = false) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _yoyo;
|
||||
}
|
||||
_yoyo = param1;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,473 @@
|
||||
package com.greensock.core
|
||||
{
|
||||
import flash.display.Shape;
|
||||
import flash.events.Event;
|
||||
import flash.utils.getTimer;
|
||||
|
||||
public class Animation
|
||||
{
|
||||
|
||||
public static const version:String = "12.1.1";
|
||||
|
||||
public static var _rootTimeline:SimpleTimeline;
|
||||
|
||||
public static var _rootFramesTimeline:SimpleTimeline;
|
||||
|
||||
protected static var _rootFrame:Number = -1;
|
||||
|
||||
protected static var _tinyNum:Number = 1e-10;
|
||||
|
||||
public static var ticker:Shape = new Shape();
|
||||
|
||||
protected static var _tickEvent:Event = new Event("tick");
|
||||
|
||||
protected var _onUpdate:Function;
|
||||
|
||||
public var _delay:Number;
|
||||
|
||||
public var _rawPrevTime:Number;
|
||||
|
||||
public var _active:Boolean;
|
||||
|
||||
public var _gc:Boolean;
|
||||
|
||||
public var _initted:Boolean;
|
||||
|
||||
public var _startTime:Number;
|
||||
|
||||
public var _time:Number;
|
||||
|
||||
public var _totalTime:Number;
|
||||
|
||||
public var _duration:Number;
|
||||
|
||||
public var _totalDuration:Number;
|
||||
|
||||
public var _pauseTime:Number;
|
||||
|
||||
public var _timeScale:Number;
|
||||
|
||||
public var _reversed:Boolean;
|
||||
|
||||
public var _timeline:SimpleTimeline;
|
||||
|
||||
public var _dirty:Boolean;
|
||||
|
||||
public var _paused:Boolean;
|
||||
|
||||
public var _next:Animation;
|
||||
|
||||
public var _prev:Animation;
|
||||
|
||||
public var vars:Object;
|
||||
|
||||
public var timeline:SimpleTimeline;
|
||||
|
||||
public var data:*;
|
||||
|
||||
public function Animation(param1:Number = 0, param2:Object = null)
|
||||
{
|
||||
super();
|
||||
this.vars = param2 || {};
|
||||
if(this.vars._isGSVars)
|
||||
{
|
||||
this.vars = this.vars.vars;
|
||||
}
|
||||
_duration = _totalDuration = param1 || 0;
|
||||
_delay = Number(this.vars.delay) || 0;
|
||||
_timeScale = 1;
|
||||
_totalTime = _time = 0;
|
||||
data = this.vars.data;
|
||||
_rawPrevTime = -1;
|
||||
if(_rootTimeline == null)
|
||||
{
|
||||
if(_rootFrame != -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_rootFrame = 0;
|
||||
_rootFramesTimeline = new SimpleTimeline();
|
||||
_rootTimeline = new SimpleTimeline();
|
||||
_rootTimeline._startTime = getTimer() / 1000;
|
||||
_rootFramesTimeline._startTime = 0;
|
||||
_rootTimeline._active = _rootFramesTimeline._active = true;
|
||||
ticker.addEventListener("enterFrame",_updateRoot,false,0,true);
|
||||
}
|
||||
var _loc3_:SimpleTimeline = this.vars.useFrames ? _rootFramesTimeline : _rootTimeline;
|
||||
_loc3_.add(this,_loc3_._time);
|
||||
_reversed = this.vars.reversed == true;
|
||||
if(this.vars.paused)
|
||||
{
|
||||
paused(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static function _updateRoot(param1:Event = null) : void
|
||||
{
|
||||
_rootFrame = _rootFrame + 1;
|
||||
_rootTimeline.render((getTimer() / 1000 - _rootTimeline._startTime) * _rootTimeline._timeScale,false,false);
|
||||
_rootFramesTimeline.render((_rootFrame - _rootFramesTimeline._startTime) * _rootFramesTimeline._timeScale,false,false);
|
||||
ticker.dispatchEvent(_tickEvent);
|
||||
}
|
||||
|
||||
public function play(param1:* = null, param2:Boolean = true) : *
|
||||
{
|
||||
if(param1 != null)
|
||||
{
|
||||
seek(param1,param2);
|
||||
}
|
||||
reversed(false);
|
||||
return paused(false);
|
||||
}
|
||||
|
||||
public function pause(param1:* = null, param2:Boolean = true) : *
|
||||
{
|
||||
if(param1 != null)
|
||||
{
|
||||
seek(param1,param2);
|
||||
}
|
||||
return paused(true);
|
||||
}
|
||||
|
||||
public function resume(param1:* = null, param2:Boolean = true) : *
|
||||
{
|
||||
if(param1 != null)
|
||||
{
|
||||
seek(param1,param2);
|
||||
}
|
||||
return paused(false);
|
||||
}
|
||||
|
||||
public function seek(param1:*, param2:Boolean = true) : *
|
||||
{
|
||||
return totalTime(Number(param1),param2);
|
||||
}
|
||||
|
||||
public function restart(param1:Boolean = false, param2:Boolean = true) : *
|
||||
{
|
||||
reversed(false);
|
||||
paused(false);
|
||||
return totalTime(param1 ? -_delay : 0,param2,true);
|
||||
}
|
||||
|
||||
public function reverse(param1:* = null, param2:Boolean = true) : *
|
||||
{
|
||||
if(param1 != null)
|
||||
{
|
||||
seek(param1 || totalDuration(),param2);
|
||||
}
|
||||
reversed(true);
|
||||
return paused(false);
|
||||
}
|
||||
|
||||
public function render(param1:Number, param2:Boolean = false, param3:Boolean = false) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function invalidate() : *
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
public function isActive() : Boolean
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc1_:SimpleTimeline = _timeline;
|
||||
return _loc1_ == null || !_gc && !_paused && _loc1_.isActive() && (_loc2_ = _loc1_.rawTime()) >= _startTime && _loc2_ < _startTime + totalDuration() / _timeScale;
|
||||
}
|
||||
|
||||
public function _enabled(param1:Boolean, param2:Boolean = false) : Boolean
|
||||
{
|
||||
_gc = !param1;
|
||||
_active = param1 && !_paused && _totalTime > 0 && _totalTime < _totalDuration;
|
||||
if(!param2)
|
||||
{
|
||||
if(param1 && timeline == null)
|
||||
{
|
||||
_timeline.add(this,_startTime - _delay);
|
||||
}
|
||||
else if(!param1 && timeline != null)
|
||||
{
|
||||
_timeline._remove(this,true);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function _kill(param1:Object = null, param2:Object = null) : Boolean
|
||||
{
|
||||
return _enabled(false,false);
|
||||
}
|
||||
|
||||
public function kill(param1:Object = null, param2:Object = null) : *
|
||||
{
|
||||
_kill(param1,param2);
|
||||
return this;
|
||||
}
|
||||
|
||||
protected function _uncache(param1:Boolean) : *
|
||||
{
|
||||
var _loc2_:Animation = param1 ? this : timeline;
|
||||
while(_loc2_)
|
||||
{
|
||||
_loc2_._dirty = true;
|
||||
_loc2_ = _loc2_.timeline;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
protected function _swapSelfInParams(param1:Array) : Array
|
||||
{
|
||||
var _loc2_:int = int(param1.length);
|
||||
var _loc3_:Array = param1.concat();
|
||||
while(--_loc2_ > -1)
|
||||
{
|
||||
if(param1[_loc2_] === "{self}")
|
||||
{
|
||||
_loc3_[_loc2_] = this;
|
||||
}
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
public function eventCallback(param1:String, param2:Function = null, param3:Array = null) : *
|
||||
{
|
||||
if(param1 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if(param1.substr(0,2) == "on")
|
||||
{
|
||||
if(arguments.length == 1)
|
||||
{
|
||||
return vars[param1];
|
||||
}
|
||||
if(param2 == null)
|
||||
{
|
||||
delete vars[param1];
|
||||
}
|
||||
else
|
||||
{
|
||||
vars[param1] = param2;
|
||||
vars[param1 + "Params"] = param3 is Array && param3.join("").indexOf("{self}") !== -1 ? _swapSelfInParams(param3) : param3;
|
||||
}
|
||||
if(param1 == "onUpdate")
|
||||
{
|
||||
_onUpdate = param2;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public function delay(param1:Number = NaN) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _delay;
|
||||
}
|
||||
if(_timeline.smoothChildTiming)
|
||||
{
|
||||
startTime(_startTime + param1 - _delay);
|
||||
}
|
||||
_delay = param1;
|
||||
return this;
|
||||
}
|
||||
|
||||
public function duration(param1:Number = NaN) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
_dirty = false;
|
||||
return _duration;
|
||||
}
|
||||
_duration = _totalDuration = param1;
|
||||
_uncache(true);
|
||||
if(_timeline.smoothChildTiming)
|
||||
{
|
||||
if(_time > 0)
|
||||
{
|
||||
if(_time < _duration)
|
||||
{
|
||||
if(param1 != 0)
|
||||
{
|
||||
totalTime(_totalTime * (param1 / _duration),true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public function totalDuration(param1:Number = NaN) : *
|
||||
{
|
||||
_dirty = false;
|
||||
return !arguments.length ? _totalDuration : duration(param1);
|
||||
}
|
||||
|
||||
public function time(param1:Number = NaN, param2:Boolean = false) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _time;
|
||||
}
|
||||
if(_dirty)
|
||||
{
|
||||
totalDuration();
|
||||
}
|
||||
if(param1 > _duration)
|
||||
{
|
||||
param1 = _duration;
|
||||
}
|
||||
return totalTime(param1,param2);
|
||||
}
|
||||
|
||||
public function totalTime(param1:Number = NaN, param2:Boolean = false, param3:Boolean = false) : *
|
||||
{
|
||||
var _loc5_:SimpleTimeline = null;
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _totalTime;
|
||||
}
|
||||
if(_timeline)
|
||||
{
|
||||
if(param1 < 0 && !param3)
|
||||
{
|
||||
param1 += totalDuration();
|
||||
}
|
||||
if(_timeline.smoothChildTiming)
|
||||
{
|
||||
if(_dirty)
|
||||
{
|
||||
totalDuration();
|
||||
}
|
||||
if(param1 > _totalDuration && !param3)
|
||||
{
|
||||
param1 = _totalDuration;
|
||||
}
|
||||
_loc5_ = _timeline;
|
||||
_startTime = (_paused ? _pauseTime : _loc5_._time) - (!_reversed ? param1 : _totalDuration - param1) / _timeScale;
|
||||
if(!_timeline._dirty)
|
||||
{
|
||||
_uncache(false);
|
||||
}
|
||||
if(_loc5_._timeline != null)
|
||||
{
|
||||
while(_loc5_._timeline)
|
||||
{
|
||||
if(_loc5_._timeline._time !== (_loc5_._startTime + _loc5_._totalTime) / _loc5_._timeScale)
|
||||
{
|
||||
_loc5_.totalTime(_loc5_._totalTime,true);
|
||||
}
|
||||
_loc5_ = _loc5_._timeline;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_gc)
|
||||
{
|
||||
_enabled(true,false);
|
||||
}
|
||||
if(_totalTime != param1 || _duration === 0)
|
||||
{
|
||||
render(param1,param2,false);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public function progress(param1:Number = NaN, param2:Boolean = false) : *
|
||||
{
|
||||
return !arguments.length ? _time / duration() : totalTime(duration() * param1,param2);
|
||||
}
|
||||
|
||||
public function totalProgress(param1:Number = NaN, param2:Boolean = false) : *
|
||||
{
|
||||
return !arguments.length ? _time / duration() : totalTime(duration() * param1,param2);
|
||||
}
|
||||
|
||||
public function startTime(param1:Number = NaN) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _startTime;
|
||||
}
|
||||
if(param1 != _startTime)
|
||||
{
|
||||
_startTime = param1;
|
||||
if(timeline)
|
||||
{
|
||||
if(timeline._sortChildren)
|
||||
{
|
||||
timeline.add(this,param1 - _delay);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public function timeScale(param1:Number = NaN) : *
|
||||
{
|
||||
var _loc3_:Number = NaN;
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _timeScale;
|
||||
}
|
||||
param1 ||= 0.000001;
|
||||
if(_timeline && _timeline.smoothChildTiming)
|
||||
{
|
||||
_loc3_ = _pauseTime || _pauseTime == 0 ? _pauseTime : _timeline._totalTime;
|
||||
_startTime = _loc3_ - (_loc3_ - _startTime) * _timeScale / param1;
|
||||
}
|
||||
_timeScale = param1;
|
||||
return _uncache(false);
|
||||
}
|
||||
|
||||
public function reversed(param1:Boolean = false) : *
|
||||
{
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _reversed;
|
||||
}
|
||||
if(param1 != _reversed)
|
||||
{
|
||||
_reversed = param1;
|
||||
totalTime(_timeline && !_timeline.smoothChildTiming ? totalDuration() - _totalTime : _totalTime,true);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public function paused(param1:Boolean = false) : *
|
||||
{
|
||||
var _loc4_:Number = NaN;
|
||||
if(!arguments.length)
|
||||
{
|
||||
return _paused;
|
||||
}
|
||||
if(param1 != _paused)
|
||||
{
|
||||
if(_timeline)
|
||||
{
|
||||
_loc4_ = _timeline.rawTime();
|
||||
var _loc3_:Number = _loc4_ - _pauseTime;
|
||||
if(!param1 && _timeline.smoothChildTiming)
|
||||
{
|
||||
_startTime += _loc3_;
|
||||
_uncache(false);
|
||||
}
|
||||
_pauseTime = param1 ? _loc4_ : NaN;
|
||||
_paused = param1;
|
||||
_active = !param1 && _totalTime > 0 && _totalTime < _totalDuration;
|
||||
if(!param1 && _loc3_ != 0 && _initted && duration() !== 0)
|
||||
{
|
||||
render(_timeline.smoothChildTiming ? _totalTime : (_loc4_ - _startTime) / _timeScale,true,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_gc && !param1)
|
||||
{
|
||||
_enabled(true,false);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.greensock.core
|
||||
{
|
||||
public final class PropTween
|
||||
{
|
||||
|
||||
public var t:Object;
|
||||
|
||||
public var p:String;
|
||||
|
||||
public var s:Number;
|
||||
|
||||
public var c:Number;
|
||||
|
||||
public var f:Boolean;
|
||||
|
||||
public var pr:int;
|
||||
|
||||
public var pg:Boolean;
|
||||
|
||||
public var n:String;
|
||||
|
||||
public var r:Boolean;
|
||||
|
||||
public var _next:PropTween;
|
||||
|
||||
public var _prev:PropTween;
|
||||
|
||||
public function PropTween(param1:Object, param2:String, param3:Number, param4:Number, param5:String, param6:Boolean, param7:PropTween = null, param8:int = 0)
|
||||
{
|
||||
super();
|
||||
this.t = param1;
|
||||
this.p = param2;
|
||||
this.s = param3;
|
||||
this.c = param4;
|
||||
this.n = param5;
|
||||
this.f = param1[param2] is Function;
|
||||
this.pg = param6;
|
||||
if(param7)
|
||||
{
|
||||
param7._prev = this;
|
||||
this._next = param7;
|
||||
}
|
||||
this.pr = param8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.greensock.core
|
||||
{
|
||||
public class SimpleTimeline extends Animation
|
||||
{
|
||||
|
||||
public var autoRemoveChildren:Boolean;
|
||||
|
||||
public var smoothChildTiming:Boolean;
|
||||
|
||||
public var _sortChildren:Boolean;
|
||||
|
||||
public var _first:Animation;
|
||||
|
||||
public var _last:Animation;
|
||||
|
||||
public function SimpleTimeline(param1:Object = null)
|
||||
{
|
||||
super(0,param1);
|
||||
this.autoRemoveChildren = this.smoothChildTiming = true;
|
||||
}
|
||||
|
||||
public function insert(param1:*, param2:* = 0) : *
|
||||
{
|
||||
return add(param1,param2 || 0);
|
||||
}
|
||||
|
||||
public function add(param1:*, param2:* = "+=0", param3:String = "normal", param4:Number = 0) : *
|
||||
{
|
||||
var _loc5_:Number = NaN;
|
||||
param1._startTime = (Number(param2 || 0)) + param1._delay;
|
||||
if(param1._paused)
|
||||
{
|
||||
if(this != param1._timeline)
|
||||
{
|
||||
param1._pauseTime = param1._startTime + (rawTime() - param1._startTime) / param1._timeScale;
|
||||
}
|
||||
}
|
||||
if(param1.timeline)
|
||||
{
|
||||
param1.timeline._remove(param1,true);
|
||||
}
|
||||
param1.timeline = param1._timeline = this;
|
||||
if(param1._gc)
|
||||
{
|
||||
param1._enabled(true,true);
|
||||
}
|
||||
var _loc6_:Animation = _last;
|
||||
if(_sortChildren)
|
||||
{
|
||||
_loc5_ = Number(param1._startTime);
|
||||
while(_loc6_ && _loc6_._startTime > _loc5_)
|
||||
{
|
||||
_loc6_ = _loc6_._prev;
|
||||
}
|
||||
}
|
||||
if(_loc6_)
|
||||
{
|
||||
param1._next = _loc6_._next;
|
||||
_loc6_._next = Animation(param1);
|
||||
}
|
||||
else
|
||||
{
|
||||
param1._next = _first;
|
||||
_first = Animation(param1);
|
||||
}
|
||||
if(param1._next)
|
||||
{
|
||||
param1._next._prev = param1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_last = Animation(param1);
|
||||
}
|
||||
param1._prev = _loc6_;
|
||||
if(_timeline)
|
||||
{
|
||||
_uncache(true);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public function _remove(param1:Animation, param2:Boolean = false) : *
|
||||
{
|
||||
if(param1.timeline == this)
|
||||
{
|
||||
if(!param2)
|
||||
{
|
||||
param1._enabled(false,true);
|
||||
}
|
||||
if(param1._prev)
|
||||
{
|
||||
param1._prev._next = param1._next;
|
||||
}
|
||||
else if(_first === param1)
|
||||
{
|
||||
_first = param1._next;
|
||||
}
|
||||
if(param1._next)
|
||||
{
|
||||
param1._next._prev = param1._prev;
|
||||
}
|
||||
else if(_last === param1)
|
||||
{
|
||||
_last = param1._prev;
|
||||
}
|
||||
param1._next = param1._prev = param1.timeline = null;
|
||||
if(_timeline)
|
||||
{
|
||||
_uncache(true);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
override public function render(param1:Number, param2:Boolean = false, param3:Boolean = false) : void
|
||||
{
|
||||
var _loc5_:Animation = null;
|
||||
var _loc4_:Animation = _first;
|
||||
_totalTime = _time = _rawPrevTime = param1;
|
||||
while(_loc4_)
|
||||
{
|
||||
_loc5_ = _loc4_._next;
|
||||
if(_loc4_._active || param1 >= _loc4_._startTime && !_loc4_._paused)
|
||||
{
|
||||
if(!_loc4_._reversed)
|
||||
{
|
||||
_loc4_.render((param1 - _loc4_._startTime) * _loc4_._timeScale,param2,param3);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc4_.render((!_loc4_._dirty ? _loc4_._totalDuration : _loc4_.totalDuration()) - (param1 - _loc4_._startTime) * _loc4_._timeScale,param2,param3);
|
||||
}
|
||||
}
|
||||
_loc4_ = _loc5_;
|
||||
}
|
||||
}
|
||||
|
||||
public function rawTime() : Number
|
||||
{
|
||||
return _totalTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class Back
|
||||
{
|
||||
|
||||
public static var easeOut:BackOut = new BackOut();
|
||||
|
||||
public static var easeIn:BackIn = new BackIn();
|
||||
|
||||
public static var easeInOut:BackInOut = new BackInOut();
|
||||
|
||||
public function Back()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class BackIn extends Ease
|
||||
{
|
||||
|
||||
public static var ease:BackIn = new BackIn();
|
||||
|
||||
public function BackIn(param1:Number = 1.70158)
|
||||
{
|
||||
super();
|
||||
_p1 = param1;
|
||||
}
|
||||
|
||||
override public function getRatio(param1:Number) : Number
|
||||
{
|
||||
return param1 * param1 * ((_p1 + 1) * param1 - _p1);
|
||||
}
|
||||
|
||||
public function config(param1:Number = 1.70158) : BackIn
|
||||
{
|
||||
return new BackIn(param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class BackInOut extends Ease
|
||||
{
|
||||
|
||||
public static var ease:BackInOut = new BackInOut();
|
||||
|
||||
public function BackInOut(param1:Number = 1.70158)
|
||||
{
|
||||
super();
|
||||
_p1 = param1;
|
||||
_p2 = _p1 * 1.525;
|
||||
}
|
||||
|
||||
override public function getRatio(param1:Number) : Number
|
||||
{
|
||||
param1 *= 2;
|
||||
return param1 < 1 ? 0.5 * param1 * param1 * ((_p2 + 1) * param1 - _p2) : 0.5 * ((param1 -= 2) * param1 * ((_p2 + 1) * param1 + _p2) + 2);
|
||||
}
|
||||
|
||||
public function config(param1:Number = 1.70158) : BackInOut
|
||||
{
|
||||
return new BackInOut(param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class BackOut extends Ease
|
||||
{
|
||||
|
||||
public static var ease:BackOut = new BackOut();
|
||||
|
||||
public function BackOut(param1:Number = 1.70158)
|
||||
{
|
||||
super();
|
||||
_p1 = param1;
|
||||
}
|
||||
|
||||
override public function getRatio(param1:Number) : Number
|
||||
{
|
||||
param1 -= 1;
|
||||
return param1 * param1 * ((_p1 + 1) * param1 + _p1) + 1;
|
||||
}
|
||||
|
||||
public function config(param1:Number = 1.70158) : BackOut
|
||||
{
|
||||
return new BackOut(param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class Circ
|
||||
{
|
||||
|
||||
public static var easeOut:CircOut = new CircOut();
|
||||
|
||||
public static var easeIn:CircIn = new CircIn();
|
||||
|
||||
public static var easeInOut:CircInOut = new CircInOut();
|
||||
|
||||
public function Circ()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class CircIn extends Ease
|
||||
{
|
||||
|
||||
public static var ease:CircIn = new CircIn();
|
||||
|
||||
public function CircIn()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function getRatio(param1:Number) : Number
|
||||
{
|
||||
return -(Math.sqrt(1 - param1 * param1) - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class CircInOut extends Ease
|
||||
{
|
||||
|
||||
public static var ease:CircInOut = new CircInOut();
|
||||
|
||||
public function CircInOut()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function getRatio(param1:Number) : Number
|
||||
{
|
||||
param1 *= 2;
|
||||
return param1 < 1 ? -0.5 * (Math.sqrt(1 - param1 * param1) - 1) : 0.5 * (Math.sqrt(1 - (param1 -= 2) * param1) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class CircOut extends Ease
|
||||
{
|
||||
|
||||
public static var ease:CircOut = new CircOut();
|
||||
|
||||
public function CircOut()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function getRatio(param1:Number) : Number
|
||||
{
|
||||
return Math.sqrt(1 - (param1 -= 1) * param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public class Ease
|
||||
{
|
||||
|
||||
protected static var _baseParams:Array = [0,0,1,1];
|
||||
|
||||
protected var _func:Function;
|
||||
|
||||
protected var _params:Array;
|
||||
|
||||
protected var _p1:Number;
|
||||
|
||||
protected var _p2:Number;
|
||||
|
||||
protected var _p3:Number;
|
||||
|
||||
public var _type:int;
|
||||
|
||||
public var _power:int;
|
||||
|
||||
public var _calcEnd:Boolean;
|
||||
|
||||
public function Ease(param1:Function = null, param2:Array = null, param3:Number = 0, param4:Number = 0)
|
||||
{
|
||||
super();
|
||||
_func = param1;
|
||||
_params = param2 ? _baseParams.concat(param2) : _baseParams;
|
||||
_type = param3;
|
||||
_power = param4;
|
||||
}
|
||||
|
||||
public function getRatio(param1:Number) : Number
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
if(_func != null)
|
||||
{
|
||||
_params[0] = param1;
|
||||
return _func.apply(null,_params);
|
||||
}
|
||||
_loc2_ = _type == 1 ? 1 - param1 : (_type == 2 ? param1 : (param1 < 0.5 ? param1 * 2 : (1 - param1) * 2));
|
||||
if(_power == 1)
|
||||
{
|
||||
_loc2_ *= _loc2_;
|
||||
}
|
||||
else if(_power == 2)
|
||||
{
|
||||
_loc2_ *= _loc2_ * _loc2_;
|
||||
}
|
||||
else if(_power == 3)
|
||||
{
|
||||
_loc2_ *= _loc2_ * _loc2_ * _loc2_;
|
||||
}
|
||||
else if(_power == 4)
|
||||
{
|
||||
_loc2_ *= _loc2_ * _loc2_ * _loc2_ * _loc2_;
|
||||
}
|
||||
return _type == 1 ? 1 - _loc2_ : (_type == 2 ? _loc2_ : (param1 < 0.5 ? _loc2_ / 2 : 1 - _loc2_ / 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class Expo
|
||||
{
|
||||
|
||||
public static var easeOut:ExpoOut = new ExpoOut();
|
||||
|
||||
public static var easeIn:ExpoIn = new ExpoIn();
|
||||
|
||||
public static var easeInOut:ExpoInOut = new ExpoInOut();
|
||||
|
||||
public function Expo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class ExpoIn extends Ease
|
||||
{
|
||||
|
||||
public static var ease:ExpoIn = new ExpoIn();
|
||||
|
||||
public function ExpoIn()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function getRatio(param1:Number) : Number
|
||||
{
|
||||
return Math.pow(2,10 * (param1 - 1)) - 0.001;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class ExpoInOut extends Ease
|
||||
{
|
||||
|
||||
public static var ease:ExpoInOut = new ExpoInOut();
|
||||
|
||||
public function ExpoInOut()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function getRatio(param1:Number) : Number
|
||||
{
|
||||
param1 *= 2;
|
||||
return param1 < 1 ? 0.5 * Math.pow(2,10 * (param1 - 1)) : 0.5 * (2 - Math.pow(2,-10 * (param1 - 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class ExpoOut extends Ease
|
||||
{
|
||||
|
||||
public static var ease:ExpoOut = new ExpoOut();
|
||||
|
||||
public function ExpoOut()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function getRatio(param1:Number) : Number
|
||||
{
|
||||
return 1 - Math.pow(2,-10 * param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public final class Quad
|
||||
{
|
||||
|
||||
public static var easeOut:Ease = new Ease(null,null,1,1);
|
||||
|
||||
public static var easeIn:Ease = new Ease(null,null,2,1);
|
||||
|
||||
public static var easeInOut:Ease = new Ease(null,null,3,1);
|
||||
|
||||
public function Quad()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.greensock.easing
|
||||
{
|
||||
public class SlowMo extends Ease
|
||||
{
|
||||
|
||||
public static var ease:SlowMo = new SlowMo();
|
||||
|
||||
private var _p:Number;
|
||||
|
||||
public function SlowMo(param1:Number = 0.7, param2:Number = 0.7, param3:Boolean = false)
|
||||
{
|
||||
super();
|
||||
if(param1 > 1)
|
||||
{
|
||||
param1 = 1;
|
||||
}
|
||||
_p = param1 != 1 ? param2 : 0;
|
||||
_p1 = (1 - param1) / 2;
|
||||
_p2 = param1;
|
||||
_p3 = _p1 + _p2;
|
||||
_calcEnd = param3;
|
||||
}
|
||||
|
||||
override public function getRatio(param1:Number) : Number
|
||||
{
|
||||
var _loc2_:Number = param1 + (0.5 - param1) * _p;
|
||||
if(param1 < _p1)
|
||||
{
|
||||
return _calcEnd ? 1 - (param1 = 1 - param1 / _p1) * param1 : _loc2_ - (param1 = 1 - param1 / _p1) * param1 * param1 * param1 * _loc2_;
|
||||
}
|
||||
if(param1 > _p3)
|
||||
{
|
||||
return _calcEnd ? 1 - (param1 = (param1 - _p3) / _p1) * param1 : _loc2_ + (param1 - _loc2_) * (param1 = (param1 - _p3) / _p1) * param1 * param1 * param1;
|
||||
}
|
||||
return _calcEnd ? 1 : _loc2_;
|
||||
}
|
||||
|
||||
public function config(param1:Number = 0.7, param2:Number = 0.7, param3:Boolean = false) : SlowMo
|
||||
{
|
||||
return new SlowMo(param1,param2,param3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.greensock.events
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class TweenEvent extends Event
|
||||
{
|
||||
|
||||
public static const VERSION:Number = 12;
|
||||
|
||||
public static const START:String = "start";
|
||||
|
||||
public static const UPDATE:String = "change";
|
||||
|
||||
public static const COMPLETE:String = "complete";
|
||||
|
||||
public static const REVERSE_COMPLETE:String = "reverseComplete";
|
||||
|
||||
public static const REPEAT:String = "repeat";
|
||||
|
||||
public function TweenEvent(param1:String, param2:Boolean = false, param3:Boolean = false)
|
||||
{
|
||||
super(param1,param2,param3);
|
||||
}
|
||||
|
||||
override public function clone() : Event
|
||||
{
|
||||
return new TweenEvent(this.type,this.bubbles,this.cancelable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class AutoAlphaPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _target:Object;
|
||||
|
||||
protected var _ignoreVisible:Boolean;
|
||||
|
||||
public function AutoAlphaPlugin()
|
||||
{
|
||||
super("autoAlpha,alpha,visible");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
_target = param1;
|
||||
_addTween(param1,"alpha",param1.alpha,param2,"alpha");
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function _kill(param1:Object) : Boolean
|
||||
{
|
||||
_ignoreVisible = "visible" in param1;
|
||||
return super._kill(param1);
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
super.setRatio(param1);
|
||||
if(!_ignoreVisible)
|
||||
{
|
||||
_target.visible = _target.alpha != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.BevelFilter;
|
||||
|
||||
public class BevelFilterPlugin extends FilterPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
private static var _propNames:Array = ["distance","angle","highlightColor","highlightAlpha","shadowColor","shadowAlpha","blurX","blurY","strength","quality"];
|
||||
|
||||
public function BevelFilterPlugin()
|
||||
{
|
||||
super("bevelFilter");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
return _initFilter(param1,param2,param3,BevelFilter,new BevelFilter(0,0,16777215,0.5,0,0.5,2,2,0,param2.quality || 2),_propNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,790 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.geom.Point;
|
||||
|
||||
public class BezierPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected static const _RAD2DEG:Number = 57.29577951308232;
|
||||
|
||||
protected static var _r1:Array = [];
|
||||
|
||||
protected static var _r2:Array = [];
|
||||
|
||||
protected static var _r3:Array = [];
|
||||
|
||||
protected static var _corProps:Object = {};
|
||||
|
||||
protected var _target:Object;
|
||||
|
||||
protected var _autoRotate:Array;
|
||||
|
||||
protected var _round:Object;
|
||||
|
||||
protected var _lengths:Array;
|
||||
|
||||
protected var _segments:Array;
|
||||
|
||||
protected var _length:Number;
|
||||
|
||||
protected var _func:Object;
|
||||
|
||||
protected var _props:Array;
|
||||
|
||||
protected var _l1:Number;
|
||||
|
||||
protected var _l2:Number;
|
||||
|
||||
protected var _li:Number;
|
||||
|
||||
protected var _curSeg:Array;
|
||||
|
||||
protected var _s1:Number;
|
||||
|
||||
protected var _s2:Number;
|
||||
|
||||
protected var _si:Number;
|
||||
|
||||
protected var _beziers:Object;
|
||||
|
||||
protected var _segCount:int;
|
||||
|
||||
protected var _prec:Number;
|
||||
|
||||
protected var _timeRes:int;
|
||||
|
||||
protected var _initialRotations:Array;
|
||||
|
||||
protected var _startRatio:int;
|
||||
|
||||
public function BezierPlugin()
|
||||
{
|
||||
super("bezier");
|
||||
this._overwriteProps.pop();
|
||||
this._func = {};
|
||||
this._round = {};
|
||||
}
|
||||
|
||||
public static function bezierThrough(param1:Array, param2:Number = 1, param3:Boolean = false, param4:Boolean = false, param5:String = "x,y,z", param6:Object = null) : Object
|
||||
{
|
||||
var _loc17_:Array = null;
|
||||
var _loc11_:int = 0;
|
||||
var _loc14_:String = null;
|
||||
var _loc10_:int = 0;
|
||||
var _loc8_:Array = null;
|
||||
var _loc9_:int = 0;
|
||||
var _loc13_:Number = NaN;
|
||||
var _loc12_:Boolean = false;
|
||||
var _loc7_:Object = null;
|
||||
var _loc15_:Object = {};
|
||||
var _loc16_:Object = param6 || param1[0];
|
||||
param5 = "," + param5 + ",";
|
||||
if(_loc16_ is Point)
|
||||
{
|
||||
_loc17_ = ["x","y"];
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc17_ = [];
|
||||
for(_loc14_ in _loc16_)
|
||||
{
|
||||
_loc17_.push(_loc14_);
|
||||
}
|
||||
}
|
||||
if(param1.length > 1)
|
||||
{
|
||||
_loc7_ = param1[param1.length - 1];
|
||||
_loc12_ = true;
|
||||
_loc11_ = int(_loc17_.length);
|
||||
while(--_loc11_ > -1)
|
||||
{
|
||||
_loc14_ = _loc17_[_loc11_];
|
||||
if(Math.abs(_loc16_[_loc14_] - _loc7_[_loc14_]) > 0.05)
|
||||
{
|
||||
_loc12_ = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc12_)
|
||||
{
|
||||
param1 = param1.concat();
|
||||
if(param6)
|
||||
{
|
||||
param1.unshift(param6);
|
||||
}
|
||||
param1.push(param1[1]);
|
||||
param6 = param1[param1.length - 3];
|
||||
}
|
||||
}
|
||||
_r1.length = _r2.length = _r3.length = 0;
|
||||
_loc11_ = int(_loc17_.length);
|
||||
while(--_loc11_ > -1)
|
||||
{
|
||||
_loc14_ = _loc17_[_loc11_];
|
||||
_corProps[_loc14_] = param5.indexOf("," + _loc14_ + ",") !== -1;
|
||||
_loc15_[_loc14_] = _parseAnchors(param1,_loc14_,_corProps[_loc14_],param6);
|
||||
}
|
||||
_loc11_ = int(_r1.length);
|
||||
while(--_loc11_ > -1)
|
||||
{
|
||||
_r1[_loc11_] = Math.sqrt(_r1[_loc11_]);
|
||||
_r2[_loc11_] = Math.sqrt(_r2[_loc11_]);
|
||||
}
|
||||
if(!param4)
|
||||
{
|
||||
_loc11_ = int(_loc17_.length);
|
||||
while(--_loc11_ > -1)
|
||||
{
|
||||
if(_corProps[_loc14_])
|
||||
{
|
||||
_loc8_ = _loc15_[_loc17_[_loc11_]];
|
||||
_loc9_ = _loc8_.length - 1;
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc9_)
|
||||
{
|
||||
_loc13_ = _loc8_[_loc10_ + 1].da / _r2[_loc10_] + _loc8_[_loc10_].da / _r1[_loc10_];
|
||||
_r3[_loc10_] = (_r3[_loc10_] || 0) + _loc13_ * _loc13_;
|
||||
_loc10_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc11_ = int(_r3.length);
|
||||
while(--_loc11_ > -1)
|
||||
{
|
||||
_r3[_loc11_] = Math.sqrt(_r3[_loc11_]);
|
||||
}
|
||||
}
|
||||
_loc11_ = int(_loc17_.length);
|
||||
_loc10_ = param3 ? 4 : 1;
|
||||
while(--_loc11_ > -1)
|
||||
{
|
||||
_loc14_ = _loc17_[_loc11_];
|
||||
_loc8_ = _loc15_[_loc14_];
|
||||
_calculateControlPoints(_loc8_,param2,param3,param4,_corProps[_loc14_]);
|
||||
if(_loc12_)
|
||||
{
|
||||
_loc8_.splice(0,_loc10_);
|
||||
_loc8_.splice(_loc8_.length - _loc10_,_loc10_);
|
||||
}
|
||||
}
|
||||
return _loc15_;
|
||||
}
|
||||
|
||||
public static function _parseBezierData(param1:Array, param2:String, param3:Object = null) : Object
|
||||
{
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc6_:Number = NaN;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc16_:Array = null;
|
||||
var _loc18_:Array = null;
|
||||
var _loc12_:int = 0;
|
||||
var _loc10_:int = 0;
|
||||
var _loc9_:int = 0;
|
||||
var _loc14_:String = null;
|
||||
var _loc5_:int = 0;
|
||||
var _loc15_:Object = null;
|
||||
param2 ||= "soft";
|
||||
var _loc17_:Object = {};
|
||||
var _loc13_:int = param2 === "cubic" ? 3 : 2;
|
||||
var _loc11_:Boolean = param2 === "soft";
|
||||
if(_loc11_ && param3)
|
||||
{
|
||||
param1 = [param3].concat(param1);
|
||||
}
|
||||
if(param1 == null || param1.length < _loc13_ + 1)
|
||||
{
|
||||
throw new Error("invalid Bezier data");
|
||||
}
|
||||
if(param1[1] is Point)
|
||||
{
|
||||
_loc18_ = ["x","y"];
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc18_ = [];
|
||||
for(_loc14_ in param1[0])
|
||||
{
|
||||
_loc18_.push(_loc14_);
|
||||
}
|
||||
}
|
||||
_loc12_ = int(_loc18_.length);
|
||||
while(--_loc12_ > -1)
|
||||
{
|
||||
_loc14_ = _loc18_[_loc12_];
|
||||
_loc17_[_loc14_] = _loc16_ = [];
|
||||
_loc5_ = 0;
|
||||
_loc9_ = int(param1.length);
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc9_)
|
||||
{
|
||||
_loc15_ = param1[_loc10_][_loc14_];
|
||||
_loc8_ = Number(param3 == null ? param1[_loc10_][_loc14_] : (typeof _loc15_ === "string" && _loc15_.charAt(1) === "=" ? param3[_loc14_] + (_loc15_.charAt(0) + _loc15_.substr(2)) : Number(_loc15_)));
|
||||
if(_loc11_)
|
||||
{
|
||||
if(_loc10_ > 1)
|
||||
{
|
||||
if(_loc10_ < _loc9_ - 1)
|
||||
{
|
||||
_loc16_[_loc5_++] = (_loc8_ + _loc16_[_loc5_ - 2]) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc16_[_loc5_++] = _loc8_;
|
||||
_loc10_++;
|
||||
}
|
||||
_loc9_ = _loc5_ - _loc13_ + 1;
|
||||
_loc5_ = 0;
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc9_)
|
||||
{
|
||||
_loc8_ = Number(_loc16_[_loc10_]);
|
||||
_loc6_ = Number(_loc16_[_loc10_ + 1]);
|
||||
_loc7_ = Number(_loc16_[_loc10_ + 2]);
|
||||
_loc4_ = Number(_loc13_ === 2 ? 0 : _loc16_[_loc10_ + 3]);
|
||||
_loc16_[_loc5_++] = _loc13_ === 3 ? new Segment(_loc8_,_loc6_,_loc7_,_loc4_) : new Segment(_loc8_,(2 * _loc6_ + _loc8_) / 3,(2 * _loc6_ + _loc7_) / 3,_loc7_);
|
||||
_loc10_ += _loc13_;
|
||||
}
|
||||
_loc16_.length = _loc5_;
|
||||
}
|
||||
return _loc17_;
|
||||
}
|
||||
|
||||
protected static function _parseAnchors(param1:Array, param2:String, param3:Boolean, param4:Object) : Array
|
||||
{
|
||||
var _loc10_:int = 0;
|
||||
var _loc11_:int = 0;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc6_:Number = NaN;
|
||||
var _loc5_:Number = NaN;
|
||||
var _loc9_:Object = null;
|
||||
var _loc8_:Array = [];
|
||||
if(param4)
|
||||
{
|
||||
param1 = [param4].concat(param1);
|
||||
_loc11_ = int(param1.length);
|
||||
while(--_loc11_ > -1)
|
||||
{
|
||||
_loc9_ = param1[_loc11_][param2];
|
||||
if(typeof _loc9_ === "string")
|
||||
{
|
||||
if(_loc9_.charAt(1) === "=")
|
||||
{
|
||||
param1[_loc11_][param2] = param4[param2] + (_loc9_.charAt(0) + _loc9_.substr(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc10_ = param1.length - 2;
|
||||
if(_loc10_ < 0)
|
||||
{
|
||||
_loc8_[0] = new Segment(param1[0][param2],0,0,param1[_loc10_ < -1 ? 0 : 1][param2]);
|
||||
return _loc8_;
|
||||
}
|
||||
_loc11_ = 0;
|
||||
while(_loc11_ < _loc10_)
|
||||
{
|
||||
_loc7_ = Number(param1[_loc11_][param2]);
|
||||
_loc6_ = Number(param1[_loc11_ + 1][param2]);
|
||||
_loc8_[_loc11_] = new Segment(_loc7_,0,0,_loc6_);
|
||||
if(param3)
|
||||
{
|
||||
_loc5_ = Number(param1[_loc11_ + 2][param2]);
|
||||
_r1[_loc11_] = (_r1[_loc11_] || 0) + (_loc6_ - _loc7_) * (_loc6_ - _loc7_);
|
||||
_r2[_loc11_] = (_r2[_loc11_] || 0) + (_loc5_ - _loc6_) * (_loc5_ - _loc6_);
|
||||
}
|
||||
_loc11_++;
|
||||
}
|
||||
_loc8_[_loc11_] = new Segment(param1[_loc11_][param2],0,0,param1[_loc11_ + 1][param2]);
|
||||
return _loc8_;
|
||||
}
|
||||
|
||||
protected static function _calculateControlPoints(param1:Array, param2:Number = 1, param3:Boolean = false, param4:Boolean = false, param5:Boolean = false) : void
|
||||
{
|
||||
var _loc18_:int = 0;
|
||||
var _loc10_:Number = NaN;
|
||||
var _loc9_:Number = NaN;
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc19_:Segment = null;
|
||||
var _loc12_:Number = NaN;
|
||||
var _loc14_:Number = NaN;
|
||||
var _loc6_:Number = NaN;
|
||||
var _loc11_:Number = NaN;
|
||||
var _loc17_:Array = null;
|
||||
var _loc20_:Number = NaN;
|
||||
var _loc21_:Number = NaN;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc16_:int = param1.length - 1;
|
||||
var _loc13_:int = 0;
|
||||
var _loc15_:Number = Number(param1[0].a);
|
||||
_loc18_ = 0;
|
||||
while(_loc18_ < _loc16_)
|
||||
{
|
||||
_loc19_ = param1[_loc13_];
|
||||
_loc10_ = _loc19_.a;
|
||||
_loc9_ = _loc19_.d;
|
||||
_loc8_ = Number(param1[_loc13_ + 1].d);
|
||||
if(param5)
|
||||
{
|
||||
_loc20_ = Number(_r1[_loc18_]);
|
||||
_loc21_ = Number(_r2[_loc18_]);
|
||||
_loc7_ = (_loc21_ + _loc20_) * param2 * 0.25 / (param4 ? 0.5 : _r3[_loc18_] || 0.5);
|
||||
_loc12_ = _loc9_ - (_loc9_ - _loc10_) * (param4 ? param2 * 0.5 : (_loc20_ !== 0 ? _loc7_ / _loc20_ : 0));
|
||||
_loc14_ = _loc9_ + (_loc8_ - _loc9_) * (param4 ? param2 * 0.5 : (_loc21_ !== 0 ? _loc7_ / _loc21_ : 0));
|
||||
_loc6_ = _loc9_ - (_loc12_ + ((_loc14_ - _loc12_) * (_loc20_ * 3 / (_loc20_ + _loc21_) + 0.5) / 4 || 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc12_ = _loc9_ - (_loc9_ - _loc10_) * param2 * 0.5;
|
||||
_loc14_ = _loc9_ + (_loc8_ - _loc9_) * param2 * 0.5;
|
||||
_loc6_ = _loc9_ - (_loc12_ + _loc14_) / 2;
|
||||
}
|
||||
_loc12_ += _loc6_;
|
||||
_loc14_ += _loc6_;
|
||||
_loc19_.c = _loc11_ = _loc12_;
|
||||
if(_loc18_ != 0)
|
||||
{
|
||||
_loc19_.b = _loc15_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc19_.b = _loc15_ = _loc19_.a + (_loc19_.c - _loc19_.a) * 0.6;
|
||||
}
|
||||
_loc19_.da = _loc9_ - _loc10_;
|
||||
_loc19_.ca = _loc11_ - _loc10_;
|
||||
_loc19_.ba = _loc15_ - _loc10_;
|
||||
if(param3)
|
||||
{
|
||||
_loc17_ = cubicToQuadratic(_loc10_,_loc15_,_loc11_,_loc9_);
|
||||
param1.splice(_loc13_,1,_loc17_[0],_loc17_[1],_loc17_[2],_loc17_[3]);
|
||||
_loc13_ += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc13_++;
|
||||
}
|
||||
_loc15_ = _loc14_;
|
||||
_loc18_++;
|
||||
}
|
||||
_loc19_ = param1[_loc13_];
|
||||
_loc19_.b = _loc15_;
|
||||
_loc19_.c = _loc15_ + (_loc19_.d - _loc15_) * 0.4;
|
||||
_loc19_.da = _loc19_.d - _loc19_.a;
|
||||
_loc19_.ca = _loc19_.c - _loc19_.a;
|
||||
_loc19_.ba = _loc15_ - _loc19_.a;
|
||||
if(param3)
|
||||
{
|
||||
_loc17_ = cubicToQuadratic(_loc19_.a,_loc15_,_loc19_.c,_loc19_.d);
|
||||
param1.splice(_loc13_,1,_loc17_[0],_loc17_[1],_loc17_[2],_loc17_[3]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function cubicToQuadratic(param1:Number, param2:Number, param3:Number, param4:Number) : Array
|
||||
{
|
||||
var _loc6_:Object = {"a":param1};
|
||||
var _loc5_:Object = {};
|
||||
var _loc10_:Object = {};
|
||||
var _loc7_:Object = {"c":param4};
|
||||
var _loc13_:Number = (param1 + param2) / 2;
|
||||
var _loc11_:Number = (param2 + param3) / 2;
|
||||
var _loc8_:Number = (param3 + param4) / 2;
|
||||
var _loc14_:Number = (_loc13_ + _loc11_) / 2;
|
||||
var _loc12_:Number = (_loc11_ + _loc8_) / 2;
|
||||
var _loc9_:Number = (_loc12_ - _loc14_) / 8;
|
||||
_loc6_.b = _loc13_ + (param1 - _loc13_) / 4;
|
||||
_loc5_.b = _loc14_ + _loc9_;
|
||||
_loc6_.c = _loc5_.a = (_loc6_.b + _loc5_.b) / 2;
|
||||
_loc5_.c = _loc10_.a = (_loc14_ + _loc12_) / 2;
|
||||
_loc10_.b = _loc12_ - _loc9_;
|
||||
_loc7_.b = _loc8_ + (param4 - _loc8_) / 4;
|
||||
_loc10_.c = _loc7_.a = (_loc10_.b + _loc7_.b) / 2;
|
||||
return [_loc6_,_loc5_,_loc10_,_loc7_];
|
||||
}
|
||||
|
||||
public static function quadraticToCubic(param1:Number, param2:Number, param3:Number) : Object
|
||||
{
|
||||
return new Segment(param1,(2 * param2 + param1) / 3,(2 * param2 + param3) / 3,param3);
|
||||
}
|
||||
|
||||
protected static function _parseLengthData(param1:Object, param2:uint = 6) : Object
|
||||
{
|
||||
var _loc13_:String = null;
|
||||
var _loc11_:int = 0;
|
||||
var _loc9_:int = 0;
|
||||
var _loc5_:Number = NaN;
|
||||
var _loc7_:Array = [];
|
||||
var _loc8_:Array = [];
|
||||
var _loc4_:Number = 0;
|
||||
var _loc3_:Number = 0;
|
||||
var _loc10_:int = param2 - 1;
|
||||
var _loc6_:Array = [];
|
||||
var _loc12_:Array = [];
|
||||
for(_loc13_ in param1)
|
||||
{
|
||||
_addCubicLengths(param1[_loc13_],_loc7_,param2);
|
||||
}
|
||||
_loc9_ = int(_loc7_.length);
|
||||
_loc11_ = 0;
|
||||
while(_loc11_ < _loc9_)
|
||||
{
|
||||
_loc4_ += Math.sqrt(_loc7_[_loc11_]);
|
||||
_loc5_ = _loc11_ % param2;
|
||||
_loc12_[_loc5_] = _loc4_;
|
||||
if(_loc5_ == _loc10_)
|
||||
{
|
||||
_loc3_ += _loc4_;
|
||||
_loc5_ = _loc11_ / param2 >> 0;
|
||||
_loc6_[_loc5_] = _loc12_;
|
||||
_loc8_[_loc5_] = _loc3_;
|
||||
_loc4_ = 0;
|
||||
_loc12_ = [];
|
||||
}
|
||||
_loc11_++;
|
||||
}
|
||||
return {
|
||||
"length":_loc3_,
|
||||
"lengths":_loc8_,
|
||||
"segments":_loc6_
|
||||
};
|
||||
}
|
||||
|
||||
private static function _addCubicLengths(param1:Array, param2:Array, param3:uint = 6) : void
|
||||
{
|
||||
var _loc5_:Number = NaN;
|
||||
var _loc12_:Number = NaN;
|
||||
var _loc14_:Number = NaN;
|
||||
var _loc6_:Number = NaN;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc15_:Number = NaN;
|
||||
var _loc10_:int = 0;
|
||||
var _loc16_:Number = NaN;
|
||||
var _loc11_:Segment = null;
|
||||
var _loc4_:int = 0;
|
||||
var _loc13_:Number = 1 / param3;
|
||||
var _loc9_:int = int(param1.length);
|
||||
while(--_loc9_ > -1)
|
||||
{
|
||||
_loc11_ = param1[_loc9_];
|
||||
_loc14_ = _loc11_.a;
|
||||
_loc6_ = _loc11_.d - _loc14_;
|
||||
_loc7_ = _loc11_.c - _loc14_;
|
||||
_loc8_ = _loc11_.b - _loc14_;
|
||||
_loc5_ = _loc12_ = 0;
|
||||
_loc10_ = 1;
|
||||
while(_loc10_ <= param3)
|
||||
{
|
||||
_loc15_ = _loc13_ * _loc10_;
|
||||
_loc16_ = 1 - _loc15_;
|
||||
_loc5_ = _loc12_ - (_loc12_ = (_loc15_ * _loc15_ * _loc6_ + 3 * _loc16_ * (_loc15_ * _loc7_ + _loc16_ * _loc8_)) * _loc15_);
|
||||
_loc4_ = _loc9_ * param3 + _loc10_ - 1;
|
||||
param2[_loc4_] = (param2[_loc4_] || 0) + _loc5_ * _loc5_;
|
||||
_loc10_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
var _loc14_:String = null;
|
||||
var _loc9_:Boolean = false;
|
||||
var _loc10_:int = 0;
|
||||
var _loc8_:int = 0;
|
||||
var _loc7_:Array = null;
|
||||
var _loc6_:Object = null;
|
||||
var _loc12_:Array = null;
|
||||
var _loc13_:Object = null;
|
||||
this._target = param1;
|
||||
var _loc11_:Object = param2 is Array ? {"values":param2} : param2;
|
||||
this._props = [];
|
||||
this._timeRes = _loc11_.timeResolution == null ? 6 : int(_loc11_.timeResolution);
|
||||
_loc12_ = _loc11_.values || [];
|
||||
var _loc15_:Object = {};
|
||||
var _loc4_:Object = _loc12_[0];
|
||||
var _loc5_:Object = _loc11_.autoRotate || param3.vars.orientToBezier;
|
||||
this._autoRotate = _loc5_ ? (_loc5_ is Array ? _loc5_ as Array : [["x","y","rotation",_loc5_ === true ? 0 : Number(_loc5_)]]) : null;
|
||||
if(_loc4_ is Point)
|
||||
{
|
||||
this._props = ["x","y"];
|
||||
}
|
||||
else
|
||||
{
|
||||
for(_loc14_ in _loc4_)
|
||||
{
|
||||
this._props.push(_loc14_);
|
||||
}
|
||||
}
|
||||
_loc10_ = int(this._props.length);
|
||||
while(--_loc10_ > -1)
|
||||
{
|
||||
_loc14_ = this._props[_loc10_];
|
||||
this._overwriteProps.push(_loc14_);
|
||||
_loc9_ = Boolean(this._func[_loc14_] = param1[_loc14_] is Function);
|
||||
var _temp_4:*;
|
||||
_loc15_[_loc14_] = !_loc9_ ? param1[_loc14_] : (_temp_4 = param1,param1[_loc14_.indexOf("set") || !("get" + _loc14_.substr(3) in param1) ? _loc14_ : "get" + _loc14_.substr(3)]());
|
||||
if(!_loc6_)
|
||||
{
|
||||
if(_loc15_[_loc14_] !== _loc12_[0][_loc14_])
|
||||
{
|
||||
_loc6_ = _loc15_;
|
||||
}
|
||||
}
|
||||
}
|
||||
this._beziers = _loc11_.type !== "cubic" && _loc11_.type !== "quadratic" && _loc11_.type !== "soft" ? bezierThrough(_loc12_,isNaN(_loc11_.curviness) ? 1 : _loc11_.curviness,false,_loc11_.type === "thruBasic",_loc11_.correlate || "x,y,z",_loc6_) : _parseBezierData(_loc12_,_loc11_.type,_loc15_);
|
||||
this._segCount = this._beziers[_loc14_].length;
|
||||
if(this._timeRes)
|
||||
{
|
||||
_loc13_ = _parseLengthData(this._beziers,this._timeRes);
|
||||
this._length = _loc13_.length;
|
||||
this._lengths = _loc13_.lengths;
|
||||
this._segments = _loc13_.segments;
|
||||
this._l1 = this._li = this._s1 = this._si = 0;
|
||||
this._l2 = this._lengths[0];
|
||||
this._curSeg = this._segments[0];
|
||||
this._s2 = this._curSeg[0];
|
||||
this._prec = 1 / this._curSeg.length;
|
||||
}
|
||||
if(_loc7_ == this._autoRotate)
|
||||
{
|
||||
this._initialRotations = [];
|
||||
if(!(_loc7_[0] is Array))
|
||||
{
|
||||
this._autoRotate = _loc7_ = [_loc7_];
|
||||
}
|
||||
_loc10_ = int(_loc7_.length);
|
||||
while(--_loc10_ > -1)
|
||||
{
|
||||
_loc8_ = 0;
|
||||
while(_loc8_ < 3)
|
||||
{
|
||||
_loc14_ = _loc7_[_loc10_][_loc8_];
|
||||
this._func[_loc14_] = param1[_loc14_] is Function ? param1[_loc14_.indexOf("set") || !("get" + _loc14_.substr(3) in param1) ? _loc14_ : "get" + _loc14_.substr(3)] : false;
|
||||
_loc8_++;
|
||||
}
|
||||
_loc14_ = _loc7_[_loc10_][2];
|
||||
this._initialRotations[_loc10_] = this._func[_loc14_] ? this._func[_loc14_]() : this._target[_loc14_];
|
||||
}
|
||||
}
|
||||
_startRatio = param3.vars.runBackwards ? 1 : 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function _kill(param1:Object) : Boolean
|
||||
{
|
||||
var _loc3_:String = null;
|
||||
var _loc4_:int = 0;
|
||||
var _loc2_:Array = this._props;
|
||||
for(_loc3_ in _beziers)
|
||||
{
|
||||
if(_loc3_ in param1)
|
||||
{
|
||||
delete _beziers[_loc3_];
|
||||
delete _func[_loc3_];
|
||||
_loc4_ = int(_loc2_.length);
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
if(_loc2_[_loc4_] === _loc3_)
|
||||
{
|
||||
_loc2_.splice(_loc4_,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super._kill(param1);
|
||||
}
|
||||
|
||||
override public function _roundProps(param1:Object, param2:Boolean = true) : void
|
||||
{
|
||||
var _loc3_:Array = null;
|
||||
_loc3_ = this._overwriteProps;
|
||||
var _loc4_:int = int(_loc3_.length);
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
if(_loc3_[_loc4_] in param1 || "bezier" in param1 || "bezierThrough" in param1)
|
||||
{
|
||||
this._round[_loc3_[_loc4_]] = param2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
var _loc3_:* = 0;
|
||||
var _loc20_:Number = NaN;
|
||||
var _loc16_:int = 0;
|
||||
var _loc18_:String = null;
|
||||
var _loc6_:Segment = null;
|
||||
var _loc17_:Number = NaN;
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc12_:int = 0;
|
||||
var _loc10_:Array = null;
|
||||
var _loc5_:Array = null;
|
||||
var _loc9_:Segment = null;
|
||||
var _loc15_:Number = NaN;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc14_:Number = NaN;
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc13_:Number = NaN;
|
||||
var _loc21_:Number = NaN;
|
||||
var _loc11_:Array = null;
|
||||
var _loc4_:int = this._segCount;
|
||||
var _loc22_:Object = this._func;
|
||||
var _loc19_:Object = this._target;
|
||||
var _loc23_:Boolean = param1 !== this._startRatio;
|
||||
if(this._timeRes == 0)
|
||||
{
|
||||
_loc3_ = int(param1 < 0 ? 0 : (param1 >= 1 ? _loc4_ - 1 : _loc4_ * param1 >> 0));
|
||||
_loc17_ = (param1 - _loc3_ * (1 / _loc4_)) * _loc4_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc10_ = this._lengths;
|
||||
_loc5_ = this._curSeg;
|
||||
param1 *= this._length;
|
||||
_loc16_ = this._li;
|
||||
if(param1 > this._l2 && _loc16_ < _loc4_ - 1)
|
||||
{
|
||||
_loc12_ = _loc4_ - 1;
|
||||
while(_loc16_ < _loc12_ && (this._l2 = _loc10_[++_loc16_]) <= param1)
|
||||
{
|
||||
}
|
||||
this._l1 = _loc10_[_loc16_ - 1];
|
||||
this._li = _loc16_;
|
||||
this._curSeg = _loc5_ = this._segments[_loc16_];
|
||||
this._s2 = _loc5_[this._s1 = this._si = 0];
|
||||
}
|
||||
else if(param1 < this._l1 && _loc16_ > 0)
|
||||
{
|
||||
while(_loc16_ > 0 && (this._l1 = _loc10_[--_loc16_]) >= param1)
|
||||
{
|
||||
}
|
||||
if(_loc16_ === 0 && param1 < this._l1)
|
||||
{
|
||||
this._l1 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc16_++;
|
||||
}
|
||||
this._l2 = _loc10_[_loc16_];
|
||||
this._li = _loc16_;
|
||||
this._curSeg = _loc5_ = this._segments[_loc16_];
|
||||
this._s1 = _loc5_[(this._si = _loc5_.length - 1) - 1] || 0;
|
||||
this._s2 = _loc5_[this._si];
|
||||
}
|
||||
_loc3_ = _loc16_;
|
||||
param1 -= this._l1;
|
||||
_loc16_ = this._si;
|
||||
if(param1 > this._s2 && _loc16_ < _loc5_.length - 1)
|
||||
{
|
||||
_loc12_ = _loc5_.length - 1;
|
||||
while(_loc16_ < _loc12_ && (this._s2 = _loc5_[++_loc16_]) <= param1)
|
||||
{
|
||||
}
|
||||
this._s1 = _loc5_[_loc16_ - 1];
|
||||
this._si = _loc16_;
|
||||
}
|
||||
else if(param1 < this._s1 && _loc16_ > 0)
|
||||
{
|
||||
while(_loc16_ > 0 && (this._s1 = _loc5_[--_loc16_]) >= param1)
|
||||
{
|
||||
}
|
||||
if(_loc16_ === 0 && param1 < this._s1)
|
||||
{
|
||||
this._s1 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc16_++;
|
||||
}
|
||||
this._s2 = _loc5_[_loc16_];
|
||||
this._si = _loc16_;
|
||||
}
|
||||
_loc17_ = (_loc16_ + (param1 - this._s1) / (this._s2 - this._s1)) * this._prec;
|
||||
}
|
||||
_loc20_ = 1 - _loc17_;
|
||||
_loc16_ = int(this._props.length);
|
||||
while(--_loc16_ > -1)
|
||||
{
|
||||
_loc18_ = this._props[_loc16_];
|
||||
_loc6_ = this._beziers[_loc18_][_loc3_];
|
||||
_loc2_ = (_loc17_ * _loc17_ * _loc6_.da + 3 * _loc20_ * (_loc17_ * _loc6_.ca + _loc20_ * _loc6_.ba)) * _loc17_ + _loc6_.a;
|
||||
if(this._round[_loc18_])
|
||||
{
|
||||
_loc2_ = _loc2_ + (_loc2_ > 0 ? 0.5 : -0.5) >> 0;
|
||||
}
|
||||
if(_loc22_[_loc18_])
|
||||
{
|
||||
_loc19_[_loc18_](_loc2_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc19_[_loc18_] = _loc2_;
|
||||
}
|
||||
}
|
||||
if(this._autoRotate != null)
|
||||
{
|
||||
_loc11_ = this._autoRotate;
|
||||
_loc16_ = int(_loc11_.length);
|
||||
while(--_loc16_ > -1)
|
||||
{
|
||||
_loc18_ = _loc11_[_loc16_][2];
|
||||
_loc13_ = Number(_loc11_[_loc16_][3] || 0);
|
||||
_loc21_ = _loc11_[_loc16_][4] == true ? 1 : 57.29577951308232;
|
||||
_loc6_ = this._beziers[_loc11_[_loc16_][0]][_loc3_];
|
||||
_loc9_ = this._beziers[_loc11_[_loc16_][1]][_loc3_];
|
||||
_loc15_ = _loc6_.a + (_loc6_.b - _loc6_.a) * _loc17_;
|
||||
_loc14_ = _loc6_.b + (_loc6_.c - _loc6_.b) * _loc17_;
|
||||
_loc15_ += (_loc14_ - _loc15_) * _loc17_;
|
||||
_loc14_ += (_loc6_.c + (_loc6_.d - _loc6_.c) * _loc17_ - _loc14_) * _loc17_;
|
||||
_loc7_ = _loc9_.a + (_loc9_.b - _loc9_.a) * _loc17_;
|
||||
_loc8_ = _loc9_.b + (_loc9_.c - _loc9_.b) * _loc17_;
|
||||
_loc7_ += (_loc8_ - _loc7_) * _loc17_;
|
||||
_loc8_ += (_loc9_.c + (_loc9_.d - _loc9_.c) * _loc17_ - _loc8_) * _loc17_;
|
||||
_loc2_ = Number(_loc23_ ? Math.atan2(_loc8_ - _loc7_,_loc14_ - _loc15_) * _loc21_ + _loc13_ : this._initialRotations[_loc16_]);
|
||||
if(_loc22_[_loc18_])
|
||||
{
|
||||
_loc19_[_loc18_](_loc2_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc19_[_loc18_] = _loc2_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Segment
|
||||
{
|
||||
|
||||
public var a:Number;
|
||||
|
||||
public var b:Number;
|
||||
|
||||
public var c:Number;
|
||||
|
||||
public var d:Number;
|
||||
|
||||
public var da:Number;
|
||||
|
||||
public var ca:Number;
|
||||
|
||||
public var ba:Number;
|
||||
|
||||
public function Segment(param1:Number, param2:Number, param3:Number, param4:Number)
|
||||
{
|
||||
super();
|
||||
this.a = param1;
|
||||
this.b = param2;
|
||||
this.c = param3;
|
||||
this.d = param4;
|
||||
this.da = param4 - param1;
|
||||
this.ca = param3 - param1;
|
||||
this.ba = param2 - param1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class BezierThroughPlugin extends BezierPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public function BezierThroughPlugin()
|
||||
{
|
||||
super();
|
||||
_propName = "bezierThrough";
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(param2 is Array)
|
||||
{
|
||||
param2 = {"values":param2};
|
||||
}
|
||||
param2.type = "thru";
|
||||
return super._onInitTween(param1,param2,param3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.BlurFilter;
|
||||
|
||||
public class BlurFilterPlugin extends FilterPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
private static var _propNames:Array = ["blurX","blurY","quality"];
|
||||
|
||||
public function BlurFilterPlugin()
|
||||
{
|
||||
super("blurFilter");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
return _initFilter(param1,param2,param3,BlurFilter,new BlurFilter(0,0,param2.quality || 2),_propNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.ColorMatrixFilter;
|
||||
|
||||
public class ColorMatrixFilterPlugin extends FilterPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected static var _lumR:Number = 0.212671;
|
||||
|
||||
protected static var _lumG:Number = 0.71516;
|
||||
|
||||
protected static var _lumB:Number = 0.072169;
|
||||
|
||||
private static var _propNames:Array = [];
|
||||
|
||||
protected static var _idMatrix:Array = [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];
|
||||
|
||||
protected var _matrix:Array;
|
||||
|
||||
protected var _matrixTween:EndArrayPlugin;
|
||||
|
||||
public function ColorMatrixFilterPlugin()
|
||||
{
|
||||
super("colorMatrixFilter");
|
||||
}
|
||||
|
||||
public static function colorize(param1:Array, param2:Number, param3:Number = 1) : Array
|
||||
{
|
||||
var _loc6_:Number = NaN;
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
if(isNaN(param3))
|
||||
{
|
||||
param3 = 1;
|
||||
}
|
||||
_loc6_ = (param2 >> 16 & 0xFF) / 255;
|
||||
var _loc4_:Number = (param2 >> 8 & 0xFF) / 255;
|
||||
var _loc5_:Number = (param2 & 0xFF) / 255;
|
||||
var _loc8_:Number = 1 - param3;
|
||||
var _loc7_:Array = [_loc8_ + param3 * _loc6_ * _lumR,param3 * _loc6_ * _lumG,param3 * _loc6_ * _lumB,0,0,param3 * _loc4_ * _lumR,_loc8_ + param3 * _loc4_ * _lumG,param3 * _loc4_ * _lumB,0,0,param3 * _loc5_ * _lumR,param3 * _loc5_ * _lumG,_loc8_ + param3 * _loc5_ * _lumB,0,0,0,0,0,1,0];
|
||||
return applyMatrix(_loc7_,param1);
|
||||
}
|
||||
|
||||
public static function setThreshold(param1:Array, param2:Number) : Array
|
||||
{
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
var _loc3_:Array = [_lumR * 256,_lumG * 256,_lumB * 256,0,-256 * param2,_lumR * 256,_lumG * 256,_lumB * 256,0,-256 * param2,_lumR * 256,_lumG * 256,_lumB * 256,0,-256 * param2,0,0,0,1,0];
|
||||
return applyMatrix(_loc3_,param1);
|
||||
}
|
||||
|
||||
public static function setHue(param1:Array, param2:Number) : Array
|
||||
{
|
||||
var _loc4_:Number = NaN;
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
param2 *= 3.141592653589793 / 180;
|
||||
_loc4_ = Math.cos(param2);
|
||||
var _loc3_:Number = Math.sin(param2);
|
||||
var _loc5_:Array = [_lumR + _loc4_ * (1 - _lumR) + _loc3_ * -_lumR,_lumG + _loc4_ * -_lumG + _loc3_ * -_lumG,_lumB + _loc4_ * -_lumB + _loc3_ * (1 - _lumB),0,0,_lumR + _loc4_ * -_lumR + _loc3_ * 0.143,_lumG + _loc4_ * (1 - _lumG) + _loc3_ * 0.14,_lumB + _loc4_ * -_lumB + _loc3_ * -0.283,0,0,_lumR + _loc4_ * -_lumR + _loc3_ * -(1 - _lumR),_lumG + _loc4_ * -_lumG + _loc3_ * _lumG,_lumB + _loc4_ * (1 - _lumB) + _loc3_ * _lumB,0,0,0,0,0,1,0,0,0,0,0,1];
|
||||
return applyMatrix(_loc5_,param1);
|
||||
}
|
||||
|
||||
public static function setBrightness(param1:Array, param2:Number) : Array
|
||||
{
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
param2 = param2 * 100 - 100;
|
||||
return applyMatrix([1,0,0,0,param2,0,1,0,0,param2,0,0,1,0,param2,0,0,0,1,0,0,0,0,0,1],param1);
|
||||
}
|
||||
|
||||
public static function setSaturation(param1:Array, param2:Number) : Array
|
||||
{
|
||||
var _loc7_:Number = NaN;
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
_loc7_ = 1 - param2;
|
||||
var _loc5_:Number = _loc7_ * _lumR;
|
||||
var _loc3_:Number = _loc7_ * _lumG;
|
||||
var _loc4_:Number = _loc7_ * _lumB;
|
||||
var _loc6_:Array = [_loc5_ + param2,_loc3_,_loc4_,0,0,_loc5_,_loc3_ + param2,_loc4_,0,0,_loc5_,_loc3_,_loc4_ + param2,0,0,0,0,0,1,0];
|
||||
return applyMatrix(_loc6_,param1);
|
||||
}
|
||||
|
||||
public static function setContrast(param1:Array, param2:Number) : Array
|
||||
{
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
param2 += 0.01;
|
||||
var _loc3_:Array = [param2,0,0,0,128 * (1 - param2),0,param2,0,0,128 * (1 - param2),0,0,param2,0,128 * (1 - param2),0,0,0,1,0];
|
||||
return applyMatrix(_loc3_,param1);
|
||||
}
|
||||
|
||||
public static function applyMatrix(param1:Array, param2:Array) : Array
|
||||
{
|
||||
var _loc5_:int = 0;
|
||||
var _loc6_:int = 0;
|
||||
if(!(param1 is Array) || !(param2 is Array))
|
||||
{
|
||||
return param2;
|
||||
}
|
||||
var _loc3_:Array = [];
|
||||
var _loc7_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < 4)
|
||||
{
|
||||
_loc6_ = 0;
|
||||
while(_loc6_ < 5)
|
||||
{
|
||||
_loc4_ = int(_loc6_ == 4 ? param1[_loc7_ + 4] : 0);
|
||||
_loc3_[_loc7_ + _loc6_] = param1[_loc7_] * param2[_loc6_] + param1[_loc7_ + 1] * param2[_loc6_ + 5] + param1[_loc7_ + 2] * param2[_loc6_ + 10] + param1[_loc7_ + 3] * param2[_loc6_ + 15] + _loc4_;
|
||||
_loc6_ += 1;
|
||||
}
|
||||
_loc7_ += 5;
|
||||
_loc5_ += 1;
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
var _loc4_:Object = param2;
|
||||
_initFilter(param1,{
|
||||
"remove":param2.remove,
|
||||
"index":param2.index,
|
||||
"addFilter":param2.addFilter
|
||||
},param3,ColorMatrixFilter,new ColorMatrixFilter(_idMatrix.slice()),_propNames);
|
||||
if(_filter == null)
|
||||
{
|
||||
trace("FILTER NULL! ");
|
||||
return true;
|
||||
}
|
||||
_matrix = ColorMatrixFilter(_filter).matrix;
|
||||
var _loc5_:Array = [];
|
||||
if(_loc4_.matrix != null && _loc4_.matrix is Array)
|
||||
{
|
||||
_loc5_ = _loc4_.matrix;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_loc4_.relative == true)
|
||||
{
|
||||
_loc5_ = _matrix.slice();
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_ = _idMatrix.slice();
|
||||
}
|
||||
_loc5_ = setBrightness(_loc5_,_loc4_.brightness);
|
||||
_loc5_ = setContrast(_loc5_,_loc4_.contrast);
|
||||
_loc5_ = setHue(_loc5_,_loc4_.hue);
|
||||
_loc5_ = setSaturation(_loc5_,_loc4_.saturation);
|
||||
_loc5_ = setThreshold(_loc5_,_loc4_.threshold);
|
||||
if(!isNaN(_loc4_.colorize))
|
||||
{
|
||||
_loc5_ = colorize(_loc5_,_loc4_.colorize,_loc4_.amount);
|
||||
}
|
||||
}
|
||||
_matrixTween = new EndArrayPlugin();
|
||||
_matrixTween._init(_matrix,_loc5_);
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
_matrixTween.setRatio(param1);
|
||||
ColorMatrixFilter(_filter).matrix = _matrix;
|
||||
super.setRatio(param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.geom.ColorTransform;
|
||||
|
||||
public class ColorTransformPlugin extends TintPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public function ColorTransformPlugin()
|
||||
{
|
||||
super();
|
||||
_propName = "colorTransform";
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
var _loc5_:ColorTransform = null;
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc7_:ColorTransform = new ColorTransform();
|
||||
if(param1 is DisplayObject)
|
||||
{
|
||||
_transform = DisplayObject(param1).transform;
|
||||
_loc5_ = _transform.colorTransform;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!(param1 is ColorTransform))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_loc5_ = param1 as ColorTransform;
|
||||
}
|
||||
if(param2 is ColorTransform)
|
||||
{
|
||||
_loc7_.concat(param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc7_.concat(_loc5_);
|
||||
}
|
||||
for(var _loc6_:String in param2)
|
||||
{
|
||||
if(_loc6_ == "tint" || _loc6_ == "color")
|
||||
{
|
||||
if(param2[_loc6_] != null)
|
||||
{
|
||||
_loc7_.color = int(param2[_loc6_]);
|
||||
}
|
||||
}
|
||||
else if(!(_loc6_ == "tintAmount" || _loc6_ == "exposure" || _loc6_ == "brightness"))
|
||||
{
|
||||
_loc7_[_loc6_] = param2[_loc6_];
|
||||
}
|
||||
}
|
||||
if(!(param2 is ColorTransform))
|
||||
{
|
||||
if(!isNaN(param2.tintAmount))
|
||||
{
|
||||
_loc4_ = param2.tintAmount / (1 - (_loc7_.redMultiplier + _loc7_.greenMultiplier + _loc7_.blueMultiplier) / 3);
|
||||
_loc7_.redOffset *= _loc4_;
|
||||
_loc7_.greenOffset *= _loc4_;
|
||||
_loc7_.blueOffset *= _loc4_;
|
||||
_loc7_.redMultiplier = _loc7_.greenMultiplier = _loc7_.blueMultiplier = 1 - param2.tintAmount;
|
||||
}
|
||||
else if(!isNaN(param2.exposure))
|
||||
{
|
||||
_loc7_.redOffset = _loc7_.greenOffset = _loc7_.blueOffset = 255 * (param2.exposure - 1);
|
||||
_loc7_.redMultiplier = _loc7_.greenMultiplier = _loc7_.blueMultiplier = 1;
|
||||
}
|
||||
else if(!isNaN(param2.brightness))
|
||||
{
|
||||
_loc7_.redOffset = _loc7_.greenOffset = _loc7_.blueOffset = Math.max(0,(param2.brightness - 1) * 255);
|
||||
_loc7_.redMultiplier = _loc7_.greenMultiplier = _loc7_.blueMultiplier = 1 - Math.abs(param2.brightness - 1);
|
||||
}
|
||||
}
|
||||
_init(_loc5_,_loc7_);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.DropShadowFilter;
|
||||
|
||||
public class DropShadowFilterPlugin extends FilterPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
private static var _propNames:Array = ["distance","angle","color","alpha","blurX","blurY","strength","quality","inner","knockout","hideObject"];
|
||||
|
||||
public function DropShadowFilterPlugin()
|
||||
{
|
||||
super("dropShadowFilter");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
return _initFilter(param1,param2,param3,DropShadowFilter,new DropShadowFilter(0,45,0,0,0,0,1,param2.quality || 2,param2.inner,param2.knockout,param2.hideObject),_propNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class EndArrayPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _a:Array;
|
||||
|
||||
protected var _round:Boolean;
|
||||
|
||||
protected var _info:Array = [];
|
||||
|
||||
public function EndArrayPlugin()
|
||||
{
|
||||
super("endArray");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(!(param1 is Array) || !(param2 is Array))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_init(param1 as Array,param2);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _init(param1:Array, param2:Array) : void
|
||||
{
|
||||
_a = param1;
|
||||
var _loc4_:int = int(param2.length);
|
||||
var _loc3_:int = 0;
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
if(param1[_loc4_] != param2[_loc4_] && param1[_loc4_] != null)
|
||||
{
|
||||
_info[_loc3_++] = new ArrayTweenInfo(_loc4_,_a[_loc4_],param2[_loc4_] - _a[_loc4_]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function _roundProps(param1:Object, param2:Boolean = true) : void
|
||||
{
|
||||
if("endArray" in param1)
|
||||
{
|
||||
_round = param2;
|
||||
}
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
var _loc3_:ArrayTweenInfo = null;
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc4_:int = int(_info.length);
|
||||
if(_round)
|
||||
{
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
_loc3_ = _info[_loc4_];
|
||||
_a[_loc3_.i] = (_loc2_ = _loc3_.c * param1 + _loc3_.s) > 0 ? _loc2_ + 0.5 >> 0 : _loc2_ - 0.5 >> 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
_loc3_ = _info[_loc4_];
|
||||
_a[_loc3_.i] = _loc3_.c * param1 + _loc3_.s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ArrayTweenInfo
|
||||
{
|
||||
|
||||
public var i:uint;
|
||||
|
||||
public var s:Number;
|
||||
|
||||
public var c:Number;
|
||||
|
||||
public function ArrayTweenInfo(param1:uint, param2:Number, param3:Number)
|
||||
{
|
||||
super();
|
||||
this.i = param1;
|
||||
this.s = param2;
|
||||
this.c = param3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.BitmapFilter;
|
||||
import flash.filters.BlurFilter;
|
||||
|
||||
public class FilterPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _target:Object;
|
||||
|
||||
protected var _type:Class;
|
||||
|
||||
protected var _filter:BitmapFilter;
|
||||
|
||||
protected var _index:int;
|
||||
|
||||
protected var _remove:Boolean;
|
||||
|
||||
private var _tween:TweenLite;
|
||||
|
||||
public function FilterPlugin(param1:String = "", param2:Number = 0)
|
||||
{
|
||||
super(param1,param2);
|
||||
}
|
||||
|
||||
protected function _initFilter(param1:*, param2:Object, param3:TweenLite, param4:Class, param5:BitmapFilter, param6:Array) : Boolean
|
||||
{
|
||||
var _loc8_:String = null;
|
||||
var _loc11_:int = 0;
|
||||
var _loc7_:HexColorsPlugin = null;
|
||||
_target = param1;
|
||||
_tween = param3;
|
||||
_type = param4;
|
||||
var _loc9_:Array = _target.filters;
|
||||
var _loc10_:Object = param2 is BitmapFilter ? {} : param2;
|
||||
if(_loc10_.index != null)
|
||||
{
|
||||
_index = _loc10_.index;
|
||||
}
|
||||
else
|
||||
{
|
||||
_index = _loc9_.length;
|
||||
if(_loc10_.addFilter != true)
|
||||
{
|
||||
while(--_index > -1 && !(_loc9_[_index] is _type))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_index < 0 || !(_loc9_[_index] is _type))
|
||||
{
|
||||
if(_index < 0)
|
||||
{
|
||||
_index = _loc9_.length;
|
||||
}
|
||||
if(_index > _loc9_.length)
|
||||
{
|
||||
_loc11_ = _loc9_.length - 1;
|
||||
while(++_loc11_ < _index)
|
||||
{
|
||||
_loc9_[_loc11_] = new BlurFilter(0,0,1);
|
||||
}
|
||||
}
|
||||
_loc9_[_index] = param5;
|
||||
_target.filters = _loc9_;
|
||||
}
|
||||
_filter = _loc9_[_index];
|
||||
_remove = _loc10_.remove == true;
|
||||
_loc11_ = int(param6.length);
|
||||
while(--_loc11_ > -1)
|
||||
{
|
||||
_loc8_ = param6[_loc11_];
|
||||
if(_loc8_ in param2 && _filter[_loc8_] != param2[_loc8_])
|
||||
{
|
||||
if(_loc8_ == "color" || _loc8_ == "highlightColor" || _loc8_ == "shadowColor")
|
||||
{
|
||||
_loc7_ = new HexColorsPlugin();
|
||||
_loc7_._initColor(_filter,_loc8_,param2[_loc8_]);
|
||||
_addTween(_loc7_,"setRatio",0,1,_propName);
|
||||
}
|
||||
else if(_loc8_ == "quality" || _loc8_ == "inner" || _loc8_ == "knockout" || _loc8_ == "hideObject")
|
||||
{
|
||||
_filter[_loc8_] = param2[_loc8_];
|
||||
}
|
||||
else
|
||||
{
|
||||
_addTween(_filter,_loc8_,_filter[_loc8_],param2[_loc8_],_propName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
super.setRatio(param1);
|
||||
var _loc2_:Array = _target.filters;
|
||||
if(!(_loc2_[_index] is _type))
|
||||
{
|
||||
_index = _loc2_.length;
|
||||
while(--_index > -1 && !(_loc2_[_index] is _type))
|
||||
{
|
||||
}
|
||||
if(_index == -1)
|
||||
{
|
||||
_index = _loc2_.length;
|
||||
}
|
||||
}
|
||||
if(param1 == 1 && _remove && _tween._time == _tween._duration && _tween.data != "isFromStart")
|
||||
{
|
||||
if(_index < _loc2_.length)
|
||||
{
|
||||
_loc2_.splice(_index,1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_[_index] = _filter;
|
||||
}
|
||||
_target.filters = _loc2_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.display.MovieClip;
|
||||
|
||||
public class FrameLabelPlugin extends FramePlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public function FrameLabelPlugin()
|
||||
{
|
||||
super();
|
||||
_propName = "frameLabel";
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(!param3.target is MovieClip)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_target = param1 as MovieClip;
|
||||
this.frame = _target.currentFrame;
|
||||
var _loc5_:Array = _target.currentLabels;
|
||||
var _loc6_:String = param2;
|
||||
var _loc4_:int = _target.currentFrame;
|
||||
var _loc7_:int = int(_loc5_.length);
|
||||
while(--_loc7_ > -1)
|
||||
{
|
||||
if(_loc5_[_loc7_].name == _loc6_)
|
||||
{
|
||||
_loc4_ = int(_loc5_[_loc7_].frame);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(this.frame != _loc4_)
|
||||
{
|
||||
_addTween(this,"frame",this.frame,_loc4_,"frame",true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.display.MovieClip;
|
||||
|
||||
public class FramePlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public var frame:int;
|
||||
|
||||
protected var _target:MovieClip;
|
||||
|
||||
public function FramePlugin()
|
||||
{
|
||||
super("frame,frameLabel,frameForward,frameBackward");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(!(param1 is MovieClip) || isNaN(param2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_target = param1 as MovieClip;
|
||||
this.frame = _target.currentFrame;
|
||||
_addTween(this,"frame",this.frame,param2,"frame",true);
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
super.setRatio(param1);
|
||||
if(this.frame != _target.currentFrame)
|
||||
{
|
||||
_target.gotoAndStop(this.frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.GlowFilter;
|
||||
|
||||
public class GlowFilterPlugin extends FilterPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
private static var _propNames:Array = ["color","alpha","blurX","blurY","strength","quality","inner","knockout"];
|
||||
|
||||
public function GlowFilterPlugin()
|
||||
{
|
||||
super("glowFilter");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
return _initFilter(param1,param2,param3,GlowFilter,new GlowFilter(16777215,0,0,0,param2.strength || 1,param2.quality || 2,param2.inner,param2.knockout),_propNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class HexColorsPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _colors:Array;
|
||||
|
||||
public function HexColorsPlugin()
|
||||
{
|
||||
super("hexColors");
|
||||
_overwriteProps = [];
|
||||
_colors = [];
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
for(var _loc4_:String in param2)
|
||||
{
|
||||
_initColor(param1,_loc4_,uint(param2[_loc4_]));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _initColor(param1:Object, param2:String, param3:uint) : void
|
||||
{
|
||||
var _loc8_:Boolean = false;
|
||||
var _loc6_:* = 0;
|
||||
_loc8_ = typeof param1[param2] == "function";
|
||||
var _temp_2:*;
|
||||
var _loc7_:uint = uint(!_loc8_ ? param1[param2] : (_temp_2 = param1,param1[param2.indexOf("set") || !("get" + param2.substr(3) in param1) ? param2 : "get" + param2.substr(3)]()));
|
||||
var _temp_2:*;
|
||||
if(_loc7_ != param3)
|
||||
{
|
||||
_loc6_ = uint(_loc7_ >> 16);
|
||||
var _loc4_:uint = uint(_loc7_ >> 8 & 0xFF);
|
||||
var _loc5_:uint = uint(_loc7_ & 0xFF);
|
||||
_colors[_colors.length] = new ColorProp(param1,param2,_loc8_,_loc6_,(param3 >> 16) - _loc6_,_loc4_,(param3 >> 8 & 0xFF) - _loc4_,_loc5_,(param3 & 0xFF) - _loc5_);
|
||||
_overwriteProps[_overwriteProps.length] = param2;
|
||||
}
|
||||
}
|
||||
|
||||
override public function _kill(param1:Object) : Boolean
|
||||
{
|
||||
var _loc2_:int = int(_colors.length);
|
||||
while(_loc2_--)
|
||||
{
|
||||
if(param1[_colors[_loc2_].p] != null)
|
||||
{
|
||||
_colors.splice(_loc2_,1);
|
||||
}
|
||||
}
|
||||
return super._kill(param1);
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
var _loc3_:ColorProp = null;
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc4_:int = int(_colors.length);
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
_loc3_ = _colors[_loc4_];
|
||||
_loc2_ = _loc3_.rs + param1 * _loc3_.rc << 16 | _loc3_.gs + param1 * _loc3_.gc << 8 | _loc3_.bs + param1 * _loc3_.bc;
|
||||
if(_loc3_.f)
|
||||
{
|
||||
_loc3_.t[_loc3_.p](_loc2_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_.t[_loc3_.p] = _loc2_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ColorProp
|
||||
{
|
||||
|
||||
public var t:Object;
|
||||
|
||||
public var p:String;
|
||||
|
||||
public var f:Boolean;
|
||||
|
||||
public var rs:int;
|
||||
|
||||
public var rc:int;
|
||||
|
||||
public var gs:int;
|
||||
|
||||
public var gc:int;
|
||||
|
||||
public var bs:int;
|
||||
|
||||
public var bc:int;
|
||||
|
||||
public function ColorProp(param1:Object, param2:String, param3:Boolean, param4:int, param5:int, param6:int, param7:int, param8:int, param9:int)
|
||||
{
|
||||
super();
|
||||
this.t = param1;
|
||||
this.p = param2;
|
||||
this.f = param3;
|
||||
this.rs = param4;
|
||||
this.rc = param5;
|
||||
this.gs = param6;
|
||||
this.gc = param7;
|
||||
this.bs = param8;
|
||||
this.bc = param9;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
public class RemoveTintPlugin extends TintPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public function RemoveTintPlugin()
|
||||
{
|
||||
super();
|
||||
_propName = "removeTint";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import com.greensock.core.PropTween;
|
||||
|
||||
public class RoundPropsPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _tween:TweenLite;
|
||||
|
||||
public function RoundPropsPlugin()
|
||||
{
|
||||
super("roundProps",-1);
|
||||
_overwriteProps.length = 0;
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
_tween = param3;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _onInitAllProps() : Boolean
|
||||
{
|
||||
var _loc5_:String = null;
|
||||
var _loc4_:PropTween = null;
|
||||
var _loc3_:PropTween = null;
|
||||
var _loc2_:Array = null;
|
||||
_loc2_ = _tween.vars.roundProps is Array ? _tween.vars.roundProps : _tween.vars.roundProps.split(",");
|
||||
var _loc7_:int = int(_loc2_.length);
|
||||
var _loc6_:Object = {};
|
||||
var _loc1_:PropTween = _tween._propLookup.roundProps;
|
||||
while(--_loc7_ > -1)
|
||||
{
|
||||
_loc6_[_loc2_[_loc7_]] = 1;
|
||||
}
|
||||
_loc7_ = int(_loc2_.length);
|
||||
while(--_loc7_ > -1)
|
||||
{
|
||||
_loc5_ = _loc2_[_loc7_];
|
||||
_loc4_ = _tween._firstPT;
|
||||
while(_loc4_)
|
||||
{
|
||||
_loc3_ = _loc4_._next;
|
||||
if(_loc4_.pg)
|
||||
{
|
||||
_loc4_.t._roundProps(_loc6_,true);
|
||||
}
|
||||
else if(_loc4_.n == _loc5_)
|
||||
{
|
||||
_add(_loc4_.t,_loc5_,_loc4_.s,_loc4_.c);
|
||||
if(_loc3_)
|
||||
{
|
||||
_loc3_._prev = _loc4_._prev;
|
||||
}
|
||||
if(_loc4_._prev)
|
||||
{
|
||||
_loc4_._prev._next = _loc3_;
|
||||
}
|
||||
else if(_tween._firstPT == _loc4_)
|
||||
{
|
||||
_tween._firstPT = _loc3_;
|
||||
}
|
||||
_loc4_._next = _loc4_._prev = null;
|
||||
_tween._propLookup[_loc5_] = _loc1_;
|
||||
}
|
||||
_loc4_ = _loc3_;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function _add(param1:Object, param2:String, param3:Number, param4:Number) : void
|
||||
{
|
||||
_addTween(param1,param2,param3,param3 + param4,param2,true);
|
||||
_overwriteProps[_overwriteProps.length] = param2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class ShortRotationPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public function ShortRotationPlugin()
|
||||
{
|
||||
super("shortRotation");
|
||||
_overwriteProps.pop();
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
var _loc4_:Number = NaN;
|
||||
if(typeof param2 == "number")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var _loc6_:Boolean = param2.useRadians == true;
|
||||
for(var _loc5_:String in param2)
|
||||
{
|
||||
if(_loc5_ != "useRadians")
|
||||
{
|
||||
var _temp_2:*;
|
||||
_loc4_ = Number(param1[_loc5_] is Function ? (_temp_2 = param1,param1[_loc5_.indexOf("set") || !("get" + _loc5_.substr(3) in param1) ? _loc5_ : "get" + _loc5_.substr(3)]()) : param1[_loc5_]);
|
||||
_initRotation(param1,_loc5_,_loc4_,typeof param2[_loc5_] == "number" ? Number(param2[_loc5_]) : _loc4_ + Number(param2[_loc5_].split("=").join("")),_loc6_);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _initRotation(param1:Object, param2:String, param3:Number, param4:Number, param5:Boolean = false) : void
|
||||
{
|
||||
var _loc6_:Number = NaN;
|
||||
_loc6_ = param5 ? 3.141592653589793 * 2 : 360;
|
||||
var _loc7_:Number = (param4 - param3) % _loc6_;
|
||||
if(_loc7_ != _loc7_ % (_loc6_ / 2))
|
||||
{
|
||||
_loc7_ = _loc7_ < 0 ? _loc7_ + _loc6_ : _loc7_ - _loc6_;
|
||||
}
|
||||
_addTween(param1,param2,param3,param3 + _loc7_,param2);
|
||||
_overwriteProps[_overwriteProps.length] = param2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.display.Stage;
|
||||
|
||||
public class StageQualityPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _stage:Stage;
|
||||
|
||||
protected var _during:String;
|
||||
|
||||
protected var _after:String;
|
||||
|
||||
protected var _tween:TweenLite;
|
||||
|
||||
public function StageQualityPlugin()
|
||||
{
|
||||
super("stageQuality");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(!(param2.stage is Stage))
|
||||
{
|
||||
trace("You must define a \'stage\' property for the stageQuality object in your tween.");
|
||||
return false;
|
||||
}
|
||||
_stage = param2.stage as Stage;
|
||||
_tween = param3;
|
||||
_during = "during" in param2 ? param2.during : "medium";
|
||||
_after = "after" in param2 ? param2.after : _stage.quality;
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
if(param1 == 1 && _tween._duration == _tween._time && _tween.data != "isFromStart" || param1 == 0 && _tween._time == 0)
|
||||
{
|
||||
_stage.quality = _after;
|
||||
}
|
||||
else if(_stage.quality != _during)
|
||||
{
|
||||
_stage.quality = _during;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.*;
|
||||
import com.greensock.core.*;
|
||||
import flash.display.*;
|
||||
import flash.geom.ColorTransform;
|
||||
import flash.geom.Transform;
|
||||
|
||||
public class TintPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected static var _props:Array = ["redMultiplier","greenMultiplier","blueMultiplier","alphaMultiplier","redOffset","greenOffset","blueOffset","alphaOffset"];
|
||||
|
||||
protected var _transform:Transform;
|
||||
|
||||
public function TintPlugin()
|
||||
{
|
||||
super("tint,colorTransform,removeTint");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(!(param1 is DisplayObject))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var _loc5_:ColorTransform = new ColorTransform();
|
||||
if(param2 != null && param3.vars.removeTint != true)
|
||||
{
|
||||
_loc5_.color = param2;
|
||||
}
|
||||
_transform = DisplayObject(param1).transform;
|
||||
var _loc4_:ColorTransform = _transform.colorTransform;
|
||||
_loc5_.alphaMultiplier = _loc4_.alphaMultiplier;
|
||||
_loc5_.alphaOffset = _loc4_.alphaOffset;
|
||||
_init(_loc4_,_loc5_);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _init(param1:ColorTransform, param2:ColorTransform) : void
|
||||
{
|
||||
var _loc3_:String = null;
|
||||
var _loc4_:int = int(_props.length);
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
_loc3_ = _props[_loc4_];
|
||||
if(param1[_loc3_] != param2[_loc3_])
|
||||
{
|
||||
_addTween(param1,_loc3_,param1[_loc3_],param2[_loc3_],"tint");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
var _loc3_:ColorTransform = _transform.colorTransform;
|
||||
var _loc2_:PropTween = _firstPT;
|
||||
while(_loc2_)
|
||||
{
|
||||
_loc3_[_loc2_.p] = _loc2_.c * param1 + _loc2_.s;
|
||||
_loc2_ = _loc2_._next;
|
||||
}
|
||||
_transform.colorTransform = _loc3_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import com.greensock.core.PropTween;
|
||||
|
||||
public class TweenPlugin
|
||||
{
|
||||
|
||||
public static const version:String = "12.1.5";
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public var _propName:String;
|
||||
|
||||
public var _overwriteProps:Array;
|
||||
|
||||
public var _priority:int = 0;
|
||||
|
||||
protected var _firstPT:PropTween;
|
||||
|
||||
public function TweenPlugin(param1:String = "", param2:int = 0)
|
||||
{
|
||||
super();
|
||||
_overwriteProps = param1.split(",");
|
||||
_propName = _overwriteProps[0];
|
||||
_priority = param2 || 0;
|
||||
}
|
||||
|
||||
private static function _onTweenEvent(param1:String, param2:TweenLite) : Boolean
|
||||
{
|
||||
var _loc8_:Boolean = false;
|
||||
var _loc7_:PropTween = null;
|
||||
var _loc3_:PropTween = null;
|
||||
var _loc4_:PropTween = null;
|
||||
var _loc6_:PropTween = null;
|
||||
var _loc5_:PropTween = param2._firstPT;
|
||||
if(param1 == "_onInitAllProps")
|
||||
{
|
||||
while(_loc5_)
|
||||
{
|
||||
_loc4_ = _loc5_._next;
|
||||
_loc6_ = _loc7_;
|
||||
while(_loc6_ && _loc6_.pr > _loc5_.pr)
|
||||
{
|
||||
_loc6_ = _loc6_._next;
|
||||
}
|
||||
if(_loc5_._prev == _loc6_ ? _loc6_._prev : _loc3_)
|
||||
{
|
||||
_loc5_._prev._next = _loc5_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc7_ = _loc5_;
|
||||
}
|
||||
if(_loc5_._next == _loc6_)
|
||||
{
|
||||
_loc6_._prev = _loc5_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = _loc5_;
|
||||
}
|
||||
_loc5_ = _loc4_;
|
||||
}
|
||||
_loc5_ = param2._firstPT = _loc7_;
|
||||
}
|
||||
while(_loc5_)
|
||||
{
|
||||
if(_loc5_.pg)
|
||||
{
|
||||
if(param1 in _loc5_.t)
|
||||
{
|
||||
if(_loc5_.t[param1]())
|
||||
{
|
||||
_loc8_ = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc5_ = _loc5_._next;
|
||||
}
|
||||
return _loc8_;
|
||||
}
|
||||
|
||||
public static function activate(param1:Array) : Boolean
|
||||
{
|
||||
TweenLite._onPluginEvent = TweenPlugin._onTweenEvent;
|
||||
var _loc2_:int = int(param1.length);
|
||||
while(--_loc2_ > -1)
|
||||
{
|
||||
if(param1[_loc2_].API == 2)
|
||||
{
|
||||
TweenLite._plugins[new (param1[_loc2_] as Class)()._propName] = param1[_loc2_];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function _addTween(param1:Object, param2:String, param3:Number, param4:*, param5:String = null, param6:Boolean = false) : PropTween
|
||||
{
|
||||
var _loc7_:Number = param4 == null ? 0 : (typeof param4 === "number" || param4.charAt(1) !== "=" ? Number(param4) - param3 : (int(param4.charAt(0) + "1")) * Number(param4.substr(2)));
|
||||
if(_loc7_ !== 0)
|
||||
{
|
||||
_firstPT = new PropTween(param1,param2,param3,_loc7_,param5 || param2,false,_firstPT);
|
||||
_firstPT.r = param6;
|
||||
return _firstPT;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function setRatio(param1:Number) : void
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc3_:PropTween = _firstPT;
|
||||
while(_loc3_)
|
||||
{
|
||||
_loc2_ = _loc3_.c * param1 + _loc3_.s;
|
||||
if(_loc3_.r)
|
||||
{
|
||||
_loc2_ = _loc2_ + (_loc2_ > 0 ? 0.5 : -0.5) | 0;
|
||||
}
|
||||
if(_loc3_.f)
|
||||
{
|
||||
_loc3_.t[_loc3_.p](_loc2_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_.t[_loc3_.p] = _loc2_;
|
||||
}
|
||||
_loc3_ = _loc3_._next;
|
||||
}
|
||||
}
|
||||
|
||||
public function _roundProps(param1:Object, param2:Boolean = true) : void
|
||||
{
|
||||
var _loc3_:PropTween = _firstPT;
|
||||
while(_loc3_)
|
||||
{
|
||||
if(_propName in param1 || _loc3_.n != null && _loc3_.n.split(_propName + "_").join("") in param1)
|
||||
{
|
||||
_loc3_.r = param2;
|
||||
}
|
||||
_loc3_ = _loc3_._next;
|
||||
}
|
||||
}
|
||||
|
||||
public function _kill(param1:Object) : Boolean
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
if(_propName in param1)
|
||||
{
|
||||
_overwriteProps = [];
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = int(_overwriteProps.length);
|
||||
while(--_loc3_ > -1)
|
||||
{
|
||||
if(_overwriteProps[_loc3_] in param1)
|
||||
{
|
||||
_overwriteProps.splice(_loc3_,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
var _loc2_:PropTween = _firstPT;
|
||||
while(_loc2_)
|
||||
{
|
||||
if(_loc2_.n in param1)
|
||||
{
|
||||
if(_loc2_._next)
|
||||
{
|
||||
_loc2_._next._prev = _loc2_._prev;
|
||||
}
|
||||
if(_loc2_._prev)
|
||||
{
|
||||
_loc2_._prev._next = _loc2_._next;
|
||||
_loc2_._prev = null;
|
||||
}
|
||||
else if(_firstPT == _loc2_)
|
||||
{
|
||||
_firstPT = _loc2_._next;
|
||||
}
|
||||
}
|
||||
_loc2_ = _loc2_._next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class VisiblePlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _target:Object;
|
||||
|
||||
protected var _tween:TweenLite;
|
||||
|
||||
protected var _visible:Boolean;
|
||||
|
||||
protected var _initVal:Boolean;
|
||||
|
||||
protected var _progress:int;
|
||||
|
||||
public function VisiblePlugin()
|
||||
{
|
||||
super("visible");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
_target = param1;
|
||||
_tween = param3;
|
||||
_progress = _tween.vars.runBackwards ? 0 : 1;
|
||||
_initVal = _target.visible;
|
||||
_visible = param2;
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
_target.visible = param1 == 1 && (_tween._time / _tween._duration == _progress || _tween._duration == 0) ? _visible : _initVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 7925 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user