mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
fix: settings, chat, video spots and other bugs from the owner's list
- Jam-A-Gram privacy: the inbox's options were taken the wrong way round - report window: no instruction text over the reason - the museum's theatre and other unnamed rooms get names; every shop a title - "How did you hear?" is never offered (its window soft locked the game) - video spots with nothing to play open a "Your Video" box on the game page; the trade list's help plays a video; the theatre's box no longer vanishes - emotes, actions and phrases are limited per player, as typed chat is - phrases from the menus come in the sender's chat bubble style - settings: WASD, blocked players and custom items as two-sided switches, graphics at their best by default, a switch for bubble animations, and Manage Account beside two-step sign-in opens the account page - pressing a @mention in a bubble no longer walks the player there
This commit is contained in:
1 parent
e9097a9a4f
commit
22fb7f0fa5
16 files changed
+589
-207
No files matched your search
@@ -173,7 +173,8 @@ module.exports = {
|
||||
// 61: the Owner, Moderator, Developer and Verified name tag badges seen by everyone.
|
||||
// 62: "Custom pictures" in the settings menu, to hide players' item pictures.
|
||||
// 83: den items tinted (the tint in their version, DenItemHelper.applyTint).
|
||||
buildVersion: env.AJ_BUILD_VERSION || "83",
|
||||
// 84: fixes from the owner's list of bugs (bugs.txt, 2026-10-23).
|
||||
buildVersion: env.AJ_BUILD_VERSION || "84",
|
||||
// what the official CDN is asked for; not ours to change.
|
||||
upstreamBuildVersion: "3",
|
||||
|
||||
@@ -381,6 +382,8 @@ module.exports = {
|
||||
chatLogDays: env.AJ_CHAT_LOG_DAYS === undefined ? 30 : Math.max(0, Number(env.AJ_CHAT_LOG_DAYS) || 0),
|
||||
chatLinesPerWindow: 5, // typed chat lines one player may send ...
|
||||
chatWindowMs: 3000, // ... in this long
|
||||
roomActionsPerWindow: 6, // emotes, actions and the like one player may send a room ...
|
||||
roomActionWindowMs: 3000, // ... in this long (the rest reach nobody)
|
||||
maxBytesPerTenSeconds: 512 * 1024, // per game socket; saving a full den is about 40 KB
|
||||
// custom colours (lib/colours.js). every one ever made is sent to every
|
||||
// player at every login and is never taken out again, so there is an end
|
||||
|
||||
@@ -181,6 +181,13 @@ const ADDED_STRINGS = {
|
||||
9000004: "Crystal Palace (concept)",
|
||||
// the buddy game the client's files call "fourGem"; no string says so.
|
||||
9000005: "Four Gems",
|
||||
// a shop's title when its room gives it none (lib/world.js SHOP_KIND_TITLES)
|
||||
9000010: "Clothing Shop",
|
||||
9000011: "Den Shop",
|
||||
9000012: "Den Rooms",
|
||||
9000013: "Shop",
|
||||
9000014: "Exchange",
|
||||
9000015: "Diamond Shop",
|
||||
};
|
||||
|
||||
// the game under this server's name. its text says "Animal Jam", "Animal
|
||||
|
||||
+10
-3
@@ -51,10 +51,15 @@ const INBOX_FULL = -1;
|
||||
const NOT_ACCEPTING = -2;
|
||||
const FAILED = 0;
|
||||
|
||||
// who may send to a player (ECardInbox's settings popup).
|
||||
// who may send to a player, as kept (account.ecardPrivacy).
|
||||
const FROM_EVERYONE = 0;
|
||||
const FROM_BUDDIES = 1;
|
||||
const FROM_NOBODY = 2;
|
||||
// ECardInbox's settings popup sends the place of the option picked, and its
|
||||
// artwork has Nobody first and Everyone last: the other way round from the
|
||||
// above. turned over both ways between the two (buddies is in the middle).
|
||||
const SETTING_COUNT = 3;
|
||||
const turnedOver = value => SETTING_COUNT - 1 - value;
|
||||
|
||||
const LIST_CARDS = 10;
|
||||
const LIST_STAMPS = 44;
|
||||
@@ -345,7 +350,7 @@ module.exports = ({findOnline, blocks}) => {
|
||||
|
||||
// [setting] -> eCardIsolationHandler: [success]
|
||||
ei(session, roomId, [setting]) {
|
||||
const value = Number(setting);
|
||||
const value = turnedOver(Number(setting));
|
||||
const valid = [FROM_EVERYONE, FROM_BUDDIES, FROM_NOBODY].includes(value);
|
||||
if (valid) {
|
||||
session.account.ecardPrivacy = value;
|
||||
@@ -374,5 +379,7 @@ module.exports = ({findOnline, blocks}) => {
|
||||
return card ? senderOf(card) : null;
|
||||
};
|
||||
|
||||
return {handlers, list, unread, redemptions, sendFromHq, noteFromHq, secretSender, SECRET_NAME: "Secret Valentine"};
|
||||
// the setting as the inbox's settings popup shows it (above)
|
||||
const privacyShown = account => turnedOver(account.ecardPrivacy || FROM_EVERYONE);
|
||||
return {handlers, list, unread, redemptions, privacyShown, sendFromHq, noteFromHq, secretSender, SECRET_NAME: "Secret Valentine"};
|
||||
};
|
||||
+7
-3
@@ -14,8 +14,9 @@ const defpacks = require("./defpacks.js");
|
||||
// then AMF3), so reading it here costs no extra download once anyone has
|
||||
// been in the room.
|
||||
|
||||
// what the room editor left in files nobody named.
|
||||
const UNNAMED = "Display Name";
|
||||
// what the room editor left in files nobody named ("default": the museum's
|
||||
// theatre).
|
||||
const UNNAMED = ["display name", "default"];
|
||||
// rooms whose file has no name and whose path does not spell it either.
|
||||
const NAMES = new Map([
|
||||
["jamaa_township.room_diamonds", "Diamond Shop"],
|
||||
@@ -24,6 +25,9 @@ const NAMES = new Map([
|
||||
["aussie.room_main", "Kimbara Outback"],
|
||||
["aussie.room_aushop", "Outback Imports"],
|
||||
["aussie.room_hos", "Medical Center"],
|
||||
["appondale.room_museumtheater", "Museum Theater"],
|
||||
["crystal_sands.room_tiertheater", "Tierney's Theater"],
|
||||
["lost_temple_of_zios.bb_theater", "Temple Theater"],
|
||||
]);
|
||||
const VOLUME_SHOP = 12; // ActorVolume.type: clicking it opens generic list `typeDefId`
|
||||
|
||||
@@ -37,7 +41,7 @@ const parse = body => {
|
||||
const settings = (room.actors.ActorSettings || [])[0] || {};
|
||||
const volumes = room.actors.ActorVolume || [];
|
||||
return {
|
||||
name: typeof settings.name === "string" && settings.name.trim() !== UNNAMED ? settings.name.trim() : "",
|
||||
name: typeof settings.name === "string" && !UNNAMED.includes(settings.name.trim().toLowerCase()) ? settings.name.trim() : "",
|
||||
shops: new Set(volumes.filter(volume => Number(volume.type) === VOLUME_SHOP).map(volume => Number(volume.typeDefId))),
|
||||
};
|
||||
};
|
||||
|
||||
+28
-5
@@ -129,6 +129,11 @@ const DEF_DEN_ROOM = 1040;
|
||||
const DEF_CURRENCY_EXCHANGE = 1051;
|
||||
const DEF_DIAMOND = 1054;
|
||||
const SHOP_LIST_TYPES = [DEF_ITEM, DEF_DEN_ITEM, DEF_DEN_ROOM, DEF_COMBINED_LIST, DEF_CURRENCY_EXCHANGE, DEF_DIAMOND];
|
||||
// a shop's title when its room gives it none (a shop in a land's main room,
|
||||
// or one opened from elsewhere): what it sells (strings in lib/defpacks.js).
|
||||
// with no title the shop window's banner was blank.
|
||||
const SHOP_KIND_TITLES = new Map([[DEF_ITEM, 9000010], [DEF_DEN_ITEM, 9000011], [DEF_DEN_ROOM, 9000012],
|
||||
[DEF_COMBINED_LIST, 9000013], [DEF_CURRENCY_EXCHANGE, 9000014], [DEF_DIAMOND, 9000015]]);
|
||||
// diamond lists the client reads at login to learn which animals and pets
|
||||
// cost diamonds. they stay empty: animals and pets are free here.
|
||||
const DIAMOND_ANIMAL_AND_PET_LISTS = [166, 214, 293];
|
||||
@@ -150,6 +155,9 @@ const TYPED_NAME = /^[A-Za-z0-9][A-Za-z0-9 '.-]{0,19}$/; // an animal's or pet's
|
||||
const nameFiltered = name => !String(name).includes("|") && Boolean(chatFilter.broken(String(name)));
|
||||
const MAX_BLOCKED = 1000; // from the account page; the game's own button has no limit
|
||||
const TYPED_CHAT_TYPES = ["0", "9"];
|
||||
// UserCommXtCommManager's safe chat phrase (1), emote (2), action (3),
|
||||
// attachment (4), slide (6) and pet action (7)
|
||||
const MOMENTARY_TYPES = ["1", "2", "3", "4", "6", "7"];
|
||||
const MAX_CHAT_EXTRA = 100; // the field after a chat line's type
|
||||
const MAX_USER_VARS = 2000;
|
||||
const MAX_FILTER_WORDS = 100; // a player's own words for their chat filter
|
||||
@@ -163,6 +171,9 @@ const LOGIN_OUTDATED = -12;
|
||||
|
||||
const THEME_PATH_PREFIX = "theme_"; // lib/http.js looks for this
|
||||
const chatLines = limits.limiter(config.chatLinesPerWindow, config.chatWindowMs);
|
||||
// emotes, actions, attachments: each goes to everyone in the room, so a
|
||||
// player pressing one over and over slowed a busy room for all of them.
|
||||
const roomActions = limits.limiter(config.roomActionsPerWindow, config.roomActionWindowMs);
|
||||
const online = new Map(); // lowercased username -> session
|
||||
const rooms = new Map(); // "path.name#shard" -> room
|
||||
const gameActivityListeners = new Set();
|
||||
@@ -290,7 +301,7 @@ const loginParams = session => {
|
||||
playerWallSettings: account.wall.privacy,
|
||||
// not 0: PlayerWallManager only opens walls for accounts with them on.
|
||||
webWallStatus: 1,
|
||||
eCardPrivacySettings: account.ecardPrivacy,
|
||||
eCardPrivacySettings: ecards.privacyShown(account),
|
||||
// not empty: with neither address set, every fifth login opens a
|
||||
// "parent's email" window (GuiManager.showAjEmailBtn). accounts here
|
||||
// have no email.
|
||||
@@ -924,7 +935,7 @@ const handlers = {
|
||||
}
|
||||
// for shops the first unused field is the title's string id; left empty
|
||||
// it keeps the shop window's own title (Shop.gotItemListCallback).
|
||||
const title = SHOP_LIST_TYPES.includes(type) ? (session.room ? roomInfo.shopTitle(session.room.base, listId) : "") : 0;
|
||||
const title = SHOP_LIST_TYPES.includes(type) ? (session.room && roomInfo.shopTitle(session.room.base, listId)) || SHOP_KIND_TITLES.get(type) : 0;
|
||||
session.sendXt("gl", -1, listId, type, title, 0, 0, 0, count === undefined ? entries.length : count, ...entries);
|
||||
},
|
||||
|
||||
@@ -1888,6 +1899,10 @@ module.exports = {
|
||||
// local client deliberately does not draw it optimistically, unlike
|
||||
// typed chat and normal emotes.
|
||||
const attachmentEcho = fields[1] === "4";
|
||||
// A phrase from the phrase menus is drawn from the echo too (the
|
||||
// patched UserCommXtCommManager.sendAvatarSafeChat), so that it
|
||||
// comes in the sender's chat bubble style, as typed chat does.
|
||||
const phrase = fields[1] === "1";
|
||||
// silenced, or chat switched off on the account page: the line
|
||||
// goes nowhere.
|
||||
if (echo && (moderation.isSilenced(session.account) || !accounts.featureOn(session.account, "chat"))) {
|
||||
@@ -1900,6 +1915,14 @@ module.exports = {
|
||||
session.sendXt("uc", session.room.id, session.id, -1, 5);
|
||||
return;
|
||||
}
|
||||
// the momentary ones (a phrase, an emote, an action, an attachment,
|
||||
// a slide, a pet's trick), past a few in a few seconds, reach
|
||||
// nobody: the sender has shown their own already. what sets a
|
||||
// state (a colour, see-through, a lasting emote) always goes, or
|
||||
// others would be left seeing the wrong one.
|
||||
if (MOMENTARY_TYPES.includes(fields[1]) && !limits.isTrustedLocal(session.address) && !roomActions.allow(session.account.id)) {
|
||||
return;
|
||||
}
|
||||
if (echo) {
|
||||
// "!help" and the like (lib/commands.js). A command's line is
|
||||
// still echoed to its sender, whose chat bubble waits for it.
|
||||
@@ -1945,14 +1968,14 @@ module.exports = {
|
||||
// its style. Keeping message and type at their original indexes is
|
||||
// what clears the local "..." bubble; carrying the style on the
|
||||
// same packet prevents it being lost or applied to a later line.
|
||||
const style = echo ? chatStyles.packet(session.account.chatStyle) : "";
|
||||
for (const recipient of (echo || attachmentEcho) ? session.room.sessions : others(session)) {
|
||||
const style = echo || phrase ? chatStyles.packet(session.account.chatStyle) : "";
|
||||
for (const recipient of (echo || attachmentEcho || phrase) ? session.room.sessions : others(session)) {
|
||||
if (session.invisible && recipient !== session && !roles.isActiveStaff(recipient.account)) {
|
||||
continue;
|
||||
}
|
||||
if (recipient === session || (!blocks.has(recipient.account, session.account) && (!echo || accounts.featureOn(recipient.account, "chat")))) {
|
||||
recipient.sendXt("uc", session.room.id, session.id,
|
||||
...(echo && style ? [fields[0], fields[1], fields[2] || "", style] : fields));
|
||||
...((echo || phrase) && style ? [fields[0], fields[1], fields[2] || "", style] : fields));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+326
-121
@@ -249,6 +249,41 @@
|
||||
.aj-box-close:hover {
|
||||
background: radial-gradient(circle at 50% 35%, #ff8f74, #d93d22 70%);
|
||||
}
|
||||
/* a video spot's box (ajVideoSpot): a screen of the theatre's size with
|
||||
a link box under it, over the middle of the stage */
|
||||
#spot {
|
||||
--s: 1;
|
||||
--px: calc(var(--s) * 1px);
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 3;
|
||||
pointer-events: none;
|
||||
font-family: "DigitalDelivery", Arial, Helvetica, sans-serif;
|
||||
}
|
||||
#spot[hidden], #spot [hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
#spot-box {
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: calc(548 * var(--px));
|
||||
}
|
||||
#spot-screen {
|
||||
width: calc(512 * var(--px));
|
||||
height: calc(288 * var(--px));
|
||||
background: #000;
|
||||
border: calc(2 * var(--px)) solid #7f6744;
|
||||
border-radius: calc(6 * var(--px));
|
||||
overflow: hidden;
|
||||
margin-bottom: calc(10 * var(--px));
|
||||
}
|
||||
#spot-screen > * {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
display: block;
|
||||
}
|
||||
.aj-box-said {
|
||||
min-height: calc(15 * var(--px));
|
||||
margin: calc(8 * var(--px)) 0 0;
|
||||
@@ -286,6 +321,19 @@
|
||||
<p id="own-video-said" class="aj-box-said" role="status"></p>
|
||||
</form>
|
||||
</div>
|
||||
<div id="spot" hidden>
|
||||
<form id="spot-box" class="aj-box">
|
||||
<h2>Your Video</h2>
|
||||
<button type="button" id="spot-close" class="aj-box-close" aria-label="Close">×</button>
|
||||
<div id="spot-screen"></div>
|
||||
<input id="spot-url" type="url" placeholder="Paste a link: YouTube, Vimeo, .mp4, .webm, .mp3" autocomplete="off" spellcheck="false" aria-label="Video link">
|
||||
<div class="own-video-buttons">
|
||||
<button type="submit" class="aj-button go">Play</button>
|
||||
<button type="button" id="spot-stop" class="aj-button stop">Stop</button>
|
||||
</div>
|
||||
<p id="spot-said" class="aj-box-said" role="status"></p>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
@@ -357,8 +405,11 @@
|
||||
// an address the SWF wants open (AJClient.finderLink): the client opens
|
||||
// it in the system browser, being a webview that may open no window.
|
||||
function ajOpenPage(url) {
|
||||
if (/^https:\/\//.test(String(url))) {
|
||||
window.ipc.sendToHost("openPage", String(url));
|
||||
// https anywhere, or this server's own pages however it is reached
|
||||
// (a server tried on this machine has no https)
|
||||
const link = String(url);
|
||||
if (/^https:\/\//.test(link) || link.startsWith(`${location.origin}/`)) {
|
||||
window.ipc.sendToHost("openPage", link);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,9 +441,24 @@
|
||||
? {x: numbers[0], y: numbers[1], w: numbers[2], h: numbers[3]} : null;
|
||||
theatreCover = theatreScreen && parts.length === 3 ? coverRects(Number(parts[1]), parts[2].split(",")) : [];
|
||||
placeTheatre();
|
||||
ownVideo.inTheatre(theatreScreen !== null);
|
||||
browserPage.inTheatre(theatreScreen !== null);
|
||||
// the screen gone for a moment (the room redrawing it) is no reason
|
||||
// to stop the player's video and put its box away: only gone for good.
|
||||
clearTimeout(theatreLeftTimer);
|
||||
if (theatreScreen !== null) {
|
||||
ownVideo.inTheatre(true);
|
||||
browserPage.inTheatre(true);
|
||||
}
|
||||
else {
|
||||
theatreLeftTimer = setTimeout(() => {
|
||||
if (theatreScreen === null) {
|
||||
ownVideo.inTheatre(false);
|
||||
browserPage.inTheatre(false);
|
||||
}
|
||||
}, THEATRE_GONE_MS);
|
||||
}
|
||||
}
|
||||
const THEATRE_GONE_MS = 1500;
|
||||
let theatreLeftTimer = null;
|
||||
|
||||
// the covered cells as rectangles: runs along each row, and a run
|
||||
// that the row above has too made taller.
|
||||
@@ -496,7 +562,9 @@
|
||||
x: theatre.offsetLeft + x * scale, y: theatre.offsetTop + y * scale,
|
||||
w: w * scale, h: (below ? h : h - BUTTON_ROOM) * scale, clip,
|
||||
});
|
||||
for (const id of ["theatre-pills", "own-video-box", "browser-bar"]) {
|
||||
// (not the Your Video box: the player opened it, and with it open the
|
||||
// button is away, so hiding it too left nothing to click)
|
||||
for (const id of ["theatre-pills", "browser-bar"]) {
|
||||
const element = document.getElementById(id);
|
||||
element.classList.toggle("covered", underCover(element, scale));
|
||||
}
|
||||
@@ -525,11 +593,101 @@
|
||||
browserPage.roomVideo(true);
|
||||
}
|
||||
|
||||
// a link of the player's own, to play: YouTube and Vimeo links in those
|
||||
// sites' own players; any other http(s) address in a <video>, which
|
||||
// plays a media file or nothing (a web page in it runs no script and
|
||||
// asks nobody for anything). {frame}, {file} or {error}; null for no link.
|
||||
const videoEmbedFor = text => {
|
||||
let url;
|
||||
try {
|
||||
url = new URL(text);
|
||||
}
|
||||
catch (err) {
|
||||
return null;
|
||||
}
|
||||
if (url.protocol !== "https:" && url.protocol !== "http:") {
|
||||
return null;
|
||||
}
|
||||
const host = url.hostname.replace(/^(?:www\.|m\.)/, "").toLowerCase();
|
||||
let match = null;
|
||||
if (host === "youtu.be") {
|
||||
match = /^\/([A-Za-z0-9_-]{11})/.exec(url.pathname);
|
||||
}
|
||||
else if (host === "youtube.com" || host === "youtube-nocookie.com") {
|
||||
match = url.pathname === "/watch" ? /^([A-Za-z0-9_-]{11})$/.exec(url.searchParams.get("v") || "")
|
||||
: /^\/(?:embed|shorts|live)\/([A-Za-z0-9_-]{11})/.exec(url.pathname);
|
||||
}
|
||||
if (match) {
|
||||
return {frame: `https://www.youtube-nocookie.com/embed/${match[1]}?autoplay=1&rel=0&modestbranding=1`};
|
||||
}
|
||||
if (host === "vimeo.com" || host === "player.vimeo.com") {
|
||||
match = /^\/(?:video\/)?(\d{1,12})(?:\/|$)/.exec(url.pathname);
|
||||
return match ? {frame: `https://player.vimeo.com/video/${match[1]}?autoplay=1`} : {error: "That Vimeo link has no video in it."};
|
||||
}
|
||||
if (host.endsWith("youtube.com")) {
|
||||
return {error: "That YouTube link has no video in it."};
|
||||
}
|
||||
return {file: url.href};
|
||||
};
|
||||
|
||||
// the desktop client loads nothing for this page from elsewhere but
|
||||
// what it is told the player chose (client 1.3.2, app/main.js): it
|
||||
// says when that address may load. an older client never answers.
|
||||
const CLIENT_WAIT_MS = 1500;
|
||||
let videoCleared = null; // {link, go}
|
||||
window.ipc.on("ownVideoReady", (event, link) => {
|
||||
if (videoCleared && videoCleared.link === link) {
|
||||
videoCleared.go();
|
||||
}
|
||||
});
|
||||
const whenVideoCleared = link => new Promise(resolve => {
|
||||
const timer = setTimeout(resolve, CLIENT_WAIT_MS);
|
||||
videoCleared = {link, go: () => {
|
||||
clearTimeout(timer);
|
||||
resolve();
|
||||
}};
|
||||
window.ipc.sendToHost("ownVideo", link);
|
||||
});
|
||||
|
||||
// the element that plays `found` (videoEmbedFor). a file starts once
|
||||
// the client lets it, and only while `stillWanted(element)`;
|
||||
// `failed` hears of a file that would not play.
|
||||
const videoElementFor = (found, stillWanted, failed, started) => {
|
||||
if (found.frame) {
|
||||
const frame = document.createElement("iframe");
|
||||
frame.title = "Your video";
|
||||
frame.allow = "autoplay; encrypted-media; fullscreen";
|
||||
frame.referrerPolicy = "strict-origin-when-cross-origin";
|
||||
frame.src = found.frame;
|
||||
return frame;
|
||||
}
|
||||
const video = document.createElement("video");
|
||||
video.controls = true;
|
||||
video.autoplay = true;
|
||||
video.playsInline = true;
|
||||
video.addEventListener("error", failed);
|
||||
whenVideoCleared(found.file).then(() => {
|
||||
if (stillWanted(video)) {
|
||||
video.src = found.file;
|
||||
started();
|
||||
}
|
||||
});
|
||||
return video;
|
||||
};
|
||||
const VIDEO_DID_NOT_PLAY = "That link did not play. It has to be a video or sound file (.mp4, .webm, .mp3), and the site has to allow it.";
|
||||
|
||||
// a playing element stopped: a file's sound with it, and the client told.
|
||||
const stopVideoElement = element => {
|
||||
if (element instanceof HTMLMediaElement) {
|
||||
element.pause();
|
||||
element.removeAttribute("src");
|
||||
element.load();
|
||||
window.ipc.sendToHost("ownVideo", "");
|
||||
}
|
||||
};
|
||||
|
||||
// a video of the player's own choosing on the theatre screen, seen by
|
||||
// them alone: nothing of it goes to the server. YouTube and Vimeo
|
||||
// links play in those sites' own players; any other http(s) address
|
||||
// in a <video>, which plays a media file or nothing (a web page in it
|
||||
// runs no script and asks nobody for anything).
|
||||
// them alone: nothing of it goes to the server.
|
||||
const ownVideo = (() => {
|
||||
const $ = id => document.getElementById(id);
|
||||
const screen = $("own-video");
|
||||
@@ -542,39 +700,6 @@
|
||||
let roomPlaying = false;
|
||||
let playing = null; // the element showing it
|
||||
|
||||
const embedFor = text => {
|
||||
let url;
|
||||
try {
|
||||
url = new URL(text);
|
||||
}
|
||||
catch (err) {
|
||||
return null;
|
||||
}
|
||||
if (url.protocol !== "https:" && url.protocol !== "http:") {
|
||||
return null;
|
||||
}
|
||||
const host = url.hostname.replace(/^(?:www\.|m\.)/, "").toLowerCase();
|
||||
let match = null;
|
||||
if (host === "youtu.be") {
|
||||
match = /^\/([A-Za-z0-9_-]{11})/.exec(url.pathname);
|
||||
}
|
||||
else if (host === "youtube.com" || host === "youtube-nocookie.com") {
|
||||
match = url.pathname === "/watch" ? /^([A-Za-z0-9_-]{11})$/.exec(url.searchParams.get("v") || "")
|
||||
: /^\/(?:embed|shorts|live)\/([A-Za-z0-9_-]{11})/.exec(url.pathname);
|
||||
}
|
||||
if (match) {
|
||||
return {frame: `https://www.youtube-nocookie.com/embed/${match[1]}?autoplay=1&rel=0&modestbranding=1`};
|
||||
}
|
||||
if (host === "vimeo.com" || host === "player.vimeo.com") {
|
||||
match = /^\/(?:video\/)?(\d{1,12})(?:\/|$)/.exec(url.pathname);
|
||||
return match ? {frame: `https://player.vimeo.com/video/${match[1]}?autoplay=1`} : {error: "That Vimeo link has no video in it."};
|
||||
}
|
||||
if (host.endsWith("youtube.com")) {
|
||||
return {error: "That YouTube link has no video in it."};
|
||||
}
|
||||
return {file: url.href};
|
||||
};
|
||||
|
||||
const show = () => {
|
||||
screen.hidden = !playing || !here || roomPlaying;
|
||||
if (playing instanceof HTMLMediaElement) {
|
||||
@@ -588,99 +713,71 @@
|
||||
};
|
||||
|
||||
const stop = () => {
|
||||
if (playing instanceof HTMLMediaElement) {
|
||||
playing.pause();
|
||||
playing.removeAttribute("src");
|
||||
playing.load();
|
||||
window.ipc.sendToHost("ownVideo", "");
|
||||
}
|
||||
stopVideoElement(playing);
|
||||
screen.replaceChildren();
|
||||
playing = null;
|
||||
show();
|
||||
};
|
||||
|
||||
// the desktop client loads nothing for this page from elsewhere but
|
||||
// what it is told the player chose (client 1.3.2, app/main.js): it
|
||||
// says when that address may load. an older client never answers.
|
||||
const CLIENT_WAIT_MS = 1500;
|
||||
let cleared = null; // {link, go}
|
||||
window.ipc.on("ownVideoReady", (event, link) => {
|
||||
if (cleared && cleared.link === link) {
|
||||
cleared.go();
|
||||
}
|
||||
});
|
||||
const whenCleared = link => new Promise(resolve => {
|
||||
const timer = setTimeout(resolve, CLIENT_WAIT_MS);
|
||||
cleared = {link, go: () => {
|
||||
clearTimeout(timer);
|
||||
resolve();
|
||||
}};
|
||||
window.ipc.sendToHost("ownVideo", link);
|
||||
});
|
||||
|
||||
const play = text => {
|
||||
const found = embedFor(String(text || "").trim());
|
||||
if (!found || found.error) {
|
||||
said.textContent = found ? found.error : "Paste a link starting with https://";
|
||||
return;
|
||||
}
|
||||
stop();
|
||||
browserPage.close();
|
||||
if (found.frame) {
|
||||
playing = document.createElement("iframe");
|
||||
playing.title = "Your video";
|
||||
playing.allow = "autoplay; encrypted-media; fullscreen";
|
||||
playing.referrerPolicy = "strict-origin-when-cross-origin";
|
||||
playing.src = found.frame;
|
||||
}
|
||||
else {
|
||||
const video = document.createElement("video");
|
||||
playing = video;
|
||||
video.controls = true;
|
||||
video.autoplay = true;
|
||||
video.playsInline = true;
|
||||
video.addEventListener("error", () => {
|
||||
said.textContent = "That link did not play. It has to be a video or sound file (.mp4, .webm, .mp3), and the site has to allow it.";
|
||||
});
|
||||
whenCleared(found.file).then(() => {
|
||||
if (playing === video) {
|
||||
video.src = found.file;
|
||||
show();
|
||||
}
|
||||
});
|
||||
}
|
||||
screen.append(playing);
|
||||
said.textContent = roomPlaying ? "It plays when the theatre's own video stops." : "";
|
||||
try {
|
||||
localStorage.setItem(SAVED, input.value.trim());
|
||||
}
|
||||
catch (err) {
|
||||
}
|
||||
show();
|
||||
};
|
||||
|
||||
opener.addEventListener("click", () => {
|
||||
box.hidden = !box.hidden;
|
||||
opener.hidden = !box.hidden;
|
||||
const open = () => {
|
||||
box.hidden = false;
|
||||
opener.hidden = true;
|
||||
placeTheatre();
|
||||
if (!box.hidden) {
|
||||
if (!input.value) {
|
||||
try {
|
||||
input.value = localStorage.getItem(SAVED) || "";
|
||||
}
|
||||
catch (err) {
|
||||
}
|
||||
if (!input.value) {
|
||||
try {
|
||||
input.value = localStorage.getItem(SAVED) || "";
|
||||
}
|
||||
catch (err) {
|
||||
}
|
||||
input.focus();
|
||||
input.select();
|
||||
}
|
||||
});
|
||||
input.focus();
|
||||
input.select();
|
||||
};
|
||||
// the box away and the button back: the two are never gone at once.
|
||||
const close = () => {
|
||||
box.hidden = true;
|
||||
opener.hidden = false;
|
||||
placeTheatre();
|
||||
said.textContent = "";
|
||||
};
|
||||
|
||||
const play = text => {
|
||||
const found = videoEmbedFor(String(text || "").trim());
|
||||
if (!found || found.error) {
|
||||
said.textContent = found ? found.error : "Paste a link starting with https://";
|
||||
return;
|
||||
}
|
||||
stop();
|
||||
browserPage.close();
|
||||
const element = videoElementFor(found, video => playing === video, () => {
|
||||
open();
|
||||
said.textContent = VIDEO_DID_NOT_PLAY;
|
||||
}, show);
|
||||
playing = element;
|
||||
screen.append(playing);
|
||||
try {
|
||||
localStorage.setItem(SAVED, input.value.trim());
|
||||
}
|
||||
catch (err) {
|
||||
}
|
||||
// the box goes once it plays, the button back to change it
|
||||
if (roomPlaying) {
|
||||
said.textContent = "It plays when the theatre's own video stops.";
|
||||
}
|
||||
else {
|
||||
close();
|
||||
}
|
||||
show();
|
||||
};
|
||||
|
||||
opener.addEventListener("click", () => {
|
||||
if (box.hidden) {
|
||||
open();
|
||||
}
|
||||
else {
|
||||
close();
|
||||
}
|
||||
});
|
||||
$("own-video-close").addEventListener("click", close);
|
||||
$("own-video-stop").addEventListener("click", () => {
|
||||
stop();
|
||||
@@ -697,6 +794,7 @@
|
||||
});
|
||||
|
||||
return {
|
||||
open,
|
||||
// the browser takes the screen: the player's own video and its box go.
|
||||
giveWay() {
|
||||
stop();
|
||||
@@ -724,6 +822,113 @@
|
||||
};
|
||||
})();
|
||||
|
||||
// a video spot of the game's (a screen in a room, a "videos" button,
|
||||
// the trade list's help): its videos came from the official server,
|
||||
// and here the spot opens a box for a video of the player's own, over
|
||||
// the middle of the stage, seen by them alone. the game says when
|
||||
// (AJClient's GenericListGuiManager.openVideoSpot).
|
||||
const spotVideo = (() => {
|
||||
const $ = id => document.getElementById(id);
|
||||
const spot = $("spot");
|
||||
const screen = $("spot-screen");
|
||||
const input = $("spot-url");
|
||||
const said = $("spot-said");
|
||||
const SAVED = "ownVideoUrl";
|
||||
let playing = null;
|
||||
|
||||
const fit = () => {
|
||||
spot.style.setProperty("--s", String(Math.min(window.innerWidth / STAGE_W, window.innerHeight / STAGE_H)));
|
||||
};
|
||||
const stop = () => {
|
||||
stopVideoElement(playing);
|
||||
screen.replaceChildren();
|
||||
playing = null;
|
||||
};
|
||||
const play = text => {
|
||||
const found = videoEmbedFor(String(text || "").trim());
|
||||
if (!found || found.error) {
|
||||
said.textContent = found ? found.error : "Paste a link starting with https://";
|
||||
return;
|
||||
}
|
||||
stop();
|
||||
said.textContent = "";
|
||||
playing = videoElementFor(found, video => playing === video, () => {
|
||||
said.textContent = VIDEO_DID_NOT_PLAY;
|
||||
}, () => {});
|
||||
screen.append(playing);
|
||||
};
|
||||
const close = () => {
|
||||
stop();
|
||||
spot.hidden = true;
|
||||
said.textContent = "";
|
||||
};
|
||||
|
||||
$("spot-close").addEventListener("click", close);
|
||||
$("spot-stop").addEventListener("click", () => {
|
||||
stop();
|
||||
said.textContent = "";
|
||||
});
|
||||
$("spot-box").addEventListener("submit", event => {
|
||||
event.preventDefault();
|
||||
play(input.value);
|
||||
try {
|
||||
localStorage.setItem(SAVED, input.value.trim());
|
||||
}
|
||||
catch (err) {
|
||||
}
|
||||
});
|
||||
input.addEventListener("keydown", event => {
|
||||
if (event.key === "Escape") {
|
||||
close();
|
||||
}
|
||||
});
|
||||
window.addEventListener("resize", fit);
|
||||
|
||||
return {
|
||||
close,
|
||||
// `videoId`: a YouTube video to play at once, or none
|
||||
open(videoId) {
|
||||
fit();
|
||||
spot.hidden = false;
|
||||
said.textContent = "";
|
||||
if (videoId) {
|
||||
input.value = "";
|
||||
play(`https://youtu.be/${videoId}`);
|
||||
return;
|
||||
}
|
||||
if (!input.value) {
|
||||
try {
|
||||
input.value = localStorage.getItem(SAVED) || "";
|
||||
}
|
||||
catch (err) {
|
||||
}
|
||||
}
|
||||
input.focus();
|
||||
input.select();
|
||||
},
|
||||
};
|
||||
})();
|
||||
|
||||
// from the game: a video spot clicked ("" or a YouTube id of ours to
|
||||
// play), or "close" (the player left the room). in a theatre, its own
|
||||
// Your Video box.
|
||||
function ajVideoSpot(text) {
|
||||
const wanted = String(text || "");
|
||||
if (wanted === "close") {
|
||||
spotVideo.close();
|
||||
return;
|
||||
}
|
||||
if (/^[A-Za-z0-9_-]{11}$/.test(wanted)) {
|
||||
spotVideo.open(wanted);
|
||||
}
|
||||
else if (theatreScreen !== null) {
|
||||
ownVideo.open();
|
||||
}
|
||||
else {
|
||||
spotVideo.open("");
|
||||
}
|
||||
}
|
||||
|
||||
// the theatre's browser (experimental): a web page on the screen, for
|
||||
// the player alone, when the admin has turned it on (the server marks
|
||||
// this page so: lib/panel.js). the desktop client (1.3.3) draws it in a
|
||||
|
||||
+9
-7
@@ -1832,9 +1832,10 @@ package
|
||||
// 9004 Frame rate: 1 is 60; anything else is Max, as fast as the
|
||||
// timer goes (about 80 a second on the owner's machine, where
|
||||
// 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
|
||||
// 9005 Camera: 2 the game's own, else Smooth
|
||||
// (room.RoomManagerWorld.easeCamera).
|
||||
// 9007 Performance profile: 1 Low-end, 3 Balanced, else (unset) High:
|
||||
// the best the game can look, which most machines manage. A
|
||||
// profile changes only optional rendering work, never the
|
||||
// game's native 24 FPS (which would slow its animations).
|
||||
// 9008 Play as your pet (gui.PetInventory, lib/pets.js): 1 on.
|
||||
@@ -1874,12 +1875,13 @@ package
|
||||
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.
|
||||
// 0 Balanced, 1 Low-end, 2 High (kept as 3, 1, and 2 or nothing). 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;
|
||||
return _loc1_ == 1 ? 1 : (_loc1_ == 3 ? 0 : 2);
|
||||
}
|
||||
|
||||
public static function performanceProfileLabel() : String
|
||||
@@ -1910,7 +1912,7 @@ package
|
||||
var _loc1_:Boolean = false;
|
||||
try
|
||||
{
|
||||
_loc1_ = smoothOn() && settingOf(9005) == 1;
|
||||
_loc1_ = smoothOn() && settingOf(9005) != 2;
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
|
||||
@@ -167,7 +167,7 @@ package buddy
|
||||
private static function onHasReferralAssociationResponse(param1:int) : void
|
||||
{
|
||||
_hasRequestedReferralAssociation = true;
|
||||
_buddyListReferFriendBg.visible = true;
|
||||
_buddyListReferFriendBg.visible = param1 == 1;
|
||||
if(param1 == 1)
|
||||
{
|
||||
_buddyListReferAFriendBtn.visible = true;
|
||||
@@ -175,8 +175,10 @@ package buddy
|
||||
}
|
||||
else
|
||||
{
|
||||
// "How did you hear?" is never offered here: its window soft
|
||||
// locked the game, and nothing reads its answer.
|
||||
_buddyListReferAFriendBtn.visible = false;
|
||||
_buddyListHowDidYouHearBtn.visible = true;
|
||||
_buddyListHowDidYouHearBtn.visible = false;
|
||||
}
|
||||
if(_buddyListPopup.visible)
|
||||
{
|
||||
|
||||
+15
-1
@@ -216,6 +216,8 @@ package gui
|
||||
var field:TextField = TextField(_msgTxt);
|
||||
var shown:String = field.text;
|
||||
field.addEventListener("link",onMentionLink,false,0,true);
|
||||
field.addEventListener("mouseDown",onMentionMouse,false,0,true);
|
||||
field.addEventListener("mouseUp",onMentionMouse,false,0,true);
|
||||
AJClient.resolveMentions(shown,function(param1:Array):void
|
||||
{
|
||||
if(field.text == shown)
|
||||
@@ -275,7 +277,7 @@ package gui
|
||||
_styleText = uint(parseInt(_loc4_[2],16));
|
||||
_styleBorder = uint(parseInt(_loc4_[3],16));
|
||||
_styleOpacity = Math.max(0.25,Math.min(1,Number(_loc4_[4]) / 100));
|
||||
_styleAnimation = _loc4_[5] == "pulse" || _loc4_[5] == "shimmer" || _loc4_[5] == "flow" || _loc4_[5] == "rainbow" ? _loc4_[5] : "none";
|
||||
_styleAnimation = GuiManager.chatBubbleAnimationsEnabled() && (_loc4_[5] == "pulse" || _loc4_[5] == "shimmer" || _loc4_[5] == "flow" || _loc4_[5] == "rainbow") ? _loc4_[5] : "none";
|
||||
_styleSpeed = Math.max(40,Math.min(300,Number(_loc4_[6])));
|
||||
_styleGradient = _loc4_.length > 7 && (_loc4_[7] == "solid" || _loc4_[7] == "radial") ? _loc4_[7] : "linear";
|
||||
_styleAngle = _loc4_.length > 8 && int(_loc4_[8]) >= 0 && int(_loc4_[8]) <= 315 && int(_loc4_[8]) % 45 == 0 ? int(_loc4_[8]) : 45;
|
||||
@@ -979,6 +981,18 @@ package gui
|
||||
}
|
||||
}
|
||||
|
||||
// a press on a tag goes no further: the room under the balloon would
|
||||
// take it for a click on the floor and walk the player there.
|
||||
private function onMentionMouse(param1:MouseEvent) : void
|
||||
{
|
||||
var _loc2_:TextField = param1.currentTarget as TextField;
|
||||
var _loc3_:int = _loc2_ != null ? _loc2_.getCharIndexAtPoint(param1.localX,param1.localY) : -1;
|
||||
if(_loc3_ >= 0 && _loc2_.getTextFormat(_loc3_,_loc3_ + 1).url)
|
||||
{
|
||||
param1.stopPropagation();
|
||||
}
|
||||
}
|
||||
|
||||
// a tag clicked: "@name" (setText)
|
||||
private function onMentionLink(param1:TextEvent) : void
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package gui
|
||||
{
|
||||
import collection.StreamDefCollection;
|
||||
import flash.external.ExternalInterface;
|
||||
import movie.MovieManager;
|
||||
import quest.QuestManager;
|
||||
import room.RoomManagerWorld;
|
||||
@@ -50,10 +51,17 @@ package gui
|
||||
var _loc4_:Boolean = false;
|
||||
// the video lists came from the official server; this one answers
|
||||
// them empty, and a player with nothing to play threw (#1009 in
|
||||
// VideoPlayerOSMF.playNonStreaming)
|
||||
// VideoPlayerOSMF.playNonStreaming). a video spot clicked opens the
|
||||
// game page's video box instead (game.html ajVideoSpot), for a link
|
||||
// of the player's own; the trade list's help plays a video of ours.
|
||||
// a list the room plays by itself ("autoplay") opens nothing.
|
||||
if(param2 == null || param2.length == 0)
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
if(param3 == null || param3.msg == null || String(param3.msg).indexOf("autoplay") == -1)
|
||||
{
|
||||
openVideoSpot(param1 == TRADE_HELP_LIST ? TRADE_HELP_VIDEO : "");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(param2.length > 1)
|
||||
@@ -143,6 +151,27 @@ package gui
|
||||
movieSelector.destroy();
|
||||
movieSelector = null;
|
||||
}
|
||||
openVideoSpot("close");
|
||||
}
|
||||
|
||||
// the trade list's "how to trade" video (AvatarEditor.onInfoBtnDown)
|
||||
private static const TRADE_HELP_LIST:int = 22;
|
||||
private static const TRADE_HELP_VIDEO:String = "dQw4w9WgXcQ";
|
||||
|
||||
// the game page's video box (game.html ajVideoSpot): a YouTube id to
|
||||
// play, "" for a link of the player's choosing, "close" to put it away
|
||||
public static function openVideoSpot(param1:String) : void
|
||||
{
|
||||
try
|
||||
{
|
||||
if(ExternalInterface.available)
|
||||
{
|
||||
ExternalInterface.call("ajVideoSpot",param1);
|
||||
}
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static function togglePlayPauseVideoPlayer(param1:Boolean) : void
|
||||
|
||||
@@ -272,6 +272,8 @@ package gui
|
||||
private static var _sharedObj:SharedObject;
|
||||
|
||||
private static var _customChatBubbles:Boolean = true;
|
||||
|
||||
private static var _chatBubbleAnimations:Boolean = true;
|
||||
|
||||
private static var _giftGemsMediaHelper:MediaHelper;
|
||||
|
||||
@@ -368,12 +370,14 @@ package gui
|
||||
{
|
||||
_sharedObj = null;
|
||||
_customChatBubbles = true;
|
||||
_chatBubbleAnimations = true;
|
||||
if(gMainFrame.myFlashVarUserName != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
_sharedObj = SharedObject.getLocal(gMainFrame.myFlashVarUserName);
|
||||
_customChatBubbles = _sharedObj.data.customChatBubbles !== false;
|
||||
_chatBubbleAnimations = _sharedObj.data.chatBubbleAnimations !== false;
|
||||
if(_sharedObj.data.cursor == null || _sharedObj.data.cursor == "custom")
|
||||
{
|
||||
CursorManager.switchToCursor("custom_cursor");
|
||||
@@ -489,6 +493,30 @@ package gui
|
||||
}
|
||||
}
|
||||
|
||||
// the same, for custom bubbles' animations (pulse, shimmer, flow,
|
||||
// rainbow): off, every bubble keeps its colours and stands still.
|
||||
public static function chatBubbleAnimationsEnabled() : Boolean
|
||||
{
|
||||
return _chatBubbleAnimations;
|
||||
}
|
||||
|
||||
public static function setChatBubbleAnimationsEnabled(param1:Boolean) : void
|
||||
{
|
||||
_chatBubbleAnimations = param1;
|
||||
if(_sharedObj == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_sharedObj.data.chatBubbleAnimations = param1;
|
||||
try
|
||||
{
|
||||
_sharedObj.flush();
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static function startFFM(param1:Boolean = false) : void
|
||||
{
|
||||
if(gMainFrame.server.getCurrentRoom())
|
||||
@@ -995,6 +1023,15 @@ package gui
|
||||
|
||||
public static function initMoviePlayer(param1:int, param2:StreamDefCollection, param3:Boolean = true, param4:int = 512, param5:int = 288) : void
|
||||
{
|
||||
// nothing to play (the official server's video lists are gone; a
|
||||
// tutorial video that never came): the game page's video box
|
||||
// instead, as GenericListGuiManager.launchMovies does.
|
||||
if(param2 == null || param2.length == 0 || param2.getStreamDefItem(0) == null)
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
GenericListGuiManager.openVideoSpot("");
|
||||
return;
|
||||
}
|
||||
if(_videoPlayer)
|
||||
{
|
||||
_videoPlayer.destroy();
|
||||
|
||||
+92
-54
@@ -14,6 +14,7 @@ package gui.itemWindows
|
||||
import flash.geom.Matrix;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.events.Event;
|
||||
import flash.external.ExternalInterface;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.net.URLRequest;
|
||||
import flash.net.navigateToURL;
|
||||
@@ -133,7 +134,7 @@ package gui.itemWindows
|
||||
_window.toggleBtn.visible = true;
|
||||
_window.toggleBtn.toggleBtn.toggleKnob.gotoAndStop("up");
|
||||
_window.toggleBtn.toggleBtn.toggleBG.gotoAndStop("up");
|
||||
_window.icon.gotoAndStop(_currItem.frame);
|
||||
_window.icon.gotoAndStop(_currItem.iconFrame != null ? _currItem.iconFrame : _currItem.frame);
|
||||
_window.toggleBtn.addEventListener("mouseDown",handleMouseDown,false,0,true);
|
||||
_window.toggleBtn.addEventListener("rollOver",handleMouseOver,false,0,true);
|
||||
_window.toggleBtn.addEventListener("rollOut",handleMouseOut,false,0,true);
|
||||
@@ -236,17 +237,16 @@ package gui.itemWindows
|
||||
}
|
||||
break;
|
||||
case "hideBlocked":
|
||||
showHideBlocked();
|
||||
break;
|
||||
case "customArt":
|
||||
showCustomArt();
|
||||
case "wasd":
|
||||
_window.toggleBtn.gotoAndStop("double");
|
||||
_window.toggleBtn.toggleBtn.gotoAndStop(ownSwitchOn() ? "startingOn" : "startingOff");
|
||||
setToggleLabels();
|
||||
_window.labelTxtCont.labelTxt.text = _currItem.labelLabel;
|
||||
break;
|
||||
case "expandedInventory":
|
||||
showExpandedInventory();
|
||||
break;
|
||||
case "wasd":
|
||||
showWasd();
|
||||
break;
|
||||
case "performance":
|
||||
showPerformance();
|
||||
break;
|
||||
@@ -443,17 +443,57 @@ package gui.itemWindows
|
||||
}
|
||||
}
|
||||
|
||||
// "WASD Movement": walking with those four keys as well as the
|
||||
// arrow keys (room.RoomManagerView). user var 9002, not one of the game's.
|
||||
private function showWasd() : void
|
||||
// the switches of this server's own (MySettings): on is the left
|
||||
// choice, as on the Nametag row. "WASD Movement": walking with those
|
||||
// four keys as well as the arrow keys (room.RoomManagerView), user var
|
||||
// 9002. "Blocked Players": shown, or hidden in rooms, user var 9001.
|
||||
// "Custom Items": the pictures players give their items, or every item
|
||||
// with its base's art (AJClient.customArtOn), user var 9006.
|
||||
private function ownSwitchOn() : Boolean
|
||||
{
|
||||
var _loc1_:String = AJClient.wasdOn() ? "Turn off" : "Turn on";
|
||||
_window.goNowBtn.down.txt.text = _loc1_;
|
||||
_window.goNowBtn.mouse.mouse.txt.text = _loc1_;
|
||||
_window.goNowBtn.mouse.up.txt.text = _loc1_;
|
||||
_window.labelTxtCont.labelTxt.text = "WASD Movement";
|
||||
switch(_currItem.frame)
|
||||
{
|
||||
case "wasd":
|
||||
return AJClient.wasdOn();
|
||||
case "hideBlocked":
|
||||
return !blockedAreHidden();
|
||||
case "customArt":
|
||||
return AJClient.customArtOn();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private function setOwnSwitch(param1:Boolean) : void
|
||||
{
|
||||
switch(_currItem.frame)
|
||||
{
|
||||
case "wasd":
|
||||
setWasd(param1);
|
||||
break;
|
||||
case "hideBlocked":
|
||||
setHideBlocked(!param1);
|
||||
break;
|
||||
case "customArt":
|
||||
setCustomArt(param1);
|
||||
}
|
||||
}
|
||||
|
||||
// the two choices either side of a switch: the game's strings, or
|
||||
// words of this server's
|
||||
private function setToggleLabels() : void
|
||||
{
|
||||
if(_currItem.onLabel != null)
|
||||
{
|
||||
_window.toggleBtn.toggleBtn.valueTxt.onTxt.text = _currItem.onLabel;
|
||||
_window.toggleBtn.toggleBtn.valueTxt.offTxt.text = _currItem.offLabel;
|
||||
}
|
||||
else
|
||||
{
|
||||
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||
}
|
||||
}
|
||||
|
||||
// the three rows of smooth graphics (AJClient has what each does): a
|
||||
// name on the left and on the button what it is set to now; a press
|
||||
// goes on to the next choice. user vars 9003 to 9005.
|
||||
@@ -481,10 +521,12 @@ package gui.itemWindows
|
||||
showChoice("Performance",AJClient.performanceProfileLabel());
|
||||
}
|
||||
|
||||
// High, Balanced, Low-end, and round again (AJClient.performanceProfile
|
||||
// has how each is kept)
|
||||
private function nextPerformance() : void
|
||||
{
|
||||
var _loc1_:int = AJClient.performanceProfile();
|
||||
setChoice(9007,_loc1_ == 0 ? 1 : (_loc1_ == 1 ? 2 : 0));
|
||||
setChoice(9007,_loc1_ == 2 ? 3 : (_loc1_ == 0 ? 1 : 2));
|
||||
showPerformance();
|
||||
}
|
||||
|
||||
@@ -513,7 +555,6 @@ package gui.itemWindows
|
||||
{
|
||||
gMainFrame.stage.focus = null;
|
||||
}
|
||||
showWasd();
|
||||
}
|
||||
|
||||
private function blockedAreHidden() : Boolean
|
||||
@@ -521,38 +562,16 @@ package gui.itemWindows
|
||||
return gMainFrame.userInfo.userVarCache.getUserVarValueById(9001) == 1;
|
||||
}
|
||||
|
||||
private function showHideBlocked() : void
|
||||
{
|
||||
var _loc1_:String = blockedAreHidden() ? "Show" : "Hide";
|
||||
_window.goNowBtn.down.txt.text = _loc1_;
|
||||
_window.goNowBtn.mouse.mouse.txt.text = _loc1_;
|
||||
_window.goNowBtn.mouse.up.txt.text = _loc1_;
|
||||
_window.labelTxtCont.labelTxt.text = blockedAreHidden() ? "Blocked players: hidden" : "Blocked players: shown";
|
||||
}
|
||||
|
||||
private function setHideBlocked(param1:Boolean) : void
|
||||
{
|
||||
gMainFrame.userInfo.userVarCache.updateUserVar(9001,param1 ? 1 : 0);
|
||||
AchievementXtCommManager.requestSetUserVar(9001,param1 ? 1 : 0);
|
||||
showHideBlocked();
|
||||
}
|
||||
|
||||
// "Custom pictures": the pictures players give their items, or every
|
||||
// item with its base's art (AJClient.customArtOn). user var 9006.
|
||||
private function showCustomArt() : void
|
||||
{
|
||||
var _loc1_:String = AJClient.customArtOn() ? "Hide" : "Show";
|
||||
_window.goNowBtn.down.txt.text = _loc1_;
|
||||
_window.goNowBtn.mouse.mouse.txt.text = _loc1_;
|
||||
_window.goNowBtn.mouse.up.txt.text = _loc1_;
|
||||
_window.labelTxtCont.labelTxt.text = AJClient.customArtOn() ? "Custom pictures: shown" : "Custom pictures: hidden";
|
||||
}
|
||||
|
||||
private function setCustomArt(param1:Boolean) : void
|
||||
{
|
||||
gMainFrame.userInfo.userVarCache.updateUserVar(9006,param1 ? 0 : 1);
|
||||
AchievementXtCommManager.requestSetUserVar(9006,param1 ? 0 : 1);
|
||||
showCustomArt();
|
||||
}
|
||||
|
||||
// "Expanded Inventory" (Strawberry Jam's): more, smaller items a row in
|
||||
@@ -727,7 +746,10 @@ package gui.itemWindows
|
||||
_chatButtons.outline = _loc2_;
|
||||
_loc1_.addChild(chatButton("Reset",380,397,110,"chat-reset"));
|
||||
_loc1_.addChild(chatButton("Save",505,397,125,"chat-save"));
|
||||
_chatStatus = chatText("",30,451,590,14,0x5A2C19,false);
|
||||
_loc2_ = chatButton("",30,441,190,"chat-animations");
|
||||
_loc1_.addChild(_loc2_);
|
||||
_chatButtons.animations = _loc2_;
|
||||
_chatStatus = chatText("",235,451,400,14,0x5A2C19,false);
|
||||
_loc1_.addChild(_chatStatus);
|
||||
_loc1_.addChild(chatButton("X",600,18,36,"chat-close"));
|
||||
GuiManager.guiLayer.addChild(_chatPopup);
|
||||
@@ -804,6 +826,7 @@ package gui.itemWindows
|
||||
setChatButton(_chatButtons.speed,"Speed: " + _chatStyle.speed + "%");
|
||||
setChatButton(_chatButtons.outline,"Outline: " + _chatStyle.outline + " px");
|
||||
setChatButton(_chatButtons.enabled,"Custom bubbles: " + (GuiManager.customChatBubblesEnabled() ? "On" : "Off"));
|
||||
setChatButton(_chatButtons.animations,"Animations: " + (GuiManager.chatBubbleAnimationsEnabled() ? "On" : "Off"));
|
||||
if(_chatSelectedStop < 0 || _chatSelectedStop >= _chatStops.length)
|
||||
{
|
||||
_chatSelectedStop = 0;
|
||||
@@ -1407,6 +1430,12 @@ package gui.itemWindows
|
||||
refreshChatPopup(false);
|
||||
_chatStatus.text = GuiManager.customChatBubblesEnabled() ? "Custom bubbles are visible on this client." : "Custom bubbles are hidden only on this client.";
|
||||
}
|
||||
else if(_loc3_ == "chat-animations")
|
||||
{
|
||||
GuiManager.setChatBubbleAnimationsEnabled(!GuiManager.chatBubbleAnimationsEnabled());
|
||||
refreshChatPopup(false);
|
||||
_chatStatus.text = GuiManager.chatBubbleAnimationsEnabled() ? "Bubbles move as their owners chose." : "Every bubble stands still on this client.";
|
||||
}
|
||||
else if(_loc3_ == "chat-save")
|
||||
{
|
||||
_loc4_ = 0;
|
||||
@@ -1435,6 +1464,7 @@ package gui.itemWindows
|
||||
var _loc3_:String = null;
|
||||
var _loc4_:Array = null;
|
||||
var _loc6_:int = 0;
|
||||
var _loc7_:Boolean = false;
|
||||
param1.stopPropagation();
|
||||
if(_currItem.type == MySettings.TOGGLE_TYPE_TOGGLE_BTN)
|
||||
{
|
||||
@@ -1447,6 +1477,13 @@ package gui.itemWindows
|
||||
case "music":
|
||||
handleMuteUnmute();
|
||||
break;
|
||||
case "wasd":
|
||||
case "hideBlocked":
|
||||
case "customArt":
|
||||
_loc7_ = !ownSwitchOn();
|
||||
setOwnSwitch(_loc7_);
|
||||
param1.currentTarget.toggleBtn.gotoAndPlay(_loc7_ ? "on" : "off");
|
||||
break;
|
||||
case "buddyRequest":
|
||||
case "gameInvites":
|
||||
case "doorBell":
|
||||
@@ -1564,8 +1601,7 @@ package gui.itemWindows
|
||||
}
|
||||
}
|
||||
}
|
||||
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||
setToggleLabels();
|
||||
}
|
||||
else if(_currItem.type == MySettings.TOGGLE_TYPE_CURSOR)
|
||||
{
|
||||
@@ -1653,18 +1689,9 @@ package gui.itemWindows
|
||||
}
|
||||
AJClient.runCommand(_loc3_);
|
||||
break;
|
||||
case "hideBlocked":
|
||||
setHideBlocked(!blockedAreHidden());
|
||||
break;
|
||||
case "customArt":
|
||||
setCustomArt(!AJClient.customArtOn());
|
||||
break;
|
||||
case "expandedInventory":
|
||||
setExpandedInventory(!AJClient.expandedInventoryOn());
|
||||
break;
|
||||
case "wasd":
|
||||
setWasd(!AJClient.wasdOn());
|
||||
break;
|
||||
case "performance":
|
||||
nextPerformance();
|
||||
break;
|
||||
@@ -1690,10 +1717,21 @@ package gui.itemWindows
|
||||
GuiManager.initEmailConfirmation(null,null,false);
|
||||
break;
|
||||
case "twoFactor":
|
||||
_loc3_ = gMainFrame.clientInfo.websiteURL + "parents";
|
||||
// the account page, where two-step sign-in is set up. the
|
||||
// game's webview may open no window: the page asks the
|
||||
// client to open it in the system browser (game.html
|
||||
// ajOpenPage), as the client's own Manage Account does.
|
||||
_loc3_ = gMainFrame.clientInfo.websiteURL + "account";
|
||||
try
|
||||
{
|
||||
navigateToURL(new URLRequest(_loc3_),"_blank");
|
||||
if(ExternalInterface.available)
|
||||
{
|
||||
ExternalInterface.call("ajOpenPage",_loc3_);
|
||||
}
|
||||
else
|
||||
{
|
||||
navigateToURL(new URLRequest(_loc3_),"_blank");
|
||||
}
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
|
||||
+17
-6
@@ -213,9 +213,14 @@ package gui
|
||||
"run":showSavedList
|
||||
*/
|
||||
},{
|
||||
"type":TOGGLE_TYPE_JOIN,
|
||||
// this server's switches, drawn as the Nametag row is: the two
|
||||
// choices named either side of the knob (ItemWindowToggle)
|
||||
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||
"frame":"wasd",
|
||||
"iconFrame":"world"
|
||||
"iconFrame":"world",
|
||||
"labelLabel":"WASD Movement",
|
||||
"onLabel":"On",
|
||||
"offLabel":"Off"
|
||||
},{
|
||||
"type":TOGGLE_TYPE_JOIN,
|
||||
"frame":"performance",
|
||||
@@ -233,14 +238,20 @@ package gui
|
||||
"frame":"camera",
|
||||
"iconFrame":"world"
|
||||
},{
|
||||
"type":TOGGLE_TYPE_JOIN,
|
||||
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||
"frame":"hideBlocked",
|
||||
"iconFrame":"buddyRequest"
|
||||
"iconFrame":"buddyRequest",
|
||||
"labelLabel":"Blocked Players",
|
||||
"onLabel":"Shown",
|
||||
"offLabel":"Hidden"
|
||||
},{
|
||||
// the pictures players give their items (AJClient.customArtOn)
|
||||
"type":TOGGLE_TYPE_JOIN,
|
||||
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||
"frame":"customArt",
|
||||
"iconFrame":"redeemCode"
|
||||
"iconFrame":"redeemCode",
|
||||
"labelLabel":"Custom Items",
|
||||
"onLabel":"Shown",
|
||||
"offLabel":"Hidden"
|
||||
},{
|
||||
// more, smaller items a row in the clothes and item pickers
|
||||
// (AJClient.expandedInventoryOn)
|
||||
|
||||
@@ -242,8 +242,7 @@ package gui
|
||||
_loc2_.addEventListener("change",onDetailTyped,false,0,true);
|
||||
_loc1_.x = -143;
|
||||
_loc1_.y = -19;
|
||||
LocalizationManager.updateToFit(_reportFromCard.bodyTxt,"Choose a REASON, tell the moderator what happened, then click REPORT.");
|
||||
_reportFromCard.bodyTxt.height = 48;
|
||||
_reportFromCard.bodyTxt.visible = false;
|
||||
_reportFromCard.addChildAt(_loc1_,_reportFromCard.getChildIndex(_reportFromCard.reasonChatTree));
|
||||
_detailBar = _loc1_;
|
||||
_detailInput = _loc2_;
|
||||
|
||||
@@ -173,7 +173,8 @@ package avatar
|
||||
{
|
||||
return;
|
||||
}
|
||||
AvatarManager.addAvatarMessage(param1,_playerSfsUserId,0);
|
||||
// the bubble comes with the server's echo, as typed chat's does, so
|
||||
// that it is drawn in the player's chat style (lib/world.js)
|
||||
addChatMessage(param1);
|
||||
gMainFrame.server.sendMessage(param2 + RAW_STR + 1);
|
||||
if(_chatHist.enableFreeChatValue)
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user