mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
feat(client): item maker, worn pictures, emoji, sitting, typing, AFK, staff window
Rebuilt swf/ajclient.swf from swf-src (tools/build-client.sh). New patched
classes: KeepAlive, AvatarView, AvatarUtility, Item, DenItemHelper,
SitForwardAction.
Custom items
- The Item Maker in Settings, in the game's own style: make an item from one
of the game's, name it, upload a picture (PNG encoded in the client and
shrunk when too big), choose sticker or texture, rename, delete.
- Pictures stand in for the item's icon and, for den items, the placed item.
- Worn pictures: LayerBitmap paints a sticker or a texture. Fixed it showing
only until the player moved:
- AvatarView rebuilt the worn layers on every new animation without the
item id, so walking drew the base item. It now carries the id ("d").
- Frames painted while the picture loaded stayed cached as the base item.
They are all painted again when it arrives (LayerBitmap.artArrived).
- The picture loader checks the server's crossdomain policy before its pixels
are read.
Chat
- Windows emoji and the AJ emotes inline with text in chat bubbles; emoji are
sent as \{hex} tags. An emoji picker and :shortcodes:.
- Chat box limit 200 characters; the box shows emoji in the system font.
- Clicking an emote while typing puts its code in the chat box.
- Two new base emotes: 💀 and 😭 (HUDAssets.swf, EmoticonUtility).
- Typing bubble: a "..." over a player's animal while they type ("xty").
It goes on a new line, when they stop, or after 8 seconds.
- loadArt shares pictures by address: emoji and icons load and decode once.
Actions
- Sit Front and Sit Back between the sit arrows, plus Mirror for any action
(from the other session). Front now plays animation 5 (facing the camera)
and Back animation 1 (facing away); both had played animation 1.
Staff
- The Moderate window from a player card's Report button for staff: warn
(custom text too), kick, silence, ban, summon, goto, notes.
- Invisible staff drawn half see-through; staff land on the exact spot on
goto and summon ("xgt").
Other
- AFK sign-out after 75 minutes instead of 7, with a 60-second warning
(com.sbi.client.KeepAlive).
- Jam-a-Grams show custom items and colours; Jammer Wall avatar photos fixed.
- The Item Maker row in the settings menu and the item window toggle.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
331c3e6025
commit
59d9d7e5fa
26 files changed
+6629
-125
No files matched your search
+1584
-70
File diff suppressed because it is too large.
Load diff
+125
-1
@@ -47,6 +47,17 @@ package gui
|
||||
private var _names:Dictionary = new Dictionary(true);
|
||||
|
||||
private var _swapBtn:MovieClip;
|
||||
|
||||
// Whether the next (and currently selected) action is horizontally
|
||||
// mirrored. The state is sent with the action to other players.
|
||||
public var mirrorActions:Boolean = false;
|
||||
|
||||
private var _lastAction:Sprite;
|
||||
|
||||
// sitting facing forward (":sitS:", AvatarWorldView's animation 1): the
|
||||
// "Forward" in the middle of the four arrows. its action sprite is a
|
||||
// class of the client's own (SitForwardAction), not of the HUD's art.
|
||||
private static const SIT_FORWARD:String = "SitForwardAction";
|
||||
|
||||
|
||||
private const ACTIONWINDOW_DIM_ALPHA:Number = 0.5;
|
||||
@@ -309,6 +320,7 @@ package gui
|
||||
_loc12_.addEventListener("mouseDown",actionClickHandler,false,0,true);
|
||||
_loc8_++;
|
||||
}
|
||||
addSitDirectionButtons(_loc3_);
|
||||
}
|
||||
else if(_loc6_ >= 4)
|
||||
{
|
||||
@@ -393,6 +405,7 @@ package gui
|
||||
actionStrings["sleepAnim_btnCont"] = actionStrings["diveAnim_btnCont"] = [":sleep:",":dive:"];
|
||||
actionStrings["hopAnim_btnCont"] = actionStrings["swirlAnim_btnCont"] = [":hop:",":swirl:"];
|
||||
actionStrings["playAnim_btnCont"] = [":play:"];
|
||||
actionStrings[SIT_FORWARD] = [":sitS:"];
|
||||
}
|
||||
|
||||
private function setupTitleBanner() : void
|
||||
@@ -445,6 +458,110 @@ package gui
|
||||
return _loc2_.length > 1 ? _loc2_[_oceanShown ? 1 : 0] : _loc2_[0];
|
||||
}
|
||||
|
||||
// Front and Back sit facing straight forward and straight away. Mirror
|
||||
// replays whichever action was picked most recently in the other
|
||||
// horizontal direction (including dance, sleep, hop and play).
|
||||
private function addSitDirectionButtons(param1:MovieClip) : void
|
||||
{
|
||||
var _loc2_:Rectangle = param1.getBounds(param1);
|
||||
var _loc3_:Number = _loc2_.x + _loc2_.width * 0.5;
|
||||
var _loc4_:Number = _loc2_.y + _loc2_.height * 0.5;
|
||||
var _loc5_:Sprite = addDirectionButton(param1,"Front",0,0,false);
|
||||
var _loc6_:Sprite = addDirectionButton(param1,"Back",0,0,true);
|
||||
var _loc7_:Number = _loc3_ - (_loc5_.width + 3 + _loc6_.width) * 0.5;
|
||||
_loc5_.x = _loc7_;
|
||||
_loc6_.x = _loc7_ + _loc5_.width + 3;
|
||||
_loc5_.y = _loc6_.y = _loc4_ - 13;
|
||||
var _loc8_:Sprite = actionPill("Mirror");
|
||||
var _loc9_:Sprite = actionHitTarget(_loc8_);
|
||||
_loc9_.x = _loc3_ - _loc9_.width * 0.5;
|
||||
_loc9_.y = _loc4_ + 3;
|
||||
_loc9_.addEventListener("mouseDown",mirrorClickHandler,false,0,true);
|
||||
_loc9_.addEventListener("mouseOver",function(param1:MouseEvent):void
|
||||
{
|
||||
_loc9_.alpha = 0.8;
|
||||
},false,0,true);
|
||||
_loc9_.addEventListener("mouseOut",function(param1:MouseEvent):void
|
||||
{
|
||||
_loc9_.alpha = 1;
|
||||
},false,0,true);
|
||||
param1.addChild(_loc9_);
|
||||
}
|
||||
|
||||
private function addDirectionButton(param1:MovieClip, param2:String, param3:Number, param4:Number, param5:Boolean) : Sprite
|
||||
{
|
||||
var _loc6_:Sprite = actionPill(param2);
|
||||
var _loc7_:Sprite = actionHitTarget(_loc6_);
|
||||
_loc7_.x = param3;
|
||||
_loc7_.y = param4;
|
||||
_loc7_.name = param5 ? "sitBackHit" : "sitFrontHit";
|
||||
_loc7_.addEventListener("mouseDown",sitDirectionClickHandler,false,0,true);
|
||||
param1.addChild(_loc7_);
|
||||
return _loc7_;
|
||||
}
|
||||
|
||||
// Keep the generated controls visually uniform. Invisible trailing
|
||||
// spaces reserve the same room without changing the labels players see.
|
||||
private function actionPill(param1:String) : Sprite
|
||||
{
|
||||
var _loc2_:String = param1 == "Front" ? "Front " : (param1 == "Back" ? "Back " : param1);
|
||||
return AJClient.makePill(_loc2_,0x5CB82E,0x2C6E16,false,10);
|
||||
}
|
||||
|
||||
private function sitDirectionClickHandler(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
// one sprite class for both; each sprite is named for the way it faces
|
||||
var _loc2_:Sprite = new SitForwardAction();
|
||||
_names[_loc2_] = param1.currentTarget.name == "sitBackHit" ? ":sitN:" : ":sitS:";
|
||||
selectAction(_loc2_);
|
||||
}
|
||||
|
||||
// The sit artwork is itself a MovieClip with mouse children. A separate
|
||||
// transparent hit target above it keeps our generated labels clickable.
|
||||
private function actionHitTarget(param1:Sprite) : Sprite
|
||||
{
|
||||
var _loc2_:Sprite = new Sprite();
|
||||
_loc2_.graphics.beginFill(0,0);
|
||||
_loc2_.graphics.drawRect(0,0,param1.width,param1.height);
|
||||
_loc2_.graphics.endFill();
|
||||
_loc2_.addChild(param1);
|
||||
_loc2_.buttonMode = true;
|
||||
_loc2_.useHandCursor = true;
|
||||
_loc2_.mouseEnabled = true;
|
||||
_loc2_.mouseChildren = false;
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
private function selectAction(param1:Sprite, param2:Boolean = false) : void
|
||||
{
|
||||
if(!actionBtn.isGray)
|
||||
{
|
||||
mirrorActions = param2;
|
||||
_lastAction = param1;
|
||||
setActionCallback(param1);
|
||||
actionBtn.dispatchEvent(new MouseEvent("mouseDown"));
|
||||
}
|
||||
}
|
||||
|
||||
private function mirrorClickHandler(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
if(!actionBtn.isGray)
|
||||
{
|
||||
mirrorActions = !mirrorActions;
|
||||
if(_lastAction)
|
||||
{
|
||||
setActionCallback(_lastAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function rememberAction(param1:Sprite) : void
|
||||
{
|
||||
_lastAction = param1;
|
||||
}
|
||||
|
||||
public function getActionString(param1:Sprite) : String
|
||||
{
|
||||
if(_names[param1] != undefined)
|
||||
@@ -462,6 +579,12 @@ package gui
|
||||
public function matchActionString(param1:String, param2:Boolean = false) : Sprite
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
if(param1 == ":sitS:" || param1 == ":sitN:")
|
||||
{
|
||||
var _loc9_:Sprite = new SitForwardAction();
|
||||
_names[_loc9_] = param1;
|
||||
return _loc9_;
|
||||
}
|
||||
var _loc4_:String = OTHER_SET_BUTTONS[param1];
|
||||
var _loc5_:Sprite = null;
|
||||
if(_loc4_ && param2 && !playerHasSet(param1.indexOf("Swim") != -1))
|
||||
@@ -565,7 +688,8 @@ package gui
|
||||
param1.stopPropagation();
|
||||
if(!actionBtn.isGray && !param1.currentTarget.isGray)
|
||||
{
|
||||
setActionCallback(new param1.currentTarget.constructor());
|
||||
_lastAction = new param1.currentTarget.constructor();
|
||||
setActionCallback(_lastAction);
|
||||
actionBtn.dispatchEvent(new MouseEvent("mouseDown"));
|
||||
param1.currentTarget.downToUpState();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,380 @@
|
||||
package avatar
|
||||
{
|
||||
import collection.AccItemCollection;
|
||||
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;
|
||||
|
||||
protected var _skipAnimEnviroCheck:Boolean;
|
||||
|
||||
public var avTypeChangedCallback:Function;
|
||||
|
||||
public var onAvatarChangedCallback: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, param3:Function = null, param4:Boolean = false, param5:Boolean = false) : void
|
||||
{
|
||||
_holdAnimId = 0;
|
||||
_avatar = param1;
|
||||
_avatar.addEventListener("OnAvatarChanged",avatarChanged,false,0,true);
|
||||
avTypeChangedCallback = param2;
|
||||
onAvatarChangedCallback = param3;
|
||||
_skipAnimEnviroCheck = param5;
|
||||
_layerAnim = LayerAnim.getNew(param4);
|
||||
_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;
|
||||
onAvatarChangedCallback = 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();
|
||||
if(onAvatarChangedCallback != null)
|
||||
{
|
||||
onAvatarChangedCallback(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function setLayerHelper() : Array
|
||||
{
|
||||
var _loc1_:AvatarInfo = null;
|
||||
var _loc2_:AccItemCollection = null;
|
||||
var _loc3_:* = null;
|
||||
if(_avatar.inventoryBodyMod && _avatar.inventoryBodyMod.itemCollection && _avatar.inventoryBodyMod.itemCollection.length >= 1)
|
||||
{
|
||||
_loc3_ = new AccItemCollection(_avatar.inventoryBodyMod.itemCollection.concatCollection(_avatar.inventoryClothing.itemCollection));
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc1_ = gMainFrame.userInfo.getAvatarInfoByUsernamePerUserAvId(_avatar.userName,_avatar.perUserAvId);
|
||||
if(_loc1_)
|
||||
{
|
||||
_loc2_ = _skipAnimEnviroCheck ? _loc1_.getFullItems(true) : _loc1_.getItems(true);
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc3_ = _loc2_;
|
||||
}
|
||||
}
|
||||
}
|
||||
return AvatarUtility.layerArrayForItemsAndColors(_loc3_,_avatar.colors,_avatar.avInvId,_avatar.roomType,_skipAnimEnviroCheck);
|
||||
}
|
||||
|
||||
public function playAnim(param1:int, param2:Boolean = false, param3:int = 0, param4:Function = null, param5:Boolean = false) : void
|
||||
{
|
||||
var _loc14_:Boolean = false;
|
||||
var _loc13_:AccItemCollection = null;
|
||||
var _loc6_:int = 0;
|
||||
var _loc15_:int = 0;
|
||||
var _loc11_:Array = null;
|
||||
var _loc8_:* = null;
|
||||
var _loc10_:Object = null;
|
||||
var _loc9_:Array = null;
|
||||
var _loc7_:* = 0;
|
||||
if(_layerAnim && _layerAnim.visible && (_holdAnimId == 0 || param1 == _holdAnimId))
|
||||
{
|
||||
if(!_isOffScreen)
|
||||
{
|
||||
_loc14_ = false;
|
||||
_loc13_ = _avatar.accShownItems;
|
||||
if(!_layerAnim.layers)
|
||||
{
|
||||
_loc14_ = true;
|
||||
}
|
||||
else if(_layerAnim.layers.length != _loc13_.length)
|
||||
{
|
||||
_loc14_ = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_ = int(_loc13_.length);
|
||||
_loc15_ = 0;
|
||||
while(_loc15_ < _loc6_)
|
||||
{
|
||||
if(_layerAnim.layers.indexOf(_loc13_.getAccItem(_loc15_).accId) == -1)
|
||||
{
|
||||
_loc14_ = true;
|
||||
break;
|
||||
}
|
||||
_loc15_++;
|
||||
}
|
||||
}
|
||||
if(_loc14_)
|
||||
{
|
||||
_loc11_ = [];
|
||||
_loc8_ = _loc13_;
|
||||
_loc9_ = _avatar.colors;
|
||||
for each(var _loc12_ in _loc8_.getCoreArray())
|
||||
{
|
||||
if((_loc12_.layerId <= 3 || (_skipAnimEnviroCheck || _loc12_.enviroType == _avatar.roomType || _loc12_.isLandAndOcean)) && _loc12_.getInUse(_avatar.avInvId))
|
||||
{
|
||||
if(_loc12_.layerId == 1)
|
||||
{
|
||||
_loc7_ = uint(_loc9_[0]);
|
||||
}
|
||||
else if(_loc12_.layerId == 2)
|
||||
{
|
||||
_loc7_ = uint(_loc9_[1]);
|
||||
}
|
||||
else if(_loc12_.layerId == 3)
|
||||
{
|
||||
_loc7_ = uint(_loc9_[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(param5)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
_loc7_ = _loc12_.color;
|
||||
}
|
||||
// "d": the item, as AvatarUtility.layerArrayForItemsAndColors
|
||||
// gives it: a custom one's own picture goes by it
|
||||
// (LayerAnim, LayerBitmap). without it every new
|
||||
// animation (walking) was painted as the item's base.
|
||||
_loc10_ = {
|
||||
"l":_loc12_.accId,
|
||||
"c":_loc7_,
|
||||
"d":_loc12_.defId
|
||||
};
|
||||
_loc11_.push(_loc10_);
|
||||
}
|
||||
}
|
||||
_layerAnim.layers = _loc11_;
|
||||
}
|
||||
_layerAnim.hFlip = param2;
|
||||
_layerAnim.playAnim(param1,param3,param4);
|
||||
}
|
||||
else
|
||||
{
|
||||
_lastAnimToHappen = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function reloadItemsFromCache() : void
|
||||
{
|
||||
var _loc1_:AccItemCollection = gMainFrame.userInfo.getAvatarInfoByUsernamePerUserAvId(_avatar.userName,_avatar.perUserAvId).getItems(true);
|
||||
_avatar.itemResponseIntegrate(_loc1_,_skipAnimEnviroCheck);
|
||||
}
|
||||
|
||||
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 avInvId() : int
|
||||
{
|
||||
return _avatar.avInvId;
|
||||
}
|
||||
|
||||
public function get inventoryBodyModItems() : AccItemCollection
|
||||
{
|
||||
return _avatar.inventoryBodyMod.itemCollection;
|
||||
}
|
||||
|
||||
public function get inventoryClothingItems() : AccItemCollection
|
||||
{
|
||||
return _avatar.inventoryClothing.itemCollection;
|
||||
}
|
||||
|
||||
public function setAvtColors(param1:Array) : void
|
||||
{
|
||||
_avatar.colors = param1;
|
||||
}
|
||||
|
||||
public function get avName() : String
|
||||
{
|
||||
return _avatar.avName;
|
||||
}
|
||||
|
||||
public function get accShownItems() : AccItemCollection
|
||||
{
|
||||
return _avatar.accShownItems;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,6 +191,20 @@ package avatar
|
||||
"water":40,
|
||||
"set":"land",
|
||||
"flip":false
|
||||
},{
|
||||
// sitting facing straight forward, and straight away (the "Front"
|
||||
// and "Back" between the arrows): animations 5 and 1, the ends of
|
||||
// the sitting turn 1-5 (2 the back corners, 4 the front ones; the
|
||||
// slide's spin plays them in turn). the game's own buttons never did.
|
||||
"name":":sitS:",
|
||||
"land":5,
|
||||
"water":40,
|
||||
"flip":false
|
||||
},{
|
||||
"name":":sitN:",
|
||||
"land":1,
|
||||
"water":40,
|
||||
"flip":false
|
||||
}];
|
||||
|
||||
// the landing puff, artwork compiled into the client. its class has a
|
||||
@@ -209,6 +223,21 @@ package avatar
|
||||
private var _platformingCurVel:Number = 0;
|
||||
|
||||
private var _chatBalloon:ChatBalloon;
|
||||
|
||||
// "..." where the chat bubble goes, while the player is typing
|
||||
// (AJClient.onTyping). gone when a line arrives, when they stop, or
|
||||
// TYPING_SHOWN ms after they last said they were, if a "stopped" is lost.
|
||||
private static const TYPING_SHOWN:int = 8000;
|
||||
|
||||
private var _typing:Sprite;
|
||||
|
||||
private var _typingDots:Array;
|
||||
|
||||
private var _typingTimer:Timer;
|
||||
|
||||
private var _typingStep:int;
|
||||
|
||||
private var _typingUntil:int;
|
||||
|
||||
private var _namebar:NameBar;
|
||||
|
||||
@@ -628,6 +657,14 @@ package avatar
|
||||
{
|
||||
_chatLayer.removeChild(_chatBalloon);
|
||||
}
|
||||
hideTyping();
|
||||
if(_typingTimer)
|
||||
{
|
||||
_typingTimer.removeEventListener("timer",onTypingTimer);
|
||||
_typingTimer = null;
|
||||
}
|
||||
_typing = null;
|
||||
_typingDots = null;
|
||||
removeChild(_namebar);
|
||||
if(_secondaryEmot && _chatLayer.contains(_secondaryEmot))
|
||||
{
|
||||
@@ -1023,9 +1060,108 @@ package avatar
|
||||
return false;
|
||||
}
|
||||
|
||||
public function setTyping(param1:Boolean) : void
|
||||
{
|
||||
var _loc2_:Sprite = null;
|
||||
var _loc3_:int = 0;
|
||||
if(!param1 || _chatLayer == null)
|
||||
{
|
||||
hideTyping();
|
||||
return;
|
||||
}
|
||||
if(_typing == null)
|
||||
{
|
||||
_typing = new Sprite();
|
||||
_typing.mouseEnabled = false;
|
||||
_typing.mouseChildren = false;
|
||||
_typing.graphics.lineStyle(2,0x8C6A3C);
|
||||
_typing.graphics.beginFill(0xFFFFFF);
|
||||
_typing.graphics.drawRoundRect(-22,-26,44,22,20,20);
|
||||
_typing.graphics.endFill();
|
||||
_typing.graphics.lineStyle();
|
||||
_typing.graphics.beginFill(0xFFFFFF);
|
||||
_typing.graphics.moveTo(-5,-5);
|
||||
_typing.graphics.lineTo(0,2);
|
||||
_typing.graphics.lineTo(5,-5);
|
||||
_typing.graphics.endFill();
|
||||
_typingDots = [];
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < 3)
|
||||
{
|
||||
_loc2_ = new Sprite();
|
||||
_loc2_.graphics.beginFill(0x6B5034);
|
||||
_loc2_.graphics.drawCircle(0,0,3);
|
||||
_loc2_.graphics.endFill();
|
||||
_loc2_.x = -10 + _loc3_ * 10;
|
||||
_loc2_.y = -15;
|
||||
_typing.addChild(_loc2_);
|
||||
_typingDots.push(_loc2_);
|
||||
_loc3_++;
|
||||
}
|
||||
_typingTimer = new Timer(300);
|
||||
_typingTimer.addEventListener("timer",onTypingTimer,false,0,true);
|
||||
}
|
||||
_typingUntil = getTimer() + TYPING_SHOWN;
|
||||
if(_typing.parent != _chatLayer)
|
||||
{
|
||||
_chatLayer.addChild(_typing);
|
||||
}
|
||||
placeTyping();
|
||||
_typing.visible = !(_chatBalloon && _chatBalloon.visible);
|
||||
if(!_typingTimer.running)
|
||||
{
|
||||
_typingTimer.start();
|
||||
}
|
||||
}
|
||||
|
||||
private function hideTyping() : void
|
||||
{
|
||||
if(_typingTimer)
|
||||
{
|
||||
_typingTimer.stop();
|
||||
}
|
||||
if(_typing && _typing.parent)
|
||||
{
|
||||
_typing.parent.removeChild(_typing);
|
||||
}
|
||||
}
|
||||
|
||||
private function placeTyping() : void
|
||||
{
|
||||
if(_typing && _chatBalloon)
|
||||
{
|
||||
_typing.x = _chatBalloon.x;
|
||||
_typing.y = _chatBalloon.y;
|
||||
}
|
||||
}
|
||||
|
||||
private function onTypingTimer(param1:TimerEvent) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
if(_typing == null || getTimer() > _typingUntil)
|
||||
{
|
||||
hideTyping();
|
||||
return;
|
||||
}
|
||||
placeTyping();
|
||||
_typing.visible = !(_chatBalloon && _chatBalloon.visible);
|
||||
_typingStep = (_typingStep + 1) % 3;
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _typingDots.length)
|
||||
{
|
||||
_typingDots[_loc2_].alpha = _loc2_ == _typingStep ? 1 : 0.35;
|
||||
_typingDots[_loc2_].y = _loc2_ == _typingStep ? -17 : -15;
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
|
||||
public function setMessage(param1:String, param2:int) : void
|
||||
{
|
||||
var _loc3_:Boolean = false;
|
||||
if(param1 != "...")
|
||||
{
|
||||
hideTyping();
|
||||
}
|
||||
if(param2 > 1)
|
||||
{
|
||||
if(param2 == 2)
|
||||
@@ -1220,6 +1356,18 @@ package avatar
|
||||
_pet.setActionByName(_loc2_.replace(/(Land|Swim):$/,":"));
|
||||
}
|
||||
}
|
||||
|
||||
// The base action definitions supply their normal orientation. A local
|
||||
// Mirror selection is applied after that, so it works for every action
|
||||
// without changing the original sit/dance/etc. mappings.
|
||||
public function setActionMirrored(param1:Boolean) : void
|
||||
{
|
||||
if(_lastIdleAnim > 0 && param1)
|
||||
{
|
||||
_lastIdleFlip = !_lastIdleFlip;
|
||||
playAnim(_lastIdleAnim,_lastIdleFlip);
|
||||
}
|
||||
}
|
||||
|
||||
public function circleTest(param1:int, param2:int, param3:int) : Boolean
|
||||
{
|
||||
|
||||
+191
-33
@@ -63,9 +63,12 @@ package gui
|
||||
|
||||
private var _emoteBGOffsetFunc:Function;
|
||||
|
||||
// emotes drawn inside a line of chat: "\" and an emote's code
|
||||
// ("\:)", "\:fever:") is shown as that emote, small, where it was
|
||||
// typed. each is {at, clip}: where its gap starts in the text shown.
|
||||
// emotes drawn inside a line of chat, small, where they were typed: an
|
||||
// emote's code standing as a word of its own ("hi :) there", ":fever:"),
|
||||
// or anywhere after a "\" ("yay\:)"). and emoji (typed with Windows'
|
||||
// emoji panel, say), which the game's font has none of: each is drawn
|
||||
// as a picture of it, from the server (/emoji/<code points>.png,
|
||||
// Twemoji's). each is {at, clip}: where its gap starts in the text shown.
|
||||
private static const INLINE_GAP:String = " ";
|
||||
|
||||
private static const LONGEST_EMOTE_CODE:int = 16;
|
||||
@@ -130,7 +133,7 @@ package gui
|
||||
this.visible = true;
|
||||
}
|
||||
clearInline();
|
||||
_msgTxt.text = param1.indexOf("\\") == -1 ? param1 : inlineEmotes(param1);
|
||||
_msgTxt.text = inlineEmotes(param1);
|
||||
_msgTxt.height;
|
||||
// AJClient.whisperNext is set by the server's "xw" just ahead of a
|
||||
// whispered line.
|
||||
@@ -178,50 +181,63 @@ package gui
|
||||
}
|
||||
}
|
||||
|
||||
// the text with each "\<emote code>" replaced by a gap, the emote for
|
||||
// it kept in _inline. A code that is no emote stays as typed.
|
||||
// the text with each emote code and emoji (above) replaced by a gap, the
|
||||
// picture for it kept in _inline. what is neither stays as typed.
|
||||
private function inlineEmotes(param1:String) : String
|
||||
{
|
||||
var _loc2_:String = "";
|
||||
var _loc3_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
var _loc5_:String = null;
|
||||
var _loc6_:String = null;
|
||||
var _loc7_:MovieClip = null;
|
||||
var _loc7_:Sprite = null;
|
||||
var _loc8_:int = 0;
|
||||
while(_loc3_ < param1.length)
|
||||
{
|
||||
_loc5_ = null;
|
||||
if(param1.charAt(_loc3_) == "\\")
|
||||
_loc8_ = emojiLength(param1,_loc3_);
|
||||
if(_loc8_ > 0)
|
||||
{
|
||||
_loc4_ = Math.min(LONGEST_EMOTE_CODE,param1.length - _loc3_ - 1);
|
||||
while(_loc4_ >= 2 && _loc5_ == null)
|
||||
{
|
||||
_loc6_ = param1.substr(_loc3_ + 1,_loc4_);
|
||||
if(EmoticonUtility.doesStringMatchAnEmote(_loc6_))
|
||||
{
|
||||
_loc5_ = _loc6_;
|
||||
}
|
||||
_loc4_--;
|
||||
}
|
||||
_inline.push({
|
||||
"at":_loc2_.length,
|
||||
"clip":emojiClip(param1.substr(_loc3_,_loc8_))
|
||||
});
|
||||
_loc2_ += INLINE_GAP;
|
||||
_loc3_ += _loc8_;
|
||||
continue;
|
||||
}
|
||||
if(_loc5_ != null)
|
||||
_loc5_ = null;
|
||||
// an emoji as it is sent: "\{1f600}" (AJClient.emojiToTokens)
|
||||
if(param1.substr(_loc3_,2) == "\\{")
|
||||
{
|
||||
_loc7_ = EmoticonUtility.getSmallSmileyMCForEmoteString(_loc5_);
|
||||
if(_loc7_ != null)
|
||||
var _loc9_:Array = /^\\\{([0-9a-f]{2,6}(?:-[0-9a-f]{2,6}){0,9})\}/.exec(param1.substr(_loc3_,90));
|
||||
if(_loc9_ != null)
|
||||
{
|
||||
_loc7_.mouseEnabled = false;
|
||||
_loc7_.mouseChildren = false;
|
||||
_inline.push({
|
||||
"at":_loc2_.length,
|
||||
"clip":_loc7_
|
||||
"clip":emojiClipNamed(_loc9_[1])
|
||||
});
|
||||
_loc2_ += INLINE_GAP;
|
||||
_loc3_ += String(_loc9_[0]).length;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ += _loc5_;
|
||||
}
|
||||
_loc3_ += 1 + _loc5_.length;
|
||||
}
|
||||
if(param1.charAt(_loc3_) == "\\")
|
||||
{
|
||||
_loc5_ = emoteCodeAt(param1,_loc3_ + 1,false);
|
||||
}
|
||||
else if(_loc3_ == 0 || param1.charAt(_loc3_ - 1) == " ")
|
||||
{
|
||||
_loc5_ = emoteCodeAt(param1,_loc3_,true);
|
||||
}
|
||||
_loc7_ = _loc5_ == null ? null : EmoticonUtility.getSmallSmileyMCForEmoteString(_loc5_);
|
||||
if(_loc7_ != null)
|
||||
{
|
||||
_loc7_.mouseEnabled = false;
|
||||
_loc7_.mouseChildren = false;
|
||||
_inline.push({
|
||||
"at":_loc2_.length,
|
||||
"clip":_loc7_
|
||||
});
|
||||
_loc2_ += INLINE_GAP;
|
||||
_loc3_ += (param1.charAt(_loc3_) == "\\" ? 1 : 0) + _loc5_.length;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -231,7 +247,149 @@ package gui
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
|
||||
// the longest emote code at `param2`, or null. `param3`: as a word of its
|
||||
// own, so it must end the text or come before a space or a stop.
|
||||
private static function emoteCodeAt(param1:String, param2:int, param3:Boolean) : String
|
||||
{
|
||||
var _loc4_:int = Math.min(LONGEST_EMOTE_CODE,param1.length - param2);
|
||||
var _loc5_:String = null;
|
||||
var _loc6_:String = null;
|
||||
while(_loc4_ >= 2)
|
||||
{
|
||||
_loc5_ = param1.substr(param2,_loc4_);
|
||||
_loc6_ = param1.charAt(param2 + _loc4_);
|
||||
if((!param3 || _loc6_ == "" || " .,!?".indexOf(_loc6_) != -1) && EmoticonUtility.doesStringMatchAnEmote(_loc5_))
|
||||
{
|
||||
return _loc5_;
|
||||
}
|
||||
_loc4_--;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// how many UTF-16 units the emoji at `param2` takes (with its skin tone,
|
||||
// its variation selector, a keycap, a second flag letter, and whatever
|
||||
// it is joined to with a zero-width joiner), or 0 when there is none.
|
||||
public static function emojiLength(param1:String, param2:int) : int
|
||||
{
|
||||
var _loc3_:int = param1.charCodeAt(param2);
|
||||
var _loc4_:int = 0;
|
||||
var _loc5_:int = 0;
|
||||
var _loc6_:int = 0;
|
||||
var _loc7_:Boolean = false;
|
||||
if(_loc3_ >= 0xD800 && _loc3_ <= 0xDBFF)
|
||||
{
|
||||
_loc5_ = codePointAt(param1,param2);
|
||||
if(_loc5_ < 0x1F000 || _loc5_ > 0x1FAFF)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
_loc4_ = 2;
|
||||
_loc7_ = _loc5_ >= 0x1F1E6 && _loc5_ <= 0x1F1FF;
|
||||
// a flag is two letters
|
||||
if(_loc7_)
|
||||
{
|
||||
_loc6_ = codePointAt(param1,param2 + 2);
|
||||
if(_loc6_ >= 0x1F1E6 && _loc6_ <= 0x1F1FF)
|
||||
{
|
||||
_loc4_ = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(_loc3_ >= 0x2600 && _loc3_ <= 0x27BF || _loc3_ >= 0x2300 && _loc3_ <= 0x23FF || _loc3_ >= 0x2B00 && _loc3_ <= 0x2BFF
|
||||
|| _loc3_ >= 0x2194 && _loc3_ <= 0x21AA || _loc3_ >= 0x25AA && _loc3_ <= 0x25FE
|
||||
|| [0x203C,0x2049,0x2122,0x2139,0x24C2,0x2934,0x2935,0x3030,0x303D,0x3297,0x3299,0xA9,0xAE].indexOf(_loc3_) != -1 && param1.charCodeAt(param2 + 1) == 0xFE0F)
|
||||
{
|
||||
_loc4_ = 1;
|
||||
}
|
||||
else if("0123456789#*".indexOf(param1.charAt(param2)) != -1 && param1.charCodeAt(param2 + 1) == 0xFE0F && param1.charCodeAt(param2 + 2) == 0x20E3)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
while(param2 + _loc4_ < param1.length)
|
||||
{
|
||||
_loc3_ = param1.charCodeAt(param2 + _loc4_);
|
||||
if(_loc3_ == 0xFE0F || _loc3_ == 0x20E3)
|
||||
{
|
||||
_loc4_++;
|
||||
}
|
||||
else if(_loc3_ == 0xD83C && param1.charCodeAt(param2 + _loc4_ + 1) >= 0xDFFB && param1.charCodeAt(param2 + _loc4_ + 1) <= 0xDFFF)
|
||||
{
|
||||
_loc4_ += 2;
|
||||
}
|
||||
else if(_loc3_ == 0x200D && param2 + _loc4_ + 1 < param1.length)
|
||||
{
|
||||
_loc5_ = emojiLength(param1,param2 + _loc4_ + 1);
|
||||
if(_loc5_ == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
_loc4_ += 1 + _loc5_;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return _loc4_;
|
||||
}
|
||||
|
||||
private static function codePointAt(param1:String, param2:int) : int
|
||||
{
|
||||
var _loc3_:int = param1.charCodeAt(param2);
|
||||
var _loc4_:int = param1.charCodeAt(param2 + 1);
|
||||
if(_loc3_ >= 0xD800 && _loc3_ <= 0xDBFF && _loc4_ >= 0xDC00 && _loc4_ <= 0xDFFF)
|
||||
{
|
||||
return (_loc3_ - 0xD800) * 0x400 + (_loc4_ - 0xDC00) + 0x10000;
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
// its picture's name, as Twemoji names its files: the code points in
|
||||
// hex, "-" between, without U+FE0F unless it is joined (U+200D).
|
||||
public static function emojiName(param1:String) : String
|
||||
{
|
||||
var _loc2_:Array = [];
|
||||
var _loc3_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
var _loc5_:Boolean = param1.indexOf(String.fromCharCode(0x200D)) != -1;
|
||||
while(_loc3_ < param1.length)
|
||||
{
|
||||
_loc4_ = codePointAt(param1,_loc3_);
|
||||
_loc3_ += _loc4_ > 0xFFFF ? 2 : 1;
|
||||
if(_loc4_ != 0xFE0F || _loc5_)
|
||||
{
|
||||
_loc2_.push(_loc4_.toString(16));
|
||||
}
|
||||
}
|
||||
return _loc2_.join("-");
|
||||
}
|
||||
|
||||
// the picture of an emoji: a 72-square, its middle on the origin (as
|
||||
// the game's small emotes are), filled when the picture has loaded.
|
||||
private static function emojiClip(param1:String) : Sprite
|
||||
{
|
||||
return emojiClipNamed(emojiName(param1));
|
||||
}
|
||||
|
||||
private static function emojiClipNamed(param1:String) : Sprite
|
||||
{
|
||||
var _loc2_:Sprite = new Sprite();
|
||||
_loc2_.graphics.beginFill(0,0);
|
||||
_loc2_.graphics.drawRect(-36,-36,72,72);
|
||||
_loc2_.graphics.endFill();
|
||||
_loc2_.mouseEnabled = false;
|
||||
_loc2_.mouseChildren = false;
|
||||
AJClient.loadArt(gMainFrame.clientInfo.websiteURL + "emoji/" + param1 + ".png",_loc2_,72,false);
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
// puts each inline emote over its gap, as tall as the line.
|
||||
private function placeInline() : void
|
||||
{
|
||||
|
||||
+52
-3
@@ -14,6 +14,7 @@ package gui
|
||||
import flash.events.TextEvent;
|
||||
import flash.text.StyleSheet;
|
||||
import flash.text.TextField;
|
||||
import flash.text.TextFormat;
|
||||
import flash.ui.Mouse;
|
||||
import gui.itemWindows.ItemWindowTextNode;
|
||||
import localization.LocalizationManager;
|
||||
@@ -211,6 +212,8 @@ package gui
|
||||
|
||||
public function addMessage(param1:String, param2:String, param3:String, param4:String) : void
|
||||
{
|
||||
// emoji as their names here: this list has no pictures (AJClient.emojiAsNames)
|
||||
param4 = AJClient.emojiAsNames(param4);
|
||||
var _loc5_:Boolean = false;
|
||||
var _loc6_:* = 0;
|
||||
var _loc7_:int = 0;
|
||||
@@ -479,9 +482,10 @@ package gui
|
||||
}
|
||||
else
|
||||
{
|
||||
// 150 here, where the original stopped at 70. the server takes
|
||||
// up to config.maxChatLength.
|
||||
chatMsgText.maxChars = 150;
|
||||
// 200 here, where the original stopped at 70. the server takes
|
||||
// up to config.maxChatLength (more: an emoji goes as a tag of 8
|
||||
// or more), and makes long lines shorter (lib/chatspam.js).
|
||||
chatMsgText.maxChars = 200;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -753,6 +757,51 @@ package gui
|
||||
{
|
||||
_predictiveTextManager.onTextFieldChanged(param1);
|
||||
}
|
||||
showEmojiInInput();
|
||||
AJClient.noteTyping(chatMsgText.text);
|
||||
}
|
||||
|
||||
// the chat box while it holds an emoji (Windows' emoji panel, say): the
|
||||
// game's font has none, so the box is drawn in the computer's own emoji
|
||||
// font until there are none again. the bubble shows them as pictures
|
||||
// (gui.ChatBalloon).
|
||||
private var _inputShowsEmoji:Boolean = false;
|
||||
|
||||
private var _inputFormat:TextFormat;
|
||||
|
||||
private var _inputEmbedded:Boolean = true;
|
||||
|
||||
public function showEmojiInInput() : void
|
||||
{
|
||||
var _loc1_:Boolean = false;
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:String = chatMsgText == null ? "" : chatMsgText.text;
|
||||
var _loc4_:TextFormat = null;
|
||||
while(_loc2_ < _loc3_.length && !_loc1_)
|
||||
{
|
||||
_loc1_ = ChatBalloon.emojiLength(_loc3_,_loc2_) > 0;
|
||||
_loc2_++;
|
||||
}
|
||||
if(chatMsgText == null || _loc1_ == _inputShowsEmoji)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(_loc1_)
|
||||
{
|
||||
_inputFormat = chatMsgText.defaultTextFormat;
|
||||
_inputEmbedded = chatMsgText.embedFonts;
|
||||
_loc4_ = new TextFormat("Segoe UI Emoji",_inputFormat.size,_inputFormat.color,_inputFormat.bold);
|
||||
chatMsgText.embedFonts = false;
|
||||
chatMsgText.defaultTextFormat = _loc4_;
|
||||
chatMsgText.setTextFormat(_loc4_);
|
||||
}
|
||||
else
|
||||
{
|
||||
chatMsgText.embedFonts = _inputEmbedded;
|
||||
chatMsgText.defaultTextFormat = _inputFormat;
|
||||
chatMsgText.setTextFormat(_inputFormat);
|
||||
}
|
||||
_inputShowsEmoji = _loc1_;
|
||||
}
|
||||
|
||||
private function keyDownListener(param1:KeyboardEvent) : void
|
||||
|
||||
@@ -0,0 +1,665 @@
|
||||
package loader
|
||||
{
|
||||
import Enums.DenItemDef;
|
||||
import avatar.AvatarManager;
|
||||
import avatar.MannequinData;
|
||||
import com.sbi.loader.FileServerEvent;
|
||||
import den.DenItem;
|
||||
import den.DenStateItem;
|
||||
import den.DenXtCommManager;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Loader;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import flash.events.MouseEvent;
|
||||
import pet.PetItem;
|
||||
import pet.PetManager;
|
||||
|
||||
public class DenItemHelper
|
||||
{
|
||||
|
||||
private var _denItem:DenItem;
|
||||
|
||||
private var _denStateItem:DenStateItem;
|
||||
|
||||
private var _defId:int;
|
||||
|
||||
private var _id:uint;
|
||||
|
||||
private var _callback:Function;
|
||||
|
||||
private var _loader:Loader;
|
||||
|
||||
private var _sprite:Sprite;
|
||||
|
||||
private var _portalSprite:Sprite;
|
||||
|
||||
private var _sortOffset:int;
|
||||
|
||||
private var _minigameDefId:int;
|
||||
|
||||
private var _nameStrId:int;
|
||||
|
||||
private var _listLauncherId:int;
|
||||
|
||||
private var _version:int;
|
||||
|
||||
private var _version2:int;
|
||||
|
||||
private var _version3:int;
|
||||
|
||||
private var _petItem:PetItem;
|
||||
|
||||
private var _bFlipLabel:Boolean;
|
||||
|
||||
private var _isUniqueImageItem:Boolean;
|
||||
|
||||
private var _uniqueImageId:String;
|
||||
|
||||
private var _uniqueImageCreator:String;
|
||||
|
||||
private var _uniqueImageCreatorDbId:int;
|
||||
|
||||
private var _uniqueImageCreatorUUID:String;
|
||||
|
||||
private var _isMannequin:Boolean;
|
||||
|
||||
private var _isDenStore:Boolean;
|
||||
|
||||
private var _masterpieceDefHelper:MasterpieceDefHelper;
|
||||
|
||||
private var _mannequinData:MannequinData;
|
||||
|
||||
private var _onMouseDownCallback:Function;
|
||||
|
||||
private var _onMouseOverCallback:Function;
|
||||
|
||||
private var _onMouseOutCallback:Function;
|
||||
|
||||
private var _uniqueImage:Sprite;
|
||||
|
||||
public function DenItemHelper()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get displayObject() : Sprite
|
||||
{
|
||||
return _sprite;
|
||||
}
|
||||
|
||||
public function get content() : DisplayObject
|
||||
{
|
||||
return _loader.content;
|
||||
}
|
||||
|
||||
public function get sortOffset() : int
|
||||
{
|
||||
return _sortOffset;
|
||||
}
|
||||
|
||||
public function get id() : int
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
public function get minigameDefId() : int
|
||||
{
|
||||
return _minigameDefId;
|
||||
}
|
||||
|
||||
public function get bFlipLabel() : Boolean
|
||||
{
|
||||
return _bFlipLabel;
|
||||
}
|
||||
|
||||
public function get isUniqueImageItem() : Boolean
|
||||
{
|
||||
return _isUniqueImageItem;
|
||||
}
|
||||
|
||||
public function get listLauncherId() : int
|
||||
{
|
||||
return _listLauncherId;
|
||||
}
|
||||
|
||||
public function get nameStrId() : int
|
||||
{
|
||||
return _nameStrId;
|
||||
}
|
||||
|
||||
public function get uniqueImage() : Sprite
|
||||
{
|
||||
return _uniqueImage;
|
||||
}
|
||||
|
||||
public function get uniqueImageId() : String
|
||||
{
|
||||
return _uniqueImageId;
|
||||
}
|
||||
|
||||
public function set uniqueImageId(param1:String) : void
|
||||
{
|
||||
_uniqueImageId = param1;
|
||||
}
|
||||
|
||||
public function get uniqueImageCreator() : String
|
||||
{
|
||||
return _uniqueImageCreator;
|
||||
}
|
||||
|
||||
public function set uniqueImageCreator(param1:String) : void
|
||||
{
|
||||
_uniqueImageCreator = param1;
|
||||
}
|
||||
|
||||
public function get uniqueImageCreatorDbId() : int
|
||||
{
|
||||
return _uniqueImageCreatorDbId;
|
||||
}
|
||||
|
||||
public function get uniqueImageCreatorUUID() : String
|
||||
{
|
||||
return _uniqueImageCreatorUUID;
|
||||
}
|
||||
|
||||
public function get denStateItem() : DenStateItem
|
||||
{
|
||||
return _denStateItem;
|
||||
}
|
||||
|
||||
public function get defId() : int
|
||||
{
|
||||
return _defId;
|
||||
}
|
||||
|
||||
public function get version() : int
|
||||
{
|
||||
return _version;
|
||||
}
|
||||
|
||||
public function get mannequin() : MannequinData
|
||||
{
|
||||
return _mannequinData;
|
||||
}
|
||||
|
||||
public function get isMannequin() : Boolean
|
||||
{
|
||||
return _isMannequin;
|
||||
}
|
||||
|
||||
public function get isDenStore() : Boolean
|
||||
{
|
||||
return _isDenStore;
|
||||
}
|
||||
|
||||
public function get contentWidth() : int
|
||||
{
|
||||
if(_loader != null && _loader.content != null)
|
||||
{
|
||||
if(_loader.content.hasOwnProperty("sizeCont"))
|
||||
{
|
||||
return _loader.content["sizeCont"].width;
|
||||
}
|
||||
return _loader.content.width;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function get contentHeight() : int
|
||||
{
|
||||
if(_loader != null && _loader.content != null)
|
||||
{
|
||||
if(_loader.content.hasOwnProperty("sizeCont"))
|
||||
{
|
||||
return _loader.content["sizeCont"].height;
|
||||
}
|
||||
return _loader.content.height;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function get currDenItem() : DenItem
|
||||
{
|
||||
return _denItem;
|
||||
}
|
||||
|
||||
public function init(param1:DenItem, param2:Function, param3:PetItem = null, param4:int = 0, param5:int = 0, param6:MannequinData = null) : void
|
||||
{
|
||||
_denItem = param1;
|
||||
_defId = param1.defId;
|
||||
_id = uint(_defId << 16 | DenItem.getIconId(param1.sortId));
|
||||
_callback = param2;
|
||||
_minigameDefId = param1.minigameDefId;
|
||||
_nameStrId = param5;
|
||||
_listLauncherId = param4;
|
||||
_bFlipLabel = false;
|
||||
_isUniqueImageItem = false;
|
||||
_petItem = param3;
|
||||
_version = param1.sortId == 99 ? _petItem.petBits[0] : param1.version;
|
||||
_version2 = param1.sortId == 99 ? _petItem.petBits[1] : 0;
|
||||
_version3 = param1.sortId == 99 ? _petItem.petBits[2] : 0;
|
||||
_loader = new Loader();
|
||||
_sprite = new Sprite();
|
||||
_portalSprite = new Sprite();
|
||||
_uniqueImage = new Sprite();
|
||||
_uniqueImageId = param1.uniqueImageId;
|
||||
_uniqueImageCreator = param1.uniqueImageCreator;
|
||||
_uniqueImageCreatorDbId = param1.uniqueImageCreatorDbId;
|
||||
_uniqueImageCreatorUUID = param1.uniqueImageCreatorUUID;
|
||||
_mannequinData = param6;
|
||||
if(loadCustomArt())
|
||||
{
|
||||
return;
|
||||
}
|
||||
DenItemServer.instance.addEventListener("OnNewData",handleData,false,0,true);
|
||||
DenItemServer.instance.requestFile(_id);
|
||||
}
|
||||
|
||||
public function initDS(param1:DenStateItem, param2:Function) : void
|
||||
{
|
||||
_denStateItem = param1;
|
||||
_defId = param1.defId;
|
||||
_id = uint(_defId << 16 | param1.catId);
|
||||
_callback = param2;
|
||||
_minigameDefId = param1.minigameDefId;
|
||||
_nameStrId = param1.nameStrId;
|
||||
_listLauncherId = param1.listLauncherId;
|
||||
_bFlipLabel = false;
|
||||
_isUniqueImageItem = false;
|
||||
_petItem = param1.petItem;
|
||||
_version = param1.sortCatId == 99 ? _petItem.petBits[0] : param1.version;
|
||||
_version2 = param1.sortCatId == 99 ? _petItem.petBits[1] : 0;
|
||||
_version3 = param1.sortCatId == 99 ? _petItem.petBits[2] : 0;
|
||||
_loader = new Loader();
|
||||
_sprite = new Sprite();
|
||||
_portalSprite = new Sprite();
|
||||
_uniqueImage = new Sprite();
|
||||
_uniqueImageId = param1.uniqueImageId;
|
||||
_uniqueImageCreator = param1.uniqueImageCreator;
|
||||
_uniqueImageCreatorDbId = param1.uniqueImageCreatorDbId;
|
||||
_uniqueImageCreatorUUID = param1.uniqueImageCreatorUUID;
|
||||
_mannequinData = param1.mannequinData;
|
||||
if(loadCustomArt())
|
||||
{
|
||||
return;
|
||||
}
|
||||
DenItemServer.instance.addEventListener("OnNewData",handleData,false,0,true);
|
||||
DenItemServer.instance.requestFile(_id);
|
||||
}
|
||||
|
||||
public function initGeneric(param1:DenItemDef, param2:Function, param3:int = 0, param4:int = 0, param5:int = 0, param6:String = "", param7:int = -1, param8:String = "", param9:PetItem = null, param10:MannequinData = null) : void
|
||||
{
|
||||
_defId = param1.id;
|
||||
_id = uint(_defId << 16 | DenItem.getIconId(param1.sortCat));
|
||||
_callback = param2;
|
||||
_minigameDefId = param1.gameDefId;
|
||||
_nameStrId = param5;
|
||||
_listLauncherId = param4;
|
||||
_bFlipLabel = false;
|
||||
_isUniqueImageItem = false;
|
||||
_petItem = param9;
|
||||
_version = param1.sortCat == 99 ? _petItem.petBits[0] : param3;
|
||||
_version2 = param1.sortCat == 99 ? _petItem.petBits[1] : 0;
|
||||
_version3 = param1.sortCat == 99 ? _petItem.petBits[2] : 0;
|
||||
_loader = new Loader();
|
||||
_sprite = new Sprite();
|
||||
_portalSprite = new Sprite();
|
||||
_uniqueImage = new Sprite();
|
||||
_uniqueImageId = param6;
|
||||
_uniqueImageCreator = "";
|
||||
_uniqueImageCreatorDbId = param7;
|
||||
_uniqueImageCreatorUUID = param8;
|
||||
_mannequinData = param10;
|
||||
if(loadCustomArt())
|
||||
{
|
||||
return;
|
||||
}
|
||||
DenItemServer.instance.addEventListener("OnNewData",handleData,false,0,true);
|
||||
DenItemServer.instance.requestFile(_id);
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
DenItemServer.instance.removeEventListener("OnNewData",handleData);
|
||||
if(_loader)
|
||||
{
|
||||
if(_loader.parent)
|
||||
{
|
||||
_loader.parent.removeChild(_loader);
|
||||
}
|
||||
_loader.unloadAndStop(true);
|
||||
}
|
||||
_callback = null;
|
||||
_sprite = null;
|
||||
}
|
||||
|
||||
public function loadUniqueImage() : void
|
||||
{
|
||||
if(_loader && _loader.content.hasOwnProperty("setUniqueImage"))
|
||||
{
|
||||
_isUniqueImageItem = true;
|
||||
if(_uniqueImageId != "")
|
||||
{
|
||||
_masterpieceDefHelper = new MasterpieceDefHelper();
|
||||
_masterpieceDefHelper.init(_uniqueImageId,onUniqueImageIdLoaded);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setupItemWithEmotes(param1:DenStateItem) : void
|
||||
{
|
||||
_denStateItem = param1;
|
||||
}
|
||||
|
||||
public function addPortalListeners(param1:DenStateItem, param2:Function, param3:Function = null, param4:Function = null) : void
|
||||
{
|
||||
_denStateItem = param1;
|
||||
_onMouseDownCallback = param2;
|
||||
_portalSprite.addEventListener("mouseDown",onMouseDown,false,0,true);
|
||||
if(param3 != null)
|
||||
{
|
||||
_onMouseOverCallback = param3;
|
||||
_portalSprite.addEventListener("mouseOver",onMouseOver,false,0,true);
|
||||
}
|
||||
if(param4 != null)
|
||||
{
|
||||
_onMouseOutCallback = param4;
|
||||
_portalSprite.addEventListener("mouseOut",onMouseOut,false,0,true);
|
||||
}
|
||||
}
|
||||
|
||||
public function addMouseListeners(param1:DenStateItem, param2:Function, param3:Function = null, param4:Function = null) : void
|
||||
{
|
||||
_denStateItem = param1;
|
||||
_onMouseDownCallback = param2;
|
||||
_sprite.addEventListener("mouseDown",onMouseDown,false,0,true);
|
||||
if(param3 != null)
|
||||
{
|
||||
_onMouseOverCallback = param3;
|
||||
_sprite.addEventListener("mouseOver",onMouseOver,false,0,true);
|
||||
}
|
||||
if(param4 != null)
|
||||
{
|
||||
_onMouseOutCallback = param4;
|
||||
_sprite.addEventListener("mouseOut",onMouseOut,false,0,true);
|
||||
}
|
||||
}
|
||||
|
||||
public function removeMouseListeners() : void
|
||||
{
|
||||
_denStateItem = null;
|
||||
_onMouseDownCallback = null;
|
||||
_sprite.removeEventListener("mouseDown",onMouseDown);
|
||||
if(_onMouseOverCallback != null)
|
||||
{
|
||||
_onMouseOverCallback = null;
|
||||
_sprite.removeEventListener("mouseOver",onMouseOver);
|
||||
}
|
||||
if(_onMouseOutCallback != null)
|
||||
{
|
||||
_onMouseOutCallback = null;
|
||||
_sprite.removeEventListener("mouseOut",onMouseOut);
|
||||
}
|
||||
}
|
||||
|
||||
public function removePortalListeners() : void
|
||||
{
|
||||
_denStateItem = null;
|
||||
_onMouseDownCallback = null;
|
||||
_portalSprite.removeEventListener("mouseDown",onMouseDown);
|
||||
if(_onMouseOverCallback != null)
|
||||
{
|
||||
_onMouseOverCallback = null;
|
||||
_portalSprite.removeEventListener("mouseOver",onMouseOver);
|
||||
}
|
||||
if(_onMouseOutCallback != null)
|
||||
{
|
||||
_onMouseOutCallback = null;
|
||||
_portalSprite.removeEventListener("mouseOut",onMouseOut);
|
||||
}
|
||||
}
|
||||
|
||||
public function getVersions() : Array
|
||||
{
|
||||
if(_loader && _loader.content && _loader.content.hasOwnProperty("getVersions"))
|
||||
{
|
||||
return _loader.content["getVersions"]();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function setVersion(param1:int, param2:int = 0, param3:int = 0) : void
|
||||
{
|
||||
var _loc5_:MovieClip = null;
|
||||
var _loc4_:int = 0;
|
||||
_version = param1;
|
||||
if(param2 > 0)
|
||||
{
|
||||
_version2 = param2;
|
||||
}
|
||||
if(param3 > 0)
|
||||
{
|
||||
_version3 = param3;
|
||||
}
|
||||
if(_loader && _loader.content)
|
||||
{
|
||||
if(_loader.content.hasOwnProperty("setVersion"))
|
||||
{
|
||||
if(_version == -1)
|
||||
{
|
||||
_version = getVersions()[0];
|
||||
}
|
||||
_loader.content["setVersion"](param1);
|
||||
}
|
||||
else if(_loader.content.hasOwnProperty("pet"))
|
||||
{
|
||||
_loc5_ = MovieClip(_loader.content);
|
||||
PetManager.setPetState(_loc5_,_version,_version2,_version3);
|
||||
if(_petItem && _petItem.isEgg)
|
||||
{
|
||||
if(_loc5_.pet.hasOwnProperty("setEggDayInt"))
|
||||
{
|
||||
_loc4_ = _petItem.createdTs > 0 ? Math.floor((Utility.getInitialEpochTime() - _petItem.createdTs) / 86400) : 0;
|
||||
_loc5_.pet.setEggDayInt(_loc4_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function rebuildMannequinView() : void
|
||||
{
|
||||
var _loc1_:DenItemDef = DenXtCommManager.getDenItemDef(_defId);
|
||||
if(_loc1_ != null && _loc1_.mannequinAvatarDefId > 0)
|
||||
{
|
||||
_isMannequin = true;
|
||||
_mannequinData.setupMannequinAvatarView(_loc1_,MovieClip(_loader.content));
|
||||
}
|
||||
}
|
||||
|
||||
// a custom den item's own picture (AJClient.customArtUrl): in place of
|
||||
// the game's art, as its icon and in a den, standing on its spot.
|
||||
private function loadCustomArt() : Boolean
|
||||
{
|
||||
var _loc1_:String = AJClient.customArtUrl("den",_defId);
|
||||
if(_loc1_ == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var _loc2_:DenItemHelper = this;
|
||||
_sortOffset = 0;
|
||||
AJClient.loadArt(_loc1_,_sprite,160,true,function():void
|
||||
{
|
||||
_sprite.addChild(_portalSprite);
|
||||
if(_callback != null)
|
||||
{
|
||||
_callback(_loc2_);
|
||||
_callback = null;
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
private function handleData(param1:FileServerEvent) : void
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
if(param1.id == _id && param1.success)
|
||||
{
|
||||
DenItemServer.instance.removeEventListener("OnNewData",handleData);
|
||||
_loader.contentLoaderInfo.addEventListener("complete",onBytesLoaded);
|
||||
param1.data.position = 0;
|
||||
_loc2_ = param1.data.readObject();
|
||||
_sortOffset = _loc2_.so;
|
||||
_loader.loadBytes(_loc2_.ba);
|
||||
}
|
||||
}
|
||||
|
||||
private function onBytesLoaded(param1:Event) : void
|
||||
{
|
||||
var _loc3_:MovieClip = null;
|
||||
var _loc2_:int = 0;
|
||||
var _loc4_:DenItemDef = null;
|
||||
_loader.contentLoaderInfo.removeEventListener("complete",onBytesLoaded);
|
||||
var _loc5_:Array = _loader.content["currentLabels"];
|
||||
if(_loc5_.length >= 0)
|
||||
{
|
||||
for each(var _loc6_:Object in _loc5_)
|
||||
{
|
||||
if(_loc6_.name == "flip")
|
||||
{
|
||||
_bFlipLabel = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!Utility.doesItAnimate(_loader.content))
|
||||
{
|
||||
_loader.cacheAsBitmap = true;
|
||||
}
|
||||
}
|
||||
if(_version == -1)
|
||||
{
|
||||
if(_loader.content.hasOwnProperty("getVersions"))
|
||||
{
|
||||
_version = getVersions()[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
_version = 0;
|
||||
}
|
||||
}
|
||||
if(_loader.content.hasOwnProperty("setVersion") && _version >= 0)
|
||||
{
|
||||
MovieClip(_loader.content).setVersion(_version);
|
||||
}
|
||||
else if(_loader.content.hasOwnProperty("pet"))
|
||||
{
|
||||
_loc3_ = MovieClip(_loader.content);
|
||||
PetManager.setPetState(_loc3_,_version,_version2,_version3);
|
||||
if(_petItem && _petItem.isEgg)
|
||||
{
|
||||
if(_loc3_.pet.hasOwnProperty("setEggDayInt"))
|
||||
{
|
||||
_loc2_ = _petItem.createdTs > 0 ? Math.floor((Utility.getInitialEpochTime() - _petItem.createdTs) / 86400) : 0;
|
||||
_loc3_.pet.setEggDayInt(_loc2_);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(MovieClip(_loader.content).isMoveToDisabled)
|
||||
{
|
||||
_loader.name = "moveToDisabled";
|
||||
}
|
||||
if(_mannequinData != null)
|
||||
{
|
||||
_loc4_ = DenXtCommManager.getDenItemDef(_defId);
|
||||
if(_loc4_ != null && _loc4_.mannequinAvatarDefId > 0)
|
||||
{
|
||||
_isMannequin = true;
|
||||
_mannequinData.setupMannequinAvatarView(_loc4_,MovieClip(_loader.content));
|
||||
}
|
||||
}
|
||||
if(_denStateItem != null)
|
||||
{
|
||||
if(_denStateItem.specialType == 1)
|
||||
{
|
||||
_portalSprite.addChild(MovieClip(_loader.content).clickObject);
|
||||
}
|
||||
else if(_denStateItem.specialType == 2 && _loader.content.hasOwnProperty("setEmoteCallback"))
|
||||
{
|
||||
MovieClip(_loader.content).setEmoteCallback(onEmoteItemClicked);
|
||||
}
|
||||
else if(_denStateItem.specialType == 5)
|
||||
{
|
||||
_isDenStore = true;
|
||||
}
|
||||
}
|
||||
if(_loader.content.hasOwnProperty("setUniqueImage"))
|
||||
{
|
||||
_isUniqueImageItem = true;
|
||||
if(_uniqueImageId != "")
|
||||
{
|
||||
_masterpieceDefHelper = new MasterpieceDefHelper();
|
||||
_masterpieceDefHelper.init(_uniqueImageId,onUniqueImageIdLoaded);
|
||||
}
|
||||
}
|
||||
_sprite.addChild(_loader);
|
||||
_sprite.addChild(_portalSprite);
|
||||
if(_callback != null)
|
||||
{
|
||||
_callback(this);
|
||||
_callback = null;
|
||||
}
|
||||
}
|
||||
|
||||
private function onUniqueImageIdLoaded(param1:Sprite) : void
|
||||
{
|
||||
if(_masterpieceDefHelper)
|
||||
{
|
||||
_masterpieceDefHelper.destroy();
|
||||
_masterpieceDefHelper = null;
|
||||
}
|
||||
if(_uniqueImage)
|
||||
{
|
||||
_uniqueImage.addChild(param1);
|
||||
if(_loader && _loader.content && "setUniqueImage" in _loader.content)
|
||||
{
|
||||
MovieClip(_loader.content).setUniqueImage(_uniqueImage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function onEmoteItemClicked(param1:int) : void
|
||||
{
|
||||
if(AvatarManager.playerAvatarWorldView && !AvatarManager.playerAvatarWorldView.isThisAttachmentOn(param1))
|
||||
{
|
||||
AvatarManager.setPlayerAttachmentEmot(param1);
|
||||
}
|
||||
}
|
||||
|
||||
private function onMouseDown(param1:MouseEvent) : void
|
||||
{
|
||||
if(_onMouseDownCallback != null)
|
||||
{
|
||||
_onMouseDownCallback(param1,this);
|
||||
}
|
||||
}
|
||||
|
||||
private function onMouseOver(param1:MouseEvent) : void
|
||||
{
|
||||
if(_onMouseOverCallback != null)
|
||||
{
|
||||
_onMouseOverCallback(param1,this);
|
||||
}
|
||||
}
|
||||
|
||||
private function onMouseOut(param1:MouseEvent) : void
|
||||
{
|
||||
if(_onMouseOutCallback != null)
|
||||
{
|
||||
_onMouseOutCallback(param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ package gui
|
||||
import flash.net.navigateToURL;
|
||||
import giftPopup.GiftPopup;
|
||||
import gui.itemWindows.ItemWindowECard;
|
||||
import item.ItemXtCommManager;
|
||||
import item.SimpleIcon;
|
||||
import loader.DenItemHelper;
|
||||
import loader.MediaHelper;
|
||||
@@ -698,6 +699,16 @@ package gui
|
||||
switch(_loc6_.type)
|
||||
{
|
||||
case 1:
|
||||
// a custom item's own picture, when it has one (AJClient.customArtUrl)
|
||||
if(AJClient.customArtUrl("clothing",giftItemDefId(_loc6_)) != null)
|
||||
{
|
||||
var _loc8_:Sprite = new Sprite();
|
||||
AJClient.loadArt(AJClient.customArtUrl("clothing",giftItemDefId(_loc6_)),_loc8_,100,false,function():void
|
||||
{
|
||||
setupGiftPopup(_loc8_);
|
||||
});
|
||||
break;
|
||||
}
|
||||
_clothingIconHelper = new SimpleIcon();
|
||||
_clothingIconHelper.init(_loc6_.giftColor,_loc6_.giftId,1,true,false,clothingIconReceived);
|
||||
break;
|
||||
@@ -802,10 +813,45 @@ package gui
|
||||
setupGiftPopup(_guiPet);
|
||||
}
|
||||
|
||||
// a clothing gift's item id, which the server sends as "item|<id>" in
|
||||
// the card's additional gift data (its gift id is the art's), or 0
|
||||
private static function giftItemDefId(param1:ECard) : int
|
||||
{
|
||||
var _loc2_:String = param1.additionalGiftData == null ? "" : param1.additionalGiftData;
|
||||
return _loc2_.indexOf("item|") == 0 ? int(_loc2_.substr(5)) : 0;
|
||||
}
|
||||
|
||||
// a custom item's name as it is now (the server sends it with the
|
||||
// item, "xdi"): the game's strings have none for one made since this
|
||||
// game started, nor a name it was given since.
|
||||
private static function giftItemName(param1:ECard) : String
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
var _loc3_:int = param1.type == 1 ? giftItemDefId(param1) : param1.giftId;
|
||||
if(_loc3_ < 50000)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if(param1.type == 1)
|
||||
{
|
||||
_loc2_ = ItemXtCommManager.getItemDef(_loc3_);
|
||||
}
|
||||
else if(param1.type == 3 || param1.type == 99)
|
||||
{
|
||||
_loc2_ = DenXtCommManager.getDenItemDef(_loc3_);
|
||||
}
|
||||
return _loc2_ != null && _loc2_.name ? String(_loc2_.name) : null;
|
||||
}
|
||||
|
||||
private function setupGiftPopup(param1:Sprite) : void
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
var _loc2_:ECard = _inbox[_currCardIdx];
|
||||
var _loc4_:String = giftItemName(_loc2_);
|
||||
if(_loc4_ != null)
|
||||
{
|
||||
_loc2_.giftName = _loc4_;
|
||||
}
|
||||
var _loc3_:Boolean = _loc2_.isFromVoice && _loc2_.additionalGiftData.length > 0 && _loc2_.additionalGiftData.indexOf("|") == -1;
|
||||
_giftPopup = new GiftPopup();
|
||||
_giftPopup.init(_guiLayer,param1,_loc2_.giftName,_loc2_.giftId,_loc2_.isFromVoice ? 6 : 0,GiftPopup.giftTypeForECardType(_loc2_.type),keepGiftCallback,rejectGiftCallback,destroyGiftPopup,!_loc2_.isFromVoice,GiftPopup.buttonsTypeForECardType(_loc2_.type),_loc2_.secondaryType,null,_loc3_ ? _loc2_.modifiedMsg : null,_petBits);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
returns null
|
||||
|
||||
body
|
||||
maxstack 43
|
||||
maxstack 45
|
||||
localcount 1
|
||||
initscopedepth 0
|
||||
maxscopedepth 1
|
||||
@@ -54,7 +54,9 @@
|
||||
pushstring "emo_star2_sml"
|
||||
pushstring "emo_star3_sml"
|
||||
pushstring "emo_temp_sml"
|
||||
newarray 43
|
||||
pushstring "emo_skull_sml"
|
||||
pushstring "emo_sob_sml"
|
||||
newarray 45
|
||||
findproperty QName(PrivateNamespace("gui:EmoticonUtility"),"displaySprites")
|
||||
swap
|
||||
setproperty QName(PrivateNamespace("gui:EmoticonUtility"),"displaySprites")
|
||||
@@ -126,7 +128,9 @@
|
||||
pushstring "emo_star2"
|
||||
pushstring "emo_star3"
|
||||
pushstring "emo_temp"
|
||||
newarray 43
|
||||
pushstring "emo_skull"
|
||||
pushstring "emo_sob"
|
||||
newarray 45
|
||||
findproperty QName(PrivateNamespace("gui:EmoticonUtility"),"emoteSprites")
|
||||
swap
|
||||
setproperty QName(PrivateNamespace("gui:EmoticonUtility"),"emoteSprites")
|
||||
@@ -565,6 +569,26 @@
|
||||
pushstring ":fever:"
|
||||
newarray 1
|
||||
setproperty MultinameL([PrivateNamespace("gui:EmoticonUtility"),StaticProtectedNs("gui:EmoticonUtility"),StaticProtectedNs("Object"),PackageNamespace("gui"),PackageInternalNs("gui"),PrivateNamespace("FilePrivateNS:EmoticonUtility"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getlex QName(PrivateNamespace("gui:EmoticonUtility"),"_emoteStrings")
|
||||
pushstring "emo_skull"
|
||||
pushstring ":skull:"
|
||||
newarray 1
|
||||
setproperty MultinameL([PrivateNamespace("gui:EmoticonUtility"),StaticProtectedNs("gui:EmoticonUtility"),StaticProtectedNs("Object"),PackageNamespace("gui"),PackageInternalNs("gui"),PrivateNamespace("FilePrivateNS:EmoticonUtility"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getlex QName(PrivateNamespace("gui:EmoticonUtility"),"_emoteChatStrings")
|
||||
pushstring "emo_skull"
|
||||
pushstring ":skull:"
|
||||
newarray 1
|
||||
setproperty MultinameL([PrivateNamespace("gui:EmoticonUtility"),StaticProtectedNs("gui:EmoticonUtility"),StaticProtectedNs("Object"),PackageNamespace("gui"),PackageInternalNs("gui"),PrivateNamespace("FilePrivateNS:EmoticonUtility"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getlex QName(PrivateNamespace("gui:EmoticonUtility"),"_emoteStrings")
|
||||
pushstring "emo_sob"
|
||||
pushstring ":sob:"
|
||||
newarray 1
|
||||
setproperty MultinameL([PrivateNamespace("gui:EmoticonUtility"),StaticProtectedNs("gui:EmoticonUtility"),StaticProtectedNs("Object"),PackageNamespace("gui"),PackageInternalNs("gui"),PrivateNamespace("FilePrivateNS:EmoticonUtility"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getlex QName(PrivateNamespace("gui:EmoticonUtility"),"_emoteChatStrings")
|
||||
pushstring "emo_sob"
|
||||
pushstring ":sob:"
|
||||
newarray 1
|
||||
setproperty MultinameL([PrivateNamespace("gui:EmoticonUtility"),StaticProtectedNs("gui:EmoticonUtility"),StaticProtectedNs("Object"),PackageNamespace("gui"),PackageInternalNs("gui"),PrivateNamespace("FilePrivateNS:EmoticonUtility"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
returnvoid
|
||||
end ; code
|
||||
end ; body
|
||||
|
||||
@@ -2769,8 +2769,20 @@ package gui
|
||||
gMainFrame.stage.removeEventListener("mouseUp",clickedOutsideChatCui);
|
||||
}
|
||||
|
||||
// an emote from the emote window: sent on its own, as the game has it;
|
||||
// but with words already typed in the chat box, its code goes there,
|
||||
// after them, and the line shows it among the words (gui.ChatBalloon).
|
||||
public static function onEmoteClick(param1:Sprite) : void
|
||||
{
|
||||
var _loc2_:String = EmoticonUtility.getEmoteString(param1);
|
||||
var _loc3_:Object = chatHist != null ? chatHist.chatMsgText : null;
|
||||
if(_loc2_ != null && _loc3_ != null && chatHist.enableFreeChatValue && String(_loc3_.text).replace(/\s+/g,"").length > 0)
|
||||
{
|
||||
_loc3_.text = String(_loc3_.text).replace(/\s+$/,"") + " " + _loc2_ + " ";
|
||||
gMainFrame.stage.focus = _loc3_ as InteractiveObject;
|
||||
_loc3_.setSelection(_loc3_.text.length,_loc3_.text.length);
|
||||
return;
|
||||
}
|
||||
UserCommXtCommManager.sendAvatarEmote(param1);
|
||||
}
|
||||
|
||||
|
||||
+803
@@ -0,0 +1,803 @@
|
||||
package item
|
||||
{
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import currency.CombinedCurrencyItem;
|
||||
import diamond.DiamondItem;
|
||||
import diamond.DiamondXtCommManager;
|
||||
import flash.display.Sprite;
|
||||
import inventory.Iitem;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class Item implements Iitem
|
||||
{
|
||||
|
||||
public static const BODY_MOD_TYPE:int = 0;
|
||||
|
||||
public static const CLOTHING_TYPE:int = 1;
|
||||
|
||||
public static const BASE_LAYER:int = 1;
|
||||
|
||||
public static const PATTERN_LAYER:int = 2;
|
||||
|
||||
public static const EYE_LAYER:int = 3;
|
||||
|
||||
public static const TAIL_LAYER:int = 4;
|
||||
|
||||
public static const LEG_LAYER:int = 5;
|
||||
|
||||
public static const BACK_LAYER:int = 6;
|
||||
|
||||
public static const NECK_LAYER:int = 7;
|
||||
|
||||
public static const HEAD_LAYER_1:int = 8;
|
||||
|
||||
public static const HEAD_LAYER_2:int = 9;
|
||||
|
||||
public static const HEAD_LAYER_3:int = 10;
|
||||
|
||||
public static const OCEAN_LEG_LAYER:int = 8;
|
||||
|
||||
public static const OCEAN_BACK_LAYER:int = 6;
|
||||
|
||||
public static const OCEAN_HEAD_LAYER:int = 7;
|
||||
|
||||
public static const OCEAN_NECK_LAYER:int = 5;
|
||||
|
||||
public static const NUM_DETAILS_PER_ITEM:int = 11;
|
||||
|
||||
public static const COMBAT_TYPE_MELEE:int = 0;
|
||||
|
||||
public static const COMBAT_TYPE_RANGED:int = 1;
|
||||
|
||||
public static const MODIFIER_TYPE_NONE:int = 0;
|
||||
|
||||
public static const MODIFIER_TYPE_RANGED:int = 1;
|
||||
|
||||
public static const MODIFIER_TYPE_MELEE:int = 2;
|
||||
|
||||
public static const MODIFIER_TYPE_DEFENSE:int = 3;
|
||||
|
||||
public static const MODIFIER_TYPE_RESTORE:int = 4;
|
||||
|
||||
private var _currDef:Object;
|
||||
|
||||
private var _layerId:int;
|
||||
|
||||
private var _invIdx:int;
|
||||
|
||||
private var _accId:int;
|
||||
|
||||
private var _color:uint;
|
||||
|
||||
private var _name:String;
|
||||
|
||||
private var _isGiftable:Boolean;
|
||||
|
||||
private var _isMemberOnly:Boolean;
|
||||
|
||||
private var _itemStatus:int;
|
||||
|
||||
private var _type:int;
|
||||
|
||||
private var _enviroType:int;
|
||||
|
||||
private var _recycleValue:int;
|
||||
|
||||
private var _currencyType:int;
|
||||
|
||||
private var _avatarUseFlag:Object;
|
||||
|
||||
private var _endTime:uint;
|
||||
|
||||
private var _colors:Array;
|
||||
|
||||
private var _equippedAvatars:EquippedAvatars;
|
||||
|
||||
private var _value:int;
|
||||
|
||||
private var _defId:int;
|
||||
|
||||
private var _icon:Sprite;
|
||||
|
||||
private var _iconHelper:SimpleIcon;
|
||||
|
||||
private var _denStoreInvId:int;
|
||||
|
||||
private var _largeIcon:Sprite;
|
||||
|
||||
private var _largeIconHelper:SimpleIcon;
|
||||
|
||||
private var _isShopItem:Boolean;
|
||||
|
||||
private var _isIconLoaded:Boolean;
|
||||
|
||||
private var _imageLoadedCallback:Function;
|
||||
|
||||
private var _iconLayerID:int = -1;
|
||||
|
||||
private var _iconColorID:int = 0;
|
||||
|
||||
private var _attackMediaRefId:int = 0;
|
||||
|
||||
private var _defense:int = 0;
|
||||
|
||||
private var _attack:int = 0;
|
||||
|
||||
private var _combatType:int = 0;
|
||||
|
||||
private var _fierce:int = 0;
|
||||
|
||||
private var _modifierType:int = 0;
|
||||
|
||||
private var _modifierValue:int = 0;
|
||||
|
||||
private var _combinedCurrencyItem:CombinedCurrencyItem;
|
||||
|
||||
private var _specialScale:Number;
|
||||
|
||||
private var _diamondItem:DiamondItem;
|
||||
|
||||
private var _asShopItemSized:Boolean;
|
||||
|
||||
public function Item()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:int, param2:int = 0, param3:uint = 0, param4:EquippedAvatars = null, param5:Boolean = false, param6:Number = -1, param7:int = 0) : void
|
||||
{
|
||||
_defId = param1;
|
||||
_invIdx = param2;
|
||||
_color = param3;
|
||||
_equippedAvatars = param4 != null ? param4 : new EquippedAvatars();
|
||||
_isShopItem = param5;
|
||||
_specialScale = param6;
|
||||
_denStoreInvId = param7;
|
||||
_currDef = ItemXtCommManager.getItemDef(param1);
|
||||
if(_currDef == null)
|
||||
{
|
||||
DebugUtility.debugTrace("Item.init got invalid defId? defId:" + param1);
|
||||
return;
|
||||
}
|
||||
_layerId = _currDef.layerId;
|
||||
_accId = _currDef.accId;
|
||||
_name = _currDef.name;
|
||||
_isGiftable = _currDef.isGiftable;
|
||||
_diamondItem = DiamondXtCommManager.getDiamondItem(DiamondXtCommManager.getDiamondDefIdByRefId(_currDef.defId,0));
|
||||
if(_diamondItem)
|
||||
{
|
||||
_itemStatus = _diamondItem.status;
|
||||
_value = _diamondItem.value;
|
||||
_currencyType = 3;
|
||||
_endTime = _diamondItem.availabilityEndTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
_itemStatus = _currDef.itemStatus;
|
||||
_value = isOnSale ? Math.ceil(_currDef.cost * 0.5) : _currDef.cost;
|
||||
_currencyType = _currDef.currencyType;
|
||||
_endTime = _currDef.availabilityEndTime;
|
||||
}
|
||||
_type = _currDef.type;
|
||||
_isMemberOnly = _currDef.isMembersOnly;
|
||||
_enviroType = _currDef.enviroType;
|
||||
_recycleValue = _currDef.recycleValue == 0 ? _currDef.cost * gMainFrame.clientInfo.recyclePercentage : _currDef.recycleValue;
|
||||
_avatarUseFlag = _currDef.avatarUseFlag;
|
||||
_colors = _currDef.colors;
|
||||
_attackMediaRefId = _currDef.attackMediaRefId;
|
||||
_defense = _currDef.defense;
|
||||
_attack = _currDef.attack;
|
||||
_combatType = _currDef.combatType;
|
||||
_fierce = _currDef.criticalHit;
|
||||
_modifierType = _currDef.modifierType;
|
||||
_modifierValue = _currDef.modifierValue;
|
||||
_largeIcon = null;
|
||||
_icon = null;
|
||||
if(_currencyType == 100)
|
||||
{
|
||||
_combinedCurrencyItem = new CombinedCurrencyItem(_currDef.combinedCurrencyString);
|
||||
}
|
||||
_isIconLoaded = false;
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
if(_iconHelper)
|
||||
{
|
||||
_iconHelper.destroy();
|
||||
_iconHelper = null;
|
||||
}
|
||||
if(_largeIconHelper)
|
||||
{
|
||||
_largeIconHelper.destroy();
|
||||
_largeIconHelper = null;
|
||||
}
|
||||
if(_icon)
|
||||
{
|
||||
_icon = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function ifItemDiffers(param1:Iitem) : Boolean
|
||||
{
|
||||
var _loc2_:Item = param1 as Item;
|
||||
if(_loc2_)
|
||||
{
|
||||
if(_defId == param1.defId)
|
||||
{
|
||||
if(!_equippedAvatars.equals(_loc2_._equippedAvatars) || value != _loc2_.value || _color != _loc2_._color || _name != _loc2_._name || _isGiftable != _loc2_._isGiftable || _type != _loc2_._type || _layerId != _loc2_._layerId || _accId != _loc2_._accId || _isMemberOnly != _loc2_._isMemberOnly || isNew != _loc2_.isNew || isOnSale != _loc2_.isOnSale || _recycleValue != _loc2_._recycleValue || _currencyType != _loc2_._currencyType || _endTime != _loc2_._endTime || _specialScale != _loc2_.specialScale || isInDenShop != _loc2_.isInDenShop)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function clone() : Iitem
|
||||
{
|
||||
var _loc1_:Item = new Item();
|
||||
_loc1_.init(_defId,_invIdx,_color,_equippedAvatars.clone(),_isShopItem,_specialScale,_denStoreInvId);
|
||||
_loc1_.updateValueWithNewStatus(_itemStatus);
|
||||
_loc1_.imageLoadedCallback = imageLoadedCallback;
|
||||
return _loc1_;
|
||||
}
|
||||
|
||||
public function makeSmallIcon() : void
|
||||
{
|
||||
if(_accId == 3)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_isIconLoaded = false;
|
||||
_icon = new Sprite();
|
||||
// a custom item's own picture (AJClient.customArtUrl), in a box the
|
||||
// size of the game's icons
|
||||
var _loc1_:String = AJClient.customArtUrl("clothing",_defId);
|
||||
if(_loc1_ != null)
|
||||
{
|
||||
var _loc2_:Sprite = new Sprite();
|
||||
AJClient.loadArt(_loc1_,_loc2_,100,false,function():void
|
||||
{
|
||||
_loc2_.x = 50;
|
||||
_loc2_.y = 50;
|
||||
_icon.addChild(_loc2_);
|
||||
resizeAndPositionIcon(false);
|
||||
_isIconLoaded = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
_iconHelper = new SimpleIcon();
|
||||
_iconHelper.init(_color,_accId,1,_isShopItem,false,smallIconReceived);
|
||||
}
|
||||
|
||||
public function makeLargeIcon() : void
|
||||
{
|
||||
if(_accId == 3)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_isIconLoaded = false;
|
||||
_largeIcon = new Sprite();
|
||||
var _loc1_:String = AJClient.customArtUrl("clothing",_defId);
|
||||
if(_loc1_ != null)
|
||||
{
|
||||
var _loc2_:Sprite = new Sprite();
|
||||
AJClient.loadArt(_loc1_,_loc2_,100,false,function():void
|
||||
{
|
||||
_loc2_.x = 50;
|
||||
_loc2_.y = 50;
|
||||
_largeIcon.addChild(_loc2_);
|
||||
resizeAndPositionIcon(true);
|
||||
_isIconLoaded = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
_largeIconHelper = new SimpleIcon();
|
||||
_largeIconHelper.init(_color,_accId,1,_isShopItem,false,largeIconReceived);
|
||||
}
|
||||
|
||||
private function smallIconReceived() : void
|
||||
{
|
||||
_icon.addChild(_iconHelper.iconBitmap);
|
||||
resizeAndPositionIcon(false);
|
||||
_isIconLoaded = true;
|
||||
if(_iconLayerID >= 0)
|
||||
{
|
||||
if(_icon && _iconHelper)
|
||||
{
|
||||
_iconHelper.updateLayerColor(_iconLayerID,_iconColorID);
|
||||
}
|
||||
_iconLayerID = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private function largeIconReceived() : void
|
||||
{
|
||||
_largeIcon.addChild(_largeIconHelper.iconBitmap);
|
||||
resizeAndPositionIcon(true);
|
||||
_isIconLoaded = true;
|
||||
}
|
||||
|
||||
public function setIconColor(param1:int, param2:uint) : void
|
||||
{
|
||||
_iconLayerID = param1;
|
||||
_iconColorID = param2;
|
||||
if(_icon && _iconHelper)
|
||||
{
|
||||
_iconHelper.updateLayerColor(_iconLayerID,_iconColorID);
|
||||
}
|
||||
}
|
||||
|
||||
private function updateLargeIconColor() : void
|
||||
{
|
||||
if(_largeIcon && _largeIconHelper)
|
||||
{
|
||||
_largeIconHelper.updateLayerColor(_layerId,_color);
|
||||
}
|
||||
}
|
||||
|
||||
private function updateIconColor() : void
|
||||
{
|
||||
if(_icon && _iconHelper)
|
||||
{
|
||||
_iconHelper.updateLayerColor(_layerId,_color);
|
||||
}
|
||||
}
|
||||
|
||||
public function resizeAndPositionIcon(param1:Boolean) : void
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
if(_isShopItem || param1 || _asShopItemSized)
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
_loc2_ = 1;
|
||||
_largeIcon.width *= _loc2_;
|
||||
_largeIcon.height *= _loc2_;
|
||||
_largeIcon.x = -(_largeIcon.width * 0.5);
|
||||
_largeIcon.y = -(_largeIcon.height * 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_specialScale > 0)
|
||||
{
|
||||
_loc2_ = _specialScale;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = 0.6;
|
||||
}
|
||||
_icon.width *= _loc2_;
|
||||
_icon.height *= _loc2_;
|
||||
_icon.x = -(_icon.width * 0.5);
|
||||
_icon.y = -(_icon.height * 0.5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = 0.75;
|
||||
_icon.width *= _loc2_;
|
||||
_icon.height *= _loc2_;
|
||||
_icon.x = -(_icon.width * 0.5);
|
||||
_icon.y = -(_icon.height * 0.5);
|
||||
}
|
||||
if(_imageLoadedCallback != null)
|
||||
{
|
||||
_imageLoadedCallback();
|
||||
}
|
||||
}
|
||||
|
||||
public function set asShopItemSized(param1:Boolean) : void
|
||||
{
|
||||
_asShopItemSized = param1;
|
||||
}
|
||||
|
||||
public function set diamondItem(param1:DiamondItem) : void
|
||||
{
|
||||
_diamondItem = param1;
|
||||
}
|
||||
|
||||
public function get diamondItem() : DiamondItem
|
||||
{
|
||||
return _diamondItem;
|
||||
}
|
||||
|
||||
public function get defId() : int
|
||||
{
|
||||
return _defId;
|
||||
}
|
||||
|
||||
public function set defId(param1:int) : void
|
||||
{
|
||||
_defId = param1;
|
||||
}
|
||||
|
||||
public function get icon() : Sprite
|
||||
{
|
||||
if(!_icon)
|
||||
{
|
||||
makeSmallIcon();
|
||||
}
|
||||
else
|
||||
{
|
||||
updateIconColor();
|
||||
}
|
||||
return _icon;
|
||||
}
|
||||
|
||||
public function get largeIcon() : Sprite
|
||||
{
|
||||
if(!_largeIcon)
|
||||
{
|
||||
makeLargeIcon();
|
||||
}
|
||||
else
|
||||
{
|
||||
updateLargeIconColor();
|
||||
}
|
||||
return _largeIcon;
|
||||
}
|
||||
|
||||
public function get isOnSale() : Boolean
|
||||
{
|
||||
return _itemStatus == 2;
|
||||
}
|
||||
|
||||
public function get isOnClearance() : Boolean
|
||||
{
|
||||
return _itemStatus == 3;
|
||||
}
|
||||
|
||||
public function get isRare() : Boolean
|
||||
{
|
||||
return _itemStatus == 4;
|
||||
}
|
||||
|
||||
public function get isNew() : Boolean
|
||||
{
|
||||
return _itemStatus == 1;
|
||||
}
|
||||
|
||||
public function get startTime() : uint
|
||||
{
|
||||
if(_diamondItem)
|
||||
{
|
||||
return _diamondItem.startTime;
|
||||
}
|
||||
if(_currDef)
|
||||
{
|
||||
return _currDef.availabilityStartTime;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function get isOcean() : Boolean
|
||||
{
|
||||
return _enviroType == 1;
|
||||
}
|
||||
|
||||
public function get isLand() : Boolean
|
||||
{
|
||||
return _enviroType == 0;
|
||||
}
|
||||
|
||||
public function get isLandAndOcean() : Boolean
|
||||
{
|
||||
return _enviroType == 3;
|
||||
}
|
||||
|
||||
public function get isDiamond() : Boolean
|
||||
{
|
||||
return _diamondItem != null;
|
||||
}
|
||||
|
||||
public function get isRareDiamond() : Boolean
|
||||
{
|
||||
return isRare && isDiamond;
|
||||
}
|
||||
|
||||
public function get attackMediaRefId() : int
|
||||
{
|
||||
return _attackMediaRefId;
|
||||
}
|
||||
|
||||
public function get defense() : int
|
||||
{
|
||||
return _defense;
|
||||
}
|
||||
|
||||
public function get attack() : int
|
||||
{
|
||||
return _attack;
|
||||
}
|
||||
|
||||
public function get combatType() : int
|
||||
{
|
||||
return _combatType;
|
||||
}
|
||||
|
||||
public function get modifierType() : int
|
||||
{
|
||||
return _modifierType;
|
||||
}
|
||||
|
||||
public function get modifierValue() : int
|
||||
{
|
||||
return _modifierValue;
|
||||
}
|
||||
|
||||
public function get fierceAttack() : int
|
||||
{
|
||||
return _fierce;
|
||||
}
|
||||
|
||||
public function get extraTooltipInfo() : String
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public function cloneEquippedAvatars(param1:Boolean = false) : EquippedAvatars
|
||||
{
|
||||
if(param1 && _equippedAvatars.isEquippedOnAnyAvatars())
|
||||
{
|
||||
return EquippedAvatars.forced();
|
||||
}
|
||||
return _equippedAvatars.clone();
|
||||
}
|
||||
|
||||
public function getInUse(param1:int = -1) : Boolean
|
||||
{
|
||||
return _equippedAvatars.isEquipped(param1);
|
||||
}
|
||||
|
||||
public function setInUse(param1:int, param2:Boolean) : void
|
||||
{
|
||||
_equippedAvatars.setEquipped(param1,param2);
|
||||
}
|
||||
|
||||
public function forceInUse(param1:Boolean) : void
|
||||
{
|
||||
_equippedAvatars.setForceInUse(param1);
|
||||
}
|
||||
|
||||
public function updateValueWithNewStatus(param1:int) : void
|
||||
{
|
||||
if(_currencyType != 100 && !isRare && _currDef != null)
|
||||
{
|
||||
_itemStatus = param1;
|
||||
if(isOnSale)
|
||||
{
|
||||
if(_diamondItem)
|
||||
{
|
||||
if(_diamondItem.isOnSale)
|
||||
{
|
||||
_value = _diamondItem.value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_value = Math.ceil(_diamondItem.value * 0.5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_value = Math.ceil(_currDef.cost * 0.5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_value = _diamondItem ? _diamondItem.value : _currDef.cost;
|
||||
}
|
||||
_recycleValue = _currDef.recycleValue == 0 ? _currDef.cost * gMainFrame.clientInfo.recyclePercentage : _currDef.recycleValue;
|
||||
}
|
||||
}
|
||||
|
||||
public function get combinedCurrencyItem() : CombinedCurrencyItem
|
||||
{
|
||||
return _combinedCurrencyItem;
|
||||
}
|
||||
|
||||
public function get sincleCurrencyCost() : int
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
|
||||
public function get value() : *
|
||||
{
|
||||
if(_currencyType == 100)
|
||||
{
|
||||
return _combinedCurrencyItem;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
public function get sortIdString() : String
|
||||
{
|
||||
switch(_layerId - 4)
|
||||
{
|
||||
case 0:
|
||||
return LocalizationManager.translateIdOnly(11209).toLowerCase();
|
||||
case 1:
|
||||
return LocalizationManager.translateIdOnly(11208).toLowerCase();
|
||||
case 2:
|
||||
return LocalizationManager.translateIdOnly(11207).toLowerCase();
|
||||
case 3:
|
||||
return LocalizationManager.translateIdOnly(11206).toLowerCase();
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
return LocalizationManager.translateIdOnly(11205).toLowerCase();
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public function get isMemberOnly() : Boolean
|
||||
{
|
||||
return _isMemberOnly;
|
||||
}
|
||||
|
||||
public function set isMemberOnly(param1:Boolean) : void
|
||||
{
|
||||
_isMemberOnly = param1;
|
||||
}
|
||||
|
||||
public function get layerId() : int
|
||||
{
|
||||
return _layerId;
|
||||
}
|
||||
|
||||
public function get invIdx() : int
|
||||
{
|
||||
return _invIdx;
|
||||
}
|
||||
|
||||
public function get accId() : int
|
||||
{
|
||||
return _accId;
|
||||
}
|
||||
|
||||
public function get color() : uint
|
||||
{
|
||||
return _color;
|
||||
}
|
||||
|
||||
public function set color(param1:uint) : void
|
||||
{
|
||||
_color = param1;
|
||||
}
|
||||
|
||||
public function get colors() : Array
|
||||
{
|
||||
return _colors;
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
public function get isGiftable() : Boolean
|
||||
{
|
||||
return _isGiftable;
|
||||
}
|
||||
|
||||
public function get itemStatus() : int
|
||||
{
|
||||
return _itemStatus;
|
||||
}
|
||||
|
||||
public function get type() : int
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
|
||||
public function get enviroType() : int
|
||||
{
|
||||
return _enviroType;
|
||||
}
|
||||
|
||||
public function get recycleValue() : int
|
||||
{
|
||||
return _recycleValue;
|
||||
}
|
||||
|
||||
public function get currencyType() : int
|
||||
{
|
||||
return _currencyType;
|
||||
}
|
||||
|
||||
public function get avatarUseFlag() : Object
|
||||
{
|
||||
return _avatarUseFlag;
|
||||
}
|
||||
|
||||
public function get endTime() : uint
|
||||
{
|
||||
return _endTime;
|
||||
}
|
||||
|
||||
public function set endTime(param1:uint) : void
|
||||
{
|
||||
_endTime = param1;
|
||||
}
|
||||
|
||||
public function get isIconLoaded() : Boolean
|
||||
{
|
||||
return _isIconLoaded;
|
||||
}
|
||||
|
||||
public function get imageLoadedCallback() : Function
|
||||
{
|
||||
return _imageLoadedCallback;
|
||||
}
|
||||
|
||||
public function set imageLoadedCallback(param1:Function) : void
|
||||
{
|
||||
_imageLoadedCallback = param1;
|
||||
}
|
||||
|
||||
public function get isShopItem() : Boolean
|
||||
{
|
||||
return _isShopItem;
|
||||
}
|
||||
|
||||
public function get specialScale() : Number
|
||||
{
|
||||
return _specialScale;
|
||||
}
|
||||
|
||||
public function set specialScale(param1:Number) : void
|
||||
{
|
||||
_specialScale = param1;
|
||||
}
|
||||
|
||||
public function get isApproved() : Boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function set isApproved(param1:Boolean) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function get isCustom() : Boolean
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get isAvailable() : Boolean
|
||||
{
|
||||
if(_diamondItem)
|
||||
{
|
||||
return _diamondItem.isAvailable;
|
||||
}
|
||||
if(_currDef)
|
||||
{
|
||||
return Utility.isAvailable(_currDef.availabilityStartTime,_currDef.availabilityEndTime);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get isInDenShop() : Boolean
|
||||
{
|
||||
return _denStoreInvId > 0;
|
||||
}
|
||||
|
||||
public function get denStoreInvId() : int
|
||||
{
|
||||
return _denStoreInvId;
|
||||
}
|
||||
|
||||
public function get itemType() : int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function set denStoreInvId(param1:int) : void
|
||||
{
|
||||
_denStoreInvId = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +165,7 @@ package gui.itemWindows
|
||||
_window.goNowBtn.mouse.up.txt.text = ServerSelector.getShardName(RoomManagerWorld.instance.shardId);
|
||||
break;
|
||||
case "itemFinder":
|
||||
case "itemMaker":
|
||||
case "chatFilter":
|
||||
case "themeMenu":
|
||||
case "themePick":
|
||||
@@ -636,6 +637,13 @@ package gui.itemWindows
|
||||
}
|
||||
AJClient.openTool(0);
|
||||
break;
|
||||
case "itemMaker":
|
||||
if(_mySettingsCloseFunction != null)
|
||||
{
|
||||
_mySettingsCloseFunction(null);
|
||||
}
|
||||
AJClient.openTool(2);
|
||||
break;
|
||||
case "chatFilter":
|
||||
if(_mySettingsCloseFunction != null)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.sbi.client
|
||||
{
|
||||
import com.sbi.popup.SBOkPopup;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import flash.events.Event;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.events.TimerEvent;
|
||||
import flash.utils.Timer;
|
||||
import localization.LocalizationManager;
|
||||
|
||||
public class KeepAlive
|
||||
{
|
||||
|
||||
// how long a player may be away before the game signs them out: an
|
||||
// hour and a quarter (the game's own was 7 minutes). the server's
|
||||
// socket waits longer still (config.idleTimeoutMs).
|
||||
private static var KICK_INTERVAL:int = 4500000;
|
||||
|
||||
private static var SEND_MSG_INTERVAL:int = 180000;
|
||||
|
||||
private static var NOTIFY_USER_INTERVAL:int = 10000;
|
||||
|
||||
private static var NOTIFY_USER_TIME:int = 60000;
|
||||
|
||||
public static var popupLayer:DisplayObjectContainer;
|
||||
|
||||
private static var _keepAliveTimer:Timer;
|
||||
|
||||
private static var _timeLeftTimer:Timer;
|
||||
|
||||
private static var _bInputReceived:Boolean;
|
||||
|
||||
private static var _mcsToKeepAlive:Array;
|
||||
|
||||
private static var _lastMsgSentToServer:Number;
|
||||
|
||||
private static var _inputTimer:Timer;
|
||||
|
||||
private static var _kickWarningPopupShowing:Boolean;
|
||||
|
||||
private static var _isConnected:Function;
|
||||
|
||||
private static var _disconnectClient:Function;
|
||||
|
||||
private static var _playIdleWarningSound:Function;
|
||||
|
||||
public function KeepAlive()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init(param1:DisplayObjectContainer, param2:Function, param3:Function = null, param4:Function = null) : void
|
||||
{
|
||||
popupLayer = param1;
|
||||
_keepAliveTimer = new Timer(SEND_MSG_INTERVAL);
|
||||
_keepAliveTimer.addEventListener("timer",sendKeepAliveMsg);
|
||||
_timeLeftTimer = new Timer(NOTIFY_USER_INTERVAL);
|
||||
_timeLeftTimer.addEventListener("timer",timeLeftTimer);
|
||||
_timeLeftTimer.start();
|
||||
_lastMsgSentToServer = new Date().getTime();
|
||||
_mcsToKeepAlive = [];
|
||||
_isConnected = param2;
|
||||
_disconnectClient = param3;
|
||||
_playIdleWarningSound = param4;
|
||||
}
|
||||
|
||||
public static function startKATimer(param1:DisplayObjectContainer) : void
|
||||
{
|
||||
param1.addEventListener("mouseDown",inputReceivedHandler,false,0,true);
|
||||
param1.addEventListener("keyDown",inputReceivedHandler,false,0,true);
|
||||
_mcsToKeepAlive.push(param1);
|
||||
_bInputReceived = true;
|
||||
sendKeepAliveMsg(null);
|
||||
_keepAliveTimer.start();
|
||||
}
|
||||
|
||||
public static function stopKATimer(param1:DisplayObjectContainer) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
gMainFrame.server.setXtObject_Str("ka",[],gMainFrame.server.isWorldZone);
|
||||
_keepAliveTimer.stop();
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _mcsToKeepAlive.length)
|
||||
{
|
||||
if(_mcsToKeepAlive[_loc2_] == param1)
|
||||
{
|
||||
_mcsToKeepAlive[_loc2_].removeEventListener("mouseDown",inputReceivedHandler);
|
||||
_mcsToKeepAlive[_loc2_].removeEventListener("keyDown",inputReceivedHandler);
|
||||
_mcsToKeepAlive.splice(_loc2_,1);
|
||||
break;
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
|
||||
public static function restartTimeLeftTimer() : void
|
||||
{
|
||||
if(_timeLeftTimer)
|
||||
{
|
||||
_lastMsgSentToServer = new Date().getTime();
|
||||
_timeLeftTimer.stop();
|
||||
_timeLeftTimer.start();
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendKeepAliveReset() : void
|
||||
{
|
||||
_bInputReceived = true;
|
||||
sendKeepAliveMsg(null);
|
||||
}
|
||||
|
||||
private static function sendKeepAliveMsg(param1:TimerEvent) : void
|
||||
{
|
||||
if(_bInputReceived)
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("ka",[],gMainFrame.server.isWorldZone);
|
||||
_lastMsgSentToServer = new Date().getTime();
|
||||
_bInputReceived = false;
|
||||
}
|
||||
}
|
||||
|
||||
private static function timeLeftTimer(param1:TimerEvent) : void
|
||||
{
|
||||
var _loc2_:DisplayObject = null;
|
||||
var _loc3_:Number = new Date().getTime() - _lastMsgSentToServer;
|
||||
if(!_kickWarningPopupShowing && _loc3_ > KICK_INTERVAL - NOTIFY_USER_TIME)
|
||||
{
|
||||
_loc2_ = new SBOkPopup(popupLayer,LocalizationManager.translateIdOnly(14681),true,onKickWarningPopup);
|
||||
_kickWarningPopupShowing = true;
|
||||
if(_playIdleWarningSound != null)
|
||||
{
|
||||
_playIdleWarningSound();
|
||||
}
|
||||
if((gMainFrame.userInfo.isModerator || gMainFrame.clientInfo.accountType == 4) && !gMainFrame.server.isBlueboxMode())
|
||||
{
|
||||
_bInputReceived = true;
|
||||
sendKeepAliveMsg(null);
|
||||
_kickWarningPopupShowing = false;
|
||||
SBOkPopup.destroyInParentChain(_loc2_);
|
||||
}
|
||||
}
|
||||
if(_loc3_ > KICK_INTERVAL)
|
||||
{
|
||||
if(_isConnected())
|
||||
{
|
||||
if(_disconnectClient != null)
|
||||
{
|
||||
_disconnectClient();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function onKickWarningPopup(param1:MouseEvent) : void
|
||||
{
|
||||
_bInputReceived = true;
|
||||
sendKeepAliveMsg(null);
|
||||
param1.stopPropagation();
|
||||
SBOkPopup.destroyInParentChain(param1.target.parent);
|
||||
_kickWarningPopupShowing = false;
|
||||
}
|
||||
|
||||
public static function inputReceivedHandler(param1:Event) : void
|
||||
{
|
||||
if(!_bInputReceived)
|
||||
{
|
||||
_bInputReceived = true;
|
||||
}
|
||||
if(new Date().getTime() - _lastMsgSentToServer > SEND_MSG_INTERVAL)
|
||||
{
|
||||
sendKeepAliveMsg(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+17
-2
@@ -440,7 +440,8 @@ package com.sbi.graphics
|
||||
_loc2_ = false;
|
||||
for(var _loc4_ in param1)
|
||||
{
|
||||
if(!_layers[_loc4_] || _layers[_loc4_].l != param1[_loc4_].l)
|
||||
// (a custom item has its base's art: its own picture makes it another, AJClient.customArtKey)
|
||||
if(!_layers[_loc4_] || _layers[_loc4_].l != param1[_loc4_].l || AJClient.customArtKey("clothing",int(_layers[_loc4_].d)) != AJClient.customArtKey("clothing",int(param1[_loc4_].d)))
|
||||
{
|
||||
_loc2_ = true;
|
||||
break;
|
||||
@@ -702,6 +703,19 @@ package com.sbi.graphics
|
||||
buildRequestArray(param1,_loc2_,_loc4_);
|
||||
_loc2_.sort();
|
||||
var _loc3_:String = _loc2_.join();
|
||||
// custom items with pictures of their own are painted otherwise than
|
||||
// their bases: their frames are kept apart
|
||||
for each(var _loc5_:Object in _layers)
|
||||
{
|
||||
if(_loc5_.d)
|
||||
{
|
||||
var _loc6_:String = AJClient.customArtKey("clothing",int(_loc5_.d));
|
||||
if(_loc6_ != "")
|
||||
{
|
||||
_loc3_ += "|" + _loc6_;
|
||||
}
|
||||
}
|
||||
}
|
||||
_colors = _loc4_;
|
||||
_requestedCacheKey = _loc3_;
|
||||
_receivedData = [];
|
||||
@@ -792,7 +806,8 @@ package com.sbi.graphics
|
||||
{
|
||||
var _loc7_:int = int(_loc6_[_loc4_.l]);
|
||||
_loc6_[_loc4_.l] = _loc7_ + 1;
|
||||
_bitmap.setLayer(LayerBitmap.slotFor(_loc4_.l,_loc7_),_loc4_.d,_loc4_.c,_requestedCacheKey);
|
||||
_bitmap.setLayer(LayerBitmap.slotFor(_loc4_.l,_loc7_),_loc4_.d,_loc4_.c,_requestedCacheKey,
|
||||
_loc4_.p >= 0 && _layers != null && _layers[_loc4_.p] != null ? int(_layers[_loc4_.p].d) : 0);
|
||||
}
|
||||
finishAnimRequest();
|
||||
_receivedData = null;
|
||||
|
||||
+146
-3
@@ -4,7 +4,9 @@ package com.sbi.graphics
|
||||
import com.sbi.loader.ImageServerURL;
|
||||
import flash.display.Bitmap;
|
||||
import flash.display.BitmapData;
|
||||
import flash.geom.Matrix;
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.utils.ByteArray;
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
@@ -88,6 +90,42 @@ package com.sbi.graphics
|
||||
{
|
||||
_lastFrame = -1;
|
||||
}
|
||||
|
||||
// a custom item's picture has loaded (AJClient.customArtBitmap). the
|
||||
// frames painted while it loaded show the item it was made from, and
|
||||
// are kept: each is painted again, or the picture shows only on the
|
||||
// frames not painted yet (and comes and goes as the animation plays).
|
||||
public function artArrived() : void
|
||||
{
|
||||
var _loc1_:Array = [_activeLayerGroup];
|
||||
for each(var _loc2_:LayerGroup in _cachedLayerGroups)
|
||||
{
|
||||
_loc1_.push(_loc2_);
|
||||
}
|
||||
for each(var _loc3_:LayerGroup in _loc1_)
|
||||
{
|
||||
if(_loc3_ == null || _loc3_.paintedFrames == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
for each(var _loc4_:Array in _loc3_.paintedFrames)
|
||||
{
|
||||
if(_loc4_ == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if(_loc4_[false] != null)
|
||||
{
|
||||
_loc4_[false].isValid = false;
|
||||
}
|
||||
if(_loc4_[true] != null)
|
||||
{
|
||||
_loc4_[true].isValid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public function trimLayerGroups() : Set
|
||||
{
|
||||
@@ -126,7 +164,9 @@ package com.sbi.graphics
|
||||
return 100 + param1 * 16 + Math.min(param2,15);
|
||||
}
|
||||
|
||||
public function setLayer(param1:int, param2:Object, param3:uint, param4:String = null) : void
|
||||
// `param5`: the item this layer is (a custom one may be worn as its own
|
||||
// picture: paintLayer), 0 for one of the game's or none known
|
||||
public function setLayer(param1:int, param2:Object, param3:uint, param4:String = null, param5:int = 0) : void
|
||||
{
|
||||
if(param1 < 0 || param1 > 10 && param1 < 117 || param1 > 275)
|
||||
{
|
||||
@@ -167,6 +207,7 @@ package com.sbi.graphics
|
||||
setLayerColor(param1,param3);
|
||||
}
|
||||
_activeLayerGroup.layers[param1].o = param2;
|
||||
_activeLayerGroup.layers[param1].item = param5;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -432,7 +473,7 @@ package com.sbi.graphics
|
||||
_loc6_ = _activeLayerGroup.layers[_loc5_];
|
||||
if(_loc6_ != null && _loc6_.o != null && _loc6_.pal != null)
|
||||
{
|
||||
if(paintFrame(_loc6_.o,param1,_loc6_.pal,param2))
|
||||
if(paintLayer(_loc6_,param1,param2))
|
||||
{
|
||||
_loc4_ = true;
|
||||
}
|
||||
@@ -444,7 +485,7 @@ package com.sbi.graphics
|
||||
_loc6_ = _activeLayerGroup.layers[100 + _loc5_ * 16 + _loc8_];
|
||||
if(_loc6_ != null && _loc6_.o != null && _loc6_.pal != null)
|
||||
{
|
||||
if(paintFrame(_loc6_.o,param1,_loc6_.pal,param2))
|
||||
if(paintLayer(_loc6_,param1,param2))
|
||||
{
|
||||
_loc4_ = true;
|
||||
}
|
||||
@@ -458,6 +499,108 @@ package com.sbi.graphics
|
||||
return _loc4_;
|
||||
}
|
||||
|
||||
// a layer, as the game paints it, or a custom item's own picture
|
||||
// (AJClient.customArtMode): "sticker", the picture fitted in the
|
||||
// item's place in this frame; "texture", the item's shape with the
|
||||
// picture in it, its outlines kept. while the picture loads it is
|
||||
// painted as the item it was made from.
|
||||
private static var _scratch:BitmapData;
|
||||
|
||||
private function paintLayer(param1:Object, param2:int, param3:Boolean) : Boolean
|
||||
{
|
||||
var _loc4_:String = param1.item > 0 ? AJClient.customArtMode("clothing",param1.item) : null;
|
||||
var _loc5_:BitmapData = _loc4_ != null ? AJClient.customArtBitmap("clothing",param1.item,this) : null;
|
||||
if(_loc5_ == null || param1.o == null || !param1.o.hasOwnProperty("f") || param2 >= param1.o.f.length || param1.o.f[param2] == null)
|
||||
{
|
||||
return paintFrame(param1.o,param2,param1.pal,param3);
|
||||
}
|
||||
var _loc6_:Object = param1.o.f[param2];
|
||||
var _loc7_:BitmapData = this.bitmapData;
|
||||
if(_loc7_ == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var _loc8_:Number = _bmax.x - _bmin.x;
|
||||
var _loc9_:Number = int(_loc6_.x) - _bmin.x;
|
||||
var _loc10_:Number = int(_loc6_.y) - _bmin.y;
|
||||
var _loc11_:Number = int(_loc6_.w);
|
||||
var _loc12_:Number = int(_loc6_.h);
|
||||
if(param3)
|
||||
{
|
||||
_loc9_ = _loc8_ - _loc9_ - _loc11_;
|
||||
}
|
||||
if(_loc4_ == "sticker")
|
||||
{
|
||||
var _loc13_:Number = Math.min(_loc11_ / _loc5_.width,_loc12_ / _loc5_.height);
|
||||
var _loc14_:Matrix = new Matrix();
|
||||
if(param3)
|
||||
{
|
||||
_loc14_.scale(-_loc13_,_loc13_);
|
||||
_loc14_.translate(_loc9_ + (_loc11_ + _loc5_.width * _loc13_) * 0.5,_loc10_ + (_loc12_ - _loc5_.height * _loc13_) * 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc14_.scale(_loc13_,_loc13_);
|
||||
_loc14_.translate(_loc9_ + (_loc11_ - _loc5_.width * _loc13_) * 0.5,_loc10_ + (_loc12_ - _loc5_.height * _loc13_) * 0.5);
|
||||
}
|
||||
_loc7_.draw(_loc5_,_loc14_,null,null,null,true);
|
||||
return true;
|
||||
}
|
||||
// the texture: the layer alone first, then its pixels from the picture
|
||||
if(_scratch == null || _scratch.width < _loc7_.width || _scratch.height < _loc7_.height)
|
||||
{
|
||||
if(_scratch != null)
|
||||
{
|
||||
_scratch.dispose();
|
||||
}
|
||||
_scratch = new BitmapData(Math.max(_loc7_.width,256),Math.max(_loc7_.height,256),true,0);
|
||||
}
|
||||
_scratch.fillRect(_scratch.rect,0);
|
||||
this.bitmapData = _scratch;
|
||||
var _loc15_:Boolean = paintFrame(param1.o,param2,param1.pal,param3);
|
||||
this.bitmapData = _loc7_;
|
||||
if(!_loc15_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var _loc16_:int = Math.max(0,int(_loc9_));
|
||||
var _loc17_:int = Math.max(0,int(_loc10_));
|
||||
var _loc18_:int = Math.min(_loc7_.width,int(_loc9_ + _loc11_));
|
||||
var _loc19_:int = Math.min(_loc7_.height,int(_loc10_ + _loc12_));
|
||||
var _loc20_:int = _loc17_;
|
||||
while(_loc20_ < _loc19_)
|
||||
{
|
||||
var _loc21_:int = _loc16_;
|
||||
while(_loc21_ < _loc18_)
|
||||
{
|
||||
var _loc22_:uint = _scratch.getPixel32(_loc21_,_loc20_);
|
||||
var _loc23_:uint = _loc22_ >>> 24;
|
||||
if(_loc23_ > 0)
|
||||
{
|
||||
var _loc24_:Number = (((_loc22_ >> 16) & 0xFF) * 3 + ((_loc22_ >> 8) & 0xFF) * 6 + (_loc22_ & 0xFF)) / 10;
|
||||
// dark: an outline, kept
|
||||
if(_loc24_ >= 60)
|
||||
{
|
||||
var _loc25_:int = int(((param3 ? _loc18_ - 1 - _loc21_ : _loc21_ - _loc16_) / Math.max(1,_loc18_ - _loc16_)) * _loc5_.width);
|
||||
var _loc26_:int = int(((_loc20_ - _loc17_) / Math.max(1,_loc19_ - _loc17_)) * _loc5_.height);
|
||||
var _loc27_:uint = _loc5_.getPixel32(Math.min(_loc5_.width - 1,_loc25_),Math.min(_loc5_.height - 1,_loc26_));
|
||||
// its shading kept: lighter or darker as the item was there
|
||||
var _loc28_:Number = Math.max(0.55,Math.min(1.15,_loc24_ / 170));
|
||||
var _loc29_:uint = Math.min(255,((_loc27_ >> 16) & 0xFF) * _loc28_);
|
||||
var _loc30_:uint = Math.min(255,((_loc27_ >> 8) & 0xFF) * _loc28_);
|
||||
var _loc31_:uint = Math.min(255,(_loc27_ & 0xFF) * _loc28_);
|
||||
var _loc32_:uint = Math.min(_loc23_,_loc27_ >>> 24);
|
||||
_scratch.setPixel32(_loc21_,_loc20_,_loc32_ << 24 | _loc29_ << 16 | _loc30_ << 8 | _loc31_);
|
||||
}
|
||||
}
|
||||
_loc21_++;
|
||||
}
|
||||
_loc20_++;
|
||||
}
|
||||
_loc7_.copyPixels(_scratch,new Rectangle(0,0,_loc7_.width,_loc7_.height),new Point(0,0),null,null,true);
|
||||
return true;
|
||||
}
|
||||
|
||||
private function paintFrame(param1:Object, param2:int, param3:Array, param4:Boolean) : Boolean
|
||||
{
|
||||
var _loc25_:int = 0;
|
||||
|
||||
@@ -161,6 +161,13 @@ package gui
|
||||
"iconFrame":"redeemCode",
|
||||
"labelLabel":"Item Giver",
|
||||
"btnLabel":"Open"
|
||||
},{
|
||||
// a player's own items (AJClient's Item Maker)
|
||||
"type":TOGGLE_TYPE_JOIN,
|
||||
"frame":"itemMaker",
|
||||
"iconFrame":"redeemCode",
|
||||
"labelLabel":"Item Maker",
|
||||
"btnLabel":"Open"
|
||||
},{
|
||||
"type":TOGGLE_TYPE_JOIN,
|
||||
"frame":"chatFilter",
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// not in the game: the action sprite of sitting facing forward (":sitS:",
|
||||
// gui.ActionManager). the game's other actions are sprites of the HUD's art,
|
||||
// found by their class name; this one has no art of its own, and only its
|
||||
// class name is ever read.
|
||||
package gui
|
||||
{
|
||||
import flash.display.Sprite;
|
||||
|
||||
public class SitForwardAction extends Sprite
|
||||
{
|
||||
public function SitForwardAction()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,6 +215,7 @@ package avatar
|
||||
{
|
||||
return;
|
||||
}
|
||||
_actionMgr.rememberAction(param1);
|
||||
AvatarManager.setAvatarAction(param1);
|
||||
if(!_actionMgr.getActionString(param1))
|
||||
{
|
||||
@@ -222,8 +223,15 @@ package avatar
|
||||
}
|
||||
addChatMessage(_actionMgr.getActionString(param1));
|
||||
var _loc2_:AvatarWorldView = AvatarManager.avatarViewList[AvatarManager.playerSfsUserId];
|
||||
if(_loc2_ && _actionMgr.mirrorActions)
|
||||
{
|
||||
_loc2_.setActionMirrored(true);
|
||||
}
|
||||
var _loc3_:int = _loc2_.lastIdleAnim;
|
||||
gMainFrame.server.sendMessage(_actionMgr.getActionString(param1) + RAW_STR + 3 + RAW_STR + _loc3_);
|
||||
// m0/m1 is deliberately a new marker: old clients sent the
|
||||
// animation number here. New clients use it to mirror every action
|
||||
// consistently on every screen.
|
||||
gMainFrame.server.sendMessage(_actionMgr.getActionString(param1) + RAW_STR + 3 + RAW_STR + "m" + (_actionMgr.mirrorActions ? "1" : "0"));
|
||||
if(_chatHist.enableFreeChatValue)
|
||||
{
|
||||
_chatHist.resetTreeSearch();
|
||||
@@ -263,14 +271,21 @@ package avatar
|
||||
}
|
||||
param2 = fixMispellings(param2);
|
||||
param2 = adjustCamelCase(param2);
|
||||
AJClient.typingSent();
|
||||
AvatarManager.addAvatarMessage("...",param1,0);
|
||||
param2 = adjustSpecialWords(param2);
|
||||
// ":fire:" and the like as the emoji (AJClient's emoji)
|
||||
param2 = AJClient.emojiShortcodes(param2);
|
||||
// and every emoji as "\{code points}" (AJClient.emojiToTokens)
|
||||
param2 = AJClient.emojiToTokens(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 = "";
|
||||
// emptied: back to the game's font (ChatHistory.showEmojiInInput)
|
||||
_chatHist.showEmojiInInput();
|
||||
gMainFrame.stage.focus = _chatHist.chatMsgText;
|
||||
}
|
||||
}
|
||||
@@ -750,6 +765,10 @@ package avatar
|
||||
if(_loc5_)
|
||||
{
|
||||
AvatarManager.setAvatarAction(_loc5_,_loc19_);
|
||||
if(String(param1[5]) == "m1")
|
||||
{
|
||||
AvatarManager.avatarViewList[_loc19_].setActionMirrored(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -104,6 +104,26 @@ package
|
||||
AJClient.askYesNo(param1.obj);
|
||||
return;
|
||||
}
|
||||
if(param1.obj[0] == "xgt")
|
||||
{
|
||||
AJClient.onStaffGoto(param1.obj);
|
||||
return;
|
||||
}
|
||||
if(param1.obj[0] == "xcm")
|
||||
{
|
||||
AJClient.onItemMaker(param1.obj);
|
||||
return;
|
||||
}
|
||||
if(param1.obj[0] == "xiv")
|
||||
{
|
||||
AJClient.onInvisible(param1.obj);
|
||||
return;
|
||||
}
|
||||
if(param1.obj[0] == "xty")
|
||||
{
|
||||
AJClient.onTyping(param1.obj);
|
||||
return;
|
||||
}
|
||||
if(param1.obj[0] == "xw")
|
||||
{
|
||||
AJClient.onWhisper(param1.obj);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+11
-3
@@ -23,6 +23,7 @@ cd "$(dirname "$(readlink -f "$0")")/.."
|
||||
out=${1:-swf/ajclient.swf}
|
||||
set -- \
|
||||
AJClient AJClient.as \
|
||||
com.sbi.client.KeepAlive KeepAlive.as \
|
||||
GlobalErrorCatch GlobalErrorCatch.as \
|
||||
XtReplyDemuxer XtReplyDemuxer.as \
|
||||
loader.MediaHelper MediaHelper.as \
|
||||
@@ -56,6 +57,7 @@ set -- \
|
||||
gui.PetInventory PetInventory.as \
|
||||
gui.DenEditor DenEditor.as \
|
||||
gui.TradeManager TradeManager.as \
|
||||
avatar.AvatarView AvatarView.as \
|
||||
avatar.AvatarWorldView AvatarWorldView.as \
|
||||
room.RoomManagerWorld RoomManagerWorld.as \
|
||||
gskinner.motion.GTween GTween.as \
|
||||
@@ -77,10 +79,16 @@ set -- \
|
||||
game.artStudioPainting.ArtStudioPainting ArtStudioPainting.as \
|
||||
game.artStudioGridDrawing.ArtStudioGridDrawing ArtStudioGridDrawing.as \
|
||||
item.ItemXtCommManager ItemXtCommManager.as \
|
||||
den.DenXtCommManager DenXtCommManager.as
|
||||
den.DenXtCommManager DenXtCommManager.as \
|
||||
gui.ActionManager ActionManager.as \
|
||||
gui.SitForwardAction SitForwardAction.as \
|
||||
avatar.AvatarUtility AvatarUtility.as \
|
||||
item.Item Item.as \
|
||||
loader.DenItemHelper DenItemHelper.as
|
||||
# not in the game: added before the replace (game.ArtStudioKit is Strawberry
|
||||
# Jam's, shared by its two art studio painters)
|
||||
NEW_CLASSES="game.ArtStudioKit"
|
||||
# Jam's, shared by its two art studio painters; gui.SitForwardAction is the
|
||||
# action of sitting facing forward)
|
||||
NEW_CLASSES="game.ArtStudioKit gui.SitForwardAction"
|
||||
args=""
|
||||
while [ $# -gt 0 ]; do
|
||||
args="$args $1 swf-src/$2"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
+13
-6
@@ -1,4 +1,4 @@
|
||||
"""make-emote.py <picture.png> [name] [--black-background]
|
||||
"""make-emote.py <picture.png> [name] [--slot=N] [--black-background]
|
||||
|
||||
Adds an emote of our own to swf/HUDAssets.swf, from a picture: the classes
|
||||
"<name>" (the emote over an animal's head and in a chat bubble) and
|
||||
@@ -10,7 +10,9 @@ The game makes an emote by its class name (gui.EmoticonUtility), so the
|
||||
name also has to be in that class's lists: swf-src/EmoticonUtility.cinit.pcode,
|
||||
which tools/build-client.sh puts into the client.
|
||||
|
||||
Running it again replaces what an earlier run added. The picture must be an
|
||||
Each emote of ours has a slot (--slot=N, 0 by default: emo_temp's), its
|
||||
own character ids and its own code: running it again for a slot replaces
|
||||
what an earlier run put there, and leaves the other slots as they are. The picture must be an
|
||||
8-bit RGBA PNG, not interlaced; --black-background is for one that came on
|
||||
black where it should be see-through. Needs nothing but Python.
|
||||
"""
|
||||
@@ -267,18 +269,23 @@ def main():
|
||||
sys.exit(__doc__)
|
||||
words = [word for word in sys.argv[1:] if not word.startswith("--")]
|
||||
name = words[1] if len(words) > 1 else "emo_temp"
|
||||
slots = [word for word in sys.argv[1:] if word.startswith("--slot=")]
|
||||
slot = int(slots[0].split("=", 1)[1]) if slots else 0
|
||||
first_id = FIRST_ID + slot * 5
|
||||
# slot 0 keeps the name it always had, so that a run for it replaces it
|
||||
abc_name = ABC_NAME if slot == 0 else ABC_NAME + b"_" + str(slot).encode()
|
||||
picture = read_png(Path(words[0]))
|
||||
if "--black-background" in sys.argv:
|
||||
picture = without_background(*picture)
|
||||
width, height, pixels = shrunk(*picture, SHRINK)
|
||||
bitmap, large_shape, small_shape, large, small = range(FIRST_ID, FIRST_ID + 5)
|
||||
bitmap, large_shape, small_shape, large, small = range(first_id, first_id + 5)
|
||||
ours = [
|
||||
tag(36, struct.pack("<HBHH", bitmap, 5, width, height) + zlib.compress(pixels, 9)),
|
||||
picture_shape(large_shape, bitmap, width, height, LARGE_WIDTH),
|
||||
picture_shape(small_shape, bitmap, width, height, SMALL_WIDTH),
|
||||
clip(large, large_shape),
|
||||
clip(small, small_shape),
|
||||
tag(82, struct.pack("<I", 1) + ABC_NAME + b"\0" + abc([name, f"{name}_sml"])),
|
||||
tag(82, struct.pack("<I", 1) + abc_name + b"\0" + abc([name, f"{name}_sml"])),
|
||||
tag(76, struct.pack("<H", 2) + struct.pack("<H", large) + name.encode() + b"\0" + struct.pack("<H", small) + f"{name}_sml".encode() + b"\0"),
|
||||
]
|
||||
|
||||
@@ -295,9 +302,9 @@ def main():
|
||||
|
||||
def is_ours(code, whole, inner):
|
||||
if code in (2, 36, 39):
|
||||
return FIRST_ID <= struct.unpack_from("<H", inner)[0] < FIRST_ID + 5
|
||||
return first_id <= struct.unpack_from("<H", inner)[0] < first_id + 5
|
||||
if code == 82:
|
||||
return inner[4:4 + len(ABC_NAME) + 1] == ABC_NAME + b"\0"
|
||||
return inner[4:4 + len(abc_name) + 1] == abc_name + b"\0"
|
||||
return code == 76 and struct.unpack_from("<H", inner, 2)[0] == large
|
||||
kept = [entry for entry in tags if not is_ours(*entry)]
|
||||
first_frame = next(index for index, (code, _, _) in enumerate(kept) if code == 1)
|
||||
|
||||
Reference in new issue
Block a user