feat(client): add staff tooling and resilient room UI

Deliver the in-game moderation and event overlays, theatre playback bridge, room-effect controls, staff shortcuts, friend-game prompts, and Windows emoji handling fixes.

Improve den editing with explicit front, behind, and natural stacking choices that persist without changing item position. Correct item display layers and custom artwork behavior, and make popup controls reliably closable.

Include performance-mode settings, animation and input safeguards, and rebuild ajclient.swf from the patched sources so the served client exactly matches the feature set.
This commit is contained in:
Snipzil committed 2026-10-19 10:10:11 -04:00
1 parent 5c9b2e0066
commit 8babe9cb39
20 files changed
+742 -11

No files matched your search

+50 -1
View File
@@ -10,8 +10,28 @@
margin: 0;
overflow: hidden;
}
#flash-content {
position: relative;
z-index: 1;
}
#theatre-video {
position: fixed;
z-index: 2;
display: none;
left: 8.4vw;
top: 6.2vh;
width: 56.8vw;
height: 52.8vh;
border: 0;
background: #000;
pointer-events: auto;
}
#theatre-video.visible {
display: block;
}
</style>
<embed id="flash-content"></embed>
<iframe id="theatre-video" title="Theatre video" allow="autoplay; encrypted-media" referrerpolicy="strict-origin-when-cross-origin"></iframe>
<script>
"use strict";
@@ -19,11 +39,15 @@
// same contract with the launcher (gui/gamePreload.js) and the SWF.
const flashContent = document.getElementById("flash-content");
const theatreVideo = document.getElementById("theatre-video");
// only a SWF from this server may call into this page. with "always"
// any SWF the game came to load, from anywhere, could: and this page
// is handed the player's login token.
flashContent.setAttribute("allowScriptAccess", "sameDomain");
flashContent.setAttribute("wmode", "window");
// The theatre's staff-controlled browser video must be able to appear
// over the SWF screen. "window" puts Flash above every HTML element;
// opaque keeps the normal game drawing while allowing that overlay.
flashContent.setAttribute("wmode", "opaque");
flashContent.style.width = "100vw";
flashContent.style.height = "100vh";
@@ -94,6 +118,31 @@
window.ipc.sendToHost("printImage", imageData);
}
// The server validates the id and decides who in the theatre gets this
// call. The page merely displays it over the theatre's screen area.
function ajTheatreVideo(videoId) {
const id = String(videoId || "");
if (!/^[A-Za-z0-9_-]{11}$/.test(id)) {
theatreVideo.removeAttribute("src");
theatreVideo.classList.remove("visible");
return;
}
theatreVideo.src = `https://www.youtube-nocookie.com/embed/${id}?autoplay=1&rel=0&modestbranding=1`;
theatreVideo.classList.add("visible");
}
// The native theatre sign calls this through ExternalInterface. The
// SWF performs its own permission check before showing the controls.
function ajOpenTheatreControl() {
if (flashContent && typeof flashContent.openTheatreControl === "function") {
try {
flashContent.openTheatreControl();
}
catch (err) {
}
}
}
function reloadSwfOrGetIP(reloadSwf, params) {
window.ipc.sendToHost("reloadGame", reloadSwf, params);
}
+364 -3
View File
@@ -127,6 +127,17 @@ package
private var _moderateButtons:Array;
// Staff-only YouTube control for the theatre. The video itself is a
// browser overlay, called through ExternalInterface below.
private var _theatreButton:Sprite;
private var _theatreControl:Sprite;
private var _theatreInput:TextField;
// Owner/developer room-effect controls, opened by !event or !host.
private var _roomControl:Sprite;
public static var staffRole:String = "";
public static var staffPermissions:Array = [];
@@ -164,6 +175,7 @@ package
if(ExternalInterface.available)
{
ExternalInterface.addCallback("ajHud",setHudShown);
ExternalInterface.addCallback("openTheatreControl",openTheatreControl);
}
}
catch(e:Error)
@@ -327,6 +339,7 @@ package
gMainFrame.stage.addEventListener("keyDown",onFinderKey,true,1000);
gMainFrame.stage.addEventListener("keyDown",onFinderKey,false,1000);
startEmojiButton();
placeTheatreButton();
}
public static function openTool(param1:int) : void
@@ -826,6 +839,278 @@ package
{
staffRole = String(param1[2]);
staffPermissions = String(param1[3]).length > 0 ? String(param1[3]).split(",") : [];
if(_toolsInstance != null)
{
_toolsInstance.placeTheatreButton();
}
}
// "xui": a permission-checked server command asks for a staff panel.
// It is never acted on merely because a browser or another player asks.
public static function onStaffUi(param1:Object) : void
{
if(_toolsInstance == null)
{
return;
}
var _loc1_:String = param1.length > 2 ? String(param1[2]) : "";
if(_loc1_ == "moderate" && param1.length > 3 && canModerate())
{
openModerate(String(param1[3]));
}
else if(_loc1_ == "event" && staffMay("room.effects"))
{
_toolsInstance.openRoomControl();
}
}
// "xtv": a server-authorized YouTube id for this theatre, or empty to
// stop it. The desktop game's web page owns the actual iframe.
public static function onTheatreVideo(param1:Object) : void
{
try
{
if(ExternalInterface.available)
{
ExternalInterface.call("ajTheatreVideo",param1.length > 2 ? String(param1[2]) : "");
}
}
catch(e:Error)
{
}
}
private function placeTheatreButton() : void
{
// Video playback belongs to the theatre's own VIDEOS sign. A HUD
// button existed in every room and den for staff, which was both
// misleading and able to cover other interfaces.
if(_theatreButton != null)
{
_theatreButton.visible = false;
}
}
private function onTheatreButton(param1:MouseEvent) : void
{
param1.stopPropagation();
if(_theatreControl == null)
{
buildTheatreControl();
}
_theatreControl.visible = !_theatreControl.visible;
if(_theatreControl.visible)
{
setChildIndex(_theatreControl,numChildren - 1);
gMainFrame.stage.focus = _theatreInput;
}
}
// Called by the theatre's VIDEOS sign through game.html. This needs to
// remain public for ExternalInterface, but permission is still derived
// from the signed-in server role, never from the browser call.
public function openTheatreControl() : void
{
if(!staffMay("theater.control"))
{
return;
}
if(_theatreControl == null)
{
buildTheatreControl();
}
_theatreControl.visible = true;
setChildIndex(_theatreControl,numChildren - 1);
gMainFrame.stage.focus = _theatreInput;
}
private function buildTheatreControl() : void
{
_theatreControl = new Sprite();
_theatreControl.graphics.beginFill(0,0.55);
_theatreControl.graphics.drawRect(0,0,900,550);
_theatreControl.graphics.endFill();
var _loc1_:Sprite = new Sprite();
_loc1_.x = 225;
_loc1_.y = 170;
_loc1_.graphics.lineStyle(2,0x7B4D24);
_loc1_.graphics.beginFill(0x27221D);
_loc1_.graphics.drawRoundRect(0,0,450,210,22,22);
_loc1_.graphics.endFill();
_theatreControl.addChild(_loc1_);
theatreCloseButton(_loc1_);
var _loc2_:TextField = modText("THEATRE VIDEO",22,0xFFFFFF);
_loc2_.x = 24;
_loc2_.y = 22;
_loc1_.addChild(_loc2_);
var _loc3_:TextField = modText("Paste a YouTube link. Everyone in this theatre will see it.",12,0xD5C5AE,false);
_loc3_.x = 24;
_loc3_.y = 58;
_loc1_.addChild(_loc3_);
var _loc4_:Sprite = new Sprite();
_loc4_.x = 24;
_loc4_.y = 94;
_loc4_.graphics.lineStyle(1,0x7B4D24);
_loc4_.graphics.beginFill(0x111111);
_loc4_.graphics.drawRoundRect(0,0,402,34,10,10);
_loc4_.graphics.endFill();
_loc1_.addChild(_loc4_);
_theatreInput = new TextField();
_theatreInput.type = "input";
_theatreInput.embedFonts = hasGameFont();
_theatreInput.defaultTextFormat = new TextFormat("CCDigitalDelivery",13,0xFFFFFF,false);
_theatreInput.maxChars = 200;
_theatreInput.x = 10;
_theatreInput.y = 7;
_theatreInput.width = 382;
_theatreInput.height = 22;
_loc4_.addChild(_theatreInput);
theatreControlButton(_loc1_,"play","Play for room",24,150,186,0x357A45);
theatreControlButton(_loc1_,"stop","Stop video",240,150,186,0x8E3D3D);
_theatreControl.addEventListener("mouseDown",onFinderMouse);
_theatreControl.addEventListener("mouseUp",onFinderMouse);
_theatreControl.addEventListener("click",onFinderMouse);
_theatreControl.visible = false;
addChild(_theatreControl);
}
private function theatreControlButton(param1:Sprite, param2:String, param3:String, param4:Number, param5:Number, param6:Number, param7:uint) : void
{
var _loc1_:Sprite = new Sprite();
_loc1_.name = param2;
_loc1_.x = param4;
_loc1_.y = param5;
_loc1_.buttonMode = true;
_loc1_.mouseChildren = false;
paintFlatButton(_loc1_,param6,param7);
var _loc2_:TextField = modText(param3,14,0xFFFFFF);
_loc2_.name = "label";
_loc1_.addChild(_loc2_);
paintFlatButton(_loc1_,param6,param7);
_loc1_.addEventListener("mouseDown",onTheatreControl,false,0,true);
param1.addChild(_loc1_);
}
private function onTheatreControl(param1:MouseEvent) : void
{
param1.stopPropagation();
var _loc1_:String = Sprite(param1.currentTarget).name;
if(_loc1 == "play" && _theatreInput.text.replace(/^\s+|\s+$/g,"").length == 0)
{
gMainFrame.stage.focus = _theatreInput;
return;
}
gMainFrame.server.setXtObject_Str("xtv",[_loc1,_loc1 == "play" ? _theatreInput.text.split("%").join("") : ""]);
_theatreControl.visible = false;
gMainFrame.stage.focus = null;
}
private function openRoomControl() : void
{
if(!staffMay("room.effects"))
{
return;
}
if(_roomControl == null)
{
buildRoomControl();
}
_roomControl.visible = true;
setChildIndex(_roomControl,numChildren - 1);
}
private function buildRoomControl() : void
{
_roomControl = new Sprite();
_roomControl.graphics.beginFill(0,0.55);
_roomControl.graphics.drawRect(0,0,900,550);
_roomControl.graphics.endFill();
var _loc1_:Sprite = new Sprite();
_loc1_.x = 225;
_loc1_.y = 150;
_loc1_.graphics.lineStyle(2,0x7B4D24);
_loc1_.graphics.beginFill(0x27221D);
_loc1_.graphics.drawRoundRect(0,0,450,250,22,22);
_loc1_.graphics.endFill();
_roomControl.addChild(_loc1_);
theatreCloseButton(_loc1_);
var _loc2_:TextField = modText("HOST / EVENT CONTROLS",22,0xFFFFFF);
_loc2_.x = 24;
_loc2_.y = 22;
_loc1_.addChild(_loc2_);
var _loc3_:TextField = modText("Change the whole room. Clear resets size and colour.",12,0xD5C5AE,false);
_loc3_.x = 24;
_loc3_.y = 58;
_loc1_.addChild(_loc3_);
roomControlButton(_loc1_,"small","Make everyone small",24,98,126,0x357A45);
roomControlButton(_loc1_,"normal","Normal size",162,98,126,0x496B91);
roomControlButton(_loc1_,"big","Make everyone big",300,98,126,0x7A5FBD);
roomControlButton(_loc1_,"rainbow","Rainbow room",24,150,196,0xA54E96);
roomControlButton(_loc1_,"clear","Clear effects",230,150,196,0x8E3D3D);
_roomControl.addEventListener("mouseDown",onFinderMouse);
_roomControl.addEventListener("mouseUp",onFinderMouse);
_roomControl.addEventListener("click",onFinderMouse);
_roomControl.visible = false;
addChild(_roomControl);
}
private function roomControlButton(param1:Sprite, param2:String, param3:String, param4:Number, param5:Number, param6:Number, param7:uint) : void
{
var _loc1_:Sprite = new Sprite();
_loc1_.name = param2;
_loc1_.x = param4;
_loc1_.y = param5;
_loc1_.buttonMode = true;
_loc1_.useHandCursor = true;
_loc1_.mouseChildren = false;
var _loc2_:TextField = modText(param3,12,0xFFFFFF);
_loc2_.name = "label";
_loc1_.addChild(_loc2_);
paintFlatButton(_loc1_,param6,param7);
_loc1_.addEventListener("mouseDown",onRoomControl,false,0,true);
param1.addChild(_loc1_);
}
private function onRoomControl(param1:MouseEvent) : void
{
param1.stopPropagation();
gMainFrame.server.setXtObject_Str("xrc",[Sprite(param1.currentTarget).name]);
_roomControl.visible = false;
}
// A visible close control is reliable even while an input field owns
// keyboard focus, unlike relying only on Escape.
private function theatreCloseButton(param1:Sprite) : void
{
var _loc1_:Sprite = new Sprite();
_loc1_.buttonMode = true;
_loc1_.useHandCursor = true;
_loc1_.graphics.beginFill(MOD_GREY);
_loc1_.graphics.drawCircle(0,0,13);
_loc1_.graphics.endFill();
_loc1_.graphics.lineStyle(2,0xFFFFFF);
_loc1_.graphics.moveTo(-4,-4);
_loc1_.graphics.lineTo(4,4);
_loc1_.graphics.moveTo(4,-4);
_loc1_.graphics.lineTo(-4,4);
_loc1_.x = 422;
_loc1_.y = 25;
_loc1_.addEventListener("mouseDown",onTheatreClose,false,0,true);
param1.addChild(_loc1_);
}
private function onTheatreClose(param1:MouseEvent) : void
{
param1.stopPropagation();
if(_theatreControl != null)
{
_theatreControl.visible = false;
}
if(_roomControl != null)
{
_roomControl.visible = false;
}
gMainFrame.stage.focus = null;
}
public static function staffMay(param1:String) : Boolean
@@ -1254,6 +1539,9 @@ package
// the 120 and 144 this once offered came to the same).
// 9005 Camera: 1 Smooth (room.RoomManagerWorld.easeCamera), else the
// game's own.
// 9007 Performance profile: 1 Low-end, 2 High, unset Balanced. A
// profile changes only optional rendering work, never the
// game's native 24 FPS (which would slow its animations).
private static var _smoothTimer:Timer;
@@ -1277,12 +1565,45 @@ package
public static function smoothOn() : Boolean
{
if(performanceProfile() == 1)
{
return false;
}
if(performanceProfile() == 2)
{
return true;
}
return settingOf(9003) != 1;
}
// 0 Balanced, 1 Low-end, 2 High. It is persisted with the other client
// settings, so the preference follows the player to another computer.
public static function performanceProfile() : int
{
var _loc1_:int = settingOf(9007);
return _loc1_ == 1 || _loc1_ == 2 ? _loc1_ : 0;
}
public static function performanceProfileLabel() : String
{
switch(performanceProfile())
{
case 1:
return "Low-end";
case 2:
return "High";
default:
return "Balanced";
}
}
// pictures a second asked for, or 0 for no limit.
public static function frameRate() : int
{
if(performanceProfile() == 2)
{
return 0;
}
return settingOf(9004) == 1 ? 60 : 0;
}
@@ -1330,7 +1651,9 @@ package
}
try
{
_loc2_ = !_smoothBroken && MainFrame.isInitialized() && gMainFrame.userInfo != null && gMainFrame.userInfo.userVarCache != null && AvatarManager.playerAvatarWorldView != null && !MinigameManager.inMinigame() && smoothOn();
// Extra interpolation cannot be seen below a modal. The world map
// is a modal without DarkenManager, so include it here too.
_loc2_ = !_smoothBroken && MainFrame.isInitialized() && gMainFrame.userInfo != null && gMainFrame.userInfo.userVarCache != null && AvatarManager.playerAvatarWorldView != null && !MinigameManager.inMinigame() && !GuiManager.isModal() && smoothOn();
}
catch(e:Error)
{
@@ -1370,6 +1693,20 @@ package
gMainFrame.stage.quality = gMainFrame.currStageQuality != null ? gMainFrame.currStageQuality : "medium";
}
}
// Low-end uses Flash's lower-quality renderer but keeps the original
// game framerate, so movement and frame-based animations do not run
// in slow motion. Restore the game's normal renderer on exit.
if(performanceProfile() == 1)
{
if(gMainFrame.stage.quality != "LOW")
{
gMainFrame.stage.quality = "low";
}
}
else if(!_smoothQuality && gMainFrame.stage.quality == "LOW")
{
gMainFrame.stage.quality = gMainFrame.currStageQuality != null ? gMainFrame.currStageQuality : "medium";
}
}
// between two frames: every animal that is walking goes on by the
@@ -2426,7 +2763,7 @@ package
// the window's look: flat, dark, rounded, in the game's font.
private static const MOD_W:int = 560;
private static const MOD_H:int = 432;
private static const MOD_H:int = 486;
private static const MOD_PAD:int = 24;
@@ -2624,6 +2961,8 @@ package
modButton("warnings","Warnings",_loc2_[0],372,_loc1_,MOD_GREY,"player.warn");
modButton("unwarn","Undo warning",_loc2_[1],372,_loc1_,MOD_GREY,"player.warn");
modButton("invisible","Go invisible",_loc2_[2],372,_loc1_,MOD_GREY,"staff.invisible");
modSection("Name",422);
modButton("reject","Reject username",_loc2_[0],440,_loc1_,MOD_RED,"player.names");
_moderate.addEventListener("mouseDown",onFinderMouse);
_moderate.addEventListener("mouseUp",onFinderMouse);
_moderate.addEventListener("click",onFinderMouse);
@@ -3437,7 +3776,10 @@ package
_emojiButton.addEventListener("mouseDown",onEmojiButton);
addChild(_emojiButton);
}
var _loc5_:Boolean = shownOnStage(_loc2_) && _loc2_.type == "input";
// The chat field remains technically visible under darkened game
// windows (inventory, trading, shops, etc.). Do not leave the
// emoji button or its grid sitting above those interfaces.
var _loc5_:Boolean = shownOnStage(_loc2_) && _loc2_.type == "input" && !DarkenManager.isDarkened && !GuiManager.isModal();
_emojiButton.visible = _loc5_;
if(!_loc5_)
{
@@ -4227,6 +4569,25 @@ package
param1.stopImmediatePropagation();
return;
}
if(_theatreControl != null && _theatreControl.visible)
{
if(param1.keyCode == 27)
{
_theatreControl.visible = false;
gMainFrame.stage.focus = null;
}
param1.stopImmediatePropagation();
return;
}
if(_roomControl != null && _roomControl.visible)
{
if(param1.keyCode == 27)
{
_roomControl.visible = false;
}
param1.stopImmediatePropagation();
return;
}
// the rules: Esc closes them as their X does
if(_rulesWin != null && _rulesWin.visible)
{
+14
View File
@@ -2,6 +2,7 @@ package gui
{
import avatar.Avatar;
import avatar.AvatarManager;
import avatar.UserCommXtCommManager;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.MouseEvent;
@@ -699,6 +700,19 @@ package gui
{
var _loc2_:WorldPet = null;
param1.stopPropagation();
// Outside a play-as-your-pet event this button is the personal
// pet-form switch. The server echoes the change to everybody in
// the room, so this is not merely a local visual effect.
if(!GuiManager.isBeYourPetRoom())
{
if(AvatarManager.playerAvatarWorldView && AvatarManager.playerAvatarWorldView.getActivePet())
{
UserCommXtCommManager.sendPetPlayerMode(!GuiManager.isPlayingAsPet());
}
actionBtn.dispatchEvent(new MouseEvent("mouseDown"));
param1.currentTarget.downToUpState();
return;
}
if(AvatarManager.playerAvatarWorldView)
{
_loc2_ = AvatarManager.playerAvatarWorldView.getActivePet();
+30 -1
View File
@@ -605,7 +605,7 @@ package avatar
_hudViewHolder.mouse.gotoAndStop(offScreenDefaultMouseFrameLabel());
}
}
_shouldShowPetOnly = GuiManager.isBeYourPetRoom();
_shouldShowPetOnly = GuiManager.isBeYourPetRoom() || userId == AvatarManager.playerSfsUserId && GuiManager.isPlayingAsPet();
if(_shouldShowPetOnly)
{
_layerAnim.alpha = 0;
@@ -2079,6 +2079,7 @@ package avatar
if(param2 != 0 && PetManager.canCurrAvatarUsePet(_avatar.enviroTypeFlag,PetManager.getPetDef(param2 & 0xFF),param1))
{
_pet = new WorldPet(this,param1,param2,param3,param4,param6,param8,param7,param9);
_currPetName = LocalizationManager.translatePetName(param5);
}
if(_shouldShowPetOnly)
{
@@ -2095,6 +2096,34 @@ package avatar
}
}
}
// Called from the type-13 user communication message. Unlike the
// party/quest form this belongs to one avatar, so each view keeps its
// own state instead of asking the room-wide GuiManager predicate.
public function setPetPlayerMode(param1:Boolean) : void
{
var _loc2_:Boolean = param1 && _pet != null;
_shouldShowPetOnly = _loc2_ || GuiManager.isBeYourPetRoom();
_layerAnim.alpha = _shouldShowPetOnly ? 0 : 1;
_layerAnim.avatarEnabled = !_shouldShowPetOnly;
if(_shouldShowPetOnly && _pet)
{
if(!isActivePetGroundPet())
{
_splash.showShadow(false);
}
_namebar.setAvName(_currPetName);
}
else
{
_splash.showShadow(true);
_namebar.setAvName(_avatar.avName);
}
if(userId == AvatarManager.playerSfsUserId)
{
GuiManager.setPersonalPetMode(_loc2_);
}
}
public function getActivePet() : WorldPet
{
+3 -1
View File
@@ -71,7 +71,9 @@ package gui
// 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 = " ";
// Three spaces fit the line-height-sized emoji without the noticeably
// wide hole four spaces left between neighbouring words or emoji.
private static const INLINE_GAP:String = " ";
private static const LONGEST_EMOTE_CODE:int = 16;
+6 -1
View File
@@ -870,7 +870,12 @@ package gui
{
_inputFormat = chatMsgText.defaultTextFormat;
_inputEmbedded = chatMsgText.embedFonts;
_loc4_ = new TextFormat("Segoe UI Emoji",_inputFormat.size,_inputFormat.color,_inputFormat.bold);
// Keep ordinary letters and spaces in their normal Windows face;
// it falls back to Segoe UI Emoji only for the emoji glyphs.
// The emoji-only face widened mixed text and made spacing uneven.
_loc4_ = new TextFormat("Segoe UI",_inputFormat.size,_inputFormat.color,_inputFormat.bold);
_loc4_.letterSpacing = _inputFormat.letterSpacing;
_loc4_.leading = _inputFormat.leading;
chatMsgText.embedFonts = false;
chatMsgText.defaultTextFormat = _loc4_;
chatMsgText.setTextFormat(_loc4_);
+77
View File
@@ -15,10 +15,13 @@ package gui
import den.DenStateItem;
import den.DenXtCommManager;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.geom.Point;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.utils.Timer;
import gui.itemWindows.ItemWindowOriginal;
import localization.LocalizationManager;
@@ -139,6 +142,8 @@ package gui
private var _privacyId:int;
private var _itemSetEvent:DenItemHolderEvent;
private var _layerControls:Sprite;
public function DenEditor()
{
@@ -157,6 +162,7 @@ package gui
_roomMgr = RoomManagerWorld.instance;
_denItemHolder = _roomMgr.denItemHolder;
_guiLayer.addChild(_denEditor);
createLayerControls();
initAssetVisibility();
setupPlayerItems();
DenXtCommManager.denEditorDIResponseCallback = diResponseCallback;
@@ -170,6 +176,7 @@ package gui
_denItemHolder.removeEventListener("OnItemRemoved",onDenItemRemoved);
_denItemHolder.removeEventListener("OnSaveState",onDenSaveState);
removeListeners();
destroyLayerControls();
_guiLayer.removeChild(_denEditor);
if(_denLockPopup)
{
@@ -1195,6 +1202,76 @@ package gui
var _loc3_:DenStateItem = new DenStateItem(param1.defId,param1.invIdx,param1.defId << 16 | _loc2_,0,0,param1.version,param1.version2,param1.version3,0,_loc2_,param1.refId,param1.sortId,param1.minigameDefId,param1.layerId,param1.enviroType,param1.strmName,0,"",param1.specialType,param1.listId,param1.uniqueImageId,param1.uniqueImageCreator,param1.uniqueImageCreatorDbId,param1.uniqueImageCreatorUUID,false,null,0,0,param1.petItem,param1.mannequinData,param1.ecoConsumerStateId);
_roomMgr.spawnNewDenItem(_loc3_);
}
// Small controls added at runtime so every den item can be stacked
// deliberately, instead of relying solely on where its feet land.
private function createLayerControls() : void
{
_layerControls = new Sprite();
_layerControls.x = _denEditor.width - 258;
_layerControls.y = 12;
_layerControls.addChild(makeLayerLabel("Selected item layer",0,0,230,22,13,16774041));
addLayerButton("Send behind",0,onSendBehind);
addLayerButton("Bring on top",116,onBringOnTop);
addLayerButton("Use natural depth",0,onResetLayer,62,230,30);
_denEditor.addChild(_layerControls);
}
private function addLayerButton(param1:String, param2:Number, param3:Function, param4:Number = 26, param5:Number = 110, param6:Number = 30) : void
{
var _loc6_:Sprite = new Sprite();
_loc6_.x = param2;
_loc6_.y = param4;
_loc6_.buttonMode = true;
_loc6_.mouseChildren = false;
_loc6_.graphics.beginFill(5986842,0.96);
_loc6_.graphics.drawRoundRect(0,0,param5,param6,8,8);
_loc6_.graphics.endFill();
_loc6_.addChild(makeLayerLabel(param1,0,5,param5,param6 - 5,12,16777215));
_loc6_.addEventListener("mouseDown",param3,false,0,true);
_layerControls.addChild(_loc6_);
}
private function makeLayerLabel(param1:String, param2:Number, param3:Number, param4:Number, param5:Number, param6:int, param7:uint) : TextField
{
var _loc8_:TextField = new TextField();
_loc8_.x = param2;
_loc8_.y = param3;
_loc8_.width = param4;
_loc8_.height = param5;
_loc8_.selectable = false;
_loc8_.mouseEnabled = false;
_loc8_.defaultTextFormat = new TextFormat("Arial",param6,param7,true,null,null,null,null,"center");
_loc8_.text = param1;
return _loc8_;
}
private function onSendBehind(param1:MouseEvent) : void
{
param1.stopImmediatePropagation();
_denItemHolder.sendSelectedBehind();
}
private function onBringOnTop(param1:MouseEvent) : void
{
param1.stopImmediatePropagation();
_denItemHolder.bringSelectedToFront();
}
private function onResetLayer(param1:MouseEvent) : void
{
param1.stopImmediatePropagation();
_denItemHolder.resetSelectedStacking();
}
private function destroyLayerControls() : void
{
if(_layerControls && _layerControls.parent)
{
_layerControls.parent.removeChild(_layerControls);
}
_layerControls = null;
}
private function onClose(param1:MouseEvent) : void
{
+16
View File
@@ -96,6 +96,22 @@ package loader
public function get sortOffset() : int
{
// The low two flip bits are used by the original client. Den editing
// also uses bits 2-3 as an explicit stacking choice: 1 = behind and
// 2 = in front. A very large offset lets that choice win over the
// normal y-position depth sort without visibly moving the item.
if(_denStateItem != null)
{
var _loc1_:int = _denStateItem.flipped >> 2 & 3;
if(_loc1_ == 1)
{
return _sortOffset + 1000000;
}
if(_loc1_ == 2)
{
return _sortOffset - 1000000;
}
}
return _sortOffset;
}
+6 -1
View File
@@ -690,6 +690,7 @@ package gui
var _loc5_:String = null;
var _loc4_:Array = null;
var _loc3_:Object = null;
var _loc9_:Object = null;
var _loc6_:ECard = _inbox[_currCardIdx];
if(_loc6_)
{
@@ -709,8 +710,12 @@ package gui
});
break;
}
// A card records the historical layer id. Prefer the
// attached item's current accId when it is available,
// so items with shared or changed layers draw correctly.
_loc9_ = ItemXtCommManager.getItemDef(giftItemDefId(_loc6_));
_clothingIconHelper = new SimpleIcon();
_clothingIconHelper.init(_loc6_.giftColor,_loc6_.giftId,1,true,false,clothingIconReceived);
_clothingIconHelper.init(_loc6_.giftColor,_loc9_ ? _loc9_.accId : _loc6_.giftId,1,true,false,clothingIconReceived);
break;
case 3:
case 99:
+22
View File
@@ -180,6 +180,10 @@ package gui
private static var _imageDisplayPopup:ImageDisplayPopup;
private static var _petInventory:PetInventory;
// A player's voluntary pet form. Party and quest pet forms remain
// room-wide and are still reported by isBeYourPetRoom().
private static var _personalPetMode:Boolean = false;
private static var _joeyPopup:MovieClip;
@@ -2906,6 +2910,24 @@ package gui
{
return QuestManager.isBeYourPetQuest() || PartyManager.isBeYourPetParty();
}
public static function isPlayingAsPet() : Boolean
{
return _personalPetMode || isBeYourPetRoom();
}
public static function setPersonalPetMode(param1:Boolean) : void
{
if(_personalPetMode == param1)
{
return;
}
_personalPetMode = param1;
if(mainHud)
{
showHudAvt();
}
}
public static function addQuestXP(param1:Number) : void
{
+18
View File
@@ -191,6 +191,9 @@ package gui.itemWindows
case "wasd":
showWasd();
break;
case "performance":
showPerformance();
break;
case "graphics":
showGraphics();
break;
@@ -416,6 +419,18 @@ package gui.itemWindows
{
showChoice("Graphics",AJClient.smoothOn() ? "Smooth" : "Default");
}
private function showPerformance() : void
{
showChoice("Performance",AJClient.performanceProfileLabel());
}
private function nextPerformance() : void
{
var _loc1_:int = AJClient.performanceProfile();
setChoice(9007,_loc1_ == 0 ? 1 : (_loc1_ == 1 ? 2 : 0));
showPerformance();
}
private function showFrameRate() : void
{
@@ -715,6 +730,9 @@ package gui.itemWindows
case "wasd":
setWasd(!AJClient.wasdOn());
break;
case "performance":
nextPerformance();
break;
case "graphics":
setChoice(9003,AJClient.smoothOn() ? 1 : 2);
showGraphics();
+4
View File
@@ -204,6 +204,10 @@ package gui
"type":TOGGLE_TYPE_JOIN,
"frame":"wasd",
"iconFrame":"world"
},{
"type":TOGGLE_TYPE_JOIN,
"frame":"performance",
"iconFrame":"world"
},{
"type":TOGGLE_TYPE_JOIN,
"frame":"graphics",
+36
View File
@@ -151,6 +151,7 @@ package room
gMainFrame.stage.removeEventListener("deactivate",onDeactivate);
gMainFrame.stage.removeEventListener("keyDown",onKeyDownEvt);
gMainFrame.stage.removeEventListener("keyUp",onKeyUpEvt);
removeAndClearMiniMap();
}
override public function exitRoom(param1:Boolean = false) : void
@@ -380,6 +381,11 @@ package room
public function removeAndClearMiniMap() : void
{
var _loc1_:MovieClip = null;
for each(_loc1_ in _miniMaps)
{
disposeMiniMap(_loc1_);
}
if(_miniMap && _miniMap.parent)
{
_miniMap.parent.removeChild(_miniMap);
@@ -387,6 +393,36 @@ package room
_miniMap = null;
_miniMaps = new Dictionary();
}
// The minimap grid and trail are BitmapData made for this room. Flash
// may keep their native allocations after the display clips are dropped,
// particularly after visiting many rooms, so release only those buffers
// when the cache is intentionally cleared.
private function disposeMiniMap(param1:MovieClip) : void
{
var _loc1_:Bitmap = null;
try
{
if(param1 != null && param1.numChildren > 1)
{
_loc1_ = param1.getChildAt(1) as Bitmap;
if(_loc1_ != null && _loc1_.bitmapData != null)
{
_loc1_.bitmapData.dispose();
_loc1_.bitmapData = null;
}
}
_loc1_ = param1 != null && param1.overlay is Bitmap ? Bitmap(param1.overlay) : null;
if(_loc1_ != null && _loc1_.bitmapData != null)
{
_loc1_.bitmapData.dispose();
_loc1_.bitmapData = null;
}
}
catch(e:Error)
{
}
}
public function removeMiniMap() : void
{
+20 -1
View File
@@ -2526,7 +2526,26 @@ package room
}
_theaterLayer = _scene.getLayer("movie_player_streaming");
}
GenericListGuiManager.genericListVolumeClicked(_loc5_.typeDefId,_loc9_);
// The stock theatre asks the server for a legacy FLV
// playlist, which this server intentionally does not
// fabricate for arbitrary web URLs. Let the VIDEOS
// sign open the staff YouTube control instead; its SWF
// callback verifies the staff permission.
if(_loc4_.typeId == 1037 && ExternalInterface.available)
{
try
{
ExternalInterface.call("ajOpenTheatreControl");
}
catch(e:Error)
{
GenericListGuiManager.genericListVolumeClicked(_loc5_.typeDefId,_loc9_);
}
}
else
{
GenericListGuiManager.genericListVolumeClicked(_loc5_.typeDefId,_loc9_);
}
}
break;
case 13:
+5 -1
View File
@@ -1103,7 +1103,11 @@ package gui
var _loc4_:int = int(param1[2]);
if(_loc4_ == 0)
{
if(isCurrentlyTrading || gMainFrame.clientInfo.extCallsActive)
// The desktop client keeps extCallsActive set while its host is
// available. It is not an indication that this player has a
// modal dialog open; treating it as one made every incoming
// trade request look like a busy response.
if(isCurrentlyTrading)
{
TradeXtCommManager.sendTradeItemAcceptOrReject(2);
}
+25
View File
@@ -523,6 +523,13 @@ package avatar
_customPVPPassback = param4;
gMainFrame.server.sendMessage((param1 ? "on" : "off") + RAW_STR + 12 + RAW_STR + param2);
}
// A per-player counterpart to the party's room-wide pet form. The
// server relays this as a normal user-communication message (type 13).
public static function sendPetPlayerMode(param1:Boolean) : void
{
gMainFrame.server.sendMessage((param1 ? "on" : "off") + RAW_STR + 13);
}
public static function onSendMessage(param1:MouseEvent, param2:String = "") : void
{
@@ -714,6 +721,13 @@ package avatar
_customPVPMessageCallback = null;
}
}
else if(_loc20_ == 13)
{
if(AvatarManager.avatarViewList[_loc19_])
{
AvatarManager.avatarViewList[_loc19_].setPetPlayerMode(_loc2_ == "on");
}
}
else
{
_loc2_ = param1[3];
@@ -786,6 +800,17 @@ package avatar
case 10:
AvatarManager._setAvatarAlphaLevel(_loc19_,uint(param1[3]));
return;
// Server room effects: a temporary display-only scale.
// Kept here (rather than in avatar state) so it never
// becomes part of an animal's saved appearance.
case 14:
_loc3_ = Math.max(0.5,Math.min(1.5,Number(param1[3])));
if(AvatarManager.avatarViewList[_loc19_])
{
AvatarManager.avatarViewList[_loc19_].scaleX = _loc3_;
AvatarManager.avatarViewList[_loc19_].scaleY = _loc3_;
}
return;
default:
_loc14_ = true;
}
+10
View File
@@ -89,6 +89,16 @@ package
AJClient.onStaff(param1.obj);
return;
}
if(param1.obj[0] == "xtv")
{
AJClient.onTheatreVideo(param1.obj);
return;
}
if(param1.obj[0] == "xui")
{
AJClient.onStaffUi(param1.obj);
return;
}
if(param1.obj[0] == "xdi")
{
AJClient.onItemDefs(param1.obj);
BIN
View File
Binary file not shown.
+2 -1
View File
@@ -92,7 +92,8 @@ set -- \
gui.SitForwardAction SitForwardAction.as \
avatar.AvatarUtility AvatarUtility.as \
item.Item Item.as \
loader.DenItemHelper DenItemHelper.as
loader.DenItemHelper DenItemHelper.as \
room.DenItemHolder ../tools/decompiled/room/DenItemHolder.as
# not in the game: added before the replace (game.ArtStudioKit is Strawberry
# Jam's, shared by its two art studio painters; gui.SitForwardAction is the
# action of sitting facing forward)
+34
View File
@@ -148,6 +148,40 @@ package room
{
return _dragItem != null;
}
// The original editor only sorted furniture from its y position. These
// helpers give the replacement editor an explicit, persisted choice.
// Bits 2-3 of `flipped` are unused by the game's flip code, so the
// normal horizontal/vertical flip bits remain intact in bits 0-1.
public function sendSelectedBehind() : Boolean
{
return setSelectedStacking(1);
}
public function bringSelectedToFront() : Boolean
{
return setSelectedStacking(2);
}
public function resetSelectedStacking() : Boolean
{
return setSelectedStacking(0);
}
private function setSelectedStacking(param1:int) : Boolean
{
if(_dragItem == null || _dragItem.layerId == 1 || isTheme(_dragItem.sortCatId) || _dragItem.sortCatId == 4)
{
return false;
}
_dragItem.flipped = _dragItem.flipped & -13 | param1 << 2;
if(_dragItem.denItemHelper && _dragItem.denItemHelper.displayObject)
{
_dragItem.denItemHelper.displayObject.name = String(_dragItem.denItemHelper.sortOffset);
}
saveState(_dragItem.invIdx);
return true;
}
public function get lastSelectedItem() : DenStateItem
{