mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 17:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -131,6 +131,9 @@ module.exports = {
|
|||||||
// updates for installed clients, served at /client/ (the client's
|
// updates for installed clients, served at /client/ (the client's
|
||||||
// tools/make-update.js writes them here; they are in the repository)
|
// tools/make-update.js writes them here; they are in the repository)
|
||||||
clientUpdatesDir: env.AJ_CLIENT_UPDATES_DIR || path.join(__dirname, "client-updates"),
|
clientUpdatesDir: env.AJ_CLIENT_UPDATES_DIR || path.join(__dirname, "client-updates"),
|
||||||
|
// the client's installers, listed at /download. not in the repository:
|
||||||
|
// copied here by hand after a build (the client's BUILDING.md).
|
||||||
|
downloadsDir: env.AJ_DOWNLOADS_DIR || path.join(env.AJ_DATA_DIR || path.join(__dirname, "data"), "downloads"),
|
||||||
publicDir: path.join(__dirname, "public"),
|
publicDir: path.join(__dirname, "public"),
|
||||||
|
|
||||||
// accounts are made through the client's Create Account screens or the
|
// accounts are made through the client's Create Account screens or the
|
||||||
|
|||||||
+5
-1
@@ -48,6 +48,7 @@ const COLUMN_FIELDS = ["id", "username", "salt", "hash", "createdAt"];
|
|||||||
const SESSION_FIELDS = ["accountType", "isGuide", "isModerator", "membershipDays", "startInDen", "startRoom"];
|
const SESSION_FIELDS = ["accountType", "isGuide", "isModerator", "membershipDays", "startInDen", "startRoom"];
|
||||||
const DEFAULT_MEMBERSHIP_DAYS = 9999;
|
const DEFAULT_MEMBERSHIP_DAYS = 9999;
|
||||||
const MAX_ACCOUNT_TYPE = 5;
|
const MAX_ACCOUNT_TYPE = 5;
|
||||||
|
const MEMBERSHIP_TYPES = [0, 2]; // non-member, member
|
||||||
const MAX_MEMBERSHIP_DAYS = 99999;
|
const MAX_MEMBERSHIP_DAYS = 99999;
|
||||||
|
|
||||||
const USERNAME_PATTERN = /^[A-Za-z0-9 .-]{3,20}$/;
|
const USERNAME_PATTERN = /^[A-Za-z0-9 .-]{3,20}$/;
|
||||||
@@ -244,7 +245,10 @@ const MAX_START_ROOM = 80;
|
|||||||
function setLoginChoices(account, choices) {
|
function setLoginChoices(account, choices) {
|
||||||
const asked = config.loginChoices && choices && typeof choices === "object" ? choices : {};
|
const asked = config.loginChoices && choices && typeof choices === "object" ? choices : {};
|
||||||
const whole = (value, max) => Number.isInteger(value) && value >= 0 && value <= max;
|
const whole = (value, max) => Number.isInteger(value) && value >= 0 && value <= max;
|
||||||
account.accountType = whole(asked.accountType, MAX_ACCOUNT_TYPE) ? asked.accountType : config.defaultAccountType;
|
// member or not is the player's own choice on any server, the rest only
|
||||||
|
// with config.loginChoices: another account type shows to everyone.
|
||||||
|
const type = choices && typeof choices === "object" && MEMBERSHIP_TYPES.includes(choices.accountType) ? choices.accountType : asked.accountType;
|
||||||
|
account.accountType = whole(type, MAX_ACCOUNT_TYPE) ? type : config.defaultAccountType;
|
||||||
account.isGuide = asked.isGuide === true;
|
account.isGuide = asked.isGuide === true;
|
||||||
account.isModerator = asked.isModerator === true;
|
account.isModerator = asked.isModerator === true;
|
||||||
account.membershipDays = whole(asked.membershipDays, MAX_MEMBERSHIP_DAYS) ? asked.membershipDays : DEFAULT_MEMBERSHIP_DAYS;
|
account.membershipDays = whole(asked.membershipDays, MAX_MEMBERSHIP_DAYS) ? asked.membershipDays : DEFAULT_MEMBERSHIP_DAYS;
|
||||||
|
|||||||
+99
-1
@@ -59,6 +59,8 @@ const flashVars = () => ({
|
|||||||
deploy_version: config.deployVersion,
|
deploy_version: config.deployVersion,
|
||||||
// for the custom client: are its advanced login settings honoured here?
|
// for the custom client: are its advanced login settings honoured here?
|
||||||
loginChoices: config.loginChoices,
|
loginChoices: config.loginChoices,
|
||||||
|
// member or not may be chosen on any server (lib/accounts.js)
|
||||||
|
membershipChoice: true,
|
||||||
smoke_version: config.deployVersion,
|
smoke_version: config.deployVersion,
|
||||||
clientURL: `${config.baseUrl}${config.deployVersion}/ajclient.swf?v=${config.buildVersion}`,
|
clientURL: `${config.baseUrl}${config.deployVersion}/ajclient.swf?v=${config.buildVersion}`,
|
||||||
startupRoom: config.startupRoom,
|
startupRoom: config.startupRoom,
|
||||||
@@ -170,7 +172,42 @@ const keepClientError = text => {
|
|||||||
const THEMED_ROOM = /^(\d+)\/roomDefs\/theme_(\d+)\/(.+)$/;
|
const THEMED_ROOM = /^(\d+)\/roomDefs\/theme_(\d+)\/(.+)$/;
|
||||||
|
|
||||||
// the web pages, as against what the game and the client load
|
// the web pages, as against what the game and the client load
|
||||||
const SITE_PAGES = /^\/(?:register|terms|privacy|commands|shop|account|mod)?\/?$/;
|
const SITE_PAGES = /^\/(?:register|terms|privacy|commands|shop|account|mod|download)?\/?$/;
|
||||||
|
|
||||||
|
// the installers /download offers, those of them config.downloadsDir has
|
||||||
|
const DOWNLOADS = [
|
||||||
|
{file: "Burrow-Setup.exe", system: "Windows", detail: "SmartScreen may warn you about this file. Click 'More info', then 'Run anyway'."},
|
||||||
|
// shown as coming until there is one
|
||||||
|
{file: "Burrow-macos.dmg", system: "macOS", detail: "The first time: right-click Burrow, then Open", soon: true},
|
||||||
|
{file: "Burrow-x86_64.AppImage", system: "Linux", detail: "AppImage, for any distribution"},
|
||||||
|
{file: "burrow_amd64.deb", system: "Debian, Ubuntu, Mint", detail: ".deb"},
|
||||||
|
{file: "burrow.x86_64.rpm", system: "Fedora, openSUSE", detail: ".rpm"},
|
||||||
|
];
|
||||||
|
const DOWNLOAD_PATH = /^\/download\/(Burrow-Setup\.exe|Burrow-macos\.dmg|Burrow-x86_64\.AppImage|burrow_amd64\.deb|burrow\.x86_64\.rpm|SHA256SUMS)$/;
|
||||||
|
// a file's address carries this, so that a new upload is a new address that
|
||||||
|
// no cache (cloudflare keeps such files for hours) answers with the old one
|
||||||
|
const fileVersion = stat => `${stat.size.toString(36)}${Math.floor(stat.mtimeMs).toString(36)}`;
|
||||||
|
const statOf = file => fs.promises.stat(path.join(config.downloadsDir, file)).catch(() => null);
|
||||||
|
// what each installer is: RELEASES beside them, written by the client's
|
||||||
|
// build, a line each: "Burrow-Setup.exe 1.1.0 2026-10-14". a file it does
|
||||||
|
// not name shows the day it was put there.
|
||||||
|
const releasesOf = async () => {
|
||||||
|
const text = await fs.promises.readFile(path.join(config.downloadsDir, "RELEASES"), "utf8").catch(() => "");
|
||||||
|
const releases = {};
|
||||||
|
for (const line of text.split("\n")) {
|
||||||
|
const [file, version, date] = line.trim().split(/\s+/);
|
||||||
|
if (file) {
|
||||||
|
releases[file] = {version, date};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return releases;
|
||||||
|
};
|
||||||
|
const MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
||||||
|
const releaseLine = (release, stat) => {
|
||||||
|
const version = release && /^\d{1,5}\.\d{1,5}\.\d{1,5}$/.test(release.version) ? `Version ${release.version}` : "";
|
||||||
|
const day = release && /^\d{4}-\d{2}-\d{2}$/.test(release.date) ? new Date(`${release.date}T12:00:00Z`) : stat.mtime;
|
||||||
|
return [version, `${day.getUTCDate()} ${MONTHS[day.getUTCMonth()]} ${day.getUTCFullYear()}`].filter(Boolean).join(" · ");
|
||||||
|
};
|
||||||
|
|
||||||
// origins a client's own page has: a file, as browsers name it.
|
// origins a client's own page has: a file, as browsers name it.
|
||||||
const CLIENT_ORIGINS = ["null", "file://"];
|
const CLIENT_ORIGINS = ["null", "file://"];
|
||||||
@@ -210,6 +247,58 @@ const sendHomePage = async res => {
|
|||||||
.replace(/\{\{(\w+)\}\}/g, (whole, name) => (Object.hasOwn(HOME_VALUES, name) ? escapeHtml(HOME_VALUES[name]) : whole));
|
.replace(/\{\{(\w+)\}\}/g, (whole, name) => (Object.hasOwn(HOME_VALUES, name) ? escapeHtml(HOME_VALUES[name]) : whole));
|
||||||
send(res, 200, page, MIME[".html"]);
|
send(res, 200, page, MIME[".html"]);
|
||||||
};
|
};
|
||||||
|
const sendDownloadPage = async res => {
|
||||||
|
for (const [name, value] of Object.entries(PAGE_HEADERS)) {
|
||||||
|
res.setHeader(name, value);
|
||||||
|
}
|
||||||
|
const rows = [];
|
||||||
|
const releases = await releasesOf();
|
||||||
|
for (const entry of DOWNLOADS) {
|
||||||
|
const stat = await statOf(entry.file);
|
||||||
|
if (stat && stat.isFile()) {
|
||||||
|
rows.push(`<div class="row"><div><div class="system">${escapeHtml(entry.system)}</div>`
|
||||||
|
+ `<div class="detail">${escapeHtml(entry.detail)}</div>`
|
||||||
|
+ `<div class="detail">${escapeHtml(releaseLine(releases[entry.file], stat))} · ${Math.round(stat.size / 1048576)} MB</div></div>`
|
||||||
|
+ `<a class="get" href="/download/${entry.file}?v=${fileVersion(stat)}" download>Download</a></div>`);
|
||||||
|
}
|
||||||
|
else if (entry.soon) {
|
||||||
|
rows.push(`<div class="row"><div><div class="system">${escapeHtml(entry.system)}</div></div><span class="soon">Soon</span></div>`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const sums = await statOf("SHA256SUMS");
|
||||||
|
const values = {
|
||||||
|
rows: rows.length ? rows.join("\n ") : '<p class="none">Coming soon.</p>',
|
||||||
|
sums: sums ? `<a href="/download/SHA256SUMS?v=${fileVersion(sums)}">Checksums</a>` : "",
|
||||||
|
};
|
||||||
|
const page = (await fs.promises.readFile(path.join(config.publicDir, "download.html"), "utf8"))
|
||||||
|
.replace(/\{\{(\w+)\}\}/g, (whole, name) => (Object.hasOwn(values, name) ? values[name] : whole));
|
||||||
|
send(res, 200, page, MIME[".html"]);
|
||||||
|
};
|
||||||
|
|
||||||
|
// one installer, read from disk as it goes out: they are tens of MB.
|
||||||
|
const sendDownload = async (req, res, file) => {
|
||||||
|
const full = path.join(config.downloadsDir, file);
|
||||||
|
const stat = await statOf(file);
|
||||||
|
if (!stat || !stat.isFile()) {
|
||||||
|
send(res, 404, "Not found", "text/plain");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
res.writeHead(200, {
|
||||||
|
"Content-Type": file === "SHA256SUMS" ? "text/plain; charset=utf-8" : "application/octet-stream",
|
||||||
|
"Content-Length": stat.size,
|
||||||
|
"Content-Disposition": file === "SHA256SUMS" ? "inline" : `attachment; filename="${file}"`,
|
||||||
|
"Cache-Control": "public, max-age=86400",
|
||||||
|
});
|
||||||
|
if (req.method === "HEAD") {
|
||||||
|
res.end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const stream = fs.createReadStream(full);
|
||||||
|
stream.on("error", () => res.destroy());
|
||||||
|
res.on("close", () => stream.destroy());
|
||||||
|
stream.pipe(res);
|
||||||
|
};
|
||||||
|
|
||||||
const sendPage = async (res, file, headers = PAGE_HEADERS) => {
|
const sendPage = async (res, file, headers = PAGE_HEADERS) => {
|
||||||
for (const [name, value] of Object.entries(headers)) {
|
for (const [name, value] of Object.entries(headers)) {
|
||||||
res.setHeader(name, value);
|
res.setHeader(name, value);
|
||||||
@@ -512,6 +601,12 @@ const handle = async (req, res) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const download = (req.method === "GET" || req.method === "HEAD") && DOWNLOAD_PATH.exec(url.pathname);
|
||||||
|
if (download) {
|
||||||
|
await sendDownload(req, res, download[1]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// the badges and the Discord mark on player cards (public/badges/, lib/badges.js).
|
// the badges and the Discord mark on player cards (public/badges/, lib/badges.js).
|
||||||
const badgeArt = req.method === "GET" && /^\/badges\/([a-z0-9]{1,30}\.png)$/.exec(url.pathname);
|
const badgeArt = req.method === "GET" && /^\/badges\/([a-z0-9]{1,30}\.png)$/.exec(url.pathname);
|
||||||
if (badgeArt) {
|
if (badgeArt) {
|
||||||
@@ -522,6 +617,9 @@ const handle = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (route) {
|
switch (route) {
|
||||||
|
case "GET /download":
|
||||||
|
await sendDownloadPage(res);
|
||||||
|
return;
|
||||||
case "GET /register":
|
case "GET /register":
|
||||||
await sendPage(res, "register.html", CAPTCHA_PAGE_HEADERS);
|
await sendPage(res, "register.html", CAPTCHA_PAGE_HEADERS);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>Download Burrow</title>
|
||||||
|
<link rel="icon" type="image/png" href="/logo-square.png">
|
||||||
|
<style>
|
||||||
|
/* the look of the sign-up page: black and white, the game's text font,
|
||||||
|
rounded pills. the rows are filled in by the server (lib/http.js),
|
||||||
|
one for each installer it has. */
|
||||||
|
@font-face { font-family: "DigitalDelivery"; font-weight: 400; src: url("/fonts/CCDigitalDelivery-Regular.otf") format("opentype"); }
|
||||||
|
@font-face { font-family: "DigitalDelivery"; font-weight: 700; src: url("/fonts/CCDigitalDelivery-Bold.otf") format("opentype"); }
|
||||||
|
:root {
|
||||||
|
color-scheme: dark;
|
||||||
|
--bg: #000;
|
||||||
|
--panel: #0d0d0d;
|
||||||
|
--line: #2e2e2e;
|
||||||
|
--text: #fff;
|
||||||
|
--muted: #8c8c8c;
|
||||||
|
}
|
||||||
|
* { box-sizing: border-box; }
|
||||||
|
::selection { background: #fff; color: #000; }
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 40px 16px;
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
font: 15px/1.4 "DigitalDelivery", system-ui, "Segoe UI", sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
a { color: inherit; text-underline-offset: 3px; }
|
||||||
|
main {
|
||||||
|
max-width: 520px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 24px;
|
||||||
|
background: var(--panel);
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: 18px;
|
||||||
|
}
|
||||||
|
.logo { display: block; height: 72px; margin: 0 0 12px; }
|
||||||
|
h1 { margin: 0 0 14px; font-size: 26px; font-weight: 700; letter-spacing: 0.01em; }
|
||||||
|
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
|
||||||
|
.row div { flex: 1; min-width: 0; }
|
||||||
|
.system { font-weight: 700; }
|
||||||
|
.detail { color: var(--muted); font-size: 12px; }
|
||||||
|
.get {
|
||||||
|
flex: none;
|
||||||
|
padding: 7px 16px 8px;
|
||||||
|
border: 1px solid var(--text);
|
||||||
|
border-radius: 999px;
|
||||||
|
background: var(--text);
|
||||||
|
color: #000;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 14px;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: background 0.12s, border-color 0.12s;
|
||||||
|
}
|
||||||
|
.get:hover { background: #d9d9d9; border-color: #d9d9d9; }
|
||||||
|
.soon { flex: none; padding: 7px 16px 8px; border: 1px dashed var(--line); border-radius: 999px; color: var(--muted); font-size: 14px; }
|
||||||
|
.none { margin: 0; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); }
|
||||||
|
footer { max-width: 520px; margin: 14px auto 0; text-align: center; font-size: 13px; color: var(--muted); }
|
||||||
|
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<a href="/"><img class="logo" src="/logo.png" alt="Burrow"></a>
|
||||||
|
<h1>Download</h1>
|
||||||
|
{{rows}}
|
||||||
|
</main>
|
||||||
|
<footer><a href="/register">Create an account</a> · {{sums}}</footer>
|
||||||
|
<footer>Burrow is an unofficial fan project, not affiliated with WildWorks or Animal Jam. <a href="/terms">Terms</a> · <a href="/privacy">Privacy</a></footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+1987
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,488 @@
|
|||||||
|
package avatar
|
||||||
|
{
|
||||||
|
import collection.AccItemCollection;
|
||||||
|
import collection.IntItemCollection;
|
||||||
|
import com.sbi.debug.DebugUtility;
|
||||||
|
import flash.events.EventDispatcher;
|
||||||
|
import inventory.InventoryAccessoryItem;
|
||||||
|
import inventory.InventoryDenItem;
|
||||||
|
import item.Item;
|
||||||
|
import item.ItemXtCommManager;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
|
||||||
|
public class Avatar extends EventDispatcher
|
||||||
|
{
|
||||||
|
|
||||||
|
private var _avName:String;
|
||||||
|
|
||||||
|
private var _userName:String;
|
||||||
|
|
||||||
|
private var _uuid:String;
|
||||||
|
|
||||||
|
private var _sfsUserId:int;
|
||||||
|
|
||||||
|
private var _avInvId:int;
|
||||||
|
|
||||||
|
private var _perUserAvId:int;
|
||||||
|
|
||||||
|
private var _avTypeId:int;
|
||||||
|
|
||||||
|
private var _roomType:int;
|
||||||
|
|
||||||
|
private var _customAvId:int;
|
||||||
|
|
||||||
|
private var _isMannequin:Boolean;
|
||||||
|
|
||||||
|
private var _enviroTypeFlag:int;
|
||||||
|
|
||||||
|
private var _isSingleEnviro:Boolean;
|
||||||
|
|
||||||
|
private var _colors:Array;
|
||||||
|
|
||||||
|
private var _accState:AccessoryState;
|
||||||
|
|
||||||
|
public var inventoryClothing:InventoryAccessoryItem;
|
||||||
|
|
||||||
|
public var inventoryBodyMod:InventoryAccessoryItem;
|
||||||
|
|
||||||
|
public var inventoryDenFull:InventoryDenItem;
|
||||||
|
|
||||||
|
public var inventoryDenPartial:InventoryDenItem;
|
||||||
|
|
||||||
|
public var isShaman:Boolean;
|
||||||
|
|
||||||
|
public var shamanName:String;
|
||||||
|
|
||||||
|
public var shamanText:String;
|
||||||
|
|
||||||
|
public var rangedAttack:Array;
|
||||||
|
|
||||||
|
public var meleeAttack:Array;
|
||||||
|
|
||||||
|
public var fierceAttack:Array;
|
||||||
|
|
||||||
|
public var healingPower:Array;
|
||||||
|
|
||||||
|
public var defense:Array;
|
||||||
|
|
||||||
|
public function Avatar()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:int, param2:int, param3:String, param4:int, param5:Array, param6:int = -1, param7:AccessoryState = null, param8:String = "", param9:int = -1, param10:int = 0, param11:Array = null, param12:Array = null, param13:Array = null, param14:Array = null, param15:Array = null, param16:Boolean = false) : void
|
||||||
|
{
|
||||||
|
avTypeId = param4;
|
||||||
|
_perUserAvId = param1;
|
||||||
|
_avInvId = param2;
|
||||||
|
roomType = param10;
|
||||||
|
_customAvId = param6;
|
||||||
|
_isMannequin = param16;
|
||||||
|
_avName = param3;
|
||||||
|
rangedAttack = param11 == null ? [0,0] : param11;
|
||||||
|
meleeAttack = param12 == null ? [0,0] : param12;
|
||||||
|
fierceAttack = param13 == null ? [0,0] : param13;
|
||||||
|
healingPower = param14 == null ? [0,0] : param14;
|
||||||
|
defense = param15 == null ? [0,0] : param15;
|
||||||
|
if(param8 != "")
|
||||||
|
{
|
||||||
|
userName = param8;
|
||||||
|
}
|
||||||
|
_sfsUserId = param9;
|
||||||
|
_accState = new AccessoryState();
|
||||||
|
if(param7)
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace("Avatar init - copying accState");
|
||||||
|
_accState.copyShownAccRef(param7);
|
||||||
|
DebugUtility.debugTrace("old ownerAvatar:" + (_accState.ownerAvatar ? _accState.ownerAvatar.avName : _accState.ownerAvatar));
|
||||||
|
_accState.ownerAvatar = this;
|
||||||
|
DebugUtility.debugTrace("new ownerAvatar:" + _accState.ownerAvatar.avName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_accState.init(this);
|
||||||
|
}
|
||||||
|
if(param5)
|
||||||
|
{
|
||||||
|
copyColors(param5);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_colors = null;
|
||||||
|
}
|
||||||
|
inventoryClothing = new InventoryAccessoryItem();
|
||||||
|
inventoryBodyMod = new InventoryAccessoryItem();
|
||||||
|
inventoryDenFull = new InventoryDenItem();
|
||||||
|
inventoryDenPartial = new InventoryDenItem();
|
||||||
|
inventoryClothing.init(_accState);
|
||||||
|
inventoryBodyMod.init(_accState);
|
||||||
|
inventoryDenFull.init(_accState);
|
||||||
|
inventoryDenPartial.init(_accState);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
if(_accState)
|
||||||
|
{
|
||||||
|
_accState.destroy();
|
||||||
|
_accState = null;
|
||||||
|
}
|
||||||
|
if(inventoryClothing)
|
||||||
|
{
|
||||||
|
inventoryClothing.destroy();
|
||||||
|
inventoryClothing = null;
|
||||||
|
}
|
||||||
|
if(inventoryBodyMod)
|
||||||
|
{
|
||||||
|
inventoryBodyMod.destroy();
|
||||||
|
inventoryBodyMod = null;
|
||||||
|
}
|
||||||
|
if(inventoryDenFull)
|
||||||
|
{
|
||||||
|
inventoryDenFull.destroy();
|
||||||
|
inventoryDenFull = null;
|
||||||
|
}
|
||||||
|
if(inventoryDenPartial)
|
||||||
|
{
|
||||||
|
inventoryDenPartial.destroy();
|
||||||
|
inventoryDenPartial = null;
|
||||||
|
}
|
||||||
|
_colors = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get perUserAvId() : int
|
||||||
|
{
|
||||||
|
return _perUserAvId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set perUserAvId(param1:int) : void
|
||||||
|
{
|
||||||
|
_perUserAvId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get avInvId() : int
|
||||||
|
{
|
||||||
|
return _avInvId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set avInvId(param1:int) : void
|
||||||
|
{
|
||||||
|
_avInvId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get avName() : String
|
||||||
|
{
|
||||||
|
return LocalizationManager.translateAvatarName(_avName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set avName(param1:String) : void
|
||||||
|
{
|
||||||
|
_avName = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get userName() : String
|
||||||
|
{
|
||||||
|
return _userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set userName(param1:String) : void
|
||||||
|
{
|
||||||
|
_userName = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get uuid() : String
|
||||||
|
{
|
||||||
|
return _uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set uuid(param1:String) : void
|
||||||
|
{
|
||||||
|
_uuid = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get sfsUserId() : int
|
||||||
|
{
|
||||||
|
return _sfsUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set avTypeId(param1:int) : void
|
||||||
|
{
|
||||||
|
_avTypeId = param1;
|
||||||
|
_enviroTypeFlag = gMainFrame.userInfo.getAvatarEnviroTypeFlagByAvType(_avTypeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get avTypeId() : int
|
||||||
|
{
|
||||||
|
return _avTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get enviroTypeFlag() : int
|
||||||
|
{
|
||||||
|
return _enviroTypeFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set colors(param1:Array) : void
|
||||||
|
{
|
||||||
|
setColors(param1[0],param1[1],param1[2],_isMannequin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get colors() : Array
|
||||||
|
{
|
||||||
|
return _colors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get accShownItems() : AccItemCollection
|
||||||
|
{
|
||||||
|
return _accState.accShownItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get accShownItemsWithoutBodMods() : AccItemCollection
|
||||||
|
{
|
||||||
|
return _accState.accItemsWithoutBodMods;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get numClothingItemsShown() : int
|
||||||
|
{
|
||||||
|
return _accState.numClothingItemsShown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set roomType(param1:int) : void
|
||||||
|
{
|
||||||
|
_roomType = param1;
|
||||||
|
_isSingleEnviro = Utility.isLand(_enviroTypeFlag) && !Utility.isOcean(_enviroTypeFlag) || Utility.isOcean(_enviroTypeFlag) && !Utility.isLand(_enviroTypeFlag) || Utility.isAir(_enviroTypeFlag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get roomType() : int
|
||||||
|
{
|
||||||
|
return _roomType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get customAvId() : int
|
||||||
|
{
|
||||||
|
return _customAvId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set customAvId(param1:int) : void
|
||||||
|
{
|
||||||
|
_customAvId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get inUsePatternId() : int
|
||||||
|
{
|
||||||
|
return _accState.getAccessoryVisibleDefIdByLayer(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get inUseEyeId() : int
|
||||||
|
{
|
||||||
|
return _accState.getAccessoryVisibleDefIdByLayer(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function copyShownAccRefsFromAvatar(param1:Avatar) : void
|
||||||
|
{
|
||||||
|
_accState.copyShownAccRef(param1._accState);
|
||||||
|
inventoryBodyMod.itemCollection.setCoreArray(inventoryBodyMod.itemCollection.concatCollection(param1.inventoryBodyMod.itemCollection));
|
||||||
|
if(param1.inventoryClothing)
|
||||||
|
{
|
||||||
|
inventoryClothing.itemCollection.setCoreArray(inventoryClothing.itemCollection.concatCollection(param1.inventoryClothing.itemCollection));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function cloneShownAccFromAvatar(param1:Avatar) : void
|
||||||
|
{
|
||||||
|
_accState.cloneShownAcc(param1._accState);
|
||||||
|
inventoryBodyMod.itemCollection.setCoreArray(inventoryBodyMod.itemCollection.concatCollection(param1.inventoryBodyMod.itemCollection));
|
||||||
|
if(param1.inventoryClothing)
|
||||||
|
{
|
||||||
|
inventoryClothing.itemCollection.setCoreArray(inventoryClothing.itemCollection.concatCollection(param1.inventoryClothing.itemCollection));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function matchShownAcc(param1:AccessoryState) : void
|
||||||
|
{
|
||||||
|
_accState.matchShownItems(param1,inventoryClothing.itemCollection,inventoryBodyMod.itemCollection);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setColors(param1:uint, param2:uint, param3:uint, param4:Boolean = false) : void
|
||||||
|
{
|
||||||
|
if(_colors == null)
|
||||||
|
{
|
||||||
|
_colors = new Array(3);
|
||||||
|
}
|
||||||
|
var _loc15_:AvatarDef = gMainFrame.userInfo.getAvatarDefByAvType(_avTypeId,false);
|
||||||
|
var _loc5_:uint = uint(_loc15_ != null ? (param4 ? _loc15_.mannequinColorLayer1 : _loc15_.colorLayer1) : 0);
|
||||||
|
var _loc10_:int = param1 >> 24 & 0xFF;
|
||||||
|
var _loc11_:int = param1 >> 16 & 0xFF;
|
||||||
|
var _loc8_:int = _loc5_ >> 8 & 0xFF;
|
||||||
|
var _loc9_:int = _loc5_ & 0xFF;
|
||||||
|
var _loc6_:uint = uint(_loc15_ != null ? (param4 ? _loc15_.mannequinColorLayer3 : _loc15_.colorLayer3) : 0);
|
||||||
|
var _loc7_:int = param3 >> 24 & 0xFF;
|
||||||
|
var _loc14_:int = _loc6_ >> 16 & 0xFF;
|
||||||
|
var _loc13_:int = _loc6_ >> 8 & 0xFF;
|
||||||
|
var _loc12_:int = _loc6_ & 0xFF;
|
||||||
|
_colors[0] = uint(_loc10_ << 24 | _loc11_ << 16 | _loc8_ << 8 | _loc9_);
|
||||||
|
_colors[1] = param2;
|
||||||
|
_colors[2] = uint(_loc7_ << 24 | _loc14_ << 16 | _loc13_ << 8 | _loc12_);
|
||||||
|
if(!param4)
|
||||||
|
{
|
||||||
|
dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function copyColors(param1:Array) : void
|
||||||
|
{
|
||||||
|
colors = param1.concat();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function itemResponseIntegrate(param1:AccItemCollection, param2:Boolean = false) : void
|
||||||
|
{
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
var _loc5_:Item = null;
|
||||||
|
var _loc4_:Boolean = false;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
if(inventoryBodyMod && inventoryClothing)
|
||||||
|
{
|
||||||
|
removeAllItems();
|
||||||
|
_loc6_ = int(param1.length);
|
||||||
|
_loc4_ = _customAvId != -1;
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < _loc6_)
|
||||||
|
{
|
||||||
|
_loc5_ = param1.getAccItem(_loc3_);
|
||||||
|
if(_loc5_.type == 0)
|
||||||
|
{
|
||||||
|
if(ItemXtCommManager.canUseItem(_loc5_.defId,this,_loc4_))
|
||||||
|
{
|
||||||
|
inventoryBodyMod.addItem(_loc5_);
|
||||||
|
if(_loc5_.getInUse(_avInvId))
|
||||||
|
{
|
||||||
|
_accState.showAccessory(_loc5_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_loc5_.type == 1)
|
||||||
|
{
|
||||||
|
if(_isSingleEnviro || param2 || _loc5_.enviroType == _roomType || _loc5_.isLandAndOcean)
|
||||||
|
{
|
||||||
|
inventoryClothing.addItem(_loc5_);
|
||||||
|
if((param2 && _isSingleEnviro || _loc5_.enviroType == _roomType || _loc5_.isLandAndOcean) && _loc5_.getInUse(_avInvId))
|
||||||
|
{
|
||||||
|
_accState.showAccessory(_loc5_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace("ERROR: Bad item type: " + _loc5_.type);
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function accStateShowAccessory(param1:Item, param2:Function = null) : void
|
||||||
|
{
|
||||||
|
var _loc4_:Item = null;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc5_:AccItemCollection = param1.type == 0 ? inventoryBodyMod.itemCollection : inventoryClothing.itemCollection;
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
// up to three pieces of clothing may be worn in one place (head,
|
||||||
|
// neck, back, legs, tail) where the game allowed one: something
|
||||||
|
// comes off only to make room for a fourth. eyes and patterns are
|
||||||
|
// one at a time as ever.
|
||||||
|
if(param1.type != 0)
|
||||||
|
{
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < _loc5_.length)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc5_.getAccItem(_loc3_);
|
||||||
|
if(_loc4_ != param1 && _loc4_.enviroType == _roomType && _loc4_.layerId == param1.layerId && _loc4_.getInUse(_avInvId))
|
||||||
|
{
|
||||||
|
_loc6_++;
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc3_ = param1.type != 0 && _loc6_ < 3 ? _loc5_.length : 0;
|
||||||
|
while(_loc3_ < _loc5_.length)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc5_.getAccItem(_loc3_);
|
||||||
|
if((_loc4_.type == 0 || _loc4_.enviroType == _roomType) && _loc4_.layerId == param1.layerId && _loc4_.getInUse(_avInvId))
|
||||||
|
{
|
||||||
|
if(_loc4_ != param1)
|
||||||
|
{
|
||||||
|
accStateHideAccessory(_loc4_,false);
|
||||||
|
if(param2 != null)
|
||||||
|
{
|
||||||
|
param2(_loc4_);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
_accState.showAccessory(param1);
|
||||||
|
dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function accStateHideAccessory(param1:Item, param2:Boolean = true) : void
|
||||||
|
{
|
||||||
|
_accState.hideAccessory(param1);
|
||||||
|
if(param2)
|
||||||
|
{
|
||||||
|
dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function accStateHideAllClothingItems(param1:IntItemCollection) : void
|
||||||
|
{
|
||||||
|
_accState.hideAllClothingArticles(param1);
|
||||||
|
dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeAllItems() : void
|
||||||
|
{
|
||||||
|
inventoryBodyMod.itemCollection = new AccItemCollection();
|
||||||
|
inventoryClothing.itemCollection = new AccItemCollection();
|
||||||
|
_accState.removeAllItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get accState() : AccessoryState
|
||||||
|
{
|
||||||
|
return _accState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function replaceAccItem(param1:Item, param2:Item) : void
|
||||||
|
{
|
||||||
|
_accState.replaceAccessory(param1,param2);
|
||||||
|
dispatchEvent(new AvatarEvent("OnAvatarChanged"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function clone(param1:Avatar) : void
|
||||||
|
{
|
||||||
|
_avTypeId = param1.avTypeId;
|
||||||
|
_perUserAvId = param1.perUserAvId;
|
||||||
|
_avName = param1.avName;
|
||||||
|
userName = param1.userName;
|
||||||
|
_sfsUserId = param1._sfsUserId;
|
||||||
|
_accState = new AccessoryState();
|
||||||
|
_accState.init(this);
|
||||||
|
_accState.cloneShownAcc(param1.accState);
|
||||||
|
rangedAttack = param1.rangedAttack.concat();
|
||||||
|
meleeAttack = param1.meleeAttack.concat();
|
||||||
|
fierceAttack = param1.fierceAttack.concat();
|
||||||
|
healingPower = param1.healingPower.concat();
|
||||||
|
defense = param1.defense.concat();
|
||||||
|
copyColors(param1.colors);
|
||||||
|
inventoryClothing = new InventoryAccessoryItem();
|
||||||
|
inventoryClothing.clone(param1.inventoryClothing);
|
||||||
|
inventoryBodyMod = new InventoryAccessoryItem();
|
||||||
|
inventoryBodyMod.clone(param1.inventoryBodyMod);
|
||||||
|
inventoryDenFull = new InventoryDenItem();
|
||||||
|
inventoryDenFull.clone(param1.inventoryDenFull);
|
||||||
|
inventoryDenPartial = new InventoryDenItem();
|
||||||
|
inventoryDenPartial.clone(param1.inventoryDenPartial);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,610 @@
|
|||||||
|
package gui
|
||||||
|
{
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.display.Sprite;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import flash.geom.ColorTransform;
|
||||||
|
import flash.geom.Point;
|
||||||
|
import flash.geom.Rectangle;
|
||||||
|
import flash.utils.setTimeout;
|
||||||
|
import loader.MediaHelper;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
|
||||||
|
public dynamic class ChatBalloon extends MovieClip
|
||||||
|
{
|
||||||
|
|
||||||
|
private const CHAT_TIMEOUT_MS:int = 8000;
|
||||||
|
|
||||||
|
private const BALLOON_BEGIN_FADEOUT:Number = 1000;
|
||||||
|
|
||||||
|
private const BALLOON_MAX_ALPHA:Number = 0.75;
|
||||||
|
|
||||||
|
private const TEXT_COLOR_NORMAL:uint = 4477529;
|
||||||
|
|
||||||
|
private const TEXT_COLOR_BAD_TEXT:uint = 13369344;
|
||||||
|
|
||||||
|
private var _maxAlpha:Number;
|
||||||
|
|
||||||
|
private var _timeout:int = 0;
|
||||||
|
|
||||||
|
private var _avType:int = 0;
|
||||||
|
|
||||||
|
private var _originalFrameId:int = 0;
|
||||||
|
|
||||||
|
private var _originalCustomMsgText:String;
|
||||||
|
|
||||||
|
private var _emoteBG:MovieClip = null;
|
||||||
|
|
||||||
|
private var _emote:Sprite = null;
|
||||||
|
|
||||||
|
private var _permEmoteMediaId:int = -1;
|
||||||
|
|
||||||
|
private var _permEmoteMediaHelper:MediaHelper;
|
||||||
|
|
||||||
|
private var _hasSbTextfield:Boolean;
|
||||||
|
|
||||||
|
private var _msgTxt:Object;
|
||||||
|
|
||||||
|
private var _balloonBG:MovieClip;
|
||||||
|
|
||||||
|
private var _btnBallonBG:MovieClip;
|
||||||
|
|
||||||
|
private var _btnBalloonMouseBG:MovieClip;
|
||||||
|
|
||||||
|
private var _btnBalloonUpBG:MovieClip;
|
||||||
|
|
||||||
|
private var _btnBalloonDownBg:MovieClip;
|
||||||
|
|
||||||
|
private var _btnBalloonGrayBG:MovieClip;
|
||||||
|
|
||||||
|
private var _onCustomAdventureBtn:Function;
|
||||||
|
|
||||||
|
private var _onCustomPVPBtn:Function;
|
||||||
|
|
||||||
|
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.
|
||||||
|
private static const INLINE_GAP:String = " ";
|
||||||
|
|
||||||
|
private static const LONGEST_EMOTE_CODE:int = 16;
|
||||||
|
|
||||||
|
private var _inline:Array = [];
|
||||||
|
|
||||||
|
public function ChatBalloon()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:int, param2:Function, param3:Boolean = false, param4:int = 1, param5:Number = 1, param6:Class = null, param7:Function = null, param8:Function = null) : void
|
||||||
|
{
|
||||||
|
if(param5 < 0.75)
|
||||||
|
{
|
||||||
|
this.scaleX = this.scaleY = 1 + (0.75 - param5);
|
||||||
|
}
|
||||||
|
_originalFrameId = param4;
|
||||||
|
this.gotoAndStop(param4);
|
||||||
|
_balloonBG = this["balloon_bg"];
|
||||||
|
_msgTxt = this["message_txt"];
|
||||||
|
_onCustomAdventureBtn = param7;
|
||||||
|
_onCustomPVPBtn = param8;
|
||||||
|
_emoteBGOffsetFunc = param2;
|
||||||
|
_avType = param1;
|
||||||
|
visible = false;
|
||||||
|
_msgTxt.autoSize = "center";
|
||||||
|
if(param3)
|
||||||
|
{
|
||||||
|
_maxAlpha = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_maxAlpha = 0.75;
|
||||||
|
}
|
||||||
|
_emoteBG = GETDEFINITIONBYNAME("emo_bubble");
|
||||||
|
setEmoteBgOffsets();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setText(param1:String, param2:Boolean = false, param3:Boolean = true) : void
|
||||||
|
{
|
||||||
|
if(_emote)
|
||||||
|
{
|
||||||
|
_permEmoteMediaId = -1;
|
||||||
|
_emoteBG.itemWindow.removeChild(_emote);
|
||||||
|
_emote = null;
|
||||||
|
}
|
||||||
|
if(contains(_emoteBG))
|
||||||
|
{
|
||||||
|
removeChild(_emoteBG);
|
||||||
|
}
|
||||||
|
if(param1 != _msgTxt.text && _hasSbTextfield)
|
||||||
|
{
|
||||||
|
_balloonBG.visible = false;
|
||||||
|
setAlpha(_maxAlpha);
|
||||||
|
this.visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_balloonBG.visible = true;
|
||||||
|
setAlpha(_maxAlpha);
|
||||||
|
this.visible = true;
|
||||||
|
}
|
||||||
|
clearInline();
|
||||||
|
_msgTxt.text = param1.indexOf("\\") == -1 ? param1 : inlineEmotes(param1);
|
||||||
|
_msgTxt.height;
|
||||||
|
// AJClient.whisperNext is set by the server's "xw" just ahead of a
|
||||||
|
// whispered line.
|
||||||
|
_balloonBG.transform.colorTransform = AJClient.whisperNext ? AJClient.whisperTint() : new ColorTransform();
|
||||||
|
AJClient.whisperNext = false;
|
||||||
|
if(!_hasSbTextfield)
|
||||||
|
{
|
||||||
|
if(param3)
|
||||||
|
{
|
||||||
|
_balloonBG.m.height = Math.ceil(_msgTxt.height);
|
||||||
|
_balloonBG.m.y = _balloonBG.b.y - _balloonBG.m.height;
|
||||||
|
_balloonBG.t.y = _balloonBG.m.y - _balloonBG.t.height;
|
||||||
|
_msgTxt.y = -_balloonBG.b.height - _balloonBG.m.height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_balloonBG.m.height = Math.ceil(_msgTxt.height);
|
||||||
|
_balloonBG.b.y = _balloonBG.m.y + _balloonBG.m.height;
|
||||||
|
_msgTxt.y = _balloonBG.t.height + 3;
|
||||||
|
}
|
||||||
|
if(this.currentFrameLabel == "advBtn")
|
||||||
|
{
|
||||||
|
_btnBallonBG.y = _balloonBG.y + _balloonBG.t.y - _btnBallonBG.height + _balloonBG.t.height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(param2)
|
||||||
|
{
|
||||||
|
_msgTxt.textColor = 13369344;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_msgTxt.textColor = 4477529;
|
||||||
|
}
|
||||||
|
_timeout = 8000;
|
||||||
|
if(param3 && this.parent)
|
||||||
|
{
|
||||||
|
this.parent.addChild(this);
|
||||||
|
}
|
||||||
|
if(_inline.length > 0)
|
||||||
|
{
|
||||||
|
// now, and once more when the text has been laid out for sure
|
||||||
|
// (the game's own inline emotes, in SBTextField, wait a frame).
|
||||||
|
placeInline();
|
||||||
|
setTimeout(placeInline,42);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
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;
|
||||||
|
while(_loc3_ < param1.length)
|
||||||
|
{
|
||||||
|
_loc5_ = null;
|
||||||
|
if(param1.charAt(_loc3_) == "\\")
|
||||||
|
{
|
||||||
|
_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_--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc5_ != null)
|
||||||
|
{
|
||||||
|
_loc7_ = EmoticonUtility.getSmallSmileyMCForEmoteString(_loc5_);
|
||||||
|
if(_loc7_ != null)
|
||||||
|
{
|
||||||
|
_loc7_.mouseEnabled = false;
|
||||||
|
_loc7_.mouseChildren = false;
|
||||||
|
_inline.push({
|
||||||
|
"at":_loc2_.length,
|
||||||
|
"clip":_loc7_
|
||||||
|
});
|
||||||
|
_loc2_ += INLINE_GAP;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_ += _loc5_;
|
||||||
|
}
|
||||||
|
_loc3_ += 1 + _loc5_.length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_ += param1.charAt(_loc3_);
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
// puts each inline emote over its gap, as tall as the line.
|
||||||
|
private function placeInline() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Object = null;
|
||||||
|
var _loc2_:Rectangle = null;
|
||||||
|
var _loc3_:Rectangle = null;
|
||||||
|
for each(_loc1_ in _inline)
|
||||||
|
{
|
||||||
|
_loc2_ = _msgTxt.getCharBoundaries(_loc1_.at);
|
||||||
|
_loc3_ = _msgTxt.getCharBoundaries(_loc1_.at + INLINE_GAP.length - 1);
|
||||||
|
if(_loc2_ == null)
|
||||||
|
{
|
||||||
|
_loc2_ = _loc3_;
|
||||||
|
}
|
||||||
|
if(_loc3_ == null || _loc2_ != null && _loc3_.y != _loc2_.y)
|
||||||
|
{
|
||||||
|
_loc3_ = _loc2_;
|
||||||
|
}
|
||||||
|
if(_loc2_ != null)
|
||||||
|
{
|
||||||
|
_loc1_.clip.scaleX = _loc1_.clip.scaleY = 1;
|
||||||
|
_loc1_.clip.height = _loc2_.height;
|
||||||
|
_loc1_.clip.scaleX = _loc1_.clip.scaleY;
|
||||||
|
_loc1_.clip.x = _msgTxt.x + (_loc2_.x + _loc3_.x + _loc3_.width) / 2;
|
||||||
|
_loc1_.clip.y = _msgTxt.y + _loc2_.y + _loc2_.height / 2;
|
||||||
|
if(_loc1_.clip.parent != this)
|
||||||
|
{
|
||||||
|
addChild(_loc1_.clip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function clearInline() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Object = null;
|
||||||
|
for each(_loc1_ in _inline)
|
||||||
|
{
|
||||||
|
if(_loc1_.clip.parent == this)
|
||||||
|
{
|
||||||
|
removeChild(_loc1_.clip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_inline = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCustomAdventureMessage(param1:String, param2:String, param3:int, param4:Boolean = false, param5:Boolean = false) : void
|
||||||
|
{
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc8_:Array = param2.split("|");
|
||||||
|
if(param5)
|
||||||
|
{
|
||||||
|
param2 = _loc8_[0];
|
||||||
|
_loc6_ = int(_loc8_[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param2 = _loc8_[0];
|
||||||
|
_loc7_ = int(_loc8_[1]);
|
||||||
|
}
|
||||||
|
if(param2 == "on")
|
||||||
|
{
|
||||||
|
if(_emote && _emoteBG)
|
||||||
|
{
|
||||||
|
_emoteBG.itemWindow.removeChild(_emote);
|
||||||
|
_emote = null;
|
||||||
|
if(contains(_emoteBG))
|
||||||
|
{
|
||||||
|
removeChild(_emoteBG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(this.currentFrameLabel != "advBtn")
|
||||||
|
{
|
||||||
|
this.gotoAndStop("advBtn");
|
||||||
|
}
|
||||||
|
_balloonBG = this["balloon_bg"];
|
||||||
|
_btnBallonBG = this["btnBalloon_bg"];
|
||||||
|
_btnBalloonMouseBG = _btnBallonBG.mouse.mouse;
|
||||||
|
_btnBalloonUpBG = _btnBallonBG.mouse.up;
|
||||||
|
_btnBalloonDownBg = _btnBallonBG.down;
|
||||||
|
_btnBalloonGrayBG = _btnBallonBG.gray;
|
||||||
|
_btnBallonBG.isForPVP = param5;
|
||||||
|
_btnBallonBG.PVPGameId = _loc6_;
|
||||||
|
_btnBallonBG.scriptDefId = _loc7_;
|
||||||
|
_btnBallonBG.addEventListener("mouseDown",onBtnBG,false,0,true);
|
||||||
|
_msgTxt = this["message_txt"];
|
||||||
|
_msgTxt.autoSize = "center";
|
||||||
|
LocalizationManager.translateId(_btnBalloonMouseBG.message_txt,11259);
|
||||||
|
LocalizationManager.translateId(_btnBalloonUpBG.message_txt,11259);
|
||||||
|
LocalizationManager.translateId(_btnBalloonDownBg.message_txt,11259);
|
||||||
|
LocalizationManager.translateId(_btnBalloonGrayBG.message_txt,11259);
|
||||||
|
if(param3 > 0)
|
||||||
|
{
|
||||||
|
_btnBalloonMouseBG.message_txt.x = 3;
|
||||||
|
_btnBalloonUpBG.message_txt.x = 3;
|
||||||
|
_btnBalloonDownBg.message_txt.x = 3;
|
||||||
|
_btnBalloonGrayBG.message_txt.x = 3;
|
||||||
|
_btnBallonBG["redDot"].visible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_btnBalloonMouseBG.message_txt.x = 17;
|
||||||
|
_btnBalloonUpBG.message_txt.x = 17;
|
||||||
|
_btnBalloonDownBg.message_txt.x = 17;
|
||||||
|
_btnBalloonGrayBG.message_txt.x = 17;
|
||||||
|
_btnBallonBG["redDot"].visible = false;
|
||||||
|
}
|
||||||
|
_msgTxt.text = param1;
|
||||||
|
_originalCustomMsgText = param1;
|
||||||
|
_balloonBG.m.height = _msgTxt.height;
|
||||||
|
_balloonBG.m.y = _balloonBG.b.y - _msgTxt.height;
|
||||||
|
_balloonBG.t.y = _balloonBG.m.y - _balloonBG.t.height;
|
||||||
|
_msgTxt.y = -_balloonBG.b.height - _msgTxt.height;
|
||||||
|
_btnBallonBG.y = _balloonBG.y + _balloonBG.t.y - _btnBallonBG.height + _balloonBG.t.height;
|
||||||
|
if(this.itemWindow)
|
||||||
|
{
|
||||||
|
this.itemWindow.y = _btnBallonBG.y;
|
||||||
|
}
|
||||||
|
_balloonBG.t.alpha = 0;
|
||||||
|
setAlpha(_maxAlpha);
|
||||||
|
this.visible = true;
|
||||||
|
_timeout = 8000;
|
||||||
|
if(this.parent)
|
||||||
|
{
|
||||||
|
this.parent.addChild(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(_btnBallonBG)
|
||||||
|
{
|
||||||
|
if(_btnBallonBG.isForPVP != param5)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_btnBallonBG.removeEventListener("mouseDown",onBtnBG);
|
||||||
|
}
|
||||||
|
if(this.currentFrameLabel == "advBtn")
|
||||||
|
{
|
||||||
|
this.gotoAndStop(_originalFrameId);
|
||||||
|
}
|
||||||
|
_balloonBG = this["balloon_bg"];
|
||||||
|
_msgTxt = this["message_txt"];
|
||||||
|
_msgTxt.autoSize = "center";
|
||||||
|
this.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get msgTxt() : Object
|
||||||
|
{
|
||||||
|
return _msgTxt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isPvpCustom() : Boolean
|
||||||
|
{
|
||||||
|
if(_btnBallonBG)
|
||||||
|
{
|
||||||
|
return _btnBallonBG.isForPVP;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get pvpGameId() : int
|
||||||
|
{
|
||||||
|
if(_btnBallonBG)
|
||||||
|
{
|
||||||
|
return _btnBallonBG.PVPGameId;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCustomPVPImage(param1:MovieClip) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = NaN;
|
||||||
|
if(this.currentFrameLabel == "advBtn")
|
||||||
|
{
|
||||||
|
while(this.itemWindow.numChildren > 0)
|
||||||
|
{
|
||||||
|
this.itemWindow.removeChildAt(0);
|
||||||
|
}
|
||||||
|
param1 = param1.getChildAt(0) as MovieClip;
|
||||||
|
param1.gotoAndStop("icon");
|
||||||
|
_loc2_ = 32.5 / Math.max(param1.sizeCont.width,param1.sizeCont.height);
|
||||||
|
param1.scaleX = param1.scaleY = _loc2_;
|
||||||
|
param1.sizeCont.scaleX = param1.sizeCont.scaleY = _loc2_;
|
||||||
|
param1.x += param1.sizeCont.width * 0.5;
|
||||||
|
param1.y += param1.sizeCont.height * 0.5;
|
||||||
|
this.itemWindow.addChild(param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onBtnBG(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(param1.currentTarget.isForPVP)
|
||||||
|
{
|
||||||
|
_onCustomPVPBtn(param1.currentTarget.PVPGameId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_onCustomAdventureBtn(param1.currentTarget.scriptDefId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function updateCustAdventureBGSize(param1:MovieClip, param2:Object) : void
|
||||||
|
{
|
||||||
|
_balloonBG.m.height = _msgTxt.height;
|
||||||
|
_balloonBG.m.y = _balloonBG.b.y - _msgTxt.height;
|
||||||
|
_balloonBG.t.y = _balloonBG.m.y - _balloonBG.t.height;
|
||||||
|
_msgTxt.y = -_balloonBG.b.height - _msgTxt.height;
|
||||||
|
_btnBallonBG.y = _balloonBG.y + _balloonBG.t.y - _btnBallonBG.height + _balloonBG.t.height;
|
||||||
|
if(this.itemWindow)
|
||||||
|
{
|
||||||
|
this.itemWindow.y = _btnBallonBG.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmote(param1:Sprite, param2:int = -1) : void
|
||||||
|
{
|
||||||
|
if(this.currentFrameLabel != "advBtn")
|
||||||
|
{
|
||||||
|
_permEmoteMediaId = param2;
|
||||||
|
if(_emote)
|
||||||
|
{
|
||||||
|
_emoteBG.itemWindow.removeChild(_emote);
|
||||||
|
_emote = null;
|
||||||
|
}
|
||||||
|
if(_permEmoteMediaId >= 0)
|
||||||
|
{
|
||||||
|
param1 = new Sprite();
|
||||||
|
_permEmoteMediaHelper = new MediaHelper();
|
||||||
|
_permEmoteMediaHelper.init(_permEmoteMediaId,permEmoteMediaCallback);
|
||||||
|
}
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
_msgTxt.text = "";
|
||||||
|
addChild(_emoteBG);
|
||||||
|
_emote = param1;
|
||||||
|
_emote.y = -5;
|
||||||
|
_emoteBG.itemWindow.addChild(_emote);
|
||||||
|
if(_emote is MovieClip)
|
||||||
|
{
|
||||||
|
MovieClip(_emote).gotoAndPlay(1);
|
||||||
|
}
|
||||||
|
if(this.currentFrameLabel != "advBtn")
|
||||||
|
{
|
||||||
|
_timeout = 8000;
|
||||||
|
}
|
||||||
|
_balloonBG.visible = false;
|
||||||
|
setAlpha(1);
|
||||||
|
_emoteBG.bubble.alpha = _maxAlpha;
|
||||||
|
_emoteBG.itemWindow.alpha = 1;
|
||||||
|
this.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setReadyForClear() : void
|
||||||
|
{
|
||||||
|
if(this.visible && _timeout > 1000)
|
||||||
|
{
|
||||||
|
_timeout = 1000;
|
||||||
|
}
|
||||||
|
_permEmoteMediaId = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPos(param1:int, param2:int) : void
|
||||||
|
{
|
||||||
|
this.x = param1;
|
||||||
|
this.y = param2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function heartbeat(param1:int) : void
|
||||||
|
{
|
||||||
|
if(_timeout && _permEmoteMediaId < 0)
|
||||||
|
{
|
||||||
|
if(param1 >= _timeout)
|
||||||
|
{
|
||||||
|
_timeout = 0;
|
||||||
|
if(_emote)
|
||||||
|
{
|
||||||
|
_emoteBG.itemWindow.removeChild(_emote);
|
||||||
|
_emote = null;
|
||||||
|
}
|
||||||
|
if(this.currentFrameLabel != "advBtn")
|
||||||
|
{
|
||||||
|
this.visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_msgTxt.text = _originalCustomMsgText;
|
||||||
|
updateCustAdventureBGSize(_balloonBG,_msgTxt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_timeout -= param1;
|
||||||
|
if(this.currentFrameLabel != "advBtn" && _timeout < 1000)
|
||||||
|
{
|
||||||
|
setAlpha(_timeout / 1000 * _maxAlpha);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set avType(param1:int) : void
|
||||||
|
{
|
||||||
|
if(param1 != _avType)
|
||||||
|
{
|
||||||
|
_avType = param1;
|
||||||
|
setEmoteBgOffsets();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateEmoteBgOffsets() : void
|
||||||
|
{
|
||||||
|
setEmoteBgOffsets();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setAlpha(param1:Number) : void
|
||||||
|
{
|
||||||
|
this.alpha = param1;
|
||||||
|
_msgTxt.alpha = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function permEmoteMediaCallback(param1:MovieClip) : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc4_:Point = null;
|
||||||
|
var _loc3_:Number = NaN;
|
||||||
|
if(param1 && _emote && _permEmoteMediaId >= 0)
|
||||||
|
{
|
||||||
|
param1 = param1.getChildAt(0) as MovieClip;
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < param1.currentLabels.length)
|
||||||
|
{
|
||||||
|
if(param1.currentLabels[_loc2_].name == "icon")
|
||||||
|
{
|
||||||
|
param1.gotoAndStop("icon");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
if("sizeCont" in param1)
|
||||||
|
{
|
||||||
|
_loc4_ = new Point(param1.sizeCont.width,param1.sizeCont.height);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc4_ = new Point(param1.width,param1.height);
|
||||||
|
}
|
||||||
|
_loc3_ = 30 / Math.max(_loc4_.x,_loc4_.y);
|
||||||
|
param1.scaleX = param1.scaleY = _loc3_;
|
||||||
|
if("sizeCont" in param1)
|
||||||
|
{
|
||||||
|
param1.sizeCont.scaleX = param1.sizeCont.scaleY = _loc3_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param1.x -= param1.width * 0.5;
|
||||||
|
param1.y -= param1.height * 0.5;
|
||||||
|
}
|
||||||
|
_emote.addChild(param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setEmoteBgOffsets() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Point = _emoteBGOffsetFunc(_avType);
|
||||||
|
_emoteBG.x = _loc1_.x;
|
||||||
|
_emoteBG.y = _loc1_.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,871 @@
|
|||||||
|
package gui
|
||||||
|
{
|
||||||
|
import avatar.Avatar;
|
||||||
|
import avatar.AvatarManager;
|
||||||
|
import avatar.UserInfo;
|
||||||
|
import buddy.BuddyManager;
|
||||||
|
import com.sbi.analytics.SBTracker;
|
||||||
|
import com.sbi.popup.SBOkPopup;
|
||||||
|
import com.sbi.popup.SBYesNoPopup;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.events.Event;
|
||||||
|
import flash.events.KeyboardEvent;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import flash.events.TextEvent;
|
||||||
|
import flash.text.StyleSheet;
|
||||||
|
import flash.text.TextField;
|
||||||
|
import flash.ui.Mouse;
|
||||||
|
import gui.itemWindows.ItemWindowTextNode;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
import quest.QuestManager;
|
||||||
|
import room.RoomXtCommManager;
|
||||||
|
|
||||||
|
public class ChatHistory
|
||||||
|
{
|
||||||
|
|
||||||
|
private const CHAT_DIM_ALPHA:Number = 0.5;
|
||||||
|
|
||||||
|
private const CHAT_BRIGHT_ALPHA:Number = 1;
|
||||||
|
|
||||||
|
private var _keyListenersActive:Boolean;
|
||||||
|
|
||||||
|
private var _enableFreeChat:Boolean = true;
|
||||||
|
|
||||||
|
private var _predictiveTextManager:PredictiveTextManager;
|
||||||
|
|
||||||
|
private var _predictiveText:MovieClip;
|
||||||
|
|
||||||
|
private var _specialCharText:MovieClip;
|
||||||
|
|
||||||
|
private var _chatText:TextField;
|
||||||
|
|
||||||
|
private var _chatBarContainer:MovieClip;
|
||||||
|
|
||||||
|
private var _chatRepeatBtn:MovieClip;
|
||||||
|
|
||||||
|
private var _chatRepeatWindow:MovieClip;
|
||||||
|
|
||||||
|
private var _repeatChatWindows:WindowGenerator;
|
||||||
|
|
||||||
|
private var _chatRepeatArray:Array;
|
||||||
|
|
||||||
|
private var _hasSetupChatRepeatBtn:Boolean;
|
||||||
|
|
||||||
|
private var _isOverChatText:Boolean;
|
||||||
|
|
||||||
|
public var chatHistory:MovieClip;
|
||||||
|
|
||||||
|
public var chatUpDown:MovieClip;
|
||||||
|
|
||||||
|
public var chatMsgText:TextField;
|
||||||
|
|
||||||
|
public var chatSendBtn:MovieClip;
|
||||||
|
|
||||||
|
public var sendMsgCallback:Function;
|
||||||
|
|
||||||
|
public function ChatHistory(param1:MovieClip, param2:MovieClip, param3:MovieClip, param4:MovieClip, param5:TextField, param6:MovieClip, param7:Function, param8:MovieClip, param9:MovieClip, param10:MovieClip, param11:MovieClip)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
if(chatHistory)
|
||||||
|
{
|
||||||
|
throw new Error("ERROR: Singleton ChatHistory did not expect to be created twice!");
|
||||||
|
}
|
||||||
|
setupInitialItems(param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reload(param1:MovieClip, param2:MovieClip, param3:MovieClip, param4:MovieClip, param5:TextField, param6:MovieClip, param7:Function, param8:MovieClip, param9:MovieClip, param10:MovieClip, param11:MovieClip, param12:Boolean) : void
|
||||||
|
{
|
||||||
|
_keyListenersActive = true;
|
||||||
|
_isOverChatText = false;
|
||||||
|
if(chatHistory)
|
||||||
|
{
|
||||||
|
chatHistory.removeEventListener("mouseDown",chatClickHandler);
|
||||||
|
}
|
||||||
|
if(chatUpDown)
|
||||||
|
{
|
||||||
|
chatUpDown.removeEventListener("mouseDown",openCloseHandler);
|
||||||
|
}
|
||||||
|
if(_chatText)
|
||||||
|
{
|
||||||
|
_chatText.removeEventListener("mouseDown",chatClickHandler);
|
||||||
|
_chatText.removeEventListener("link",onChatLink);
|
||||||
|
_chatText.removeEventListener("mouseOver",overChatText);
|
||||||
|
_chatText.removeEventListener("mouseOut",outChatText);
|
||||||
|
}
|
||||||
|
if(chatMsgText)
|
||||||
|
{
|
||||||
|
chatMsgText.removeEventListener("keyDown",keyDownListener);
|
||||||
|
chatMsgText.removeEventListener("mouseDown",msgTextDownHandler);
|
||||||
|
if(Mouse["supportsNativeCursor"])
|
||||||
|
{
|
||||||
|
chatMsgText.removeEventListener("mouseOver",mouseOverMsgText);
|
||||||
|
chatMsgText.removeEventListener("mouseOut",mouseOutMsgText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_chatRepeatBtn)
|
||||||
|
{
|
||||||
|
_chatRepeatBtn.removeEventListener("mouseDown",onChatRepeatBtn);
|
||||||
|
}
|
||||||
|
_hasSetupChatRepeatBtn = false;
|
||||||
|
setupInitialItems(param1,param2,param3,param4,param5,param6,param7,param8,param9,param10,param11);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetChatPrivs(param1:Boolean = false) : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
if(Utility.canChat())
|
||||||
|
{
|
||||||
|
_loc2_ = int(gMainFrame.userInfo.sgChatType);
|
||||||
|
if(_loc2_ != 0 && _loc2_ != 3)
|
||||||
|
{
|
||||||
|
chatMsgText.restrict = "^%";
|
||||||
|
enableFreeChat(true);
|
||||||
|
if(param1 && _predictiveTextManager)
|
||||||
|
{
|
||||||
|
_predictiveTextManager.reload(chatMsgText,_predictiveText,_specialCharText,_chatBarContainer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_predictiveTextManager = new PredictiveTextManager();
|
||||||
|
_predictiveTextManager.init(chatMsgText,0,_predictiveText,_specialCharText,343,_chatBarContainer,sendMsgCallback);
|
||||||
|
}
|
||||||
|
if(_chatText)
|
||||||
|
{
|
||||||
|
_chatText.selectable = false;
|
||||||
|
_chatText.htmlText = "";
|
||||||
|
}
|
||||||
|
_enableFreeChat = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
enableFreeChat(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
enableFreeChat(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
chatMsgText.removeEventListener("keyDown",keyDownListener);
|
||||||
|
_keyListenersActive = false;
|
||||||
|
chatMsgText.removeEventListener("mouseDown",msgTextDownHandler);
|
||||||
|
if(_chatText)
|
||||||
|
{
|
||||||
|
_chatText.removeEventListener("mouseDown",chatClickHandler);
|
||||||
|
_chatText.removeEventListener("link",onChatLink);
|
||||||
|
_chatText.removeEventListener("mouseOver",overChatText);
|
||||||
|
_chatText.removeEventListener("mouseOut",outChatText);
|
||||||
|
_chatText = null;
|
||||||
|
}
|
||||||
|
chatHistory.removeEventListener("mouseDown",chatClickHandler);
|
||||||
|
chatHistory.visible = false;
|
||||||
|
chatHistory = null;
|
||||||
|
chatUpDown.removeEventListener("mouseDown",openCloseHandler);
|
||||||
|
chatUpDown.visible = false;
|
||||||
|
chatUpDown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showChatInput(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
chatUpDown.visible = param1;
|
||||||
|
chatMsgText.visible = param1;
|
||||||
|
if(chatSendBtn)
|
||||||
|
{
|
||||||
|
chatSendBtn.visible = param1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addMessageById(param1:int, param2:String) : void
|
||||||
|
{
|
||||||
|
var _loc4_:String = null;
|
||||||
|
var _loc3_:UserInfo = null;
|
||||||
|
var _loc5_:Avatar = AvatarManager.getAvatarBySfsUserId(param1);
|
||||||
|
if(_loc5_)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc5_.userName;
|
||||||
|
if(_loc4_ != null && _loc4_ != "_unknown")
|
||||||
|
{
|
||||||
|
_loc3_ = gMainFrame.userInfo.getUserInfoByUserName(_loc4_);
|
||||||
|
if(_loc3_)
|
||||||
|
{
|
||||||
|
addMessage(_loc5_.avName,_loc4_,_loc3_.getModeratedUserName(),param2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// what players typed is text, never markup: the chat window is an HTML
|
||||||
|
// text field, and a line with a tag in it would be drawn as one (an
|
||||||
|
// <img> fetched from wherever it names, by everyone who saw the line).
|
||||||
|
private static function plain(param1:String) : String
|
||||||
|
{
|
||||||
|
if(param1 == null)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return param1.split("&").join("&").split("<").join("<").split(">").join(">").split("\"").join(""");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addMessage(param1:String, param2:String, param3:String, param4:String) : void
|
||||||
|
{
|
||||||
|
var _loc5_:Boolean = false;
|
||||||
|
var _loc6_:* = 0;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc8_:String = null;
|
||||||
|
if(_chatText && param1 != null && param1.length > 0 && param2 && param4)
|
||||||
|
{
|
||||||
|
_chatText.htmlText += "<a href=\"event:" + plain(param2) + "\">" + plain(Utility.isSettingOn(MySettings.SETTINGS_USERNAME_BADGE) ? param3 : param1) + ": " + "</a>" + plain(param4) + "\n";
|
||||||
|
if(_chatRepeatWindow && AvatarManager.playerAvatar && param2.toLowerCase() == AvatarManager.playerAvatar.userName.toLowerCase())
|
||||||
|
{
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < _chatRepeatArray.length)
|
||||||
|
{
|
||||||
|
if(_chatRepeatArray[_loc7_] == param4)
|
||||||
|
{
|
||||||
|
_loc5_ = true;
|
||||||
|
_loc6_ = _loc7_;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
if(!_loc5_)
|
||||||
|
{
|
||||||
|
if(_chatRepeatArray.length >= 5)
|
||||||
|
{
|
||||||
|
_chatRepeatArray.shift();
|
||||||
|
}
|
||||||
|
_chatRepeatArray.push(param4);
|
||||||
|
onChatRepeatBtn(null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_chatRepeatArray.splice(_loc6_,1);
|
||||||
|
_chatRepeatArray.push(param4);
|
||||||
|
onChatRepeatBtn(null);
|
||||||
|
}
|
||||||
|
setupRepeatChat();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_chatText.htmlText += "\"" + plain(param4) + "\"" + "\n";
|
||||||
|
}
|
||||||
|
if(_chatText.numLines >= 100)
|
||||||
|
{
|
||||||
|
_loc8_ = _chatText.htmlText;
|
||||||
|
_chatText.htmlText = _loc8_.substr(_loc8_.indexOf("\n") + 1);
|
||||||
|
}
|
||||||
|
if(!_isOverChatText)
|
||||||
|
{
|
||||||
|
_chatText.scrollV = _chatText.maxScrollV;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeEmotesFromChatRepeat() : void
|
||||||
|
{
|
||||||
|
var _loc1_:int = 0;
|
||||||
|
if(_chatRepeatArray && _chatRepeatArray.length > 0)
|
||||||
|
{
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < _chatRepeatArray.length)
|
||||||
|
{
|
||||||
|
if(EmoticonUtility.doesStringMatchAnEmote(_chatRepeatArray[_loc1_]))
|
||||||
|
{
|
||||||
|
_chatRepeatArray.splice(_loc1_,1);
|
||||||
|
_loc1_--;
|
||||||
|
}
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
setupRepeatChat();
|
||||||
|
onChatRepeatBtn(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addPrivateMessage(param1:String, param2:String, param3:String) : void
|
||||||
|
{
|
||||||
|
if(_chatText)
|
||||||
|
{
|
||||||
|
if(param2 == null)
|
||||||
|
{
|
||||||
|
_chatText.htmlText += plain(param1) + ": " + plain(param3) + "\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_chatText.htmlText += plain(param1) + " to " + plain(param2) + ": " + plain(param3) + "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reAddKeyListeners() : void
|
||||||
|
{
|
||||||
|
if(!_keyListenersActive)
|
||||||
|
{
|
||||||
|
chatMsgText.addEventListener("keyDown",keyDownListener,false,0,true);
|
||||||
|
_keyListenersActive = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeKeyListeners() : void
|
||||||
|
{
|
||||||
|
if(_keyListenersActive)
|
||||||
|
{
|
||||||
|
chatMsgText.removeEventListener("keyDown",keyDownListener);
|
||||||
|
_keyListenersActive = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function clearChat() : void
|
||||||
|
{
|
||||||
|
if(_chatText)
|
||||||
|
{
|
||||||
|
_chatText.htmlText = "";
|
||||||
|
}
|
||||||
|
_chatRepeatArray = [];
|
||||||
|
setupRepeatChat();
|
||||||
|
onRepeatWindoesLoaded(true);
|
||||||
|
if(_chatText)
|
||||||
|
{
|
||||||
|
_chatText.scrollV = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function openChat() : void
|
||||||
|
{
|
||||||
|
if(chatHistory.currentFrameLabel != "open")
|
||||||
|
{
|
||||||
|
chatUpDown.gotoAndStop("down");
|
||||||
|
chatHistory.gotoAndPlay("open");
|
||||||
|
brightenChat();
|
||||||
|
AJAudio.playChatOpenSound();
|
||||||
|
closeChatRepeatWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function closeChatRepeatWindow() : void
|
||||||
|
{
|
||||||
|
if(_chatRepeatWindow && _chatRepeatWindow.visible)
|
||||||
|
{
|
||||||
|
_chatRepeatWindow.visible = false;
|
||||||
|
_chatRepeatBtn.downToUpState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function dimChat() : void
|
||||||
|
{
|
||||||
|
if(chatHistory && chatHistory.currentFrameLabel == "open" && chatHistory.alpha == 1)
|
||||||
|
{
|
||||||
|
chatHistory.alpha = 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function brightenChat() : void
|
||||||
|
{
|
||||||
|
if(chatHistory.alpha != 1)
|
||||||
|
{
|
||||||
|
chatHistory.alpha = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function closeChat() : void
|
||||||
|
{
|
||||||
|
if(chatHistory && chatHistory.currentFrameLabel != null && chatHistory.currentFrameLabel != "close")
|
||||||
|
{
|
||||||
|
_isOverChatText = false;
|
||||||
|
brightenChat();
|
||||||
|
chatUpDown.gotoAndStop("up");
|
||||||
|
chatHistory.gotoAndPlay("close");
|
||||||
|
AJAudio.playChatCloseSound();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get enableFreeChatValue() : Boolean
|
||||||
|
{
|
||||||
|
return _enableFreeChat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function enableFreeChat(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
_enableFreeChat = param1;
|
||||||
|
chatMsgText.text = "";
|
||||||
|
if(!param1)
|
||||||
|
{
|
||||||
|
chatMsgText.restrict = "";
|
||||||
|
if(_chatText)
|
||||||
|
{
|
||||||
|
_chatText.selectable = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
chatMsgText.restrict = "^%";
|
||||||
|
if(_chatText)
|
||||||
|
{
|
||||||
|
_chatText.selectable = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_specialCharText)
|
||||||
|
{
|
||||||
|
_specialCharText.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetTreeSearch() : void
|
||||||
|
{
|
||||||
|
if(_predictiveTextManager)
|
||||||
|
{
|
||||||
|
_predictiveTextManager.resetTreeSearch();
|
||||||
|
}
|
||||||
|
if(_predictiveTextManager && _predictiveTextManager.isAllowedFreeChat())
|
||||||
|
{
|
||||||
|
chatMsgText.restrict = "^%";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function doesChatContainText() : Boolean
|
||||||
|
{
|
||||||
|
if(chatMsgText.text != "")
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setFocusOnMsgText() : void
|
||||||
|
{
|
||||||
|
// with W, A, S and D walking, the box is typed in only after a
|
||||||
|
// click on it or Enter (room.RoomManagerView).
|
||||||
|
if(AJClient.wasdOn())
|
||||||
|
{
|
||||||
|
if(gMainFrame.stage.focus == chatMsgText)
|
||||||
|
{
|
||||||
|
gMainFrame.stage.focus = null;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(gMainFrame.userInfo.firstFiveMinutes <= 0 || gMainFrame.userInfo.sgChatType == 0 || gMainFrame.userInfo.sgChatType == 3 || !Utility.canChat())
|
||||||
|
{
|
||||||
|
gMainFrame.stage.focus = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gMainFrame.stage.focus = chatMsgText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setFocusToChatTextWithKeydown(param1:KeyboardEvent, param2:String) : void
|
||||||
|
{
|
||||||
|
if(gMainFrame.userInfo.firstFiveMinutes > 0)
|
||||||
|
{
|
||||||
|
gMainFrame.stage.focus = chatMsgText;
|
||||||
|
if(chatMsgText)
|
||||||
|
{
|
||||||
|
keyDownListener(param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gMainFrame.stage.focus = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggleInGameHud(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
chatMsgText.maxChars = 40;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
chatMsgText.maxChars = 70;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setupInitialItems(param1:MovieClip, param2:MovieClip, param3:MovieClip, param4:MovieClip, param5:TextField, param6:MovieClip, param7:Function, param8:MovieClip, param9:MovieClip, param10:MovieClip, param11:MovieClip) : void
|
||||||
|
{
|
||||||
|
var _loc13_:StyleSheet = null;
|
||||||
|
var _loc12_:Object = null;
|
||||||
|
_keyListenersActive = true;
|
||||||
|
chatHistory = param1;
|
||||||
|
_predictiveText = param8;
|
||||||
|
_specialCharText = param9;
|
||||||
|
_chatBarContainer = param2;
|
||||||
|
_chatRepeatBtn = param10;
|
||||||
|
_chatRepeatWindow = param11;
|
||||||
|
_chatRepeatArray = [];
|
||||||
|
_isOverChatText = false;
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
chatHistory.gotoAndStop(1);
|
||||||
|
chatHistory.addEventListener("mouseDown",chatClickHandler,false,0,true);
|
||||||
|
chatUpDown = param3;
|
||||||
|
chatUpDown.gotoAndStop(1);
|
||||||
|
chatUpDown["up"].mouse.gotoAndStop(1);
|
||||||
|
chatUpDown.addEventListener("mouseDown",openCloseHandler,false,0,true);
|
||||||
|
}
|
||||||
|
if(param4)
|
||||||
|
{
|
||||||
|
param4.glow.visible = false;
|
||||||
|
}
|
||||||
|
chatMsgText = param5;
|
||||||
|
toggleInGameHud(false);
|
||||||
|
chatMsgText.text = "";
|
||||||
|
if(gMainFrame.userInfo.sgChatType == 0 || gMainFrame.userInfo.sgChatType == 3)
|
||||||
|
{
|
||||||
|
chatMsgText.restrict = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
chatMsgText.restrict = "^%";
|
||||||
|
}
|
||||||
|
if(gMainFrame.userInfo.sgChatType != 2)
|
||||||
|
{
|
||||||
|
if(GuiManager.mainHud.ansChatBtn)
|
||||||
|
{
|
||||||
|
GuiManager.mainHud.ansChatBtn.visible = false;
|
||||||
|
}
|
||||||
|
param6 = GuiManager.mainHud.sendChatBtn;
|
||||||
|
if(param6)
|
||||||
|
{
|
||||||
|
param6.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(GuiManager.mainHud.sendChatBtn)
|
||||||
|
{
|
||||||
|
GuiManager.mainHud.sendChatBtn.visible = false;
|
||||||
|
}
|
||||||
|
param6 = GuiManager.mainHud.ansChatBtn;
|
||||||
|
if(param6)
|
||||||
|
{
|
||||||
|
param6.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(GuiManager.mainHud.emailChatBtn)
|
||||||
|
{
|
||||||
|
if((gMainFrame.clientInfo.userEmail == null || gMainFrame.clientInfo.userEmail == "") && (gMainFrame.clientInfo.pendingEmail == null || gMainFrame.clientInfo.pendingEmail == ""))
|
||||||
|
{
|
||||||
|
if(param6)
|
||||||
|
{
|
||||||
|
param6.visible = false;
|
||||||
|
}
|
||||||
|
param6 = GuiManager.mainHud.emailChatBtn;
|
||||||
|
if(param6)
|
||||||
|
{
|
||||||
|
param6.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GuiManager.mainHud.emailChatBtn.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_chatRepeatWindow)
|
||||||
|
{
|
||||||
|
_chatRepeatWindow.visible = false;
|
||||||
|
}
|
||||||
|
setupLanguageFlag();
|
||||||
|
param8.visible = false;
|
||||||
|
_chatText = GuiManager.mainHud.chatHistTxt;
|
||||||
|
chatSendBtn = param6;
|
||||||
|
sendMsgCallback = param7;
|
||||||
|
if(_chatText)
|
||||||
|
{
|
||||||
|
_chatText.addEventListener("mouseDown",chatClickHandler,false,0,true);
|
||||||
|
_chatText.addEventListener("link",onChatLink,false,0,true);
|
||||||
|
_chatText.addEventListener("mouseOver",overChatText,false,0,true);
|
||||||
|
_chatText.addEventListener("mouseOut",outChatText,false,0,true);
|
||||||
|
_loc13_ = new StyleSheet();
|
||||||
|
_loc12_ = {};
|
||||||
|
_loc12_.color = "#ff9900";
|
||||||
|
_loc13_.setStyle("a:hover",_loc12_);
|
||||||
|
_chatText.styleSheet = _loc13_;
|
||||||
|
}
|
||||||
|
chatMsgText.addEventListener("change",onTextFieldChanged,false,0,true);
|
||||||
|
chatMsgText.addEventListener("keyDown",keyDownListener,false,0,true);
|
||||||
|
chatMsgText.addEventListener("mouseDown",msgTextDownHandler,false,0,true);
|
||||||
|
if(Mouse["supportsNativeCursor"])
|
||||||
|
{
|
||||||
|
chatMsgText.addEventListener("mouseOver",mouseOverMsgText,false,0,true);
|
||||||
|
chatMsgText.addEventListener("mouseOut",mouseOutMsgText,false,0,true);
|
||||||
|
}
|
||||||
|
if(chatSendBtn)
|
||||||
|
{
|
||||||
|
chatSendBtn.addEventListener("mouseDown",sendChatBtnDownHandler,false,0,true);
|
||||||
|
}
|
||||||
|
setupRepeatChat();
|
||||||
|
resetChatPrivs();
|
||||||
|
setFocusOnMsgText();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setupRepeatChat() : void
|
||||||
|
{
|
||||||
|
if(_chatRepeatBtn)
|
||||||
|
{
|
||||||
|
if(gMainFrame.userInfo.isMember && _chatRepeatArray.length > 0)
|
||||||
|
{
|
||||||
|
_chatRepeatBtn.visible = true;
|
||||||
|
GuiManager.mainHud.bgChatRepeat.visible = true;
|
||||||
|
if(!_hasSetupChatRepeatBtn)
|
||||||
|
{
|
||||||
|
_chatRepeatBtn.addEventListener("mouseDown",onChatRepeatBtn,false,0,true);
|
||||||
|
}
|
||||||
|
_hasSetupChatRepeatBtn = true;
|
||||||
|
}
|
||||||
|
else if(_chatRepeatBtn.visible || GuiManager.mainHud.bgChatRepeat.visible)
|
||||||
|
{
|
||||||
|
_chatRepeatBtn.visible = false;
|
||||||
|
GuiManager.mainHud.bgChatRepeat.visible = false;
|
||||||
|
_chatRepeatBtn.removeEventListener("mouseDown",onChatRepeatBtn);
|
||||||
|
_hasSetupChatRepeatBtn = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setupLanguageFlag() : void
|
||||||
|
{
|
||||||
|
if(LocalizationManager.currentLanguage != LocalizationManager.accountLanguage)
|
||||||
|
{
|
||||||
|
_chatBarContainer.flag.gotoAndStop(LocalizationManager.currentLanguage + 1);
|
||||||
|
_chatBarContainer.text01_chat.width = 258.75;
|
||||||
|
_chatBarContainer.text01_chat.x = -130.5;
|
||||||
|
_chatBarContainer.flag.addEventListener("mouseDown",onEscapeFlagDown,false,0,true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_chatBarContainer.flag.gotoAndStop("off");
|
||||||
|
_chatBarContainer.text01_chat.width = 290.75;
|
||||||
|
_chatBarContainer.text01_chat.x = -162.5;
|
||||||
|
_chatBarContainer.flag.removeEventListener("mouseDown",onEscapeFlagDown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onEscapeFlagDown(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
new SBYesNoPopup(GuiManager.guiLayer,LocalizationManager.translatePreferredIdOnly(15989),true,onConfirmEscape);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onConfirmEscape(param1:Object) : void
|
||||||
|
{
|
||||||
|
if(param1.status)
|
||||||
|
{
|
||||||
|
if(QuestManager.inQuestRoom())
|
||||||
|
{
|
||||||
|
QuestManager.commandExit("flag");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RoomXtCommManager.sendRoomJoinRequest("jamaa_township.room_main#-1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function openCloseHandler(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(chatHistory.currentFrameLabel == "open")
|
||||||
|
{
|
||||||
|
closeChat();
|
||||||
|
}
|
||||||
|
else if(!param1.currentTarget["up"].isGray)
|
||||||
|
{
|
||||||
|
openChat();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function mouseOverMsgText(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
CursorManager.showICursor(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function mouseOutMsgText(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
CursorManager.showICursor(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function msgTextDownHandler(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(gMainFrame.userInfo.firstFiveMinutes > 0)
|
||||||
|
{
|
||||||
|
if(gMainFrame.userInfo.sgChatType == 0 || gMainFrame.userInfo.sgChatType == 3 || !Utility.canChat())
|
||||||
|
{
|
||||||
|
if(gMainFrame.userInfo.sgChatType != gMainFrame.userInfo.sgChatTypeNonDegraded)
|
||||||
|
{
|
||||||
|
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(18406));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14713));
|
||||||
|
}
|
||||||
|
gMainFrame.stage.focus = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
gMainFrame.stage.focus = chatMsgText;
|
||||||
|
if(_predictiveTextManager)
|
||||||
|
{
|
||||||
|
_predictiveTextManager.onTextClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gMainFrame.stage.focus = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function chatClickHandler(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
brightenChat();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onChatLink(param1:TextEvent) : void
|
||||||
|
{
|
||||||
|
if(param1.text && param1.text != "" && param1.text != gMainFrame.userInfo.myUserName)
|
||||||
|
{
|
||||||
|
BuddyManager.showBuddyCard({
|
||||||
|
"userName":param1.text,
|
||||||
|
"onlineStatus":0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function overChatText(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
_isOverChatText = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function outChatText(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
_isOverChatText = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onTextFieldChanged(param1:Event) : void
|
||||||
|
{
|
||||||
|
if(_predictiveTextManager)
|
||||||
|
{
|
||||||
|
_predictiveTextManager.onTextFieldChanged(param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function keyDownListener(param1:KeyboardEvent) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
if(_enableFreeChat)
|
||||||
|
{
|
||||||
|
if(_predictiveTextManager)
|
||||||
|
{
|
||||||
|
_predictiveTextManager.onKeyDown(param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if((param1.keyCode == 13 || param1.keyCode == 27) && AJClient.wasdOn())
|
||||||
|
{
|
||||||
|
gMainFrame.stage.focus = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function sendChatBtnDownHandler(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(!param1.currentTarget.isGray)
|
||||||
|
{
|
||||||
|
if(param1.currentTarget == GuiManager.mainHud.emailChatBtn)
|
||||||
|
{
|
||||||
|
GuiManager.initEmailConfirmation(null,null,false);
|
||||||
|
}
|
||||||
|
else if(gMainFrame.userInfo.sgChatType == 2)
|
||||||
|
{
|
||||||
|
if(LocalizationManager.accountLanguage != LocalizationManager.currentLanguage)
|
||||||
|
{
|
||||||
|
onEscapeFlagDown(null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FeedbackManager.openFeedbackPopup(19);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_enableFreeChat)
|
||||||
|
{
|
||||||
|
if(_predictiveTextManager)
|
||||||
|
{
|
||||||
|
_predictiveTextManager.onSendBtnDown(param1);
|
||||||
|
}
|
||||||
|
chatSendBtn.down.visible = false;
|
||||||
|
chatSendBtn.mouse.visible = true;
|
||||||
|
chatSendBtn.mouse.gotoAndPlay(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onChatRepeatBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(param1 == null || !param1.currentTarget.isGray)
|
||||||
|
{
|
||||||
|
if(param1 != null && _chatRepeatWindow.visible)
|
||||||
|
{
|
||||||
|
_chatRepeatWindow.visible = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1 == null && !_chatRepeatWindow.visible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_chatRepeatWindow.visible = true;
|
||||||
|
if(chatHistory.visible)
|
||||||
|
{
|
||||||
|
closeChat();
|
||||||
|
}
|
||||||
|
if(_repeatChatWindows)
|
||||||
|
{
|
||||||
|
_repeatChatWindows.destroy();
|
||||||
|
_repeatChatWindows = null;
|
||||||
|
}
|
||||||
|
while(_chatRepeatWindow.itemWindow.numChildren > 1)
|
||||||
|
{
|
||||||
|
_chatRepeatWindow.itemWindow.removeChildAt(1);
|
||||||
|
}
|
||||||
|
_repeatChatWindows = new WindowGenerator();
|
||||||
|
_repeatChatWindows.init(1,_chatRepeatArray.length,_chatRepeatArray.length,0,0,0,ItemWindowTextNode,_chatRepeatArray,"",{
|
||||||
|
"mouseDown":onRepeatChatSelected,
|
||||||
|
"mouseOver":null,
|
||||||
|
"mouseOut":null
|
||||||
|
},null,onRepeatWindoesLoaded);
|
||||||
|
_chatRepeatWindow.itemWindow.addChild(_repeatChatWindows);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRepeatWindoesLoaded(param1:Boolean = false) : void
|
||||||
|
{
|
||||||
|
if(_chatRepeatWindow)
|
||||||
|
{
|
||||||
|
_chatRepeatWindow.m.height = param1 ? 33 : Math.round(_repeatChatWindows.height);
|
||||||
|
_chatRepeatWindow.m.width = _chatRepeatWindow.t.width = _chatRepeatWindow.b.width = param1 ? 268 : _repeatChatWindows.width + 2;
|
||||||
|
_chatRepeatWindow.m.y = _chatRepeatWindow.b.y - _chatRepeatWindow.m.height;
|
||||||
|
_chatRepeatWindow.t.y = _chatRepeatWindow.m.y - _chatRepeatWindow.t.height;
|
||||||
|
_chatRepeatWindow.itemWindow.x = _chatRepeatWindow.m.x;
|
||||||
|
_chatRepeatWindow.itemWindow.y = _chatRepeatWindow.m.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRepeatChatSelected(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(!AvatarManager.playerAvatarWorldView.isSameMessage(param1.currentTarget.text))
|
||||||
|
{
|
||||||
|
sendMsgCallback(null,param1.currentTarget.text);
|
||||||
|
SBTracker.trackPageview("/game/play/popup/repeatChat/#repeat",-1,1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SBTracker.trackPageview("/game/play/popup/repeatChat/#repeatDeny",-1,1);
|
||||||
|
}
|
||||||
|
closeChatRepeatWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,497 @@
|
|||||||
|
package gui
|
||||||
|
{
|
||||||
|
import avatar.AvatarEditorView;
|
||||||
|
import com.sbi.graphics.PaletteHelper;
|
||||||
|
import flash.display.Bitmap;
|
||||||
|
import flash.display.BitmapData;
|
||||||
|
import flash.display.DisplayObjectContainer;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.display.Sprite;
|
||||||
|
import flash.events.Event;
|
||||||
|
import flash.events.KeyboardEvent;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import flash.geom.Rectangle;
|
||||||
|
import flash.text.TextField;
|
||||||
|
import flash.text.TextFormat;
|
||||||
|
|
||||||
|
public class ColorTable extends MovieClip
|
||||||
|
{
|
||||||
|
|
||||||
|
private static const HEX_ROW_HEIGHT:int = 24;
|
||||||
|
|
||||||
|
private static const EXPANDED_COLS:int = 20;
|
||||||
|
|
||||||
|
private static var _pending:Array = [];
|
||||||
|
|
||||||
|
private var _bm:Bitmap;
|
||||||
|
|
||||||
|
private var _bmd:BitmapData;
|
||||||
|
|
||||||
|
private var _id:int;
|
||||||
|
|
||||||
|
private var _currColor:int;
|
||||||
|
|
||||||
|
private var _currColorSwatch:Sprite;
|
||||||
|
|
||||||
|
private var _secretColorIdx:int;
|
||||||
|
|
||||||
|
private var _colorValues:Array;
|
||||||
|
|
||||||
|
private var _colorIndexes:Array;
|
||||||
|
|
||||||
|
private var _width:int;
|
||||||
|
|
||||||
|
private var _height:int;
|
||||||
|
|
||||||
|
private var _gridHeight:int;
|
||||||
|
|
||||||
|
private var _numRows:int;
|
||||||
|
|
||||||
|
private var _numCols:int;
|
||||||
|
|
||||||
|
private var _cellWidth:Number;
|
||||||
|
|
||||||
|
private var _cellHeight:Number;
|
||||||
|
|
||||||
|
private var _expanded:Boolean;
|
||||||
|
|
||||||
|
private var _hexInput:TextField;
|
||||||
|
|
||||||
|
private var _hexStatus:TextField;
|
||||||
|
|
||||||
|
private var _colorChangeCallback:Function;
|
||||||
|
|
||||||
|
public function ColorTable()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function compareSwatches(param1:Object, param2:Object) : int
|
||||||
|
{
|
||||||
|
if(param1.g != param2.g)
|
||||||
|
{
|
||||||
|
return param1.g < param2.g ? -1 : 1;
|
||||||
|
}
|
||||||
|
if(param1.h != param2.h)
|
||||||
|
{
|
||||||
|
return param1.h < param2.h ? -1 : 1;
|
||||||
|
}
|
||||||
|
if(param1.v != param2.v)
|
||||||
|
{
|
||||||
|
return param1.v < param2.v ? -1 : 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function allPaletteIndexes(param1:Array) : Array
|
||||||
|
{
|
||||||
|
var _loc2_:Array = [];
|
||||||
|
var _loc3_:Object = {};
|
||||||
|
var _loc4_:int = 0;
|
||||||
|
var _loc5_:uint = 0;
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
var _loc9_:int = 0;
|
||||||
|
var _loc10_:int = 0;
|
||||||
|
var _loc11_:Number = NaN;
|
||||||
|
var _loc12_:Array = [];
|
||||||
|
while(_loc4_ < param1.length && _loc4_ < 256)
|
||||||
|
{
|
||||||
|
_loc5_ = uint(param1[_loc4_]) & 0xFFFFFF;
|
||||||
|
if(_loc3_[_loc5_] == null)
|
||||||
|
{
|
||||||
|
_loc3_[_loc5_] = true;
|
||||||
|
_loc6_ = _loc5_ >> 16 & 0xFF;
|
||||||
|
_loc7_ = _loc5_ >> 8 & 0xFF;
|
||||||
|
_loc8_ = _loc5_ & 0xFF;
|
||||||
|
_loc9_ = Math.max(_loc6_,_loc7_,_loc8_);
|
||||||
|
_loc10_ = Math.min(_loc6_,_loc7_,_loc8_);
|
||||||
|
_loc11_ = 0;
|
||||||
|
if(_loc9_ != _loc10_)
|
||||||
|
{
|
||||||
|
if(_loc9_ == _loc6_)
|
||||||
|
{
|
||||||
|
_loc11_ = ((_loc7_ - _loc8_) / (_loc9_ - _loc10_) + 6) % 6;
|
||||||
|
}
|
||||||
|
else if(_loc9_ == _loc7_)
|
||||||
|
{
|
||||||
|
_loc11_ = (_loc8_ - _loc6_) / (_loc9_ - _loc10_) + 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc11_ = (_loc6_ - _loc7_) / (_loc9_ - _loc10_) + 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc2_.push({
|
||||||
|
"i":_loc4_,
|
||||||
|
"g":(_loc9_ - _loc10_ < 24 ? 0 : 1),
|
||||||
|
"h":(_loc9_ - _loc10_ < 24 ? 0 : Math.floor(_loc11_ * 4)),
|
||||||
|
"v":_loc6_ + _loc7_ + _loc8_
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
_loc2_.sort(compareSwatches);
|
||||||
|
_loc4_ = 0;
|
||||||
|
while(_loc4_ < _loc2_.length)
|
||||||
|
{
|
||||||
|
_loc12_.push(_loc2_[_loc4_].i);
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
return _loc12_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function onCustomRegistered(param1:uint, param2:Array) : void
|
||||||
|
{
|
||||||
|
var _loc3_:String = param2.join(",");
|
||||||
|
var _loc4_:int = 0;
|
||||||
|
var _loc5_:Object = null;
|
||||||
|
while(_loc4_ < _pending.length)
|
||||||
|
{
|
||||||
|
_loc5_ = _pending[_loc4_];
|
||||||
|
if(_loc5_.key == _loc3_)
|
||||||
|
{
|
||||||
|
_pending.splice(_loc4_,1);
|
||||||
|
ColorTable(_loc5_.table).applyCustom(int(_loc5_.u),param1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:int, param2:int, param3:int, param4:int, param5:int, param6:Array, param7:Array, param8:int, param9:Function, param10:int = -1) : void
|
||||||
|
{
|
||||||
|
_id = param1;
|
||||||
|
_width = param2;
|
||||||
|
_height = param3;
|
||||||
|
_gridHeight = param3;
|
||||||
|
_colorValues = param6;
|
||||||
|
_colorIndexes = param7;
|
||||||
|
_numCols = param4;
|
||||||
|
_numRows = param5;
|
||||||
|
_colorChangeCallback = param9;
|
||||||
|
_secretColorIdx = param10;
|
||||||
|
_expanded = param6 != null && param6 == PaletteHelper.gamePalette && (param7 == PaletteHelper.avatarPalette1 || param7 == PaletteHelper.avatarPalette2);
|
||||||
|
if(_expanded)
|
||||||
|
{
|
||||||
|
_colorIndexes = allPaletteIndexes(param6);
|
||||||
|
_numCols = EXPANDED_COLS;
|
||||||
|
_numRows = Math.ceil(_colorIndexes.length / EXPANDED_COLS);
|
||||||
|
_gridHeight = _height - HEX_ROW_HEIGHT;
|
||||||
|
_secretColorIdx = -1;
|
||||||
|
}
|
||||||
|
_cellWidth = _width / _numCols;
|
||||||
|
_cellHeight = _gridHeight / _numRows;
|
||||||
|
_bmd = new BitmapData(_width,_gridHeight,false,0);
|
||||||
|
fillColorTable();
|
||||||
|
_currColor = param8;
|
||||||
|
setCurrentColorSwatch(_currColor);
|
||||||
|
if(_expanded)
|
||||||
|
{
|
||||||
|
buildHexRow();
|
||||||
|
showHex(_currColor);
|
||||||
|
}
|
||||||
|
addEventListener("mouseDown",colorTableClickHandler,false,0,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
if(_bm)
|
||||||
|
{
|
||||||
|
this.removeChild(_bm);
|
||||||
|
_bm = null;
|
||||||
|
}
|
||||||
|
if(_bmd)
|
||||||
|
{
|
||||||
|
_bmd = null;
|
||||||
|
}
|
||||||
|
_colorIndexes = null;
|
||||||
|
_colorValues = null;
|
||||||
|
_colorChangeCallback = null;
|
||||||
|
removeEventListener("mouseDown",colorTableClickHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function fillColorTable() : void
|
||||||
|
{
|
||||||
|
var _loc1_:int = 0;
|
||||||
|
var _loc2_:Number = NaN;
|
||||||
|
var _loc3_:Number = NaN;
|
||||||
|
while(_loc1_ < _colorIndexes.length)
|
||||||
|
{
|
||||||
|
_loc2_ = _loc1_ % _numCols * _cellWidth;
|
||||||
|
_loc3_ = Math.floor(_loc1_ / _numCols) * _cellHeight;
|
||||||
|
_bmd.fillRect(new Rectangle(Math.round(_loc2_),Math.round(_loc3_),Math.ceil(_cellWidth),Math.ceil(_cellHeight)),uint(_colorValues[_colorIndexes[_loc1_]]) & 0xFFFFFF);
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
_bm = new Bitmap(_bmd);
|
||||||
|
this.addChild(_bm);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setCurrentColorSwatch(param1:int) : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = -1;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc4_:Number = NaN;
|
||||||
|
var _loc5_:Number = NaN;
|
||||||
|
var _loc6_:int = _expanded ? 2 : 5;
|
||||||
|
while(_loc3_ < _colorIndexes.length)
|
||||||
|
{
|
||||||
|
if(_colorIndexes[_loc3_] == param1)
|
||||||
|
{
|
||||||
|
_loc2_ = _loc3_;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
if(_currColorSwatch)
|
||||||
|
{
|
||||||
|
this.removeChild(_currColorSwatch);
|
||||||
|
_currColorSwatch = null;
|
||||||
|
}
|
||||||
|
if(_loc2_ >= 0)
|
||||||
|
{
|
||||||
|
_loc4_ = Math.round(_loc2_ % _numCols * _cellWidth);
|
||||||
|
_loc5_ = Math.round(Math.floor(_loc2_ / _numCols) * _cellHeight);
|
||||||
|
_currColorSwatch = new Sprite();
|
||||||
|
_currColorSwatch.mouseEnabled = false;
|
||||||
|
_currColorSwatch.graphics.beginFill(0);
|
||||||
|
_currColorSwatch.graphics.drawRect(_loc4_,_loc5_,_cellWidth,_loc6_);
|
||||||
|
_currColorSwatch.graphics.drawRect(_loc4_,_loc5_ + _cellHeight - _loc6_,_cellWidth,_loc6_);
|
||||||
|
_currColorSwatch.graphics.drawRect(_loc4_,_loc5_,_loc6_,_cellHeight);
|
||||||
|
_currColorSwatch.graphics.drawRect(_loc4_ + _cellWidth - _loc6_,_loc5_,_loc6_,_cellHeight);
|
||||||
|
_currColorSwatch.graphics.endFill();
|
||||||
|
this.addChild(_currColorSwatch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function buildHexRow() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Sprite = new Sprite();
|
||||||
|
var _loc2_:TextField = new TextField();
|
||||||
|
var _loc3_:TextFormat = new TextFormat("_sans",11,16777215,true);
|
||||||
|
_hexInput = new TextField();
|
||||||
|
_hexInput.defaultTextFormat = new TextFormat("_sans",12,2302234);
|
||||||
|
_hexInput.type = "input";
|
||||||
|
_hexInput.border = true;
|
||||||
|
_hexInput.borderColor = 10066329;
|
||||||
|
_hexInput.background = true;
|
||||||
|
_hexInput.backgroundColor = 16777215;
|
||||||
|
_hexInput.restrict = "0-9a-fA-F#";
|
||||||
|
_hexInput.maxChars = 7;
|
||||||
|
_hexInput.x = 0;
|
||||||
|
_hexInput.y = _gridHeight + 3;
|
||||||
|
_hexInput.width = 66;
|
||||||
|
_hexInput.height = 19;
|
||||||
|
_hexInput.addEventListener("keyDown",onHexKey);
|
||||||
|
_hexInput.addEventListener("keyUp",onHexKeyUp);
|
||||||
|
addChild(_hexInput);
|
||||||
|
_loc1_.graphics.beginFill(3112271);
|
||||||
|
_loc1_.graphics.drawRoundRect(0,0,40,19,6,6);
|
||||||
|
_loc1_.graphics.endFill();
|
||||||
|
_loc3_.align = "center";
|
||||||
|
_loc2_.defaultTextFormat = _loc3_;
|
||||||
|
_loc2_.selectable = false;
|
||||||
|
_loc2_.mouseEnabled = false;
|
||||||
|
_loc2_.width = 40;
|
||||||
|
_loc2_.height = 18;
|
||||||
|
_loc2_.text = "Set";
|
||||||
|
_loc1_.addChild(_loc2_);
|
||||||
|
_loc1_.x = 70;
|
||||||
|
_loc1_.y = _gridHeight + 3;
|
||||||
|
_loc1_.buttonMode = true;
|
||||||
|
_loc1_.mouseChildren = false;
|
||||||
|
_loc1_.addEventListener("click",onHexSetClick);
|
||||||
|
addChild(_loc1_);
|
||||||
|
_hexStatus = new TextField();
|
||||||
|
_hexStatus.defaultTextFormat = new TextFormat("_sans",10,5592405);
|
||||||
|
_hexStatus.selectable = false;
|
||||||
|
_hexStatus.mouseEnabled = false;
|
||||||
|
_hexStatus.x = 114;
|
||||||
|
_hexStatus.y = _gridHeight + 5;
|
||||||
|
_hexStatus.width = _width - 114;
|
||||||
|
_hexStatus.height = 18;
|
||||||
|
_hexStatus.text = "any colour, e.g. #FF8800";
|
||||||
|
addChild(_hexStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function showHex(param1:int) : void
|
||||||
|
{
|
||||||
|
var _loc2_:String = null;
|
||||||
|
if(_hexInput == null || param1 < 0 || param1 >= _colorValues.length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loc2_ = (uint(_colorValues[param1]) & 0xFFFFFF).toString(16).toUpperCase();
|
||||||
|
while(_loc2_.length < 6)
|
||||||
|
{
|
||||||
|
_loc2_ = "0" + _loc2_;
|
||||||
|
}
|
||||||
|
_hexInput.text = "#" + _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onHexKey(param1:KeyboardEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(param1.keyCode == 13)
|
||||||
|
{
|
||||||
|
applyHex();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onHexKeyUp(param1:KeyboardEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onHexSetClick(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
applyHex();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function applyHex() : void
|
||||||
|
{
|
||||||
|
var _loc1_:String = _hexInput.text.split("#").join("");
|
||||||
|
if(_loc1_.length != 6)
|
||||||
|
{
|
||||||
|
_hexStatus.text = "use 6 hex digits";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
applyRgb(uint(parseInt(_loc1_,16)) & 0xFFFFFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function colorSlot() : int
|
||||||
|
{
|
||||||
|
return _id == 0 || _id == 1 ? 0 : (_id == 2 ? 2 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function findView() : AvatarEditorView
|
||||||
|
{
|
||||||
|
var _loc1_:DisplayObjectContainer = parent;
|
||||||
|
var _loc2_:DisplayObjectContainer = null;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc4_:AvatarEditorView = null;
|
||||||
|
while(_loc1_ != null)
|
||||||
|
{
|
||||||
|
_loc2_ = _loc1_.getChildByName("charBox") as DisplayObjectContainer;
|
||||||
|
if(_loc2_ != null)
|
||||||
|
{
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < _loc2_.numChildren)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc2_.getChildAt(_loc3_) as AvatarEditorView;
|
||||||
|
if(_loc4_ != null)
|
||||||
|
{
|
||||||
|
return _loc4_;
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc1_ = _loc1_.parent;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function applyRgb(param1:uint) : void
|
||||||
|
{
|
||||||
|
var _loc2_:AvatarEditorView = findView();
|
||||||
|
var _loc3_:Array = null;
|
||||||
|
if(_loc2_ == null || _loc2_.colors == null)
|
||||||
|
{
|
||||||
|
if(_hexStatus != null)
|
||||||
|
{
|
||||||
|
_hexStatus.text = "not available here";
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loc3_ = PaletteHelper.resolve(uint(_loc2_.colors[colorSlot()]));
|
||||||
|
_loc3_[_id == 1 ? 1 : 0] = param1;
|
||||||
|
_pending.push({
|
||||||
|
"key":_loc3_.join(","),
|
||||||
|
"table":this,
|
||||||
|
"u":colorSlot()
|
||||||
|
});
|
||||||
|
PaletteHelper.onCustomRegistered = onCustomRegistered;
|
||||||
|
if(_hexStatus != null)
|
||||||
|
{
|
||||||
|
_hexStatus.text = "setting...";
|
||||||
|
}
|
||||||
|
gMainFrame.server.setXtObject_Str("xcc",_loc3_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyCustom(param1:int, param2:uint) : void
|
||||||
|
{
|
||||||
|
var _loc3_:AvatarEditorView = findView();
|
||||||
|
var _loc4_:Array = null;
|
||||||
|
if(_loc3_ == null || _loc3_.colors == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loc4_ = _loc3_.colors.concat();
|
||||||
|
_loc4_[param1] = param2;
|
||||||
|
_loc3_.colors = _loc4_;
|
||||||
|
_currColor = -1;
|
||||||
|
setCurrentColorSwatch(-1);
|
||||||
|
if(_hexStatus != null)
|
||||||
|
{
|
||||||
|
_hexStatus.text = "set";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function colorTableClickHandler(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = mouseX;
|
||||||
|
var _loc3_:Number = mouseY;
|
||||||
|
var _loc4_:int = -1;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc6_:AvatarEditorView = null;
|
||||||
|
if(_loc3_ < 0 || _loc3_ >= _gridHeight || _loc2_ < 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(_loc2_ >= _width)
|
||||||
|
{
|
||||||
|
if(_secretColorIdx == -1 || _loc3_ < _cellHeight * (_numRows - 1))
|
||||||
|
{
|
||||||
|
_loc2_ = _width - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc4_ = _secretColorIdx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc4_ < 0)
|
||||||
|
{
|
||||||
|
_loc5_ = Math.floor(_loc2_ / _cellWidth) + Math.floor(_loc3_ / _cellHeight) * _numCols;
|
||||||
|
if(_loc5_ < 0 || _loc5_ >= _colorIndexes.length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loc4_ = int(_colorIndexes[_loc5_]);
|
||||||
|
}
|
||||||
|
if(_expanded)
|
||||||
|
{
|
||||||
|
showHex(_loc4_);
|
||||||
|
_loc6_ = findView();
|
||||||
|
if(_loc6_ != null && _loc6_.colors != null && PaletteHelper.isCustom(uint(_loc6_.colors[colorSlot()])))
|
||||||
|
{
|
||||||
|
_currColor = _loc4_;
|
||||||
|
applyRgb(uint(_colorValues[_loc4_]) & 0xFFFFFF);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_currColor != _loc4_)
|
||||||
|
{
|
||||||
|
_currColor = _loc4_;
|
||||||
|
setCurrentColorSwatch(_loc4_);
|
||||||
|
if(_colorChangeCallback != null)
|
||||||
|
{
|
||||||
|
_colorChangeCallback(_id,_loc4_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,571 @@
|
|||||||
|
method
|
||||||
|
name null
|
||||||
|
returns null
|
||||||
|
|
||||||
|
body
|
||||||
|
maxstack 43
|
||||||
|
localcount 1
|
||||||
|
initscopedepth 0
|
||||||
|
maxscopedepth 1
|
||||||
|
|
||||||
|
code
|
||||||
|
getlocal0
|
||||||
|
pushscope
|
||||||
|
pushstring "emoMO_angry_sml"
|
||||||
|
pushstring "emoMO_combat_sml"
|
||||||
|
pushstring "emoMO_confused_sml"
|
||||||
|
pushstring "emoMO_laugh_sml"
|
||||||
|
pushstring "emoMO_phantom_sml"
|
||||||
|
pushstring "emoMO_sad_sml"
|
||||||
|
pushstring "emoMO_sleep_sml"
|
||||||
|
pushstring "emoMO_heartbreak_sml"
|
||||||
|
pushstring "emoMO_lovesick_sml"
|
||||||
|
pushstring "emoMO_ninja_sml"
|
||||||
|
pushstring "emoMO_sick_sml"
|
||||||
|
pushstring "emoMO_smiley_sml"
|
||||||
|
pushstring "emoMO_sunglasses_sml"
|
||||||
|
pushstring "emoMO_vampire_sml"
|
||||||
|
pushstring "emo_peace_sml"
|
||||||
|
pushstring "emo_angry_sml"
|
||||||
|
pushstring "emo_blush_sml"
|
||||||
|
pushstring "emo_confused_sml"
|
||||||
|
pushstring "emo_cool_sml"
|
||||||
|
pushstring "emo_cry_sml"
|
||||||
|
pushstring "emo_evil_sml"
|
||||||
|
pushstring "emo_grin_sml"
|
||||||
|
pushstring "emo_happy_sml"
|
||||||
|
pushstring "emo_laugh_sml"
|
||||||
|
pushstring "emo_love_sml"
|
||||||
|
pushstring "emo_rainy_sml"
|
||||||
|
pushstring "emo_sick_sml"
|
||||||
|
pushstring "emo_sleep_sml"
|
||||||
|
pushstring "emo_sneaky_sml"
|
||||||
|
pushstring "emo_surprise_sml"
|
||||||
|
pushstring "emo_think_sml"
|
||||||
|
pushstring "emo_tongue_sml"
|
||||||
|
pushstring "emo_wink_sml"
|
||||||
|
pushstring "emo_game_sml"
|
||||||
|
pushstring "emo_hearts_sml"
|
||||||
|
pushstring "emo_brokenHeart_sml"
|
||||||
|
pushstring "emo_burger_sml"
|
||||||
|
pushstring "emo_icecream_sml"
|
||||||
|
pushstring "emo_sword_sml"
|
||||||
|
pushstring "emo_star1_sml"
|
||||||
|
pushstring "emo_star2_sml"
|
||||||
|
pushstring "emo_star3_sml"
|
||||||
|
pushstring "emo_temp_sml"
|
||||||
|
newarray 43
|
||||||
|
findproperty QName(PrivateNamespace("gui:EmoticonUtility"),"displaySprites")
|
||||||
|
swap
|
||||||
|
setproperty QName(PrivateNamespace("gui:EmoticonUtility"),"displaySprites")
|
||||||
|
pushstring "emoMO_angry_sml"
|
||||||
|
pushstring "emoMO_combat_sml"
|
||||||
|
pushstring "emoMO_confused_sml"
|
||||||
|
pushstring "emoMO_laugh_sml"
|
||||||
|
pushstring "emoMO_phantom_sml"
|
||||||
|
pushstring "emoMO_sad_sml"
|
||||||
|
pushstring "emoMO_sleep_sml"
|
||||||
|
pushstring "emoMO_heartbreak_sml"
|
||||||
|
pushstring "emoMO_lovesick_sml"
|
||||||
|
pushstring "emoMO_ninja_sml"
|
||||||
|
pushstring "emoMO_sick_sml"
|
||||||
|
pushstring "emoMO_smiley_sml"
|
||||||
|
pushstring "emoMO_sunglasses_sml"
|
||||||
|
pushstring "emoMO_vampire_sml"
|
||||||
|
pushstring "emo_confused_sml"
|
||||||
|
pushstring "emo_love_sml"
|
||||||
|
pushstring "emo_rainy_sml"
|
||||||
|
pushstring "emo_sick_sml"
|
||||||
|
pushstring "emo_hearts_sml"
|
||||||
|
pushstring "emo_brokenHeart_sml"
|
||||||
|
pushstring "emo_sword_sml"
|
||||||
|
newarray 21
|
||||||
|
findproperty QName(PrivateNamespace("gui:EmoticonUtility"),"displaySpritesNotAllowedInPlayerWall")
|
||||||
|
swap
|
||||||
|
setproperty QName(PrivateNamespace("gui:EmoticonUtility"),"displaySpritesNotAllowedInPlayerWall")
|
||||||
|
pushstring "emoMO_angry"
|
||||||
|
pushstring "emoMO_combat"
|
||||||
|
pushstring "emoMO_confused"
|
||||||
|
pushstring "emoMO_laugh"
|
||||||
|
pushstring "emoMO_phantom"
|
||||||
|
pushstring "emoMO_sad"
|
||||||
|
pushstring "emoMO_sleep"
|
||||||
|
pushstring "emoMO_heartbreak"
|
||||||
|
pushstring "emoMO_lovesick"
|
||||||
|
pushstring "emoMO_ninja"
|
||||||
|
pushstring "emoMO_sick"
|
||||||
|
pushstring "emoMO_smiley"
|
||||||
|
pushstring "emoMO_sunglasses"
|
||||||
|
pushstring "emoMO_vampire"
|
||||||
|
pushstring "emo_peace"
|
||||||
|
pushstring "emo_angry"
|
||||||
|
pushstring "emo_blush"
|
||||||
|
pushstring "emo_confused"
|
||||||
|
pushstring "emo_cool"
|
||||||
|
pushstring "emo_cry"
|
||||||
|
pushstring "emo_evil"
|
||||||
|
pushstring "emo_grin"
|
||||||
|
pushstring "emo_happy"
|
||||||
|
pushstring "emo_laugh"
|
||||||
|
pushstring "emo_love"
|
||||||
|
pushstring "emo_rainy"
|
||||||
|
pushstring "emo_sick"
|
||||||
|
pushstring "emo_sleep"
|
||||||
|
pushstring "emo_sneaky"
|
||||||
|
pushstring "emo_surprise"
|
||||||
|
pushstring "emo_think"
|
||||||
|
pushstring "emo_tongue"
|
||||||
|
pushstring "emo_wink"
|
||||||
|
pushstring "emo_game"
|
||||||
|
pushstring "emo_hearts"
|
||||||
|
pushstring "emo_brokenHeart"
|
||||||
|
pushstring "emo_burger"
|
||||||
|
pushstring "emo_icecream"
|
||||||
|
pushstring "emo_sword"
|
||||||
|
pushstring "emo_star1"
|
||||||
|
pushstring "emo_star2"
|
||||||
|
pushstring "emo_star3"
|
||||||
|
pushstring "emo_temp"
|
||||||
|
newarray 43
|
||||||
|
findproperty QName(PrivateNamespace("gui:EmoticonUtility"),"emoteSprites")
|
||||||
|
swap
|
||||||
|
setproperty QName(PrivateNamespace("gui:EmoticonUtility"),"emoteSprites")
|
||||||
|
newobject 0
|
||||||
|
findproperty QName(PrivateNamespace("gui:EmoticonUtility"),"_emoteStrings")
|
||||||
|
swap
|
||||||
|
setproperty QName(PrivateNamespace("gui:EmoticonUtility"),"_emoteStrings")
|
||||||
|
newobject 0
|
||||||
|
findproperty QName(PrivateNamespace("gui:EmoticonUtility"),"_emoteChatStrings")
|
||||||
|
swap
|
||||||
|
setproperty QName(PrivateNamespace("gui:EmoticonUtility"),"_emoteChatStrings")
|
||||||
|
getlex QName(PrivateNamespace("gui:EmoticonUtility"),"_emoteStrings")
|
||||||
|
pushstring "emoMO_angry"
|
||||||
|
pushstring ":mad:"
|
||||||
|
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 "emoMO_combat"
|
||||||
|
pushstring ":scuffle:"
|
||||||
|
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 "emoMO_confused"
|
||||||
|
pushstring ":puzzle:"
|
||||||
|
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 "emoMO_laugh"
|
||||||
|
pushstring ":joy:"
|
||||||
|
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 "emoMO_phantom"
|
||||||
|
pushstring ":phantom:"
|
||||||
|
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 "emoMO_sad"
|
||||||
|
pushstring ":sad:"
|
||||||
|
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 "emoMO_sleep"
|
||||||
|
pushstring ":sleepy:"
|
||||||
|
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 "emoMO_heartbreak"
|
||||||
|
pushstring ":breakingheart:"
|
||||||
|
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 "emoMO_lovesick"
|
||||||
|
pushstring ":lovesick:"
|
||||||
|
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 "emoMO_ninja"
|
||||||
|
pushstring ":ninja:"
|
||||||
|
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 "emoMO_sick"
|
||||||
|
pushstring ":queasy:"
|
||||||
|
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 "emoMO_smiley"
|
||||||
|
pushstring ":smiley:"
|
||||||
|
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 "emoMO_sunglasses"
|
||||||
|
pushstring ":sunglasses:"
|
||||||
|
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 "emoMO_vampire"
|
||||||
|
pushstring ":vampire:"
|
||||||
|
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_peace"
|
||||||
|
pushstring ":peace:"
|
||||||
|
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_angry"
|
||||||
|
pushstring ":angry:"
|
||||||
|
pushstring "X("
|
||||||
|
pushstring "X-("
|
||||||
|
newarray 3
|
||||||
|
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_blush"
|
||||||
|
pushstring ":blush:"
|
||||||
|
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_brokenHeart"
|
||||||
|
pushstring ":brokenheart:"
|
||||||
|
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_burger"
|
||||||
|
pushstring ":burger:"
|
||||||
|
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_confused"
|
||||||
|
pushstring ":confused:"
|
||||||
|
pushstring ":/"
|
||||||
|
newarray 2
|
||||||
|
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_cool"
|
||||||
|
pushstring ":cool:"
|
||||||
|
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_cry"
|
||||||
|
pushstring ":cry:"
|
||||||
|
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_evil"
|
||||||
|
pushstring ":evil:"
|
||||||
|
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_game"
|
||||||
|
pushstring ":game:"
|
||||||
|
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_grin"
|
||||||
|
pushstring ":D"
|
||||||
|
pushstring ":grin:"
|
||||||
|
newarray 2
|
||||||
|
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_happy"
|
||||||
|
pushstring ":)"
|
||||||
|
pushstring ":happy:"
|
||||||
|
newarray 2
|
||||||
|
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_hearts"
|
||||||
|
pushstring ":hearts:"
|
||||||
|
pushstring "<3<3<3"
|
||||||
|
newarray 2
|
||||||
|
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_icecream"
|
||||||
|
pushstring ":icecream:"
|
||||||
|
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_laugh"
|
||||||
|
pushstring ":laugh:"
|
||||||
|
pushstring ":))"
|
||||||
|
newarray 2
|
||||||
|
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_love"
|
||||||
|
pushstring ":love:"
|
||||||
|
pushstring "(l)"
|
||||||
|
pushstring "(L)"
|
||||||
|
pushstring "(^_^)<3"
|
||||||
|
newarray 4
|
||||||
|
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_rainy"
|
||||||
|
pushstring ":rainy:"
|
||||||
|
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_sick"
|
||||||
|
pushstring ":sick:"
|
||||||
|
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_sleep"
|
||||||
|
pushstring ":tired:"
|
||||||
|
pushstring "|)"
|
||||||
|
pushstring "|-)"
|
||||||
|
pushstring ":zzz:"
|
||||||
|
pushstring "-_-"
|
||||||
|
pushstring "-_-zzz"
|
||||||
|
pushstring "--_"
|
||||||
|
newarray 7
|
||||||
|
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_sneaky"
|
||||||
|
pushstring ":sneaky:"
|
||||||
|
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_surprise"
|
||||||
|
pushstring ":surprise:"
|
||||||
|
pushstring ":O"
|
||||||
|
pushstring ":-O"
|
||||||
|
newarray 3
|
||||||
|
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_sword"
|
||||||
|
pushstring ":sword:"
|
||||||
|
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_think"
|
||||||
|
pushstring ":think:"
|
||||||
|
pushstring ":?"
|
||||||
|
newarray 2
|
||||||
|
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_tongue"
|
||||||
|
pushstring ":P"
|
||||||
|
pushstring ":p"
|
||||||
|
pushstring ":tongue:"
|
||||||
|
newarray 3
|
||||||
|
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_wink"
|
||||||
|
pushstring ":wink:"
|
||||||
|
pushstring ";)"
|
||||||
|
pushstring ";-)"
|
||||||
|
newarray 3
|
||||||
|
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_star1"
|
||||||
|
pushstring ":singlestar:"
|
||||||
|
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_star2"
|
||||||
|
pushstring ":doublestar:"
|
||||||
|
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_star3"
|
||||||
|
pushstring ":triplestar:"
|
||||||
|
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 "emoMO_angry"
|
||||||
|
pushstring ":mad:"
|
||||||
|
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 "emoMO_combat"
|
||||||
|
pushstring ":scuffle:"
|
||||||
|
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 "emoMO_laugh"
|
||||||
|
pushstring ":joy:"
|
||||||
|
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 "emoMO_phantom"
|
||||||
|
pushstring ":phantom:"
|
||||||
|
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 "emoMO_sad"
|
||||||
|
pushstring ":sad:"
|
||||||
|
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 "emoMO_sleep"
|
||||||
|
pushstring ":sleepy:"
|
||||||
|
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 "emoMO_heartbreak"
|
||||||
|
pushstring ":breakingheart:"
|
||||||
|
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 "emoMO_lovesick"
|
||||||
|
pushstring ":lovesick:"
|
||||||
|
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 "emoMO_ninja"
|
||||||
|
pushstring ":ninja:"
|
||||||
|
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 "emoMO_sick"
|
||||||
|
pushstring ":queasy:"
|
||||||
|
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 "emoMO_smiley"
|
||||||
|
pushstring ":smiley:"
|
||||||
|
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 "emoMO_sunglasses"
|
||||||
|
pushstring ":sunglasses:"
|
||||||
|
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 "emoMO_vampire"
|
||||||
|
pushstring ":vampire:"
|
||||||
|
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_peace"
|
||||||
|
pushstring ":peace:"
|
||||||
|
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_angry"
|
||||||
|
pushstring ":angry:"
|
||||||
|
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_blush"
|
||||||
|
pushstring ":blush:"
|
||||||
|
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_burger"
|
||||||
|
pushstring ":burger:"
|
||||||
|
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_cool"
|
||||||
|
pushstring ":cool:"
|
||||||
|
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_cry"
|
||||||
|
pushstring ":cry:"
|
||||||
|
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_evil"
|
||||||
|
pushstring ":evil:"
|
||||||
|
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_game"
|
||||||
|
pushstring ":game:"
|
||||||
|
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_grin"
|
||||||
|
pushstring ":D"
|
||||||
|
pushstring ":grin:"
|
||||||
|
newarray 2
|
||||||
|
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_happy"
|
||||||
|
pushstring ":)"
|
||||||
|
pushstring ":happy:"
|
||||||
|
newarray 2
|
||||||
|
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_icecream"
|
||||||
|
pushstring ":icecream:"
|
||||||
|
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_laugh"
|
||||||
|
pushstring ":laugh:"
|
||||||
|
pushstring ":))"
|
||||||
|
newarray 2
|
||||||
|
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_sleep"
|
||||||
|
pushstring ":tired:"
|
||||||
|
pushstring "|)"
|
||||||
|
pushstring "|-)"
|
||||||
|
pushstring ":zzz:"
|
||||||
|
pushstring "-_-"
|
||||||
|
pushstring "-_-zzz"
|
||||||
|
pushstring "--_"
|
||||||
|
newarray 7
|
||||||
|
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_sneaky"
|
||||||
|
pushstring ":sneaky:"
|
||||||
|
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_surprise"
|
||||||
|
pushstring ":surprise:"
|
||||||
|
pushstring ":O"
|
||||||
|
pushstring ":-O"
|
||||||
|
newarray 3
|
||||||
|
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_think"
|
||||||
|
pushstring ":think:"
|
||||||
|
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_tongue"
|
||||||
|
pushstring ":P"
|
||||||
|
pushstring ":tongue:"
|
||||||
|
newarray 2
|
||||||
|
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_wink"
|
||||||
|
pushstring ":wink:"
|
||||||
|
pushstring ";)"
|
||||||
|
pushstring ";-)"
|
||||||
|
newarray 3
|
||||||
|
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_star1"
|
||||||
|
pushstring ":singlestar:"
|
||||||
|
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_star2"
|
||||||
|
pushstring ":doublestar:"
|
||||||
|
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_star3"
|
||||||
|
pushstring ":triplestar:"
|
||||||
|
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_temp"
|
||||||
|
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"),"_emoteChatStrings")
|
||||||
|
pushstring "emo_temp"
|
||||||
|
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")])
|
||||||
|
returnvoid
|
||||||
|
end ; code
|
||||||
|
end ; body
|
||||||
|
end ; method
|
||||||
@@ -0,0 +1,604 @@
|
|||||||
|
package gskinner.motion
|
||||||
|
{
|
||||||
|
import flash.display.Shape;
|
||||||
|
import flash.events.Event;
|
||||||
|
import flash.events.EventDispatcher;
|
||||||
|
import flash.events.IEventDispatcher;
|
||||||
|
import flash.utils.Dictionary;
|
||||||
|
import flash.utils.getTimer;
|
||||||
|
|
||||||
|
public class GTween extends EventDispatcher
|
||||||
|
{
|
||||||
|
|
||||||
|
public static var version:Number = 2.01;
|
||||||
|
|
||||||
|
public static var defaultDispatchEvents:Boolean = false;
|
||||||
|
|
||||||
|
public static var pauseAll:Boolean = false;
|
||||||
|
|
||||||
|
public static var timeScaleAll:Number = 1;
|
||||||
|
|
||||||
|
protected static var hasStarPlugins:Boolean = false;
|
||||||
|
|
||||||
|
protected static var shape:Shape;
|
||||||
|
|
||||||
|
protected static var time:Number;
|
||||||
|
|
||||||
|
protected static var numItemsInTickList:int;
|
||||||
|
|
||||||
|
public static var defaultEase:Function = linearEase;
|
||||||
|
|
||||||
|
protected static var plugins:Object = {};
|
||||||
|
|
||||||
|
protected static var tickList:Dictionary = new Dictionary(true);
|
||||||
|
|
||||||
|
protected static var gcLockList:Dictionary = new Dictionary(false);
|
||||||
|
|
||||||
|
staticInit();
|
||||||
|
|
||||||
|
protected var _delay:Number = 0;
|
||||||
|
|
||||||
|
protected var _values:Object;
|
||||||
|
|
||||||
|
protected var _paused:Boolean = true;
|
||||||
|
|
||||||
|
protected var _position:Number;
|
||||||
|
|
||||||
|
protected var _inited:Boolean;
|
||||||
|
|
||||||
|
protected var _initValues:Object;
|
||||||
|
|
||||||
|
protected var _rangeValues:Object;
|
||||||
|
|
||||||
|
protected var _proxy:TargetProxy;
|
||||||
|
|
||||||
|
public var autoPlay:Boolean = true;
|
||||||
|
|
||||||
|
public var data:*;
|
||||||
|
|
||||||
|
public var duration:Number;
|
||||||
|
|
||||||
|
public var ease:Function;
|
||||||
|
|
||||||
|
public var nextTween:GTween;
|
||||||
|
|
||||||
|
public var pluginData:Object;
|
||||||
|
|
||||||
|
public var reflect:Boolean;
|
||||||
|
|
||||||
|
public var repeatCount:int = 1;
|
||||||
|
|
||||||
|
public var target:Object;
|
||||||
|
|
||||||
|
public var useFrames:Boolean;
|
||||||
|
|
||||||
|
public var timeScale:Number = 1;
|
||||||
|
|
||||||
|
public var positionOld:Number;
|
||||||
|
|
||||||
|
public var ratio:Number;
|
||||||
|
|
||||||
|
public var ratioOld:Number;
|
||||||
|
|
||||||
|
public var calculatedPosition:Number;
|
||||||
|
|
||||||
|
public var calculatedPositionOld:Number;
|
||||||
|
|
||||||
|
public var suppressEvents:Boolean;
|
||||||
|
|
||||||
|
public var dispatchEvents:Boolean;
|
||||||
|
|
||||||
|
public var onComplete:Function;
|
||||||
|
|
||||||
|
public var onChange:Function;
|
||||||
|
|
||||||
|
public var onInit:Function;
|
||||||
|
|
||||||
|
public function GTween(param1:Object = null, param2:Number = 1, param3:Object = null, param4:Object = null, param5:Object = null)
|
||||||
|
{
|
||||||
|
var _loc6_:Boolean = false;
|
||||||
|
super();
|
||||||
|
ease = defaultEase;
|
||||||
|
dispatchEvents = defaultDispatchEvents;
|
||||||
|
this.target = param1;
|
||||||
|
this.duration = param2;
|
||||||
|
this.pluginData = copy(param5,{});
|
||||||
|
if(param4)
|
||||||
|
{
|
||||||
|
_loc6_ = Boolean(param4.swapValues);
|
||||||
|
delete param4.swapValues;
|
||||||
|
}
|
||||||
|
copy(param4,this);
|
||||||
|
resetValues(param3);
|
||||||
|
if(_loc6_)
|
||||||
|
{
|
||||||
|
swapValues();
|
||||||
|
}
|
||||||
|
if(this.duration == 0 && delay == 0 && autoPlay)
|
||||||
|
{
|
||||||
|
position = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function installPlugin(param1:Object, param2:Array, param3:Boolean = false) : void
|
||||||
|
{
|
||||||
|
var _loc5_:* = 0;
|
||||||
|
var _loc4_:String = null;
|
||||||
|
_loc5_ = 0;
|
||||||
|
while(_loc5_ < param2.length)
|
||||||
|
{
|
||||||
|
_loc4_ = param2[_loc5_];
|
||||||
|
if(_loc4_ == "*")
|
||||||
|
{
|
||||||
|
hasStarPlugins = true;
|
||||||
|
}
|
||||||
|
if(plugins[_loc4_] == null)
|
||||||
|
{
|
||||||
|
plugins[_loc4_] = [param1];
|
||||||
|
}
|
||||||
|
else if(param3)
|
||||||
|
{
|
||||||
|
plugins[_loc4_].unshift(param1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
plugins[_loc4_].push(param1);
|
||||||
|
}
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function linearEase(param1:Number, param2:Number, param3:Number, param4:Number) : Number
|
||||||
|
{
|
||||||
|
return param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function staticInit() : void
|
||||||
|
{
|
||||||
|
(shape = new Shape()).addEventListener("enterFrame",staticTick);
|
||||||
|
time = getTimer() / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
// smooth graphics (AJClient.onSmoothTimer): the tweens that go by the
|
||||||
|
// clock moved on between two frames as well, which is all a frame
|
||||||
|
// does for them. those counted in frames wait for a frame. returns
|
||||||
|
// whether there was one to move.
|
||||||
|
public static function tickNow() : Boolean
|
||||||
|
{
|
||||||
|
var _loc1_:GTween = null;
|
||||||
|
var _loc2_:Number = time;
|
||||||
|
var _loc3_:Number = NaN;
|
||||||
|
var _loc4_:Boolean = false;
|
||||||
|
if(pauseAll || numItemsInTickList <= 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
time = getTimer() / 1000;
|
||||||
|
_loc3_ = (time - _loc2_) * timeScaleAll;
|
||||||
|
for(var _loc5_:Object in tickList)
|
||||||
|
{
|
||||||
|
_loc1_ = _loc5_ as GTween;
|
||||||
|
if(!_loc1_.useFrames)
|
||||||
|
{
|
||||||
|
_loc1_.position = _loc1_._position + _loc3_ * _loc1_.timeScale;
|
||||||
|
_loc4_ = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _loc4_;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function staticTick(param1:Event) : void
|
||||||
|
{
|
||||||
|
var _loc3_:GTween = null;
|
||||||
|
var _loc4_:Number = time;
|
||||||
|
if(pauseAll || numItemsInTickList <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
time = getTimer() / 1000;
|
||||||
|
var _loc2_:Number = (time - _loc4_) * timeScaleAll;
|
||||||
|
for(var _loc5_:Object in tickList)
|
||||||
|
{
|
||||||
|
_loc3_ = _loc5_ as GTween;
|
||||||
|
_loc3_.position = _loc3_._position + (_loc3_.useFrames ? timeScaleAll : _loc2_) * _loc3_.timeScale;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get paused() : Boolean
|
||||||
|
{
|
||||||
|
return _paused;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set paused(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
if(param1 == _paused)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_paused = param1;
|
||||||
|
if(_paused)
|
||||||
|
{
|
||||||
|
numItemsInTickList = numItemsInTickList - 1;
|
||||||
|
delete tickList[this];
|
||||||
|
if(target is IEventDispatcher)
|
||||||
|
{
|
||||||
|
target.removeEventListener("_",invalidate);
|
||||||
|
}
|
||||||
|
delete gcLockList[this];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
time = getTimer() / 1000;
|
||||||
|
if(isNaN(_position) || repeatCount != 0 && _position >= repeatCount * duration)
|
||||||
|
{
|
||||||
|
_inited = false;
|
||||||
|
calculatedPosition = calculatedPositionOld = ratio = ratioOld = positionOld = 0;
|
||||||
|
_position = -delay;
|
||||||
|
}
|
||||||
|
numItemsInTickList = numItemsInTickList + 1;
|
||||||
|
tickList[this] = true;
|
||||||
|
if(target is IEventDispatcher)
|
||||||
|
{
|
||||||
|
target.addEventListener("_",invalidate);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gcLockList[this] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get position() : Number
|
||||||
|
{
|
||||||
|
return _position;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set position(param1:Number) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = NaN;
|
||||||
|
var _loc4_:Number = NaN;
|
||||||
|
var _loc3_:Number = NaN;
|
||||||
|
var _loc5_:Array = null;
|
||||||
|
var _loc9_:* = 0;
|
||||||
|
var _loc7_:* = 0;
|
||||||
|
positionOld = _position;
|
||||||
|
ratioOld = ratio;
|
||||||
|
calculatedPositionOld = calculatedPosition;
|
||||||
|
var _loc6_:Number = repeatCount * duration;
|
||||||
|
var _loc8_:Boolean = param1 >= _loc6_ && repeatCount > 0;
|
||||||
|
if(_loc8_)
|
||||||
|
{
|
||||||
|
if(calculatedPositionOld == _loc6_)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_position = _loc6_;
|
||||||
|
calculatedPosition = reflect && !(repeatCount & 1) ? 0 : duration;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_position = param1;
|
||||||
|
calculatedPosition = _position < 0 ? 0 : _position % duration;
|
||||||
|
if(reflect && _position / duration & 1)
|
||||||
|
{
|
||||||
|
calculatedPosition = duration - calculatedPosition;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ratio = duration == 0 && _position >= 0 ? 1 : ease(calculatedPosition / duration,0,1,1);
|
||||||
|
if(target && (_position >= 0 || positionOld >= 0) && calculatedPosition != calculatedPositionOld)
|
||||||
|
{
|
||||||
|
if(!_inited)
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
for(var _loc10_:String in _values)
|
||||||
|
{
|
||||||
|
_loc2_ = Number(_initValues[_loc10_]);
|
||||||
|
_loc4_ = Number(_rangeValues[_loc10_]);
|
||||||
|
_loc3_ = _loc2_ + _loc4_ * ratio;
|
||||||
|
_loc5_ = plugins[_loc10_];
|
||||||
|
if(_loc5_)
|
||||||
|
{
|
||||||
|
_loc9_ = _loc5_.length;
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < _loc9_)
|
||||||
|
{
|
||||||
|
_loc3_ = Number(_loc5_[_loc7_].tween(this,_loc10_,_loc3_,_loc2_,_loc4_,ratio,_loc8_));
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
if(!isNaN(_loc3_))
|
||||||
|
{
|
||||||
|
target[_loc10_] = _loc3_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
target[_loc10_] = _loc3_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(hasStarPlugins)
|
||||||
|
{
|
||||||
|
_loc5_ = plugins["*"];
|
||||||
|
_loc9_ = _loc5_.length;
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < _loc9_)
|
||||||
|
{
|
||||||
|
_loc5_[_loc7_].tween(this,"*",NaN,NaN,NaN,ratio,_loc8_);
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!suppressEvents)
|
||||||
|
{
|
||||||
|
if(dispatchEvents)
|
||||||
|
{
|
||||||
|
dispatchEvt("change");
|
||||||
|
}
|
||||||
|
if(onChange != null)
|
||||||
|
{
|
||||||
|
onChange(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc8_)
|
||||||
|
{
|
||||||
|
paused = true;
|
||||||
|
if(nextTween)
|
||||||
|
{
|
||||||
|
nextTween.paused = false;
|
||||||
|
}
|
||||||
|
if(!suppressEvents)
|
||||||
|
{
|
||||||
|
if(dispatchEvents)
|
||||||
|
{
|
||||||
|
dispatchEvt("complete");
|
||||||
|
}
|
||||||
|
if(onComplete != null)
|
||||||
|
{
|
||||||
|
onComplete(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get delay() : Number
|
||||||
|
{
|
||||||
|
return _delay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set delay(param1:Number) : void
|
||||||
|
{
|
||||||
|
if(_position <= 0)
|
||||||
|
{
|
||||||
|
_position = -param1;
|
||||||
|
}
|
||||||
|
_delay = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get proxy() : TargetProxy
|
||||||
|
{
|
||||||
|
if(_proxy == null)
|
||||||
|
{
|
||||||
|
_proxy = new TargetProxy(this);
|
||||||
|
}
|
||||||
|
return _proxy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setValue(param1:String, param2:Number) : void
|
||||||
|
{
|
||||||
|
_values[param1] = param2;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getValue(param1:String) : Number
|
||||||
|
{
|
||||||
|
return _values[param1];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteValue(param1:String) : Boolean
|
||||||
|
{
|
||||||
|
delete _rangeValues[param1];
|
||||||
|
delete _initValues[param1];
|
||||||
|
return delete _values[param1];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setValues(param1:Object) : void
|
||||||
|
{
|
||||||
|
copy(param1,_values,true);
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetValues(param1:Object = null) : void
|
||||||
|
{
|
||||||
|
_values = {};
|
||||||
|
setValues(param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getValues() : Object
|
||||||
|
{
|
||||||
|
return copy(_values,{});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getInitValue(param1:String) : Number
|
||||||
|
{
|
||||||
|
return _initValues[param1];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function swapValues() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Number = NaN;
|
||||||
|
if(!_inited)
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
var _loc3_:Object = _values;
|
||||||
|
_values = _initValues;
|
||||||
|
_initValues = _loc3_;
|
||||||
|
for(var _loc2_:String in _rangeValues)
|
||||||
|
{
|
||||||
|
_rangeValues[_loc2_] *= -1;
|
||||||
|
}
|
||||||
|
if(_position < 0)
|
||||||
|
{
|
||||||
|
_loc1_ = positionOld;
|
||||||
|
position = 0;
|
||||||
|
_position = positionOld;
|
||||||
|
positionOld = _loc1_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
position = _position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Array = null;
|
||||||
|
var _loc3_:* = 0;
|
||||||
|
var _loc4_:Number = NaN;
|
||||||
|
var _loc2_:* = 0;
|
||||||
|
_inited = true;
|
||||||
|
_initValues = {};
|
||||||
|
_rangeValues = {};
|
||||||
|
for(var _loc5_:String in _values)
|
||||||
|
{
|
||||||
|
if(plugins[_loc5_])
|
||||||
|
{
|
||||||
|
_loc1_ = plugins[_loc5_];
|
||||||
|
_loc3_ = _loc1_.length;
|
||||||
|
_loc4_ = Number(_loc5_ in target ? target[_loc5_] : NaN);
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < _loc3_)
|
||||||
|
{
|
||||||
|
_loc4_ = Number(_loc1_[_loc2_].init(this,_loc5_,_loc4_));
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
if(!isNaN(_loc4_))
|
||||||
|
{
|
||||||
|
_rangeValues[_loc5_] = _values[_loc5_] - (_initValues[_loc5_] = _loc4_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_rangeValues[_loc5_] = _values[_loc5_] - (_initValues[_loc5_] = target[_loc5_]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(hasStarPlugins)
|
||||||
|
{
|
||||||
|
_loc1_ = plugins["*"];
|
||||||
|
_loc3_ = _loc1_.length;
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < _loc3_)
|
||||||
|
{
|
||||||
|
_loc1_[_loc2_].init(this,"*",NaN);
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!suppressEvents)
|
||||||
|
{
|
||||||
|
if(dispatchEvents)
|
||||||
|
{
|
||||||
|
dispatchEvt("init");
|
||||||
|
}
|
||||||
|
if(onInit != null)
|
||||||
|
{
|
||||||
|
onInit(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function beginning() : void
|
||||||
|
{
|
||||||
|
position = 0;
|
||||||
|
paused = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function end() : void
|
||||||
|
{
|
||||||
|
position = repeatCount > 0 ? repeatCount * duration : duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function invalidate() : void
|
||||||
|
{
|
||||||
|
_inited = false;
|
||||||
|
if(_position > 0)
|
||||||
|
{
|
||||||
|
_position = 0;
|
||||||
|
}
|
||||||
|
if(autoPlay)
|
||||||
|
{
|
||||||
|
paused = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function copy(param1:Object, param2:Object, param3:Boolean = false) : Object
|
||||||
|
{
|
||||||
|
for(var _loc4_:String in param1)
|
||||||
|
{
|
||||||
|
if(param3 && param1[_loc4_] == null)
|
||||||
|
{
|
||||||
|
delete param2[_loc4_];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param2[_loc4_] = param1[_loc4_];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return param2;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function dispatchEvt(param1:String) : void
|
||||||
|
{
|
||||||
|
if(hasEventListener(param1))
|
||||||
|
{
|
||||||
|
dispatchEvent(new Event(param1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
import flash.utils.Proxy;
|
||||||
|
import flash.utils.flash_proxy;
|
||||||
|
import gskinner.motion.GTween;
|
||||||
|
|
||||||
|
use namespace flash_proxy;
|
||||||
|
|
||||||
|
dynamic class TargetProxy extends Proxy
|
||||||
|
{
|
||||||
|
|
||||||
|
private var tween:GTween;
|
||||||
|
|
||||||
|
public function TargetProxy(param1:GTween)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.tween = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
override flash_proxy function callProperty(param1:*, ... rest) : *
|
||||||
|
{
|
||||||
|
return tween.target[param1].apply(null,rest);
|
||||||
|
}
|
||||||
|
|
||||||
|
override flash_proxy function getProperty(param1:*) : *
|
||||||
|
{
|
||||||
|
var _loc2_:Number = Number(tween.getValue(param1));
|
||||||
|
return isNaN(_loc2_) ? tween.target[param1] : _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
override flash_proxy function setProperty(param1:*, param2:*) : void
|
||||||
|
{
|
||||||
|
if(param2 is Boolean || param2 is String || isNaN(param2))
|
||||||
|
{
|
||||||
|
tween.target[param1] = param2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tween.setValue(String(param1),Number(param2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override flash_proxy function deleteProperty(param1:*) : Boolean
|
||||||
|
{
|
||||||
|
tween.deleteValue(param1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package
|
||||||
|
{
|
||||||
|
import com.sbi.analytics.GATracker;
|
||||||
|
import com.sbi.debug.DebugUtility;
|
||||||
|
import flash.desktop.Clipboard;
|
||||||
|
import flash.display.LoaderInfo;
|
||||||
|
import flash.events.ErrorEvent;
|
||||||
|
import flash.events.Event;
|
||||||
|
import flash.events.UncaughtErrorEvent;
|
||||||
|
import flash.external.ExternalInterface;
|
||||||
|
import flash.net.URLLoader;
|
||||||
|
import flash.net.URLRequest;
|
||||||
|
|
||||||
|
public class GlobalErrorCatch
|
||||||
|
{
|
||||||
|
|
||||||
|
public function GlobalErrorCatch()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function describeTarget(param1:Object) : String
|
||||||
|
{
|
||||||
|
var _loc2_:String = String(param1);
|
||||||
|
if(param1 is LoaderInfo)
|
||||||
|
{
|
||||||
|
_loc2_ += " url=" + LoaderInfo(param1).url + " loaderURL=" + LoaderInfo(param1).loaderURL + " bytes=" + LoaderInfo(param1).bytesTotal;
|
||||||
|
if(LoaderInfo(param1).loader && LoaderInfo(param1).loader.parent)
|
||||||
|
{
|
||||||
|
_loc2_ += " parent=" + LoaderInfo(param1).loader.parent + " name=" + LoaderInfo(param1).loader.parent.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function reportToServer(param1:String) : void
|
||||||
|
{
|
||||||
|
var _loc2_:URLRequest = new URLRequest(gMainFrame.clientInfo.websiteURL + "v1/reportError");
|
||||||
|
_loc2_.method = "POST";
|
||||||
|
_loc2_.contentType = "application/json";
|
||||||
|
_loc2_.data = JSON.stringify({
|
||||||
|
"section":"swf",
|
||||||
|
"message":param1
|
||||||
|
});
|
||||||
|
var _loc3_:URLLoader = new URLLoader();
|
||||||
|
_loc3_.addEventListener("ioError",onReportFailed);
|
||||||
|
_loc3_.addEventListener("securityError",onReportFailed);
|
||||||
|
_loc3_.load(_loc2_);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function onReportFailed(param1:Event) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function globalErrorListener(param1:UncaughtErrorEvent) : void
|
||||||
|
{
|
||||||
|
var _loc4_:UncaughtErrorEvent = UncaughtErrorEvent(param1);
|
||||||
|
var _loc2_:Boolean = gMainFrame.clientInfo.accountType == 4 || gMainFrame.clientInfo.extCallsActive;
|
||||||
|
var _loc5_:String = "Default";
|
||||||
|
if(_loc4_)
|
||||||
|
{
|
||||||
|
if(!_loc2_)
|
||||||
|
{
|
||||||
|
_loc4_.preventDefault();
|
||||||
|
}
|
||||||
|
if(_loc4_.error is Error)
|
||||||
|
{
|
||||||
|
_loc5_ = Error(_loc4_.error).message + _loc4_.error.toString() + "\n";
|
||||||
|
_loc5_ = _loc4_.error.getStackTrace();
|
||||||
|
}
|
||||||
|
else if(_loc4_.error is ErrorEvent)
|
||||||
|
{
|
||||||
|
_loc5_ = ErrorEvent(_loc4_.error).text + _loc4_.error.toString();
|
||||||
|
_loc5_ = _loc5_ + ("\n target: " + describeTarget(ErrorEvent(_loc4_.error).target));
|
||||||
|
_loc5_ = _loc5_ + "\n This is an ErrorEvent";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc5_ = _loc4_.error.toString();
|
||||||
|
_loc5_ = _loc5_ + ("\n This is not an Error or Error event: " + _loc4_.error);
|
||||||
|
}
|
||||||
|
if(_loc2_)
|
||||||
|
{
|
||||||
|
if(ExternalInterface.available)
|
||||||
|
{
|
||||||
|
if(gMainFrame.clientInfo.clientPlatform.toLowerCase() == "electron")
|
||||||
|
{
|
||||||
|
ExternalInterface.call("console.log",_loc5_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ExternalInterface.call("alert",_loc5_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AJClient.globalDebugLog.setVisibility(true);
|
||||||
|
Clipboard.generalClipboard.clear();
|
||||||
|
Clipboard.generalClipboard.setData("air:text",_loc5_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reportToServer(_loc4_ ? String(_loc4_.error) + "\n" + _loc5_ : _loc5_);
|
||||||
|
var _loc3_:String = DebugUtility.getTrackedDebugStatements();
|
||||||
|
if(_loc3_.length > 0)
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace("Tracked Debug Statements:\n" + _loc3_);
|
||||||
|
}
|
||||||
|
DebugUtility.debugTrace(_loc5_,false);
|
||||||
|
GATracker.trackError(_loc5_ + _loc3_,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,556 @@
|
|||||||
|
package gui.itemWindows
|
||||||
|
{
|
||||||
|
import avatar.Avatar;
|
||||||
|
import avatar.AvatarInfo;
|
||||||
|
import avatar.AvatarManager;
|
||||||
|
import avatar.AvatarSwitch;
|
||||||
|
import avatar.AvatarUtility;
|
||||||
|
import avatar.AvatarView;
|
||||||
|
import com.sbi.graphics.LayerAnim;
|
||||||
|
import den.DenRoomItem;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.geom.Point;
|
||||||
|
import gui.DenSwitch;
|
||||||
|
import gui.LoadingSpiral;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
|
||||||
|
public class ItemWindowAnimal extends ItemWindowBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private const COST_OF_NEW_ANIMAL:int = 1000;
|
||||||
|
|
||||||
|
private const SLOTS_PER_NONMEMBER:int = 2;
|
||||||
|
|
||||||
|
private var _isChoosing:Boolean;
|
||||||
|
|
||||||
|
private var _isAnimal:Boolean;
|
||||||
|
|
||||||
|
private var _recyclingOnly:Boolean;
|
||||||
|
|
||||||
|
private var _addGrayChild:Boolean;
|
||||||
|
|
||||||
|
private var _isChoosingOcean:Boolean;
|
||||||
|
|
||||||
|
private var _ai:AvatarInfo;
|
||||||
|
|
||||||
|
private var _nameBarData:int;
|
||||||
|
|
||||||
|
private var _hasAddedEventListeners:Boolean;
|
||||||
|
|
||||||
|
private var _avtView:AvatarView;
|
||||||
|
|
||||||
|
private var _loadingSpiral:LoadingSpiral;
|
||||||
|
|
||||||
|
private var _numNonMemberOceanOnlyAvatars:int;
|
||||||
|
|
||||||
|
private var _numNonMemberAvatars:int;
|
||||||
|
|
||||||
|
private var _isRecycling:Function;
|
||||||
|
|
||||||
|
private var _fromDeletion:Boolean;
|
||||||
|
|
||||||
|
private var _ignoreEnviroType:Boolean;
|
||||||
|
|
||||||
|
public function ItemWindowAnimal(param1:Function, param2:Object, param3:String, param4:int, param5:Function = null, param6:Function = null, param7:Function = null, param8:Function = null, param9:Object = null)
|
||||||
|
{
|
||||||
|
_isChoosing = param9.isChoosing;
|
||||||
|
_isAnimal = param9.isAnimal;
|
||||||
|
_recyclingOnly = param9.recylingOnly;
|
||||||
|
_isChoosingOcean = param9.isChoosingOcean;
|
||||||
|
_nameBarData = param9.nameBarData;
|
||||||
|
if(_isAnimal)
|
||||||
|
{
|
||||||
|
_numNonMemberAvatars = param9.numNonMemberAvatars;
|
||||||
|
_numNonMemberOceanOnlyAvatars = param9.numNonMemberOceanOnlyAvatars;
|
||||||
|
_isRecycling = param9.isRecycling;
|
||||||
|
_ignoreEnviroType = param9.ignoreEnviroType;
|
||||||
|
}
|
||||||
|
super("amlCont",param1,param2,param3,param4,param5,param6,param7,param8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get aml() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.aml;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get makeNew() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.makeNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get recycle() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.recycle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get denWindow() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.den;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get lock() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.lock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get gray() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get checkbox() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.checkbox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get buyDen() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.buyDen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set currItem(param1:DenRoomItem) : void
|
||||||
|
{
|
||||||
|
_currItem = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get level() : int
|
||||||
|
{
|
||||||
|
return _ai ? _ai.questLevel : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isUsable() : Boolean
|
||||||
|
{
|
||||||
|
if(AvatarSwitch.avatars[_index] == null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeLoadedItem() : void
|
||||||
|
{
|
||||||
|
_fromDeletion = true;
|
||||||
|
if(_avtView)
|
||||||
|
{
|
||||||
|
_avtView.destroy();
|
||||||
|
_avtView = null;
|
||||||
|
}
|
||||||
|
while(aml.amlMask.amlBox.numChildren > 0)
|
||||||
|
{
|
||||||
|
aml.amlMask.amlBox.removeChildAt(0);
|
||||||
|
}
|
||||||
|
while(gray.amlMask.amlBox.numChildren > 0)
|
||||||
|
{
|
||||||
|
gray.amlMask.amlBox.removeChildAt(0);
|
||||||
|
}
|
||||||
|
resetWindow(index);
|
||||||
|
_fromDeletion = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetWindow(param1:int) : void
|
||||||
|
{
|
||||||
|
if(_isAnimal)
|
||||||
|
{
|
||||||
|
_window.makeNew.visible = true;
|
||||||
|
_window.priceTag.visible = false;
|
||||||
|
_window.buy.visible = false;
|
||||||
|
_window.lock.visible = false;
|
||||||
|
_window.aml.visible = false;
|
||||||
|
_window.aml.sel.visible = false;
|
||||||
|
_window.recycle.visible = false;
|
||||||
|
_window.gray.visible = false;
|
||||||
|
_window.lock.visible = false;
|
||||||
|
_window.makeNew.newAmlBtn.gray.visible = false;
|
||||||
|
_window.xpShape.visible = false;
|
||||||
|
AvatarSwitch.numOpenNonMemberSlots--;
|
||||||
|
_isCurrItemLoaded = false;
|
||||||
|
loadCurrItem();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(param1 > 0)
|
||||||
|
{
|
||||||
|
while(_window.den.itemBlock.numChildren > 0)
|
||||||
|
{
|
||||||
|
_window.den.itemBlock.removeChildAt(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_window.buyDen.visible = true;
|
||||||
|
_window.den.visible = false;
|
||||||
|
_window.priceTag.visible = false;
|
||||||
|
_window.buy.visible = false;
|
||||||
|
_window.lock.visible = false;
|
||||||
|
_window.aml.visible = false;
|
||||||
|
_window.aml.sel.visible = false;
|
||||||
|
_window.recycle.visible = false;
|
||||||
|
_window.gray.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function onWindowLoadCallback() : void
|
||||||
|
{
|
||||||
|
setChildrenAndInitialConditions();
|
||||||
|
if(!_hasAddedEventListeners && (_isChoosing || _isChoosingOcean))
|
||||||
|
{
|
||||||
|
addEventListeners();
|
||||||
|
}
|
||||||
|
super.onWindowLoadCallback();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function loadCurrItem(param1:int = 0, param2:int = 0) : void
|
||||||
|
{
|
||||||
|
var _loc4_:int = 0;
|
||||||
|
var _loc3_:Avatar = null;
|
||||||
|
_itemYLocation = param1;
|
||||||
|
_itemXLocation = param2;
|
||||||
|
if(!_hasAddedEventListeners)
|
||||||
|
{
|
||||||
|
addEventListeners();
|
||||||
|
}
|
||||||
|
if(_isAnimal)
|
||||||
|
{
|
||||||
|
if(!_isCurrItemLoaded)
|
||||||
|
{
|
||||||
|
_loc4_ = 1000;
|
||||||
|
_window.gray.grayDen.visible = false;
|
||||||
|
_window.aml.bg.visible = true;
|
||||||
|
_window.aml.gray.visible = false;
|
||||||
|
_window.aml.nameTxt.visible = true;
|
||||||
|
_window.priceTag.txt.text = 1000;
|
||||||
|
_window.aml.visible = true;
|
||||||
|
if(AvatarSwitch.avatars[_index] != null && !_fromDeletion)
|
||||||
|
{
|
||||||
|
_loc3_ = AvatarSwitch.avatars[_index];
|
||||||
|
_loc3_ = AvatarUtility.generateNew(_loc3_.perUserAvId,_loc3_,_loc3_.userName,_loc3_.sfsUserId,AvatarManager.roomEnviroType,null,false,_ignoreEnviroType);
|
||||||
|
_avtView = new AvatarView();
|
||||||
|
_avtView.init(_loc3_,null,null,false,_ignoreEnviroType);
|
||||||
|
_avtView.visible = false;
|
||||||
|
_avtView.playAnim(13,false,1,onViewLoaded);
|
||||||
|
if(AvatarSwitch.isSlotAvailable(_index) || _isChoosing)
|
||||||
|
{
|
||||||
|
_loadingSpiral = new LoadingSpiral(_window.aml.amlMask.amlBox.addChild(_avtView));
|
||||||
|
_window.priceTag.visible = false;
|
||||||
|
_window.buy.visible = false;
|
||||||
|
_window.makeNew.visible = false;
|
||||||
|
_window.lock.visible = false;
|
||||||
|
_window.aml.visible = true;
|
||||||
|
_window.aml.sel.visible = false;
|
||||||
|
_window.aml.nameTxt.text = _loc3_.avName;
|
||||||
|
if(_isChoosing)
|
||||||
|
{
|
||||||
|
_window.checkbox.visible = true;
|
||||||
|
_window.checkbox.check.visible = false;
|
||||||
|
_window.aml.bg.visible = false;
|
||||||
|
_window.aml.gray.visible = true;
|
||||||
|
if(_numNonMemberAvatars > 0 && _numNonMemberAvatars < 3)
|
||||||
|
{
|
||||||
|
if(!AvatarSwitch.isMemberOnlyAvatar(_index))
|
||||||
|
{
|
||||||
|
_window.checkbox.check.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_numNonMemberAvatars - _numNonMemberOceanOnlyAvatars < 1 || _numNonMemberAvatars <= _loc4_ && AvatarSwitch.isMemberOnlyAvatar(_index))
|
||||||
|
{
|
||||||
|
_window.aml.visible = false;
|
||||||
|
_window.gray.visible = true;
|
||||||
|
_window.lock.visible = true;
|
||||||
|
_window.checkbox.visible = false;
|
||||||
|
_window.gray.nameTxt.text = _loc3_.avName;
|
||||||
|
_addGrayChild = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_index == AvatarSwitch.activeAvatarIdx)
|
||||||
|
{
|
||||||
|
_window.aml.sel.visible = true;
|
||||||
|
}
|
||||||
|
while(_window.xpShape.numChildren > 0)
|
||||||
|
{
|
||||||
|
_window.xpShape.removeChildAt(0);
|
||||||
|
}
|
||||||
|
if(_isChoosing)
|
||||||
|
{
|
||||||
|
if(!gMainFrame.userInfo.isMember && !AvatarSwitch.isMemberOnlyAvatar(_index))
|
||||||
|
{
|
||||||
|
AvatarSwitch.numOpenNonMemberSlots++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AvatarSwitch.numOpenNonMemberSlots++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.aml.visible = false;
|
||||||
|
_window.gray.visible = true;
|
||||||
|
_window.gray.nameTxt.text = _loc3_.avName;
|
||||||
|
_addGrayChild = true;
|
||||||
|
_window.gray.amlMask.amlBox.addChild(_avtView);
|
||||||
|
}
|
||||||
|
if(Utility.isOcean(_avtView.avatarData.enviroTypeFlag))
|
||||||
|
{
|
||||||
|
if(Utility.isLand(_avtView.avatarData.enviroTypeFlag))
|
||||||
|
{
|
||||||
|
if(_window.aml.visible)
|
||||||
|
{
|
||||||
|
if(_window.aml.gray.visible)
|
||||||
|
{
|
||||||
|
_window.aml.gray.gotoAndStop(3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.aml.bg.gotoAndStop(3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.gray.grayAml.gotoAndStop(3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_window.aml.visible)
|
||||||
|
{
|
||||||
|
if(_window.aml.gray.visible)
|
||||||
|
{
|
||||||
|
_window.aml.gray.gotoAndStop(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.aml.bg.gotoAndStop(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.gray.grayAml.gotoAndStop(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_window.recycle.visible = _isRecycling();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!gMainFrame.userInfo.isMember)
|
||||||
|
{
|
||||||
|
if(AvatarSwitch.numOpenNonMemberSlots < 2 || _isChoosing && _numNonMemberAvatars - _numNonMemberOceanOnlyAvatars < 1)
|
||||||
|
{
|
||||||
|
AvatarSwitch.numOpenNonMemberSlots++;
|
||||||
|
_window.makeNew.visible = true;
|
||||||
|
_window.lock.visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.makeNew.visible = false;
|
||||||
|
_window.lock.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.makeNew.visible = true;
|
||||||
|
_window.lock.visible = false;
|
||||||
|
}
|
||||||
|
_window.priceTag.visible = false;
|
||||||
|
_window.buy.visible = false;
|
||||||
|
_window.aml.visible = false;
|
||||||
|
_window.aml.sel.visible = false;
|
||||||
|
_window.recycle.visible = false;
|
||||||
|
if(_isChoosing && _numNonMemberAvatars > 1 && _numNonMemberAvatars - _numNonMemberOceanOnlyAvatars > 0)
|
||||||
|
{
|
||||||
|
_window.makeNew.newAmlBtn.gray.visible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.makeNew.newAmlBtn.gray.visible = false;
|
||||||
|
}
|
||||||
|
_isCurrItemLoaded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_currItem != null)
|
||||||
|
{
|
||||||
|
if(!_isCurrItemLoaded)
|
||||||
|
{
|
||||||
|
_isCurrItemLoaded = true;
|
||||||
|
_window.den.sel.visible = false;
|
||||||
|
if(gMainFrame.userInfo.isMember)
|
||||||
|
{
|
||||||
|
_window.den.visible = true;
|
||||||
|
LocalizationManager.updateToFit(_window.den.txt,_currItem.name,false,false,false);
|
||||||
|
}
|
||||||
|
else if(_currItem.isMemberOnly)
|
||||||
|
{
|
||||||
|
_addGrayChild = true;
|
||||||
|
_window.den.visible = false;
|
||||||
|
_window.gray.visible = true;
|
||||||
|
LocalizationManager.updateToFit(_window.gray.nameTxt,_currItem.name,false,false,false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.den.visible = true;
|
||||||
|
LocalizationManager.updateToFit(_window.den.txt,_currItem.name,false,false,false);
|
||||||
|
}
|
||||||
|
if(_currItem.isLand)
|
||||||
|
{
|
||||||
|
_window.den.greenBG.visible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.den.greenBG.visible = false;
|
||||||
|
}
|
||||||
|
if(_index == DenSwitch.activeDenIdx)
|
||||||
|
{
|
||||||
|
_window.den.sel.visible = true;
|
||||||
|
}
|
||||||
|
_window.buyDen.visible = false;
|
||||||
|
if(_recyclingOnly)
|
||||||
|
{
|
||||||
|
_window.recycle.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.den.visible = false;
|
||||||
|
_window.buyDen.visible = true;
|
||||||
|
}
|
||||||
|
if(_currItem && _avtView && !_isCurrItemLoaded && _isAnimal)
|
||||||
|
{
|
||||||
|
_isCurrItemLoaded = true;
|
||||||
|
if(_addGrayChild)
|
||||||
|
{
|
||||||
|
_window.gray.amlMask.amlBox.addChild(_avtView);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.aml.amlMask.amlBox.addChild(_avtView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function loadQuestShape() : void
|
||||||
|
{
|
||||||
|
var _loc1_:String = _window.xpShape.currentLabels[Utility.getColorId(_nameBarData) - 1].name;
|
||||||
|
_window.xpShape.visible = true;
|
||||||
|
if(_loc1_ == "black")
|
||||||
|
{
|
||||||
|
_window.xpShape.gotoAndStop(2);
|
||||||
|
_window.xpShape.gotoAndStop(_loc1_);
|
||||||
|
}
|
||||||
|
if(_window.xpShape.currentFrameLabel != _loc1_)
|
||||||
|
{
|
||||||
|
_window.xpShape.gotoAndStop(_loc1_);
|
||||||
|
}
|
||||||
|
Utility.createXpShape(_ai.questLevel,true,_window.xpShape[_loc1_].mouse.up.icon,null,_nameBarData);
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function destroy() : void
|
||||||
|
{
|
||||||
|
AvatarSwitch.numOpenNonMemberSlots = 0;
|
||||||
|
if(_avtView)
|
||||||
|
{
|
||||||
|
_avtView.destroy();
|
||||||
|
_avtView = null;
|
||||||
|
}
|
||||||
|
if(_loadingSpiral)
|
||||||
|
{
|
||||||
|
_loadingSpiral.destroy();
|
||||||
|
_loadingSpiral = null;
|
||||||
|
}
|
||||||
|
if(_isAnimal)
|
||||||
|
{
|
||||||
|
_currItem = null;
|
||||||
|
}
|
||||||
|
super.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function setChildrenAndInitialConditions() : void
|
||||||
|
{
|
||||||
|
_window.priceTag.visible = false;
|
||||||
|
_window.priceTag.txt.textColor = "0x386630";
|
||||||
|
_window.buy.visible = false;
|
||||||
|
_window.makeNew.visible = false;
|
||||||
|
_window.lock.visible = false;
|
||||||
|
_window.recycle.visible = false;
|
||||||
|
_window.den.visible = false;
|
||||||
|
_window.buyDen.visible = false;
|
||||||
|
_window.xpShape.visible = false;
|
||||||
|
if(_isAnimal)
|
||||||
|
{
|
||||||
|
_window.aml.visible = true;
|
||||||
|
_window.aml.bg.visible = false;
|
||||||
|
_window.aml.gray.visible = true;
|
||||||
|
_window.aml.sel.visible = false;
|
||||||
|
_window.aml.nameTxt.visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.aml.visible = false;
|
||||||
|
}
|
||||||
|
_window.gray.visible = false;
|
||||||
|
_window.buyDen.buyBtn.gray.visible = false;
|
||||||
|
_window.buy.buyAmlBtn.gray.visible = false;
|
||||||
|
_window.makeNew.newAmlBtn.gray.visible = false;
|
||||||
|
_window.checkbox.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function addEventListeners() : void
|
||||||
|
{
|
||||||
|
_hasAddedEventListeners = true;
|
||||||
|
if(_window)
|
||||||
|
{
|
||||||
|
if(_mouseDown != null)
|
||||||
|
{
|
||||||
|
addEventListener("mouseDown",_mouseDown,false,0,true);
|
||||||
|
}
|
||||||
|
if(_mouseOver != null)
|
||||||
|
{
|
||||||
|
addEventListener("rollOver",_mouseOver,false,0,true);
|
||||||
|
}
|
||||||
|
if(_mouseOut != null)
|
||||||
|
{
|
||||||
|
addEventListener("rollOut",_mouseOut,false,0,true);
|
||||||
|
}
|
||||||
|
if(_memberOnlyDown != null)
|
||||||
|
{
|
||||||
|
addEventListener("mouseDown",_memberOnlyDown,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRenamed(param1:String) : void
|
||||||
|
{
|
||||||
|
if(AvatarSwitch.avatars[_index] != null)
|
||||||
|
{
|
||||||
|
AvatarSwitch.avatars[_index].avName = param1;
|
||||||
|
}
|
||||||
|
if(_window)
|
||||||
|
{
|
||||||
|
_window.gray.nameTxt.text = param1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onViewLoaded(param1:LayerAnim, param2:int) : void
|
||||||
|
{
|
||||||
|
var _loc3_:Point = null;
|
||||||
|
if(_window && _avtView)
|
||||||
|
{
|
||||||
|
_loc3_ = AvatarUtility.getAnimalItemWindowOffset(_avtView.avTypeId);
|
||||||
|
_avtView.x = _loc3_.x;
|
||||||
|
_avtView.y = _loc3_.y;
|
||||||
|
_window.aml.nameTxt.text = _avtView.avName;
|
||||||
|
_window.gray.nameTxt.text = _avtView.avName;
|
||||||
|
// A double click on the name lets the player type another.
|
||||||
|
AJClient.makeRenamable(_window.aml.nameTxt,"a",_avtView.perUserAvId,onRenamed,this);
|
||||||
|
_ai = gMainFrame.userInfo.getAvatarInfoByUserNameThenPerUserAvId(_avtView.userName,_avtView.perUserAvId);
|
||||||
|
if(_ai && _ai.questLevel > 0)
|
||||||
|
{
|
||||||
|
loadQuestShape();
|
||||||
|
}
|
||||||
|
_avtView.visible = true;
|
||||||
|
}
|
||||||
|
if(_loadingSpiral)
|
||||||
|
{
|
||||||
|
_loadingSpiral.destroy();
|
||||||
|
_loadingSpiral = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
package gui.itemWindows
|
||||||
|
{
|
||||||
|
import avatar.Avatar;
|
||||||
|
import avatar.AvatarInfo;
|
||||||
|
import avatar.AvatarManager;
|
||||||
|
import avatar.AvatarUtility;
|
||||||
|
import avatar.AvatarView;
|
||||||
|
import buddy.BuddyCard;
|
||||||
|
import com.sbi.graphics.LayerAnim;
|
||||||
|
import flash.display.DisplayObject;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import pet.GuiPet;
|
||||||
|
|
||||||
|
public class ItemWindowAvtPetSml extends ItemWindowBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private var _isPet:Boolean;
|
||||||
|
|
||||||
|
private var _ai:AvatarInfo;
|
||||||
|
|
||||||
|
private var _isMember:Boolean;
|
||||||
|
|
||||||
|
private var _nameBarData:int;
|
||||||
|
|
||||||
|
private var _currFrameName:String;
|
||||||
|
|
||||||
|
private var _avtView:AvatarView;
|
||||||
|
|
||||||
|
private var _petView:GuiPet;
|
||||||
|
|
||||||
|
private var _currPerUserAvId:int;
|
||||||
|
|
||||||
|
private var _hasSetInitialConditions:Boolean;
|
||||||
|
|
||||||
|
public function ItemWindowAvtPetSml(param1:Function, param2:Object, param3:String, param4:int, param5:Function = null, param6:Function = null, param7:Function = null, param8:Function = null, param9:Object = null)
|
||||||
|
{
|
||||||
|
_isPet = param9 != null ? param9.isPet : false;
|
||||||
|
_isMember = param9 != null ? param9.isMember : false;
|
||||||
|
_nameBarData = param9 != null ? param9.nameBarData : 0;
|
||||||
|
if(!_isPet)
|
||||||
|
{
|
||||||
|
_ai = gMainFrame.userInfo.getAvatarInfoByUserNameThenPerUserAvId(param2.userName,param2.perUserAvId);
|
||||||
|
_currPerUserAvId = param9.currPerUserAvId;
|
||||||
|
}
|
||||||
|
super("charBtnSmlCont",param1,param2,param3,param4,param5,param6,param7,param8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get sel() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.sel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isPet() : Boolean
|
||||||
|
{
|
||||||
|
return _isPet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get charLayer() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.charLayer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get xpShape() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.xpShape;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get toolTipName() : String
|
||||||
|
{
|
||||||
|
if(_isPet && _petView)
|
||||||
|
{
|
||||||
|
return _petView.petName;
|
||||||
|
}
|
||||||
|
if(_avtView)
|
||||||
|
{
|
||||||
|
return _avtView.avName;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function gotoAndStop(param1:Object, param2:String = null) : void
|
||||||
|
{
|
||||||
|
_window.gotoAndStop(param1,param2);
|
||||||
|
if(_currFrameName)
|
||||||
|
{
|
||||||
|
if(param1 == "over")
|
||||||
|
{
|
||||||
|
xpShape[_currFrameName].mouse.gotoAndPlay(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xpShape[_currFrameName].mouse.gotoAndStop(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function destroy() : void
|
||||||
|
{
|
||||||
|
if(_avtView)
|
||||||
|
{
|
||||||
|
_avtView.destroy();
|
||||||
|
_avtView = null;
|
||||||
|
}
|
||||||
|
if(_petView)
|
||||||
|
{
|
||||||
|
_petView.destroy();
|
||||||
|
_petView = null;
|
||||||
|
}
|
||||||
|
super.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function loadCurrItem(param1:int = 0, param2:int = 0) : void
|
||||||
|
{
|
||||||
|
_itemYLocation = param1;
|
||||||
|
_itemXLocation = param2;
|
||||||
|
if(_currItem && !_isCurrItemLoaded)
|
||||||
|
{
|
||||||
|
if(!_hasSetInitialConditions)
|
||||||
|
{
|
||||||
|
setChildrenAndInitialConditions();
|
||||||
|
}
|
||||||
|
_isCurrItemLoaded = true;
|
||||||
|
_window.charLayer.addChild(DisplayObject(_isPet ? _petView : _avtView));
|
||||||
|
if(_ai && _ai.questLevel > 0)
|
||||||
|
{
|
||||||
|
_currFrameName = xpShape.currentLabels[Utility.getColorId(_nameBarData) - 1].name;
|
||||||
|
if(xpShape.currentFrameLabel != _currFrameName)
|
||||||
|
{
|
||||||
|
xpShape.gotoAndStop(_currFrameName);
|
||||||
|
}
|
||||||
|
Utility.createXpShape(_ai.questLevel,_isMember,xpShape[_currFrameName].mouse.up.icon,xpShape[_currFrameName].mouse.mouse.icon,2147483647);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function setChildrenAndInitialConditions() : void
|
||||||
|
{
|
||||||
|
_hasSetInitialConditions = true;
|
||||||
|
_window.sel.visible = false;
|
||||||
|
if(_isPet)
|
||||||
|
{
|
||||||
|
_petView = new GuiPet(_currItem.createdTs,_currItem.idx,_currItem.lBits,_currItem.uBits,_currItem.eBits,_currItem.type,_currItem.name,_currItem.personalityDefId,_currItem.favoriteToyDefId,_currItem.favoriteFoodDefId,onPetViewLoaded);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_currItem = AvatarUtility.generateNew(Avatar(_currItem).perUserAvId,Avatar(_currItem),Avatar(_currItem).userName,AvatarManager.roomEnviroType);
|
||||||
|
_avtView = new AvatarView();
|
||||||
|
_avtView.init(Avatar(_currItem),null);
|
||||||
|
_avtView.playAnim(13,false,1,onAvtAnimLoaded);
|
||||||
|
if(_currPerUserAvId == Avatar(_currItem).perUserAvId)
|
||||||
|
{
|
||||||
|
sel.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addEventListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPetViewLoaded(param1:MovieClip, param2:GuiPet) : void
|
||||||
|
{
|
||||||
|
param2.animatePet(false);
|
||||||
|
if(_window)
|
||||||
|
{
|
||||||
|
param2.x = this.width * 0.3;
|
||||||
|
param2.y = this.height * 0.4;
|
||||||
|
param2.scaleX = param2.scaleY = 1.1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onAvtAnimLoaded(param1:LayerAnim, param2:int) : void
|
||||||
|
{
|
||||||
|
BuddyCard.updateViewPosition(_avtView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
package gui.itemWindows
|
||||||
|
{
|
||||||
|
import buddy.Buddy;
|
||||||
|
import buddy.BuddyList;
|
||||||
|
import buddy.BuddyManager;
|
||||||
|
import com.sbi.popup.SBYesNoPopup;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import flash.utils.setTimeout;
|
||||||
|
import gui.DarkenManager;
|
||||||
|
import gui.GuiManager;
|
||||||
|
import gui.GuiRadioButtonSingle;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
|
||||||
|
public class ItemWindowBuddyList extends ItemWindowBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private var _bud:Buddy = new Buddy();
|
||||||
|
|
||||||
|
private var _isForMainHud:Boolean;
|
||||||
|
|
||||||
|
private var _currWindow:MovieClip;
|
||||||
|
|
||||||
|
private var _isSelection:Boolean;
|
||||||
|
|
||||||
|
private var _currSelectedUsername:String;
|
||||||
|
|
||||||
|
public function ItemWindowBuddyList(param1:Function, param2:*, param3:String, param4:int, param5:Function = null, param6:Function = null, param7:Function = null, param8:Function = null, param9:Object = null)
|
||||||
|
{
|
||||||
|
_bud.init(param2.userName,param2.uuid,param2.moderatedUserNameFlag,param2.onlineStatus,param2.accountType,param2.timeLeftHostingCustomParty);
|
||||||
|
_isForMainHud = param9 ? param9.isForMainHud : false;
|
||||||
|
_isSelection = param9 ? param9.isSelection : false;
|
||||||
|
if(param9 && _bud.userName.toLowerCase() == param9.currSelectedUsername.toLowerCase())
|
||||||
|
{
|
||||||
|
_currSelectedUsername = param9.currSelectedUsername;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_currSelectedUsername = "";
|
||||||
|
}
|
||||||
|
super("buddyListWindowCont",param1,param2,param3,param4,param5,param6,param7,param8,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function destroy() : void
|
||||||
|
{
|
||||||
|
if(_window && _window.recycleBtn)
|
||||||
|
{
|
||||||
|
_window.recycleBtn.removeEventListener("mouseDown",onRecycleDown);
|
||||||
|
}
|
||||||
|
super.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBuddy() : Buddy
|
||||||
|
{
|
||||||
|
return _bud;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buddyPortalUsername() : String
|
||||||
|
{
|
||||||
|
return _currSelectedUsername.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function turnOffBuddySelection() : void
|
||||||
|
{
|
||||||
|
_currSelectedUsername = "";
|
||||||
|
_currWindow.selectPortalBuddyBox.selected = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setBuddySelection() : void
|
||||||
|
{
|
||||||
|
_currSelectedUsername = _bud.userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showRecycleBtn(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
if(_window)
|
||||||
|
{
|
||||||
|
_window.recycleBtn.visible = param1;
|
||||||
|
_window.highlight.visible = param1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get sizeCont() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.sizeCont;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update() : void
|
||||||
|
{
|
||||||
|
if(_bud && _bud.onlineStatus == 1)
|
||||||
|
{
|
||||||
|
_bud = BuddyManager.getBuddyByUserName(_bud.userName);
|
||||||
|
if(_bud && _window)
|
||||||
|
{
|
||||||
|
_currWindow = _window.OnlineBuddyListWindow;
|
||||||
|
if(_currWindow && _currWindow.onOffBlocked.currentFrameLabel != "blocked")
|
||||||
|
{
|
||||||
|
if(_bud.timeLeftHostingCustomParty > 0)
|
||||||
|
{
|
||||||
|
_currWindow.onOffBlocked.gotoAndStop("jammerParty");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_currWindow.onOffBlocked.gotoAndStop("online");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function onWindowLoadCallback() : void
|
||||||
|
{
|
||||||
|
setChildrenAndInitialConditions();
|
||||||
|
addEventListeners();
|
||||||
|
super.onWindowLoadCallback();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function setStatesForVisibility(param1:Boolean, param2:Object = null) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function loadCurrItem(param1:int = 0, param2:int = 0) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function setChildrenAndInitialConditions() : void
|
||||||
|
{
|
||||||
|
if(_isSelection)
|
||||||
|
{
|
||||||
|
_window.gotoAndStop("portal");
|
||||||
|
_currWindow = _window.portal;
|
||||||
|
_currWindow.selectPortalBuddyBox = new GuiRadioButtonSingle(_currWindow.radioBtn,_currWindow.userNameTxt);
|
||||||
|
if(_bud.onlineStatus == -1)
|
||||||
|
{
|
||||||
|
_currWindow.selectPortalBuddyBox.gray = true;
|
||||||
|
}
|
||||||
|
else if(_bud.userName.toLowerCase() == _currSelectedUsername.toLowerCase())
|
||||||
|
{
|
||||||
|
_currWindow.selectPortalBuddyBox.selected = true;
|
||||||
|
BuddyList.updateSelectedInWorldBuddyIndex(_index);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_currWindow.selectPortalBuddyBox.selected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(_bud.onlineStatus == 1)
|
||||||
|
{
|
||||||
|
_window.gotoAndStop("online");
|
||||||
|
_currWindow = _window.OnlineBuddyListWindow;
|
||||||
|
if(BuddyManager.isBlocked(_bud.userName))
|
||||||
|
{
|
||||||
|
_currWindow.onOffBlocked.gotoAndStop("blocked");
|
||||||
|
}
|
||||||
|
else if(_bud.timeLeftHostingCustomParty > 0)
|
||||||
|
{
|
||||||
|
_currWindow.onOffBlocked.gotoAndStop("jammerParty");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_currWindow.onOffBlocked.gotoAndStop("online");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.gotoAndStop("offline");
|
||||||
|
_currWindow = _window.OfflineBuddyListWindow;
|
||||||
|
_currWindow.onOffBlocked.gotoAndStop("offline");
|
||||||
|
}
|
||||||
|
_currWindow.onlineStatus = _bud.onlineStatus;
|
||||||
|
_currWindow.accountType = _bud.accountType;
|
||||||
|
_window.recycleBtn.addEventListener("mouseDown",onRecycleDown,false,0,true);
|
||||||
|
_window.recycleBtn.visible = false;
|
||||||
|
_window.highlight.visible = false;
|
||||||
|
}
|
||||||
|
_currWindow.userName = _bud.userName;
|
||||||
|
_currWindow.moderatedUserName = _bud.userNameModerated;
|
||||||
|
LocalizationManager.updateToFit(_currWindow.userNameTxt,_bud.userNameModerated + (!_isSelection && _bud.onlineStatus != 1 ? AJClient.lastSeenShort(_bud.userName) : ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRecycleDown(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(_bud)
|
||||||
|
{
|
||||||
|
new SBYesNoPopup(GuiManager.guiLayer,LocalizationManager.translateIdAndInsertOnly(14705,_bud.userNameModerated),true,removeBuddyConfirmCallback,{
|
||||||
|
"currUserName":_bud.userName,
|
||||||
|
"currUserNameModerated":_bud.userNameModerated
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function removeBuddyConfirmCallback(param1:Object) : void
|
||||||
|
{
|
||||||
|
if(param1.status)
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
setTimeout(DarkenManager.showLoadingSpiral,1000,false);
|
||||||
|
BuddyManager.addRemoveBuddy(param1.passback.currUserName,param1.passback.currUserNameModerated,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,690 @@
|
|||||||
|
package gui.itemWindows
|
||||||
|
{
|
||||||
|
import avatar.AvatarManager;
|
||||||
|
import den.DenItem;
|
||||||
|
import den.DenMannequinInventory;
|
||||||
|
import flash.display.DisplayObject;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import gui.LoadingSpiral;
|
||||||
|
import inventory.Iitem;
|
||||||
|
import item.Item;
|
||||||
|
import pet.GuiPet;
|
||||||
|
import pet.PetItem;
|
||||||
|
import pet.PetManager;
|
||||||
|
import shop.ShopManager;
|
||||||
|
|
||||||
|
public class ItemWindowOriginal extends ItemWindowBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private var _isAvatarEditor:Boolean;
|
||||||
|
|
||||||
|
private var _isTradeList:Boolean;
|
||||||
|
|
||||||
|
private var _isChoosingForTradeList:Boolean;
|
||||||
|
|
||||||
|
private var _generatorIndex:int;
|
||||||
|
|
||||||
|
private var _giftItemIdx:int;
|
||||||
|
|
||||||
|
private var _isDownGift:Boolean;
|
||||||
|
|
||||||
|
private var _isPetItem:Boolean;
|
||||||
|
|
||||||
|
private var _isActivePet:Boolean;
|
||||||
|
|
||||||
|
private var _isAudio:Boolean;
|
||||||
|
|
||||||
|
private var _isLastPlacedAudio:Boolean;
|
||||||
|
|
||||||
|
private var _isTradeManager:Boolean;
|
||||||
|
|
||||||
|
private var _isECard:Boolean;
|
||||||
|
|
||||||
|
private var _isViewingATradeList:Boolean;
|
||||||
|
|
||||||
|
private var _isRecycling:Boolean;
|
||||||
|
|
||||||
|
private var _loadImmediately:Boolean;
|
||||||
|
|
||||||
|
private var _showAddRemoveBtns:Boolean;
|
||||||
|
|
||||||
|
private var _hasBeenHidden:Boolean;
|
||||||
|
|
||||||
|
private var _inUse:Boolean;
|
||||||
|
|
||||||
|
private var _hasSetInitialConditions:Boolean;
|
||||||
|
|
||||||
|
private var _avInvId:int;
|
||||||
|
|
||||||
|
private var _mannequinInvIdx:int;
|
||||||
|
|
||||||
|
private var _hasSetState:Boolean;
|
||||||
|
|
||||||
|
private var _isSellShop:Boolean;
|
||||||
|
|
||||||
|
public function ItemWindowOriginal(param1:Function, param2:Object, param3:String, param4:int, param5:Function = null, param6:Function = null, param7:Function = null, param8:Function = null, param9:Object = null)
|
||||||
|
{
|
||||||
|
var _loc11_:int = 0;
|
||||||
|
var _loc10_:int = param4;
|
||||||
|
_generatorIndex = param4;
|
||||||
|
if(param9 != null)
|
||||||
|
{
|
||||||
|
_loadImmediately = param9.loadImmediately;
|
||||||
|
_isRecycling = param9.isRecycling;
|
||||||
|
_isViewingATradeList = param9.isViewingATradeList;
|
||||||
|
_isECard = param9.isECard;
|
||||||
|
_isAvatarEditor = param9.isAvatarEditor;
|
||||||
|
_isTradeManager = param9.isTradeManager;
|
||||||
|
_isAudio = param9.isAudio;
|
||||||
|
_isPetItem = param9.isPetItem;
|
||||||
|
_giftItemIdx = param9.giftItemIdx;
|
||||||
|
_isTradeList = param9.isTradeList;
|
||||||
|
_isChoosingForTradeList = param9.isChoosingForTradeList;
|
||||||
|
_isSellShop = param9.isSellShop;
|
||||||
|
_showAddRemoveBtns = param9.showAddRemoveBtns;
|
||||||
|
_avInvId = param9.avInvId ? param9.avInvId : gMainFrame.userInfo.playerAvatarInfo.avInvId;
|
||||||
|
_mannequinInvIdx = _isAvatarEditor ? param9.mannequinInvIdx : -1;
|
||||||
|
if(param9.indexArray != null)
|
||||||
|
{
|
||||||
|
_loc11_ = int(param9.indexArray.length);
|
||||||
|
_loc10_ = int(_loc11_ - 1 >= param4 ? param9.indexArray[param4] : param4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super("itemWindow",param1,param2,param3,_loc10_,param5,param6,param7,param8,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// draws the ring again after the list of picked items changed.
|
||||||
|
public function refreshPicked() : void
|
||||||
|
{
|
||||||
|
if(_window == null || _currItem == null || !_isCurrItemLoaded || _window.cir.currentFrameLabel == "gray")
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(AJClient.isPicked(_currItem))
|
||||||
|
{
|
||||||
|
_window.cir.gotoAndStop("green");
|
||||||
|
}
|
||||||
|
else if(_window.cir.currentFrameLabel == "green" || _window.cir.currentFrameLabel == "greenMouse")
|
||||||
|
{
|
||||||
|
_window.cir.gotoAndStop(_inUse ? "down" : "up");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get removeBtn() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.removeBtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get addBtn() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.addBtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get cir() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.cir;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get sizeCont() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.sizeCont;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get gift() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.gift;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isDownGift() : Boolean
|
||||||
|
{
|
||||||
|
return _isDownGift;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isActivePet() : Boolean
|
||||||
|
{
|
||||||
|
return _isActivePet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isLastPlacedAudio() : Boolean
|
||||||
|
{
|
||||||
|
return _isLastPlacedAudio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isAudio() : Boolean
|
||||||
|
{
|
||||||
|
return _isAudio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isUsable() : Boolean
|
||||||
|
{
|
||||||
|
return _currItem == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get currItem() : Object
|
||||||
|
{
|
||||||
|
return _currItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get itemName() : String
|
||||||
|
{
|
||||||
|
if(_currItem)
|
||||||
|
{
|
||||||
|
return _currItem.name;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isInUse() : Boolean
|
||||||
|
{
|
||||||
|
return _inUse;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get mannequinInvIdx() : int
|
||||||
|
{
|
||||||
|
return _mannequinInvIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function get numChildren() : int
|
||||||
|
{
|
||||||
|
return _window.numChildren;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function getChildAt(param1:int) : DisplayObject
|
||||||
|
{
|
||||||
|
return _window.getChildAt(param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetDownGift() : void
|
||||||
|
{
|
||||||
|
if(_window)
|
||||||
|
{
|
||||||
|
_window.gift.visible = false;
|
||||||
|
}
|
||||||
|
_isDownGift = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set currDownGift(param1:Object) : void
|
||||||
|
{
|
||||||
|
_isDownGift = true;
|
||||||
|
_window.gift.visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetAudioDown() : void
|
||||||
|
{
|
||||||
|
_isLastPlacedAudio = false;
|
||||||
|
_window.cir.gotoAndStop("up");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAudioDown() : void
|
||||||
|
{
|
||||||
|
_isLastPlacedAudio = true;
|
||||||
|
_window.cir.gotoAndStop("down");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get defId() : int
|
||||||
|
{
|
||||||
|
if(_currItem)
|
||||||
|
{
|
||||||
|
return _currItem.defId;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get avtSpecific() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.avtSpecific;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get hasBeenHidden() : Boolean
|
||||||
|
{
|
||||||
|
return _hasBeenHidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeLoadedItem() : void
|
||||||
|
{
|
||||||
|
_hasBeenHidden = true;
|
||||||
|
if(_currItem)
|
||||||
|
{
|
||||||
|
if(_iconLayerName != "" && _currItem.hasOwnProperty(_iconLayerName))
|
||||||
|
{
|
||||||
|
if(_currItem[_iconLayerName].parent == _window.iconLayer)
|
||||||
|
{
|
||||||
|
_window.iconLayer.removeChild(_currItem[_iconLayerName]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_currItem.parent == _window.iconLayer)
|
||||||
|
{
|
||||||
|
_window.iconLayer.removeChild(_currItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resetDownGift();
|
||||||
|
resetAudioDown();
|
||||||
|
resetVisibility();
|
||||||
|
super.removeEventListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update() : void
|
||||||
|
{
|
||||||
|
if(_currItem)
|
||||||
|
{
|
||||||
|
if(_isCurrItemLoaded && !_hasBeenHidden)
|
||||||
|
{
|
||||||
|
if(_mannequinInvIdx != -1 && _currItem as DenItem)
|
||||||
|
{
|
||||||
|
(_currItem as DenItem).rebuildMannequin();
|
||||||
|
}
|
||||||
|
_hasSetState = false;
|
||||||
|
setStates();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateWithInput(param1:*) : void
|
||||||
|
{
|
||||||
|
_hasBeenHidden = false;
|
||||||
|
_currItem = param1;
|
||||||
|
_isCurrItemLoaded = false;
|
||||||
|
_hasSetState = false;
|
||||||
|
removeEventListeners();
|
||||||
|
loadCurrItem();
|
||||||
|
addEventListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetWindowToOriginalState() : void
|
||||||
|
{
|
||||||
|
_hasSetInitialConditions = false;
|
||||||
|
_hasBeenHidden = false;
|
||||||
|
_isCurrItemLoaded = false;
|
||||||
|
_hasSetState = false;
|
||||||
|
removeEventListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function loadCurrItem(param1:int = 0, param2:int = 0) : void
|
||||||
|
{
|
||||||
|
_itemYLocation = param1;
|
||||||
|
_itemXLocation = param2;
|
||||||
|
if(!_hasSetInitialConditions)
|
||||||
|
{
|
||||||
|
setChildrenAndInitialConditions();
|
||||||
|
}
|
||||||
|
if(_currItem && !_isCurrItemLoaded && !_hasBeenHidden)
|
||||||
|
{
|
||||||
|
_isCurrItemLoaded = true;
|
||||||
|
if(_currItem is PetItem)
|
||||||
|
{
|
||||||
|
(_currItem as PetItem).imageLoadedCallback = onPetItemLoaded;
|
||||||
|
}
|
||||||
|
if(_iconLayerName != "" && _currItem.hasOwnProperty(_iconLayerName))
|
||||||
|
{
|
||||||
|
_window.iconLayer.addChild(_currItem[_iconLayerName]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.iconLayer.addChild(DisplayObject(_currItem));
|
||||||
|
}
|
||||||
|
setStates();
|
||||||
|
}
|
||||||
|
else if(_currItem == null)
|
||||||
|
{
|
||||||
|
_isCurrItemLoaded = false;
|
||||||
|
resetVisibility();
|
||||||
|
resetDownGift();
|
||||||
|
resetAudioDown();
|
||||||
|
if(_showAddRemoveBtns && (_isTradeList || _isTradeManager))
|
||||||
|
{
|
||||||
|
_window.addBtn.visible = true;
|
||||||
|
}
|
||||||
|
while(_window.iconLayer.numChildren > 1)
|
||||||
|
{
|
||||||
|
_window.iconLayer.removeChildAt(_window.iconLayer.numChildren - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function setStatesForVisibility(param1:Boolean, param2:Object = null) : void
|
||||||
|
{
|
||||||
|
if(!param1)
|
||||||
|
{
|
||||||
|
_isCurrItemLoaded = false;
|
||||||
|
if(_currItem != null && currItem.hasOwnProperty("destroy"))
|
||||||
|
{
|
||||||
|
_currItem.destroy();
|
||||||
|
}
|
||||||
|
while(_window.iconLayer.numChildren > 1)
|
||||||
|
{
|
||||||
|
_window.iconLayer.removeChildAt(_window.iconLayer.numChildren - 1);
|
||||||
|
}
|
||||||
|
setChildrenAndInitialConditions();
|
||||||
|
}
|
||||||
|
this.visible = param1;
|
||||||
|
if(param1 && _currItem != null && _currItem is DenItem)
|
||||||
|
{
|
||||||
|
if(DenItem(_currItem).petItem)
|
||||||
|
{
|
||||||
|
DenItem(_currItem).setVersion(DenItem(_currItem).petItem.petBits[0],DenItem(_currItem).petItem.petBits[1],DenItem(_currItem).petItem.petBits[2]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DenItem(_currItem).setVersion(DenItem(_currItem).version);
|
||||||
|
}
|
||||||
|
if(DenItem(_currItem).mannequinData != null)
|
||||||
|
{
|
||||||
|
DenItem(_currItem).mannequinData.setToAvatarBoxFrame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setStates() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Iitem = null;
|
||||||
|
if(!_hasSetState)
|
||||||
|
{
|
||||||
|
_hasSetState = true;
|
||||||
|
if(_isTradeManager)
|
||||||
|
{
|
||||||
|
if(_currItem is Item)
|
||||||
|
{
|
||||||
|
_loc1_ = _currItem as Item;
|
||||||
|
_currItem = _loc1_.clone();
|
||||||
|
}
|
||||||
|
else if(_currItem is PetItem)
|
||||||
|
{
|
||||||
|
_loc1_ = _currItem as PetItem;
|
||||||
|
_currItem = _loc1_.clone();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc1_ = _currItem as DenItem;
|
||||||
|
_currItem = _loc1_.clone();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_currItem.isMemberOnly)
|
||||||
|
{
|
||||||
|
if(!gMainFrame.userInfo.isMember)
|
||||||
|
{
|
||||||
|
_window.lock.visible = true;
|
||||||
|
if(!isSpecialList())
|
||||||
|
{
|
||||||
|
_window.gray.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.lockOpen.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_currItem.isOcean)
|
||||||
|
{
|
||||||
|
_window.ocean.visible = true;
|
||||||
|
}
|
||||||
|
if(_currItem.isRareDiamond)
|
||||||
|
{
|
||||||
|
_window.rareDiamondTag.visible = true;
|
||||||
|
}
|
||||||
|
else if(_currItem.isCustom)
|
||||||
|
{
|
||||||
|
_window.customDiamond.visible = true;
|
||||||
|
_window.previewBtn.visible = _mouseDown != null ? true : false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(_currItem.isRare)
|
||||||
|
{
|
||||||
|
_window.rare.visible = true;
|
||||||
|
}
|
||||||
|
_window.diamond.visible = _currItem.isDiamond;
|
||||||
|
}
|
||||||
|
if(_showAddRemoveBtns && (_isTradeList || _isTradeManager || _isSellShop))
|
||||||
|
{
|
||||||
|
_window.removeBtn.visible = true;
|
||||||
|
_window.addBtn.visible = false;
|
||||||
|
}
|
||||||
|
if(_currItem is Item)
|
||||||
|
{
|
||||||
|
if(_currItem.getInUse(_avInvId))
|
||||||
|
{
|
||||||
|
_window.cir.gotoAndStop("down");
|
||||||
|
_inUse = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.cir.gotoAndStop("up");
|
||||||
|
_inUse = false;
|
||||||
|
}
|
||||||
|
if(_isAvatarEditor && !_isTradeList && !_isSellShop)
|
||||||
|
{
|
||||||
|
if((_currItem as Item).enviroType != AvatarManager.roomEnviroType || _mannequinInvIdx != -1 && !DenMannequinInventory.canUseItem((_currItem as Item).invIdx,_mannequinInvIdx))
|
||||||
|
{
|
||||||
|
_window.cir.gotoAndStop("gray");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_currItem is DenItem)
|
||||||
|
{
|
||||||
|
if(_currItem.categoryId != 0 && !_isActivePet)
|
||||||
|
{
|
||||||
|
_isLastPlacedAudio = true;
|
||||||
|
_window.cir.gotoAndStop("down");
|
||||||
|
_inUse = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.cir.gotoAndStop("up");
|
||||||
|
_inUse = false;
|
||||||
|
}
|
||||||
|
if(_currItem.refId == 1)
|
||||||
|
{
|
||||||
|
if(_currItem.invIdx == PetManager.myActivePetInvId)
|
||||||
|
{
|
||||||
|
_window.cir.gotoAndStop("green");
|
||||||
|
_isActivePet = true;
|
||||||
|
}
|
||||||
|
if(_mouseDown != null && (!DenItem(_currItem).petItem.isEgg || Boolean(DenItem(_currItem).petItem.isHatched)))
|
||||||
|
{
|
||||||
|
_window.certBtn.visible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.certBtn.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_currItem.specialType == 7 || _currItem.specialType == 6)
|
||||||
|
{
|
||||||
|
_window.consumerItemBtn.visible = true;
|
||||||
|
_window.consumerItemBtn.activateGrayState(_currItem.specialType == 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_currItem is PetItem || _isPetItem)
|
||||||
|
{
|
||||||
|
if(_currItem.invIdx == PetManager.myActivePetInvId)
|
||||||
|
{
|
||||||
|
_window.cir.gotoAndStop("green");
|
||||||
|
_isActivePet = true;
|
||||||
|
}
|
||||||
|
if(_mouseDown != null && (!PetItem(_currItem).isEgg || Boolean(PetItem(_currItem).isHatched)))
|
||||||
|
{
|
||||||
|
_window.certBtn.visible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.certBtn.visible = false;
|
||||||
|
}
|
||||||
|
if(_currItem.isRare)
|
||||||
|
{
|
||||||
|
_window.rare.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// picked in the item picker or for recycling (AJClient's list):
|
||||||
|
// the ring is green however the cell came into view.
|
||||||
|
if(AJClient.pickedCount > 0 && AJClient.isPicked(_currItem))
|
||||||
|
{
|
||||||
|
_window.cir.gotoAndStop("green");
|
||||||
|
}
|
||||||
|
if(_currItem is Iitem && (_currItem as Iitem).isInDenShop)
|
||||||
|
{
|
||||||
|
if(ShopManager.currentOpenShopId != (_currItem as Iitem).denStoreInvId)
|
||||||
|
{
|
||||||
|
_window.shopItem.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_isECard)
|
||||||
|
{
|
||||||
|
if(_giftItemIdx == _currItem.invIdx)
|
||||||
|
{
|
||||||
|
this.gift.visible = true;
|
||||||
|
_isDownGift = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function setChildrenAndInitialConditions() : void
|
||||||
|
{
|
||||||
|
if(!_hasSetInitialConditions)
|
||||||
|
{
|
||||||
|
_hasSetInitialConditions = true;
|
||||||
|
if(_currItem)
|
||||||
|
{
|
||||||
|
if(!_spiral)
|
||||||
|
{
|
||||||
|
_spiral = new LoadingSpiral(_window.iconLayer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_spiral.setNewParent(_window.iconLayer);
|
||||||
|
}
|
||||||
|
if(!_currItem.isIconLoaded)
|
||||||
|
{
|
||||||
|
_currItem.imageLoadedCallback = _spiral.destroy();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_spiral.destroy();
|
||||||
|
}
|
||||||
|
if(_loadImmediately)
|
||||||
|
{
|
||||||
|
loadCurrItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_showAddRemoveBtns && (_isTradeList || _isTradeManager))
|
||||||
|
{
|
||||||
|
_window.addBtn.visible = true;
|
||||||
|
}
|
||||||
|
addEventListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function onWindowLoadCallback() : void
|
||||||
|
{
|
||||||
|
if(_windowLoadedCallback != null)
|
||||||
|
{
|
||||||
|
resetVisibility();
|
||||||
|
if(_loadImmediately)
|
||||||
|
{
|
||||||
|
setChildrenAndInitialConditions();
|
||||||
|
}
|
||||||
|
_windowLoadedCallback(this,_generatorIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function addEventListeners() : void
|
||||||
|
{
|
||||||
|
if(_window && _currItem)
|
||||||
|
{
|
||||||
|
if(_mouseDown != null && !(_currItem.isMemberOnly && _memberOnlyDown != null && !gMainFrame.userInfo.isMember && !isSpecialList()))
|
||||||
|
{
|
||||||
|
addEventListener("mouseDown",_mouseDown,false,0,true);
|
||||||
|
_window.previewBtn.addEventListener("mouseDown",_mouseDown,false,0,true);
|
||||||
|
_window.certBtn.addEventListener("mouseDown",_mouseDown,false,0,true);
|
||||||
|
}
|
||||||
|
if(_mouseOver != null)
|
||||||
|
{
|
||||||
|
addEventListener("rollOver",_mouseOver,false,0,true);
|
||||||
|
if(_useToolTip)
|
||||||
|
{
|
||||||
|
addEventListener("rollOver",onWindowRollOver,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_mouseOut != null)
|
||||||
|
{
|
||||||
|
addEventListener("rollOut",_mouseOut,false,0,true);
|
||||||
|
if(_useToolTip)
|
||||||
|
{
|
||||||
|
addEventListener("rollOut",onWindowRollOut,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_memberOnlyDown != null && _currItem.isMemberOnly && !gMainFrame.userInfo.isMember && !isSpecialList())
|
||||||
|
{
|
||||||
|
addEventListener("mouseDown",_memberOnlyDown,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_showAddRemoveBtns && (_isTradeList || _isTradeManager))
|
||||||
|
{
|
||||||
|
if(_mouseDown != null)
|
||||||
|
{
|
||||||
|
addEventListener("mouseDown",_mouseDown,false,0,true);
|
||||||
|
_window.previewBtn.addEventListener("mouseDown",_mouseDown,false,0,true);
|
||||||
|
_window.certBtn.addEventListener("mouseDown",_mouseDown,false,0,true);
|
||||||
|
}
|
||||||
|
if(_mouseOver != null)
|
||||||
|
{
|
||||||
|
addEventListener("rollOver",_mouseOver,false,0,true);
|
||||||
|
}
|
||||||
|
if(_mouseOut != null)
|
||||||
|
{
|
||||||
|
addEventListener("rollOut",_mouseOut,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function removeEventListeners() : void
|
||||||
|
{
|
||||||
|
super.removeEventListeners();
|
||||||
|
if(Boolean(_mouseDown))
|
||||||
|
{
|
||||||
|
_window.previewBtn.removeEventListener("mouseDown",_mouseDown);
|
||||||
|
_window.certBtn.removeEventListener("mouseDown",_mouseDown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function isSpecialList() : Boolean
|
||||||
|
{
|
||||||
|
return _isTradeList || _isTradeManager || _isChoosingForTradeList || _isViewingATradeList || _isECard || _isRecycling;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function resetVisibility() : void
|
||||||
|
{
|
||||||
|
_window.lock.visible = false;
|
||||||
|
_window.lockOpen.visible = false;
|
||||||
|
_window.gray.visible = false;
|
||||||
|
_window.gift.visible = false;
|
||||||
|
_window.addBtn.visible = false;
|
||||||
|
_window.removeBtn.visible = false;
|
||||||
|
_window.ocean.visible = false;
|
||||||
|
_window.rare.visible = false;
|
||||||
|
_window.avtSpecific.visible = false;
|
||||||
|
_window.avtSpecificIcon.visible = false;
|
||||||
|
_window.avtSpecificHighlight.visible = false;
|
||||||
|
_window.rareDiamondTag.visible = false;
|
||||||
|
_window.diamond.visible = false;
|
||||||
|
_window.customDiamond.visible = false;
|
||||||
|
_window.previewBtn.visible = false;
|
||||||
|
_window.certBtn.visible = false;
|
||||||
|
_window.shopItem.visible = false;
|
||||||
|
_window.consumerItemBtn.visible = false;
|
||||||
|
super.onWindowRollOut(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPetItemLoaded(param1:MovieClip, param2:GuiPet) : void
|
||||||
|
{
|
||||||
|
var _loc3_:Number = NaN;
|
||||||
|
if(_window)
|
||||||
|
{
|
||||||
|
_loc3_ = _window.iconLayer.width / Math.max(param1.width,param1.height);
|
||||||
|
param1.scaleX = param1.scaleY = _loc3_;
|
||||||
|
param1.y = _window.iconLayer.height * 0.5 - 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,272 @@
|
|||||||
|
package gui.itemWindows
|
||||||
|
{
|
||||||
|
import avatar.AvatarManager;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import gui.LoadingSpiral;
|
||||||
|
import gui.WindowAndScrollbarGenerator;
|
||||||
|
import pet.GuiPet;
|
||||||
|
import pet.PetDef;
|
||||||
|
import pet.PetManager;
|
||||||
|
|
||||||
|
public class ItemWindowPets extends ItemWindowBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private var _isRecycling:Boolean;
|
||||||
|
|
||||||
|
private var _currGuiPet:GuiPet;
|
||||||
|
|
||||||
|
public function ItemWindowPets(param1:Function, param2:Object, param3:String, param4:int, param5:Function = null, param6:Function = null, param7:Function = null, param8:Function = null, param9:Object = null)
|
||||||
|
{
|
||||||
|
_isRecycling = param9.isRecycling;
|
||||||
|
super("itemWindowPets",param1,param2,param3,param4,param5,param6,param7,param8,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get cir() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.cir;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get gray() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get cageIcon() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.cageIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get newPetIcon() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.newPet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get hasPet() : Boolean
|
||||||
|
{
|
||||||
|
return _currItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get sizeCont() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.sizeCont;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get shopItem() : MovieClip
|
||||||
|
{
|
||||||
|
return _window.shopItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(param1:Object) : void
|
||||||
|
{
|
||||||
|
if("petObject" in param1)
|
||||||
|
{
|
||||||
|
if(_currGuiPet)
|
||||||
|
{
|
||||||
|
_currGuiPet.updateAllBits(param1.petObject.lBits,param1.petObject.uBits,param1.petObject.eBits);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if("isRecycling" in param1)
|
||||||
|
{
|
||||||
|
_isRecycling = param1.isRecycling;
|
||||||
|
if(_currItem)
|
||||||
|
{
|
||||||
|
_window.cageIcon.visible = _isRecycling;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeLoadedItem() : void
|
||||||
|
{
|
||||||
|
if(_currGuiPet)
|
||||||
|
{
|
||||||
|
_window.iconLayer.removeChild(_currGuiPet);
|
||||||
|
_currGuiPet.destroy();
|
||||||
|
_currGuiPet = null;
|
||||||
|
}
|
||||||
|
_currItem = null;
|
||||||
|
setChildrenAndInitialConditions();
|
||||||
|
_spiral.visible = false;
|
||||||
|
_window.newPet.visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function destroy() : void
|
||||||
|
{
|
||||||
|
if(_currGuiPet)
|
||||||
|
{
|
||||||
|
_currGuiPet.destroy();
|
||||||
|
_currGuiPet = null;
|
||||||
|
}
|
||||||
|
_spiral = null;
|
||||||
|
super.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function setStatesForVisibility(param1:Boolean, param2:Object = null) : void
|
||||||
|
{
|
||||||
|
if(_currGuiPet)
|
||||||
|
{
|
||||||
|
if(!param1)
|
||||||
|
{
|
||||||
|
_isCurrItemLoaded = false;
|
||||||
|
_window.iconLayer.removeChild(_currGuiPet);
|
||||||
|
_currGuiPet.destroy();
|
||||||
|
_currGuiPet = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.visible = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function loadCurrItem(param1:int = 0, param2:int = 0) : void
|
||||||
|
{
|
||||||
|
var _loc3_:PetDef = null;
|
||||||
|
_itemYLocation = param1;
|
||||||
|
_itemXLocation = param2;
|
||||||
|
if(!_isCurrItemLoaded)
|
||||||
|
{
|
||||||
|
setChildrenAndInitialConditions();
|
||||||
|
addEventListeners();
|
||||||
|
if(_currItem)
|
||||||
|
{
|
||||||
|
if(_spiral)
|
||||||
|
{
|
||||||
|
_spiral.visible = true;
|
||||||
|
}
|
||||||
|
_loc3_ = PetManager.getPetDef(_currItem.defId);
|
||||||
|
_currGuiPet = new GuiPet(_currItem.createdTs,_currItem.idx,_currItem.lBits,_currItem.uBits,_currItem.eBits,_currItem.type,_currItem.name,_currItem.personalityDefId,_currItem.favoriteToyDefId,_currItem.favoriteFoodDefId,onPetLoaded);
|
||||||
|
_window.cageIcon.visible = _isRecycling;
|
||||||
|
if(_currGuiPet.isEggAndHasNotHatched())
|
||||||
|
{
|
||||||
|
_window.ocean.visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.ocean.visible = _currGuiPet.canGoInOcean();
|
||||||
|
}
|
||||||
|
if(!gMainFrame.userInfo.isMember)
|
||||||
|
{
|
||||||
|
_window.lockOpen.visible = false;
|
||||||
|
if(_loc3_.isMember)
|
||||||
|
{
|
||||||
|
_window.gray.visible = true;
|
||||||
|
_window.lock.visible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.lock.visible = false;
|
||||||
|
_window.gray.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.lock.visible = false;
|
||||||
|
_window.gray.visible = false;
|
||||||
|
if(_loc3_.isMember)
|
||||||
|
{
|
||||||
|
_window.lockOpen.visible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.lockOpen.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
trace(_currItem.denStoreInvId);
|
||||||
|
if(_currItem.denStoreInvId > 0)
|
||||||
|
{
|
||||||
|
_window.shopItem.visible = true;
|
||||||
|
}
|
||||||
|
_window.newPet.visible = false;
|
||||||
|
if(!PetManager.canCurrAvatarUsePet(AvatarManager.playerAvatar.enviroTypeFlag,_loc3_,_currItem.createdTs))
|
||||||
|
{
|
||||||
|
_window.gray.visible = true;
|
||||||
|
}
|
||||||
|
else if(PetManager.myActivePetInvId == _currGuiPet.idx)
|
||||||
|
{
|
||||||
|
_window.cir.gotoAndStop("down");
|
||||||
|
}
|
||||||
|
_window.rare.visible = _loc3_.status == 4;
|
||||||
|
_currGuiPet.scaleX = _currGuiPet.scaleY = 2;
|
||||||
|
_isCurrItemLoaded = true;
|
||||||
|
_window.iconLayer.addChild(_currGuiPet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_window.newPet.visible = true;
|
||||||
|
}
|
||||||
|
if(_spiral)
|
||||||
|
{
|
||||||
|
_spiral.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function setChildrenAndInitialConditions() : void
|
||||||
|
{
|
||||||
|
if(_spiral == null)
|
||||||
|
{
|
||||||
|
_spiral = new LoadingSpiral(_window.iconLayer,0,-_window.iconLayer.height * 0.5);
|
||||||
|
}
|
||||||
|
_window.lockOpen.visible = false;
|
||||||
|
_window.lock.visible = false;
|
||||||
|
_window.gray.visible = false;
|
||||||
|
_window.ocean.visible = false;
|
||||||
|
_window.cageIcon.visible = false;
|
||||||
|
_window.newPet.gray.visible = false;
|
||||||
|
_window.newPet.visible = false;
|
||||||
|
_window.rare.visible = false;
|
||||||
|
_window.shopItem.visible = false;
|
||||||
|
_window.cir.gotoAndStop("up");
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function addEventListeners() : void
|
||||||
|
{
|
||||||
|
if(_window)
|
||||||
|
{
|
||||||
|
if(_mouseDown != null && !(_memberOnlyDown != null && !gMainFrame.userInfo.isMember))
|
||||||
|
{
|
||||||
|
addEventListener("mouseDown",_mouseDown,false,0,true);
|
||||||
|
}
|
||||||
|
if(_mouseOver != null && _currItem)
|
||||||
|
{
|
||||||
|
addEventListener("rollOver",_mouseOver,false,0,true);
|
||||||
|
if(_useToolTip)
|
||||||
|
{
|
||||||
|
addEventListener("rollOver",onWindowRollOver,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_mouseOut != null && _currItem)
|
||||||
|
{
|
||||||
|
addEventListener("rollOut",_mouseOut,false,0,true);
|
||||||
|
if(_useToolTip)
|
||||||
|
{
|
||||||
|
addEventListener("rollOut",onWindowRollOut,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_memberOnlyDown != null && !gMainFrame.userInfo.isMember)
|
||||||
|
{
|
||||||
|
addEventListener("mouseDown",_memberOnlyDown,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function onWindowRollOver(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(_currItem && _useToolTip && this.parent != null)
|
||||||
|
{
|
||||||
|
if(_windowGenerator == null)
|
||||||
|
{
|
||||||
|
_windowGenerator = WindowAndScrollbarGenerator(this.parent.parent);
|
||||||
|
}
|
||||||
|
_windowGenerator.toolTip.init(_windowGenerator.parent.parent,_currGuiPet.petName,this.x + _windowGenerator.boxWidth * 0.5 + _windowGenerator.parent.x + _itemXLocation,this.y + _windowGenerator.boxHeight - _itemYLocation + _windowGenerator.parent.y - 5);
|
||||||
|
_windowGenerator.toolTip.startTimer(param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPetLoaded(param1:MovieClip, param2:GuiPet) : void
|
||||||
|
{
|
||||||
|
param2.animatePet(false);
|
||||||
|
if(_spiral)
|
||||||
|
{
|
||||||
|
_spiral.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,896 @@
|
|||||||
|
package gui.itemWindows
|
||||||
|
{
|
||||||
|
import achievement.AchievementXtCommManager;
|
||||||
|
import com.sbi.corelib.audio.SBAudio;
|
||||||
|
import com.sbi.debug.DebugUtility;
|
||||||
|
import den.DenXtCommManager;
|
||||||
|
import flash.display.Bitmap;
|
||||||
|
import flash.display.BitmapData;
|
||||||
|
import flash.display.DisplayObject;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.geom.Matrix;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import flash.geom.Rectangle;
|
||||||
|
import flash.net.URLRequest;
|
||||||
|
import flash.net.navigateToURL;
|
||||||
|
import gamePlayFlow.GamePlay;
|
||||||
|
import gui.CursorManager;
|
||||||
|
import gui.GuiHud;
|
||||||
|
import gui.GuiManager;
|
||||||
|
import gui.MySettings;
|
||||||
|
import gui.ServerSelector;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
import room.RoomManagerWorld;
|
||||||
|
|
||||||
|
public class ItemWindowToggle extends ItemWindowBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static const SLIDER_RECT:Rectangle = new Rectangle(15,15.5,82,0);
|
||||||
|
|
||||||
|
private var _lock:MovieClip;
|
||||||
|
|
||||||
|
private var _currHeight:int;
|
||||||
|
|
||||||
|
private var _mySettingsCloseFunction:Function;
|
||||||
|
|
||||||
|
private var _mySettingsThemesFunction:Function;
|
||||||
|
|
||||||
|
private var _musicToggle:ItemWindowToggle;
|
||||||
|
|
||||||
|
public function ItemWindowToggle(param1:Function, param2:Object, param3:String, param4:int, param5:Function = null, param6:Function = null, param7:Function = null, param8:Function = null, param9:Object = null)
|
||||||
|
{
|
||||||
|
_mySettingsCloseFunction = param9.onClose;
|
||||||
|
_mySettingsThemesFunction = param9.onThemes;
|
||||||
|
super("mySettingsToggle|false",param1,param2,param3,param4,param5,param6,param7,param8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get currFrameLabel() : String
|
||||||
|
{
|
||||||
|
return _currItem.frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetConditions() : void
|
||||||
|
{
|
||||||
|
setChildrenAndInitialConditions();
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function onWindowLoadCallback() : void
|
||||||
|
{
|
||||||
|
super.onWindowLoadCallback();
|
||||||
|
addEventListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function loadCurrItem(param1:int = 0, param2:int = 0) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function get height() : Number
|
||||||
|
{
|
||||||
|
return _currHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function setChildrenAndInitialConditions() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Boolean = false;
|
||||||
|
_currHeight = _window.height;
|
||||||
|
_window.goNowBtn.visible = false;
|
||||||
|
_window.woodenCursorBtn.visible = false;
|
||||||
|
_window.defaultCursorBtn.visible = false;
|
||||||
|
_window.toggleBtn.visible = false;
|
||||||
|
_window.toggleTxt.visible = false;
|
||||||
|
_window.scrubBtn.visible = false;
|
||||||
|
switch(_currItem.type)
|
||||||
|
{
|
||||||
|
case MySettings.TOGGLE_TYPE_TOGGLE_BTN:
|
||||||
|
_window.toggleBtn.visible = true;
|
||||||
|
_window.toggleBtn.toggleBtn.toggleKnob.gotoAndStop("up");
|
||||||
|
_window.toggleBtn.toggleBtn.toggleBG.gotoAndStop("up");
|
||||||
|
_window.icon.gotoAndStop(_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);
|
||||||
|
break;
|
||||||
|
case MySettings.TOGGLE_TYPE_TEXT:
|
||||||
|
_window.toggleTxt.visible = true;
|
||||||
|
_window.icon.gotoAndStop(_currItem.frame);
|
||||||
|
break;
|
||||||
|
case MySettings.TOGGLE_TYPE_CURSOR:
|
||||||
|
_window.woodenCursorBtn.visible = true;
|
||||||
|
_window.defaultCursorBtn.visible = true;
|
||||||
|
_window.icon.visible = false;
|
||||||
|
if(GuiManager.sharedObj && (GuiManager.sharedObj.data.cursor == "custom" || GuiManager.sharedObj.data.cursor == null))
|
||||||
|
{
|
||||||
|
_window.woodenCursorBtn.upToDownState();
|
||||||
|
_window.woodenCursorBtn.mouseEnabled = false;
|
||||||
|
_window.woodenCursorBtn.mouseChildren = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.defaultCursorBtn.upToDownState();
|
||||||
|
_window.defaultCursorBtn.mouseEnabled = false;
|
||||||
|
_window.defaultCursorBtn.mouseChildren = false;
|
||||||
|
}
|
||||||
|
_window.woodenCursorBtn.addEventListener("mouseDown",handleMouseDown,false,0,true);
|
||||||
|
_window.defaultCursorBtn.addEventListener("mouseDown",handleMouseDown,false,0,true);
|
||||||
|
break;
|
||||||
|
case MySettings.TOGGLE_TYPE_JOIN:
|
||||||
|
_window.goNowBtn.visible = true;
|
||||||
|
_window.goNowBtn.addEventListener("mouseDown",handleMouseDown,false,0,true);
|
||||||
|
if(_currItem.iconFrame == "house")
|
||||||
|
{
|
||||||
|
_window.icon.gotoAndStop("denPlayerIcon");
|
||||||
|
showHouseIcon();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.icon.gotoAndStop(_currItem.iconFrame != null ? _currItem.iconFrame : _currItem.frame);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case MySettings.TOGGLE_TYPE_SCRUB:
|
||||||
|
_window.scrubBtn.visible = true;
|
||||||
|
_window.icon.gotoAndStop("music");
|
||||||
|
_window.icon.music.gotoAndStop("startingOn");
|
||||||
|
_window.scrubBtn.addEventListener("mouseDown",handleMouseDown,false,0,true);
|
||||||
|
_window.addEventListener("mouseUp",handleMouseUp,false,0,true);
|
||||||
|
_window.addEventListener("mouseMove",handleMouseMove,false,0,true);
|
||||||
|
_window.addEventListener("rollOut",handleMouseOut,false,0,true);
|
||||||
|
_window.scrubBtn.scrubKnob.gotoAndStop("up");
|
||||||
|
_window.scrubBtn.scrubBG.gotoAndStop("up");
|
||||||
|
_window.scrubBtn.addEventListener("rollOver",handleMouseOver,false,0,true);
|
||||||
|
_window.scrubBtn.addEventListener("rollOut",handleMouseOut,false,0,true);
|
||||||
|
if(GuiManager.sharedObj && GuiManager.sharedObj.data.volume != null)
|
||||||
|
{
|
||||||
|
_window.scrubBtn.scrubKnob.x = GuiManager.sharedObj.data.volume * 82 + 15;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch(_currItem.frame)
|
||||||
|
{
|
||||||
|
case "lock":
|
||||||
|
if(gMainFrame.userInfo.denPrivacySettings != 2)
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOff");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOff");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOn");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOn");
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
break;
|
||||||
|
case "world":
|
||||||
|
_window.goNowBtn.down.txt.text = ServerSelector.getShardName(RoomManagerWorld.instance.shardId);
|
||||||
|
_window.goNowBtn.mouse.mouse.txt.text = ServerSelector.getShardName(RoomManagerWorld.instance.shardId);
|
||||||
|
_window.goNowBtn.mouse.up.txt.text = ServerSelector.getShardName(RoomManagerWorld.instance.shardId);
|
||||||
|
break;
|
||||||
|
case "itemFinder":
|
||||||
|
case "chatFilter":
|
||||||
|
case "themeMenu":
|
||||||
|
case "themePick":
|
||||||
|
case "savedMenu":
|
||||||
|
case "commandPick":
|
||||||
|
_window.goNowBtn.down.txt.text = _currItem.btnLabel;
|
||||||
|
_window.goNowBtn.mouse.mouse.txt.text = _currItem.btnLabel;
|
||||||
|
_window.goNowBtn.mouse.up.txt.text = _currItem.btnLabel;
|
||||||
|
_window.labelTxtCont.labelTxt.text = _currItem.labelLabel;
|
||||||
|
break;
|
||||||
|
case "hideBlocked":
|
||||||
|
showHideBlocked();
|
||||||
|
break;
|
||||||
|
case "wasd":
|
||||||
|
showWasd();
|
||||||
|
break;
|
||||||
|
case "graphics":
|
||||||
|
showGraphics();
|
||||||
|
break;
|
||||||
|
case "frameRate":
|
||||||
|
showFrameRate();
|
||||||
|
break;
|
||||||
|
case "camera":
|
||||||
|
showCamera();
|
||||||
|
break;
|
||||||
|
case "redeemCode":
|
||||||
|
case "verifyEmail":
|
||||||
|
case "twoFactor":
|
||||||
|
LocalizationManager.translateId(_window.goNowBtn.down.txt,_currItem.btnTxt);
|
||||||
|
LocalizationManager.translateId(_window.goNowBtn.mouse.mouse.txt,_currItem.btnTxt);
|
||||||
|
LocalizationManager.translateId(_window.goNowBtn.mouse.up.txt,_currItem.btnTxt);
|
||||||
|
break;
|
||||||
|
case "music":
|
||||||
|
if(SBAudio.isMusicMuted || SBAudio.areSoundsMuted)
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOff");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOff");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOn");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOn");
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
break;
|
||||||
|
case "buddyRequest":
|
||||||
|
if(Utility.isSettingOn(MySettings.SETTINGS_BUDDY_REQUESTS))
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOn");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOn");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOff");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOff");
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
break;
|
||||||
|
case "gameInvites":
|
||||||
|
if(Utility.isSettingOn(MySettings.SETTINGS_GAME_INVITES))
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOn");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOn");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOff");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOff");
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
break;
|
||||||
|
case "doorBell":
|
||||||
|
if(Utility.isSettingOn(MySettings.SETTINGS_DOOR_BELL))
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOff");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOff");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOn");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOn");
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
break;
|
||||||
|
case "autoServer":
|
||||||
|
if(Utility.isSettingOn(MySettings.SETTINGS_AUTO_SERVER_TRAVEL))
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOn");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOn");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOff");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOff");
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
break;
|
||||||
|
case "nameBadge":
|
||||||
|
if(Utility.isSettingOn(MySettings.SETTINGS_USERNAME_BADGE))
|
||||||
|
{
|
||||||
|
_window.toggleBtn.gotoAndStop("double");
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOff");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.gotoAndStop("double");
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOn");
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
break;
|
||||||
|
case "denPlayerIcon":
|
||||||
|
if(Utility.isSettingOn(MySettings.SETTINGS_DEN_PLAYER_ICON))
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOn");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOn");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOff");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOff");
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
break;
|
||||||
|
case "jammerWallIcon":
|
||||||
|
if(Utility.isSettingOn(MySettings.SETTINGS_JAMMER_WALL_ICON))
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOn");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOn");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOff");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOff");
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
break;
|
||||||
|
case "predictTxt":
|
||||||
|
_loc1_ = Utility.isSettingOn(MySettings.SETTINGS_CHAT_PREDICTION);
|
||||||
|
if(gMainFrame.userInfo.sgChatType == 1)
|
||||||
|
{
|
||||||
|
if(!Utility.hasChatSettingBeenSet())
|
||||||
|
{
|
||||||
|
_loc1_ = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc1_)
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOn");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOn");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndStop("startingOff");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndStop("startingOff");
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
break;
|
||||||
|
case "intro":
|
||||||
|
}
|
||||||
|
if(_currItem.labelTxt)
|
||||||
|
{
|
||||||
|
LocalizationManager.translateId(_window.labelTxtCont.labelTxt,_currItem.labelTxt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// the settings artwork has no house among its icons, so the rows for
|
||||||
|
// den layouts borrow the picture of the den button on the game's bar.
|
||||||
|
// if that cannot be drawn, the row keeps the icon it has.
|
||||||
|
private function showHouseIcon() : void
|
||||||
|
{
|
||||||
|
var _loc1_:DisplayObject = null;
|
||||||
|
var _loc2_:Rectangle = null;
|
||||||
|
var _loc3_:Rectangle = null;
|
||||||
|
var _loc4_:BitmapData = null;
|
||||||
|
var _loc5_:Bitmap = null;
|
||||||
|
var _loc6_:Number = NaN;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_loc1_ = GuiManager.mainHud.denBtn;
|
||||||
|
_loc2_ = _loc1_.getBounds(_loc1_);
|
||||||
|
_loc3_ = _window.icon.getBounds(_window);
|
||||||
|
if(_loc2_.width < 1 || _loc2_.height < 1 || _loc3_.width < 1)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loc4_ = new BitmapData(Math.ceil(_loc2_.width * 2),Math.ceil(_loc2_.height * 2),true,0);
|
||||||
|
_loc4_.draw(_loc1_,new Matrix(2,0,0,2,-_loc2_.x * 2,-_loc2_.y * 2),null,null,null,true);
|
||||||
|
_loc5_ = new Bitmap(_loc4_,"auto",true);
|
||||||
|
_loc6_ = Math.min(_loc3_.width / _loc4_.width,_loc3_.height / _loc4_.height);
|
||||||
|
_loc5_.scaleX = _loc5_.scaleY = _loc6_;
|
||||||
|
_loc5_.x = _loc3_.x + (_loc3_.width - _loc4_.width * _loc6_) * 0.5;
|
||||||
|
_loc5_.y = _loc3_.y + (_loc3_.height - _loc4_.height * _loc6_) * 0.5;
|
||||||
|
_window.addChildAt(_loc5_,_window.getChildIndex(_window.icon) + 1);
|
||||||
|
_window.icon.visible = false;
|
||||||
|
}
|
||||||
|
catch(e:Error)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// "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
|
||||||
|
{
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
private function showChoice(param1:String, param2:String) : void
|
||||||
|
{
|
||||||
|
_window.goNowBtn.down.txt.text = param2;
|
||||||
|
_window.goNowBtn.mouse.mouse.txt.text = param2;
|
||||||
|
_window.goNowBtn.mouse.up.txt.text = param2;
|
||||||
|
_window.labelTxtCont.labelTxt.text = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setChoice(param1:int, param2:int) : void
|
||||||
|
{
|
||||||
|
gMainFrame.userInfo.userVarCache.updateUserVar(param1,param2);
|
||||||
|
AchievementXtCommManager.requestSetUserVar(param1,param2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function showGraphics() : void
|
||||||
|
{
|
||||||
|
showChoice("Graphics",AJClient.smoothOn() ? "Smooth" : "Default");
|
||||||
|
}
|
||||||
|
|
||||||
|
private function showFrameRate() : void
|
||||||
|
{
|
||||||
|
showChoice("Frame rate",AJClient.frameRate() > 0 ? String(AJClient.frameRate()) : "Max");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 60 or Max, turn about.
|
||||||
|
private function nextFrameRate() : void
|
||||||
|
{
|
||||||
|
setChoice(9004,AJClient.frameRate() > 0 ? 2 : 1);
|
||||||
|
showFrameRate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function showCamera() : void
|
||||||
|
{
|
||||||
|
showChoice("Camera",AJClient.cameraEases() ? "Smooth" : "Normal");
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setWasd(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
gMainFrame.userInfo.userVarCache.updateUserVar(9002,param1 ? 1 : 0);
|
||||||
|
AchievementXtCommManager.requestSetUserVar(9002,param1 ? 1 : 0);
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
gMainFrame.stage.focus = null;
|
||||||
|
}
|
||||||
|
showWasd();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function blockedAreHidden() : Boolean
|
||||||
|
{
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handleMouseDown(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = NaN;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc3_:String = null;
|
||||||
|
var _loc4_:Array = null;
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(_currItem.type == MySettings.TOGGLE_TYPE_TOGGLE_BTN)
|
||||||
|
{
|
||||||
|
switch(_currItem.frame)
|
||||||
|
{
|
||||||
|
case "lock":
|
||||||
|
_lock = MovieClip(param1.currentTarget);
|
||||||
|
GuiManager.onToggleDenLock(onDenLockUnlock);
|
||||||
|
break;
|
||||||
|
case "music":
|
||||||
|
handleMuteUnmute();
|
||||||
|
break;
|
||||||
|
case "buddyRequest":
|
||||||
|
case "gameInvites":
|
||||||
|
case "doorBell":
|
||||||
|
case "autoServer":
|
||||||
|
case "nameBadge":
|
||||||
|
case "denPlayerIcon":
|
||||||
|
case "jammerWallIcon":
|
||||||
|
case "predictTxt":
|
||||||
|
_loc2_ = Number(gMainFrame.userInfo.userVarCache.getUserVarValueById(363));
|
||||||
|
_loc5_ = -1;
|
||||||
|
if(_currItem.frame == "buddyRequest")
|
||||||
|
{
|
||||||
|
_loc5_ = MySettings.SETTINGS_BUDDY_REQUESTS;
|
||||||
|
}
|
||||||
|
else if(_currItem.frame == "gameInvites")
|
||||||
|
{
|
||||||
|
_loc5_ = MySettings.SETTINGS_GAME_INVITES;
|
||||||
|
}
|
||||||
|
else if(_currItem.frame == "doorBell")
|
||||||
|
{
|
||||||
|
_loc5_ = MySettings.SETTINGS_DOOR_BELL;
|
||||||
|
}
|
||||||
|
else if(_currItem.frame == "autoServer")
|
||||||
|
{
|
||||||
|
_loc5_ = MySettings.SETTINGS_AUTO_SERVER_TRAVEL;
|
||||||
|
}
|
||||||
|
else if(_currItem.frame == "nameBadge")
|
||||||
|
{
|
||||||
|
_loc5_ = MySettings.SETTINGS_USERNAME_BADGE;
|
||||||
|
}
|
||||||
|
else if(_currItem.frame == "denPlayerIcon")
|
||||||
|
{
|
||||||
|
_loc5_ = MySettings.SETTINGS_DEN_PLAYER_ICON;
|
||||||
|
}
|
||||||
|
else if(_currItem.frame == "jammerWallIcon")
|
||||||
|
{
|
||||||
|
_loc5_ = MySettings.SETTINGS_JAMMER_WALL_ICON;
|
||||||
|
}
|
||||||
|
else if(_currItem.frame == "predictTxt")
|
||||||
|
{
|
||||||
|
_loc5_ = MySettings.SETTINGS_CHAT_PREDICTION;
|
||||||
|
if(gMainFrame.userInfo.sgChatType == 1)
|
||||||
|
{
|
||||||
|
if(!Utility.hasChatSettingBeenSet())
|
||||||
|
{
|
||||||
|
AchievementXtCommManager.requestSetUserVar(363,_loc5_);
|
||||||
|
_loc2_ = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!Utility.hasChatSettingBeenSet())
|
||||||
|
{
|
||||||
|
AchievementXtCommManager.requestSetUserVar(452,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc5_ != -1)
|
||||||
|
{
|
||||||
|
if(_loc2_ == -1)
|
||||||
|
{
|
||||||
|
if(_loc5_ == MySettings.SETTINGS_DOOR_BELL || _loc5_ == MySettings.SETTINGS_USERNAME_BADGE)
|
||||||
|
{
|
||||||
|
param1.currentTarget.toggleBtn.gotoAndPlay("on");
|
||||||
|
if(_window.icon["" + _window.icon.currentFrameLabel].currentLabel)
|
||||||
|
{
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndPlay("on");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param1.currentTarget.toggleBtn.gotoAndPlay("off");
|
||||||
|
if(_window.icon["" + _window.icon.currentFrameLabel].currentLabel)
|
||||||
|
{
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndPlay("off");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AchievementXtCommManager.requestSetUserVar(363,_loc5_);
|
||||||
|
}
|
||||||
|
else if(param1.currentTarget.toggleBtn.currentFrameLabel == "on" || param1.currentTarget.toggleBtn.currentFrameLabel == "startingOn")
|
||||||
|
{
|
||||||
|
param1.currentTarget.toggleBtn.gotoAndPlay("off");
|
||||||
|
if(_window.icon["" + _window.icon.currentFrameLabel].currentLabel)
|
||||||
|
{
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndPlay("off");
|
||||||
|
}
|
||||||
|
if(_loc5_ == MySettings.SETTINGS_DOOR_BELL || _loc5_ == MySettings.SETTINGS_USERNAME_BADGE)
|
||||||
|
{
|
||||||
|
AchievementXtCommManager.requestSetUserVar(363,_loc5_,null,false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AchievementXtCommManager.requestSetUserVar(363,_loc5_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param1.currentTarget.toggleBtn.gotoAndPlay("on");
|
||||||
|
if(_window.icon["" + _window.icon.currentFrameLabel].currentLabel)
|
||||||
|
{
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndPlay("on");
|
||||||
|
}
|
||||||
|
if(_loc5_ == MySettings.SETTINGS_DOOR_BELL || _loc5_ == MySettings.SETTINGS_USERNAME_BADGE)
|
||||||
|
{
|
||||||
|
AchievementXtCommManager.requestSetUserVar(363,_loc5_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AchievementXtCommManager.requestSetUserVar(363,_loc5_,null,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc5_ == MySettings.SETTINGS_JAMMER_WALL_ICON)
|
||||||
|
{
|
||||||
|
GuiManager.updateMainHudButtons(false,{
|
||||||
|
"btnName":(GuiManager.mainHud as GuiHud).playerWallBtn.name,
|
||||||
|
"show":param1.currentTarget.toggleBtn.currentLabel == "on"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.onTxt,_currItem.onTxt);
|
||||||
|
LocalizationManager.translateId(_window.toggleBtn.toggleBtn.valueTxt.offTxt,_currItem.offTxt);
|
||||||
|
}
|
||||||
|
else if(_currItem.type == MySettings.TOGGLE_TYPE_CURSOR)
|
||||||
|
{
|
||||||
|
if(param1.currentTarget.mouse.currentFrame == 3)
|
||||||
|
{
|
||||||
|
param1.currentTarget.mouseEnabled = false;
|
||||||
|
param1.currentTarget.mouseChildren = false;
|
||||||
|
}
|
||||||
|
if(param1.currentTarget != _window.defaultCursorBtn)
|
||||||
|
{
|
||||||
|
GuiManager.setSharedObj("cursor","custom");
|
||||||
|
CursorManager.switchToCursor("custom_cursor");
|
||||||
|
_window.defaultCursorBtn.downToUpState();
|
||||||
|
_window.defaultCursorBtn.mouseEnabled = true;
|
||||||
|
_window.defaultCursorBtn.mouseChildren = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GuiManager.setSharedObj("cursor","default");
|
||||||
|
CursorManager.switchToCursor("Default_Cursor");
|
||||||
|
_window.woodenCursorBtn.downToUpState();
|
||||||
|
_window.woodenCursorBtn.mouseEnabled = true;
|
||||||
|
_window.woodenCursorBtn.mouseChildren = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_currItem.type == MySettings.TOGGLE_TYPE_JOIN)
|
||||||
|
{
|
||||||
|
switch(_currItem.frame)
|
||||||
|
{
|
||||||
|
case "world":
|
||||||
|
ServerSelector.init(GuiManager.guiLayer,null,GamePlay(gMainFrame.gamePlay).joinChosenShardIdNode);
|
||||||
|
break;
|
||||||
|
case "intro":
|
||||||
|
GuiManager.startFFM();
|
||||||
|
break;
|
||||||
|
case "itemFinder":
|
||||||
|
if(_mySettingsCloseFunction != null)
|
||||||
|
{
|
||||||
|
_mySettingsCloseFunction(null);
|
||||||
|
}
|
||||||
|
AJClient.openTool(0);
|
||||||
|
break;
|
||||||
|
case "chatFilter":
|
||||||
|
if(_mySettingsCloseFunction != null)
|
||||||
|
{
|
||||||
|
_mySettingsCloseFunction(null);
|
||||||
|
}
|
||||||
|
AJClient.openTool(1);
|
||||||
|
break;
|
||||||
|
case "themeMenu":
|
||||||
|
if(_mySettingsThemesFunction != null)
|
||||||
|
{
|
||||||
|
_mySettingsThemesFunction();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "themePick":
|
||||||
|
_loc3_ = _currItem.theme;
|
||||||
|
if(_mySettingsCloseFunction != null)
|
||||||
|
{
|
||||||
|
_mySettingsCloseFunction(null);
|
||||||
|
}
|
||||||
|
AJClient.setTheme(_loc3_);
|
||||||
|
break;
|
||||||
|
case "savedMenu":
|
||||||
|
if(_currItem.run != null)
|
||||||
|
{
|
||||||
|
_currItem.run(_currItem.kind);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "commandPick":
|
||||||
|
_loc3_ = _currItem.command;
|
||||||
|
if(_mySettingsCloseFunction != null)
|
||||||
|
{
|
||||||
|
_mySettingsCloseFunction(null);
|
||||||
|
}
|
||||||
|
AJClient.runCommand(_loc3_);
|
||||||
|
break;
|
||||||
|
case "hideBlocked":
|
||||||
|
setHideBlocked(!blockedAreHidden());
|
||||||
|
break;
|
||||||
|
case "wasd":
|
||||||
|
setWasd(!AJClient.wasdOn());
|
||||||
|
break;
|
||||||
|
case "graphics":
|
||||||
|
setChoice(9003,AJClient.smoothOn() ? 1 : 2);
|
||||||
|
showGraphics();
|
||||||
|
break;
|
||||||
|
case "frameRate":
|
||||||
|
nextFrameRate();
|
||||||
|
break;
|
||||||
|
case "camera":
|
||||||
|
setChoice(9005,AJClient.cameraEases() ? 2 : 1);
|
||||||
|
showCamera();
|
||||||
|
break;
|
||||||
|
case "redeemCode":
|
||||||
|
if(_mySettingsCloseFunction != null)
|
||||||
|
{
|
||||||
|
_mySettingsCloseFunction(null);
|
||||||
|
}
|
||||||
|
GuiManager.openCodeRedemptionPopup();
|
||||||
|
break;
|
||||||
|
case "verifyEmail":
|
||||||
|
GuiManager.initEmailConfirmation(null,null,false);
|
||||||
|
break;
|
||||||
|
case "twoFactor":
|
||||||
|
_loc3_ = gMainFrame.clientInfo.websiteURL + "parents";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
navigateToURL(new URLRequest(_loc3_),"_blank");
|
||||||
|
}
|
||||||
|
catch(e:Error)
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace("error with loading URL: " + _loc3_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_currItem.type == MySettings.TOGGLE_TYPE_SCRUB)
|
||||||
|
{
|
||||||
|
param1.currentTarget.scrubKnob.dragging = true;
|
||||||
|
param1.currentTarget.scrubKnob.startDrag(true,SLIDER_RECT);
|
||||||
|
if(_musicToggle == null)
|
||||||
|
{
|
||||||
|
_loc4_ = (this.parent.parent as MovieClip).mediaWindows;
|
||||||
|
_loc6_ = 0;
|
||||||
|
while(_loc6_ < _loc4_.length)
|
||||||
|
{
|
||||||
|
if(_loc4_[_loc6_].currFrameLabel == "music")
|
||||||
|
{
|
||||||
|
_musicToggle = _loc4_[_loc6_];
|
||||||
|
}
|
||||||
|
_loc6_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handleMouseMove(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(_currItem.type == MySettings.TOGGLE_TYPE_SCRUB && _window.scrubBtn.scrubKnob.dragging)
|
||||||
|
{
|
||||||
|
SBAudio.setVolumeAll((int(_window.scrubBtn.scrubKnob.x - 15)) / 82);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handleMouseUp(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(_currItem.type == MySettings.TOGGLE_TYPE_SCRUB)
|
||||||
|
{
|
||||||
|
handleStopScrubbing();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handleMouseOut(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(_currItem.type == MySettings.TOGGLE_TYPE_TOGGLE_BTN)
|
||||||
|
{
|
||||||
|
if(param1.currentTarget.toggleBtn.toggleBG.currentFrameLabel != "up")
|
||||||
|
{
|
||||||
|
param1.currentTarget.toggleBtn.toggleBG.gotoAndStop("up");
|
||||||
|
}
|
||||||
|
if(param1.currentTarget.toggleBtn.toggleKnob.currentFrameLabel != "up")
|
||||||
|
{
|
||||||
|
param1.currentTarget.toggleBtn.toggleKnob.gotoAndStop("up");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_currItem.type == MySettings.TOGGLE_TYPE_SCRUB)
|
||||||
|
{
|
||||||
|
if(param1.currentTarget == _window.scrubBtn)
|
||||||
|
{
|
||||||
|
if(_window.scrubBtn.scrubBG.currentFrameLabel != "up")
|
||||||
|
{
|
||||||
|
_window.scrubBtn.scrubBG.gotoAndStop("up");
|
||||||
|
}
|
||||||
|
if(_window.scrubBtn.scrubKnob.currentFrameLabel != "up")
|
||||||
|
{
|
||||||
|
_window.scrubBtn.scrubKnob.gotoAndStop("up");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
handleStopScrubbing();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handleMouseOver(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(_currItem.type == MySettings.TOGGLE_TYPE_TOGGLE_BTN)
|
||||||
|
{
|
||||||
|
if(param1.currentTarget.toggleBtn.toggleBG.currentFrameLabel != "over")
|
||||||
|
{
|
||||||
|
param1.currentTarget.toggleBtn.toggleBG.gotoAndStop("over");
|
||||||
|
}
|
||||||
|
if(param1.currentTarget.toggleBtn.toggleKnob.currentFrameLabel != "over")
|
||||||
|
{
|
||||||
|
param1.currentTarget.toggleBtn.toggleKnob.gotoAndStop("over");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_currItem.type == MySettings.TOGGLE_TYPE_SCRUB)
|
||||||
|
{
|
||||||
|
if(param1.currentTarget.scrubBG.currentFrameLabel != "over")
|
||||||
|
{
|
||||||
|
param1.currentTarget.scrubBG.gotoAndStop("over");
|
||||||
|
}
|
||||||
|
if(param1.currentTarget.scrubKnob.currentFrameLabel != "over")
|
||||||
|
{
|
||||||
|
param1.currentTarget.scrubKnob.gotoAndStop("over");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handleStopScrubbing() : void
|
||||||
|
{
|
||||||
|
if(_window.scrubBtn.scrubKnob.dragging)
|
||||||
|
{
|
||||||
|
_window.scrubBtn.scrubKnob.dragging = false;
|
||||||
|
_window.scrubBtn.scrubKnob.stopDrag();
|
||||||
|
GuiManager.setSharedObj("volume",SBAudio.getVolumeMusic());
|
||||||
|
if(SBAudio.currentVolume == 0 && !SBAudio.isMusicMuted)
|
||||||
|
{
|
||||||
|
if(_musicToggle)
|
||||||
|
{
|
||||||
|
_musicToggle.handleMuteUnmute();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
handleMuteUnmute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(SBAudio.currentVolume != 0 && SBAudio.isMusicMuted)
|
||||||
|
{
|
||||||
|
if(_musicToggle)
|
||||||
|
{
|
||||||
|
_musicToggle.handleMuteUnmute();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
handleMuteUnmute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handleMuteUnmute() : void
|
||||||
|
{
|
||||||
|
SBAudio.toggleMuteAll();
|
||||||
|
GuiManager.toggleMuteVideo();
|
||||||
|
if(SBAudio.isMusicMuted || SBAudio.areSoundsMuted)
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndPlay("off");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndPlay("off");
|
||||||
|
GuiManager.depressSoundButton(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_window.toggleBtn.toggleBtn.gotoAndPlay("on");
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndPlay("on");
|
||||||
|
GuiManager.depressSoundButton(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onDenLockUnlock(param1:Boolean = true) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
if(gMainFrame.userInfo.denPrivacySettings == 0)
|
||||||
|
{
|
||||||
|
gMainFrame.userInfo.denPrivacySettings = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gMainFrame.userInfo.denPrivacySettings = 0;
|
||||||
|
}
|
||||||
|
DenXtCommManager.requestSetDenPrivacy(gMainFrame.userInfo.denPrivacySettings);
|
||||||
|
GuiManager.refreshDenLockSettings();
|
||||||
|
}
|
||||||
|
if(gMainFrame.userInfo.denPrivacySettings != 2)
|
||||||
|
{
|
||||||
|
_lock.toggleBtn.gotoAndPlay("off");
|
||||||
|
if(_window)
|
||||||
|
{
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndPlay("off");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_lock.toggleBtn.gotoAndPlay("on");
|
||||||
|
if(_window)
|
||||||
|
{
|
||||||
|
_window.icon["" + _window.icon.currentFrameLabel].gotoAndPlay("on");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,218 @@
|
|||||||
|
package loader
|
||||||
|
{
|
||||||
|
import com.sbi.loader.FileServerEvent;
|
||||||
|
import com.sbi.loader.LoaderCache;
|
||||||
|
import flash.display.Loader;
|
||||||
|
import flash.display.LoaderInfo;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.events.Event;
|
||||||
|
import flash.events.ProgressEvent;
|
||||||
|
import flash.net.URLLoader;
|
||||||
|
import flash.net.URLRequest;
|
||||||
|
import flash.system.LoaderContext;
|
||||||
|
import flash.utils.ByteArray;
|
||||||
|
import flash.utils.setTimeout;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
|
||||||
|
public class MediaHelper
|
||||||
|
{
|
||||||
|
|
||||||
|
private var _id:uint;
|
||||||
|
|
||||||
|
private var _callback:Function;
|
||||||
|
|
||||||
|
private var _passback:Object;
|
||||||
|
|
||||||
|
private var _loader:Loader;
|
||||||
|
|
||||||
|
private var _mediaBytes:ByteArray;
|
||||||
|
|
||||||
|
private var _decodeAttempts:int;
|
||||||
|
|
||||||
|
private var _loadProgressFunc:Function;
|
||||||
|
|
||||||
|
private var _mc:MovieClip;
|
||||||
|
|
||||||
|
public function MediaHelper()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:uint, param2:Function = null, param3:Object = null, param4:Function = null) : void
|
||||||
|
{
|
||||||
|
if(param1 == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_id = param1;
|
||||||
|
_callback = param2;
|
||||||
|
_passback = param3;
|
||||||
|
_loadProgressFunc = param4;
|
||||||
|
_loader = new Loader();
|
||||||
|
MediaFileServer.instance.addEventListener("OnNewData",handleMediaData);
|
||||||
|
MediaFileServer.instance.addEventListener("progress",onLoadProgress);
|
||||||
|
GlobalErrorCatch.reportToServer("media " + _id + " requested");
|
||||||
|
MediaFileServer.instance.requestFile(_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
MediaFileServer.instance.removeEventListener("OnNewData",handleMediaData);
|
||||||
|
_mc = null;
|
||||||
|
_passback = null;
|
||||||
|
_loader = null;
|
||||||
|
_callback = null;
|
||||||
|
_loadProgressFunc = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get id() : int
|
||||||
|
{
|
||||||
|
if(_loader == null)
|
||||||
|
{
|
||||||
|
throw new Error("attempt to get id of an uninitialized MediaHelper instance!");
|
||||||
|
}
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handleMediaData(param1:FileServerEvent) : void
|
||||||
|
{
|
||||||
|
var _loc2_:LoaderContext = null;
|
||||||
|
if(param1.id != _id)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GlobalErrorCatch.reportToServer("media " + _id + " data success=" + param1.success + " length=" + (param1.data ? param1.data.length : -1));
|
||||||
|
if(param1.success)
|
||||||
|
{
|
||||||
|
MediaFileServer.instance.removeEventListener("OnNewData",handleMediaData);
|
||||||
|
_mediaBytes = param1.data;
|
||||||
|
_loader.contentLoaderInfo.addEventListener("ioError",onBytesFailed);
|
||||||
|
_loader.contentLoaderInfo.addEventListener("complete",onBytesLoaded);
|
||||||
|
_loader.contentLoaderInfo.addEventListener("progress",onLoadProgress);
|
||||||
|
_loc2_ = new LoaderContext();
|
||||||
|
_loc2_.allowCodeImport = true;
|
||||||
|
_loader.loadBytes(param1.data,_loc2_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onLoadProgress(param1:ProgressEvent) : void
|
||||||
|
{
|
||||||
|
if(_loadProgressFunc != null)
|
||||||
|
{
|
||||||
|
_loadProgressFunc(param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onBytesFailed(param1:Event) : void
|
||||||
|
{
|
||||||
|
var _loc2_:String = "";
|
||||||
|
var _loc3_:uint = 0;
|
||||||
|
var _loc4_:int = 0;
|
||||||
|
_decodeAttempts = _decodeAttempts + 1;
|
||||||
|
if(_mediaBytes != null)
|
||||||
|
{
|
||||||
|
while(_loc4_ < _mediaBytes.length)
|
||||||
|
{
|
||||||
|
_loc3_ = uint(_loc3_ + _mediaBytes[_loc4_]);
|
||||||
|
if(_loc4_ < 8)
|
||||||
|
{
|
||||||
|
_loc2_ += (_mediaBytes[_loc4_] < 16 ? "0" : "") + _mediaBytes[_loc4_].toString(16);
|
||||||
|
}
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GlobalErrorCatch.reportToServer("media " + _id + " could not be decoded (attempt " + _decodeAttempts + ", head " + _loc2_ + ", sum " + _loc3_ + "): " + param1);
|
||||||
|
if(_decodeAttempts < 5 && _loader != null)
|
||||||
|
{
|
||||||
|
setTimeout(refetch,_decodeAttempts == 1 ? 100 : 1500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function refetch() : void
|
||||||
|
{
|
||||||
|
var _loc1_:URLRequest = null;
|
||||||
|
var _loc2_:URLLoader = null;
|
||||||
|
if(_loader == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MediaFileServer.instance.clearFromCache("media/",_id);
|
||||||
|
_loc1_ = LoaderCache.fetchCDNURLRequest("media/" + _id,"/",true);
|
||||||
|
_loc1_.url += (_loc1_.url.indexOf("?") >= 0 ? "&" : "?") + "retry=" + _decodeAttempts + "_" + new Date().time;
|
||||||
|
_loc2_ = new URLLoader();
|
||||||
|
_loc2_.dataFormat = "binary";
|
||||||
|
_loc2_.addEventListener("complete",onRefetched);
|
||||||
|
_loc2_.addEventListener("ioError",onBytesFailed);
|
||||||
|
_loc2_.addEventListener("securityError",onBytesFailed);
|
||||||
|
_loc2_.load(_loc1_);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRefetched(param1:Event) : void
|
||||||
|
{
|
||||||
|
var _loc2_:LoaderContext = null;
|
||||||
|
if(_loader == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_mediaBytes = URLLoader(param1.target).data as ByteArray;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_mediaBytes.uncompress();
|
||||||
|
}
|
||||||
|
catch(err:Error)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
_mediaBytes.position = 0;
|
||||||
|
_loader.contentLoaderInfo.removeEventListener("complete",onBytesLoaded);
|
||||||
|
_loader.contentLoaderInfo.removeEventListener("progress",onLoadProgress);
|
||||||
|
_loader.contentLoaderInfo.removeEventListener("ioError",onBytesFailed);
|
||||||
|
_loader = new Loader();
|
||||||
|
_loader.contentLoaderInfo.addEventListener("complete",onBytesLoaded);
|
||||||
|
_loader.contentLoaderInfo.addEventListener("progress",onLoadProgress);
|
||||||
|
_loader.contentLoaderInfo.addEventListener("ioError",onBytesFailed);
|
||||||
|
_loc2_ = new LoaderContext();
|
||||||
|
_loc2_.allowCodeImport = true;
|
||||||
|
_loader.loadBytes(_mediaBytes,_loc2_);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onBytesLoaded(param1:Event) : void
|
||||||
|
{
|
||||||
|
var _loc2_:LoaderInfo = param1.target as LoaderInfo;
|
||||||
|
_mc = MovieClip(_loc2_.content);
|
||||||
|
LocalizationManager.findAllTextfields(_mc);
|
||||||
|
if(_passback != null)
|
||||||
|
{
|
||||||
|
_mc.mediaHelper = this;
|
||||||
|
_mc.passback = _passback;
|
||||||
|
}
|
||||||
|
param1.target.removeEventListener("complete",onBytesLoaded);
|
||||||
|
param1.target.removeEventListener("OnLoadProgress",onLoadProgress);
|
||||||
|
_loadProgressFunc = null;
|
||||||
|
GlobalErrorCatch.reportToServer("media " + _id + " decoded, waitingForSharedLibrary=" + Boolean(_mc.hasOwnProperty("__rslPreloader") && _mc.__rslPreloader));
|
||||||
|
if(_mc.hasOwnProperty("__rslPreloader") && _mc.__rslPreloader)
|
||||||
|
{
|
||||||
|
_mc.addEventListener("enterFrame",onFrame);
|
||||||
|
}
|
||||||
|
else if(_callback != null)
|
||||||
|
{
|
||||||
|
_callback(_mc);
|
||||||
|
_callback = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onFrame(param1:Event) : void
|
||||||
|
{
|
||||||
|
if(_mc.__rslPreloader == null)
|
||||||
|
{
|
||||||
|
GlobalErrorCatch.reportToServer("media " + _id + " shared library ready");
|
||||||
|
_mc.removeEventListener("enterFrame",onFrame);
|
||||||
|
if(_callback != null)
|
||||||
|
{
|
||||||
|
_callback(_mc);
|
||||||
|
_callback = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,525 @@
|
|||||||
|
package gui
|
||||||
|
{
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.events.*;
|
||||||
|
import flash.net.URLLoader;
|
||||||
|
import flash.net.URLRequest;
|
||||||
|
import flash.net.navigateToURL;
|
||||||
|
import flash.utils.setTimeout;
|
||||||
|
import gui.itemWindows.ItemWindowToggle;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
|
||||||
|
public class MySettings
|
||||||
|
{
|
||||||
|
|
||||||
|
public static var SETTINGS_BUDDY_REQUESTS:int = 0;
|
||||||
|
|
||||||
|
public static var SETTINGS_GAME_INVITES:int = 1;
|
||||||
|
|
||||||
|
public static var SETTINGS_DOOR_BELL:int = 2;
|
||||||
|
|
||||||
|
public static var SETTINGS_AUTO_SERVER_TRAVEL:int = 3;
|
||||||
|
|
||||||
|
public static var SETTINGS_USERNAME_BADGE:int = 4;
|
||||||
|
|
||||||
|
public static var SETTINGS_DEN_PLAYER_ICON:int = 5;
|
||||||
|
|
||||||
|
public static var SETTINGS_JAMMER_WALL_ICON:int = 6;
|
||||||
|
|
||||||
|
public static var SETTINGS_CHAT_PREDICTION:int = 7;
|
||||||
|
|
||||||
|
public static var TOGGLE_TYPE_TOGGLE_BTN:int = 0;
|
||||||
|
|
||||||
|
public static var TOGGLE_TYPE_TEXT:int = 1;
|
||||||
|
|
||||||
|
public static var TOGGLE_TYPE_CURSOR:int = 2;
|
||||||
|
|
||||||
|
public static var TOGGLE_TYPE_JOIN:int = 3;
|
||||||
|
|
||||||
|
public static var TOGGLE_TYPE_SCRUB:int = 4;
|
||||||
|
|
||||||
|
private var _mySettings:MovieClip;
|
||||||
|
|
||||||
|
private var _popupLayer:DisplayLayer;
|
||||||
|
|
||||||
|
private var _closeCallback:Function;
|
||||||
|
|
||||||
|
private var _wallPrivacyDropDown:GuiDropdown;
|
||||||
|
|
||||||
|
private var _toggleWindows:WindowGenerator;
|
||||||
|
|
||||||
|
private var _toggleScrollBar:SBScrollbar;
|
||||||
|
|
||||||
|
private var _savedKind:String;
|
||||||
|
|
||||||
|
private var _visibleRows:int;
|
||||||
|
|
||||||
|
private var _listWidth:int;
|
||||||
|
|
||||||
|
private var _listHeight:int;
|
||||||
|
|
||||||
|
public function MySettings()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:DisplayLayer, param2:int, param3:int, param4:Function = null) : void
|
||||||
|
{
|
||||||
|
_popupLayer = param1;
|
||||||
|
_closeCallback = param4;
|
||||||
|
_mySettings = GETDEFINITIONBYNAME("MySettings");
|
||||||
|
_mySettings.x = param2;
|
||||||
|
_mySettings.y = param3;
|
||||||
|
_popupLayer.addChild(_mySettings);
|
||||||
|
setupContent();
|
||||||
|
addEventListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
removeEventListeners();
|
||||||
|
_popupLayer.removeChild(_mySettings);
|
||||||
|
_closeCallback = null;
|
||||||
|
_mySettings = null;
|
||||||
|
if(_toggleWindows)
|
||||||
|
{
|
||||||
|
_toggleWindows.destroy();
|
||||||
|
_toggleWindows = null;
|
||||||
|
}
|
||||||
|
if(_toggleScrollBar)
|
||||||
|
{
|
||||||
|
_toggleScrollBar.destroy();
|
||||||
|
_toggleWindows = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateSoundBtn() : void
|
||||||
|
{
|
||||||
|
var _loc1_:int = 0;
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < _toggleWindows.bg.numChildren)
|
||||||
|
{
|
||||||
|
if((_toggleWindows.bg.getChildAt(_loc1_) as ItemWindowToggle).currFrameLabel == "music")
|
||||||
|
{
|
||||||
|
(_toggleWindows.bg.getChildAt(_loc1_) as ItemWindowToggle).resetConditions();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateWorldMessage() : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setupContent() : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc1_:int = 0;
|
||||||
|
if(gMainFrame.userInfo.isMember)
|
||||||
|
{
|
||||||
|
_mySettings.statusNonmember.visible = false;
|
||||||
|
_loc1_ = int(gMainFrame.clientInfo.numDaysLeftOnSubscription);
|
||||||
|
if(_loc1_ > 0)
|
||||||
|
{
|
||||||
|
_mySettings.gotoAndStop("memberScrollSubscription");
|
||||||
|
_loc2_ = 5;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_mySettings.gotoAndStop("memberScroll");
|
||||||
|
_loc2_ = 6;
|
||||||
|
}
|
||||||
|
_loc5_ = int(_mySettings.itemWindow.height);
|
||||||
|
_loc3_ = int(_mySettings.itemWindow.width);
|
||||||
|
if(_loc1_ > 0)
|
||||||
|
{
|
||||||
|
if(_loc1_ > 1)
|
||||||
|
{
|
||||||
|
LocalizationManager.translateIdAndInsert(_mySettings.timeRemaining.timeTxt,11361,_loc1_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LocalizationManager.translateIdAndInsert(_mySettings.timeRemaining.timeTxt,11362,_loc1_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_mySettings.statusMember.visible = false;
|
||||||
|
_mySettings.gotoAndStop("nonMemScroll");
|
||||||
|
_mySettings.joinBtn.addEventListener("mouseDown",onJoinBtn,false,0,true);
|
||||||
|
_loc2_ = 5;
|
||||||
|
_loc5_ = int(_mySettings.itemWindow.height);
|
||||||
|
_loc3_ = int(_mySettings.itemWindow.width);
|
||||||
|
}
|
||||||
|
var _loc4_:Array = [{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"itemFinder",
|
||||||
|
"iconFrame":"redeemCode",
|
||||||
|
"labelLabel":"Item Finder",
|
||||||
|
"btnLabel":"Open"
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"chatFilter",
|
||||||
|
"iconFrame":"buddyRequest",
|
||||||
|
"labelLabel":"Chat Filter",
|
||||||
|
"btnLabel":"Open"
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"themeMenu",
|
||||||
|
"iconFrame":"world",
|
||||||
|
"labelLabel":"Theme",
|
||||||
|
"btnLabel":"Choose"
|
||||||
|
/* the Outfits and Den layouts rows are out for now (too messy, the
|
||||||
|
owner's word): saved outfits and layouts are chat commands only
|
||||||
|
(!outfit, !den). showSavedList and what it needs are kept below.
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"savedMenu",
|
||||||
|
"iconFrame":"nameBadge",
|
||||||
|
"labelLabel":"Outfits",
|
||||||
|
"btnLabel":"Choose",
|
||||||
|
"kind":"outfits",
|
||||||
|
"run":showSavedList
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"savedMenu",
|
||||||
|
"iconFrame":"house",
|
||||||
|
"labelLabel":"Den layouts",
|
||||||
|
"btnLabel":"Choose",
|
||||||
|
"kind":"layouts",
|
||||||
|
"run":showSavedList
|
||||||
|
*/
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"wasd",
|
||||||
|
"iconFrame":"world"
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"graphics",
|
||||||
|
"iconFrame":"world"
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"frameRate",
|
||||||
|
"iconFrame":"world"
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"camera",
|
||||||
|
"iconFrame":"world"
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"hideBlocked",
|
||||||
|
"iconFrame":"buddyRequest"
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"redeemCode",
|
||||||
|
"labelTxt":24819,
|
||||||
|
"btnTxt":24820
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"world",
|
||||||
|
"labelTxt":6395,
|
||||||
|
"btnTxt":6366
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||||
|
"frame":"nameBadge",
|
||||||
|
"labelTxt":23912,
|
||||||
|
"onTxt":6241,
|
||||||
|
"offTxt":23918
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||||
|
"frame":"jammerWallIcon",
|
||||||
|
"labelTxt":27948,
|
||||||
|
"onTxt":6324,
|
||||||
|
"offTxt":6322
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||||
|
"frame":"lock",
|
||||||
|
"labelTxt":6271,
|
||||||
|
"onTxt":6393,
|
||||||
|
"offTxt":6301
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||||
|
"frame":"denPlayerIcon",
|
||||||
|
"labelTxt":25452,
|
||||||
|
"onTxt":6324,
|
||||||
|
"offTxt":6322
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||||
|
"frame":"doorBell",
|
||||||
|
"labelTxt":18420,
|
||||||
|
"onTxt":6324,
|
||||||
|
"offTxt":6322
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||||
|
"frame":"music",
|
||||||
|
"labelTxt":6373,
|
||||||
|
"onTxt":6324,
|
||||||
|
"offTxt":6322
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_SCRUB,
|
||||||
|
"frame":"",
|
||||||
|
"labelTxt":14666
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_CURSOR,
|
||||||
|
"frame":"",
|
||||||
|
"labelTxt":6269
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||||
|
"frame":"buddyRequest",
|
||||||
|
"labelTxt":6251,
|
||||||
|
"onTxt":6324,
|
||||||
|
"offTxt":6322
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||||
|
"frame":"gameInvites",
|
||||||
|
"labelTxt":6282,
|
||||||
|
"onTxt":6324,
|
||||||
|
"offTxt":6322
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||||
|
"frame":"autoServer",
|
||||||
|
"labelTxt":23667,
|
||||||
|
"onTxt":6324,
|
||||||
|
"offTxt":6322
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_TOGGLE_BTN,
|
||||||
|
"frame":"predictTxt",
|
||||||
|
"labelTxt":29116,
|
||||||
|
"onTxt":6324,
|
||||||
|
"offTxt":6322
|
||||||
|
},{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"twoFactor",
|
||||||
|
"labelTxt":36824,
|
||||||
|
"btnTxt":36825
|
||||||
|
}];
|
||||||
|
if(gMainFrame.clientInfo.userEmail == null || gMainFrame.clientInfo.userEmail == "")
|
||||||
|
{
|
||||||
|
_loc4_.splice(3,0,{
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"verifyEmail",
|
||||||
|
"labelTxt":33036,
|
||||||
|
"btnTxt":33035
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_visibleRows = _loc2_;
|
||||||
|
_listWidth = _loc3_;
|
||||||
|
_listHeight = _loc5_;
|
||||||
|
_toggleWindows = new WindowGenerator();
|
||||||
|
_toggleWindows.init(1,_loc2_,_loc4_.length,0,4,0,ItemWindowToggle,_loc4_,null,null,{
|
||||||
|
"onClose":onClose,
|
||||||
|
"onThemes":showThemeList
|
||||||
|
});
|
||||||
|
_mySettings.itemWindow.addChild(_toggleWindows);
|
||||||
|
_toggleScrollBar = new SBScrollbar();
|
||||||
|
_toggleScrollBar.init(_toggleWindows,_loc3_,_loc5_,2,"scrollbar2",_toggleWindows.boxHeight + 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function showThemeList() : void
|
||||||
|
{
|
||||||
|
setTimeout(buildThemeList,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function buildThemeList() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Array = [["","Current"],["halloween","Halloween"],["fall","Fall"],["jamaalidays","Jamaalidays"],["winter","Winter"],["friendship","Friendship"],["lucky","Lucky Day"],["spring","Spring"],["summer","Summer"],["halloween2025","Halloween 2025"],["fall2025","Fall 2025"],["summer2025","Summer 2025"],["lucky2025","Lucky Day 2025"],["summer2024","Summer 2024"],["spring2024","Spring 2024"],["lucky2024","Lucky Day 2024"],["jamaalidays2022","Jamaalidays 2022"],["fall2022","Fall 2022"],["freedom2021","Freedom Day 2021"],["jamaalidays2020","Jamaalidays 2020"],["spring2020","Spring 2020"],["jamaalidays2018","Jamaalidays 2018"],["summer2018","Summer 2018"],["lucky2018","Lucky Day 2018"],["friendship2018","Friendship 2018"],["halloween2013","Halloween 2013"]];
|
||||||
|
var _loc2_:Array = [];
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
while(_loc3_ < _loc1_.length)
|
||||||
|
{
|
||||||
|
_loc2_.push({
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"themePick",
|
||||||
|
"iconFrame":"world",
|
||||||
|
"labelLabel":_loc1_[_loc3_][1],
|
||||||
|
"btnLabel":"Choose",
|
||||||
|
"theme":_loc1_[_loc3_][0]
|
||||||
|
});
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
buildSubList("Theme",_loc2_);
|
||||||
|
}
|
||||||
|
|
||||||
|
// the settings list swapped for another: a title and its rows.
|
||||||
|
private function buildSubList(param1:String, param2:Array) : void
|
||||||
|
{
|
||||||
|
if(_mySettings == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(_toggleScrollBar)
|
||||||
|
{
|
||||||
|
_toggleScrollBar.destroy();
|
||||||
|
_toggleScrollBar = null;
|
||||||
|
}
|
||||||
|
if(_toggleWindows)
|
||||||
|
{
|
||||||
|
if(_toggleWindows.parent)
|
||||||
|
{
|
||||||
|
_toggleWindows.parent.removeChild(_toggleWindows);
|
||||||
|
}
|
||||||
|
_toggleWindows.destroy();
|
||||||
|
_toggleWindows = null;
|
||||||
|
}
|
||||||
|
_mySettings.titleTxt.text = param1;
|
||||||
|
_toggleWindows = new WindowGenerator();
|
||||||
|
// only as many rows as there are things to list: left to fill the
|
||||||
|
// window, a short list (a few outfits) got rows with nothing in
|
||||||
|
// them, which never finish loading, and nothing was shown.
|
||||||
|
_toggleWindows.init(1,_visibleRows,param2.length,0,4,0,ItemWindowToggle,param2,null,null,{"onClose":onClose},null,false,false);
|
||||||
|
_mySettings.itemWindow.addChild(_toggleWindows);
|
||||||
|
_toggleScrollBar = new SBScrollbar();
|
||||||
|
_toggleScrollBar.init(_toggleWindows,_listWidth,_listHeight,2,"scrollbar2",_toggleWindows.boxHeight + 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
// "Outfits" and "Den layouts": what the player saved (also with the
|
||||||
|
// !outfit and !den chat commands), asked of the server, then a row
|
||||||
|
// for each with a row on top that saves what is there now.
|
||||||
|
private function showSavedList(param1:String) : void
|
||||||
|
{
|
||||||
|
_savedKind = param1;
|
||||||
|
var _loc2_:URLLoader = new URLLoader();
|
||||||
|
_loc2_.addEventListener("complete",onSavedList,false,0,false);
|
||||||
|
_loc2_.addEventListener("ioError",onSavedFailed,false,0,false);
|
||||||
|
_loc2_.addEventListener("securityError",onSavedFailed,false,0,false);
|
||||||
|
_loc2_.load(new URLRequest(gMainFrame.clientInfo.websiteURL + "api/saved?username=" + encodeURIComponent(gMainFrame.server.userName) + "&token=" + encodeURIComponent(gMainFrame.clientInfo.authToken)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onSavedFailed(param1:Event) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onSavedList(param1:Event) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Boolean = _savedKind == "outfits";
|
||||||
|
var _loc3_:Array = [];
|
||||||
|
var _loc4_:Array = null;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_loc4_ = JSON.parse(param1.target.data)[_savedKind] as Array;
|
||||||
|
}
|
||||||
|
catch(e:Error)
|
||||||
|
{
|
||||||
|
_loc4_ = null;
|
||||||
|
}
|
||||||
|
if(_loc4_ == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loc3_.push({
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"commandPick",
|
||||||
|
"iconFrame":(_loc2_ ? "nameBadge" : "house"),
|
||||||
|
"labelLabel":(_loc2_ ? "What I wear now" : "This den as it is"),
|
||||||
|
"btnLabel":"Save",
|
||||||
|
"command":(_loc2_ ? "!outfit savenew" : "!den savenew")
|
||||||
|
});
|
||||||
|
if(_loc2_)
|
||||||
|
{
|
||||||
|
_loc3_.push({
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"commandPick",
|
||||||
|
"iconFrame":"nameBadge",
|
||||||
|
"labelLabel":"Everything off",
|
||||||
|
"btnLabel":"Do it",
|
||||||
|
"command":"!outfit off"
|
||||||
|
});
|
||||||
|
_loc3_.push({
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"commandPick",
|
||||||
|
"iconFrame":"nameBadge",
|
||||||
|
"labelLabel":"What I wore before",
|
||||||
|
"btnLabel":"Undo",
|
||||||
|
"command":"!outfit undo"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc3_.push({
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"commandPick",
|
||||||
|
"iconFrame":"house",
|
||||||
|
"labelLabel":"Before Clear Den",
|
||||||
|
"btnLabel":"Undo",
|
||||||
|
"command":"!den undo"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
while(_loc5_ < _loc4_.length)
|
||||||
|
{
|
||||||
|
_loc3_.push({
|
||||||
|
"type":TOGGLE_TYPE_JOIN,
|
||||||
|
"frame":"commandPick",
|
||||||
|
"iconFrame":(_loc2_ ? "nameBadge" : "house"),
|
||||||
|
"labelLabel":String(_loc4_[_loc5_]),
|
||||||
|
"btnLabel":(_loc2_ ? "Wear" : "Load"),
|
||||||
|
"command":(_loc2_ ? "!outfit wear " : "!den load ") + _loc4_[_loc5_]
|
||||||
|
});
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
buildSubList(_loc2_ ? "Outfits" : "Den layouts",_loc3_);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPopup(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onClose(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
if(_closeCallback != null)
|
||||||
|
{
|
||||||
|
_closeCallback();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onJoinBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
var _loc3_:String = gMainFrame.clientInfo.websiteURL + "membership";
|
||||||
|
var _loc2_:URLRequest = new URLRequest(_loc3_);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
navigateToURL(_loc2_,"_blank");
|
||||||
|
}
|
||||||
|
catch(e:Error)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addEventListeners() : void
|
||||||
|
{
|
||||||
|
with(_mySettings)
|
||||||
|
{
|
||||||
|
addEventListener(MouseEvent.MOUSE_DOWN,onPopup,false,0,true);
|
||||||
|
bx.addEventListener(MouseEvent.MOUSE_DOWN,onClose,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function removeEventListeners() : void
|
||||||
|
{
|
||||||
|
with(_mySettings)
|
||||||
|
{
|
||||||
|
removeEventListener(MouseEvent.MOUSE_DOWN,onPopup);
|
||||||
|
bx.removeEventListener(MouseEvent.MOUSE_DOWN,onClose);
|
||||||
|
if(joinBtn)
|
||||||
|
{
|
||||||
|
joinBtn.removeEventListener(MouseEvent.MOUSE_DOWN,onJoinBtn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,936 @@
|
|||||||
|
package avatar
|
||||||
|
{
|
||||||
|
import collection.AccItemCollection;
|
||||||
|
import com.sbi.graphics.LayerAnim;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.display.Sprite;
|
||||||
|
import flash.filters.GlowFilter;
|
||||||
|
import flash.geom.Point;
|
||||||
|
import flash.text.TextField;
|
||||||
|
import flash.text.TextFormat;
|
||||||
|
import gskinner.motion.GTween;
|
||||||
|
import gskinner.motion.easing.Linear;
|
||||||
|
import item.EquippedAvatars;
|
||||||
|
import item.Item;
|
||||||
|
import item.ItemXtCommManager;
|
||||||
|
import loader.MediaHelper;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
import quest.QuestManager;
|
||||||
|
import room.RoomManagerWorld;
|
||||||
|
|
||||||
|
public class NPCView extends Sprite
|
||||||
|
{
|
||||||
|
|
||||||
|
public static const NPC_STATE_LOADING:int = -2;
|
||||||
|
|
||||||
|
public static const NPC_STATE_LOADED:int = -1;
|
||||||
|
|
||||||
|
public static const NPC_STATE_IDLE:int = 0;
|
||||||
|
|
||||||
|
public static const NPC_STATE_MOVE:int = 1;
|
||||||
|
|
||||||
|
public static const NPC_STATE_ATTACK:int = 2;
|
||||||
|
|
||||||
|
public static const NPC_STATE_RECOIL:int = 3;
|
||||||
|
|
||||||
|
public static const NPC_STATE_DEATH:int = 4;
|
||||||
|
|
||||||
|
public static const NPC_STATE_TREASURE_APPEAR:int = 5;
|
||||||
|
|
||||||
|
public static const NPC_STATE_TREASURE_OPEN:int = 6;
|
||||||
|
|
||||||
|
public static const NPC_STATE_TREASURE_DISAPPEAR:int = 7;
|
||||||
|
|
||||||
|
public static const NPC_STATE_DANCE:int = 8;
|
||||||
|
|
||||||
|
private var _npcDef:Object;
|
||||||
|
|
||||||
|
private var _npcMC:MovieClip;
|
||||||
|
|
||||||
|
private var _npcAvatarView:AvatarWorldView;
|
||||||
|
|
||||||
|
private var _playerId:int;
|
||||||
|
|
||||||
|
private var _namebar:NameBar;
|
||||||
|
|
||||||
|
private var _mediaHelperObj:MediaHelper;
|
||||||
|
|
||||||
|
private var _onLoadingCompleteCallback:Function;
|
||||||
|
|
||||||
|
public static var disguiseDefId:int = 0;
|
||||||
|
|
||||||
|
private var _disguise:Boolean;
|
||||||
|
|
||||||
|
private var _disguiseStandIn:MovieClip;
|
||||||
|
|
||||||
|
private var _npcState:int;
|
||||||
|
|
||||||
|
private var _npcAngle:int;
|
||||||
|
|
||||||
|
private var _healthBar:MovieClip;
|
||||||
|
|
||||||
|
private var _hitText:TextField;
|
||||||
|
|
||||||
|
private var _hitTextTween:GTween;
|
||||||
|
|
||||||
|
private var _secondaryNpcMC:MovieClip;
|
||||||
|
|
||||||
|
public var _torch:MovieClip;
|
||||||
|
|
||||||
|
public var _eye:MovieClip;
|
||||||
|
|
||||||
|
public var _beam:MovieClip;
|
||||||
|
|
||||||
|
public var _npcFacingSW:Boolean;
|
||||||
|
|
||||||
|
public var _npcAttackTriggered:Boolean;
|
||||||
|
|
||||||
|
public function NPCView()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get npcState() : int
|
||||||
|
{
|
||||||
|
return _npcState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get npcStateComplete() : Boolean
|
||||||
|
{
|
||||||
|
switch(_npcState - -2)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return false;
|
||||||
|
case 1:
|
||||||
|
return true;
|
||||||
|
case 7:
|
||||||
|
case 8:
|
||||||
|
case 9:
|
||||||
|
return _npcMC == null || _npcMC.finished;
|
||||||
|
default:
|
||||||
|
throw new Error("NPVView: npcStateComplete: Unsupported state");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get readyToLaunchAttack() : Boolean
|
||||||
|
{
|
||||||
|
if(_npcState == 2)
|
||||||
|
{
|
||||||
|
if(_npcMC != null)
|
||||||
|
{
|
||||||
|
if(_npcMC.attacking == true)
|
||||||
|
{
|
||||||
|
_npcMC.attacking = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(_npcMC.hasOwnProperty("counterAttacking") && _npcMC.counterAttacking == true)
|
||||||
|
{
|
||||||
|
_npcMC.counterAttacking = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get readyToAttack() : Boolean
|
||||||
|
{
|
||||||
|
var _loc2_:Array = null;
|
||||||
|
var _loc1_:int = 0;
|
||||||
|
var _loc3_:Object = null;
|
||||||
|
if(_npcMC != null && _npcMC.hasOwnProperty("getCustomCollisionPoints"))
|
||||||
|
{
|
||||||
|
_loc2_ = _npcMC.getCustomCollisionPoints();
|
||||||
|
if(_loc2_ != null)
|
||||||
|
{
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < _loc2_.length)
|
||||||
|
{
|
||||||
|
_loc3_ = _loc2_[_loc1_];
|
||||||
|
if(_loc3_.Type == 2)
|
||||||
|
{
|
||||||
|
return !_npcMC.animActive && _npcMC.readyForAttack;
|
||||||
|
}
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_npcState != 2 && _npcState != 4)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIsDead() : Boolean
|
||||||
|
{
|
||||||
|
if(_npcState == 4 && (_npcMC == null || _npcMC.animActive == false))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isDying() : Boolean
|
||||||
|
{
|
||||||
|
return _npcState == 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function moveFaceAnim(param1:Number) : void
|
||||||
|
{
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc2_:Boolean = false;
|
||||||
|
if(_npcAvatarView)
|
||||||
|
{
|
||||||
|
_loc3_ = 0;
|
||||||
|
_loc2_ = false;
|
||||||
|
while(param1 < 0)
|
||||||
|
{
|
||||||
|
param1 += 360;
|
||||||
|
}
|
||||||
|
while(param1 >= 360)
|
||||||
|
{
|
||||||
|
param1 -= 360;
|
||||||
|
}
|
||||||
|
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||||
|
{
|
||||||
|
if(param1 < 180)
|
||||||
|
{
|
||||||
|
if(param1 < 35)
|
||||||
|
{
|
||||||
|
_loc3_ = 7;
|
||||||
|
}
|
||||||
|
else if(param1 < 70)
|
||||||
|
{
|
||||||
|
_loc3_ = 8;
|
||||||
|
}
|
||||||
|
else if(param1 < 110)
|
||||||
|
{
|
||||||
|
_loc3_ = 9;
|
||||||
|
}
|
||||||
|
else if(param1 < 145)
|
||||||
|
{
|
||||||
|
_loc3_ = 10;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc3_ = 11;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_ = true;
|
||||||
|
if(param1 < 215)
|
||||||
|
{
|
||||||
|
_loc3_ = 11;
|
||||||
|
}
|
||||||
|
else if(param1 < 250)
|
||||||
|
{
|
||||||
|
_loc3_ = 10;
|
||||||
|
}
|
||||||
|
else if(param1 < 290)
|
||||||
|
{
|
||||||
|
_loc3_ = 9;
|
||||||
|
}
|
||||||
|
else if(param1 < 325)
|
||||||
|
{
|
||||||
|
_loc3_ = 8;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc3_ = 7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
if(param1 < 180)
|
||||||
|
{
|
||||||
|
_loc3_ = 29;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_ = true;
|
||||||
|
_loc3_ = 29;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_npcAvatarView.playAnim(_loc3_,_loc2_,2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setNpcState(param1:int, param2:Number = 0) : void
|
||||||
|
{
|
||||||
|
if(_npcState != 4)
|
||||||
|
{
|
||||||
|
switch(param1)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
if(_npcMC)
|
||||||
|
{
|
||||||
|
if(_npcMC.animActive == false)
|
||||||
|
{
|
||||||
|
_npcState = param1;
|
||||||
|
_npcMC.idle(param2 == 0 ? 270 : param2);
|
||||||
|
}
|
||||||
|
if(_npcMC.hasOwnProperty("getSortHeight"))
|
||||||
|
{
|
||||||
|
if(_npcMC.parent.parent)
|
||||||
|
{
|
||||||
|
_npcMC.parent.parent.name = _npcMC.getSortHeight();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_npcAvatarView)
|
||||||
|
{
|
||||||
|
if(_npcState != param1)
|
||||||
|
{
|
||||||
|
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||||
|
{
|
||||||
|
playAnimationState(14,false,0,null);
|
||||||
|
}
|
||||||
|
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
playAnimationState(32,false,0,null);
|
||||||
|
}
|
||||||
|
_npcState = param1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if(_npcAvatarView != null)
|
||||||
|
{
|
||||||
|
_npcState = param1;
|
||||||
|
if(_npcAngle != param2)
|
||||||
|
{
|
||||||
|
_npcAngle = param2;
|
||||||
|
moveFaceAnim(_npcAngle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_npcMC != null)
|
||||||
|
{
|
||||||
|
_npcAngle = param2;
|
||||||
|
if(_npcMC.animActive == false)
|
||||||
|
{
|
||||||
|
_npcState = param1;
|
||||||
|
_npcMC.moveCycle(_npcAngle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if(_npcMC != null)
|
||||||
|
{
|
||||||
|
_npcAttackTriggered = false;
|
||||||
|
_npcState = param1;
|
||||||
|
_npcAngle = param2;
|
||||||
|
_npcMC.attack(_npcAngle);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
if(_npcMC != null)
|
||||||
|
{
|
||||||
|
if(_npcState != 3 || _npcMC.hasOwnProperty("animActive") == false || _npcMC.animActive == false)
|
||||||
|
{
|
||||||
|
if(_npcState == 0 || _npcState == 1)
|
||||||
|
{
|
||||||
|
_npcState = param1;
|
||||||
|
}
|
||||||
|
_npcMC.recoil(_npcAngle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
if(_npcMC)
|
||||||
|
{
|
||||||
|
_npcState = param1;
|
||||||
|
_npcMC.noHealth();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
if(_npcMC)
|
||||||
|
{
|
||||||
|
_npcMC.appear();
|
||||||
|
_npcState = param1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
if(_npcMC)
|
||||||
|
{
|
||||||
|
_npcMC.openChest();
|
||||||
|
_npcState = param1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
if(_npcMC)
|
||||||
|
{
|
||||||
|
_npcMC.disappear();
|
||||||
|
_npcState = param1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
if(_npcAvatarView != null)
|
||||||
|
{
|
||||||
|
_npcState = param1;
|
||||||
|
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||||
|
{
|
||||||
|
playAnimationState(23,false,0,null);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
playAnimationState(38,false,0,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get collisionZapRadius() : Number
|
||||||
|
{
|
||||||
|
if(_npcMC != null)
|
||||||
|
{
|
||||||
|
if("getCollisionRadius" in _npcMC)
|
||||||
|
{
|
||||||
|
return _npcMC.getCollisionRadius(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get collisionRadiusMoving() : Number
|
||||||
|
{
|
||||||
|
if(_npcMC != null)
|
||||||
|
{
|
||||||
|
if("getCollisionRadius" in _npcMC)
|
||||||
|
{
|
||||||
|
return _npcMC.getCollisionRadius(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get collisionRadiusAttack() : Number
|
||||||
|
{
|
||||||
|
if(_npcMC != null)
|
||||||
|
{
|
||||||
|
if("getCollisionRadius" in _npcMC)
|
||||||
|
{
|
||||||
|
return _npcMC.getCollisionRadius(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get collisionMovingPoint() : Point
|
||||||
|
{
|
||||||
|
if(_npcMC != null)
|
||||||
|
{
|
||||||
|
if("getCollisionPoint" in _npcMC)
|
||||||
|
{
|
||||||
|
return _npcMC.getCollisionPoint(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new Point(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get collisionZapPoint() : Point
|
||||||
|
{
|
||||||
|
if(_npcMC != null)
|
||||||
|
{
|
||||||
|
if("getCollisionPoint" in _npcMC)
|
||||||
|
{
|
||||||
|
return _npcMC.getCollisionPoint(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new Point(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get collisionPointAttack() : Point
|
||||||
|
{
|
||||||
|
if(_npcMC != null)
|
||||||
|
{
|
||||||
|
if("getCollisionPoint" in _npcMC)
|
||||||
|
{
|
||||||
|
return _npcMC.getCollisionPoint(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new Point(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get currAvatar() : Avatar
|
||||||
|
{
|
||||||
|
if(_npcAvatarView != null)
|
||||||
|
{
|
||||||
|
return _npcAvatarView.avatarData;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get talkingHeadMediaId() : int
|
||||||
|
{
|
||||||
|
if(_npcDef != null)
|
||||||
|
{
|
||||||
|
return _npcDef.headMediaRefId;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reset() : void
|
||||||
|
{
|
||||||
|
_npcState = -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:int, param2:int, param3:int = -1, param4:int = 0, param5:Boolean = false, param6:Function = null) : void
|
||||||
|
{
|
||||||
|
var _loc14_:Avatar = null;
|
||||||
|
var _loc12_:String = null;
|
||||||
|
var _loc13_:AccItemCollection = null;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc9_:Item = null;
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
var _loc10_:Array = null;
|
||||||
|
var _loc11_:Array = null;
|
||||||
|
_npcFacingSW = false;
|
||||||
|
_npcState = -2;
|
||||||
|
_npcAngle = 0;
|
||||||
|
if(disguiseDefId > 0 && param1 == 2 && QuestManager.getNPCDef(disguiseDefId) != null)
|
||||||
|
{
|
||||||
|
param1 = disguiseDefId;
|
||||||
|
_disguise = true;
|
||||||
|
}
|
||||||
|
_npcDef = QuestManager.getNPCDef(param1);
|
||||||
|
_playerId = param2;
|
||||||
|
_onLoadingCompleteCallback = param6;
|
||||||
|
_hitText = new TextField();
|
||||||
|
_hitText.selectable = false;
|
||||||
|
_hitText.multiline = false;
|
||||||
|
_hitText.autoSize = "center";
|
||||||
|
_hitText.visible = false;
|
||||||
|
_hitText.embedFonts = true;
|
||||||
|
_hitText.defaultTextFormat = new TextFormat("TikiIsland-Regular",36,4286945);
|
||||||
|
_hitText.filters = [new GlowFilter(0,1,3,3,10,2)];
|
||||||
|
switch(_npcDef.type)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
_mediaHelperObj = new MediaHelper();
|
||||||
|
_mediaHelperObj.init(_npcDef.mediaRefId,onMediaLoaded);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
_loc14_ = new Avatar();
|
||||||
|
_loc14_.avName = "";
|
||||||
|
_loc14_.userName = "";
|
||||||
|
_loc14_.isShaman = param4 == 32;
|
||||||
|
_npcAvatarView = new AvatarWorldView();
|
||||||
|
_npcAvatarView.initWorldView(_loc14_,QuestManager._layerManager.room_chat,1,true);
|
||||||
|
_loc14_.init(-1,-1,_loc14_.avName,_npcDef.avatarRefId,[_npcDef.baseColor,_npcDef.patternColor,_npcDef.eyesColor]);
|
||||||
|
_loc14_.itemResponseIntegrate(ItemXtCommManager.generateBodyModList(_npcDef.avatarRefId,_npcDef.patternItemRefId,_npcDef.eyesItemRefId,false));
|
||||||
|
if(param3 > 0)
|
||||||
|
{
|
||||||
|
if(_npcAvatarView != null && _npcAvatarView.avatarData != null)
|
||||||
|
{
|
||||||
|
_loc12_ = LocalizationManager.translateIdOnly(param3);
|
||||||
|
_npcAvatarView.avatarData.avName = _loc12_;
|
||||||
|
_npcAvatarView.avatarData.userName = _loc12_;
|
||||||
|
if(_npcAvatarView.nameBar != null)
|
||||||
|
{
|
||||||
|
_npcAvatarView.nameBar.setAvName(_loc12_);
|
||||||
|
_npcAvatarView.nameBar.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc13_ = new AccItemCollection();
|
||||||
|
_loc8_ = 100;
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < _npcAvatarView.avatarData.inventoryBodyMod.itemCollection.length)
|
||||||
|
{
|
||||||
|
_loc13_.pushAccItem(_npcAvatarView.avatarData.inventoryBodyMod.itemCollection.getAccItem(_loc7_));
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
if(_npcDef.backItemRefId != 0)
|
||||||
|
{
|
||||||
|
_loc9_ = new Item();
|
||||||
|
_loc10_ = ItemXtCommManager.getItemDef(_npcDef.backItemRefId).colors;
|
||||||
|
_loc9_.init(_npcDef.backItemRefId,_loc8_++,_loc10_[Math.min(_npcDef.backColor,_loc10_.length - 1)],EquippedAvatars.forced());
|
||||||
|
_loc13_.pushAccItem(_loc9_);
|
||||||
|
}
|
||||||
|
if(_npcDef.headItemRefId != 0)
|
||||||
|
{
|
||||||
|
_loc9_ = new Item();
|
||||||
|
_loc10_ = ItemXtCommManager.getItemDef(_npcDef.headItemRefId).colors;
|
||||||
|
_loc9_.init(_npcDef.headItemRefId,_loc8_++,_loc10_[Math.min(_npcDef.headColor,_loc10_.length - 1)],EquippedAvatars.forced());
|
||||||
|
_loc13_.pushAccItem(_loc9_);
|
||||||
|
}
|
||||||
|
if(_npcDef.legItemRefId != 0)
|
||||||
|
{
|
||||||
|
_loc9_ = new Item();
|
||||||
|
_loc10_ = ItemXtCommManager.getItemDef(_npcDef.legItemRefId).colors;
|
||||||
|
_loc9_.init(_npcDef.legItemRefId,_loc8_++,_loc10_[Math.min(_npcDef.legColor,_loc10_.length - 1)],EquippedAvatars.forced());
|
||||||
|
_loc13_.pushAccItem(_loc9_);
|
||||||
|
}
|
||||||
|
if(_npcDef.neckItemRefId != 0)
|
||||||
|
{
|
||||||
|
_loc9_ = new Item();
|
||||||
|
_loc10_ = ItemXtCommManager.getItemDef(_npcDef.neckItemRefId).colors;
|
||||||
|
_loc9_.init(_npcDef.neckItemRefId,_loc8_++,_loc10_[Math.min(_npcDef.neckColor,_loc10_.length - 1)],EquippedAvatars.forced());
|
||||||
|
_loc13_.pushAccItem(_loc9_);
|
||||||
|
}
|
||||||
|
if(_npcDef.tailItemRefId != 0)
|
||||||
|
{
|
||||||
|
_loc9_ = new Item();
|
||||||
|
_loc10_ = ItemXtCommManager.getItemDef(_npcDef.tailItemRefId).colors;
|
||||||
|
_loc9_.init(_npcDef.tailItemRefId,_loc8_++,_loc10_[Math.min(_npcDef.tailColor,_loc10_.length - 1)],EquippedAvatars.forced());
|
||||||
|
_loc13_.pushAccItem(_loc9_);
|
||||||
|
}
|
||||||
|
_npcAvatarView.avatarData.itemResponseIntegrate(_loc13_);
|
||||||
|
_loc11_ = new Array(15);
|
||||||
|
redrawCallback(null);
|
||||||
|
}
|
||||||
|
if(param5)
|
||||||
|
{
|
||||||
|
_healthBar = GETDEFINITIONBYNAME("NPCHealth");
|
||||||
|
_healthBar.x = -_healthBar.width * 0.5;
|
||||||
|
_healthBar.y = 18;
|
||||||
|
_healthBar.hpBar.width = _healthBar.hpEnemyBarContainer.width;
|
||||||
|
addChild(_healthBar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
if(_mediaHelperObj)
|
||||||
|
{
|
||||||
|
_mediaHelperObj.destroy();
|
||||||
|
_mediaHelperObj = null;
|
||||||
|
}
|
||||||
|
if(_npcMC)
|
||||||
|
{
|
||||||
|
if(_npcMC.hasOwnProperty("destroyPhantomNPC"))
|
||||||
|
{
|
||||||
|
_npcMC.destroyPhantomNPC();
|
||||||
|
}
|
||||||
|
if(_npcMC.parent != null)
|
||||||
|
{
|
||||||
|
_npcMC.parent.removeChild(_npcMC);
|
||||||
|
}
|
||||||
|
if(_eye && _eye.parent)
|
||||||
|
{
|
||||||
|
_eye.parent.removeChild(_eye);
|
||||||
|
}
|
||||||
|
if(_torch && _torch.parent)
|
||||||
|
{
|
||||||
|
_torch.parent.removeChild(_torch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_secondaryNpcMC && _secondaryNpcMC.parent != null && _secondaryNpcMC.parent is MovieClip)
|
||||||
|
{
|
||||||
|
_secondaryNpcMC.parent.removeChild(_secondaryNpcMC);
|
||||||
|
}
|
||||||
|
if(_namebar)
|
||||||
|
{
|
||||||
|
_namebar.destroy();
|
||||||
|
_namebar = null;
|
||||||
|
}
|
||||||
|
if(_healthBar)
|
||||||
|
{
|
||||||
|
_healthBar = null;
|
||||||
|
}
|
||||||
|
if(_npcAvatarView)
|
||||||
|
{
|
||||||
|
if(_npcAvatarView.parent != null)
|
||||||
|
{
|
||||||
|
_npcAvatarView.parent.removeChild(_npcAvatarView);
|
||||||
|
}
|
||||||
|
_npcAvatarView.destroy(true);
|
||||||
|
}
|
||||||
|
_hitTextTween = null;
|
||||||
|
_hitText.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateHealthBar(param1:int, param2:int, param3:Boolean, param4:Boolean) : void
|
||||||
|
{
|
||||||
|
var _loc5_:String = null;
|
||||||
|
if(_healthBar)
|
||||||
|
{
|
||||||
|
if(param1 == 0)
|
||||||
|
{
|
||||||
|
_healthBar.visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_healthBar.hpBar.width = _healthBar.hpEnemyBarContainer.width * (param1 / 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(param4)
|
||||||
|
{
|
||||||
|
if(param2 > 0 && _npcMC)
|
||||||
|
{
|
||||||
|
if(param3)
|
||||||
|
{
|
||||||
|
_loc5_ = "Fierce!\n" + Math.abs(param2) * -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc5_ = String(Math.abs(param2) * -1);
|
||||||
|
}
|
||||||
|
playHitText(_loc5_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function playHitText(param1:String) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Point = null;
|
||||||
|
_hitText.visible = true;
|
||||||
|
_hitText.alpha = 2;
|
||||||
|
_hitText.text = param1;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_loc2_ = _npcMC.getAttachmentPoint();
|
||||||
|
_hitText.x = _loc2_.x + this.x - _hitText.textWidth * 0.5;
|
||||||
|
_hitText.y = _loc2_.y + this.y;
|
||||||
|
}
|
||||||
|
catch(e:Error)
|
||||||
|
{
|
||||||
|
_hitText.x = this.x - _hitText.textWidth * 0.5;
|
||||||
|
_hitText.y = this.y - _hitText.textHeight;
|
||||||
|
}
|
||||||
|
if(parent != null)
|
||||||
|
{
|
||||||
|
_hitText.x += parent.x;
|
||||||
|
_hitText.y += parent.y;
|
||||||
|
}
|
||||||
|
if(_hitTextTween)
|
||||||
|
{
|
||||||
|
_hitTextTween.resetValues({
|
||||||
|
"y":_hitText.y - 90,
|
||||||
|
"alpha":0
|
||||||
|
});
|
||||||
|
_hitTextTween.beginning();
|
||||||
|
_hitTextTween.paused = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_hitTextTween = new GTween(_hitText,1,{
|
||||||
|
"y":_hitText.y - 90,
|
||||||
|
"alpha":0
|
||||||
|
},{"ease":Linear.easeNone});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function playAnimationState(param1:int, param2:Boolean, param3:int, param4:Function) : void
|
||||||
|
{
|
||||||
|
if(_npcAvatarView)
|
||||||
|
{
|
||||||
|
_npcAvatarView.playAnim(param1,param2,param3,param4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getNpcMC() : MovieClip
|
||||||
|
{
|
||||||
|
if(_disguise && (_npcMC == null || !("setVision" in _npcMC)))
|
||||||
|
{
|
||||||
|
if(_disguiseStandIn == null)
|
||||||
|
{
|
||||||
|
_disguiseStandIn = new MovieClip();
|
||||||
|
_disguiseStandIn["setVision"] = function(param1:* = null):void
|
||||||
|
{
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return _disguiseStandIn;
|
||||||
|
}
|
||||||
|
return _npcMC;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get defId() : int
|
||||||
|
{
|
||||||
|
return _npcDef.defId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get npcDef() : Object
|
||||||
|
{
|
||||||
|
return _npcDef;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get secondaryNpcMC() : MovieClip
|
||||||
|
{
|
||||||
|
return _secondaryNpcMC;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onMediaLoaded(param1:MovieClip) : void
|
||||||
|
{
|
||||||
|
_npcMC = param1;
|
||||||
|
addChild(_npcMC);
|
||||||
|
if(_npcMC.hasOwnProperty("eye"))
|
||||||
|
{
|
||||||
|
_eye = _npcMC.eye;
|
||||||
|
}
|
||||||
|
if(_npcMC.hasOwnProperty("torch"))
|
||||||
|
{
|
||||||
|
_torch = _npcMC.torch;
|
||||||
|
}
|
||||||
|
if(_npcDef.headMediaRefId != 0)
|
||||||
|
{
|
||||||
|
_mediaHelperObj = new MediaHelper();
|
||||||
|
_mediaHelperObj.init(_npcDef.headMediaRefId,secondaryNPCLoaded);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
loadingComplete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function secondaryNPCLoaded(param1:MovieClip) : void
|
||||||
|
{
|
||||||
|
if(param1.getChildAt(0) is MovieClip)
|
||||||
|
{
|
||||||
|
_secondaryNpcMC = MovieClip(param1.getChildAt(0));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_secondaryNpcMC = param1;
|
||||||
|
}
|
||||||
|
_mediaHelperObj.destroy();
|
||||||
|
_mediaHelperObj = null;
|
||||||
|
loadingComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function redrawCallback(param1:LayerAnim) : void
|
||||||
|
{
|
||||||
|
if(_npcAvatarView)
|
||||||
|
{
|
||||||
|
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||||
|
{
|
||||||
|
playAnimationState(14,false,0,null);
|
||||||
|
}
|
||||||
|
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
playAnimationState(32,false,32,null);
|
||||||
|
}
|
||||||
|
addChild(_npcAvatarView);
|
||||||
|
loadingComplete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function loadingComplete() : void
|
||||||
|
{
|
||||||
|
_npcState = -1;
|
||||||
|
if(_npcMC != null && _npcMC.hasOwnProperty("setInit"))
|
||||||
|
{
|
||||||
|
_npcMC.setInit(QuestManager._questDifficultyLevel);
|
||||||
|
if(_npcMC.hasOwnProperty("watcher"))
|
||||||
|
{
|
||||||
|
_beam = _npcMC.watcher;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
QuestManager._layerManager.room_chat.addChild(_hitText);
|
||||||
|
if(_onLoadingCompleteCallback != null)
|
||||||
|
{
|
||||||
|
_onLoadingCompleteCallback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSwfState(param1:String) : Number
|
||||||
|
{
|
||||||
|
if(_npcMC != null)
|
||||||
|
{
|
||||||
|
if(param1 == "facesw_k")
|
||||||
|
{
|
||||||
|
param1 = "facesw";
|
||||||
|
}
|
||||||
|
else if(param1 == "facese_k")
|
||||||
|
{
|
||||||
|
param1 = "facese";
|
||||||
|
}
|
||||||
|
return _npcMC.setStateByScript(param1);
|
||||||
|
}
|
||||||
|
if(_npcAvatarView != null)
|
||||||
|
{
|
||||||
|
if(param1 == "dance")
|
||||||
|
{
|
||||||
|
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||||
|
{
|
||||||
|
playAnimationState(23,_npcFacingSW,0,null);
|
||||||
|
}
|
||||||
|
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
playAnimationState(38,_npcFacingSW,0,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param1 == "sitsw")
|
||||||
|
{
|
||||||
|
_npcFacingSW = true;
|
||||||
|
playAnimationState(4,_npcFacingSW,0,null);
|
||||||
|
}
|
||||||
|
else if(param1 == "sitse")
|
||||||
|
{
|
||||||
|
_npcFacingSW = false;
|
||||||
|
playAnimationState(4,_npcFacingSW,0,null);
|
||||||
|
}
|
||||||
|
else if(param1 == "hop")
|
||||||
|
{
|
||||||
|
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||||
|
{
|
||||||
|
playAnimationState(17,_npcFacingSW,0,null);
|
||||||
|
}
|
||||||
|
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
playAnimationState(41,_npcFacingSW,0,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param1 == "spin")
|
||||||
|
{
|
||||||
|
if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
playAnimationState(33,_npcFacingSW,0,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param1 == "idle" || param1 == "facese")
|
||||||
|
{
|
||||||
|
_npcFacingSW = false;
|
||||||
|
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||||
|
{
|
||||||
|
playAnimationState(14,false,0,null);
|
||||||
|
}
|
||||||
|
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
playAnimationState(32,false,0,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param1 == "facesw")
|
||||||
|
{
|
||||||
|
_npcFacingSW = true;
|
||||||
|
if(RoomManagerWorld.instance.roomEnviroType == 0)
|
||||||
|
{
|
||||||
|
playAnimationState(14,true,0,null);
|
||||||
|
}
|
||||||
|
else if(RoomManagerWorld.instance.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
playAnimationState(32,true,0,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param1 == "facesw_k")
|
||||||
|
{
|
||||||
|
if(_npcFacingSW == false && _npcAvatarView)
|
||||||
|
{
|
||||||
|
_npcFacingSW = true;
|
||||||
|
playAnimationState(_npcAvatarView.animId,true,0,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param1 == "facese_k")
|
||||||
|
{
|
||||||
|
if(_npcFacingSW == true && _npcAvatarView)
|
||||||
|
{
|
||||||
|
_npcFacingSW = false;
|
||||||
|
playAnimationState(_npcAvatarView.animId,false,0,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param1 == "sleep")
|
||||||
|
{
|
||||||
|
playAnimationState(22,_npcFacingSW,0,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
package com.sbi.graphics
|
||||||
|
{
|
||||||
|
import flash.utils.ByteArray;
|
||||||
|
|
||||||
|
public class PaletteHelper
|
||||||
|
{
|
||||||
|
|
||||||
|
public static var gamePalette:Array;
|
||||||
|
|
||||||
|
public static var avatarPalette1:Array;
|
||||||
|
|
||||||
|
public static var avatarPalette2:Array;
|
||||||
|
|
||||||
|
private static const PALETTE_ALPHA_OFFSET:int = 25;
|
||||||
|
|
||||||
|
public static var customColors:Object = {};
|
||||||
|
|
||||||
|
public static var onCustomRegistered:Function;
|
||||||
|
|
||||||
|
public function PaletteHelper()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function setGamePalette(param1:ByteArray, param2:ByteArray = null, param3:ByteArray = null) : void
|
||||||
|
{
|
||||||
|
var _loc4_:int = param1.length / 4;
|
||||||
|
gamePalette = new Array(_loc4_);
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
while(_loc5_ < _loc4_)
|
||||||
|
{
|
||||||
|
gamePalette[_loc5_] = uint(_loc5_ << 24 | param1.readUnsignedInt() & 0xFFFFFF);
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
if(param2)
|
||||||
|
{
|
||||||
|
_loc4_ = int(param2.length);
|
||||||
|
avatarPalette1 = new Array(_loc4_);
|
||||||
|
_loc5_ = 0;
|
||||||
|
while(_loc5_ < _loc4_)
|
||||||
|
{
|
||||||
|
avatarPalette1[_loc5_++] = param2.readUnsignedByte();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(param3)
|
||||||
|
{
|
||||||
|
param3.position = 0;
|
||||||
|
_loc4_ = int(param3.length);
|
||||||
|
avatarPalette2 = new Array(_loc4_);
|
||||||
|
_loc5_ = 0;
|
||||||
|
while(_loc5_ < _loc4_)
|
||||||
|
{
|
||||||
|
avatarPalette2[_loc5_++] = param3.readUnsignedByte();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function isCustom(param1:uint) : Boolean
|
||||||
|
{
|
||||||
|
return customColors[param1] != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function resolve(param1:uint) : Array
|
||||||
|
{
|
||||||
|
var _loc2_:Array = customColors[param1];
|
||||||
|
if(_loc2_ != null)
|
||||||
|
{
|
||||||
|
return _loc2_.concat();
|
||||||
|
}
|
||||||
|
return [uint(gamePalette[param1 >> 24 & 0xFF]) & 0xFFFFFF,uint(gamePalette[param1 >> 16 & 0xFF]) & 0xFFFFFF,uint(gamePalette[param1 >> 8 & 0xFF]) & 0xFFFFFF,uint(gamePalette[param1 & 0xFF]) & 0xFFFFFF];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function handleCustomColors(param1:Object) : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = int(param1[2]);
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc4_:int = 3;
|
||||||
|
var _loc5_:uint = 0;
|
||||||
|
var _loc6_:Array = null;
|
||||||
|
while(_loc3_ < _loc2_)
|
||||||
|
{
|
||||||
|
_loc5_ = uint(param1[_loc4_]);
|
||||||
|
_loc6_ = [uint(param1[_loc4_ + 1]) & 0xFFFFFF,uint(param1[_loc4_ + 2]) & 0xFFFFFF,uint(param1[_loc4_ + 3]) & 0xFFFFFF,uint(param1[_loc4_ + 4]) & 0xFFFFFF];
|
||||||
|
customColors[_loc5_] = _loc6_;
|
||||||
|
if(onCustomRegistered != null)
|
||||||
|
{
|
||||||
|
onCustomRegistered(_loc5_,_loc6_);
|
||||||
|
}
|
||||||
|
_loc4_ += 5;
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function mixColors(param1:uint, param2:uint) : uint
|
||||||
|
{
|
||||||
|
var _loc7_:uint = uint(param1 >> 16 & 0xFF);
|
||||||
|
var _loc5_:uint = uint(param1 >> 8 & 0xFF);
|
||||||
|
var _loc8_:uint = uint(param1 & 0xFF);
|
||||||
|
var _loc3_:uint = uint(param2 >> 16 & 0xFF);
|
||||||
|
var _loc6_:uint = uint(param2 >> 8 & 0xFF);
|
||||||
|
var _loc4_:uint = uint(param2 & 0xFF);
|
||||||
|
_loc7_ = (_loc7_ + _loc3_) / 2;
|
||||||
|
_loc5_ = (_loc5_ + _loc6_) / 2;
|
||||||
|
_loc8_ = (_loc8_ + _loc4_) / 2;
|
||||||
|
return _loc7_ << 16 | _loc5_ << 8 | _loc8_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function setColorGradient(param1:Array, param2:uint, param3:uint, param4:uint) : void
|
||||||
|
{
|
||||||
|
var _loc9_:* = 0;
|
||||||
|
var _loc6_:* = 0;
|
||||||
|
var _loc12_:uint = uint(param2 >> 16 & 0xFF);
|
||||||
|
var _loc7_:uint = uint(param2 >> 8 & 0xFF);
|
||||||
|
var _loc5_:uint = uint(param2 & 0xFF);
|
||||||
|
var _loc13_:uint = _loc12_ / (param4 + 2);
|
||||||
|
var _loc10_:uint = _loc7_ / (param4 + 2);
|
||||||
|
var _loc11_:uint = _loc5_ / (param4 + 2);
|
||||||
|
var _loc8_:int = param3 + param4 - 1;
|
||||||
|
_loc9_ = 0;
|
||||||
|
while(_loc9_ < param4)
|
||||||
|
{
|
||||||
|
_loc6_ = uint(_loc12_ << 16 | _loc7_ << 8 | _loc5_);
|
||||||
|
param1[_loc8_] = _loc6_ | -16777216;
|
||||||
|
param1[_loc8_ + 25] = _loc6_ | -1073741824;
|
||||||
|
param1[_loc8_ + 25 * 2] = _loc6_ | -2147483648;
|
||||||
|
param1[_loc8_ + 25 * 3] = _loc6_ | 0x40000000;
|
||||||
|
_loc12_ -= _loc13_;
|
||||||
|
_loc7_ -= _loc10_;
|
||||||
|
_loc5_ -= _loc11_;
|
||||||
|
_loc8_--;
|
||||||
|
_loc9_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function AddRGB(param1:uint, param2:int, param3:int, param4:int) : uint
|
||||||
|
{
|
||||||
|
var _loc7_:int = param1 >> 24 & 0xFF;
|
||||||
|
var _loc5_:int = param1 >> 16 & 0xFF;
|
||||||
|
var _loc8_:int = param1 >> 8 & 0xFF;
|
||||||
|
var _loc6_:int = param1 & 0xFF;
|
||||||
|
_loc5_ += param2;
|
||||||
|
if(_loc5_ < 0)
|
||||||
|
{
|
||||||
|
_loc5_ = 0;
|
||||||
|
}
|
||||||
|
else if(_loc5_ > 255)
|
||||||
|
{
|
||||||
|
_loc5_ = 255;
|
||||||
|
}
|
||||||
|
_loc8_ += param3;
|
||||||
|
if(_loc8_ < 0)
|
||||||
|
{
|
||||||
|
_loc8_ = 0;
|
||||||
|
}
|
||||||
|
else if(_loc8_ > 255)
|
||||||
|
{
|
||||||
|
_loc8_ = 255;
|
||||||
|
}
|
||||||
|
_loc6_ += param4;
|
||||||
|
if(_loc6_ < 0)
|
||||||
|
{
|
||||||
|
_loc6_ = 0;
|
||||||
|
}
|
||||||
|
else if(_loc6_ > 255)
|
||||||
|
{
|
||||||
|
_loc6_ = 255;
|
||||||
|
}
|
||||||
|
return uint(_loc7_ << 24 | _loc5_ << 16 | _loc8_ << 8 | _loc6_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getAnimalPalette() : Array
|
||||||
|
{
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
var _loc3_:* = 0;
|
||||||
|
var _loc4_:* = 0;
|
||||||
|
var _loc1_:Array = new Array(4278255615,4286513152,4290707456,4294901760,4278222592,4278238976,4278255360,4278190207,4278190271,4278190335,4286545791,4290756543,4294967295,4282400768,4286611456,4278206528,4278222976,4282384448,4286578816,4286595136,4294934656,4282417216,4286644096,4282400896,4286611711,4278190080);
|
||||||
|
var _loc2_:* = 4294967295;
|
||||||
|
_loc5_ = 0;
|
||||||
|
while(_loc5_ < 3)
|
||||||
|
{
|
||||||
|
_loc6_ = 1;
|
||||||
|
while(_loc6_ <= 25)
|
||||||
|
{
|
||||||
|
_loc3_ = uint(_loc1_[_loc6_] & 0xFFFFFF);
|
||||||
|
_loc4_ = uint(_loc3_ | _loc2_);
|
||||||
|
_loc1_.push(_loc4_);
|
||||||
|
_loc6_++;
|
||||||
|
}
|
||||||
|
_loc2_ -= 1073741824;
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
return _loc1_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function BuildAnimalPalette(param1:Array, param2:uint, param3:uint, param4:uint, param5:uint) : void
|
||||||
|
{
|
||||||
|
var _loc6_:Array = customColors[uint((param2 >>> 24) << 24 | (param3 >>> 24) << 16 | (param4 >>> 24) << 8 | param5 >>> 24)];
|
||||||
|
if(_loc6_ != null)
|
||||||
|
{
|
||||||
|
param2 = uint(_loc6_[0]);
|
||||||
|
param3 = uint(_loc6_[1]);
|
||||||
|
param4 = uint(_loc6_[2]);
|
||||||
|
param5 = uint(_loc6_[3]);
|
||||||
|
}
|
||||||
|
setColorGradient(param1,param2,1,3);
|
||||||
|
setColorGradient(param1,param3,4,3);
|
||||||
|
setColorGradient(param1,param4,7,3);
|
||||||
|
setColorGradient(param1,param5,10,3);
|
||||||
|
setColorGradient(param1,PaletteHelper.mixColors(param2,param3),13,2);
|
||||||
|
setColorGradient(param1,PaletteHelper.mixColors(param3,param4),15,2);
|
||||||
|
setColorGradient(param1,PaletteHelper.mixColors(param2,param4),17,2);
|
||||||
|
setColorGradient(param1,PaletteHelper.mixColors(param2,param5),19,2);
|
||||||
|
setColorGradient(param1,PaletteHelper.mixColors(param3,param5),21,2);
|
||||||
|
setColorGradient(param1,PaletteHelper.mixColors(param4,param5),23,2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function adjustPaletteColor(param1:Array, param2:uint) : void
|
||||||
|
{
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc6_:* = 0;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc10_:int = 0;
|
||||||
|
var _loc12_:int = 0;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc4_:Number = NaN;
|
||||||
|
var _loc8_:Number = (param2 >> 24 & 0xFF) / 255;
|
||||||
|
var _loc9_:int = param2 >> 16 & 0xFF;
|
||||||
|
var _loc11_:int = param2 >> 8 & 0xFF;
|
||||||
|
var _loc13_:int = param2 & 0xFF;
|
||||||
|
while(_loc7_ < param1.length)
|
||||||
|
{
|
||||||
|
_loc6_ = uint(param1[_loc7_]);
|
||||||
|
_loc5_ = _loc6_ >> 24 & 0xFF;
|
||||||
|
_loc10_ = _loc6_ >> 16 & 0xFF;
|
||||||
|
_loc12_ = _loc6_ >> 8 & 0xFF;
|
||||||
|
_loc3_ = _loc6_ & 0xFF;
|
||||||
|
_loc4_ = _loc9_ - _loc10_;
|
||||||
|
_loc4_ = _loc4_ * _loc8_;
|
||||||
|
_loc10_ += _loc4_;
|
||||||
|
if(_loc10_ < 0)
|
||||||
|
{
|
||||||
|
_loc10_ = 0;
|
||||||
|
}
|
||||||
|
else if(_loc10_ > 255)
|
||||||
|
{
|
||||||
|
_loc10_ = 255;
|
||||||
|
}
|
||||||
|
_loc4_ = _loc11_ - _loc12_;
|
||||||
|
_loc4_ = _loc4_ * _loc8_;
|
||||||
|
_loc12_ += _loc4_;
|
||||||
|
if(_loc12_ < 0)
|
||||||
|
{
|
||||||
|
_loc12_ = 0;
|
||||||
|
}
|
||||||
|
else if(_loc12_ > 255)
|
||||||
|
{
|
||||||
|
_loc12_ = 255;
|
||||||
|
}
|
||||||
|
_loc4_ = _loc13_ - _loc3_;
|
||||||
|
_loc4_ = _loc4_ * _loc8_;
|
||||||
|
_loc3_ += _loc4_;
|
||||||
|
if(_loc3_ < 0)
|
||||||
|
{
|
||||||
|
_loc3_ = 0;
|
||||||
|
}
|
||||||
|
else if(_loc3_ > 255)
|
||||||
|
{
|
||||||
|
_loc3_ = 255;
|
||||||
|
}
|
||||||
|
param1[_loc7_] = uint(_loc5_ << 24 | _loc10_ << 16 | _loc12_ << 8 | _loc3_);
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getHexColorsFromPalette(param1:uint) : Array
|
||||||
|
{
|
||||||
|
return resolve(param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRGBColors(param1:uint) : Array
|
||||||
|
{
|
||||||
|
var _loc3_:Array = resolve(param1);
|
||||||
|
var _loc2_:Array = [];
|
||||||
|
_loc2_[0] = decToRGBObj(_loc3_[0]);
|
||||||
|
_loc2_[1] = decToRGBObj(_loc3_[1]);
|
||||||
|
_loc2_[2] = decToRGBObj(_loc3_[2]);
|
||||||
|
_loc2_[3] = decToRGBObj(_loc3_[3]);
|
||||||
|
return _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function decToRGBObj(param1:uint) : Object
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"r":param1 >> 16 & 0xFF,
|
||||||
|
"g":param1 >> 8 & 0xFF,
|
||||||
|
"b":param1 & 0xFF
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,857 @@
|
|||||||
|
package gui
|
||||||
|
{
|
||||||
|
import Party.PartyManager;
|
||||||
|
import adoptAPet.AdoptAPetManager;
|
||||||
|
import avatar.AvatarManager;
|
||||||
|
import com.sbi.analytics.SBTracker;
|
||||||
|
import com.sbi.popup.SBOkPopup;
|
||||||
|
import com.sbi.popup.SBYesNoPopup;
|
||||||
|
import diamond.DiamondXtCommManager;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import game.MinigameManager;
|
||||||
|
import gui.itemWindows.ItemWindowPets;
|
||||||
|
import gui.jazwares.CheckListPopup;
|
||||||
|
import loader.MediaHelper;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
import pet.GuiPet;
|
||||||
|
import pet.PetDef;
|
||||||
|
import pet.PetItem;
|
||||||
|
import pet.PetManager;
|
||||||
|
import pet.PetXtCommManager;
|
||||||
|
import shop.MyShopData;
|
||||||
|
import shop.MyShopItem;
|
||||||
|
import shop.Shop;
|
||||||
|
import shop.ShopManager;
|
||||||
|
import shop.ShopToSellXtCommManager;
|
||||||
|
|
||||||
|
public class PetInventory
|
||||||
|
{
|
||||||
|
|
||||||
|
private static const LOADING_SPIRAL_SMALL:int = 397;
|
||||||
|
|
||||||
|
private static const EVT_ICON_ID:int = 44;
|
||||||
|
|
||||||
|
private const PET_INVENTORY_MEDIA_ID:int = 993;
|
||||||
|
|
||||||
|
private var _guiLayer:DisplayLayer;
|
||||||
|
|
||||||
|
private var _closeCallback:Function;
|
||||||
|
|
||||||
|
private var _petList:Array;
|
||||||
|
|
||||||
|
private var _inventoryMC:MovieClip;
|
||||||
|
|
||||||
|
private var _loadingMediaHelper:MediaHelper;
|
||||||
|
|
||||||
|
private var _loadingSpiralBig:LoadingSpiral;
|
||||||
|
|
||||||
|
private var _bigPet:GuiPet;
|
||||||
|
|
||||||
|
private var _itemWindows:WindowAndScrollbarGenerator;
|
||||||
|
|
||||||
|
private var _shop:Shop;
|
||||||
|
|
||||||
|
private var _checkListPopup:CheckListPopup;
|
||||||
|
|
||||||
|
private var _isRecycling:Boolean;
|
||||||
|
|
||||||
|
private var _activePetModified:Boolean;
|
||||||
|
|
||||||
|
private var _noCurrentActivePet:Boolean;
|
||||||
|
|
||||||
|
private var _idx:int;
|
||||||
|
|
||||||
|
private var _currSelectedIdx:int;
|
||||||
|
|
||||||
|
private var _initialPetInvId:int;
|
||||||
|
|
||||||
|
private var _recycleOneOnly:Boolean;
|
||||||
|
|
||||||
|
private var _hasRecycled:Boolean;
|
||||||
|
|
||||||
|
private var _previousPetInvId:int;
|
||||||
|
|
||||||
|
private var _petIndexBeingDeleted:int;
|
||||||
|
|
||||||
|
private var _openCheckListImmediately:Boolean;
|
||||||
|
|
||||||
|
public function PetInventory()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:Function, param2:Boolean = false, param3:Boolean = false) : void
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
_guiLayer = GuiManager.guiLayer;
|
||||||
|
_closeCallback = param1;
|
||||||
|
_petList = PetManager.myPetList.concat();
|
||||||
|
_idx = -1;
|
||||||
|
_currSelectedIdx = -1;
|
||||||
|
_recycleOneOnly = param2;
|
||||||
|
_openCheckListImmediately = param3;
|
||||||
|
_loadingSpiralBig = new LoadingSpiral();
|
||||||
|
SBTracker.push();
|
||||||
|
SBTracker.trackPageview("/game/play/popup/pet/inventory");
|
||||||
|
_loadingMediaHelper = new MediaHelper();
|
||||||
|
_loadingMediaHelper.init(993,onMediaItemLoaded);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
removeEventListeners();
|
||||||
|
DarkenManager.unDarken(_inventoryMC);
|
||||||
|
_guiLayer.removeChild(_inventoryMC);
|
||||||
|
SBTracker.pop();
|
||||||
|
onCheckListClose();
|
||||||
|
_activePetModified = false;
|
||||||
|
_noCurrentActivePet = false;
|
||||||
|
_idx = -1;
|
||||||
|
_initialPetInvId = -1;
|
||||||
|
_currSelectedIdx = -1;
|
||||||
|
_isRecycling = false;
|
||||||
|
_inventoryMC = null;
|
||||||
|
_petList = null;
|
||||||
|
if(_bigPet)
|
||||||
|
{
|
||||||
|
_bigPet.destroy();
|
||||||
|
_bigPet = null;
|
||||||
|
}
|
||||||
|
if(_itemWindows)
|
||||||
|
{
|
||||||
|
_itemWindows.destroy();
|
||||||
|
_itemWindows = null;
|
||||||
|
}
|
||||||
|
if(_closeCallback != null)
|
||||||
|
{
|
||||||
|
if(_recycleOneOnly)
|
||||||
|
{
|
||||||
|
_closeCallback(_hasRecycled);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_closeCallback();
|
||||||
|
}
|
||||||
|
_closeCallback = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onMediaItemLoaded(param1:MovieClip) : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc4_:Object = null;
|
||||||
|
var _loc3_:PetDef = null;
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
_inventoryMC = MovieClip(param1.getChildAt(0));
|
||||||
|
_inventoryMC.petNameTxt.text = "";
|
||||||
|
_inventoryMC.itemCounter.counterTxt.text = "0/" + PetManager.getPetInventoryMax();
|
||||||
|
_inventoryMC.bMastery.visible = false;
|
||||||
|
_inventoryMC.certBtn.visible = false;
|
||||||
|
_inventoryMC.rare.visible = false;
|
||||||
|
_loadingMediaHelper.destroy();
|
||||||
|
_loadingMediaHelper = null;
|
||||||
|
_inventoryMC.helpBubble.visible = false;
|
||||||
|
if(AvatarManager.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
_inventoryMC.shopBtn.visible = false;
|
||||||
|
}
|
||||||
|
if(AdoptAPetManager.hasAtLeastOneUsableAdoptAPet)
|
||||||
|
{
|
||||||
|
_inventoryMC.checklistBtn.visible = true;
|
||||||
|
_inventoryMC.newBurst.visible = AdoptAPetManager.hasUnseenPetData;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_inventoryMC.checklistBtn.visible = false;
|
||||||
|
_inventoryMC.newBurst.visible = false;
|
||||||
|
}
|
||||||
|
_previousPetInvId = PetManager.myActivePetInvId;
|
||||||
|
if(_petList && _petList.length > 0)
|
||||||
|
{
|
||||||
|
if(PetManager.myActivePetInvId != 0)
|
||||||
|
{
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < _petList.length)
|
||||||
|
{
|
||||||
|
if(_petList[_loc2_].idx == PetManager.myActivePetInvId)
|
||||||
|
{
|
||||||
|
_currSelectedIdx = _loc2_;
|
||||||
|
_initialPetInvId = _petList[_loc2_].idx;
|
||||||
|
if(PetManager.canCurrAvatarUsePet(AvatarManager.playerAvatar.enviroTypeFlag,_petList[_loc2_].currPetDef,_petList[_loc2_].createdTs))
|
||||||
|
{
|
||||||
|
_loc4_ = _petList[_loc2_];
|
||||||
|
_bigPet = new GuiPet(_loc4_.createdTs,_loc4_.idx,_loc4_.lBits,_loc4_.uBits,_loc4_.eBits,_loc4_.type,_loc4_.name,_loc4_.personalityDefId,_loc4_.favoriteToyDefId,_loc4_.favoriteFoodDefId,onBigPetLoaded);
|
||||||
|
_loc3_ = PetManager.getPetDef(_bigPet.getDefID());
|
||||||
|
_inventoryMC.itemWindowPet.addChild(_bigPet);
|
||||||
|
_inventoryMC.petNameTxt.text = _bigPet.petName;
|
||||||
|
AJClient.makeRenamable(_inventoryMC.petNameTxt,"p",_bigPet.idx,onPetRenamed,_inventoryMC);
|
||||||
|
_inventoryMC.butterfly.visible = false;
|
||||||
|
if(_loc4_.masteryCounter >= 100)
|
||||||
|
{
|
||||||
|
_inventoryMC.bMastery.visible = true;
|
||||||
|
_inventoryMC.bMastery.icon.gotoAndStop(PetManager.petNameForDefId(_loc4_.defId) + "1");
|
||||||
|
if((_loc4_.uBits >> 8 & 0x0F) > 0)
|
||||||
|
{
|
||||||
|
_inventoryMC.bMastery.mouse.visible = false;
|
||||||
|
_inventoryMC.bMastery.down.visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!_bigPet.isEggAndHasNotHatched())
|
||||||
|
{
|
||||||
|
_inventoryMC.certBtn.visible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_inventoryMC.certBtn.visible = false;
|
||||||
|
}
|
||||||
|
_inventoryMC.rare.visible = _loc3_ && _loc3_.status == 4;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_inventoryMC.itemCounter.counterTxt.text = _petList.length + "/" + PetManager.getPetInventoryMax();
|
||||||
|
}
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
_inventoryMC.x = 900 * 0.5;
|
||||||
|
_inventoryMC.y = 550 * 0.5;
|
||||||
|
_guiLayer.addChild(_inventoryMC);
|
||||||
|
DarkenManager.darken(_inventoryMC);
|
||||||
|
createItemWindows();
|
||||||
|
addEventListeners();
|
||||||
|
if(_openCheckListImmediately)
|
||||||
|
{
|
||||||
|
onChecklistBtn(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// A double click on the big pet's name lets the player type another.
|
||||||
|
private function onPetRenamed(param1:String) : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
if(_bigPet == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_bigPet.petName = param1;
|
||||||
|
while(_petList != null && _loc2_ < _petList.length)
|
||||||
|
{
|
||||||
|
if(_petList[_loc2_].idx == _bigPet.idx)
|
||||||
|
{
|
||||||
|
_petList[_loc2_].name = param1;
|
||||||
|
}
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onBigPetLoaded(param1:MovieClip, param2:GuiPet) : void
|
||||||
|
{
|
||||||
|
_bigPet.scaleX = _bigPet.scaleY = 5;
|
||||||
|
_bigPet.y += 83;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function createItemWindows() : void
|
||||||
|
{
|
||||||
|
if(_itemWindows)
|
||||||
|
{
|
||||||
|
_itemWindows.destroy();
|
||||||
|
_itemWindows = null;
|
||||||
|
}
|
||||||
|
while(_inventoryMC.itemWindow.numChildren > 1)
|
||||||
|
{
|
||||||
|
_inventoryMC.itemWindow.removeChildAt(_inventoryMC.itemWindow.numChildren - 1);
|
||||||
|
}
|
||||||
|
var _loc2_:int = int(_petList.length);
|
||||||
|
var _loc3_:Number = Math.min(PetManager.getPetInventoryMax(),4);
|
||||||
|
var _loc1_:int = Math.min(PetManager.getPetInventoryMax(),4);
|
||||||
|
_itemWindows = new WindowAndScrollbarGenerator();
|
||||||
|
_itemWindows.init(_inventoryMC.itemWindow.width,_inventoryMC.itemWindow.height,4,0,_loc3_,_loc1_,PetManager.getPetInventoryMax(),2,2,1,0.5,ItemWindowPets,_petList,"",0,{
|
||||||
|
"mouseDown":winMouseDown,
|
||||||
|
"mouseOver":winMouseOver,
|
||||||
|
"mouseOut":winMouseOut
|
||||||
|
},{"isRecycling":_isRecycling || _recycleOneOnly},null,false,false,false);
|
||||||
|
_inventoryMC.itemWindow.addChild(_itemWindows);
|
||||||
|
_loadingSpiralBig.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onConfirmFreePet(param1:Object) : void
|
||||||
|
{
|
||||||
|
var _loc4_:Object = null;
|
||||||
|
var _loc3_:* = undefined;
|
||||||
|
var _loc2_:PetItem = null;
|
||||||
|
if(param1.status)
|
||||||
|
{
|
||||||
|
_loc4_ = _petList[param1.passback];
|
||||||
|
if(_loc4_.denStoreInvId > 0)
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
if(ShopManager.myShopItems[_loc4_.denStoreInvId])
|
||||||
|
{
|
||||||
|
_loc3_ = new Vector.<MyShopItem>();
|
||||||
|
_loc2_ = new PetItem();
|
||||||
|
_loc2_.init(_loc4_.createdTs,_loc4_.defId,[_loc4_.lBits,_loc4_.uBits,_loc4_.eBits],_loc4_.personalityDefId,_loc4_.favoriteToyDefId,_loc4_.favoriteFoodDefId,_loc4_.idx,_loc4_.name,false,null,DiamondXtCommManager.getDiamondItem(DiamondXtCommManager.getDiamondDefIdByRefId(_loc4_.defId,2)),_loc4_.denStoreInvId);
|
||||||
|
_loc3_.push(new MyShopItem(_loc2_,0,0,_loc4_.denStoreInvId));
|
||||||
|
ShopManager.findAndRemoveDenShopItems(_loc3_,performRecycleRequest,param1.passback);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShopToSellXtCommManager.requestStoreInfo(gMainFrame.userInfo.myUserName,_loc4_.denStoreInvId,onRecycleDenStoreInfoRequest,param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
performRecycleRequest(true,param1.passback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRecycleDenStoreInfoRequest(param1:MyShopData, param2:Object) : void
|
||||||
|
{
|
||||||
|
if(param1 != null)
|
||||||
|
{
|
||||||
|
onConfirmFreePet(param2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
new SBOkPopup(_guiLayer,LocalizationManager.translateIdOnly(24788));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function performRecycleRequest(param1:Boolean, param2:Object) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
_petIndexBeingDeleted = int(param2);
|
||||||
|
PetXtCommManager.sendPetDismissRequest(_petList[_petIndexBeingDeleted].idx,freePetCallback);
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
new SBOkPopup(_guiLayer,LocalizationManager.translateIdOnly(24788));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function freePetCallback(param1:Boolean, param2:Boolean, param3:Boolean) : void
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
if(param2)
|
||||||
|
{
|
||||||
|
SBTracker.trackPageview("/game/play/popup/pet/petInventory/free");
|
||||||
|
_idx = _idx - 1;
|
||||||
|
_currSelectedIdx = _currSelectedIdx - 1;
|
||||||
|
_hasRecycled = true;
|
||||||
|
if(param3)
|
||||||
|
{
|
||||||
|
AvatarManager.playerAvatarWorldView.setActivePet(0,0,0,0,"",0,0,0);
|
||||||
|
_activePetModified = true;
|
||||||
|
while(_inventoryMC.itemWindowPet.numChildren > 0)
|
||||||
|
{
|
||||||
|
_inventoryMC.itemWindowPet.removeChildAt(0);
|
||||||
|
}
|
||||||
|
_inventoryMC.petNameTxt.text = "";
|
||||||
|
_inventoryMC.butterfly.visible = true;
|
||||||
|
_inventoryMC.bMastery.visible = false;
|
||||||
|
_inventoryMC.certBtn.visible = false;
|
||||||
|
_inventoryMC.rare.visible = false;
|
||||||
|
_idx = -1;
|
||||||
|
_currSelectedIdx = -1;
|
||||||
|
}
|
||||||
|
if(!_recycleOneOnly)
|
||||||
|
{
|
||||||
|
_itemWindows.deleteItem(_petIndexBeingDeleted,_petList);
|
||||||
|
_inventoryMC.itemCounter.counterTxt.text = _petList.length + "/" + PetManager.getPetInventoryMax();
|
||||||
|
_noCurrentActivePet = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14786));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPetSwitch(param1:Boolean = true) : void
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PetManager.myActivePetInvId = _previousPetInvId;
|
||||||
|
reloadPets();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function winMouseDown(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc2_:MovieClip = null;
|
||||||
|
var _loc5_:Object = null;
|
||||||
|
var _loc4_:PetDef = null;
|
||||||
|
param1.stopPropagation();
|
||||||
|
if((_isRecycling || _recycleOneOnly) && param1.currentTarget.cageIcon.visible)
|
||||||
|
{
|
||||||
|
if(!(PetManager.canCurrAvatarUsePet(AvatarManager.playerAvatar.enviroTypeFlag,_petList[param1.currentTarget.index].currPetDef,_petList[param1.currentTarget.index].createdTs) && PetManager.myActivePetInvId == _petList[param1.currentTarget.index].idx && !PartyManager.canSwitchPet(true)))
|
||||||
|
{
|
||||||
|
if(param1.currentTarget.shopItem.visible)
|
||||||
|
{
|
||||||
|
new SBYesNoPopup(_guiLayer,LocalizationManager.translateIdOnly(34022),true,onConfirmFreePet,param1.currentTarget.index);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new SBYesNoPopup(_guiLayer,LocalizationManager.translateIdOnly(14787),true,onConfirmFreePet,param1.currentTarget.index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param1.currentTarget.newPetIcon.visible)
|
||||||
|
{
|
||||||
|
PetManager.openPetFinder("",onPetSwitch);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(param1.currentTarget.gray.visible)
|
||||||
|
{
|
||||||
|
if(!gMainFrame.userInfo.isMember)
|
||||||
|
{
|
||||||
|
UpsellManager.displayPopup("pets","equipMemberPet");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while(_inventoryMC.itemWindowPet.numChildren > 0)
|
||||||
|
{
|
||||||
|
_inventoryMC.itemWindowPet.removeChildAt(0);
|
||||||
|
}
|
||||||
|
_idx = param1.currentTarget.index;
|
||||||
|
_currSelectedIdx = _idx;
|
||||||
|
if((param1.currentTarget.cir.currentFrameLabel == "downMouse" || param1.currentTarget.cir.currentFrameLabel == "down") && PartyManager.canSwitchPet(true))
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("up");
|
||||||
|
if(_initialPetInvId == 0)
|
||||||
|
{
|
||||||
|
_idx = -1;
|
||||||
|
}
|
||||||
|
PetManager.myActivePetInvId = 0;
|
||||||
|
GuiManager.resetPetWindowListAndUpdateBtns();
|
||||||
|
_activePetModified = false;
|
||||||
|
_inventoryMC.petNameTxt.text = "";
|
||||||
|
_inventoryMC.butterfly.visible = true;
|
||||||
|
_inventoryMC.bMastery.visible = false;
|
||||||
|
_inventoryMC.certBtn.visible = false;
|
||||||
|
_inventoryMC.rare.visible = false;
|
||||||
|
_bigPet.destroy();
|
||||||
|
_bigPet = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_activePetModified = true;
|
||||||
|
_noCurrentActivePet = false;
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < _petList.length)
|
||||||
|
{
|
||||||
|
if(_loc3_ < _itemWindows.bg.numChildren)
|
||||||
|
{
|
||||||
|
_loc2_ = MovieClip(_itemWindows.bg.getChildAt(_loc3_));
|
||||||
|
_loc2_.cir.gotoAndStop("up");
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
param1.currentTarget.cir.gotoAndStop("downMouse");
|
||||||
|
_loc5_ = _petList[_idx];
|
||||||
|
_bigPet = new GuiPet(_loc5_.createdTs,_loc5_.idx,_loc5_.lBits,_loc5_.uBits,_loc5_.eBits,_loc5_.type,_loc5_.name,_loc5_.personalityDefId,_loc5_.favoriteToyDefId,_loc5_.favoriteFoodDefId,onBigPetLoaded);
|
||||||
|
_loc4_ = PetManager.getPetDef(_bigPet.getDefID());
|
||||||
|
_inventoryMC.itemWindowPet.addChild(_bigPet);
|
||||||
|
_inventoryMC.petNameTxt.text = _bigPet.petName;
|
||||||
|
AJClient.makeRenamable(_inventoryMC.petNameTxt,"p",_bigPet.idx,onPetRenamed,_inventoryMC);
|
||||||
|
_inventoryMC.butterfly.visible = false;
|
||||||
|
if(!_bigPet.isEggAndHasNotHatched())
|
||||||
|
{
|
||||||
|
_inventoryMC.certBtn.visible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_inventoryMC.certBtn.visible = false;
|
||||||
|
}
|
||||||
|
_inventoryMC.rare.visible = _loc4_ && _loc4_.status == 4;
|
||||||
|
if(_loc5_.masteryCounter >= 100)
|
||||||
|
{
|
||||||
|
_inventoryMC.bMastery.visible = true;
|
||||||
|
_inventoryMC.bMastery.icon.gotoAndStop(PetManager.petNameForDefId(_loc5_.defId) + "1");
|
||||||
|
if((_loc5_.uBits >> 8 & 0x0F) > 0)
|
||||||
|
{
|
||||||
|
_inventoryMC.bMastery.mouse.visible = false;
|
||||||
|
_inventoryMC.bMastery.down.visible = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_inventoryMC.bMastery.mouse.visible = true;
|
||||||
|
_inventoryMC.bMastery.down.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_inventoryMC.bMastery.visible = false;
|
||||||
|
_inventoryMC.bMastery.mouse.visible = true;
|
||||||
|
_inventoryMC.bMastery.down.visible = false;
|
||||||
|
}
|
||||||
|
_previousPetInvId = PetManager.myActivePetInvId;
|
||||||
|
if(_initialPetInvId == _loc5_.idx)
|
||||||
|
{
|
||||||
|
_idx = -1;
|
||||||
|
PetManager.myActivePetInvId = _initialPetInvId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PetManager.myActivePetInvId = _loc5_.idx;
|
||||||
|
}
|
||||||
|
GuiManager.resetPetWindowListAndUpdateBtns();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function winMouseOver(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(param1.currentTarget.hasPet)
|
||||||
|
{
|
||||||
|
if(param1.currentTarget.numChildren >= 1)
|
||||||
|
{
|
||||||
|
if(param1.currentTarget.cir.currentFrameLabel == "down")
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("downMouse");
|
||||||
|
}
|
||||||
|
else if(param1.currentTarget.cir.currentFrameLabel != "downMouse")
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("over");
|
||||||
|
}
|
||||||
|
AJAudio.playSubMenuBtnRollover();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function winMouseOut(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(param1.currentTarget.hasPet)
|
||||||
|
{
|
||||||
|
if(param1.currentTarget.numChildren >= 1)
|
||||||
|
{
|
||||||
|
if(param1.currentTarget.cir.currentFrameLabel == "downMouse")
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("down");
|
||||||
|
}
|
||||||
|
else if(param1.currentTarget.cir.currentFrameLabel != "down")
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("up");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onCageBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc2_:* = null;
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(_isRecycling)
|
||||||
|
{
|
||||||
|
_isRecycling = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_isRecycling = true;
|
||||||
|
}
|
||||||
|
_itemWindows.callUpdateInWindowWithInput({"isRecycling":_isRecycling});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onCageOverBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
GuiManager.toolTip.init(MovieClip(param1.currentTarget),LocalizationManager.translateIdOnly(14674),0,-30);
|
||||||
|
GuiManager.toolTip.startTimer(param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onCageOutBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
GuiManager.toolTip.resetTimerAndSetVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onMasteryBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
var _loc9_:int = 0;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
param1.stopPropagation();
|
||||||
|
var _loc4_:Object = _petList[_currSelectedIdx];
|
||||||
|
if(_loc4_ != null)
|
||||||
|
{
|
||||||
|
_loc6_ = _loc4_.uBits >> 8 & 0x0F;
|
||||||
|
if(_loc6_ > 0)
|
||||||
|
{
|
||||||
|
_loc6_ = 0;
|
||||||
|
param1.currentTarget.mouse.visible = true;
|
||||||
|
param1.currentTarget.down.visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc6_ = 1;
|
||||||
|
param1.currentTarget.mouse.visible = false;
|
||||||
|
param1.currentTarget.down.visible = true;
|
||||||
|
}
|
||||||
|
_loc5_ = int(_loc4_.uBits);
|
||||||
|
_loc8_ = _loc5_ & 0x0F;
|
||||||
|
_loc9_ = _loc5_ >> 4 & 0x0F;
|
||||||
|
_loc7_ = _loc5_ >> 12 & 0x0F;
|
||||||
|
_loc2_ = _loc5_ >> 16 & 0x0F;
|
||||||
|
_loc3_ = _loc5_ >> 20 & 0x0F;
|
||||||
|
_loc5_ = _loc3_ << 20 | _loc2_ << 16 | _loc7_ << 12 | _loc6_ << 8 | _loc9_ << 4 | _loc8_;
|
||||||
|
_loc4_.uBits = _loc6_ << 8 | _loc5_;
|
||||||
|
_itemWindows.callUpdateOnWindowWithInput(_currSelectedIdx,{"petObject":_loc4_});
|
||||||
|
_bigPet.updateAllBits(_loc4_.lBits,_loc4_.uBits,_loc4_.eBits);
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
PetXtCommManager.sendPetMasteryRequest(_loc6_,_loc4_.idx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function updateActivePet(param1:Boolean = false) : void
|
||||||
|
{
|
||||||
|
var _loc3_:Object = null;
|
||||||
|
var _loc2_:Function = null;
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
_loc2_ = onPetUpdate;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_ = onPetSwitch;
|
||||||
|
}
|
||||||
|
if(_idx > -1)
|
||||||
|
{
|
||||||
|
if(_petList && _petList.length > 0)
|
||||||
|
{
|
||||||
|
_loc3_ = _petList[_idx];
|
||||||
|
if(_loc3_ != null)
|
||||||
|
{
|
||||||
|
if(_activePetModified)
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
PetXtCommManager.sendPetSwitchRequest(_loc3_.idx,_loc2_);
|
||||||
|
_activePetModified = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(PetManager.myActivePetInvId == 0 && MovieClip(_itemWindows.bg.getChildAt(_idx)).cir.currentFrameLabel == "up" && !_noCurrentActivePet)
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
PetXtCommManager.sendPetSwitchRequest(0,_loc2_);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(AvatarManager.playerAvatarWorldView.getActivePet() != null)
|
||||||
|
{
|
||||||
|
if(_bigPet == null)
|
||||||
|
{
|
||||||
|
AvatarManager.playerAvatarWorldView.setActivePet(0,0,0,0,"",0,0,0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AvatarManager.playerAvatarWorldView.setActivePet(_bigPet.createdTs,_bigPet.getLBits(),_bigPet.getUBits(),_bigPet.getEBits(),_bigPet.petName,_bigPet.personalityDefId,_bigPet.favoriteFoodDefId,_bigPet.favoriteToyDefId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!param1)
|
||||||
|
{
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function reloadPets() : void
|
||||||
|
{
|
||||||
|
_petList = PetManager.myPetList.concat();
|
||||||
|
while(_inventoryMC.itemWindowPet.numChildren > 0)
|
||||||
|
{
|
||||||
|
_inventoryMC.itemWindowPet.removeChildAt(0);
|
||||||
|
}
|
||||||
|
var _loc1_:Object = PetManager.myActivePet;
|
||||||
|
if(_bigPet && _loc1_)
|
||||||
|
{
|
||||||
|
_bigPet = new GuiPet(_loc1_.createdTs,_loc1_.idx,_loc1_.lBits,_loc1_.uBits,_loc1_.eBits,_loc1_.type,_loc1_.name,_loc1_.personalityDefId,_loc1_.favoriteToyDefId,_loc1_.favoriteFoodDefId,onBigPetLoaded);
|
||||||
|
_inventoryMC.itemWindowPet.addChild(_bigPet);
|
||||||
|
_inventoryMC.petNameTxt.text = _bigPet.petName;
|
||||||
|
AJClient.makeRenamable(_inventoryMC.petNameTxt,"p",_bigPet.idx,onPetRenamed,_inventoryMC);
|
||||||
|
}
|
||||||
|
_inventoryMC.butterfly.visible = false;
|
||||||
|
createItemWindows();
|
||||||
|
if(_bigPet && AvatarManager.playerAvatarWorldView.getActivePet() != null)
|
||||||
|
{
|
||||||
|
AvatarManager.playerAvatarWorldView.setActivePet(_bigPet.createdTs,_bigPet.getLBits(),_bigPet.getUBits(),_bigPet.getEBits(),_bigPet.petName,_bigPet.personalityDefId,_bigPet.favoriteFoodDefId,_bigPet.favoriteToyDefId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPetUpdate(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Object = null;
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
_loc2_ = {"typeDefId":52};
|
||||||
|
MinigameManager.handleGameClick(_loc2_,null,false,reloadPets);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onClose(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
updateActivePet();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onShopBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
_shop = new Shop();
|
||||||
|
if(AvatarManager.roomEnviroType == 1)
|
||||||
|
{
|
||||||
|
_shop.init(89,1030,AvatarManager.playerAvatar,_guiLayer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_shop.init(85,1030,AvatarManager.playerAvatar,_guiLayer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onSalonBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
var _loc2_:Object = _petList[_currSelectedIdx];
|
||||||
|
if(_loc2_ != null && _loc2_.denStoreInvId > 0)
|
||||||
|
{
|
||||||
|
new SBYesNoPopup(_guiLayer,LocalizationManager.translateIdOnly(34045),true,onConfirmRemovePetFromStore);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updateActivePet(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onConfirmRemovePetFromStore(param1:Object) : void
|
||||||
|
{
|
||||||
|
var _loc4_:Object = null;
|
||||||
|
var _loc3_:* = undefined;
|
||||||
|
var _loc2_:PetItem = null;
|
||||||
|
if(param1.status)
|
||||||
|
{
|
||||||
|
_loc4_ = _petList[_currSelectedIdx];
|
||||||
|
_loc3_ = new Vector.<MyShopItem>();
|
||||||
|
_loc2_ = new PetItem();
|
||||||
|
_loc2_.init(_loc4_.createdTs,_loc4_.defId,[_loc4_.lBits,_loc4_.uBits,_loc4_.eBits],_loc4_.personalityDefId,_loc4_.favoriteToyDefId,_loc4_.favoriteFoodDefId,_loc4_.idx,_loc4_.name,false,null,DiamondXtCommManager.getDiamondItem(DiamondXtCommManager.getDiamondDefIdByRefId(_loc4_.defId,2)),_loc4_.denStoreInvId);
|
||||||
|
_loc3_.push(new MyShopItem(_loc2_,0,0,_loc4_.denStoreInvId));
|
||||||
|
ShopManager.findAndRemoveDenShopItems(_loc3_,onRemovalComplete,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRemovalComplete(param1:Boolean, param2:Object) : void
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
_petList[_currSelectedIdx].denStoreInvId = 0;
|
||||||
|
onSalonBtn(null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new SBOkPopup(_guiLayer,LocalizationManager.translateIdOnly(24788));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPopup(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onChecklistBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
if(_checkListPopup)
|
||||||
|
{
|
||||||
|
onCheckListClose();
|
||||||
|
}
|
||||||
|
_checkListPopup = new CheckListPopup();
|
||||||
|
_checkListPopup.init(onCheckListClose);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onCheckListClose() : void
|
||||||
|
{
|
||||||
|
if(_checkListPopup)
|
||||||
|
{
|
||||||
|
_checkListPopup.destroy();
|
||||||
|
_checkListPopup = null;
|
||||||
|
}
|
||||||
|
_inventoryMC.newBurst.visible = AdoptAPetManager.hasUnseenPetData;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onCertBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(_bigPet)
|
||||||
|
{
|
||||||
|
GuiManager.openPetCertificatePopup(_bigPet,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addEventListeners() : void
|
||||||
|
{
|
||||||
|
_inventoryMC.addEventListener("mouseDown",onPopup,false,0,true);
|
||||||
|
_inventoryMC.bx.addEventListener("mouseDown",onClose,false,0,true);
|
||||||
|
_inventoryMC.cageBtn.addEventListener("mouseDown",onCageBtn,false,0,true);
|
||||||
|
_inventoryMC.cageBtn.addEventListener("mouseOver",onCageOverBtn,false,0,true);
|
||||||
|
_inventoryMC.cageBtn.addEventListener("mouseOut",onCageOutBtn,false,0,true);
|
||||||
|
_inventoryMC.bMastery.addEventListener("mouseDown",onMasteryBtn,false,0,true);
|
||||||
|
_inventoryMC.shopBtn.addEventListener("mouseDown",onShopBtn,false,0,true);
|
||||||
|
_inventoryMC.salonBtn.addEventListener("mouseDown",onSalonBtn,false,0,true);
|
||||||
|
_inventoryMC.checklistBtn.addEventListener("mouseDown",onChecklistBtn,false,0,true);
|
||||||
|
_inventoryMC.certBtn.addEventListener("mouseDown",onCertBtn,false,0,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function removeEventListeners() : void
|
||||||
|
{
|
||||||
|
_inventoryMC.removeEventListener("mouseDown",onPopup);
|
||||||
|
_inventoryMC.bx.removeEventListener("mouseDown",onClose);
|
||||||
|
_inventoryMC.cageBtn.removeEventListener("mouseDown",onCageBtn);
|
||||||
|
_inventoryMC.cageBtn.removeEventListener("mouseOver",onCageOverBtn);
|
||||||
|
_inventoryMC.cageBtn.removeEventListener("mouseOut",onCageOutBtn);
|
||||||
|
_inventoryMC.bMastery.removeEventListener("mouseDown",onMasteryBtn);
|
||||||
|
_inventoryMC.shopBtn.removeEventListener("mouseDown",onShopBtn);
|
||||||
|
_inventoryMC.salonBtn.removeEventListener("mouseDown",onSalonBtn);
|
||||||
|
_inventoryMC.checklistBtn.removeEventListener("mouseDown",onChecklistBtn);
|
||||||
|
_inventoryMC.certBtn.removeEventListener("mouseDown",onCertBtn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
package gui
|
||||||
|
{
|
||||||
|
import avatar.AvatarXtCommManager;
|
||||||
|
import avatar.UserInfo;
|
||||||
|
import buddy.Buddy;
|
||||||
|
import buddy.BuddyManager;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.events.KeyboardEvent;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import loader.MediaHelper;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
|
||||||
|
public class PlayerSearch
|
||||||
|
{
|
||||||
|
|
||||||
|
public static const SEARCH_MEDIA_ID:int = 396;
|
||||||
|
|
||||||
|
public static const LOADING_SPIRAL_ID:int = 397;
|
||||||
|
|
||||||
|
private var _searchPopup:MovieClip;
|
||||||
|
|
||||||
|
private var _searchMediaHelper:MediaHelper;
|
||||||
|
|
||||||
|
private var _lastSearchedName:String;
|
||||||
|
|
||||||
|
private var _closeCallback:Function;
|
||||||
|
|
||||||
|
public function PlayerSearch()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:Function) : void
|
||||||
|
{
|
||||||
|
_closeCallback = param1;
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
_searchMediaHelper = new MediaHelper();
|
||||||
|
_searchMediaHelper.init(396,searchMediaCallback,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Function = null;
|
||||||
|
if(_closeCallback != null)
|
||||||
|
{
|
||||||
|
_loc1_ = _closeCallback;
|
||||||
|
_closeCallback = null;
|
||||||
|
_loc1_();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_searchMediaHelper.destroy();
|
||||||
|
if(_searchPopup)
|
||||||
|
{
|
||||||
|
removeListeners();
|
||||||
|
GuiManager.guiLayer.removeChild(_searchPopup);
|
||||||
|
DarkenManager.unDarken(_searchPopup);
|
||||||
|
_searchPopup = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function searchMediaCallback(param1:MovieClip) : void
|
||||||
|
{
|
||||||
|
_searchPopup = MovieClip(param1.getChildAt(0));
|
||||||
|
_searchPopup.x = 900 * 0.5;
|
||||||
|
_searchPopup.y = 550 * 0.5;
|
||||||
|
GuiManager.guiLayer.addChild(_searchPopup);
|
||||||
|
addListeners();
|
||||||
|
setInitialConditions();
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
DarkenManager.darken(_searchPopup);
|
||||||
|
_searchMediaHelper = new MediaHelper();
|
||||||
|
_searchMediaHelper.init(397,loadingSpiralCallback,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function loadingSpiralCallback(param1:MovieClip) : void
|
||||||
|
{
|
||||||
|
if(_searchPopup)
|
||||||
|
{
|
||||||
|
_searchPopup.itemBlock.addChild(param1);
|
||||||
|
_searchPopup.itemBlock.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setInitialConditions() : void
|
||||||
|
{
|
||||||
|
_searchPopup.userNameTxt.text = "";
|
||||||
|
_searchPopup.userNameTxt.restrict = "^%";
|
||||||
|
_searchPopup.userNameTxt.maxChars = 32;
|
||||||
|
gMainFrame.stage.focus = _searchPopup.userNameTxt;
|
||||||
|
_searchPopup.notFoundTab.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function popupCloseHandler(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onSearchBtnHandler(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
performSearch();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function keyDownListener(param1:KeyboardEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(param1.keyCode == 13)
|
||||||
|
{
|
||||||
|
performSearch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function performSearch() : void
|
||||||
|
{
|
||||||
|
var _loc1_:Buddy = null;
|
||||||
|
_searchPopup.notFoundTab.visible = true;
|
||||||
|
LocalizationManager.translateId(_searchPopup.notFoundTab.getChildAt(1),11369);
|
||||||
|
var _loc3_:String = _searchPopup.userNameTxt.text;
|
||||||
|
var _loc2_:String = _loc3_.toLowerCase();
|
||||||
|
if(_lastSearchedName != _loc2_)
|
||||||
|
{
|
||||||
|
_lastSearchedName = _loc2_;
|
||||||
|
_loc1_ = BuddyManager.getBuddyByUserName(_loc2_);
|
||||||
|
if(_loc1_)
|
||||||
|
{
|
||||||
|
_searchPopup.notFoundTab.visible = false;
|
||||||
|
BuddyManager.showBuddyCard({
|
||||||
|
"userName":_loc1_.userName,
|
||||||
|
"onlineStatus":_loc1_.onlineStatus
|
||||||
|
});
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_searchPopup.notFoundTab.visible = false;
|
||||||
|
_searchPopup.itemBlock.visible = true;
|
||||||
|
AvatarXtCommManager.requestAvatarGet(_loc3_,onUserLookUpReceived,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onUserLookUpReceived(param1:String, param2:Boolean, param3:int) : void
|
||||||
|
{
|
||||||
|
var _loc4_:UserInfo = null;
|
||||||
|
if(_searchPopup)
|
||||||
|
{
|
||||||
|
_searchPopup.itemBlock.visible = false;
|
||||||
|
_loc4_ = gMainFrame.userInfo.getUserInfoByUserName(param1);
|
||||||
|
if(param2)
|
||||||
|
{
|
||||||
|
if(_loc4_)
|
||||||
|
{
|
||||||
|
if(_loc4_.userNameModeratedFlag > 0 && param1.toLowerCase() == _searchPopup.userNameTxt.text.toLowerCase())
|
||||||
|
{
|
||||||
|
BuddyManager.showBuddyCard({
|
||||||
|
"userName":param1,
|
||||||
|
"onlineStatus":param3
|
||||||
|
});
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_searchPopup.notFoundTab.visible = true;
|
||||||
|
gMainFrame.stage.focus = _searchPopup.userNameTxt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BuddyManager.showBuddyCard({
|
||||||
|
"userName":param1,
|
||||||
|
"onlineStatus":param3
|
||||||
|
});
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param3 == -3)
|
||||||
|
{
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_searchPopup.notFoundTab.visible = true;
|
||||||
|
gMainFrame.stage.focus = _searchPopup.userNameTxt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPopup(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addListeners() : void
|
||||||
|
{
|
||||||
|
_searchPopup["bx"].addEventListener("mouseDown",popupCloseHandler,false,0,true);
|
||||||
|
_searchPopup.searchBtn.addEventListener("mouseDown",onSearchBtnHandler,false,0,true);
|
||||||
|
_searchPopup.userNameTxt.addEventListener("keyDown",keyDownListener,false,0,true);
|
||||||
|
_searchPopup.addEventListener("mouseDown",onPopup,false,0,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function removeListeners() : void
|
||||||
|
{
|
||||||
|
_searchPopup["bx"].removeEventListener("mouseDown",popupCloseHandler);
|
||||||
|
_searchPopup.searchBtn.removeEventListener("mouseDown",onSearchBtnHandler);
|
||||||
|
_searchPopup.userNameTxt.removeEventListener("keyDown",keyDownListener);
|
||||||
|
_searchPopup.addEventListener("mouseDown",onPopup,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,237 @@
|
|||||||
|
package playerWall
|
||||||
|
{
|
||||||
|
public class PostMessage
|
||||||
|
{
|
||||||
|
|
||||||
|
private var _message:String;
|
||||||
|
|
||||||
|
private var _senderUserName:String;
|
||||||
|
|
||||||
|
private var _patternId:int;
|
||||||
|
|
||||||
|
private var _colorId:int;
|
||||||
|
|
||||||
|
private var _msgId:String;
|
||||||
|
|
||||||
|
private var _postTime:Number;
|
||||||
|
|
||||||
|
private var _isBuddy:Boolean;
|
||||||
|
|
||||||
|
private var _senderModeratedUserName:String;
|
||||||
|
|
||||||
|
private var _avtDefId:int;
|
||||||
|
|
||||||
|
private var _avtColors:Array;
|
||||||
|
|
||||||
|
private var _avtEyeDefId:int;
|
||||||
|
|
||||||
|
private var _avtPatternDefId:int;
|
||||||
|
|
||||||
|
private var _senderDbId:int;
|
||||||
|
|
||||||
|
private var _localizationId:int;
|
||||||
|
|
||||||
|
private var _avtCustomId:int;
|
||||||
|
|
||||||
|
private var _parentMessageId:String;
|
||||||
|
|
||||||
|
private var _senderUUID:String;
|
||||||
|
|
||||||
|
private var _isRead:Boolean;
|
||||||
|
|
||||||
|
public function PostMessage(param1:String, param2:String, param3:int, param4:String, param5:String, param6:int, param7:int, param8:Number, param9:Boolean, param10:int, param11:Array, param12:int, param13:int, param14:int, param15:int, param16:String, param17:String, param18:Boolean)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
_msgId = param1;
|
||||||
|
// through the reader's chat filter (AJClient.filterText).
|
||||||
|
_message = AJClient.filterOrNote(param2);
|
||||||
|
_senderDbId = param3;
|
||||||
|
_senderUserName = param4;
|
||||||
|
_patternId = param6;
|
||||||
|
_colorId = param7;
|
||||||
|
_postTime = param8;
|
||||||
|
_isBuddy = param9;
|
||||||
|
_senderModeratedUserName = param5;
|
||||||
|
_avtDefId = param10;
|
||||||
|
_avtColors = param11;
|
||||||
|
_avtEyeDefId = param12;
|
||||||
|
_avtPatternDefId = param13;
|
||||||
|
_avtCustomId = param15;
|
||||||
|
_localizationId = param14;
|
||||||
|
_parentMessageId = param16;
|
||||||
|
_senderUUID = param17;
|
||||||
|
_isRead = param18;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get msgId() : String
|
||||||
|
{
|
||||||
|
return _msgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get message() : String
|
||||||
|
{
|
||||||
|
return _message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get senderDbId() : int
|
||||||
|
{
|
||||||
|
return _senderDbId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get senderUserName() : String
|
||||||
|
{
|
||||||
|
return _senderUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get senderModeratedUserName() : String
|
||||||
|
{
|
||||||
|
return _senderModeratedUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get patternId() : int
|
||||||
|
{
|
||||||
|
return _patternId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get colorId() : int
|
||||||
|
{
|
||||||
|
return _colorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get postTime() : Number
|
||||||
|
{
|
||||||
|
return _postTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isBuddy() : Boolean
|
||||||
|
{
|
||||||
|
return _isBuddy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get avtDefId() : int
|
||||||
|
{
|
||||||
|
return _avtDefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get avtColors() : Array
|
||||||
|
{
|
||||||
|
return _avtColors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get avtEyeDefId() : int
|
||||||
|
{
|
||||||
|
return _avtEyeDefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get avtPatternDefId() : int
|
||||||
|
{
|
||||||
|
return _avtPatternDefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get localizationId() : int
|
||||||
|
{
|
||||||
|
return _localizationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get avtCustomId() : int
|
||||||
|
{
|
||||||
|
return _avtCustomId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get parentMessageId() : String
|
||||||
|
{
|
||||||
|
return _parentMessageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get senderUUID() : String
|
||||||
|
{
|
||||||
|
return _senderUUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get isRead() : Boolean
|
||||||
|
{
|
||||||
|
return _isRead;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set msgId(param1:String) : void
|
||||||
|
{
|
||||||
|
_msgId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set message(param1:String) : void
|
||||||
|
{
|
||||||
|
_message = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set senderDbId(param1:int) : void
|
||||||
|
{
|
||||||
|
_senderDbId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set senderUserName(param1:String) : void
|
||||||
|
{
|
||||||
|
_senderUserName = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set senderModeratedUserName(param1:String) : void
|
||||||
|
{
|
||||||
|
_senderModeratedUserName = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set patternId(param1:int) : void
|
||||||
|
{
|
||||||
|
_patternId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set colorId(param1:int) : void
|
||||||
|
{
|
||||||
|
_colorId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set postTime(param1:Number) : void
|
||||||
|
{
|
||||||
|
_postTime = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set isBuddy(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
_isBuddy = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set avtDefId(param1:int) : void
|
||||||
|
{
|
||||||
|
_avtDefId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set avtColors(param1:Array) : void
|
||||||
|
{
|
||||||
|
_avtColors = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set avtEyeDefId(param1:int) : void
|
||||||
|
{
|
||||||
|
_avtEyeDefId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set avtPatternDefId(param1:int) : void
|
||||||
|
{
|
||||||
|
_avtPatternDefId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set localizationId(param1:int) : void
|
||||||
|
{
|
||||||
|
_localizationId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set avtCustomId(param1:int) : void
|
||||||
|
{
|
||||||
|
_avtCustomId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set isRead(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
_isRead = param1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,999 @@
|
|||||||
|
package gui
|
||||||
|
{
|
||||||
|
import achievement.AchievementXtCommManager;
|
||||||
|
import com.sbi.prediction.Predictions;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.events.Event;
|
||||||
|
import flash.events.KeyboardEvent;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import flash.text.TextField;
|
||||||
|
import flash.text.TextFormat;
|
||||||
|
import flash.utils.ByteArray;
|
||||||
|
import flash.utils.setTimeout;
|
||||||
|
import loader.DefPacksDefHelper;
|
||||||
|
import loader.MediaHelper;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
|
||||||
|
public class PredictiveTextManager
|
||||||
|
{
|
||||||
|
|
||||||
|
public static const USE_TYPE_ALL:int = 0;
|
||||||
|
|
||||||
|
public static const USE_TYPE_ECARD:int = 1;
|
||||||
|
|
||||||
|
public static const USE_TYPE_PLAYER_WALL:int = 2;
|
||||||
|
|
||||||
|
public static var dictionaryBlob:ByteArray;
|
||||||
|
|
||||||
|
public static var onDictionaryBlobLoaded:Function;
|
||||||
|
|
||||||
|
private static var _lastRequestedLanguage:int;
|
||||||
|
|
||||||
|
private static var _hasRequestedDictionaryBlob:Boolean;
|
||||||
|
|
||||||
|
private var _chatMsgText:TextField;
|
||||||
|
|
||||||
|
private var _predictiveTextMC:MovieClip;
|
||||||
|
|
||||||
|
private var _specialCharTextMC:MovieClip;
|
||||||
|
|
||||||
|
private var _chatBar:MovieClip;
|
||||||
|
|
||||||
|
private var _sendMsgCallback:Function;
|
||||||
|
|
||||||
|
private var _completeSuggestionCallback:Function;
|
||||||
|
|
||||||
|
private var _specialCharWindow:WindowGenerator;
|
||||||
|
|
||||||
|
private var _predictiveTextOriginalYLoc:Number;
|
||||||
|
|
||||||
|
private var _specialCharStartPositionX:int;
|
||||||
|
|
||||||
|
private var _useType:int;
|
||||||
|
|
||||||
|
private var _predictions:Predictions;
|
||||||
|
|
||||||
|
private var _currSuggestions:Array;
|
||||||
|
|
||||||
|
private var _unapprovedChatPopup:MovieClip;
|
||||||
|
|
||||||
|
private var _mediaHelper:MediaHelper;
|
||||||
|
|
||||||
|
public function PredictiveTextManager()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get lastRequestedPredictiveLanguage() : int
|
||||||
|
{
|
||||||
|
return _lastRequestedLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get hasRequestDictionaryBlob() : Boolean
|
||||||
|
{
|
||||||
|
return _hasRequestedDictionaryBlob;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function resetDictionaryBlob() : void
|
||||||
|
{
|
||||||
|
dictionaryBlob = null;
|
||||||
|
_hasRequestedDictionaryBlob = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:TextField, param2:int = 0, param3:MovieClip = null, param4:MovieClip = null, param5:int = 0, param6:MovieClip = null, param7:Function = null, param8:Function = null) : void
|
||||||
|
{
|
||||||
|
_chatBar = param6;
|
||||||
|
_chatMsgText = param1;
|
||||||
|
_predictiveTextMC = param3;
|
||||||
|
_specialCharTextMC = param4;
|
||||||
|
_sendMsgCallback = param7;
|
||||||
|
_completeSuggestionCallback = param8;
|
||||||
|
_specialCharStartPositionX = param5;
|
||||||
|
_useType = param2;
|
||||||
|
_chatMsgText.restrict = "^%";
|
||||||
|
if(_predictiveTextMC)
|
||||||
|
{
|
||||||
|
_predictiveTextMC.gotoAndStop(3);
|
||||||
|
_predictiveTextMC.visible = false;
|
||||||
|
_predictiveTextMC["predictTxtTag0"].addEventListener("mouseDown",onPredictiveTag,false,0,true);
|
||||||
|
_predictiveTextMC["predictTxtTag1"].addEventListener("mouseDown",onPredictiveTag,false,0,true);
|
||||||
|
_predictiveTextMC["predictTxtTag2"].addEventListener("mouseDown",onPredictiveTag,false,0,true);
|
||||||
|
if(!("originalYLoc" in _predictiveTextMC))
|
||||||
|
{
|
||||||
|
_predictiveTextOriginalYLoc = _predictiveTextMC.y;
|
||||||
|
_predictiveTextMC.originalYLoc = _predictiveTextOriginalYLoc;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_predictiveTextOriginalYLoc = _predictiveTextMC.originalYLoc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_specialCharTextMC)
|
||||||
|
{
|
||||||
|
_specialCharTextMC.visible = false;
|
||||||
|
}
|
||||||
|
_chatMsgText.defaultTextFormat.color = 4531987;
|
||||||
|
_chatMsgText.tabEnabled = false;
|
||||||
|
if(dictionaryBlob == null)
|
||||||
|
{
|
||||||
|
loadDictionaryBlob();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_predictions = new Predictions();
|
||||||
|
_predictions.setDictionary(dictionaryBlob);
|
||||||
|
resetTreeSearch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isAllowedFreeChat() : Boolean
|
||||||
|
{
|
||||||
|
return _useType == 0 && (gMainFrame.userInfo.sgChatType == 1 && LocalizationManager.currentLanguage == LocalizationManager.accountLanguage && LocalizationManager.currentLanguage == LocalizationManager.LANG_ENG);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function loadDictionaryBlob() : void
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
_hasRequestedDictionaryBlob = true;
|
||||||
|
var _loc1_:DefPacksDefHelper = new DefPacksDefHelper();
|
||||||
|
_loc1_.init("10" + LocalizationManager.currentLanguage + ".dict",wordListResponse,null,1);
|
||||||
|
DefPacksDefHelper.mediaArray["10" + LocalizationManager.currentLanguage] = _loc1_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reload(param1:TextField, param2:MovieClip = null, param3:MovieClip = null, param4:MovieClip = null) : void
|
||||||
|
{
|
||||||
|
_chatBar = param4;
|
||||||
|
_chatMsgText = param1;
|
||||||
|
if(_predictiveTextMC)
|
||||||
|
{
|
||||||
|
_predictiveTextMC["predictTxtTag0"].removeEventListener("mouseDown",onPredictiveTag);
|
||||||
|
_predictiveTextMC["predictTxtTag1"].removeEventListener("mouseDown",onPredictiveTag);
|
||||||
|
_predictiveTextMC["predictTxtTag2"].removeEventListener("mouseDown",onPredictiveTag);
|
||||||
|
}
|
||||||
|
_predictiveTextMC = param2;
|
||||||
|
_specialCharTextMC = param3;
|
||||||
|
if(_predictiveTextMC)
|
||||||
|
{
|
||||||
|
_predictiveTextMC.visible = false;
|
||||||
|
_predictiveTextMC["predictTxtTag0"].addEventListener("mouseDown",onPredictiveTag,false,0,true);
|
||||||
|
_predictiveTextMC["predictTxtTag1"].addEventListener("mouseDown",onPredictiveTag,false,0,true);
|
||||||
|
_predictiveTextMC["predictTxtTag2"].addEventListener("mouseDown",onPredictiveTag,false,0,true);
|
||||||
|
}
|
||||||
|
if(_specialCharTextMC)
|
||||||
|
{
|
||||||
|
_specialCharTextMC.visible = false;
|
||||||
|
}
|
||||||
|
_chatMsgText.defaultTextFormat.color = 4531987;
|
||||||
|
_chatMsgText.tabEnabled = false;
|
||||||
|
if(dictionaryBlob == null)
|
||||||
|
{
|
||||||
|
loadDictionaryBlob();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resetTreeSearch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
if(_predictiveTextMC)
|
||||||
|
{
|
||||||
|
_predictiveTextMC["predictTxtTag0"].removeEventListener("mouseDown",onPredictiveTag);
|
||||||
|
_predictiveTextMC["predictTxtTag1"].removeEventListener("mouseDown",onPredictiveTag);
|
||||||
|
_predictiveTextMC["predictTxtTag2"].removeEventListener("mouseDown",onPredictiveTag);
|
||||||
|
}
|
||||||
|
_chatBar = null;
|
||||||
|
_chatMsgText = null;
|
||||||
|
_predictiveTextMC = null;
|
||||||
|
_specialCharTextMC = null;
|
||||||
|
_sendMsgCallback = null;
|
||||||
|
_completeSuggestionCallback = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addWordToPredictiveText(param1:String) : void
|
||||||
|
{
|
||||||
|
if(_predictiveTextMC)
|
||||||
|
{
|
||||||
|
if(_completeSuggestionCallback != null)
|
||||||
|
{
|
||||||
|
_completeSuggestionCallback(param1,false,false,onPredictiveTxtTagWork);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
onPredictiveTxtTagWork(param1,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onTextClick() : void
|
||||||
|
{
|
||||||
|
predictWordAndHandleResults(getCurrentWord());
|
||||||
|
setPredictiveTextField();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onTextFieldChanged(param1:Event, param2:Boolean = false) : void
|
||||||
|
{
|
||||||
|
var _loc3_:Array = null;
|
||||||
|
var _loc5_:String = null;
|
||||||
|
var _loc4_:String = null;
|
||||||
|
var _loc6_:String = null;
|
||||||
|
var _loc7_:String = null;
|
||||||
|
if(_chatMsgText.text == "")
|
||||||
|
{
|
||||||
|
resetTreeSearch();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!param2 && _chatMsgText.text.length > 0 && _chatMsgText.multiline)
|
||||||
|
{
|
||||||
|
_loc3_ = _chatMsgText.text.split(/\r|\n|\r\r/gim);
|
||||||
|
if(_loc3_.length > 1)
|
||||||
|
{
|
||||||
|
_chatMsgText.text = _loc3_.join("");
|
||||||
|
_chatMsgText.setSelection(_chatMsgText.caretIndex - 1,_chatMsgText.caretIndex - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!param2)
|
||||||
|
{
|
||||||
|
setTimeout(onTextFieldChanged,1,param1,true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loc5_ = _chatMsgText.text.charAt(_chatMsgText.caretIndex - 1);
|
||||||
|
_loc4_ = String.fromCharCode(_predictions.getRootFormOfChar(_chatMsgText.text.charCodeAt(_chatMsgText.caretIndex - 1)));
|
||||||
|
if(_loc4_ != null && _loc4_ != "" && _loc4_ != _loc5_)
|
||||||
|
{
|
||||||
|
if(_loc4_ == _chatMsgText.text.charAt(_chatMsgText.caretIndex - 2))
|
||||||
|
{
|
||||||
|
_chatMsgText.text = _chatMsgText.text.substring(0,_chatMsgText.caretIndex - 2) + _loc5_ + _chatMsgText.text.substring(_chatMsgText.caretIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc6_ = String.fromCharCode(_loc4_);
|
||||||
|
_loc7_ = getCurrentWord();
|
||||||
|
if(_loc7_.length != 0)
|
||||||
|
{
|
||||||
|
predictWordAndHandleResults(_loc7_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
checkEveryWordAndSetFormat();
|
||||||
|
}
|
||||||
|
setPredictiveTextField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function predictWordAndHandleResults(param1:String) : void
|
||||||
|
{
|
||||||
|
var _loc3_:Boolean = false;
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
if(dictionaryBlob == null)
|
||||||
|
{
|
||||||
|
loadDictionaryBlob();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_currSuggestions = _predictions.predict(param1,3,50,100,_useType);
|
||||||
|
if(_currSuggestions.length > 0)
|
||||||
|
{
|
||||||
|
_loc3_ = shouldCapitalizeCurrWord(param1);
|
||||||
|
if(_loc3_)
|
||||||
|
{
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < _currSuggestions.length)
|
||||||
|
{
|
||||||
|
_currSuggestions[_loc2_][0] = _currSuggestions[_loc2_][0].toUpperCase();
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
checkEveryWordAndSetFormat();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onKeyDown(param1:KeyboardEvent) : void
|
||||||
|
{
|
||||||
|
if(param1.keyCode != 13 && param1.keyCode != 8 && _chatMsgText.length >= _chatMsgText.maxChars)
|
||||||
|
{
|
||||||
|
AJAudio.playLimitedChatErrorSound();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1.keyCode == 9 || param1.keyCode == 32)
|
||||||
|
{
|
||||||
|
onPredictiveTag(null,param1.keyCode == 32);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1.keyCode == 13)
|
||||||
|
{
|
||||||
|
onSendBtnDown(null,_chatMsgText.text);
|
||||||
|
AJAudio.playTextEnter();
|
||||||
|
}
|
||||||
|
else if(param1.keyCode > 36 && param1.keyCode < 41)
|
||||||
|
{
|
||||||
|
onTextFieldChanged(null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AJAudio.playTextType();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetTreeSearch() : void
|
||||||
|
{
|
||||||
|
var _loc1_:TextFormat = _chatMsgText.defaultTextFormat;
|
||||||
|
_chatMsgText.setTextFormat(_loc1_);
|
||||||
|
if(_specialCharTextMC)
|
||||||
|
{
|
||||||
|
_specialCharTextMC.visible = false;
|
||||||
|
}
|
||||||
|
if(_predictiveTextMC)
|
||||||
|
{
|
||||||
|
_predictiveTextMC.y = _predictiveTextOriginalYLoc;
|
||||||
|
_predictiveTextMC.visible = false;
|
||||||
|
}
|
||||||
|
if(_chatBar && _chatBar.chatBGColor)
|
||||||
|
{
|
||||||
|
_chatBar.chatBGColor.white.visible = true;
|
||||||
|
}
|
||||||
|
if(_specialCharTextMC)
|
||||||
|
{
|
||||||
|
while(_specialCharTextMC.itemWindow.numChildren > 1)
|
||||||
|
{
|
||||||
|
_specialCharTextMC.itemWindow.removeChildAt(_specialCharTextMC.itemWindow.numChildren - 1);
|
||||||
|
}
|
||||||
|
_specialCharTextMC.x = _specialCharStartPositionX;
|
||||||
|
}
|
||||||
|
_chatMsgText.scrollV = 0;
|
||||||
|
_chatMsgText.text = "";
|
||||||
|
_currSuggestions = [];
|
||||||
|
if(_chatBar && _chatBar.predictTxt_popup.currentFrameLabel != "close")
|
||||||
|
{
|
||||||
|
_chatBar.predictTxt_popup.gotoAndStop("close");
|
||||||
|
}
|
||||||
|
_chatMsgText.setSelection(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onSendBtnDown(param1:MouseEvent, param2:String = null) : void
|
||||||
|
{
|
||||||
|
if(_chatMsgText.text.length > 0 && _chatMsgText.text.match(/\S/g).length > 0)
|
||||||
|
{
|
||||||
|
if(isValid())
|
||||||
|
{
|
||||||
|
if(_sendMsgCallback != null)
|
||||||
|
{
|
||||||
|
if(_sendMsgCallback.length > 1)
|
||||||
|
{
|
||||||
|
_sendMsgCallback(param1,param2 == null ? "" : param2);
|
||||||
|
}
|
||||||
|
else if(_sendMsgCallback.length == 1)
|
||||||
|
{
|
||||||
|
_sendMsgCallback(param1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_sendMsgCallback();
|
||||||
|
}
|
||||||
|
resetTreeSearch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
showUnapprovedChatPopup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function wordListResponse(param1:DefPacksDefHelper) : void
|
||||||
|
{
|
||||||
|
DefPacksDefHelper.mediaArray["10" + LocalizationManager.currentLanguage] = null;
|
||||||
|
dictionaryBlob = ByteArray(param1.def);
|
||||||
|
_lastRequestedLanguage = LocalizationManager.currentLanguage;
|
||||||
|
_predictions = new Predictions();
|
||||||
|
_predictions.setDictionary(dictionaryBlob);
|
||||||
|
resetTreeSearch();
|
||||||
|
if(onDictionaryBlobLoaded != null)
|
||||||
|
{
|
||||||
|
onDictionaryBlobLoaded();
|
||||||
|
onDictionaryBlobLoaded = null;
|
||||||
|
}
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function showPredictiveChatBaloons() : Boolean
|
||||||
|
{
|
||||||
|
if(gMainFrame.userInfo.sgChatType == 1)
|
||||||
|
{
|
||||||
|
if(!Utility.hasChatSettingBeenSet())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Utility.isSettingOn(MySettings.SETTINGS_CHAT_PREDICTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPredictiveTag(param1:MouseEvent, param2:Boolean = false) : void
|
||||||
|
{
|
||||||
|
var _loc3_:String = null;
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
_loc3_ = param1.currentTarget.down.txt.text;
|
||||||
|
}
|
||||||
|
else if(_currSuggestions && _currSuggestions[0] && _currSuggestions[0][3] == true)
|
||||||
|
{
|
||||||
|
_loc3_ = _currSuggestions[0][0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc3_ = "";
|
||||||
|
}
|
||||||
|
_currSuggestions = [];
|
||||||
|
if(_predictiveTextMC && _predictiveTextMC.visible)
|
||||||
|
{
|
||||||
|
if(_loc3_.length > 0)
|
||||||
|
{
|
||||||
|
if(_completeSuggestionCallback != null)
|
||||||
|
{
|
||||||
|
_completeSuggestionCallback(_loc3_,false,param2,onPredictiveTxtTagWork);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
onPredictiveTxtTagWork(_loc3_,param2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
checkEveryWordAndSetFormat();
|
||||||
|
if(_predictiveTextMC)
|
||||||
|
{
|
||||||
|
_predictiveTextMC.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPredictiveTxtTagWork(param1:String, param2:Boolean = false, param3:Boolean = true) : void
|
||||||
|
{
|
||||||
|
if(param1.length > 0)
|
||||||
|
{
|
||||||
|
AJAudio.playTextType();
|
||||||
|
if(param3)
|
||||||
|
{
|
||||||
|
if(!param2)
|
||||||
|
{
|
||||||
|
param1 += " ";
|
||||||
|
}
|
||||||
|
findStartOfWordAndReplaceOrUpdate(param1,true,true,param2);
|
||||||
|
}
|
||||||
|
checkEveryWordAndSetFormat();
|
||||||
|
if(_predictiveTextMC)
|
||||||
|
{
|
||||||
|
_predictiveTextMC.visible = false;
|
||||||
|
}
|
||||||
|
if(_completeSuggestionCallback != null)
|
||||||
|
{
|
||||||
|
_completeSuggestionCallback("",true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setPredictiveTextField() : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc1_:String = null;
|
||||||
|
if(_predictiveTextMC)
|
||||||
|
{
|
||||||
|
if(showPredictiveChatBaloons() && _chatMsgText.length > 0 && _currSuggestions.length > 0)
|
||||||
|
{
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < 3)
|
||||||
|
{
|
||||||
|
if(_currSuggestions[_loc2_])
|
||||||
|
{
|
||||||
|
_loc1_ = _currSuggestions[_loc2_][0];
|
||||||
|
if(_loc1_ != null && _loc1_ != " ")
|
||||||
|
{
|
||||||
|
GuiSoundBtnSubMenu(_predictiveTextMC["predictTxtTag" + _loc2_]).setTextInLayer(_loc1_,"txt",{"adjustYLocation":false});
|
||||||
|
_predictiveTextMC["predictTxtTag" + _loc2_].visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_predictiveTextMC["predictTxtTag" + _loc2_].visible = false;
|
||||||
|
}
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
_predictiveTextMC.visible = true;
|
||||||
|
_predictiveTextMC.y = _predictiveTextOriginalYLoc;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_predictiveTextMC.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function findStartOfWordAndReplaceOrUpdate(param1:String, param2:Boolean = true, param3:Boolean = false, param4:Boolean = false) : void
|
||||||
|
{
|
||||||
|
var _loc5_:String = null;
|
||||||
|
var _loc8_:String = null;
|
||||||
|
var _loc6_:Object = getCurrentWordStartAndEnd();
|
||||||
|
var _loc9_:int = int(_loc6_.startOfWord);
|
||||||
|
var _loc7_:int = int(param4 || _loc6_.punctuationSkipped > 0 ? _loc6_.endOfWord + 1 : _loc6_.endOfWord);
|
||||||
|
if(param3 && !param4)
|
||||||
|
{
|
||||||
|
if(_chatMsgText.caretIndex < _loc6_.endOfWord || _loc6_.punctuationSkipped > 0)
|
||||||
|
{
|
||||||
|
if(param1.charAt(param1.length - 1) == " ")
|
||||||
|
{
|
||||||
|
param1 = param1.substring(0,param1.length - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(param1 != null)
|
||||||
|
{
|
||||||
|
if(_loc9_ == 0 && _loc7_ == _chatMsgText.text.length)
|
||||||
|
{
|
||||||
|
_chatMsgText.text = param1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc5_ = "";
|
||||||
|
if(_loc9_ != 0)
|
||||||
|
{
|
||||||
|
_loc5_ = _chatMsgText.text.substring(0,_loc9_);
|
||||||
|
if(_loc5_.charAt(_loc5_.length - 1).match(LocalizationManager.currentLanguage == LocalizationManager.LANG_ENG ? SbiConstants.TEXT_PUNCTUATION_ENGLISH : SbiConstants.TEXT_PUNCTUATION).length > 0)
|
||||||
|
{
|
||||||
|
_loc5_ += " ";
|
||||||
|
_loc6_.startOfWord++;
|
||||||
|
param3 = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc8_ = _chatMsgText.text.substring(_loc7_);
|
||||||
|
_chatMsgText.text = _loc5_ + param1 + _loc8_;
|
||||||
|
}
|
||||||
|
_loc7_ = Math.max(0,_loc6_.startOfWord + _loc6_.punctuationSkipped) + param1.length;
|
||||||
|
if(param3)
|
||||||
|
{
|
||||||
|
_chatMsgText.setSelection(_loc7_,_loc7_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setFormatOfWord(_loc9_,_loc7_,param2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function checkEveryWordAndSetFormat() : Boolean
|
||||||
|
{
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc4_:Boolean = false;
|
||||||
|
var _loc9_:String = null;
|
||||||
|
var _loc10_:String = null;
|
||||||
|
var _loc8_:Boolean = false;
|
||||||
|
var _loc5_:Boolean = false;
|
||||||
|
var _loc1_:* = 0;
|
||||||
|
var _loc12_:Boolean = false;
|
||||||
|
var _loc11_:Array = null;
|
||||||
|
var _loc2_:String = null;
|
||||||
|
var _loc3_:Boolean = false;
|
||||||
|
var _loc13_:Boolean = false;
|
||||||
|
var _loc14_:Boolean = false;
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
if(isAllowedFreeChat())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
_loc9_ = _chatMsgText.text;
|
||||||
|
_loc10_ = "";
|
||||||
|
_loc1_ = -1;
|
||||||
|
_loc12_ = true;
|
||||||
|
_loc6_ = 0;
|
||||||
|
while(_loc6_ < _loc9_.length)
|
||||||
|
{
|
||||||
|
_loc2_ = _loc9_.charAt(_loc6_);
|
||||||
|
if(_loc2_ != " ")
|
||||||
|
{
|
||||||
|
_loc3_ = _loc2_.match(LocalizationManager.currentLanguage == LocalizationManager.LANG_ENG ? SbiConstants.TEXT_PUNCTUATION_ENGLISH : SbiConstants.TEXT_PUNCTUATION).length > 0;
|
||||||
|
}
|
||||||
|
if(_loc13_ && _loc3_)
|
||||||
|
{
|
||||||
|
_loc14_ = true;
|
||||||
|
}
|
||||||
|
if(_loc4_ && (_loc2_ == " " || _loc6_ + 1 == _loc9_.length))
|
||||||
|
{
|
||||||
|
if(_loc6_ + 1 == _loc9_.length && _loc2_ != " ")
|
||||||
|
{
|
||||||
|
if(!_loc3_)
|
||||||
|
{
|
||||||
|
if(_loc14_)
|
||||||
|
{
|
||||||
|
_loc5_ = true;
|
||||||
|
}
|
||||||
|
_loc10_ += _loc2_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!_loc5_)
|
||||||
|
{
|
||||||
|
if(_loc3_ && !_loc13_)
|
||||||
|
{
|
||||||
|
_loc8_ = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc11_ = _predictions.predict(_loc10_,3,50,100,_useType);
|
||||||
|
_loc8_ = false;
|
||||||
|
if(_loc11_.length > 0)
|
||||||
|
{
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < _loc11_.length)
|
||||||
|
{
|
||||||
|
if(_loc11_[_loc7_][0].toLowerCase() == _loc10_.toLowerCase())
|
||||||
|
{
|
||||||
|
_loc8_ = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc8_ = false;
|
||||||
|
}
|
||||||
|
if(_loc12_ && !_loc8_)
|
||||||
|
{
|
||||||
|
_loc12_ = false;
|
||||||
|
}
|
||||||
|
setFormatOfWord(_loc1_,_loc6_ + 1,_loc8_);
|
||||||
|
if(_loc2_ == " ")
|
||||||
|
{
|
||||||
|
setFormatOfWord(_loc6_,_loc6_ + 1,true);
|
||||||
|
}
|
||||||
|
_loc1_ = -1;
|
||||||
|
_loc10_ = "";
|
||||||
|
_loc4_ = false;
|
||||||
|
_loc3_ = false;
|
||||||
|
_loc14_ = false;
|
||||||
|
_loc5_ = false;
|
||||||
|
_loc13_ = false;
|
||||||
|
}
|
||||||
|
else if(_loc2_ == " ")
|
||||||
|
{
|
||||||
|
setFormatOfWord(_loc6_,_loc6_ + 1,true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(_loc1_ == -1)
|
||||||
|
{
|
||||||
|
_loc1_ = _loc6_;
|
||||||
|
}
|
||||||
|
_loc4_ = true;
|
||||||
|
if(_loc6_ + 1 == _loc9_.length)
|
||||||
|
{
|
||||||
|
if(!_loc3_)
|
||||||
|
{
|
||||||
|
if(_loc14_)
|
||||||
|
{
|
||||||
|
_loc5_ = true;
|
||||||
|
}
|
||||||
|
_loc10_ += _loc2_;
|
||||||
|
}
|
||||||
|
if(!_loc5_)
|
||||||
|
{
|
||||||
|
if(_loc3_ && !_loc13_)
|
||||||
|
{
|
||||||
|
_loc8_ = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc11_ = _predictions.predict(_loc10_,3,50,100,_useType);
|
||||||
|
_loc8_ = false;
|
||||||
|
if(_loc11_.length > 0)
|
||||||
|
{
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < _loc11_.length)
|
||||||
|
{
|
||||||
|
if(_loc11_[_loc7_][0].toLowerCase() == _loc10_.toLowerCase())
|
||||||
|
{
|
||||||
|
_loc8_ = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc8_ = false;
|
||||||
|
}
|
||||||
|
if(_loc12_ && !_loc8_)
|
||||||
|
{
|
||||||
|
_loc12_ = false;
|
||||||
|
}
|
||||||
|
setFormatOfWord(_loc1_,_loc6_ + 1,_loc8_);
|
||||||
|
}
|
||||||
|
else if(!_loc3_)
|
||||||
|
{
|
||||||
|
if(_loc14_)
|
||||||
|
{
|
||||||
|
_loc5_ = true;
|
||||||
|
}
|
||||||
|
_loc13_ = true;
|
||||||
|
_loc10_ += _loc2_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc6_++;
|
||||||
|
}
|
||||||
|
gMainFrame.stage.focus = null;
|
||||||
|
gMainFrame.stage.focus = _chatMsgText;
|
||||||
|
if(_chatBar && _chatBar.predictTxt_popup.currentFrameLabel != "close")
|
||||||
|
{
|
||||||
|
if(_loc12_ == true)
|
||||||
|
{
|
||||||
|
_chatBar.predictTxt_popup.gotoAndStop("close");
|
||||||
|
}
|
||||||
|
else if(_currSuggestions.length > 0 && showPredictiveChatBaloons())
|
||||||
|
{
|
||||||
|
if(_chatBar.predictTxt_popup.currentFrameLabel != "open")
|
||||||
|
{
|
||||||
|
_chatBar.predictTxt_popup.gotoAndStop("open");
|
||||||
|
LocalizationManager.translateId(_chatBar.predictTxt_popup.predictTxtBG.txt,29117,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_chatBar.predictTxt_popup.currentFrameLabel != "partial")
|
||||||
|
{
|
||||||
|
_chatBar.predictTxt_popup.gotoAndStop("partial");
|
||||||
|
LocalizationManager.translateId(_chatBar.predictTxt_popup.predictTxtBG.txt,29117,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _loc12_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setFormatOfWord(param1:int, param2:int, param3:Boolean) : void
|
||||||
|
{
|
||||||
|
var _loc4_:TextFormat = null;
|
||||||
|
if(!isAllowedFreeChat())
|
||||||
|
{
|
||||||
|
_loc4_ = _chatMsgText.defaultTextFormat;
|
||||||
|
if(!param3)
|
||||||
|
{
|
||||||
|
_loc4_.underline = true;
|
||||||
|
_loc4_.color = 16711680;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc4_.underline = false;
|
||||||
|
_loc4_.color = 4531987;
|
||||||
|
}
|
||||||
|
if(_chatMsgText.length > 0 && param2 != param1)
|
||||||
|
{
|
||||||
|
if(param2 > 0)
|
||||||
|
{
|
||||||
|
_chatMsgText.setTextFormat(_loc4_,param1,param2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_chatMsgText.setTextFormat(_loc4_,param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getCurrentWordStartAndEnd() : Object
|
||||||
|
{
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc1_:int = _chatMsgText.caretIndex;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc6_:* = -1;
|
||||||
|
var _loc7_:RegExp = LocalizationManager.currentLanguage == LocalizationManager.LANG_ENG ? SbiConstants.TEXT_PUNCTUATION_ENGLISH : SbiConstants.TEXT_PUNCTUATION;
|
||||||
|
if(_chatMsgText.text.charAt(_loc1_ - 1) == " ")
|
||||||
|
{
|
||||||
|
_loc5_ = _loc1_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc3_ = 1;
|
||||||
|
while(_loc3_ <= _loc1_)
|
||||||
|
{
|
||||||
|
if(_chatMsgText.text.charAt(_loc1_ - _loc3_) == " ")
|
||||||
|
{
|
||||||
|
_loc5_ = _loc1_ - (_loc3_ - 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(_chatMsgText.text.charAt(_loc1_ - _loc3_).match(_loc7_).length > 0)
|
||||||
|
{
|
||||||
|
if(_loc6_ != -1)
|
||||||
|
{
|
||||||
|
_loc5_ = _loc1_ - (_loc3_ - 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc6_ = _loc3_;
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var _loc4_:* = -1;
|
||||||
|
if(_loc5_ != -1)
|
||||||
|
{
|
||||||
|
_loc3_ = _loc5_ + 1;
|
||||||
|
while(_loc3_ < _chatMsgText.text.length)
|
||||||
|
{
|
||||||
|
if(_chatMsgText.text.charAt(_loc3_) == " ")
|
||||||
|
{
|
||||||
|
if(_loc4_ == -1)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc3_;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(_chatMsgText.text.charAt(_loc3_).match(_loc7_).length > 0)
|
||||||
|
{
|
||||||
|
if(_loc4_ == -1)
|
||||||
|
{
|
||||||
|
_loc4_ = int(_loc3_ - 1);
|
||||||
|
}
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc4_ == -1)
|
||||||
|
{
|
||||||
|
_loc4_ = _chatMsgText.text.length;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
"startOfWord":_loc5_,
|
||||||
|
"endOfWord":_loc4_,
|
||||||
|
"punctuationSkipped":_loc2_
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getCurrentWord() : String
|
||||||
|
{
|
||||||
|
var _loc1_:Object = getCurrentWordStartAndEnd();
|
||||||
|
if(_loc1_.startOfWord < 0)
|
||||||
|
{
|
||||||
|
return _chatMsgText.text.substring(0,_loc1_.endOfWord < 0 ? _chatMsgText.text.length : _loc1_.endOfWord);
|
||||||
|
}
|
||||||
|
return _chatMsgText.text.substring(_loc1_.startOfWord,_loc1_.endOfWord < 0 ? _chatMsgText.text.length : _loc1_.endOfWord + (_loc1_.punctuationSkipped > 0 ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private function updateWordCapitalizations(param1:String, param2:int = 0, param3:Boolean = true, param4:int = -1) : void
|
||||||
|
{
|
||||||
|
if(param1.length > 1)
|
||||||
|
{
|
||||||
|
if(param1.length <= param2)
|
||||||
|
{
|
||||||
|
findStartOfWordAndReplaceOrUpdate(param1,true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1.charAt(param2).match(SbiConstants.TEXT_IGNORE_FOR_CAPITALIZATION).length > 0)
|
||||||
|
{
|
||||||
|
param2++;
|
||||||
|
updateWordCapitalizations(param1,param2,param3,param4);
|
||||||
|
}
|
||||||
|
else if(param3)
|
||||||
|
{
|
||||||
|
if(param1.charAt(param2) == param1.charAt(param2).toLowerCase())
|
||||||
|
{
|
||||||
|
param1 = param1.toLowerCase();
|
||||||
|
param2 = param1.length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param4 = param2;
|
||||||
|
}
|
||||||
|
updateWordCapitalizations(param1,++param2,false,param4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(param1.charAt(param2) == param1.charAt(param2).toUpperCase())
|
||||||
|
{
|
||||||
|
param1 = param1.toUpperCase();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param1 = param1.substring(0,param4 + 1) + param1.substring(param4 + 1).toLowerCase();
|
||||||
|
}
|
||||||
|
param2 = param1.length;
|
||||||
|
updateWordCapitalizations(param1,param2,param3,param4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function shouldCapitalizeCurrWord(param1:String, param2:int = 0, param3:Boolean = true) : Boolean
|
||||||
|
{
|
||||||
|
if(param1.length > 1)
|
||||||
|
{
|
||||||
|
if(param1.length > param2)
|
||||||
|
{
|
||||||
|
if(param1.charAt(param2).match(SbiConstants.TEXT_IGNORE_FOR_CAPITALIZATION).length > 0)
|
||||||
|
{
|
||||||
|
return shouldCapitalizeCurrWord(param1,++param2,param3);
|
||||||
|
}
|
||||||
|
if(param3)
|
||||||
|
{
|
||||||
|
if(param1.charAt(param2) == param1.charAt(param2).toLowerCase())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return shouldCapitalizeCurrWord(param1,++param2,false);
|
||||||
|
}
|
||||||
|
if(param1.charAt(param2) == param1.charAt(param2).toUpperCase())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isValid() : Boolean
|
||||||
|
{
|
||||||
|
if(_chatMsgText.length == 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(_chatMsgText.text.match("\r"))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return checkEveryWordAndSetFormat();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showUnapprovedChatPopup() : void
|
||||||
|
{
|
||||||
|
if(_currSuggestions.length > 0 && showPredictiveChatBaloons())
|
||||||
|
{
|
||||||
|
if(_chatBar.predictTxt_popup.currentFrameLabel != "open")
|
||||||
|
{
|
||||||
|
_chatBar.predictTxt_popup.gotoAndStop("open");
|
||||||
|
LocalizationManager.translateId(_chatBar.predictTxt_popup.predictTxtBG.txt,29117,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_chatBar.predictTxt_popup.currentFrameLabel != "partial")
|
||||||
|
{
|
||||||
|
_chatBar.predictTxt_popup.gotoAndStop("partial");
|
||||||
|
LocalizationManager.translateId(_chatBar.predictTxt_popup.predictTxtBG.txt,29117,true);
|
||||||
|
}
|
||||||
|
var _loc1_:Number = Number(gMainFrame.userInfo.userVarCache.getUserVarValueById(442));
|
||||||
|
if(_loc1_ < 1)
|
||||||
|
{
|
||||||
|
AchievementXtCommManager.requestSetUserVar(442,1);
|
||||||
|
if(_mediaHelper == null)
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
_mediaHelper = new MediaHelper();
|
||||||
|
_mediaHelper.init(5736,onUnapprovedPopupLoaded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onUnapprovedPopupLoaded(param1:MovieClip) : void
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
_unapprovedChatPopup = MovieClip(param1.getChildAt(0));
|
||||||
|
_unapprovedChatPopup.okBtn.addEventListener("mouseDown",onUnapprovedOkBtn,false,0,true);
|
||||||
|
_unapprovedChatPopup.x = 900 * 0.5;
|
||||||
|
_unapprovedChatPopup.y = 550 * 0.5;
|
||||||
|
_unapprovedChatPopup.startAnimation();
|
||||||
|
GuiManager.guiLayer.addChild(_unapprovedChatPopup);
|
||||||
|
DarkenManager.darken(_unapprovedChatPopup);
|
||||||
|
_mediaHelper.destroy();
|
||||||
|
_mediaHelper = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onUnapprovedOkBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
DarkenManager.unDarken(_unapprovedChatPopup);
|
||||||
|
GuiManager.guiLayer.removeChild(_unapprovedChatPopup);
|
||||||
|
_unapprovedChatPopup.okBtn.removeEventListener("mouseDown",onUnapprovedOkBtn);
|
||||||
|
_unapprovedChatPopup.visible = false;
|
||||||
|
_unapprovedChatPopup = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,834 @@
|
|||||||
|
package gui
|
||||||
|
{
|
||||||
|
import collection.AccItemCollection;
|
||||||
|
import collection.DenItemCollection;
|
||||||
|
import collection.IitemCollection;
|
||||||
|
import collection.IntItemCollection;
|
||||||
|
import collection.TradeItemCollection;
|
||||||
|
import com.sbi.popup.SBOkPopup;
|
||||||
|
import com.sbi.prediction.SetDictionary;
|
||||||
|
import den.DenItem;
|
||||||
|
import den.DenXtCommManager;
|
||||||
|
import flash.display.DisplayObjectContainer;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import gui.itemWindows.ItemWindowOriginal;
|
||||||
|
import inventory.Iitem;
|
||||||
|
import item.ItemXtCommManager;
|
||||||
|
import loader.MediaHelper;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
import pet.GuiPet;
|
||||||
|
import pet.PetItem;
|
||||||
|
import playerWall.PlayerWallManager;
|
||||||
|
import shop.MyShopData;
|
||||||
|
import shop.MyShopItem;
|
||||||
|
import shop.ShopManager;
|
||||||
|
import shop.ShopToSellXtCommManager;
|
||||||
|
|
||||||
|
public class RecycleItems
|
||||||
|
{
|
||||||
|
|
||||||
|
public static const RECYCLE_ACCESSORIES:int = 0;
|
||||||
|
|
||||||
|
public static const RECYCLE_DEN_ITEMS:int = 1;
|
||||||
|
|
||||||
|
public static const RECYCLE_DEN_AUDIO:int = 2;
|
||||||
|
|
||||||
|
public static const RECYCLE_DEN_ITEMS_OCEAN_ONLY:int = 3;
|
||||||
|
|
||||||
|
public static const RECYCLE_DEN_ITEMS_LAND_ONLY:int = 4;
|
||||||
|
|
||||||
|
public static const RECYCLE_ACCESSORIES_OCEAN_ONLY:int = 5;
|
||||||
|
|
||||||
|
public static const RECYCLE_ACCESSORIES_LAND_ONLY:int = 6;
|
||||||
|
|
||||||
|
private static var _accessoriesScrollValue:Number = 0;
|
||||||
|
|
||||||
|
private static var _accessoriesOceanOnlyScrollValue:Number = 0;
|
||||||
|
|
||||||
|
private static var _accessoriesLandOnlyScrollValue:Number = 0;
|
||||||
|
|
||||||
|
private static var _denScrollValue:Number = 0;
|
||||||
|
|
||||||
|
private static var _denOceanOnlyScrollValue:Number = 0;
|
||||||
|
|
||||||
|
private static var _denLandOnlyScrollValue:Number = 0;
|
||||||
|
|
||||||
|
private static var _denAudioScrollValue:Number = 0;
|
||||||
|
|
||||||
|
private static var _scrollValue:Number = 0;
|
||||||
|
|
||||||
|
private const POPUP_MEDIA_ID:int = 4618;
|
||||||
|
|
||||||
|
private const RECYCLE_TUT_LIST_ID:int = 52;
|
||||||
|
|
||||||
|
private var _popupLayer:DisplayObjectContainer;
|
||||||
|
|
||||||
|
private var _recyclePopup:MovieClip;
|
||||||
|
|
||||||
|
private var _confirmPopup:MovieClip;
|
||||||
|
|
||||||
|
private var _recycleInventory:IitemCollection;
|
||||||
|
|
||||||
|
private var _lastPickIndex:int = -1;
|
||||||
|
|
||||||
|
private var _itemsToRecycle:SetDictionary;
|
||||||
|
|
||||||
|
private var _itemWindows:WindowAndScrollbarGenerator;
|
||||||
|
|
||||||
|
private var _confirmWindows:WindowAndScrollbarGenerator;
|
||||||
|
|
||||||
|
private var _mediaHelper:MediaHelper;
|
||||||
|
|
||||||
|
private var _invIdxIntCollection:IntItemCollection;
|
||||||
|
|
||||||
|
private var _itemRecycleId:int;
|
||||||
|
|
||||||
|
private var _savedTradeIndexes:Vector.<Object>;
|
||||||
|
|
||||||
|
private var _recycleOneItem:Boolean;
|
||||||
|
|
||||||
|
private var _hasRecycled:Boolean;
|
||||||
|
|
||||||
|
private var _isInCurrEnviro:Boolean;
|
||||||
|
|
||||||
|
private var _recycleTotal:int;
|
||||||
|
|
||||||
|
private var _closeCallback:Function;
|
||||||
|
|
||||||
|
private var _onRecycleSuccessCallback:Function;
|
||||||
|
|
||||||
|
public function RecycleItems()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function onInfoBtnOut(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
GuiManager.toolTip.resetTimerAndSetVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:int, param2:DisplayObjectContainer, param3:Boolean = false, param4:Function = null, param5:int = 450, param6:int = 250, param7:Boolean = false) : void
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
_itemRecycleId = param1;
|
||||||
|
_popupLayer = param2;
|
||||||
|
_recycleOneItem = param3;
|
||||||
|
_isInCurrEnviro = param7;
|
||||||
|
_closeCallback = param4;
|
||||||
|
_mediaHelper = new MediaHelper();
|
||||||
|
_mediaHelper.init(4618,onPopupLoaded);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
removeListeners();
|
||||||
|
confirmRemoveEventListeners();
|
||||||
|
if(_itemWindows)
|
||||||
|
{
|
||||||
|
_scrollValue = _itemWindows.scrollYValue;
|
||||||
|
switch(_itemRecycleId)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
_accessoriesScrollValue = _scrollValue;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
_denScrollValue = _scrollValue;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
_denAudioScrollValue = _scrollValue;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
_denOceanOnlyScrollValue = _scrollValue;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
_denLandOnlyScrollValue = _scrollValue;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
_accessoriesOceanOnlyScrollValue = _scrollValue;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
_accessoriesLandOnlyScrollValue = _scrollValue;
|
||||||
|
}
|
||||||
|
_itemWindows.destroy();
|
||||||
|
_itemWindows = null;
|
||||||
|
}
|
||||||
|
DarkenManager.unDarken(_confirmPopup);
|
||||||
|
DarkenManager.unDarken(_recyclePopup);
|
||||||
|
_popupLayer.removeChild(_recyclePopup);
|
||||||
|
_hasRecycled = false;
|
||||||
|
_closeCallback = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hasBeenInited() : Boolean
|
||||||
|
{
|
||||||
|
return _recyclePopup != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPopupLoaded(param1:MovieClip) : void
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
_recyclePopup = param1.getChildAt(0) as MovieClip;
|
||||||
|
_confirmPopup = _recyclePopup.confirmPopup;
|
||||||
|
_confirmPopup.visible = false;
|
||||||
|
_mediaHelper.destroy();
|
||||||
|
_mediaHelper = null;
|
||||||
|
_recyclePopup.recycleBtn.activateGrayState(true);
|
||||||
|
_recyclePopup.currencyToolTip.text = 0;
|
||||||
|
addListeners();
|
||||||
|
_recyclePopup.x = 900 * 0.5;
|
||||||
|
_recyclePopup.y = 550 * 0.5;
|
||||||
|
_popupLayer.addChild(_recyclePopup);
|
||||||
|
DarkenManager.darken(_recyclePopup);
|
||||||
|
_itemsToRecycle = new SetDictionary();
|
||||||
|
AJClient.clearPicked();
|
||||||
|
_lastPickIndex = -1;
|
||||||
|
_savedTradeIndexes = new Vector.<Object>();
|
||||||
|
AJAudio.playItemRecycledSound();
|
||||||
|
if(_itemRecycleId == 1 || _itemRecycleId == 3 || _itemRecycleId == 4)
|
||||||
|
{
|
||||||
|
if(gMainFrame.userInfo.playerUserInfo.denItemsFull.length <= 0)
|
||||||
|
{
|
||||||
|
DenXtCommManager.requestDenItems(fillInventory);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fillInventory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fillInventory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function fillInventory(param1:Boolean = false) : void
|
||||||
|
{
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc5_:AccItemCollection = null;
|
||||||
|
var _loc2_:DenItemCollection = null;
|
||||||
|
var _loc4_:int = 0;
|
||||||
|
if(!param1)
|
||||||
|
{
|
||||||
|
_recycleInventory = new IitemCollection();
|
||||||
|
if(_itemRecycleId == 0)
|
||||||
|
{
|
||||||
|
_recycleInventory = new IitemCollection((gMainFrame.userInfo.playerAvatarInfo.getFullItems() as IitemCollection).concatCollection(null));
|
||||||
|
_scrollValue = _accessoriesScrollValue;
|
||||||
|
}
|
||||||
|
else if(_itemRecycleId == 6 || _itemRecycleId == 5)
|
||||||
|
{
|
||||||
|
_loc5_ = gMainFrame.userInfo.playerAvatarInfo.getFullItems();
|
||||||
|
if(_itemRecycleId == 6)
|
||||||
|
{
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < _loc5_.length)
|
||||||
|
{
|
||||||
|
if(_loc5_.getAccItem(_loc3_).enviroType == 0 || _loc5_.getAccItem(_loc3_).isLandAndOcean)
|
||||||
|
{
|
||||||
|
_recycleInventory.pushIitem(_loc5_.getAccItem(_loc3_).clone());
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
_scrollValue = _accessoriesLandOnlyScrollValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < _loc5_.length)
|
||||||
|
{
|
||||||
|
if(_loc5_.getAccItem(_loc3_).enviroType == 1 || _loc5_.getAccItem(_loc3_).isLandAndOcean)
|
||||||
|
{
|
||||||
|
_recycleInventory.pushIitem(_loc5_.getAccItem(_loc3_).clone());
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
_scrollValue = _accessoriesOceanOnlyScrollValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_ = gMainFrame.userInfo.playerUserInfo.denItemsFull;
|
||||||
|
if(_itemRecycleId == 4 || _itemRecycleId == 3)
|
||||||
|
{
|
||||||
|
if(_isInCurrEnviro)
|
||||||
|
{
|
||||||
|
_loc2_ = Utility.denItemListByEnviroType(_loc2_,_itemRecycleId == 4 ? 0 : 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < _loc2_.length)
|
||||||
|
{
|
||||||
|
if(_itemRecycleId == 2)
|
||||||
|
{
|
||||||
|
if(_loc2_.getDenItem(_loc3_).sortId == 4 && _loc2_.getDenItem(_loc3_).defId != 617)
|
||||||
|
{
|
||||||
|
_recycleInventory.setIitem(_loc4_,_loc2_.getDenItem(_loc3_).clone());
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_loc2_.getDenItem(_loc3_).sortId != 4)
|
||||||
|
{
|
||||||
|
if(_itemRecycleId == 1 || _isInCurrEnviro)
|
||||||
|
{
|
||||||
|
_recycleInventory.setIitem(_loc4_,_loc2_.getDenItem(_loc3_).clone());
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
else if(_itemRecycleId == 4 && (_loc2_.getDenItem(_loc3_).enviroType == 0 || _loc2_.getDenItem(_loc3_).isLandAndOcean))
|
||||||
|
{
|
||||||
|
_recycleInventory.setIitem(_loc4_,_loc2_.getDenItem(_loc3_).clone());
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
else if(_loc2_.getDenItem(_loc3_).enviroType == 1 || _loc2_.getDenItem(_loc3_).isLandAndOcean)
|
||||||
|
{
|
||||||
|
_recycleInventory.setIitem(_loc4_,_loc2_.getDenItem(_loc3_).clone());
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
if(_itemRecycleId == 2)
|
||||||
|
{
|
||||||
|
_scrollValue = _denAudioScrollValue;
|
||||||
|
}
|
||||||
|
else if(_itemRecycleId == 1)
|
||||||
|
{
|
||||||
|
_scrollValue = _denScrollValue;
|
||||||
|
}
|
||||||
|
else if(_itemRecycleId == 4)
|
||||||
|
{
|
||||||
|
_scrollValue = _denLandOnlyScrollValue;
|
||||||
|
}
|
||||||
|
else if(_itemRecycleId == 3)
|
||||||
|
{
|
||||||
|
_scrollValue = _denOceanOnlyScrollValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
createWindows();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function createWindows() : void
|
||||||
|
{
|
||||||
|
if(_itemWindows)
|
||||||
|
{
|
||||||
|
_scrollValue = _itemWindows.scrollYValue;
|
||||||
|
}
|
||||||
|
if(_itemWindows)
|
||||||
|
{
|
||||||
|
_itemWindows.destroy();
|
||||||
|
_itemWindows = null;
|
||||||
|
}
|
||||||
|
while(_recyclePopup.itemBlock.numChildren > 1)
|
||||||
|
{
|
||||||
|
_recyclePopup.itemBlock.removeChildAt(_recyclePopup.itemBlock.numChildren - 1);
|
||||||
|
}
|
||||||
|
_itemWindows = new WindowAndScrollbarGenerator();
|
||||||
|
_itemWindows.init(_recyclePopup.itemBlock.width,_recyclePopup.itemBlock.height,4,_scrollValue,3,4,12,2,2,0,1,ItemWindowOriginal,_recycleInventory.getCoreArray(),"icon",0,{
|
||||||
|
"mouseDown":onItemWindowDown,
|
||||||
|
"mouseOver":onItemRollOver,
|
||||||
|
"mouseOut":onItemRollOut
|
||||||
|
},{"isRecycling":true},null,true,false,false);
|
||||||
|
_recyclePopup.itemBlock.addChild(_itemWindows);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function sendRecycleRequest(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
var _loc6_:Array = null;
|
||||||
|
var _loc11_:TradeItemCollection = null;
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc7_:Iitem = null;
|
||||||
|
var _loc3_:* = undefined;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
var _loc4_:Boolean = false;
|
||||||
|
var _loc9_:int = 0;
|
||||||
|
var _loc12_:* = undefined;
|
||||||
|
var _loc10_:int = 0;
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
_invIdxIntCollection = new IntItemCollection();
|
||||||
|
_loc6_ = _itemsToRecycle.getValues();
|
||||||
|
_loc11_ = gMainFrame.userInfo.getMyTradeList();
|
||||||
|
_loc2_ = -1;
|
||||||
|
_loc3_ = new Vector.<MyShopItem>();
|
||||||
|
_loc5_ = 0;
|
||||||
|
while(_loc5_ < _loc6_.length)
|
||||||
|
{
|
||||||
|
if(_loc6_[_loc5_])
|
||||||
|
{
|
||||||
|
_loc7_ = _loc6_[_loc5_] as Iitem;
|
||||||
|
_loc2_ = _loc7_.invIdx;
|
||||||
|
_invIdxIntCollection.pushIntItem(_loc2_);
|
||||||
|
_loc8_ = 0;
|
||||||
|
while(_loc8_ < _loc11_.length)
|
||||||
|
{
|
||||||
|
if(_loc11_.getTradeItem(_loc8_).itemType == _itemRecycleId && _loc11_.getTradeItem(_loc8_).invIdx == _loc2_)
|
||||||
|
{
|
||||||
|
_savedTradeIndexes.push({
|
||||||
|
"tradeIndex":_loc8_,
|
||||||
|
"invIdx":_loc2_
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
if(_loc7_.denStoreInvId > 0 || _loc7_.itemType == 0 && (_loc7_ as DenItem).specialType == 5)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc7_.itemType == 0 && (_loc7_ as DenItem).specialType == 5;
|
||||||
|
_loc9_ = _loc4_ ? _loc2_ : _loc7_.denStoreInvId;
|
||||||
|
if(!ShopManager.myShopItems[_loc9_])
|
||||||
|
{
|
||||||
|
ShopToSellXtCommManager.requestStoreInfo(gMainFrame.userInfo.myUserName,_loc9_,onRecycleDenStoreInfoRequest,null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loc12_ = ShopManager.myShopItems[_loc9_].shopItems;
|
||||||
|
_loc10_ = 0;
|
||||||
|
while(_loc10_ < _loc12_.length)
|
||||||
|
{
|
||||||
|
if(_loc4_)
|
||||||
|
{
|
||||||
|
_loc3_.push(_loc12_[_loc10_]);
|
||||||
|
}
|
||||||
|
else if(_loc12_[_loc10_].currItem.itemType == _loc7_.itemType && _loc12_[_loc10_].currItem.invIdx == _loc7_.invIdx)
|
||||||
|
{
|
||||||
|
_loc3_.push(_loc12_[_loc10_]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc10_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc7_.isInDenShop)
|
||||||
|
{
|
||||||
|
_loc3_.push(new MyShopItem(_loc7_,0,0,_loc9_));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
if(_loc3_.length > 0)
|
||||||
|
{
|
||||||
|
ShopManager.findAndRemoveDenShopItems(_loc3_,performRecycleRequest,null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
performRecycleRequest(true,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRecycleDenStoreInfoRequest(param1:MyShopData, param2:Object) : void
|
||||||
|
{
|
||||||
|
if(param1 != null)
|
||||||
|
{
|
||||||
|
sendRecycleRequest(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
new SBOkPopup(_popupLayer,LocalizationManager.translateIdOnly(24788));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function performRecycleRequest(param1:Boolean, param2:Object) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
if(_itemRecycleId == 0 || _itemRecycleId == 6 || _itemRecycleId == 5)
|
||||||
|
{
|
||||||
|
ItemXtCommManager.requestItemRecycle(_invIdxIntCollection,confirmRecycle,onRecycleListCallback);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DenXtCommManager.requestRecycle(true,_invIdxIntCollection,confirmRecycle,onRecycleListCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
new SBOkPopup(_popupLayer,LocalizationManager.translateIdOnly(24788));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function confirmRecycle(param1:Vector.<int>) : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
if(param1.length > 0)
|
||||||
|
{
|
||||||
|
if(_savedTradeIndexes.length > 0)
|
||||||
|
{
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < _savedTradeIndexes.length)
|
||||||
|
{
|
||||||
|
if(param1.indexOf(_savedTradeIndexes[_loc2_].invIdx) > -1)
|
||||||
|
{
|
||||||
|
gMainFrame.userInfo.removeFromMyTradeList(_savedTradeIndexes[_loc2_].tradeIndex);
|
||||||
|
if(_itemRecycleId == 0 || _itemRecycleId == 6 || _itemRecycleId == 5)
|
||||||
|
{
|
||||||
|
TradeManager.adjustByOnNumClothingItemsInMyTradeList(-1);
|
||||||
|
}
|
||||||
|
else if(_itemRecycleId == 1 || _itemRecycleId == 2 || _itemRecycleId == 4 || _itemRecycleId == 3)
|
||||||
|
{
|
||||||
|
TradeManager.adjustByOnNumDenItemsInMyTradeList(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
}
|
||||||
|
if(_itemsToRecycle.getSize() != param1.length)
|
||||||
|
{
|
||||||
|
new SBOkPopup(_popupLayer,LocalizationManager.translateIdOnly(24788));
|
||||||
|
}
|
||||||
|
_savedTradeIndexes = new Vector.<Object>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRecycleListCallback() : void
|
||||||
|
{
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc1_:IntItemCollection = null;
|
||||||
|
var _loc4_:Array = null;
|
||||||
|
var _loc5_:Iitem = null;
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
_hasRecycled = true;
|
||||||
|
if(_onRecycleSuccessCallback != null)
|
||||||
|
{
|
||||||
|
_onRecycleSuccessCallback();
|
||||||
|
}
|
||||||
|
if(_recycleOneItem)
|
||||||
|
{
|
||||||
|
applyAndClose(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc1_ = new IntItemCollection();
|
||||||
|
_loc4_ = _itemsToRecycle.getKeys(true,16);
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < _loc4_.length)
|
||||||
|
{
|
||||||
|
_loc5_ = Iitem(_itemsToRecycle.getValue(_loc4_[_loc2_]));
|
||||||
|
if(_loc5_.isCustom)
|
||||||
|
{
|
||||||
|
_loc1_.pushIntItem(_loc5_.invIdx);
|
||||||
|
}
|
||||||
|
_itemWindows.deleteItem(_loc4_[_loc2_] - _loc3_,_recycleInventory.getCoreArray(),true,false);
|
||||||
|
_loc3_++;
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
if(_loc1_.length > 0)
|
||||||
|
{
|
||||||
|
PlayerWallManager.checkAndRemoveMasterpieceItems(_loc1_);
|
||||||
|
}
|
||||||
|
_itemsToRecycle = new SetDictionary();
|
||||||
|
AJClient.clearPicked();
|
||||||
|
_lastPickIndex = -1;
|
||||||
|
_recycleTotal = 0;
|
||||||
|
_recyclePopup.currencyToolTip.text = Utility.convertNumberToString(_recycleTotal);
|
||||||
|
_recyclePopup.recycleBtn.activateGrayState(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setOnRecycleSuccessCallback(param1:Function) : void
|
||||||
|
{
|
||||||
|
_onRecycleSuccessCallback = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function applyAndClose(param1:Boolean = false) : void
|
||||||
|
{
|
||||||
|
ItemXtCommManager.recycleIlCallback = null;
|
||||||
|
DenXtCommManager.recycleDiCallback = null;
|
||||||
|
if(_closeCallback != null)
|
||||||
|
{
|
||||||
|
_closeCallback(param1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onPopupDown(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onClose(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
applyAndClose(_hasRecycled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onItemWindowDown(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
var _loc2_:ItemWindowOriginal = null;
|
||||||
|
var _loc3_:Iitem = null;
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(param1.currentTarget.name == "previewBtn")
|
||||||
|
{
|
||||||
|
_loc2_ = param1.currentTarget.parent.parent as ItemWindowOriginal;
|
||||||
|
_loc3_ = _loc2_.currItem as Iitem;
|
||||||
|
if(_loc3_ is DenItem)
|
||||||
|
{
|
||||||
|
GuiManager.openMasterpiecePreview((_loc3_ as DenItem).uniqueImageId,(_loc3_ as DenItem).uniqueImageCreator,(_loc3_ as DenItem).uniqueImageCreatorDbId,(_loc3_ as DenItem).uniqueImageCreatorUUID,(_loc3_ as DenItem).version,gMainFrame.userInfo.myUserName,_loc3_ as DenItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param1.currentTarget.name == "certBtn")
|
||||||
|
{
|
||||||
|
_loc3_ = param1.currentTarget.parent.parent.currItem;
|
||||||
|
if(_loc3_ is PetItem)
|
||||||
|
{
|
||||||
|
GuiManager.openPetCertificatePopup((_loc3_ as PetItem).largeIcon as GuiPet,null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_ = param1.currentTarget as ItemWindowOriginal;
|
||||||
|
if(param1.shiftKey && _lastPickIndex >= 0)
|
||||||
|
{
|
||||||
|
// with Shift held: everything from the item clicked before
|
||||||
|
// to this one.
|
||||||
|
pickRun(Math.min(_lastPickIndex,_loc2_.index),Math.max(_lastPickIndex,_loc2_.index));
|
||||||
|
_lastPickIndex = _loc2_.index;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_lastPickIndex = _loc2_.index;
|
||||||
|
if((_loc2_.currItem as Iitem).isApproved)
|
||||||
|
{
|
||||||
|
if(_loc2_.cir.currentFrameLabel != "green" && _loc2_.cir.currentFrameLabel != "greenMouse")
|
||||||
|
{
|
||||||
|
_loc2_.cir.gotoAndStop("greenMouse");
|
||||||
|
_recycleTotal += (_loc2_.currItem as Iitem).recycleValue as int;
|
||||||
|
_itemsToRecycle.insertKey(_loc2_.index,(_loc2_.currItem as Iitem).clone());
|
||||||
|
AJClient.setPicked(_loc2_.currItem,true);
|
||||||
|
_recyclePopup.recycleBtn.activateGrayState(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(_loc2_.isInUse)
|
||||||
|
{
|
||||||
|
_loc2_.cir.gotoAndStop("down");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_.cir.gotoAndStop("up");
|
||||||
|
}
|
||||||
|
_recycleTotal -= (_loc2_.currItem as Iitem).recycleValue as int;
|
||||||
|
_itemsToRecycle.removeKey(_loc2_.index);
|
||||||
|
AJClient.setPicked(_loc2_.currItem,false);
|
||||||
|
if(_recycleTotal <= 0)
|
||||||
|
{
|
||||||
|
_recyclePopup.recycleBtn.activateGrayState(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_recyclePopup.currencyToolTip.text = Utility.convertNumberToString(_recycleTotal);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new SBOkPopup(_popupLayer,LocalizationManager.translateIdOnly(25196));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function pickRun(param1:int, param2:int) : void
|
||||||
|
{
|
||||||
|
var _loc3_:Array = _recycleInventory.getCoreArray();
|
||||||
|
var _loc4_:Iitem = null;
|
||||||
|
while(param1 <= param2 && param1 < _loc3_.length)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc3_[param1] as Iitem;
|
||||||
|
if(_loc4_ != null && _loc4_.isApproved && !_itemsToRecycle.containsKey(param1))
|
||||||
|
{
|
||||||
|
_recycleTotal += _loc4_.recycleValue as int;
|
||||||
|
_itemsToRecycle.insertKey(param1,_loc4_.clone());
|
||||||
|
AJClient.setPicked(_loc4_,true);
|
||||||
|
}
|
||||||
|
param1++;
|
||||||
|
}
|
||||||
|
if(_itemWindows != null)
|
||||||
|
{
|
||||||
|
for each(var _loc5_:Object in _itemWindows.mediaWindows)
|
||||||
|
{
|
||||||
|
if(_loc5_ is ItemWindowOriginal)
|
||||||
|
{
|
||||||
|
ItemWindowOriginal(_loc5_).refreshPicked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_itemsToRecycle.getSize() > 0)
|
||||||
|
{
|
||||||
|
_recyclePopup.recycleBtn.activateGrayState(false);
|
||||||
|
}
|
||||||
|
_recyclePopup.currencyToolTip.text = Utility.convertNumberToString(_recycleTotal);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onItemRollOver(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
if(param1.currentTarget.cir.currentFrameLabel == "down")
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("downMouse");
|
||||||
|
}
|
||||||
|
else if(param1.currentTarget.cir.currentFrameLabel == "green")
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("greenMouse");
|
||||||
|
}
|
||||||
|
else if(param1.currentTarget.cir.currentFrameLabel != "downMouse")
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("over");
|
||||||
|
}
|
||||||
|
AJAudio.playSubMenuBtnRollover();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onItemRollOut(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
}
|
||||||
|
if(param1.currentTarget.cir.currentFrameLabel == "downMouse")
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("down");
|
||||||
|
}
|
||||||
|
else if(param1.currentTarget.cir.currentFrameLabel == "greenMouse")
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("green");
|
||||||
|
}
|
||||||
|
else if(param1.currentTarget.cir.currentFrameLabel != "down")
|
||||||
|
{
|
||||||
|
param1.currentTarget.cir.gotoAndStop("up");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRecycleBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
var _loc4_:IitemCollection = null;
|
||||||
|
var _loc5_:Array = null;
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(!param1.currentTarget.isGray)
|
||||||
|
{
|
||||||
|
if(gMainFrame.clientInfo.extCallsActive)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DarkenManager.unDarken(_recyclePopup);
|
||||||
|
DarkenManager.darken(_confirmPopup,true);
|
||||||
|
_confirmPopup.visible = true;
|
||||||
|
confirmAddEventListeners();
|
||||||
|
_loc4_ = new IitemCollection();
|
||||||
|
_loc5_ = _itemsToRecycle.getValues();
|
||||||
|
_loc2_ = int(_loc5_.length);
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < _loc2_)
|
||||||
|
{
|
||||||
|
if(_loc5_[_loc3_])
|
||||||
|
{
|
||||||
|
_loc4_.pushIitem(_loc5_[_loc3_]);
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
_confirmWindows = new WindowAndScrollbarGenerator();
|
||||||
|
_confirmWindows.init(_confirmPopup.itemBlock.width,_confirmPopup.itemBlock.height,3,0,2,2,0,2,2,0,1,ItemWindowOriginal,_loc4_.getCoreArray(),"icon",0,{
|
||||||
|
"mouseDown":null,
|
||||||
|
"mouseOver":onItemRollOver,
|
||||||
|
"mouseOut":onItemRollOut
|
||||||
|
},{"isRecycling":true},null,true,false,false);
|
||||||
|
_confirmPopup.itemBlock.addChild(_confirmWindows);
|
||||||
|
LocalizationManager.translateIdAndInsert(_confirmPopup.bodyTxtCont.bodyTxt,_loc4_.length == 1 ? 11371 : 24764,Utility.convertNumberToString(_recycleTotal));
|
||||||
|
LocalizationManager.translateIdAndInsert(_confirmPopup.txtCounter_ba.counterTxt,_loc4_.length == 1 ? 23696 : 23695,_loc4_.length);
|
||||||
|
_loc4_ = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onConfirmOkBtn(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
onConfirmNoOrExit(param1);
|
||||||
|
sendRecycleRequest(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onConfirmNoOrExit(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
DarkenManager.unDarken(_confirmPopup);
|
||||||
|
DarkenManager.darken(_recyclePopup);
|
||||||
|
_confirmPopup.visible = false;
|
||||||
|
while(_confirmPopup.itemBlock.numChildren > 2)
|
||||||
|
{
|
||||||
|
_confirmPopup.itemBlock.removeChildAt(_confirmPopup.itemBlock.numChildren - 1);
|
||||||
|
}
|
||||||
|
if(_confirmWindows)
|
||||||
|
{
|
||||||
|
_confirmWindows.destroy();
|
||||||
|
_confirmWindows = null;
|
||||||
|
}
|
||||||
|
confirmRemoveEventListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onInfoBtnDown(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
GenericListGuiManager.genericListVolumeClicked(52);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onInfoBtnOver(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
GuiManager.toolTip.init(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14678),param1.currentTarget.x + _recyclePopup.x,param1.currentTarget.y + _recyclePopup.y + param1.currentTarget.height);
|
||||||
|
GuiManager.toolTip.startTimer(param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addListeners() : void
|
||||||
|
{
|
||||||
|
_recyclePopup.addEventListener("mouseDown",onPopupDown,false,0,true);
|
||||||
|
_recyclePopup.bx.addEventListener("mouseDown",onClose,false,0,true);
|
||||||
|
_recyclePopup.infoBtn.addEventListener("mouseDown",onInfoBtnDown,false,0,true);
|
||||||
|
_recyclePopup.infoBtn.addEventListener("mouseOver",onInfoBtnOver,false,0,true);
|
||||||
|
_recyclePopup.infoBtn.addEventListener("mouseOut",onInfoBtnOut,false,0,true);
|
||||||
|
_recyclePopup.recycleBtn.addEventListener("mouseDown",onRecycleBtn,false,0,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function confirmAddEventListeners() : void
|
||||||
|
{
|
||||||
|
if(_confirmPopup)
|
||||||
|
{
|
||||||
|
_confirmPopup.addEventListener("mouseDown",onPopupDown,false,0,true);
|
||||||
|
_confirmPopup.bx.addEventListener("mouseDown",onConfirmNoOrExit,false,0,true);
|
||||||
|
_confirmPopup.okBtn.addEventListener("mouseDown",onConfirmOkBtn,false,0,true);
|
||||||
|
_confirmPopup.noBtn.addEventListener("mouseDown",onConfirmNoOrExit,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function removeListeners() : void
|
||||||
|
{
|
||||||
|
_recyclePopup.removeEventListener("mouseDown",onPopupDown);
|
||||||
|
_recyclePopup.bx.removeEventListener("mouseDown",onClose);
|
||||||
|
_recyclePopup.infoBtn.removeEventListener("mouseDown",onInfoBtnDown);
|
||||||
|
_recyclePopup.infoBtn.removeEventListener("mouseOver",onInfoBtnOver);
|
||||||
|
_recyclePopup.infoBtn.removeEventListener("mouseOut",onInfoBtnOut);
|
||||||
|
_recyclePopup.recycleBtn.removeEventListener("mouseDown",onRecycleBtn);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function confirmRemoveEventListeners() : void
|
||||||
|
{
|
||||||
|
if(_confirmPopup)
|
||||||
|
{
|
||||||
|
_confirmPopup.removeEventListener("mouseDown",onPopupDown);
|
||||||
|
_confirmPopup.bx.removeEventListener("mouseDown",onConfirmNoOrExit);
|
||||||
|
_confirmPopup.okBtn.removeEventListener("mouseDown",onConfirmOkBtn);
|
||||||
|
_confirmPopup.noBtn.removeEventListener("mouseDown",onConfirmNoOrExit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,448 @@
|
|||||||
|
package gui
|
||||||
|
{
|
||||||
|
import buddy.BuddyManager;
|
||||||
|
import buddy.BuddyXtCommManager;
|
||||||
|
import com.sbi.popup.SBPopup;
|
||||||
|
import facilitator.FacilitatorXtCommManager;
|
||||||
|
import flash.display.DisplayObjectContainer;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.display.Shape;
|
||||||
|
import flash.events.Event;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import flash.text.TextField;
|
||||||
|
import flash.text.TextFormat;
|
||||||
|
import loader.MediaHelper;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
import playerWall.PlayerWallManager;
|
||||||
|
|
||||||
|
public class ReportAPlayer
|
||||||
|
{
|
||||||
|
|
||||||
|
public static const REASONS_ALL:int = 0;
|
||||||
|
|
||||||
|
public static const REASONS_PLAYER_CARD:int = 1;
|
||||||
|
|
||||||
|
public static const REASONS_ECARD:int = 2;
|
||||||
|
|
||||||
|
public static const REASONS_PLAYER_WALL:int = 3;
|
||||||
|
|
||||||
|
public static const REASONS_MASTERPIECE:int = 4;
|
||||||
|
|
||||||
|
private static var _reportFromCardPopup:SBPopup;
|
||||||
|
|
||||||
|
private var _popupLayer:DisplayObjectContainer;
|
||||||
|
|
||||||
|
private var _reportPopup:SBPopup;
|
||||||
|
|
||||||
|
private var _agreeBox:GuiCheckBox;
|
||||||
|
|
||||||
|
private var _reportConfirmMediaHelper:MediaHelper;
|
||||||
|
|
||||||
|
private var _closeCallback:Function;
|
||||||
|
|
||||||
|
private var _dataToPassAlong:Object;
|
||||||
|
|
||||||
|
private var _report:MovieClip;
|
||||||
|
|
||||||
|
private var _reportFromCard:MovieClip;
|
||||||
|
|
||||||
|
private var _reportFromCardConfirmPopup:MovieClip;
|
||||||
|
|
||||||
|
private var _isFromPlayersCard:Boolean;
|
||||||
|
|
||||||
|
private var _reportAPlayer:Boolean;
|
||||||
|
|
||||||
|
private var _hasReported:Boolean;
|
||||||
|
|
||||||
|
private var _playersAvatarUserName:String;
|
||||||
|
|
||||||
|
private var _playersModeratedAvatarUserName:String;
|
||||||
|
|
||||||
|
private var _reasonArray:Array;
|
||||||
|
|
||||||
|
private var _reasonToId:Vector.<String>;
|
||||||
|
|
||||||
|
private var _reasonsType:int;
|
||||||
|
|
||||||
|
private var _detailBar:MovieClip;
|
||||||
|
|
||||||
|
private var _detailInput:TextField;
|
||||||
|
|
||||||
|
public function ReportAPlayer()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function closeReportFromCardPopoup() : void
|
||||||
|
{
|
||||||
|
if(_reportFromCardPopup)
|
||||||
|
{
|
||||||
|
_reportFromCardPopup.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(param1:int, param2:DisplayObjectContainer, param3:Function = null, param4:Boolean = false, param5:String = null, param6:String = null, param7:Boolean = true, param8:* = null, param9:int = -1, param10:int = 450, param11:int = 275) : void
|
||||||
|
{
|
||||||
|
_popupLayer = param2;
|
||||||
|
_closeCallback = param3;
|
||||||
|
_isFromPlayersCard = param4;
|
||||||
|
_playersAvatarUserName = param5;
|
||||||
|
_playersModeratedAvatarUserName = param6;
|
||||||
|
_hasReported = false;
|
||||||
|
_reportAPlayer = param7;
|
||||||
|
_dataToPassAlong = param8;
|
||||||
|
_reasonsType = param1;
|
||||||
|
if(param4)
|
||||||
|
{
|
||||||
|
_reasonArray = [[LocalizationManager.translateIdOnly(11372)],[LocalizationManager.translateIdOnly(14791)],[LocalizationManager.translateIdOnly(14793)],[LocalizationManager.translateIdOnly(14794)],[LocalizationManager.translateIdOnly(14795)],[LocalizationManager.translateIdOnly(15736)],[LocalizationManager.translateIdOnly(15737)]];
|
||||||
|
if(param1 == 0)
|
||||||
|
{
|
||||||
|
_reasonArray.push([LocalizationManager.translateIdOnly(14792)]);
|
||||||
|
_reasonArray.push([LocalizationManager.translateIdOnly(20088)]);
|
||||||
|
_reasonArray.push([LocalizationManager.translateIdOnly(23217)]);
|
||||||
|
}
|
||||||
|
else if(param1 == 1)
|
||||||
|
{
|
||||||
|
_reasonArray.push([LocalizationManager.translateIdOnly(14792)]);
|
||||||
|
}
|
||||||
|
else if(param1 == 2)
|
||||||
|
{
|
||||||
|
_reasonArray.push([LocalizationManager.translateIdOnly(20088)]);
|
||||||
|
}
|
||||||
|
else if(param1 == 3)
|
||||||
|
{
|
||||||
|
_reasonArray.push([LocalizationManager.translateIdOnly(23217)]);
|
||||||
|
}
|
||||||
|
else if(param1 == 4)
|
||||||
|
{
|
||||||
|
_reasonArray.push([LocalizationManager.translateIdOnly(25195)]);
|
||||||
|
}
|
||||||
|
_reasonToId = new <String>[LocalizationManager.translateIdOnly(11372),LocalizationManager.translateIdOnly(14791),LocalizationManager.translateIdOnly(14792),LocalizationManager.translateIdOnly(14793),LocalizationManager.translateIdOnly(14794),LocalizationManager.translateIdOnly(14795),LocalizationManager.translateIdOnly(15736),LocalizationManager.translateIdOnly(15737),LocalizationManager.translateIdOnly(20088),LocalizationManager.translateIdOnly(23217),LocalizationManager.translateIdOnly(25195)];
|
||||||
|
_reportFromCard = GETDEFINITIONBYNAME("ReportPopupReportContent");
|
||||||
|
_reportFromCardPopup = new SBPopup(_popupLayer,GETDEFINITIONBYNAME("ReportPopupReportSkin"),_reportFromCard,true,true,false,false,true);
|
||||||
|
_reportFromCardPopup.x = param10;
|
||||||
|
_reportFromCardPopup.y = param11;
|
||||||
|
_reportFromCardPopup.bxClosesPopup = false;
|
||||||
|
LocalizationManager.translateId(_reportFromCard.reasonTxt,11372);
|
||||||
|
LocalizationManager.translateIdAndInsert(_reportFromCard.titleTxt,11373,_playersModeratedAvatarUserName);
|
||||||
|
SafeChatManager.buildSafeChatTree(_reportFromCard.reasonChatTree,"ECardTextTreeNode",1,onReasonTextClose,_reasonArray);
|
||||||
|
SafeChatManager.closeSafeChat(_reportFromCard.reasonChatTree);
|
||||||
|
if(param9 != -1)
|
||||||
|
{
|
||||||
|
_reportFromCard.reasonTxt.text = _reasonArray[param9];
|
||||||
|
}
|
||||||
|
addDetailBox();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_report = GETDEFINITIONBYNAME("ReportPopupHowToContent2");
|
||||||
|
_reportPopup = new SBPopup(_popupLayer,GETDEFINITIONBYNAME("ReportPopupHowToSkin"),_report);
|
||||||
|
_reportPopup.x = param10;
|
||||||
|
_reportPopup.y = param11;
|
||||||
|
_reportPopup.bxClosesPopup = false;
|
||||||
|
}
|
||||||
|
addListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() : void
|
||||||
|
{
|
||||||
|
removeListeners();
|
||||||
|
if(_reportFromCardPopup)
|
||||||
|
{
|
||||||
|
_reportFromCardPopup.destroy();
|
||||||
|
_reportFromCardPopup = null;
|
||||||
|
}
|
||||||
|
if(_reportPopup)
|
||||||
|
{
|
||||||
|
_reportPopup.destroy();
|
||||||
|
_reportPopup = null;
|
||||||
|
}
|
||||||
|
if(_reportFromCardConfirmPopup)
|
||||||
|
{
|
||||||
|
if(_agreeBox)
|
||||||
|
{
|
||||||
|
_agreeBox.destroy();
|
||||||
|
_agreeBox = null;
|
||||||
|
}
|
||||||
|
DarkenManager.unDarken(_reportFromCardConfirmPopup);
|
||||||
|
_popupLayer.removeChild(_reportFromCardConfirmPopup);
|
||||||
|
_reportFromCardConfirmPopup = null;
|
||||||
|
}
|
||||||
|
GuiManager.displayRulesPopup(false);
|
||||||
|
if(_reportFromCard)
|
||||||
|
{
|
||||||
|
SafeChatManager.destroy(_reportFromCard.reasonChatTree);
|
||||||
|
}
|
||||||
|
if(_detailInput)
|
||||||
|
{
|
||||||
|
_detailInput.removeEventListener("change",onDetailTyped);
|
||||||
|
_detailInput = null;
|
||||||
|
_detailBar = null;
|
||||||
|
}
|
||||||
|
if(GuiManager.mainHud.reportBtn)
|
||||||
|
{
|
||||||
|
GuiManager.mainHud.reportBtn.downToUpState();
|
||||||
|
}
|
||||||
|
_closeCallback = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addDetailBox() : void
|
||||||
|
{
|
||||||
|
var _loc1_:MovieClip = GETDEFINITIONBYNAME("searchBar_den");
|
||||||
|
var _loc2_:TextField = _loc1_.searchTxt;
|
||||||
|
var _loc3_:Shape = new Shape();
|
||||||
|
var _loc4_:TextFormat = null;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
_loc1_.t.visible = false;
|
||||||
|
_loc1_.m.visible = false;
|
||||||
|
_loc1_.b.visible = false;
|
||||||
|
while(_loc5_ < _loc1_.numChildren)
|
||||||
|
{
|
||||||
|
if(_loc1_.getChildAt(_loc5_) is Shape)
|
||||||
|
{
|
||||||
|
_loc1_.getChildAt(_loc5_).visible = false;
|
||||||
|
}
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
_loc3_.graphics.beginFill(9069381);
|
||||||
|
_loc3_.graphics.drawRoundRect(0,0,286,60,14,14);
|
||||||
|
_loc3_.graphics.endFill();
|
||||||
|
_loc3_.graphics.beginFill(16774621);
|
||||||
|
_loc3_.graphics.drawRoundRect(2,2,282,56,12,12);
|
||||||
|
_loc3_.graphics.endFill();
|
||||||
|
_loc1_.addChildAt(_loc3_,0);
|
||||||
|
_loc4_ = _loc1_.txt.getTextFormat();
|
||||||
|
_loc4_.size = 13;
|
||||||
|
_loc1_.txt.x = 8;
|
||||||
|
_loc1_.txt.y = 5;
|
||||||
|
_loc1_.txt.width = 270;
|
||||||
|
_loc1_.txt.height = 50;
|
||||||
|
_loc1_.txt.multiline = true;
|
||||||
|
_loc1_.txt.wordWrap = true;
|
||||||
|
_loc1_.txt.mouseEnabled = false;
|
||||||
|
_loc1_.txt.text = "What happened? Type it here (up to 200 letters).";
|
||||||
|
_loc1_.txt.setTextFormat(_loc4_);
|
||||||
|
_loc4_ = _loc2_.defaultTextFormat;
|
||||||
|
_loc4_.size = 13;
|
||||||
|
_loc4_.color = 5649441;
|
||||||
|
_loc2_.defaultTextFormat = _loc4_;
|
||||||
|
_loc2_.type = "input";
|
||||||
|
_loc2_.selectable = true;
|
||||||
|
_loc2_.mouseEnabled = true;
|
||||||
|
_loc2_.visible = true;
|
||||||
|
_loc2_.multiline = true;
|
||||||
|
_loc2_.wordWrap = true;
|
||||||
|
_loc2_.x = 8;
|
||||||
|
_loc2_.y = 5;
|
||||||
|
_loc2_.width = 270;
|
||||||
|
_loc2_.height = 50;
|
||||||
|
_loc2_.maxChars = 200;
|
||||||
|
_loc2_.restrict = "^%";
|
||||||
|
_loc2_.text = "";
|
||||||
|
_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.addChildAt(_loc1_,_reportFromCard.getChildIndex(_reportFromCard.reasonChatTree));
|
||||||
|
_detailBar = _loc1_;
|
||||||
|
_detailInput = _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onDetailTyped(param1:Event) : void
|
||||||
|
{
|
||||||
|
_detailBar.txt.visible = _detailInput.text.length == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onClose(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(_hasReported && _agreeBox.checked)
|
||||||
|
{
|
||||||
|
if(!BuddyManager.isBlocked(_playersAvatarUserName) && _playersAvatarUserName != null && _playersAvatarUserName.length > 0)
|
||||||
|
{
|
||||||
|
BuddyXtCommManager.sendBuddyBlockRequest(_playersAvatarUserName);
|
||||||
|
delete PlayerWallManager.tokenMap[_playersAvatarUserName.toLowerCase()];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_closeCallback != null)
|
||||||
|
{
|
||||||
|
_closeCallback(_hasReported);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onReportBtnHandler(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(_detailInput != null && _detailInput.text.length > 0)
|
||||||
|
{
|
||||||
|
gMainFrame.server.setXtObject_Str("xrd",[_playersAvatarUserName,reasonIdForReason(_reportFromCard.reasonTxt.text),_detailInput.text]);
|
||||||
|
}
|
||||||
|
if(_reportAPlayer)
|
||||||
|
{
|
||||||
|
FacilitatorXtCommManager.sendReportAPlayerRequest(_playersAvatarUserName,reasonIdForReason(_reportFromCard.reasonTxt.text),reportAPlayerResponse);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FacilitatorXtCommManager.sendReportWithAdditionalDataRequest(_playersAvatarUserName,_reasonsType == 3 ? 7 : 8,reasonIdForReason(_reportFromCard.reasonTxt.text),_dataToPassAlong as String,reportAPlayerResponse);
|
||||||
|
}
|
||||||
|
_reportFromCardPopup.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function reasonIdForReason(param1:String) : int
|
||||||
|
{
|
||||||
|
switch(param1)
|
||||||
|
{
|
||||||
|
case _reasonToId[0]:
|
||||||
|
return 1;
|
||||||
|
case _reasonToId[1]:
|
||||||
|
return 2;
|
||||||
|
case _reasonToId[2]:
|
||||||
|
return 5;
|
||||||
|
case _reasonToId[3]:
|
||||||
|
return 3;
|
||||||
|
case _reasonToId[4]:
|
||||||
|
return 4;
|
||||||
|
case _reasonToId[5]:
|
||||||
|
return 6;
|
||||||
|
case _reasonToId[6]:
|
||||||
|
return 7;
|
||||||
|
case _reasonToId[7]:
|
||||||
|
return 13;
|
||||||
|
case _reasonToId[8]:
|
||||||
|
return 14;
|
||||||
|
case _reasonToId[9]:
|
||||||
|
return 15;
|
||||||
|
case _reasonToId[10]:
|
||||||
|
return 16;
|
||||||
|
default:
|
||||||
|
throw new Error("Reason for reporting is invalid. Reason: " + param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onNoHandler(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
onClose(param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onReasonHandler(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
if(!_reportFromCard.reasonChatTree.visible)
|
||||||
|
{
|
||||||
|
SafeChatManager.openSafeChat(true,_reportFromCard.reasonChatTree);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SafeChatManager.closeSafeChat(_reportFromCard.reasonChatTree);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onReasonTextClose(param1:String, param2:String) : void
|
||||||
|
{
|
||||||
|
_reportFromCard.reasonTxt.text = param1;
|
||||||
|
SafeChatManager.closeSafeChat(_reportFromCard.reasonChatTree);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onRules(param1:MouseEvent) : void
|
||||||
|
{
|
||||||
|
param1.stopPropagation();
|
||||||
|
GuiManager.displayRulesPopup(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function reportAPlayerResponse(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
_reportConfirmMediaHelper = new MediaHelper();
|
||||||
|
_reportConfirmMediaHelper.init(2694,onReportConfirmLoaded,param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onReportConfirmLoaded(param1:MovieClip) : void
|
||||||
|
{
|
||||||
|
DarkenManager.showLoadingSpiral(false);
|
||||||
|
_reportFromCardConfirmPopup = MovieClip(param1.getChildAt(0));
|
||||||
|
_reportFromCardConfirmPopup.x = _reportFromCardPopup.x;
|
||||||
|
_reportFromCardConfirmPopup.y = _reportFromCardPopup.y;
|
||||||
|
if(param1.passback)
|
||||||
|
{
|
||||||
|
LocalizationManager.translateId(_reportFromCardConfirmPopup.titleTxt,11374);
|
||||||
|
_hasReported = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LocalizationManager.translateId(_reportFromCardConfirmPopup.titleTxt,11375);
|
||||||
|
}
|
||||||
|
_reportFromCardConfirmPopup.okBtn.addEventListener("mouseDown",onClose,false,0,true);
|
||||||
|
_agreeBox = new GuiCheckBox(_reportFromCardConfirmPopup.agree_box);
|
||||||
|
_agreeBox.init(_reportFromCardConfirmPopup.bodyTxt);
|
||||||
|
_agreeBox.checked = true;
|
||||||
|
_reportConfirmMediaHelper.destroy();
|
||||||
|
_reportConfirmMediaHelper = null;
|
||||||
|
_popupLayer.addChild(_reportFromCardConfirmPopup);
|
||||||
|
DarkenManager.darken(_reportFromCardConfirmPopup);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get visible() : Boolean
|
||||||
|
{
|
||||||
|
if(_reportPopup)
|
||||||
|
{
|
||||||
|
return _reportPopup.visible;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addListeners() : void
|
||||||
|
{
|
||||||
|
if(_isFromPlayersCard)
|
||||||
|
{
|
||||||
|
if(_reportFromCardPopup)
|
||||||
|
{
|
||||||
|
_reportFromCardPopup.skin.s["bx"].addEventListener("mouseDown",onClose,false,0,true);
|
||||||
|
}
|
||||||
|
_reportFromCard.reportBtn.addEventListener("mouseDown",onReportBtnHandler,false,0,true);
|
||||||
|
_reportFromCard.noBtn.addEventListener("mouseDown",onNoHandler,false,0,true);
|
||||||
|
_reportFromCard.addTxtBtn.addEventListener("mouseDown",onReasonHandler,false,0,true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(_reportPopup)
|
||||||
|
{
|
||||||
|
_reportPopup.skin.s["bx"].addEventListener("mouseDown",onClose,false,0,true);
|
||||||
|
}
|
||||||
|
_report.rulesReportBtn.addEventListener("mouseDown",onRules,false,0,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function removeListeners() : void
|
||||||
|
{
|
||||||
|
if(_isFromPlayersCard)
|
||||||
|
{
|
||||||
|
if(_reportFromCardPopup)
|
||||||
|
{
|
||||||
|
_reportFromCardPopup.skin.s["bx"].removeEventListener("mouseDown",onClose);
|
||||||
|
}
|
||||||
|
if(_reportFromCardConfirmPopup)
|
||||||
|
{
|
||||||
|
_reportFromCardConfirmPopup.okBtn.addEventListener("mouseDown",onClose);
|
||||||
|
}
|
||||||
|
_reportFromCard.reportBtn.removeEventListener("mouseDown",onReportBtnHandler);
|
||||||
|
_reportFromCard.noBtn.removeEventListener("mouseDown",onNoHandler);
|
||||||
|
_reportFromCard.addTxtBtn.addEventListener("mouseDown",onReasonHandler);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(_reportPopup)
|
||||||
|
{
|
||||||
|
_reportPopup.skin.s["bx"].removeEventListener("mouseDown",onClose);
|
||||||
|
}
|
||||||
|
_report.rulesReportBtn.removeEventListener("mouseDown",onRules);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+3036
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,336 @@
|
|||||||
|
package shop
|
||||||
|
{
|
||||||
|
import avatar.AvatarManager;
|
||||||
|
import flash.utils.Dictionary;
|
||||||
|
import gui.DarkenManager;
|
||||||
|
import gui.GuiManager;
|
||||||
|
import inventory.Iitem;
|
||||||
|
|
||||||
|
public class ShopManager
|
||||||
|
{
|
||||||
|
|
||||||
|
public static const SHOP_MEDIA_ID:int = 3934;
|
||||||
|
|
||||||
|
public static const SHOP_CHARM_BUY_MEDIA_ID:int = 6620;
|
||||||
|
|
||||||
|
public static const DEN_EDIT_TUTORIAL_SHOP_PREVIEW:int = 6;
|
||||||
|
|
||||||
|
public static const DEN_EDIT_TUTORIAL_SHOP_BUY:int = 7;
|
||||||
|
|
||||||
|
public static const DEN_EDIT_TUTORIAL_COMPLETE:int = 8;
|
||||||
|
|
||||||
|
public static const MAX_STORE_ITEMS:int = 24;
|
||||||
|
|
||||||
|
private static const EXTENDED_ITEM_COUNT_BIT_INDEX:int = 1;
|
||||||
|
|
||||||
|
private static const NUM_EXTRA_SLOTS_DEN:int = 1600;
|
||||||
|
|
||||||
|
private static const NUM_EXTRA_SLOTS_ACC:int = 900;
|
||||||
|
|
||||||
|
private static const NUM_ACC_SLOTS:int = 100;
|
||||||
|
|
||||||
|
private static const NUM_DEN_SLOTS:int = 400;
|
||||||
|
|
||||||
|
private static const NUM_AUDIO_SLOTS:int = 48;
|
||||||
|
|
||||||
|
private static const WARNING_ITEM_COUNT:int = 95;
|
||||||
|
|
||||||
|
private static const WARNING_DEN_ITEM_COUNT:int = 395;
|
||||||
|
|
||||||
|
private static const WARNING_DEN_AUDIO_COUNT:int = 45;
|
||||||
|
|
||||||
|
private static const WARNING_DEN_ROOM_COUNT_OFFSET:int = 3;
|
||||||
|
|
||||||
|
public static var currentOpenShopId:int = 0;
|
||||||
|
|
||||||
|
private static var _shop:Shop;
|
||||||
|
|
||||||
|
private static var _bundleShop:BundleShop;
|
||||||
|
|
||||||
|
private static var _numRemovedCount:int;
|
||||||
|
|
||||||
|
private static var _allRemovalsSucceeded:Boolean;
|
||||||
|
|
||||||
|
private static var _itemSoldPopup:ItemSoldPopup;
|
||||||
|
|
||||||
|
private static var _itemsSold:Array;
|
||||||
|
|
||||||
|
public static var myShopItems:Dictionary = new Dictionary();
|
||||||
|
|
||||||
|
public function ShopManager()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5,000 of each here, as this server counts (lib/items.js, lib/dens.js).
|
||||||
|
public static function get maxItems() : int
|
||||||
|
{
|
||||||
|
return 5000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get maxDenItems() : int
|
||||||
|
{
|
||||||
|
return 5000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get maxAudioItems() : int
|
||||||
|
{
|
||||||
|
return 48;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get warningItemCount() : int
|
||||||
|
{
|
||||||
|
if((gMainFrame.userInfo.pendingFlags & 1 << 1) != 0)
|
||||||
|
{
|
||||||
|
return 95 + 900;
|
||||||
|
}
|
||||||
|
return 95;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get warningDenItemCount() : int
|
||||||
|
{
|
||||||
|
if((gMainFrame.userInfo.pendingFlags & 1 << 1) != 0)
|
||||||
|
{
|
||||||
|
return 395 + 1600;
|
||||||
|
}
|
||||||
|
return 395;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get warningAudioItemCount() : int
|
||||||
|
{
|
||||||
|
return 45;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get warningDenRoomCount() : int
|
||||||
|
{
|
||||||
|
return 200 - 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function isWorldShopOpen() : Boolean
|
||||||
|
{
|
||||||
|
return _shop != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function closeWorldShop() : void
|
||||||
|
{
|
||||||
|
if(_shop)
|
||||||
|
{
|
||||||
|
_shop.destroy();
|
||||||
|
_shop = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function launchStore(param1:int, param2:int) : void
|
||||||
|
{
|
||||||
|
if(_shop)
|
||||||
|
{
|
||||||
|
_shop.destroy();
|
||||||
|
}
|
||||||
|
if((param2 == 1000 || param1 == 168 || param1 == 415 || param1 == 626 || param1 >= 676 && param1 <= 681) && param1 != 338 && param1 != 669)
|
||||||
|
{
|
||||||
|
_shop = new ShopWithPreview();
|
||||||
|
_shop.init(param1,param2,AvatarManager.playerAvatar,GuiManager.guiLayer,onShopClose);
|
||||||
|
}
|
||||||
|
else if(param1 == 1)
|
||||||
|
{
|
||||||
|
_bundleShop = new BundleShop(onShopClose);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_shop = new Shop();
|
||||||
|
_shop.init(param1,param2,AvatarManager.playerAvatar,GuiManager.guiLayer,onShopClose);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function launchDenShopStore(param1:int) : void
|
||||||
|
{
|
||||||
|
if(_shop)
|
||||||
|
{
|
||||||
|
_shop.destroy();
|
||||||
|
}
|
||||||
|
currentOpenShopId = param1;
|
||||||
|
_shop = new ShopToSell();
|
||||||
|
_shop.init(param1,0,AvatarManager.playerAvatar,GuiManager.guiLayer,onShopClose);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function onShopClose(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
currentOpenShopId = 0;
|
||||||
|
if(_shop)
|
||||||
|
{
|
||||||
|
_shop.destroy();
|
||||||
|
_shop = null;
|
||||||
|
}
|
||||||
|
if(_bundleShop)
|
||||||
|
{
|
||||||
|
_bundleShop = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function ifShopToSellOpenCloseIt(param1:int = -1) : Boolean
|
||||||
|
{
|
||||||
|
if(_shop && _shop is ShopToSell)
|
||||||
|
{
|
||||||
|
if(param1 == -1 || (_shop as ShopToSell).isDenSaleShopOwner && (_shop as ShopToSell).shopInvId == param1)
|
||||||
|
{
|
||||||
|
onShopClose(false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function addShopItemToMyList(param1:MyShopData) : void
|
||||||
|
{
|
||||||
|
if(myShopItems == null)
|
||||||
|
{
|
||||||
|
myShopItems = new Dictionary();
|
||||||
|
}
|
||||||
|
myShopItems[param1.storeInvId] = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function clearShopItems(param1:int) : void
|
||||||
|
{
|
||||||
|
delete myShopItems[param1];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function updateShopState(param1:int, param2:String) : void
|
||||||
|
{
|
||||||
|
if(myShopItems[param1])
|
||||||
|
{
|
||||||
|
myShopItems[param1].state = param2;
|
||||||
|
}
|
||||||
|
if(_shop && _shop is ShopToSell)
|
||||||
|
{
|
||||||
|
(_shop as ShopToSell).updateMyShopDataState(param2,param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function removeShopItemFromMyList(param1:int, param2:Iitem, param3:int) : void
|
||||||
|
{
|
||||||
|
var _loc6_:* = undefined;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc4_:MyShopData = myShopItems[param1];
|
||||||
|
if(_loc4_)
|
||||||
|
{
|
||||||
|
_loc6_ = _loc4_.shopItems;
|
||||||
|
_loc5_ = 0;
|
||||||
|
while(_loc5_ < _loc6_.length)
|
||||||
|
{
|
||||||
|
if(_loc6_[_loc5_].currItem.itemType == param2.itemType && _loc6_[_loc5_].currItem.defId == param2.defId && _loc6_[_loc5_].currItem.invIdx == param3)
|
||||||
|
{
|
||||||
|
_loc6_.splice(_loc5_,1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_shop && _shop is ShopToSell)
|
||||||
|
{
|
||||||
|
(_shop as ShopToSell).removeItemFromStore(param2,param3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function findAndRemoveDenShopItems(param1:Vector.<MyShopItem>, param2:Function, param3:Object) : void
|
||||||
|
{
|
||||||
|
var _loc7_:MyShopData = null;
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
var _loc4_:MyShopData = null;
|
||||||
|
DarkenManager.showLoadingSpiral(true);
|
||||||
|
var _loc5_:Dictionary = new Dictionary();
|
||||||
|
_numRemovedCount = 0;
|
||||||
|
_allRemovalsSucceeded = true;
|
||||||
|
_loc8_ = 0;
|
||||||
|
while(_loc8_ < param1.length)
|
||||||
|
{
|
||||||
|
_loc7_ = myShopItems[param1[_loc8_].shopInvIdx];
|
||||||
|
if(_loc7_)
|
||||||
|
{
|
||||||
|
if(_loc5_[param1[_loc8_].shopInvIdx] == null)
|
||||||
|
{
|
||||||
|
_loc6_++;
|
||||||
|
_loc5_[param1[_loc8_].shopInvIdx] = {
|
||||||
|
"shopData":_loc7_,
|
||||||
|
"removedItems":new Vector.<MyShopItem>()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
_loc5_[param1[_loc8_].shopInvIdx].removedItems.push(param1[_loc8_]);
|
||||||
|
}
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
if(_loc6_ > 0)
|
||||||
|
{
|
||||||
|
for each(var _loc9_:Object in _loc5_)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc9_.shopData;
|
||||||
|
ShopToSellXtCommManager.requestStoreUpdateItems(_loc4_.storeInvId,_loc4_.state,null,_loc9_.removedItems,null,onRemovalComplete,{
|
||||||
|
"totalRequests":_loc6_,
|
||||||
|
"callback":param2,
|
||||||
|
"passback":param3
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param2(true,param3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function onRemovalComplete(param1:Boolean, param2:Object) : void
|
||||||
|
{
|
||||||
|
if(!param1)
|
||||||
|
{
|
||||||
|
_allRemovalsSucceeded = false;
|
||||||
|
}
|
||||||
|
_numRemovedCount = _numRemovedCount + 1;
|
||||||
|
if(param2.totalRequests == _numRemovedCount)
|
||||||
|
{
|
||||||
|
if(param2.callback != null)
|
||||||
|
{
|
||||||
|
param2.callback(_allRemovalsSucceeded,param2.passback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function showItemSoldPopup(param1:Iitem, param2:int, param3:int, param4:int = -1) : void
|
||||||
|
{
|
||||||
|
if(_itemSoldPopup)
|
||||||
|
{
|
||||||
|
if(_itemsSold == null)
|
||||||
|
{
|
||||||
|
_itemsSold = [];
|
||||||
|
}
|
||||||
|
_itemsSold.push({
|
||||||
|
"shopItem":param1,
|
||||||
|
"soldAmount":param2,
|
||||||
|
"currencyType":param3
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_itemSoldPopup = new ItemSoldPopup(param1,param2,param3,onCloseSoldPopup,param4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function onCloseSoldPopup(param1:int) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Object = null;
|
||||||
|
if(_itemSoldPopup)
|
||||||
|
{
|
||||||
|
_itemSoldPopup.destroy();
|
||||||
|
_itemSoldPopup = null;
|
||||||
|
}
|
||||||
|
if(_itemsSold && _itemsSold.length > 0)
|
||||||
|
{
|
||||||
|
_loc2_ = _itemsSold.pop();
|
||||||
|
_itemSoldPopup = new ItemSoldPopup(_loc2_.shopItem,_loc2_.soldAmount,_loc2_.currencyType,onCloseSoldPopup,param1);
|
||||||
|
}
|
||||||
|
else if(param1 != -1)
|
||||||
|
{
|
||||||
|
launchDenShopStore(param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,863 @@
|
|||||||
|
package avatar
|
||||||
|
{
|
||||||
|
import com.adobe.utils.StringUtil;
|
||||||
|
import com.sbi.client.SFEvent;
|
||||||
|
import com.sbi.debug.DebugUtility;
|
||||||
|
import com.sbi.popup.SBAJOkPopup;
|
||||||
|
import com.sbi.popup.SBYesNoPopup;
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
import flash.display.Sprite;
|
||||||
|
import flash.events.MouseEvent;
|
||||||
|
import flash.external.ExternalInterface;
|
||||||
|
import flash.text.TextFormat;
|
||||||
|
import flash.utils.setTimeout;
|
||||||
|
import game.MinigameInfo;
|
||||||
|
import game.MinigameManager;
|
||||||
|
import gui.ActionManager;
|
||||||
|
import gui.ChatHistory;
|
||||||
|
import gui.EmoticonManager;
|
||||||
|
import gui.EmoticonUtility;
|
||||||
|
import gui.GuiManager;
|
||||||
|
import gui.SafeChatManager;
|
||||||
|
import loader.DefPacksDefHelper;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
import nodeHop.NodeHopXtCommManager;
|
||||||
|
import quest.QuestManager;
|
||||||
|
import quest.QuestXtCommManager;
|
||||||
|
import room.RoomManagerWorld;
|
||||||
|
|
||||||
|
public class UserCommXtCommManager
|
||||||
|
{
|
||||||
|
|
||||||
|
public static var RAW_STR:String;
|
||||||
|
|
||||||
|
private static const BROADCAST_MESSAGE_LOC_ID_UPDATING_AJ_FULL_DEPLOY_IN_ONE_MINUTE:int = 22368;
|
||||||
|
|
||||||
|
private static const BROADCAST_MESSAGE_LOC_ID_UPDATING_AJ_FULL_DEPLOY_IN_N_MINUTES:int = 22367;
|
||||||
|
|
||||||
|
private static const BROADCAST_MESSAGE_LOC_ID_UPDATING_AJ_HOTFIX_IN_ONE_MINUTE:int = 22370;
|
||||||
|
|
||||||
|
private static const BROADCAST_MESSAGE_LOC_ID_UPDATING_AJ_HOTFIX_IN_N_MINUTES:int = 22369;
|
||||||
|
|
||||||
|
private static var _drainPopupDelay:Number;
|
||||||
|
|
||||||
|
private static var _playerSfsUserId:int = -1;
|
||||||
|
|
||||||
|
private static var _mainHud:MovieClip;
|
||||||
|
|
||||||
|
private static var _chatHist:ChatHistory;
|
||||||
|
|
||||||
|
private static var _emoteMgr:EmoticonManager;
|
||||||
|
|
||||||
|
private static var _actionMgr:ActionManager;
|
||||||
|
|
||||||
|
private static var _roomMgr:RoomManagerWorld;
|
||||||
|
|
||||||
|
private static var _spellingCorrections:Object;
|
||||||
|
|
||||||
|
private static var _emoteDefs:Object;
|
||||||
|
|
||||||
|
private static var _specialWords:Object;
|
||||||
|
|
||||||
|
private static var _replacedWords:Object;
|
||||||
|
|
||||||
|
private static var _customPVPMessageCallback:Object;
|
||||||
|
|
||||||
|
private static var _customPVPPassback:Object;
|
||||||
|
|
||||||
|
private static var _originalPermEmoteBeingDisplayed:int;
|
||||||
|
|
||||||
|
private static var _secondPermEmoteInUse:Boolean;
|
||||||
|
|
||||||
|
public function UserCommXtCommManager()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function init() : void
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace("UserCommXtCommManager init - initializing");
|
||||||
|
_mainHud = GuiManager.mainHud;
|
||||||
|
_chatHist = GuiManager.chatHist;
|
||||||
|
_emoteMgr = GuiManager.emoteMgr;
|
||||||
|
_actionMgr = GuiManager.actionMgr;
|
||||||
|
_roomMgr = RoomManagerWorld.instance;
|
||||||
|
_drainPopupDelay = Math.random() * 10 * 60 * 1000;
|
||||||
|
if(_drainPopupDelay < 300000)
|
||||||
|
{
|
||||||
|
_drainPopupDelay = Math.random() * 10 * 60 * 1000;
|
||||||
|
}
|
||||||
|
_playerSfsUserId = AvatarManager.playerSfsUserId;
|
||||||
|
RAW_STR = gMainFrame.server.rawProtocolSeparator;
|
||||||
|
var _loc1_:DefPacksDefHelper = new DefPacksDefHelper();
|
||||||
|
_loc1_.init(1036,onEmoticonDefsLoaded,null,2);
|
||||||
|
DefPacksDefHelper.mediaArray[1036] = _loc1_;
|
||||||
|
_loc1_ = new DefPacksDefHelper();
|
||||||
|
_loc1_.init(10,onAutoCorrectListLoaded,null,1);
|
||||||
|
DefPacksDefHelper.mediaArray["10"] = _loc1_;
|
||||||
|
_specialWords = {};
|
||||||
|
_specialWords[LocalizationManager.translateIdOnly(14855)] = LocalizationManager.translateIdOnly(11142);
|
||||||
|
_originalPermEmoteBeingDisplayed = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function onAutoCorrectListLoaded(param1:DefPacksDefHelper) : void
|
||||||
|
{
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
DefPacksDefHelper.mediaArray["10"] = null;
|
||||||
|
var _loc2_:String = param1.def.toString().toLowerCase() as String;
|
||||||
|
_spellingCorrections = {};
|
||||||
|
_spellingCorrections["constructor"] = "constructor";
|
||||||
|
var _loc4_:Array = _loc2_.split("\r\n");
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < _loc4_.length)
|
||||||
|
{
|
||||||
|
_loc4_[_loc3_] = _loc4_[_loc3_].split(",");
|
||||||
|
if(!(_loc4_[_loc3_][0] == null || _loc4_[_loc3_][0].length == 0 || _loc4_[_loc3_][1] == null || _loc4_[_loc3_][1].length == 0))
|
||||||
|
{
|
||||||
|
_spellingCorrections[StringUtil.trim(_loc4_[_loc3_][0])] = StringUtil.trim(_loc4_[_loc3_][1]);
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function onEmoticonDefsLoaded(param1:DefPacksDefHelper) : void
|
||||||
|
{
|
||||||
|
DefPacksDefHelper.mediaArray[1036] = null;
|
||||||
|
var _loc3_:Object = param1.def;
|
||||||
|
var _loc2_:Object = {};
|
||||||
|
for each(var _loc4_:Object in _loc3_)
|
||||||
|
{
|
||||||
|
_loc2_[_loc4_.id] = int(_loc4_.mediaRef);
|
||||||
|
}
|
||||||
|
_emoteDefs = _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function destroy() : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function set playerSfsUserId(param1:int) : void
|
||||||
|
{
|
||||||
|
_playerSfsUserId = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getEmoticonMediaId(param1:int) : int
|
||||||
|
{
|
||||||
|
if(!_emoteDefs[param1])
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return _emoteDefs[param1];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getEmoticonDefId(param1:int) : int
|
||||||
|
{
|
||||||
|
for(var _loc2_:String in _emoteDefs)
|
||||||
|
{
|
||||||
|
if(_emoteDefs[_loc2_] == param1)
|
||||||
|
{
|
||||||
|
return int(_loc2_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function addChatMessage(param1:String) : void
|
||||||
|
{
|
||||||
|
_chatHist.addMessage(gMainFrame.userInfo.playerAvatarInfo.avName,gMainFrame.userInfo.playerAvatarInfo.userName,gMainFrame.userInfo.playerUserInfo.getModeratedUserName(),param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendAvatarSafeChat(param1:String, param2:String, param3:Boolean = true) : void
|
||||||
|
{
|
||||||
|
if(gMainFrame.clientInfo.invisMode)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
AvatarManager.addAvatarMessage(param1,_playerSfsUserId,0);
|
||||||
|
addChatMessage(param1);
|
||||||
|
gMainFrame.server.sendMessage(param2 + RAW_STR + 1);
|
||||||
|
if(_chatHist.enableFreeChatValue)
|
||||||
|
{
|
||||||
|
_chatHist.resetTreeSearch();
|
||||||
|
_chatHist.chatMsgText.text = "";
|
||||||
|
_chatHist.setFocusOnMsgText();
|
||||||
|
}
|
||||||
|
if(param3)
|
||||||
|
{
|
||||||
|
GuiManager.safeChatBtnDownHandler(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendAvatarEmote(param1:Sprite) : void
|
||||||
|
{
|
||||||
|
if(gMainFrame.clientInfo.invisMode)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
AvatarManager.setAvatarEmote(param1);
|
||||||
|
if(!EmoticonUtility.getEmoteString(param1))
|
||||||
|
{
|
||||||
|
throw new Error("setAvatarEmote: sent invalid emote sprite?!");
|
||||||
|
}
|
||||||
|
addChatMessage(EmoticonUtility.getEmoteString(param1));
|
||||||
|
gMainFrame.server.sendMessage(EmoticonUtility.idForEmote(param1) + RAW_STR + 2);
|
||||||
|
if(_chatHist.enableFreeChatValue)
|
||||||
|
{
|
||||||
|
_chatHist.resetTreeSearch();
|
||||||
|
_chatHist.chatMsgText.text = "";
|
||||||
|
_chatHist.setFocusOnMsgText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendAvatarAction(param1:Sprite) : void
|
||||||
|
{
|
||||||
|
if(gMainFrame.clientInfo.invisMode)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
AvatarManager.setAvatarAction(param1);
|
||||||
|
if(!_actionMgr.getActionString(param1))
|
||||||
|
{
|
||||||
|
throw new Error("setAvatarAction: sent invalid action sprite?!");
|
||||||
|
}
|
||||||
|
addChatMessage(_actionMgr.getActionString(param1));
|
||||||
|
var _loc2_:AvatarWorldView = AvatarManager.avatarViewList[AvatarManager.playerSfsUserId];
|
||||||
|
var _loc3_:int = _loc2_.lastIdleAnim;
|
||||||
|
gMainFrame.server.sendMessage(_actionMgr.getActionString(param1) + RAW_STR + 3 + RAW_STR + _loc3_);
|
||||||
|
if(_chatHist.enableFreeChatValue)
|
||||||
|
{
|
||||||
|
_chatHist.resetTreeSearch();
|
||||||
|
_chatHist.chatMsgText.text = "";
|
||||||
|
_chatHist.setFocusOnMsgText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendAvatarAttachmentEmot(param1:int, param2:String = null) : void
|
||||||
|
{
|
||||||
|
if(gMainFrame.clientInfo.invisMode)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param2 == null)
|
||||||
|
{
|
||||||
|
param2 = "";
|
||||||
|
}
|
||||||
|
gMainFrame.server.sendMessage(param1 + "," + param2 + RAW_STR + 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendAvatarBlendColor(param1:uint) : void
|
||||||
|
{
|
||||||
|
gMainFrame.server.sendMessage(int(param1) + RAW_STR + 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendAvatarAlphaLevel(param1:uint) : void
|
||||||
|
{
|
||||||
|
gMainFrame.server.sendMessage(int(param1) + RAW_STR + 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendChatMessage(param1:int, param2:String) : void
|
||||||
|
{
|
||||||
|
if(gMainFrame.clientInfo.invisMode || !Utility.canChat())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
param2 = fixMispellings(param2);
|
||||||
|
param2 = adjustCamelCase(param2);
|
||||||
|
AvatarManager.addAvatarMessage("...",param1,0);
|
||||||
|
param2 = adjustSpecialWords(param2);
|
||||||
|
var _loc3_:int = gMainFrame.userInfo.sgChatType == 1 ? 0 : 9;
|
||||||
|
gMainFrame.server.sendMessage(param2 + RAW_STR + _loc3_);
|
||||||
|
if(_chatHist.enableFreeChatValue)
|
||||||
|
{
|
||||||
|
_chatHist.resetTreeSearch();
|
||||||
|
_chatHist.chatMsgText.text = "";
|
||||||
|
gMainFrame.stage.focus = _chatHist.chatMsgText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function adjustSpecialWords(param1:String) : String
|
||||||
|
{
|
||||||
|
return param1;
|
||||||
|
var _loc4_:String = null;
|
||||||
|
var _loc7_:String = null;
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
var _loc9_:int = 0;
|
||||||
|
var _loc5_:String = null;
|
||||||
|
var _loc10_:String = null;
|
||||||
|
var _loc3_:String = null;
|
||||||
|
_replacedWords = {};
|
||||||
|
var _loc6_:Array = param1.split(" ");
|
||||||
|
var _loc11_:int = 0;
|
||||||
|
_loc8_ = 0;
|
||||||
|
while(_loc8_ < _loc6_.length)
|
||||||
|
{
|
||||||
|
_loc7_ = _loc6_[_loc8_];
|
||||||
|
_loc4_ = _loc7_.toLowerCase();
|
||||||
|
for(var _loc2_:String in _specialWords)
|
||||||
|
{
|
||||||
|
_loc9_ = _loc4_.indexOf(_loc2_);
|
||||||
|
if(_loc9_ >= 0)
|
||||||
|
{
|
||||||
|
_loc5_ = _loc7_.substr(0,_loc9_);
|
||||||
|
_loc10_ = _loc7_.substr(_loc9_,_loc2_.length);
|
||||||
|
_loc3_ = _loc7_.substr(_loc9_ + _loc2_.length);
|
||||||
|
_loc11_ = getCaseType(_loc10_);
|
||||||
|
_loc10_ = setCaseType(_specialWords[_loc2_],_loc11_);
|
||||||
|
_loc6_[_loc8_] = _loc5_ + _loc10_ + _loc3_;
|
||||||
|
_replacedWords[_loc6_[_loc8_]] = _loc7_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
return _loc6_.join(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function getCaseType(param1:String) : int
|
||||||
|
{
|
||||||
|
if(param1.toLowerCase() == param1)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
var _loc3_:String = param1.charAt(0);
|
||||||
|
var _loc2_:int = int(param1.match(/[A-Z]/g).length);
|
||||||
|
if(_loc2_ == param1.length)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function setCaseType(param1:String, param2:int) : String
|
||||||
|
{
|
||||||
|
if(param2 == 0)
|
||||||
|
{
|
||||||
|
return param1.toLowerCase();
|
||||||
|
}
|
||||||
|
if(param2 == 1)
|
||||||
|
{
|
||||||
|
return param1.toUpperCase();
|
||||||
|
}
|
||||||
|
param1 = param1.toLowerCase();
|
||||||
|
var _loc3_:String = param1.charAt(0).toUpperCase();
|
||||||
|
return _loc3_ + param1.substr(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function reverseSpecialWords(param1:String) : String
|
||||||
|
{
|
||||||
|
var _loc3_:String = null;
|
||||||
|
var _loc4_:int = 0;
|
||||||
|
if(_replacedWords == null)
|
||||||
|
{
|
||||||
|
return param1;
|
||||||
|
}
|
||||||
|
var _loc2_:Array = param1.split(" ");
|
||||||
|
_loc4_ = 0;
|
||||||
|
while(_loc4_ < _loc2_.length)
|
||||||
|
{
|
||||||
|
_loc3_ = _loc2_[_loc4_].toLowerCase();
|
||||||
|
if(!(_replacedWords[_loc3_] == null || _loc3_ == "constructor"))
|
||||||
|
{
|
||||||
|
_loc2_[_loc4_] = _replacedWords[_loc3_];
|
||||||
|
}
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
_replacedWords = null;
|
||||||
|
return _loc2_.join(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function adjustCamelCase(param1:String) : String
|
||||||
|
{
|
||||||
|
return param1;
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc7_:String = null;
|
||||||
|
var _loc6_:String = null;
|
||||||
|
var _loc8_:String = null;
|
||||||
|
var _loc4_:int = 0;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc3_:Array = param1.split(" ");
|
||||||
|
_loc4_ = 0;
|
||||||
|
while(_loc4_ < _loc3_.length)
|
||||||
|
{
|
||||||
|
_loc6_ = _loc3_[_loc4_];
|
||||||
|
_loc7_ = _loc6_.match(/[a-zA-Z]/g).join("");
|
||||||
|
_loc8_ = _loc7_.charAt(0);
|
||||||
|
_loc2_ = int(_loc7_.match(/[A-Z]/g).length);
|
||||||
|
if(_loc2_ > 0 && _loc2_ != _loc7_.length)
|
||||||
|
{
|
||||||
|
if(_loc8_.match(/[A-z]/g).length == 1)
|
||||||
|
{
|
||||||
|
_loc5_ = getIndexOfFirstLetter(_loc6_,_loc7_);
|
||||||
|
_loc3_[_loc4_] = _loc6_.substr(0,_loc5_) + _loc8_ + _loc6_.toLowerCase().substr(_loc5_ + 1,_loc6_.length);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc3_[_loc4_] = _loc6_.toLowerCase();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
return _loc3_.join(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getFirstLetter(param1:String) : String
|
||||||
|
{
|
||||||
|
var _loc2_:String = param1.match(/[a-zA-Z]/g).join("");
|
||||||
|
if(_loc2_.length > 0)
|
||||||
|
{
|
||||||
|
return _loc2_.charAt(0);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getIndexOfFirstLetter(param1:String, param2:String) : int
|
||||||
|
{
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
if(param2 == "")
|
||||||
|
{
|
||||||
|
param2 = param1.match(/[a-zA-Z]/g).join();
|
||||||
|
}
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < param1.length)
|
||||||
|
{
|
||||||
|
if(param1.charAt(_loc3_) == param2.charAt(0))
|
||||||
|
{
|
||||||
|
return _loc3_;
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fixMispellings(param1:String) : String
|
||||||
|
{
|
||||||
|
return param1;
|
||||||
|
var _loc4_:String = null;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
if(!_spellingCorrections || LocalizationManager.currentLanguage != LocalizationManager.LANG_ENG)
|
||||||
|
{
|
||||||
|
return param1;
|
||||||
|
}
|
||||||
|
var _loc2_:Array = param1.split(" ");
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < _loc2_.length)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc2_[_loc3_].toLowerCase();
|
||||||
|
_loc4_ = stripPunctuation(_loc4_);
|
||||||
|
if(_spellingCorrections[_loc4_] != null)
|
||||||
|
{
|
||||||
|
_loc4_ = _spellingCorrections[_loc4_];
|
||||||
|
_loc2_[_loc3_] = _loc4_;
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
return _loc2_.join(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function stripPunctuation(param1:String) : String
|
||||||
|
{
|
||||||
|
return param1.replace(/[^A-Za-z0-9 ']+/g,"");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendAvatarSlide(param1:String) : void
|
||||||
|
{
|
||||||
|
if(gMainFrame.clientInfo.invisMode)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
gMainFrame.server.sendMessage(param1 + RAW_STR + 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendPermEmote(param1:int) : void
|
||||||
|
{
|
||||||
|
if(_originalPermEmoteBeingDisplayed != -1)
|
||||||
|
{
|
||||||
|
if(param1 == -1)
|
||||||
|
{
|
||||||
|
if(_secondPermEmoteInUse)
|
||||||
|
{
|
||||||
|
param1 = _originalPermEmoteBeingDisplayed;
|
||||||
|
_secondPermEmoteInUse = false;
|
||||||
|
}
|
||||||
|
_originalPermEmoteBeingDisplayed = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_secondPermEmoteInUse = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_originalPermEmoteBeingDisplayed = param1;
|
||||||
|
}
|
||||||
|
gMainFrame.server.sendMessage(param1 + RAW_STR + 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendPetAction(param1:int, param2:int = 0) : void
|
||||||
|
{
|
||||||
|
gMainFrame.server.sendMessage(param1 + "," + param2 + RAW_STR + 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendCustomAdventureMessage(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
gMainFrame.server.sendMessage((param1 ? "on" : "off") + RAW_STR + 11);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendCustomPVPMessage(param1:Boolean, param2:int, param3:Function = null, param4:Object = null) : void
|
||||||
|
{
|
||||||
|
_customPVPMessageCallback = param3;
|
||||||
|
_customPVPPassback = param4;
|
||||||
|
gMainFrame.server.sendMessage((param1 ? "on" : "off") + RAW_STR + 12 + RAW_STR + param2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function onSendMessage(param1:MouseEvent, param2:String = "") : void
|
||||||
|
{
|
||||||
|
var _loc5_:Sprite = null;
|
||||||
|
var _loc4_:String = null;
|
||||||
|
if(_playerSfsUserId == -1)
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace("WARNING - UserCommXtCommManager.init was never called or the playerAvatarId is bad");
|
||||||
|
_playerSfsUserId = AvatarManager.playerSfsUserId;
|
||||||
|
}
|
||||||
|
var _loc3_:String = param2 == "" ? _mainHud.chatBar.text01_chat.text : param2;
|
||||||
|
_loc3_ = _loc3_.split("\r").join("");
|
||||||
|
_loc3_ = _loc3_.split(RAW_STR).join("");
|
||||||
|
_loc3_ = StringUtil.trim(_loc3_);
|
||||||
|
if(_loc3_.length <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var _loc6_:Object = EmoticonUtility.matchEmoteString(_loc3_);
|
||||||
|
if(_loc6_.status)
|
||||||
|
{
|
||||||
|
if(_loc6_.sprite)
|
||||||
|
{
|
||||||
|
sendAvatarEmote(_loc6_.sprite);
|
||||||
|
AvatarManager.setAvatarEmote(_loc6_.sprite,-2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc5_ = _actionMgr.matchActionString(_loc3_);
|
||||||
|
if(_loc5_)
|
||||||
|
{
|
||||||
|
sendAvatarAction(_loc5_);
|
||||||
|
AvatarManager.setAvatarAction(_loc5_,-2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc4_ = SafeChatManager.safeChatCodeForString(onSendMessage,[param1,param2],_loc3_,gMainFrame.clientInfo.roomType == 7 && !QuestManager.isQuestLikeNormalRoom() ? 4 : 0);
|
||||||
|
if(_loc4_ == "")
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(_loc4_)
|
||||||
|
{
|
||||||
|
sendAvatarSafeChat(_loc3_,_loc4_,false);
|
||||||
|
AvatarManager.addAvatarMessage(_loc3_,_playerSfsUserId,0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sendChatMessage(_playerSfsUserId,_loc3_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_chatHist.resetTreeSearch();
|
||||||
|
_chatHist.chatMsgText.text = "";
|
||||||
|
gMainFrame.stage.focus = _chatHist.chatMsgText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function handleXtReply(param1:SFEvent) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Array = param1.obj;
|
||||||
|
switch(_loc2_[0])
|
||||||
|
{
|
||||||
|
case "uc":
|
||||||
|
userCommChatResponse(_loc2_);
|
||||||
|
break;
|
||||||
|
case "ua":
|
||||||
|
userCommAdminMessageResponse(_loc2_);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error("UserCommXtCommManager illegal data:" + _loc2_[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function userCommChatResponse(param1:Array) : void
|
||||||
|
{
|
||||||
|
var _loc2_:String = null;
|
||||||
|
var _loc17_:int = 0;
|
||||||
|
var _loc4_:Array = null;
|
||||||
|
var _loc13_:Array = null;
|
||||||
|
var _loc11_:Array = null;
|
||||||
|
var _loc3_:Object = null;
|
||||||
|
var _loc15_:Array = null;
|
||||||
|
var _loc7_:MinigameInfo = null;
|
||||||
|
var _loc14_:Boolean = false;
|
||||||
|
var _loc18_:String = null;
|
||||||
|
var _loc9_:Sprite = null;
|
||||||
|
var _loc5_:Sprite = null;
|
||||||
|
var _loc10_:Array = null;
|
||||||
|
var _loc12_:int = 0;
|
||||||
|
var _loc8_:Avatar = null;
|
||||||
|
var _loc16_:Array = null;
|
||||||
|
var _loc19_:int = int(param1[2]);
|
||||||
|
var _loc20_:int = int(param1[4]);
|
||||||
|
var _loc6_:Boolean = true;
|
||||||
|
if(_loc6_)
|
||||||
|
{
|
||||||
|
if(_loc20_ == 5)
|
||||||
|
{
|
||||||
|
_loc17_ = int(param1[3]);
|
||||||
|
if(_loc17_ >= 0)
|
||||||
|
{
|
||||||
|
AvatarManager.setAvatarEmote(null,_loc19_,_loc17_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AvatarManager.setChatBalloonReadyForClear(_loc19_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_loc20_ == 6)
|
||||||
|
{
|
||||||
|
if(_loc19_ != gMainFrame.server.userId)
|
||||||
|
{
|
||||||
|
_roomMgr.attachAvatarToSlide(AvatarManager.avatarViewList[_loc19_],param1[3]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_loc20_ == 7)
|
||||||
|
{
|
||||||
|
_loc4_ = param1[3].split(",");
|
||||||
|
AvatarManager.setPetAction(_loc19_,_loc4_[0],_loc4_[1]);
|
||||||
|
}
|
||||||
|
else if(_loc20_ == 11)
|
||||||
|
{
|
||||||
|
_loc2_ = param1[3];
|
||||||
|
if(_loc2_ == "off")
|
||||||
|
{
|
||||||
|
AvatarManager.addCustomAdventureMessage("","off",_loc19_,0,0);
|
||||||
|
if(_loc19_ == AvatarManager.playerSfsUserId)
|
||||||
|
{
|
||||||
|
QuestManager.privateAdventureJoinClose(false,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc13_ = _loc2_.split("|");
|
||||||
|
_loc11_ = _loc13_[0].split(",");
|
||||||
|
_loc3_ = QuestXtCommManager.getScriptDef(_loc11_[0]);
|
||||||
|
if(_loc3_)
|
||||||
|
{
|
||||||
|
AvatarManager.addCustomAdventureMessage(LocalizationManager.translateIdOnly(_loc3_.titleStrId),_loc13_[1] + "|" + _loc11_[0],_loc19_,_loc11_[2],int(param1[5]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(_loc20_ == 12)
|
||||||
|
{
|
||||||
|
_loc2_ = param1[3];
|
||||||
|
_loc15_ = param1[3].split("|");
|
||||||
|
_loc7_ = MinigameManager.minigameInfoCache.getMinigameInfo(_loc15_[1]);
|
||||||
|
if(_loc15_[0] == "off")
|
||||||
|
{
|
||||||
|
if(_loc19_ == AvatarManager.playerSfsUserId)
|
||||||
|
{
|
||||||
|
MinigameManager.readySelfForQuickMinigame(null,false);
|
||||||
|
MinigameManager.readySelfForPvpGame(null,null,false);
|
||||||
|
}
|
||||||
|
AvatarManager.addCustomPvpMessage("",_loc15_[0],_loc19_,0,0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(_loc19_ == AvatarManager.playerSfsUserId)
|
||||||
|
{
|
||||||
|
MinigameManager.readySelfForPvpGame({"typeDefId":_loc15_[1]},null,true,true);
|
||||||
|
GuiManager.grayOutHudItemsForPrivateLobby(true,true);
|
||||||
|
}
|
||||||
|
AvatarManager.addCustomPvpMessage(LocalizationManager.translateIdOnly(_loc7_.titleStrId),_loc2_,_loc19_,0,int(param1[5]));
|
||||||
|
}
|
||||||
|
if(_customPVPMessageCallback)
|
||||||
|
{
|
||||||
|
if(_customPVPPassback != null)
|
||||||
|
{
|
||||||
|
if(_customPVPPassback.hasOwnProperty("gameInfo"))
|
||||||
|
{
|
||||||
|
_customPVPMessageCallback(_customPVPPassback.gameInfo,_customPVPPassback.currUserName,_customPVPPassback.currUserNameModerated);
|
||||||
|
}
|
||||||
|
else if(_customPVPPassback.hasOwnProperty("gameEntry"))
|
||||||
|
{
|
||||||
|
_customPVPMessageCallback(_customPVPPassback.gameEntry,_customPVPPassback.frgJoinedCallback,_customPVPPassback.skipGameCard,_customPVPPassback.gameCloseCallback,_customPVPPassback.optionalParam);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_customPVPMessageCallback(_customPVPPassback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_customPVPMessageCallback();
|
||||||
|
}
|
||||||
|
_customPVPMessageCallback = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_ = param1[3];
|
||||||
|
_loc14_ = false;
|
||||||
|
if(_loc20_ == 1)
|
||||||
|
{
|
||||||
|
_loc18_ = SafeChatManager.safeChatStringForCode(userCommChatResponse,[param1],_loc2_);
|
||||||
|
if(_loc18_ == "")
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(_loc18_)
|
||||||
|
{
|
||||||
|
_loc2_ = _loc18_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc14_ = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!_loc14_)
|
||||||
|
{
|
||||||
|
switch(_loc20_)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
case 9:
|
||||||
|
_loc2_ = adjustCamelCase(_loc2_);
|
||||||
|
if(_loc19_ == gMainFrame.server.userId)
|
||||||
|
{
|
||||||
|
_loc2_ = reverseSpecialWords(_loc2_);
|
||||||
|
}
|
||||||
|
AvatarManager.addAvatarMessage(_loc2_,_loc19_,int(param1[5]));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
_loc9_ = EmoticonUtility.emoteForId(int(_loc2_));
|
||||||
|
if(_loc9_)
|
||||||
|
{
|
||||||
|
AvatarManager.setAvatarEmote(_loc9_,_loc19_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc14_ = true;
|
||||||
|
}
|
||||||
|
_loc2_ = EmoticonUtility.stringForId(int(_loc2_));
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
_loc5_ = _actionMgr.matchActionString(_loc2_);
|
||||||
|
if(_loc5_)
|
||||||
|
{
|
||||||
|
AvatarManager.setAvatarAction(_loc5_,_loc19_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc14_ = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
_loc10_ = _loc2_.split(",");
|
||||||
|
_loc12_ = int(_loc10_[0]);
|
||||||
|
AvatarManager._setAvatarAttachmentEmot(_loc12_,_loc10_[1],_loc19_);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
AvatarManager._setAvatarBlendColor(_loc19_,uint(param1[3]));
|
||||||
|
return;
|
||||||
|
case 10:
|
||||||
|
AvatarManager._setAvatarAlphaLevel(_loc19_,uint(param1[3]));
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
_loc14_ = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc14_)
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace("WARNING - got bad chat! msg:" + _loc2_ + " chatType:" + _loc20_ + " from userId:" + _loc19_);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(_loc20_ != 4)
|
||||||
|
{
|
||||||
|
if(gMainFrame.clientInfo.extCallsActive)
|
||||||
|
{
|
||||||
|
_loc8_ = AvatarManager.getAvatarBySfsUserId(_loc19_);
|
||||||
|
DebugUtility.debugTrace("mrc:sending cm command - chattyUserId:" + _loc19_ + " chattyAv:" + _loc8_);
|
||||||
|
if(int(param1[5]) == 2)
|
||||||
|
{
|
||||||
|
_loc16_ = _loc2_.split("|");
|
||||||
|
_loc16_.splice(0,1);
|
||||||
|
_loc2_ = _loc16_.join("|");
|
||||||
|
}
|
||||||
|
ExternalInterface.call("mrc",["cm",_loc8_.userName,_loc2_,int(param1[5])]);
|
||||||
|
DebugUtility.debugTrace("mrc:cm command sent - chattyUserName:" + _loc8_.userName + " msg:" + _loc2_);
|
||||||
|
}
|
||||||
|
if((_loc19_ != gMainFrame.server.userId || _loc19_ == gMainFrame.server.userId && (_loc20_ == 0 || _loc20_ == 9)) && int(param1[5]) <= 1)
|
||||||
|
{
|
||||||
|
_chatHist.addMessageById(_loc19_,_loc2_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function userCommAdminMessageResponse(param1:Array) : void
|
||||||
|
{
|
||||||
|
var msgId:int;
|
||||||
|
var msgSplit:Array;
|
||||||
|
var isSystemMsg:Boolean;
|
||||||
|
var data:Array = param1;
|
||||||
|
var adminMsg:String = data[1];
|
||||||
|
if(adminMsg == "__FORCE_RELOGIN__")
|
||||||
|
{
|
||||||
|
setTimeout(refreshPage,Math.abs(_roomMgr.shardId) * 911 % 5000,{"status":true});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msgSplit = adminMsg.split("|");
|
||||||
|
if(msgSplit.length > 1)
|
||||||
|
{
|
||||||
|
msgId = int(msgSplit[0]);
|
||||||
|
adminMsg = LocalizationManager.translateIdAndInsertOnly(msgId,msgSplit.slice(1));
|
||||||
|
}
|
||||||
|
isSystemMsg = data[2] == null || int(data[2]) == 1;
|
||||||
|
if(!isSystemMsg)
|
||||||
|
{
|
||||||
|
gMainFrame.clientInfo.lastBroadcastMessage = adminMsg;
|
||||||
|
GuiManager.updateSettingsMessage();
|
||||||
|
}
|
||||||
|
if(isSystemMsg || !gMainFrame.isInMinigame() && gMainFrame.clientInfo.roomType != 7)
|
||||||
|
{
|
||||||
|
if(msgId != 22367 && msgId != 22368 && msgId != 22369 && msgId != 22370)
|
||||||
|
{
|
||||||
|
new SBAJOkPopup(GuiManager.guiLayer,adminMsg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setTimeout(function():void
|
||||||
|
{
|
||||||
|
new SBYesNoPopup(GuiManager.guiLayer,adminMsg,true,refreshPage);
|
||||||
|
},_drainPopupDelay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_chatHist.addPrivateMessage(LocalizationManager.translateIdOnly(15964),null,adminMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function refreshPage(param1:Object) : void
|
||||||
|
{
|
||||||
|
if(param1["status"])
|
||||||
|
{
|
||||||
|
NodeHopXtCommManager.sendNodeHopForDrainRequest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function getSpecialFormat() : TextFormat
|
||||||
|
{
|
||||||
|
var _loc1_:TextFormat = new TextFormat();
|
||||||
|
_loc1_.color = 12845056;
|
||||||
|
_loc1_.bold = true;
|
||||||
|
return _loc1_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,242 @@
|
|||||||
|
package
|
||||||
|
{
|
||||||
|
import com.sbi.client.SFEvent;
|
||||||
|
import avatar.NPCView;
|
||||||
|
import buddy.BuddyCard;
|
||||||
|
import com.sbi.graphics.PaletteHelper;
|
||||||
|
import flash.events.TimerEvent;
|
||||||
|
import flash.utils.Timer;
|
||||||
|
import flash.utils.getTimer;
|
||||||
|
|
||||||
|
public class XtReplyDemuxer
|
||||||
|
{
|
||||||
|
|
||||||
|
private static var MSG_DELAY_MS:int = 0;
|
||||||
|
|
||||||
|
private static var _delayList:Array;
|
||||||
|
|
||||||
|
private static var _delayTimer:Timer;
|
||||||
|
|
||||||
|
private static var _xtReplyCallbacks:Vector.<Function>;
|
||||||
|
|
||||||
|
private static var _xtReplyCommands:Vector.<String>;
|
||||||
|
|
||||||
|
public function XtReplyDemuxer()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function init() : void
|
||||||
|
{
|
||||||
|
if(MSG_DELAY_MS > 0)
|
||||||
|
{
|
||||||
|
_delayList = [];
|
||||||
|
_delayTimer = new Timer(10);
|
||||||
|
_delayTimer.addEventListener("timer",delayTimerHandler,false,0,true);
|
||||||
|
_delayTimer.start();
|
||||||
|
}
|
||||||
|
_xtReplyCallbacks = new Vector.<Function>();
|
||||||
|
_xtReplyCommands = new Vector.<String>();
|
||||||
|
gMainFrame.server.addEventListener("OnXtReply",xtReplyHandler,false,0,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function destroy() : void
|
||||||
|
{
|
||||||
|
_delayList = null;
|
||||||
|
if(_delayTimer)
|
||||||
|
{
|
||||||
|
if(_delayTimer.running)
|
||||||
|
{
|
||||||
|
_delayTimer.stop();
|
||||||
|
}
|
||||||
|
_delayTimer = null;
|
||||||
|
}
|
||||||
|
_xtReplyCallbacks = null;
|
||||||
|
_xtReplyCommands = null;
|
||||||
|
gMainFrame.server.removeEventListener("OnXtReply",xtReplyHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function addModule(param1:Function, param2:String) : void
|
||||||
|
{
|
||||||
|
_xtReplyCallbacks.push(param1);
|
||||||
|
_xtReplyCommands.push(param2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function removeModule(param1:Function) : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = _xtReplyCallbacks.indexOf(param1);
|
||||||
|
if(_loc2_ >= 0)
|
||||||
|
{
|
||||||
|
_xtReplyCallbacks.splice(_loc2_,1);
|
||||||
|
_xtReplyCommands.splice(_loc2_,1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new Error("module not found! callback:" + param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function xtReplyHandler(param1:SFEvent) : void
|
||||||
|
{
|
||||||
|
var _loc3_:String = null;
|
||||||
|
var _loc4_:int = 0;
|
||||||
|
var _loc2_:Function = null;
|
||||||
|
if(param1.obj[0] == "xcc")
|
||||||
|
{
|
||||||
|
PaletteHelper.handleCustomColors(param1.obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1.obj[0] == "xtl")
|
||||||
|
{
|
||||||
|
AJClient.showMessage(param1.obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1.obj[0] == "xyn")
|
||||||
|
{
|
||||||
|
AJClient.askYesNo(param1.obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1.obj[0] == "xw")
|
||||||
|
{
|
||||||
|
AJClient.onWhisper(param1.obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1.obj[0] == "xrn")
|
||||||
|
{
|
||||||
|
AJClient.onRenamed(param1.obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1.obj[0] == "xls")
|
||||||
|
{
|
||||||
|
AJClient.noteLastSeen(param1.obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1.obj[0] == "xfl")
|
||||||
|
{
|
||||||
|
AJClient.onFilterState(param1.obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param1.obj[0] == "xfa")
|
||||||
|
{
|
||||||
|
AJClient.onFilterAsk(param1.obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// the player's chat filter (AJClient.filterText), on what other
|
||||||
|
// players wrote, before any of the game sees it. A chat line
|
||||||
|
// ([.., room, who, text, type, ..], typed chat being types 0 and
|
||||||
|
// 9) that is to be left out is simply not passed on.
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if(param1.obj[0] == "uc" && (int(param1.obj[4]) == 0 || int(param1.obj[4]) == 9) && int(param1.obj[2]) != gMainFrame.server.userId)
|
||||||
|
{
|
||||||
|
_loc3_ = AJClient.filterText(String(param1.obj[3]));
|
||||||
|
if(_loc3_ == null)
|
||||||
|
{
|
||||||
|
AJClient.whisperNext = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
param1.obj[3] = _loc3_;
|
||||||
|
}
|
||||||
|
// Jam-A-Grams: one pushed ("ep", 17 fields from the third), or
|
||||||
|
// the inbox ("el": a count, then 17 fields a card). the words
|
||||||
|
// are a card's sixth field and who sent it (0 a player) its
|
||||||
|
// fourteenth.
|
||||||
|
else if(param1.obj[0] == "ep" && param1.obj.length >= 19 && int(param1.obj[15]) == 0)
|
||||||
|
{
|
||||||
|
param1.obj[7] = AJClient.filterOrNote(String(param1.obj[7]));
|
||||||
|
}
|
||||||
|
else if(param1.obj[0] == "el")
|
||||||
|
{
|
||||||
|
_loc4_ = 3;
|
||||||
|
while(_loc4_ + 16 < param1.obj.length)
|
||||||
|
{
|
||||||
|
if(int(param1.obj[_loc4_ + 13]) == 0)
|
||||||
|
{
|
||||||
|
param1.obj[_loc4_ + 5] = AJClient.filterOrNote(String(param1.obj[_loc4_ + 5]));
|
||||||
|
}
|
||||||
|
_loc4_ += 17;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// A player's bio, the last field of what their card is told.
|
||||||
|
else if(param1.obj[0] == "xbn" && param1.obj.length > 7 && String(param1.obj[2]).toLowerCase() != String(gMainFrame.server.userName).toLowerCase())
|
||||||
|
{
|
||||||
|
param1.obj[7] = AJClient.filterOrNote(String(param1.obj[7]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(e:Error)
|
||||||
|
{
|
||||||
|
GlobalErrorCatch.reportToServer("chat filter: " + e + "\n" + e.getStackTrace());
|
||||||
|
}
|
||||||
|
if(param1.obj[0] == "xbn")
|
||||||
|
{
|
||||||
|
BuddyCard.onBanInfo(param1.obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loc4_ = 0;
|
||||||
|
while(_loc4_ < _xtReplyCommands.length)
|
||||||
|
{
|
||||||
|
_loc3_ = _xtReplyCommands[_loc4_];
|
||||||
|
if(_loc3_.charAt(0) == param1.obj[0].charAt(0))
|
||||||
|
{
|
||||||
|
if(_loc3_.length == 1)
|
||||||
|
{
|
||||||
|
_loc2_ = _xtReplyCallbacks[_loc4_];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(param1.obj[0].indexOf(_loc3_) != -1)
|
||||||
|
{
|
||||||
|
_loc2_ = _xtReplyCallbacks[_loc4_];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
if(_loc2_ == null)
|
||||||
|
{
|
||||||
|
throw new Error("ERROR: undefined module command:" + param1.obj[0]);
|
||||||
|
}
|
||||||
|
if(MSG_DELAY_MS == 0)
|
||||||
|
{
|
||||||
|
NPCView.disguiseDefId = param1.obj[0] == "dph" ? int(param1.obj[5]) : 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_loc2_(param1);
|
||||||
|
}
|
||||||
|
catch(e:Error)
|
||||||
|
{
|
||||||
|
NPCView.disguiseDefId = 0;
|
||||||
|
GlobalErrorCatch.reportToServer("while handling server message \"" + param1.obj[0] + "\": " + e + "\n" + e.getStackTrace());
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
NPCView.disguiseDefId = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_delayList.push({
|
||||||
|
"f":_loc2_,
|
||||||
|
"e":param1,
|
||||||
|
"ts":getTimer() + MSG_DELAY_MS
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function delayTimerHandler(param1:TimerEvent) : void
|
||||||
|
{
|
||||||
|
var _loc4_:Object = null;
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc3_:uint = uint(getTimer());
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < _delayList.length)
|
||||||
|
{
|
||||||
|
_loc4_ = _delayList[_loc2_];
|
||||||
|
if(_loc4_.ts >= _loc3_)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc4_.f(_loc4_.e);
|
||||||
|
_delayList.splice(0,1);
|
||||||
|
_loc2_--;
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,295 @@
|
|||||||
|
package
|
||||||
|
{
|
||||||
|
import adobe.utils.*;
|
||||||
|
import avatar.NameBar;
|
||||||
|
import flash.accessibility.*;
|
||||||
|
import flash.desktop.*;
|
||||||
|
import flash.display.*;
|
||||||
|
import flash.errors.*;
|
||||||
|
import flash.events.*;
|
||||||
|
import flash.external.*;
|
||||||
|
import flash.filters.*;
|
||||||
|
import flash.geom.*;
|
||||||
|
import flash.globalization.*;
|
||||||
|
import flash.media.*;
|
||||||
|
import flash.net.*;
|
||||||
|
import flash.net.drm.*;
|
||||||
|
import flash.printing.*;
|
||||||
|
import flash.profiler.*;
|
||||||
|
import flash.sampler.*;
|
||||||
|
import flash.sensors.*;
|
||||||
|
import flash.system.*;
|
||||||
|
import flash.text.*;
|
||||||
|
import flash.text.engine.*;
|
||||||
|
import flash.text.ime.*;
|
||||||
|
import flash.ui.*;
|
||||||
|
import flash.utils.*;
|
||||||
|
import flash.xml.*;
|
||||||
|
|
||||||
|
[Embed(source="/_assets/assets.swf", symbol="symbol2357")]
|
||||||
|
public dynamic class memberNameBar extends NameBar
|
||||||
|
{
|
||||||
|
|
||||||
|
public var currCT:ColorTransform;
|
||||||
|
|
||||||
|
public var currColorId:int;
|
||||||
|
|
||||||
|
public function memberNameBar()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
addFrameScript(0,this.frame1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateColor(param1:*) : *
|
||||||
|
{
|
||||||
|
if(!this.currCT)
|
||||||
|
{
|
||||||
|
this.currCT = new ColorTransform();
|
||||||
|
}
|
||||||
|
switch(param1)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
this.currCT.color = 7566205;
|
||||||
|
this.currColorId = 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.currCT.color = 6593023;
|
||||||
|
this.currColorId = 2;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this.currCT.color = 13073480;
|
||||||
|
this.currColorId = 3;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
this.currCT.color = 10406971;
|
||||||
|
this.currColorId = 5;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
this.currCT.color = 16028056;
|
||||||
|
this.currColorId = 6;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
this.currCT.color = 12153599;
|
||||||
|
this.currColorId = 7;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
this.currCT.color = 16727859;
|
||||||
|
this.currColorId = 8;
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
this.currCT.color = 5751740;
|
||||||
|
this.currColorId = 9;
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
this.currCT.color = 15394278;
|
||||||
|
this.currColorId = 10;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
default:
|
||||||
|
this.currCT.color = 16631860;
|
||||||
|
this.currColorId = 4;
|
||||||
|
}
|
||||||
|
this.showDrawnColor(this.e,this.currColorId);
|
||||||
|
this.showDrawnColor(this.m,this.currColorId);
|
||||||
|
this.findChildrenAndSet(this.e,this.currCT);
|
||||||
|
this.findChildrenAndSet(this.c,this.currCT);
|
||||||
|
this.findChildrenAndSet(this.selnub,this.currCT);
|
||||||
|
this.findChildrenAndSet(this.m,this.currCT);
|
||||||
|
this.findChildrenAndSet(this.shape,this.currCT);
|
||||||
|
this.findChildrenAndSet(this.hostTag,this.currCT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showDrawnColor(param1:*, param2:int) : *
|
||||||
|
{
|
||||||
|
var _loc3_:* = param1 ? param1.getChildByName("old") : null;
|
||||||
|
if(_loc3_ is MovieClip && _loc3_.totalFrames >= param2)
|
||||||
|
{
|
||||||
|
_loc3_.gotoAndStop(param2);
|
||||||
|
this.stopChildren(_loc3_);
|
||||||
|
if(param1.mouse)
|
||||||
|
{
|
||||||
|
param1.mouse.visible = false;
|
||||||
|
}
|
||||||
|
if(param1.gradient)
|
||||||
|
{
|
||||||
|
param1.gradient.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stopChildren(param1:*) : *
|
||||||
|
{
|
||||||
|
var _loc2_:* = undefined;
|
||||||
|
var _loc3_:* = 0;
|
||||||
|
while(_loc3_ < param1.numChildren)
|
||||||
|
{
|
||||||
|
_loc2_ = param1.getChildAt(_loc3_);
|
||||||
|
if(_loc2_ is MovieClip)
|
||||||
|
{
|
||||||
|
_loc2_.gotoAndStop(1);
|
||||||
|
this.stopChildren(_loc2_);
|
||||||
|
}
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCurrCT() : *
|
||||||
|
{
|
||||||
|
return this.currCT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCurrColorId() : *
|
||||||
|
{
|
||||||
|
if(this.currCT)
|
||||||
|
{
|
||||||
|
return this.currColorId;
|
||||||
|
}
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findChildrenAndSet(param1:*, param2:*) : *
|
||||||
|
{
|
||||||
|
var _loc3_:* = undefined;
|
||||||
|
this.setColor(param1,param2);
|
||||||
|
if("numChildren" in param1)
|
||||||
|
{
|
||||||
|
_loc3_ = 0;
|
||||||
|
while(_loc3_ < param1.numChildren)
|
||||||
|
{
|
||||||
|
this.findChildrenAndSet(param1.getChildAt(_loc3_),param2);
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setColor(param1:*, param2:*) : *
|
||||||
|
{
|
||||||
|
var _loc3_:Object = null;
|
||||||
|
var _loc4_:Object = null;
|
||||||
|
if(param1 != null)
|
||||||
|
{
|
||||||
|
if(param1.name == "norm")
|
||||||
|
{
|
||||||
|
param1.transform.colorTransform = param2;
|
||||||
|
}
|
||||||
|
else if(param1.name == "light" || param1.name == "dark")
|
||||||
|
{
|
||||||
|
_loc3_ = null;
|
||||||
|
_loc4_ = null;
|
||||||
|
_loc3_ = this.RGBtoHSB(param2.redOffset,param2.greenOffset,param2.blueOffset);
|
||||||
|
if(param1.name == "light")
|
||||||
|
{
|
||||||
|
_loc3_.s *= 0.2;
|
||||||
|
if(_loc3_.b < 60)
|
||||||
|
{
|
||||||
|
_loc3_.b = 60;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(param1.name == "dark")
|
||||||
|
{
|
||||||
|
_loc3_.b *= 0.5;
|
||||||
|
}
|
||||||
|
_loc4_ = this.HSBtoRGB(_loc3_.h,_loc3_.s,_loc3_.b);
|
||||||
|
param1.transform.colorTransform = new ColorTransform(param2.redMultiplier,param2.greenMultiplier,param2.blueMultiplier,param2.alphaMultiplier,_loc4_.r,_loc4_.g,_loc4_.b,param2.alphaOffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function HSBtoRGB(param1:int, param2:int, param3:int) : Object
|
||||||
|
{
|
||||||
|
var _loc7_:Number = NaN;
|
||||||
|
var _loc4_:Object = new Object();
|
||||||
|
var _loc5_:Number = param3 * 0.01 * 255;
|
||||||
|
var _loc6_:Number = _loc5_ * (1 - param2 * 0.01);
|
||||||
|
if(param1 == 360)
|
||||||
|
{
|
||||||
|
param1 = 0;
|
||||||
|
}
|
||||||
|
if(param2 == 0)
|
||||||
|
{
|
||||||
|
_loc4_.r = _loc4_.g = _loc4_.b = param3 * (255 * 0.01);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc7_ = Math.floor(param1 / 60);
|
||||||
|
switch(_loc7_)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
_loc4_.r = _loc5_;
|
||||||
|
_loc4_.g = _loc6_ + param1 * (_loc5_ - _loc6_) / 60;
|
||||||
|
_loc4_.b = _loc6_;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
_loc4_.r = _loc5_ - (param1 - 60) * (_loc5_ - _loc6_) / 60;
|
||||||
|
_loc4_.g = _loc5_;
|
||||||
|
_loc4_.b = _loc6_;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
_loc4_.r = _loc6_;
|
||||||
|
_loc4_.g = _loc5_;
|
||||||
|
_loc4_.b = _loc6_ + (param1 - 120) * (_loc5_ - _loc6_) / 60;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
_loc4_.r = _loc6_;
|
||||||
|
_loc4_.g = _loc5_ - (param1 - 180) * (_loc5_ - _loc6_) / 60;
|
||||||
|
_loc4_.b = _loc5_;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
_loc4_.r = _loc6_ + (param1 - 240) * (_loc5_ - _loc6_) / 60;
|
||||||
|
_loc4_.g = _loc6_;
|
||||||
|
_loc4_.b = _loc5_;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
_loc4_.r = _loc5_;
|
||||||
|
_loc4_.g = _loc6_;
|
||||||
|
_loc4_.b = _loc5_ - (param1 - 300) * (_loc5_ - _loc6_) / 60;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
_loc4_.r = _loc5_;
|
||||||
|
_loc4_.g = _loc6_ + param1 * (_loc5_ - _loc6_) / 60;
|
||||||
|
_loc4_.b = _loc6_;
|
||||||
|
}
|
||||||
|
_loc4_.r = Math.min(255,Math.max(0,Math.round(_loc4_.r)));
|
||||||
|
_loc4_.g = Math.min(255,Math.max(0,Math.round(_loc4_.g)));
|
||||||
|
_loc4_.b = Math.min(255,Math.max(0,Math.round(_loc4_.b)));
|
||||||
|
}
|
||||||
|
return _loc4_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function RGBtoHSB(param1:int, param2:int, param3:int) : Object
|
||||||
|
{
|
||||||
|
var _loc4_:Object = new Object();
|
||||||
|
var _loc5_:Number = Math.max(param1,param2,param3);
|
||||||
|
var _loc6_:Number = Math.min(param1,param2,param3);
|
||||||
|
_loc4_.s = _loc5_ != 0 ? (_loc5_ - _loc6_) / _loc5_ * 100 : 0;
|
||||||
|
_loc4_.b = _loc5_ / 255 * 100;
|
||||||
|
if(_loc4_.s == 0)
|
||||||
|
{
|
||||||
|
_loc4_.h = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch(_loc5_)
|
||||||
|
{
|
||||||
|
case param1:
|
||||||
|
_loc4_.h = (param2 - param3) / (_loc5_ - _loc6_) * 60 + 0;
|
||||||
|
break;
|
||||||
|
case param2:
|
||||||
|
_loc4_.h = (param3 - param1) / (_loc5_ - _loc6_) * 60 + 120;
|
||||||
|
break;
|
||||||
|
case param3:
|
||||||
|
_loc4_.h = (param1 - param2) / (_loc5_ - _loc6_) * 60 + 240;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc4_.h = Math.min(360,Math.max(0,Math.round(_loc4_.h)));
|
||||||
|
_loc4_.s = Math.min(100,Math.max(0,Math.round(_loc4_.s)));
|
||||||
|
_loc4_.b = Math.min(100,Math.max(0,Math.round(_loc4_.b)));
|
||||||
|
return _loc4_;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal function frame1() : *
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,675 @@
|
|||||||
|
package
|
||||||
|
{
|
||||||
|
import com.sbi.corelib.Utils;
|
||||||
|
import com.sbi.corelib.audio.SBAudio;
|
||||||
|
import flash.net.SharedObject;
|
||||||
|
import flash.utils.Dictionary;
|
||||||
|
|
||||||
|
public class AJAudio
|
||||||
|
{
|
||||||
|
|
||||||
|
private static var _hasLoadedDailySpinSfx:Boolean;
|
||||||
|
|
||||||
|
private static var _hasLoadedGiftUnwrapSfx:Boolean;
|
||||||
|
|
||||||
|
private static var _hasLoadedJourneyBookWorldSfx:Boolean;
|
||||||
|
|
||||||
|
private static var _hasLoadedJourneyBookBookSfx:Boolean;
|
||||||
|
|
||||||
|
private static var _hasLoadedTradeSfx:Boolean;
|
||||||
|
|
||||||
|
private static var _hasLoadedPetCreateSfx:Boolean;
|
||||||
|
|
||||||
|
private static var _defaultVolumes:Dictionary;
|
||||||
|
|
||||||
|
public function AJAudio()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function init(param1:Function = null, param2:Object = null) : void
|
||||||
|
{
|
||||||
|
var _loc3_:Object = null;
|
||||||
|
if(!SBAudio.isInitialized)
|
||||||
|
{
|
||||||
|
_loc3_ = {};
|
||||||
|
_loc3_["HudBtnRollover"] = {
|
||||||
|
"className":Utils.getDefByName("HudBtnRollover") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["HudBtnClick"] = {
|
||||||
|
"className":Utils.getDefByName("HudBtnClick") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["SubMenuBtnRollover"] = {
|
||||||
|
"className":Utils.getDefByName("SubMenuBtnRollover") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["SubMenuBtnClick"] = {
|
||||||
|
"className":Utils.getDefByName("SubMenuBtnClick") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["ExitBtnRollover"] = {
|
||||||
|
"className":Utils.getDefByName("ExitBtnRollover") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["ExitBtnClick"] = {
|
||||||
|
"className":Utils.getDefByName("ExitBtnClick") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["ScrollUpDown"] = {
|
||||||
|
"className":Utils.getDefByName("ScrollUpDown") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["ScrollLeftRight"] = {
|
||||||
|
"className":Utils.getDefByName("ScrollLeftRight") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["TextType"] = {
|
||||||
|
"className":Utils.getDefByName("TextType") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["TextEnter"] = {
|
||||||
|
"className":Utils.getDefByName("TextEnter") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["IdleWarningSound"] = {
|
||||||
|
"className":Utils.getDefByName("IdleWarningSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["ShopCachingSound"] = {
|
||||||
|
"className":Utils.getDefByName("ShopCachingSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["GemsEarnedSound"] = {
|
||||||
|
"className":Utils.getDefByName("GemsEarnedSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["ItemRecycledSound"] = {
|
||||||
|
"className":Utils.getDefByName("ItemRecycledSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["MailReceivedSound"] = {
|
||||||
|
"className":Utils.getDefByName("MailReceivedSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["BuddyOnlineOfflineSound"] = {
|
||||||
|
"className":Utils.getDefByName("BuddyOnlineOfflineSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["NewspaperSound"] = {
|
||||||
|
"className":Utils.getDefByName("NewspaperSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["MailSentSound"] = {
|
||||||
|
"className":Utils.getDefByName("MailSentSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["AchievementSound"] = {
|
||||||
|
"className":Utils.getDefByName("AchievementSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["BuddyCardOpen"] = {
|
||||||
|
"className":Utils.getDefByName("BuddyCardOpen") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["BuddyCardClose"] = {
|
||||||
|
"className":Utils.getDefByName("BuddyCardClose") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["LimitedChatErrorSound"] = {
|
||||||
|
"className":Utils.getDefByName("LimitedChatErrorSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["ChatOpenSound"] = {
|
||||||
|
"className":Utils.getDefByName("ChatOpenSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["ChatCloseSound"] = {
|
||||||
|
"className":Utils.getDefByName("ChatCloseSound") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["RandomLever"] = {
|
||||||
|
"className":Utils.getDefByName("RandomLever") as Class,
|
||||||
|
"volume":0.2
|
||||||
|
};
|
||||||
|
_loc3_["NameGenRotationSound"] = {
|
||||||
|
"className":Utils.getDefByName("NameGenRotationSound") as Class,
|
||||||
|
"volume":1
|
||||||
|
};
|
||||||
|
_loc3_["NameGenStopSound"] = {
|
||||||
|
"className":Utils.getDefByName("NameGenStopSound") as Class,
|
||||||
|
"volume":1
|
||||||
|
};
|
||||||
|
_loc3_["DoorBellSound"] = {
|
||||||
|
"className":Utils.getDefByName("DoorBellSound") as Class,
|
||||||
|
"volume":1
|
||||||
|
};
|
||||||
|
SBAudio.init(_loc3_,param1,param2);
|
||||||
|
_defaultVolumes = new Dictionary();
|
||||||
|
_defaultVolumes["FW_TRAIL_1"] = 0.2;
|
||||||
|
_defaultVolumes["FW_TRAIL_2"] = 0.2;
|
||||||
|
_defaultVolumes["FW_TRAIL_3"] = 0.2;
|
||||||
|
_defaultVolumes["FW_LAUNCH_1"] = 0.3;
|
||||||
|
_defaultVolumes["FW_LAUNCH_2"] = 0.3;
|
||||||
|
_defaultVolumes["FW_LAUNCH_3"] = 0.3;
|
||||||
|
_defaultVolumes["FW_EXPLOSION_1"] = 0.3;
|
||||||
|
_defaultVolumes["FW_EXPLOSION_2"] = 0.3;
|
||||||
|
_defaultVolumes["FW_EXPLOSION_3"] = 0.3;
|
||||||
|
_defaultVolumes["DOOR_WOOD_OPEN"] = 0.3;
|
||||||
|
_defaultVolumes["DOOR_WOOD_CLOSE"] = 0.3;
|
||||||
|
_defaultVolumes["DOOR_SLIDE"] = 0.3;
|
||||||
|
_defaultVolumes["DOOR_STONE_SLIDE"] = 0.3;
|
||||||
|
_defaultVolumes["aj_water_fs1"] = 0;
|
||||||
|
_defaultVolumes["aj_water_fs2"] = 0;
|
||||||
|
_defaultVolumes["aj_water_fs3"] = 0;
|
||||||
|
_defaultVolumes["BOUNCE"] = 0.4;
|
||||||
|
_defaultVolumes["aj_slideBounce1"] = 0.28;
|
||||||
|
_defaultVolumes["aj_slideBounce2"] = 0.28;
|
||||||
|
_defaultVolumes["aj_JBCameraHide"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBCameraReveal"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBcarrotBounce"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBcarrotsPop"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBcarrotsRing"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBcosmoHatAppear"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBcosmoHatBoomSeedAppear"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBcosmoHatBoomSeedFall"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBcosmoHatFall"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBgilbertArmorClose"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBgilbertArmorOpen"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBgrahamGearLP"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBgreelyCapeEnter"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBgreelyCapeExit"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBlizaCompassHide"] = 0.3;
|
||||||
|
_defaultVolumes["aj_JBlizaCompassReveal"] = 0.3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function loadSfx(param1:String, param2:Class, param3:Number = 0.3) : void
|
||||||
|
{
|
||||||
|
if(_defaultVolumes[param1])
|
||||||
|
{
|
||||||
|
param3 = Number(_defaultVolumes[param1]);
|
||||||
|
}
|
||||||
|
SBAudio.addCachedSound(param1,param2,param3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function setupSharedObject(param1:SharedObject) : void
|
||||||
|
{
|
||||||
|
SBAudio.setupSharedObject(param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playSfx(param1:String, param2:int = 1) : void
|
||||||
|
{
|
||||||
|
SBAudio.playCachedSound(param1,param2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function stopSfx(param1:String) : void
|
||||||
|
{
|
||||||
|
SBAudio.stopCachedSound(param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playHudBtnRollover() : void
|
||||||
|
{
|
||||||
|
playSfx("HudBtnRollover");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playHudBtnClick() : void
|
||||||
|
{
|
||||||
|
playSfx("HudBtnClick");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playSubMenuBtnRollover() : void
|
||||||
|
{
|
||||||
|
playSfx("SubMenuBtnRollover");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playSubMenuBtnClick() : void
|
||||||
|
{
|
||||||
|
playSfx("SubMenuBtnClick");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playExitBtnRollover() : void
|
||||||
|
{
|
||||||
|
playSfx("ExitBtnRollover");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playExitBtnClick() : void
|
||||||
|
{
|
||||||
|
playSfx("ExitBtnClick");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playScrollUpDown() : void
|
||||||
|
{
|
||||||
|
playSfx("ScrollUpDown");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playScrollLeftRight() : void
|
||||||
|
{
|
||||||
|
playSfx("ScrollLeftRight");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playTextType() : void
|
||||||
|
{
|
||||||
|
playSfx("TextType");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playTextEnter() : void
|
||||||
|
{
|
||||||
|
playSfx("TextEnter");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playIdleWarningSound() : void
|
||||||
|
{
|
||||||
|
playSfx("IdleWarningSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playShopCachingSound() : void
|
||||||
|
{
|
||||||
|
playSfx("ShopCachingSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playGemsEarnedSound() : void
|
||||||
|
{
|
||||||
|
playSfx("GemsEarnedSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playItemRecycledSound() : void
|
||||||
|
{
|
||||||
|
playSfx("ItemRecycledSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playMailReceivedSound() : void
|
||||||
|
{
|
||||||
|
playSfx("MailReceivedSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playMailSentSound() : void
|
||||||
|
{
|
||||||
|
playSfx("MailSentSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playBuddyOnlineOfflineSound() : void
|
||||||
|
{
|
||||||
|
playSfx("BuddyOnlineOfflineSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playNewspaperSound() : void
|
||||||
|
{
|
||||||
|
playSfx("NewspaperSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playAchievementSound() : void
|
||||||
|
{
|
||||||
|
playSfx("AchievementSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playBuddyCardOpen() : void
|
||||||
|
{
|
||||||
|
playSfx("BuddyCardOpen");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playBuddyCardClose() : void
|
||||||
|
{
|
||||||
|
playSfx("BuddyCardClose");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playLimitedChatErrorSound() : void
|
||||||
|
{
|
||||||
|
playSfx("LimitedChatErrorSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playChatOpenSound() : void
|
||||||
|
{
|
||||||
|
playSfx("ChatOpenSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playChatCloseSound() : void
|
||||||
|
{
|
||||||
|
playSfx("ChatCloseSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playRandomLever() : void
|
||||||
|
{
|
||||||
|
playSfx("RandomLever");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playNameGenRotationSound(param1:int = 1) : void
|
||||||
|
{
|
||||||
|
playSfx("NameGenRotationSound",param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playNameGenStopSound() : void
|
||||||
|
{
|
||||||
|
playSfx("NameGenStopSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playDoorBellSound() : void
|
||||||
|
{
|
||||||
|
playSfx("DoorBellSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function stopNameGenRotationSound() : void
|
||||||
|
{
|
||||||
|
stopSfx("NameGenRotationSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function stopRandomLever() : void
|
||||||
|
{
|
||||||
|
stopSfx("RandomLever");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get hasLoadedDailySpinSfx() : Boolean
|
||||||
|
{
|
||||||
|
return _hasLoadedDailySpinSfx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function set hasLoadedDailySpinSfx(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
_hasLoadedDailySpinSfx = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playDailySpinSpin() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedDailySpinSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("DailySpinSpin");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playDailySpinBub1() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedDailySpinSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("DailySpinBub1");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playDailySpinBub2() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedDailySpinSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("DailySpinBub2");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playDailySpinBub3() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedDailySpinSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("DailySpinBub3");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get hasLoadedGiftUnwrapSfx() : Boolean
|
||||||
|
{
|
||||||
|
return _hasLoadedGiftUnwrapSfx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function set hasLoadedGiftUnwrapSfx(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
_hasLoadedGiftUnwrapSfx = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playGiftUnwrap() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedGiftUnwrapSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("GiftUnwrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playTreasureUnwrap() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedGiftUnwrapSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("TreasureUnwrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playTreasureBagUnwrap() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedGiftUnwrapSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("TreasureBagUnwrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playTreasureLuckyUnwrap() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedGiftUnwrapSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("EpicLuckyTreasureUnwrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playTreasureLucky2Unwrap() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedGiftUnwrapSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("potOgoldPopUp");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playTreasureEggUnwrap() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedGiftUnwrapSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("TreasureGoldenEgg");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get hasLoadedJourneyBookWorldSfx() : Boolean
|
||||||
|
{
|
||||||
|
return _hasLoadedJourneyBookWorldSfx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function set hasLoadedJourneyBookWorldSfx(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
_hasLoadedJourneyBookWorldSfx = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playJBPrizeEarned() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedJourneyBookWorldSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("JBPrizeEarned");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playJBWorldFactClose() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedJourneyBookWorldSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("JBWorldFactClose");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playJBWorldFactOpen() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedJourneyBookWorldSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("JBWorldFactOpen");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get hasLoadedJourneyBookBookSfx() : Boolean
|
||||||
|
{
|
||||||
|
return _hasLoadedJourneyBookBookSfx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function set hasLoadedJourneyBookBookSfx(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
_hasLoadedJourneyBookBookSfx = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playJBBookFactClose() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedJourneyBookBookSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("JBBookFactClose");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playJBBookFactOpen() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedJourneyBookBookSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("JBBookFactOpen");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get hasLoadedTradeSfx() : Boolean
|
||||||
|
{
|
||||||
|
return _hasLoadedTradeSfx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function set hasLoadedTradeSfx(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
_hasLoadedTradeSfx = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playTradeSuccessSound() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedTradeSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("TradeSuccessSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playTradeFailedSound() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedTradeSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("TradeFailedSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playTradeRequestSound() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedTradeSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("TradeRequestSound");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get hasLoadedPetCreateSfx() : Boolean
|
||||||
|
{
|
||||||
|
return _hasLoadedPetCreateSfx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function set hasLoadedPetCreatefx(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
_hasLoadedPetCreateSfx = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playPetCreateRandomSound1() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedPetCreateSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("petRandomization1");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function stopPetCreateRandomSound1() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedPetCreateSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
stopSfx("petRandomization1");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playPetCreateRandomSound2() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedPetCreateSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("petRandomization2");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function stopPetCreateRandomSound2() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedPetCreateSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
stopSfx("petRandomization2");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playPetCreateRandomSound3() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedPetCreateSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("petRandomization3");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function stopPetCreateRandomSound3() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedPetCreateSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
stopSfx("petRandomization3");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playPetCreateRandomSound4() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedPetCreateSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("petRandomization4");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function stopPetCreateRandomSound4() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedPetCreateSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
stopSfx("petRandomization4");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function playPetCreateRandomSoundFinish() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedPetCreateSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playSfx("petRandomizationFinish");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function stopPetCreateRandomSoundFinish() : void
|
||||||
|
{
|
||||||
|
if(!_hasLoadedPetCreateSfx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
stopSfx("petRandomizationFinish");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,210 @@
|
|||||||
|
package
|
||||||
|
{
|
||||||
|
import com.sbi.debug.DebugUtility;
|
||||||
|
import com.sbi.loader.ResourceStack;
|
||||||
|
import com.sbi.popup.SBStandardPopup;
|
||||||
|
import createAccountFlow.CreateAccount;
|
||||||
|
import flash.display.Sprite;
|
||||||
|
import flash.events.Event;
|
||||||
|
import flash.events.UncaughtErrorEvent;
|
||||||
|
import flash.external.ExternalInterface;
|
||||||
|
import flash.system.Capabilities;
|
||||||
|
import flash.system.Security;
|
||||||
|
import flash.ui.Mouse;
|
||||||
|
import gamePlayFlow.GamePlay;
|
||||||
|
import gui.DarkenManager;
|
||||||
|
import loadProgress.LoadProgress;
|
||||||
|
import loader.DefPacksDefHelper;
|
||||||
|
import localization.LocalizationManager;
|
||||||
|
import resource.LoadAvatarCarouselResourceStackable;
|
||||||
|
import resource.LoadCursorResourceStackable;
|
||||||
|
import room.DebugGUITextbox;
|
||||||
|
import waitingRoomFlow.WaitingRoom;
|
||||||
|
|
||||||
|
[SWF(width="900", height="550", backgroundColor="#393625", frameRate="24")]
|
||||||
|
public class AJClient extends Sprite
|
||||||
|
{
|
||||||
|
|
||||||
|
private static var _globalDebugLog:DebugGUITextbox;
|
||||||
|
|
||||||
|
private var _resourceStackLoader:ResourceStack;
|
||||||
|
|
||||||
|
public function AJClient()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
addEventListener("addedToStage",addedToStageHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get globalDebugLog() : DebugGUITextbox
|
||||||
|
{
|
||||||
|
return _globalDebugLog;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addedToStageHandler(param1:Event) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Object = null;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
removeEventListener("addedToStage",addedToStageHandler);
|
||||||
|
if(Capabilities.playerType != "Desktop")
|
||||||
|
{
|
||||||
|
Security.allowDomain("*");
|
||||||
|
Security.allowInsecureDomain("*");
|
||||||
|
}
|
||||||
|
var _loc4_:Boolean = ExternalInterface.available;
|
||||||
|
if(_loc4_)
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace("addedToStageHandler - extIntAvail is true");
|
||||||
|
DebugUtility.debugTrace("mrc dm init ctor starting up call returned:" + ExternalInterface.call("mrc",["dm","AJClient addedToStageHandler starting up"]));
|
||||||
|
ExternalInterface.call("handleGAEvent","flashStarted");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace("addedToStageHandler - extIntAvail is false");
|
||||||
|
}
|
||||||
|
if(!MainFrame.isInitialized())
|
||||||
|
{
|
||||||
|
if(parent != null)
|
||||||
|
{
|
||||||
|
if(parent.hasOwnProperty("flashVars"))
|
||||||
|
{
|
||||||
|
_loc2_ = parent["flashVars"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_ = parent.loaderInfo.parameters;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_ = loaderInfo.parameters;
|
||||||
|
}
|
||||||
|
DebugUtility.debugTrace("addedToStageHandler - printing loaderInfo parameters flashvars...");
|
||||||
|
_loc3_ = 0;
|
||||||
|
for(var _loc5_:String in _loc2_)
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace(" flashvar " + _loc5_ + ":" + _loc2_[_loc5_]);
|
||||||
|
_loc3_++;
|
||||||
|
}
|
||||||
|
DebugUtility.debugTrace("addedToStageHandler - ...done printing loaderInfo parameters flashvars - i:" + _loc3_);
|
||||||
|
MainFrame.handleLocalExternalCall = GamePlay.handleLocalExternalCall;
|
||||||
|
MainFrame.getInstance(_loc2_,setupInit,"",this);
|
||||||
|
LoadProgress.updateProgress(2);
|
||||||
|
_globalDebugLog = new DebugGUITextbox(this,"","Debug Log [F4]",false,true,true,750,276,true);
|
||||||
|
_globalDebugLog.x = 80;
|
||||||
|
_globalDebugLog.y = 50;
|
||||||
|
DebugUtility.setDebugGUIHandler(_globalDebugLog.appendHtml);
|
||||||
|
loaderInfo.uncaughtErrorEvents.addEventListener("uncaughtError",handleGlobalErrors);
|
||||||
|
}
|
||||||
|
DebugUtility.debugTrace("AJClient addedToStageHandler finished");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupInit() : void
|
||||||
|
{
|
||||||
|
gMainFrame.stage.addEventListener("Localization",LocalizationManager.onLocalizationEvent,false,0,true);
|
||||||
|
LocalizationManager.currentLanguage = LocalizationManager.accountLanguage = LocalizationManager.getLanguageIdForLocale(gMainFrame.clientInfo.locale);
|
||||||
|
LocalizationManager.countryCode = gMainFrame.clientInfo.countryCode;
|
||||||
|
var _loc1_:DefPacksDefHelper = new DefPacksDefHelper();
|
||||||
|
_loc1_.init(uint("1023" + LocalizationManager.currentLanguage),LocalizationXtCommManager.onLocalizationListResponse,loadResourceItems,2);
|
||||||
|
DefPacksDefHelper.mediaArray["1023" + LocalizationManager.currentLanguage] = _loc1_;
|
||||||
|
_loc1_ = new DefPacksDefHelper();
|
||||||
|
_loc1_.init(uint("1055" + LocalizationManager.accountLanguage),LocalizationXtCommManager.onPreferredLocalizationListResponse,null,2);
|
||||||
|
DefPacksDefHelper.mediaArray["1055" + LocalizationManager.accountLanguage] = _loc1_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function loadResourceItems() : void
|
||||||
|
{
|
||||||
|
LoadProgress.updateProgress(3);
|
||||||
|
Utility.init(DarkenManager.showLoadingSpiral,DarkenManager.darken,DarkenManager.unDarken);
|
||||||
|
_resourceStackLoader = new ResourceStack(gMainFrame.path,gMainFrame.loaderCache.openFile);
|
||||||
|
_resourceStackLoader.pushFile("assets/sharedFonts.swf",true);
|
||||||
|
_resourceStackLoader.pushFile("assets/HUDAssets.swf",true);
|
||||||
|
if(gMainFrame.clientInfo.isCreateAccount)
|
||||||
|
{
|
||||||
|
_resourceStackLoader.pushClass(new LoadAvatarCarouselResourceStackable());
|
||||||
|
}
|
||||||
|
if(Mouse["supportsNativeCursor"])
|
||||||
|
{
|
||||||
|
_resourceStackLoader.pushClass(new LoadCursorResourceStackable());
|
||||||
|
}
|
||||||
|
if(ExternalInterface.available)
|
||||||
|
{
|
||||||
|
ExternalInterface.call("aj_initialized");
|
||||||
|
}
|
||||||
|
if("failedToInitiate" in gMainFrame.clientInfo && gMainFrame.clientInfo.failedToInitiate == true)
|
||||||
|
{
|
||||||
|
_resourceStackLoader.start(onInitiationFailure);
|
||||||
|
}
|
||||||
|
else if(gMainFrame.clientInfo.isCreateAccount)
|
||||||
|
{
|
||||||
|
_resourceStackLoader.start(setupCreateAccount);
|
||||||
|
}
|
||||||
|
else if(gMainFrame.clientInfo.waitingMode)
|
||||||
|
{
|
||||||
|
_resourceStackLoader.start(setupWaitingRoom);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_resourceStackLoader.start(setupGamePlay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupCreateAccount() : void
|
||||||
|
{
|
||||||
|
var _loc1_:CreateAccount = new CreateAccount(gMainFrame.clientInfo);
|
||||||
|
addChild(_loc1_);
|
||||||
|
gMainFrame.createAccount = _loc1_;
|
||||||
|
_loc1_.loginCtorHelper();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupWaitingRoom() : void
|
||||||
|
{
|
||||||
|
var _loc1_:WaitingRoom = new WaitingRoom(gMainFrame.clientInfo);
|
||||||
|
addChild(_loc1_);
|
||||||
|
gMainFrame.waitingRoom = _loc1_;
|
||||||
|
_loc1_.waitCtorHelper();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupGamePlay(param1:Event = null, param2:Event = null) : void
|
||||||
|
{
|
||||||
|
DebugUtility.debugTrace("setupGamePlay - loginEvt:" + param1 + " connectEvt:" + param2);
|
||||||
|
if(gMainFrame.createAccount)
|
||||||
|
{
|
||||||
|
if(contains(gMainFrame.createAccount))
|
||||||
|
{
|
||||||
|
removeChild(gMainFrame.createAccount);
|
||||||
|
}
|
||||||
|
gMainFrame.createAccount = null;
|
||||||
|
_resourceStackLoader = null;
|
||||||
|
}
|
||||||
|
DebugUtility.debugTrace("setupGamePlay - constructing GamePlay - gMainFrame.clientInfo:" + gMainFrame.clientInfo);
|
||||||
|
var _loc3_:GamePlay = new GamePlay(gMainFrame.clientInfo,param1,param2);
|
||||||
|
addChild(_loc3_);
|
||||||
|
gMainFrame.gamePlay = _loc3_;
|
||||||
|
DebugUtility.debugTrace("setupGamePlay - gp:" + _loc3_ + " calling worldCtorHelper");
|
||||||
|
_loc3_.worldCtorHelper();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onInitiationFailure() : void
|
||||||
|
{
|
||||||
|
new SBStandardPopup(gMainFrame.stage,LocalizationManager.translateIdOnly(11202),false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function createAvatar() : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private function shardSelection() : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private function enterGame() : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private function handleGlobalErrors(param1:UncaughtErrorEvent) : void
|
||||||
|
{
|
||||||
|
GlobalErrorCatch.globalErrorListener(param1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Common.Math.b2Vec2;
|
||||||
|
|
||||||
|
public class ClipVertex
|
||||||
|
{
|
||||||
|
|
||||||
|
public var v:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var id:b2ContactID = new b2ContactID();
|
||||||
|
|
||||||
|
public function ClipVertex()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
public class Features
|
||||||
|
{
|
||||||
|
|
||||||
|
public var _referenceEdge:int;
|
||||||
|
|
||||||
|
public var _incidentEdge:int;
|
||||||
|
|
||||||
|
public var _incidentVertex:int;
|
||||||
|
|
||||||
|
public var _flip:int;
|
||||||
|
|
||||||
|
public var _m_id:b2ContactID;
|
||||||
|
|
||||||
|
public function Features()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set referenceEdge(param1:int) : void
|
||||||
|
{
|
||||||
|
_referenceEdge = param1;
|
||||||
|
_m_id._key = _m_id._key & 0xFFFFFF00 | _referenceEdge & 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get referenceEdge() : int
|
||||||
|
{
|
||||||
|
return _referenceEdge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set incidentEdge(param1:int) : void
|
||||||
|
{
|
||||||
|
_incidentEdge = param1;
|
||||||
|
_m_id._key = _m_id._key & 0xFFFF00FF | _incidentEdge << 8 & 0xFF00;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get incidentEdge() : int
|
||||||
|
{
|
||||||
|
return _incidentEdge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set incidentVertex(param1:int) : void
|
||||||
|
{
|
||||||
|
_incidentVertex = param1;
|
||||||
|
_m_id._key = _m_id._key & 0xFF00FFFF | _incidentVertex << 16 & 0xFF0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get incidentVertex() : int
|
||||||
|
{
|
||||||
|
return _incidentVertex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set flip(param1:int) : void
|
||||||
|
{
|
||||||
|
_flip = param1;
|
||||||
|
_m_id._key = _m_id._key & 0xFFFFFF | _flip << 24 & 0xFF000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get flip() : int
|
||||||
|
{
|
||||||
|
return _flip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package Box2D.Collision.Shapes
|
||||||
|
{
|
||||||
|
import Box2D.Common.Math.b2Vec2;
|
||||||
|
|
||||||
|
public class b2CircleDef extends b2ShapeDef
|
||||||
|
{
|
||||||
|
|
||||||
|
public var localPosition:b2Vec2 = new b2Vec2(0,0);
|
||||||
|
|
||||||
|
public var radius:Number;
|
||||||
|
|
||||||
|
public function b2CircleDef()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
type = 0;
|
||||||
|
radius = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package Box2D.Collision.Shapes
|
||||||
|
{
|
||||||
|
import Box2D.Collision.*;
|
||||||
|
import Box2D.Common.*;
|
||||||
|
import Box2D.Common.Math.*;
|
||||||
|
import Box2D.Dynamics.*;
|
||||||
|
|
||||||
|
public class b2CircleShape extends b2Shape
|
||||||
|
{
|
||||||
|
|
||||||
|
public var m_localPosition:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var m_radius:Number;
|
||||||
|
|
||||||
|
public function b2CircleShape(param1:b2ShapeDef)
|
||||||
|
{
|
||||||
|
super(param1);
|
||||||
|
var _loc2_:b2CircleDef = param1 as b2CircleDef;
|
||||||
|
m_type = 0;
|
||||||
|
m_localPosition.SetV(_loc2_.localPosition);
|
||||||
|
m_radius = _loc2_.radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function TestPoint(param1:b2XForm, param2:b2Vec2) : Boolean
|
||||||
|
{
|
||||||
|
var _loc5_:b2Mat22 = param1.R;
|
||||||
|
var _loc3_:Number = param1.position.x + (_loc5_.col1.x * m_localPosition.x + _loc5_.col2.x * m_localPosition.y);
|
||||||
|
var _loc4_:Number = param1.position.y + (_loc5_.col1.y * m_localPosition.x + _loc5_.col2.y * m_localPosition.y);
|
||||||
|
_loc3_ = param2.x - _loc3_;
|
||||||
|
_loc4_ = param2.y - _loc4_;
|
||||||
|
return _loc3_ * _loc3_ + _loc4_ * _loc4_ <= m_radius * m_radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function TestSegment(param1:b2XForm, param2:Array, param3:b2Vec2, param4:b2Segment, param5:Number) : Boolean
|
||||||
|
{
|
||||||
|
var _loc17_:b2Mat22 = param1.R;
|
||||||
|
var _loc15_:Number = param1.position.x + (_loc17_.col1.x * m_localPosition.x + _loc17_.col2.x * m_localPosition.y);
|
||||||
|
var _loc16_:Number = param1.position.y + (_loc17_.col1.y * m_localPosition.x + _loc17_.col2.y * m_localPosition.y);
|
||||||
|
var _loc11_:Number = param4.p1.x - _loc15_;
|
||||||
|
var _loc12_:Number = param4.p1.y - _loc16_;
|
||||||
|
var _loc9_:Number = _loc11_ * _loc11_ + _loc12_ * _loc12_ - m_radius * m_radius;
|
||||||
|
if(_loc9_ < 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var _loc13_:Number = param4.p2.x - param4.p1.x;
|
||||||
|
var _loc14_:Number = param4.p2.y - param4.p1.y;
|
||||||
|
var _loc10_:Number = _loc11_ * _loc13_ + _loc12_ * _loc14_;
|
||||||
|
var _loc6_:Number = _loc13_ * _loc13_ + _loc14_ * _loc14_;
|
||||||
|
var _loc7_:Number = _loc10_ * _loc10_ - _loc6_ * _loc9_;
|
||||||
|
if(_loc7_ < 0 || _loc6_ < Number.MIN_VALUE)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var _loc8_:Number = -(_loc10_ + Math.sqrt(_loc7_));
|
||||||
|
if(0 <= _loc8_ && _loc8_ <= param5 * _loc6_)
|
||||||
|
{
|
||||||
|
_loc8_ /= _loc6_;
|
||||||
|
param2[0] = _loc8_;
|
||||||
|
param3.x = _loc11_ + _loc8_ * _loc13_;
|
||||||
|
param3.y = _loc12_ + _loc8_ * _loc14_;
|
||||||
|
param3.Normalize();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function ComputeAABB(param1:b2AABB, param2:b2XForm) : void
|
||||||
|
{
|
||||||
|
var _loc4_:b2Mat22 = param2.R;
|
||||||
|
var _loc3_:Number = param2.position.x + (_loc4_.col1.x * m_localPosition.x + _loc4_.col2.x * m_localPosition.y);
|
||||||
|
var _loc5_:Number = param2.position.y + (_loc4_.col1.y * m_localPosition.x + _loc4_.col2.y * m_localPosition.y);
|
||||||
|
param1.lowerBound.Set(_loc3_ - m_radius,_loc5_ - m_radius);
|
||||||
|
param1.upperBound.Set(_loc3_ + m_radius,_loc5_ + m_radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function ComputeSweptAABB(param1:b2AABB, param2:b2XForm, param3:b2XForm) : void
|
||||||
|
{
|
||||||
|
var _loc7_:b2Mat22 = null;
|
||||||
|
_loc7_ = param2.R;
|
||||||
|
var _loc4_:Number = param2.position.x + (_loc7_.col1.x * m_localPosition.x + _loc7_.col2.x * m_localPosition.y);
|
||||||
|
var _loc8_:Number = param2.position.y + (_loc7_.col1.y * m_localPosition.x + _loc7_.col2.y * m_localPosition.y);
|
||||||
|
_loc7_ = param3.R;
|
||||||
|
var _loc6_:Number = param3.position.x + (_loc7_.col1.x * m_localPosition.x + _loc7_.col2.x * m_localPosition.y);
|
||||||
|
var _loc5_:Number = param3.position.y + (_loc7_.col1.y * m_localPosition.x + _loc7_.col2.y * m_localPosition.y);
|
||||||
|
param1.lowerBound.Set((_loc4_ < _loc6_ ? _loc4_ : _loc6_) - m_radius,(_loc8_ < _loc5_ ? _loc8_ : _loc5_) - m_radius);
|
||||||
|
param1.upperBound.Set((_loc4_ > _loc6_ ? _loc4_ : _loc6_) + m_radius,(_loc8_ > _loc5_ ? _loc8_ : _loc5_) + m_radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function ComputeMass(param1:b2MassData) : void
|
||||||
|
{
|
||||||
|
param1.mass = m_density * 3.141592653589793 * m_radius * m_radius;
|
||||||
|
param1.center.SetV(m_localPosition);
|
||||||
|
param1.I = param1.mass * (0.5 * m_radius * m_radius + (m_localPosition.x * m_localPosition.x + m_localPosition.y * m_localPosition.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetLocalPosition() : b2Vec2
|
||||||
|
{
|
||||||
|
return m_localPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetRadius() : Number
|
||||||
|
{
|
||||||
|
return m_radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function UpdateSweepRadius(param1:b2Vec2) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = m_localPosition.x - param1.x;
|
||||||
|
var _loc3_:Number = m_localPosition.y - param1.y;
|
||||||
|
_loc2_ = Math.sqrt(_loc2_ * _loc2_ + _loc3_ * _loc3_);
|
||||||
|
m_sweepRadius = _loc2_ + m_radius - 0.04;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package Box2D.Collision.Shapes
|
||||||
|
{
|
||||||
|
public class b2FilterData
|
||||||
|
{
|
||||||
|
|
||||||
|
public var categoryBits:uint = 1;
|
||||||
|
|
||||||
|
public var maskBits:uint = 65535;
|
||||||
|
|
||||||
|
public var groupIndex:int = 0;
|
||||||
|
|
||||||
|
public function b2FilterData()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Copy() : b2FilterData
|
||||||
|
{
|
||||||
|
var _loc1_:b2FilterData = new b2FilterData();
|
||||||
|
_loc1_.categoryBits = categoryBits;
|
||||||
|
_loc1_.maskBits = maskBits;
|
||||||
|
_loc1_.groupIndex = groupIndex;
|
||||||
|
return _loc1_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package Box2D.Collision.Shapes
|
||||||
|
{
|
||||||
|
import Box2D.Common.Math.b2Vec2;
|
||||||
|
|
||||||
|
public class b2MassData
|
||||||
|
{
|
||||||
|
|
||||||
|
public var mass:Number = 0;
|
||||||
|
|
||||||
|
public var center:b2Vec2 = new b2Vec2(0,0);
|
||||||
|
|
||||||
|
public var I:Number = 0;
|
||||||
|
|
||||||
|
public function b2MassData()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package Box2D.Collision.Shapes
|
||||||
|
{
|
||||||
|
import Box2D.Common.*;
|
||||||
|
import Box2D.Common.Math.*;
|
||||||
|
|
||||||
|
public class b2PolygonDef extends b2ShapeDef
|
||||||
|
{
|
||||||
|
|
||||||
|
private static var s_mat:b2Mat22 = new b2Mat22();
|
||||||
|
|
||||||
|
public var vertices:Array = new Array(8);
|
||||||
|
|
||||||
|
public var vertexCount:int;
|
||||||
|
|
||||||
|
public function b2PolygonDef()
|
||||||
|
{
|
||||||
|
var _loc1_:int = 0;
|
||||||
|
super();
|
||||||
|
type = 1;
|
||||||
|
vertexCount = 0;
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < 8)
|
||||||
|
{
|
||||||
|
vertices[_loc1_] = new b2Vec2();
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetAsBox(param1:Number, param2:Number) : void
|
||||||
|
{
|
||||||
|
vertexCount = 4;
|
||||||
|
vertices[0].Set(-param1,-param2);
|
||||||
|
vertices[1].Set(param1,-param2);
|
||||||
|
vertices[2].Set(param1,param2);
|
||||||
|
vertices[3].Set(-param1,param2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetAsOrientedBox(param1:Number, param2:Number, param3:b2Vec2 = null, param4:Number = 0) : void
|
||||||
|
{
|
||||||
|
var _loc6_:b2Vec2 = null;
|
||||||
|
var _loc5_:b2Mat22 = null;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
vertexCount = 4;
|
||||||
|
vertices[0].Set(-param1,-param2);
|
||||||
|
vertices[1].Set(param1,-param2);
|
||||||
|
vertices[2].Set(param1,param2);
|
||||||
|
vertices[3].Set(-param1,param2);
|
||||||
|
if(param3)
|
||||||
|
{
|
||||||
|
_loc6_ = param3;
|
||||||
|
_loc5_ = s_mat;
|
||||||
|
_loc5_.Set(param4);
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < vertexCount)
|
||||||
|
{
|
||||||
|
param3 = vertices[_loc7_];
|
||||||
|
param1 = _loc6_.x + (_loc5_.col1.x * param3.x + _loc5_.col2.x * param3.y);
|
||||||
|
param3.y = _loc6_.y + (_loc5_.col1.y * param3.x + _loc5_.col2.y * param3.y);
|
||||||
|
param3.x = param1;
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,492 @@
|
|||||||
|
package Box2D.Collision.Shapes
|
||||||
|
{
|
||||||
|
import Box2D.Collision.*;
|
||||||
|
import Box2D.Common.*;
|
||||||
|
import Box2D.Common.Math.*;
|
||||||
|
import Box2D.Dynamics.*;
|
||||||
|
|
||||||
|
public class b2PolygonShape extends b2Shape
|
||||||
|
{
|
||||||
|
|
||||||
|
private static var s_computeMat:b2Mat22 = new b2Mat22();
|
||||||
|
|
||||||
|
private static var s_sweptAABB1:b2AABB = new b2AABB();
|
||||||
|
|
||||||
|
private static var s_sweptAABB2:b2AABB = new b2AABB();
|
||||||
|
|
||||||
|
private var s_supportVec:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var m_centroid:b2Vec2;
|
||||||
|
|
||||||
|
public var m_obb:b2OBB = new b2OBB();
|
||||||
|
|
||||||
|
public var m_vertices:Array = new Array(8);
|
||||||
|
|
||||||
|
public var m_normals:Array = new Array(8);
|
||||||
|
|
||||||
|
public var m_coreVertices:Array = new Array(8);
|
||||||
|
|
||||||
|
public var m_vertexCount:int;
|
||||||
|
|
||||||
|
public function b2PolygonShape(param1:b2ShapeDef)
|
||||||
|
{
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc5_:Number = NaN;
|
||||||
|
var _loc2_:Number = NaN;
|
||||||
|
var _loc10_:Number = NaN;
|
||||||
|
var _loc11_:Number = NaN;
|
||||||
|
var _loc16_:Number = NaN;
|
||||||
|
var _loc14_:Number = NaN;
|
||||||
|
var _loc12_:Number = NaN;
|
||||||
|
var _loc3_:Number = NaN;
|
||||||
|
var _loc4_:Number = NaN;
|
||||||
|
var _loc13_:Number = NaN;
|
||||||
|
var _loc15_:Number = NaN;
|
||||||
|
var _loc9_:Number = NaN;
|
||||||
|
super(param1);
|
||||||
|
m_type = 1;
|
||||||
|
var _loc17_:b2PolygonDef = param1 as b2PolygonDef;
|
||||||
|
m_vertexCount = _loc17_.vertexCount;
|
||||||
|
var _loc6_:int = _loc7_;
|
||||||
|
var _loc8_:int = _loc7_;
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < m_vertexCount)
|
||||||
|
{
|
||||||
|
m_vertices[_loc7_] = _loc17_.vertices[_loc7_].Copy();
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < m_vertexCount)
|
||||||
|
{
|
||||||
|
_loc6_ = _loc7_;
|
||||||
|
_loc8_ = _loc7_ + 1 < m_vertexCount ? _loc7_ + 1 : 0;
|
||||||
|
_loc5_ = m_vertices[_loc8_].x - m_vertices[_loc6_].x;
|
||||||
|
_loc2_ = m_vertices[_loc8_].y - m_vertices[_loc6_].y;
|
||||||
|
_loc10_ = Math.sqrt(_loc5_ * _loc5_ + _loc2_ * _loc2_);
|
||||||
|
m_normals[_loc7_] = new b2Vec2(_loc2_ / _loc10_,-_loc5_ / _loc10_);
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
m_centroid = ComputeCentroid(_loc17_.vertices,_loc17_.vertexCount);
|
||||||
|
ComputeOBB(m_obb,m_vertices,m_vertexCount);
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < m_vertexCount)
|
||||||
|
{
|
||||||
|
_loc6_ = _loc7_ - 1 >= 0 ? _loc7_ - 1 : m_vertexCount - 1;
|
||||||
|
_loc8_ = _loc7_;
|
||||||
|
_loc11_ = Number(m_normals[_loc6_].x);
|
||||||
|
_loc16_ = Number(m_normals[_loc6_].y);
|
||||||
|
_loc14_ = Number(m_normals[_loc8_].x);
|
||||||
|
_loc12_ = Number(m_normals[_loc8_].y);
|
||||||
|
_loc3_ = m_vertices[_loc7_].x - m_centroid.x;
|
||||||
|
_loc4_ = m_vertices[_loc7_].y - m_centroid.y;
|
||||||
|
_loc13_ = _loc11_ * _loc3_ + _loc16_ * _loc4_ - 0.04;
|
||||||
|
_loc15_ = _loc14_ * _loc3_ + _loc12_ * _loc4_ - 0.04;
|
||||||
|
_loc9_ = 1 / (_loc11_ * _loc12_ - _loc16_ * _loc14_);
|
||||||
|
m_coreVertices[_loc7_] = new b2Vec2(_loc9_ * (_loc12_ * _loc13_ - _loc16_ * _loc15_) + m_centroid.x,_loc9_ * (_loc11_ * _loc15_ - _loc14_ * _loc13_) + m_centroid.y);
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function ComputeCentroid(param1:Array, param2:int) : b2Vec2
|
||||||
|
{
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
var _loc4_:b2Vec2 = null;
|
||||||
|
var _loc6_:b2Vec2 = null;
|
||||||
|
var _loc11_:Number = NaN;
|
||||||
|
var _loc10_:Number = NaN;
|
||||||
|
var _loc9_:Number = NaN;
|
||||||
|
var _loc12_:Number = NaN;
|
||||||
|
var _loc7_:Number = NaN;
|
||||||
|
var _loc14_:Number = NaN;
|
||||||
|
var _loc5_:b2Vec2 = new b2Vec2();
|
||||||
|
var _loc3_:Number = 0;
|
||||||
|
var _loc15_:Number = 0;
|
||||||
|
var _loc16_:Number = 0;
|
||||||
|
var _loc13_:Number = 0.3333333333333333;
|
||||||
|
_loc8_ = 0;
|
||||||
|
while(_loc8_ < param2)
|
||||||
|
{
|
||||||
|
_loc4_ = param1[_loc8_];
|
||||||
|
_loc6_ = _loc8_ + 1 < param2 ? param1[int(_loc8_ + 1)] : param1[0];
|
||||||
|
_loc11_ = _loc4_.x - _loc15_;
|
||||||
|
_loc10_ = _loc4_.y - _loc16_;
|
||||||
|
_loc9_ = _loc6_.x - _loc15_;
|
||||||
|
_loc12_ = _loc6_.y - _loc16_;
|
||||||
|
_loc7_ = _loc11_ * _loc12_ - _loc10_ * _loc9_;
|
||||||
|
_loc14_ = 0.5 * _loc7_;
|
||||||
|
_loc3_ += _loc14_;
|
||||||
|
_loc5_.x += _loc14_ * _loc13_ * (_loc15_ + _loc4_.x + _loc6_.x);
|
||||||
|
_loc5_.y += _loc14_ * _loc13_ * (_loc16_ + _loc4_.y + _loc6_.y);
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
_loc5_.x *= 1 / _loc3_;
|
||||||
|
_loc5_.y *= 1 / _loc3_;
|
||||||
|
return _loc5_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function ComputeOBB(param1:b2OBB, param2:Array, param3:int) : void
|
||||||
|
{
|
||||||
|
var _loc16_:int = 0;
|
||||||
|
var _loc7_:b2Vec2 = null;
|
||||||
|
var _loc6_:Number = NaN;
|
||||||
|
var _loc8_:Number = NaN;
|
||||||
|
var _loc14_:Number = NaN;
|
||||||
|
var _loc23_:Number = NaN;
|
||||||
|
var _loc21_:Number = NaN;
|
||||||
|
var _loc15_:Number = NaN;
|
||||||
|
var _loc12_:Number = NaN;
|
||||||
|
var _loc20_:Number = NaN;
|
||||||
|
var _loc19_:Number = NaN;
|
||||||
|
var _loc17_:int = 0;
|
||||||
|
var _loc22_:Number = NaN;
|
||||||
|
var _loc24_:Number = NaN;
|
||||||
|
var _loc11_:Number = NaN;
|
||||||
|
var _loc13_:Number = NaN;
|
||||||
|
var _loc10_:Number = NaN;
|
||||||
|
var _loc5_:Number = NaN;
|
||||||
|
var _loc4_:Number = NaN;
|
||||||
|
var _loc25_:b2Mat22 = null;
|
||||||
|
var _loc18_:Array = new Array(8 + 1);
|
||||||
|
_loc16_ = 0;
|
||||||
|
while(_loc16_ < param3)
|
||||||
|
{
|
||||||
|
_loc18_[_loc16_] = param2[_loc16_];
|
||||||
|
_loc16_++;
|
||||||
|
}
|
||||||
|
_loc18_[param3] = _loc18_[0];
|
||||||
|
var _loc9_:Number = 1.7976931348623157e+308;
|
||||||
|
_loc16_ = 1;
|
||||||
|
while(_loc16_ <= param3)
|
||||||
|
{
|
||||||
|
_loc7_ = _loc18_[int(_loc16_ - 1)];
|
||||||
|
_loc6_ = _loc18_[_loc16_].x - _loc7_.x;
|
||||||
|
_loc8_ = _loc18_[_loc16_].y - _loc7_.y;
|
||||||
|
_loc14_ = Math.sqrt(_loc6_ * _loc6_ + _loc8_ * _loc8_);
|
||||||
|
_loc6_ /= _loc14_;
|
||||||
|
_loc8_ /= _loc14_;
|
||||||
|
_loc23_ = -_loc8_;
|
||||||
|
_loc21_ = _loc6_;
|
||||||
|
_loc15_ = 1.7976931348623157e+308;
|
||||||
|
_loc12_ = 1.7976931348623157e+308;
|
||||||
|
_loc20_ = -1.7976931348623157e+308;
|
||||||
|
_loc19_ = -1.7976931348623157e+308;
|
||||||
|
_loc17_ = 0;
|
||||||
|
while(_loc17_ < param3)
|
||||||
|
{
|
||||||
|
_loc22_ = _loc18_[_loc17_].x - _loc7_.x;
|
||||||
|
_loc24_ = _loc18_[_loc17_].y - _loc7_.y;
|
||||||
|
_loc11_ = _loc6_ * _loc22_ + _loc8_ * _loc24_;
|
||||||
|
_loc13_ = _loc23_ * _loc22_ + _loc21_ * _loc24_;
|
||||||
|
if(_loc11_ < _loc15_)
|
||||||
|
{
|
||||||
|
_loc15_ = _loc11_;
|
||||||
|
}
|
||||||
|
if(_loc13_ < _loc12_)
|
||||||
|
{
|
||||||
|
_loc12_ = _loc13_;
|
||||||
|
}
|
||||||
|
if(_loc11_ > _loc20_)
|
||||||
|
{
|
||||||
|
_loc20_ = _loc11_;
|
||||||
|
}
|
||||||
|
if(_loc13_ > _loc19_)
|
||||||
|
{
|
||||||
|
_loc19_ = _loc13_;
|
||||||
|
}
|
||||||
|
_loc17_++;
|
||||||
|
}
|
||||||
|
_loc10_ = (_loc20_ - _loc15_) * (_loc19_ - _loc12_);
|
||||||
|
if(_loc10_ < 0.95 * _loc9_)
|
||||||
|
{
|
||||||
|
_loc9_ = _loc10_;
|
||||||
|
param1.R.col1.x = _loc6_;
|
||||||
|
param1.R.col1.y = _loc8_;
|
||||||
|
param1.R.col2.x = _loc23_;
|
||||||
|
param1.R.col2.y = _loc21_;
|
||||||
|
_loc5_ = 0.5 * (_loc15_ + _loc20_);
|
||||||
|
_loc4_ = 0.5 * (_loc12_ + _loc19_);
|
||||||
|
_loc25_ = param1.R;
|
||||||
|
param1.center.x = _loc7_.x + (_loc25_.col1.x * _loc5_ + _loc25_.col2.x * _loc4_);
|
||||||
|
param1.center.y = _loc7_.y + (_loc25_.col1.y * _loc5_ + _loc25_.col2.y * _loc4_);
|
||||||
|
param1.extents.x = 0.5 * (_loc20_ - _loc15_);
|
||||||
|
param1.extents.y = 0.5 * (_loc19_ - _loc12_);
|
||||||
|
}
|
||||||
|
_loc16_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function TestPoint(param1:b2XForm, param2:b2Vec2) : Boolean
|
||||||
|
{
|
||||||
|
var _loc5_:b2Vec2 = null;
|
||||||
|
var _loc9_:int = 0;
|
||||||
|
var _loc6_:Number = NaN;
|
||||||
|
var _loc7_:b2Mat22 = param1.R;
|
||||||
|
var _loc3_:Number = param2.x - param1.position.x;
|
||||||
|
var _loc4_:Number = param2.y - param1.position.y;
|
||||||
|
var _loc8_:Number = _loc3_ * _loc7_.col1.x + _loc4_ * _loc7_.col1.y;
|
||||||
|
var _loc10_:Number = _loc3_ * _loc7_.col2.x + _loc4_ * _loc7_.col2.y;
|
||||||
|
_loc9_ = 0;
|
||||||
|
while(_loc9_ < m_vertexCount)
|
||||||
|
{
|
||||||
|
_loc5_ = m_vertices[_loc9_];
|
||||||
|
_loc3_ = _loc8_ - _loc5_.x;
|
||||||
|
_loc4_ = _loc10_ - _loc5_.y;
|
||||||
|
_loc5_ = m_normals[_loc9_];
|
||||||
|
_loc6_ = _loc5_.x * _loc3_ + _loc5_.y * _loc4_;
|
||||||
|
if(_loc6_ > 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_loc9_++;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function TestSegment(param1:b2XForm, param2:Array, param3:b2Vec2, param4:b2Segment, param5:Number) : Boolean
|
||||||
|
{
|
||||||
|
var _loc6_:Number = NaN;
|
||||||
|
var _loc7_:Number = NaN;
|
||||||
|
var _loc20_:b2Mat22 = null;
|
||||||
|
var _loc16_:b2Vec2 = null;
|
||||||
|
var _loc11_:int = 0;
|
||||||
|
var _loc12_:Number = NaN;
|
||||||
|
var _loc13_:Number = NaN;
|
||||||
|
var _loc8_:Number = 0;
|
||||||
|
var _loc9_:Number = param5;
|
||||||
|
_loc6_ = param4.p1.x - param1.position.x;
|
||||||
|
_loc7_ = param4.p1.y - param1.position.y;
|
||||||
|
_loc20_ = param1.R;
|
||||||
|
var _loc17_:Number = _loc6_ * _loc20_.col1.x + _loc7_ * _loc20_.col1.y;
|
||||||
|
var _loc21_:Number = _loc6_ * _loc20_.col2.x + _loc7_ * _loc20_.col2.y;
|
||||||
|
_loc6_ = param4.p2.x - param1.position.x;
|
||||||
|
_loc7_ = param4.p2.y - param1.position.y;
|
||||||
|
_loc20_ = param1.R;
|
||||||
|
var _loc19_:Number = _loc6_ * _loc20_.col1.x + _loc7_ * _loc20_.col1.y;
|
||||||
|
var _loc18_:Number = _loc6_ * _loc20_.col2.x + _loc7_ * _loc20_.col2.y;
|
||||||
|
var _loc14_:Number = _loc19_ - _loc17_;
|
||||||
|
var _loc15_:Number = _loc18_ - _loc21_;
|
||||||
|
var _loc10_:* = -1;
|
||||||
|
_loc11_ = 0;
|
||||||
|
while(_loc11_ < m_vertexCount)
|
||||||
|
{
|
||||||
|
_loc16_ = m_vertices[_loc11_];
|
||||||
|
_loc6_ = _loc16_.x - _loc17_;
|
||||||
|
_loc7_ = _loc16_.y - _loc21_;
|
||||||
|
_loc16_ = m_normals[_loc11_];
|
||||||
|
_loc12_ = _loc16_.x * _loc6_ + _loc16_.y * _loc7_;
|
||||||
|
_loc13_ = _loc16_.x * _loc14_ + _loc16_.y * _loc15_;
|
||||||
|
if(_loc13_ < 0 && _loc12_ < _loc8_ * _loc13_)
|
||||||
|
{
|
||||||
|
_loc8_ = _loc12_ / _loc13_;
|
||||||
|
_loc10_ = _loc11_;
|
||||||
|
}
|
||||||
|
else if(_loc13_ > 0 && _loc12_ < _loc9_ * _loc13_)
|
||||||
|
{
|
||||||
|
_loc9_ = _loc12_ / _loc13_;
|
||||||
|
}
|
||||||
|
if(_loc9_ < _loc8_)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_loc11_++;
|
||||||
|
}
|
||||||
|
if(_loc10_ >= 0)
|
||||||
|
{
|
||||||
|
param2[0] = _loc8_;
|
||||||
|
_loc20_ = param1.R;
|
||||||
|
_loc16_ = m_normals[_loc10_];
|
||||||
|
param3.x = _loc20_.col1.x * _loc16_.x + _loc20_.col2.x * _loc16_.y;
|
||||||
|
param3.y = _loc20_.col1.y * _loc16_.x + _loc20_.col2.y * _loc16_.y;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function ComputeAABB(param1:b2AABB, param2:b2XForm) : void
|
||||||
|
{
|
||||||
|
var _loc8_:b2Mat22 = null;
|
||||||
|
var _loc7_:b2Vec2 = null;
|
||||||
|
var _loc6_:b2Mat22 = s_computeMat;
|
||||||
|
_loc8_ = param2.R;
|
||||||
|
_loc7_ = m_obb.R.col1;
|
||||||
|
_loc6_.col1.x = _loc8_.col1.x * _loc7_.x + _loc8_.col2.x * _loc7_.y;
|
||||||
|
_loc6_.col1.y = _loc8_.col1.y * _loc7_.x + _loc8_.col2.y * _loc7_.y;
|
||||||
|
_loc7_ = m_obb.R.col2;
|
||||||
|
_loc6_.col2.x = _loc8_.col1.x * _loc7_.x + _loc8_.col2.x * _loc7_.y;
|
||||||
|
_loc6_.col2.y = _loc8_.col1.y * _loc7_.x + _loc8_.col2.y * _loc7_.y;
|
||||||
|
_loc6_.Abs();
|
||||||
|
var _loc9_:b2Mat22 = _loc6_;
|
||||||
|
_loc7_ = m_obb.extents;
|
||||||
|
var _loc3_:Number = _loc9_.col1.x * _loc7_.x + _loc9_.col2.x * _loc7_.y;
|
||||||
|
var _loc5_:Number = _loc9_.col1.y * _loc7_.x + _loc9_.col2.y * _loc7_.y;
|
||||||
|
_loc8_ = param2.R;
|
||||||
|
_loc7_ = m_obb.center;
|
||||||
|
var _loc10_:Number = param2.position.x + (_loc8_.col1.x * _loc7_.x + _loc8_.col2.x * _loc7_.y);
|
||||||
|
var _loc4_:Number = param2.position.y + (_loc8_.col1.y * _loc7_.x + _loc8_.col2.y * _loc7_.y);
|
||||||
|
param1.lowerBound.Set(_loc10_ - _loc3_,_loc4_ - _loc5_);
|
||||||
|
param1.upperBound.Set(_loc10_ + _loc3_,_loc4_ + _loc5_);
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function ComputeSweptAABB(param1:b2AABB, param2:b2XForm, param3:b2XForm) : void
|
||||||
|
{
|
||||||
|
var _loc4_:b2AABB = s_sweptAABB1;
|
||||||
|
var _loc5_:b2AABB = s_sweptAABB2;
|
||||||
|
ComputeAABB(_loc4_,param2);
|
||||||
|
ComputeAABB(_loc5_,param3);
|
||||||
|
param1.lowerBound.Set(_loc4_.lowerBound.x < _loc5_.lowerBound.x ? _loc4_.lowerBound.x : _loc5_.lowerBound.x,_loc4_.lowerBound.y < _loc5_.lowerBound.y ? _loc4_.lowerBound.y : _loc5_.lowerBound.y);
|
||||||
|
param1.upperBound.Set(_loc4_.upperBound.x > _loc5_.upperBound.x ? _loc4_.upperBound.x : _loc5_.upperBound.x,_loc4_.upperBound.y > _loc5_.upperBound.y ? _loc4_.upperBound.y : _loc5_.upperBound.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function ComputeMass(param1:b2MassData) : void
|
||||||
|
{
|
||||||
|
var _loc16_:int = 0;
|
||||||
|
var _loc3_:b2Vec2 = null;
|
||||||
|
var _loc4_:b2Vec2 = null;
|
||||||
|
var _loc18_:Number = NaN;
|
||||||
|
var _loc17_:Number = NaN;
|
||||||
|
var _loc10_:Number = NaN;
|
||||||
|
var _loc11_:Number = NaN;
|
||||||
|
var _loc5_:Number = NaN;
|
||||||
|
var _loc21_:Number = NaN;
|
||||||
|
var _loc7_:Number = NaN;
|
||||||
|
var _loc9_:Number = NaN;
|
||||||
|
var _loc14_:Number = NaN;
|
||||||
|
var _loc24_:Number = NaN;
|
||||||
|
var _loc13_:Number = NaN;
|
||||||
|
var _loc25_:Number = NaN;
|
||||||
|
var _loc12_:Number = NaN;
|
||||||
|
var _loc19_:Number = NaN;
|
||||||
|
var _loc6_:Number = 0;
|
||||||
|
var _loc2_:Number = 0;
|
||||||
|
var _loc15_:Number = 0;
|
||||||
|
var _loc8_:Number = 0;
|
||||||
|
var _loc22_:Number = 0;
|
||||||
|
var _loc23_:Number = 0;
|
||||||
|
var _loc20_:Number = 0.3333333333333333;
|
||||||
|
_loc16_ = 0;
|
||||||
|
while(_loc16_ < m_vertexCount)
|
||||||
|
{
|
||||||
|
_loc3_ = m_vertices[_loc16_];
|
||||||
|
_loc4_ = _loc16_ + 1 < m_vertexCount ? m_vertices[int(_loc16_ + 1)] : m_vertices[0];
|
||||||
|
_loc18_ = _loc3_.x - _loc22_;
|
||||||
|
_loc17_ = _loc3_.y - _loc23_;
|
||||||
|
_loc10_ = _loc4_.x - _loc22_;
|
||||||
|
_loc11_ = _loc4_.y - _loc23_;
|
||||||
|
_loc5_ = _loc18_ * _loc11_ - _loc17_ * _loc10_;
|
||||||
|
_loc21_ = 0.5 * _loc5_;
|
||||||
|
_loc15_ += _loc21_;
|
||||||
|
_loc6_ += _loc21_ * _loc20_ * (_loc22_ + _loc3_.x + _loc4_.x);
|
||||||
|
_loc2_ += _loc21_ * _loc20_ * (_loc23_ + _loc3_.y + _loc4_.y);
|
||||||
|
_loc7_ = _loc22_;
|
||||||
|
_loc9_ = _loc23_;
|
||||||
|
_loc14_ = _loc18_;
|
||||||
|
_loc24_ = _loc17_;
|
||||||
|
_loc13_ = _loc10_;
|
||||||
|
_loc25_ = _loc11_;
|
||||||
|
_loc12_ = _loc20_ * (0.25 * (_loc14_ * _loc14_ + _loc13_ * _loc14_ + _loc13_ * _loc13_) + (_loc7_ * _loc14_ + _loc7_ * _loc13_)) + 0.5 * _loc7_ * _loc7_;
|
||||||
|
_loc19_ = _loc20_ * (0.25 * (_loc24_ * _loc24_ + _loc25_ * _loc24_ + _loc25_ * _loc25_) + (_loc9_ * _loc24_ + _loc9_ * _loc25_)) + 0.5 * _loc9_ * _loc9_;
|
||||||
|
_loc8_ += _loc5_ * (_loc12_ + _loc19_);
|
||||||
|
_loc16_++;
|
||||||
|
}
|
||||||
|
param1.mass = m_density * _loc15_;
|
||||||
|
_loc6_ *= 1 / _loc15_;
|
||||||
|
_loc2_ *= 1 / _loc15_;
|
||||||
|
param1.center.Set(_loc6_,_loc2_);
|
||||||
|
param1.I = m_density * _loc8_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetOBB() : b2OBB
|
||||||
|
{
|
||||||
|
return m_obb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetCentroid() : b2Vec2
|
||||||
|
{
|
||||||
|
return m_centroid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetVertexCount() : int
|
||||||
|
{
|
||||||
|
return m_vertexCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetVertices() : Array
|
||||||
|
{
|
||||||
|
return m_vertices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetCoreVertices() : Array
|
||||||
|
{
|
||||||
|
return m_coreVertices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetNormals() : Array
|
||||||
|
{
|
||||||
|
return m_normals;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetFirstVertex(param1:b2XForm) : b2Vec2
|
||||||
|
{
|
||||||
|
return b2Math.b2MulX(param1,m_coreVertices[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Centroid(param1:b2XForm) : b2Vec2
|
||||||
|
{
|
||||||
|
return b2Math.b2MulX(param1,m_centroid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Support(param1:b2XForm, param2:Number, param3:Number) : b2Vec2
|
||||||
|
{
|
||||||
|
var _loc4_:b2Vec2 = null;
|
||||||
|
var _loc6_:b2Mat22 = null;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc10_:Number = NaN;
|
||||||
|
_loc6_ = param1.R;
|
||||||
|
var _loc8_:Number = param2 * _loc6_.col1.x + param3 * _loc6_.col1.y;
|
||||||
|
var _loc5_:Number = param2 * _loc6_.col2.x + param3 * _loc6_.col2.y;
|
||||||
|
var _loc11_:int = 0;
|
||||||
|
_loc4_ = m_coreVertices[0];
|
||||||
|
var _loc9_:Number = _loc4_.x * _loc8_ + _loc4_.y * _loc5_;
|
||||||
|
_loc7_ = 1;
|
||||||
|
while(_loc7_ < m_vertexCount)
|
||||||
|
{
|
||||||
|
_loc4_ = m_coreVertices[_loc7_];
|
||||||
|
_loc10_ = _loc4_.x * _loc8_ + _loc4_.y * _loc5_;
|
||||||
|
if(_loc10_ > _loc9_)
|
||||||
|
{
|
||||||
|
_loc11_ = _loc7_;
|
||||||
|
_loc9_ = _loc10_;
|
||||||
|
}
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
_loc6_ = param1.R;
|
||||||
|
_loc4_ = m_coreVertices[_loc11_];
|
||||||
|
s_supportVec.x = param1.position.x + (_loc6_.col1.x * _loc4_.x + _loc6_.col2.x * _loc4_.y);
|
||||||
|
s_supportVec.y = param1.position.y + (_loc6_.col1.y * _loc4_.x + _loc6_.col2.y * _loc4_.y);
|
||||||
|
return s_supportVec;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function UpdateSweepRadius(param1:b2Vec2) : void
|
||||||
|
{
|
||||||
|
var _loc4_:b2Vec2 = null;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc2_:Number = NaN;
|
||||||
|
var _loc3_:Number = NaN;
|
||||||
|
m_sweepRadius = 0;
|
||||||
|
_loc5_ = 0;
|
||||||
|
while(_loc5_ < m_vertexCount)
|
||||||
|
{
|
||||||
|
_loc4_ = m_coreVertices[_loc5_];
|
||||||
|
_loc2_ = _loc4_.x - param1.x;
|
||||||
|
_loc3_ = _loc4_.y - param1.y;
|
||||||
|
_loc2_ = Math.sqrt(_loc2_ * _loc2_ + _loc3_ * _loc3_);
|
||||||
|
if(_loc2_ > m_sweepRadius)
|
||||||
|
{
|
||||||
|
m_sweepRadius = _loc2_;
|
||||||
|
}
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,224 @@
|
|||||||
|
package Box2D.Collision.Shapes
|
||||||
|
{
|
||||||
|
import Box2D.Collision.b2AABB;
|
||||||
|
import Box2D.Collision.b2BroadPhase;
|
||||||
|
import Box2D.Collision.b2Pair;
|
||||||
|
import Box2D.Collision.b2Segment;
|
||||||
|
import Box2D.Common.Math.b2Vec2;
|
||||||
|
import Box2D.Common.Math.b2XForm;
|
||||||
|
import Box2D.Dynamics.b2Body;
|
||||||
|
|
||||||
|
public class b2Shape
|
||||||
|
{
|
||||||
|
|
||||||
|
public static const e_unknownShape:int = -1;
|
||||||
|
|
||||||
|
public static const e_circleShape:int = 0;
|
||||||
|
|
||||||
|
public static const e_polygonShape:int = 1;
|
||||||
|
|
||||||
|
public static const e_shapeTypeCount:int = 2;
|
||||||
|
|
||||||
|
private static var s_proxyAABB:b2AABB = new b2AABB();
|
||||||
|
|
||||||
|
private static var s_syncAABB:b2AABB = new b2AABB();
|
||||||
|
|
||||||
|
private static var s_resetAABB:b2AABB = new b2AABB();
|
||||||
|
|
||||||
|
public var m_type:int;
|
||||||
|
|
||||||
|
public var m_next:b2Shape;
|
||||||
|
|
||||||
|
public var m_body:b2Body;
|
||||||
|
|
||||||
|
public var m_sweepRadius:Number;
|
||||||
|
|
||||||
|
public var m_density:Number;
|
||||||
|
|
||||||
|
public var m_friction:Number;
|
||||||
|
|
||||||
|
public var m_restitution:Number;
|
||||||
|
|
||||||
|
public var m_proxyId:uint;
|
||||||
|
|
||||||
|
public var m_filter:b2FilterData;
|
||||||
|
|
||||||
|
public var m_isSensor:Boolean;
|
||||||
|
|
||||||
|
public var m_userData:*;
|
||||||
|
|
||||||
|
public function b2Shape(param1:b2ShapeDef)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
m_userData = param1.userData;
|
||||||
|
m_friction = param1.friction;
|
||||||
|
m_restitution = param1.restitution;
|
||||||
|
m_density = param1.density;
|
||||||
|
m_body = null;
|
||||||
|
m_sweepRadius = 0;
|
||||||
|
m_next = null;
|
||||||
|
m_proxyId = b2Pair.b2_nullProxy;
|
||||||
|
m_filter = param1.filter.Copy();
|
||||||
|
m_isSensor = param1.isSensor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function Create(param1:b2ShapeDef, param2:*) : b2Shape
|
||||||
|
{
|
||||||
|
switch(param1.type)
|
||||||
|
{
|
||||||
|
case e_circleShape:
|
||||||
|
return new b2CircleShape(param1);
|
||||||
|
case 1:
|
||||||
|
return new b2PolygonShape(param1);
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function Destroy(param1:b2Shape, param2:*) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetType() : int
|
||||||
|
{
|
||||||
|
return m_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function IsSensor() : Boolean
|
||||||
|
{
|
||||||
|
return m_isSensor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetFilterData(param1:b2FilterData) : void
|
||||||
|
{
|
||||||
|
m_filter = param1.Copy();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetFilterData() : b2FilterData
|
||||||
|
{
|
||||||
|
return m_filter.Copy();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetBody() : b2Body
|
||||||
|
{
|
||||||
|
return m_body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetNext() : b2Shape
|
||||||
|
{
|
||||||
|
return m_next;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetUserData() : *
|
||||||
|
{
|
||||||
|
return m_userData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetUserData(param1:*) : void
|
||||||
|
{
|
||||||
|
m_userData = param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function TestPoint(param1:b2XForm, param2:b2Vec2) : Boolean
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function TestSegment(param1:b2XForm, param2:Array, param3:b2Vec2, param4:b2Segment, param5:Number) : Boolean
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ComputeAABB(param1:b2AABB, param2:b2XForm) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ComputeSweptAABB(param1:b2AABB, param2:b2XForm, param3:b2XForm) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ComputeMass(param1:b2MassData) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetSweepRadius() : Number
|
||||||
|
{
|
||||||
|
return m_sweepRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetFriction() : Number
|
||||||
|
{
|
||||||
|
return m_friction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetRestitution() : Number
|
||||||
|
{
|
||||||
|
return m_restitution;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function CreateProxy(param1:b2BroadPhase, param2:b2XForm) : void
|
||||||
|
{
|
||||||
|
var _loc4_:b2AABB = s_proxyAABB;
|
||||||
|
ComputeAABB(_loc4_,param2);
|
||||||
|
var _loc3_:Boolean = param1.InRange(_loc4_);
|
||||||
|
if(_loc3_)
|
||||||
|
{
|
||||||
|
m_proxyId = param1.CreateProxy(_loc4_,this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_proxyId = b2Pair.b2_nullProxy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function DestroyProxy(param1:b2BroadPhase) : void
|
||||||
|
{
|
||||||
|
if(m_proxyId != b2Pair.b2_nullProxy)
|
||||||
|
{
|
||||||
|
param1.DestroyProxy(m_proxyId);
|
||||||
|
m_proxyId = b2Pair.b2_nullProxy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Synchronize(param1:b2BroadPhase, param2:b2XForm, param3:b2XForm) : Boolean
|
||||||
|
{
|
||||||
|
if(m_proxyId == b2Pair.b2_nullProxy)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var _loc4_:b2AABB = s_syncAABB;
|
||||||
|
ComputeSweptAABB(_loc4_,param2,param3);
|
||||||
|
if(param1.InRange(_loc4_))
|
||||||
|
{
|
||||||
|
param1.MoveProxy(m_proxyId,_loc4_);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function RefilterProxy(param1:b2BroadPhase, param2:b2XForm) : void
|
||||||
|
{
|
||||||
|
if(m_proxyId == b2Pair.b2_nullProxy)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
param1.DestroyProxy(m_proxyId);
|
||||||
|
var _loc4_:b2AABB = s_resetAABB;
|
||||||
|
ComputeAABB(_loc4_,param2);
|
||||||
|
var _loc3_:Boolean = param1.InRange(_loc4_);
|
||||||
|
if(_loc3_)
|
||||||
|
{
|
||||||
|
m_proxyId = param1.CreateProxy(_loc4_,this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_proxyId = b2Pair.b2_nullProxy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function UpdateSweepRadius(param1:b2Vec2) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package Box2D.Collision.Shapes
|
||||||
|
{
|
||||||
|
public class b2ShapeDef
|
||||||
|
{
|
||||||
|
|
||||||
|
public var type:int = -1;
|
||||||
|
|
||||||
|
public var userData:* = null;
|
||||||
|
|
||||||
|
public var friction:Number = 0.2;
|
||||||
|
|
||||||
|
public var restitution:Number = 0;
|
||||||
|
|
||||||
|
public var density:Number = 0;
|
||||||
|
|
||||||
|
public var isSensor:Boolean = false;
|
||||||
|
|
||||||
|
public var filter:b2FilterData = new b2FilterData();
|
||||||
|
|
||||||
|
public function b2ShapeDef()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Common.Math.b2Vec2;
|
||||||
|
|
||||||
|
public class b2AABB
|
||||||
|
{
|
||||||
|
|
||||||
|
public var lowerBound:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var upperBound:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public function b2AABB()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function IsValid() : Boolean
|
||||||
|
{
|
||||||
|
var _loc2_:Number = upperBound.x - lowerBound.x;
|
||||||
|
var _loc3_:Number = upperBound.y - lowerBound.y;
|
||||||
|
var _loc1_:Boolean = _loc2_ >= 0 && _loc3_ >= 0;
|
||||||
|
return _loc1_ && lowerBound.IsValid() && upperBound.IsValid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
public class b2Bound
|
||||||
|
{
|
||||||
|
|
||||||
|
public var value:uint;
|
||||||
|
|
||||||
|
public var proxyId:uint;
|
||||||
|
|
||||||
|
public var stabbingCount:uint;
|
||||||
|
|
||||||
|
public function b2Bound()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function IsLower() : Boolean
|
||||||
|
{
|
||||||
|
return (value & 1) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function IsUpper() : Boolean
|
||||||
|
{
|
||||||
|
return (value & 1) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Swap(param1:b2Bound) : void
|
||||||
|
{
|
||||||
|
var _loc4_:uint = value;
|
||||||
|
var _loc3_:uint = proxyId;
|
||||||
|
var _loc2_:uint = stabbingCount;
|
||||||
|
value = param1.value;
|
||||||
|
proxyId = param1.proxyId;
|
||||||
|
stabbingCount = param1.stabbingCount;
|
||||||
|
param1.value = _loc4_;
|
||||||
|
param1.proxyId = _loc3_;
|
||||||
|
param1.stabbingCount = _loc2_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
public class b2BoundValues
|
||||||
|
{
|
||||||
|
|
||||||
|
public var lowerValues:Array = [0,0];
|
||||||
|
|
||||||
|
public var upperValues:Array = [0,0];
|
||||||
|
|
||||||
|
public function b2BoundValues()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,836 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Common.*;
|
||||||
|
import Box2D.Common.Math.*;
|
||||||
|
|
||||||
|
public class b2BroadPhase
|
||||||
|
{
|
||||||
|
|
||||||
|
public static var s_validate:Boolean = false;
|
||||||
|
|
||||||
|
public static const b2_invalid:uint = 65535;
|
||||||
|
|
||||||
|
public static const b2_nullEdge:uint = 65535;
|
||||||
|
|
||||||
|
public var m_pairManager:b2PairManager = new b2PairManager();
|
||||||
|
|
||||||
|
public var m_proxyPool:Array = new Array(4096);
|
||||||
|
|
||||||
|
public var m_freeProxy:uint;
|
||||||
|
|
||||||
|
public var m_bounds:Array = new Array(2 * 512);
|
||||||
|
|
||||||
|
public var m_queryResults:Array = new Array(512);
|
||||||
|
|
||||||
|
public var m_queryResultCount:int;
|
||||||
|
|
||||||
|
public var m_worldAABB:b2AABB;
|
||||||
|
|
||||||
|
public var m_quantizationFactor:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var m_proxyCount:int;
|
||||||
|
|
||||||
|
public var m_timeStamp:uint;
|
||||||
|
|
||||||
|
public function b2BroadPhase(param1:b2AABB, param2:b2PairCallback)
|
||||||
|
{
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc5_:b2Proxy = null;
|
||||||
|
super();
|
||||||
|
m_pairManager.Initialize(this,param2);
|
||||||
|
m_worldAABB = param1;
|
||||||
|
m_proxyCount = 0;
|
||||||
|
_loc6_ = 0;
|
||||||
|
while(_loc6_ < 512)
|
||||||
|
{
|
||||||
|
m_queryResults[_loc6_] = 0;
|
||||||
|
_loc6_++;
|
||||||
|
}
|
||||||
|
m_bounds = new Array(2);
|
||||||
|
_loc6_ = 0;
|
||||||
|
while(_loc6_ < 2)
|
||||||
|
{
|
||||||
|
m_bounds[_loc6_] = new Array(2 * 512);
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < 2 * 512)
|
||||||
|
{
|
||||||
|
m_bounds[_loc6_][_loc7_] = new b2Bound();
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
_loc6_++;
|
||||||
|
}
|
||||||
|
var _loc3_:Number = param1.upperBound.x - param1.lowerBound.x;
|
||||||
|
var _loc4_:Number = param1.upperBound.y - param1.lowerBound.y;
|
||||||
|
m_quantizationFactor.x = 65535 / _loc3_;
|
||||||
|
m_quantizationFactor.y = 65535 / _loc4_;
|
||||||
|
_loc6_ = 0;
|
||||||
|
while(_loc6_ < 512 - 1)
|
||||||
|
{
|
||||||
|
_loc5_ = new b2Proxy();
|
||||||
|
m_proxyPool[_loc6_] = _loc5_;
|
||||||
|
_loc5_.SetNext(_loc6_ + 1);
|
||||||
|
_loc5_.timeStamp = 0;
|
||||||
|
_loc5_.overlapCount = 65535;
|
||||||
|
_loc5_.userData = null;
|
||||||
|
_loc6_++;
|
||||||
|
}
|
||||||
|
_loc5_ = new b2Proxy();
|
||||||
|
m_proxyPool[511] = _loc5_;
|
||||||
|
_loc5_.SetNext(b2Pair.b2_nullProxy);
|
||||||
|
_loc5_.timeStamp = 0;
|
||||||
|
_loc5_.overlapCount = 65535;
|
||||||
|
_loc5_.userData = null;
|
||||||
|
m_freeProxy = 0;
|
||||||
|
m_timeStamp = 1;
|
||||||
|
m_queryResultCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function BinarySearch(param1:Array, param2:int, param3:uint) : uint
|
||||||
|
{
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc6_:b2Bound = null;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc4_:int = param2 - 1;
|
||||||
|
while(_loc5_ <= _loc4_)
|
||||||
|
{
|
||||||
|
_loc7_ = (_loc5_ + _loc4_) / 2;
|
||||||
|
_loc6_ = param1[_loc7_];
|
||||||
|
if(_loc6_.value > param3)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc7_ - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(_loc6_.value >= param3)
|
||||||
|
{
|
||||||
|
return uint(_loc7_);
|
||||||
|
}
|
||||||
|
_loc5_ = _loc7_ + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return uint(_loc5_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function InRange(param1:b2AABB) : Boolean
|
||||||
|
{
|
||||||
|
var _loc2_:Number = NaN;
|
||||||
|
var _loc3_:Number = NaN;
|
||||||
|
var _loc5_:Number = NaN;
|
||||||
|
var _loc4_:Number = NaN;
|
||||||
|
_loc2_ = param1.lowerBound.x;
|
||||||
|
_loc3_ = param1.lowerBound.y;
|
||||||
|
_loc2_ -= m_worldAABB.upperBound.x;
|
||||||
|
_loc3_ -= m_worldAABB.upperBound.y;
|
||||||
|
_loc5_ = m_worldAABB.lowerBound.x;
|
||||||
|
_loc4_ = m_worldAABB.lowerBound.y;
|
||||||
|
_loc5_ -= param1.upperBound.x;
|
||||||
|
_loc4_ -= param1.upperBound.y;
|
||||||
|
_loc2_ = b2Math.b2Max(_loc2_,_loc5_);
|
||||||
|
_loc3_ = b2Math.b2Max(_loc3_,_loc4_);
|
||||||
|
return b2Math.b2Max(_loc2_,_loc3_) < 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetProxy(param1:int) : b2Proxy
|
||||||
|
{
|
||||||
|
var _loc2_:b2Proxy = m_proxyPool[param1];
|
||||||
|
if(param1 == b2Pair.b2_nullProxy || _loc2_.IsValid() == false)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function CreateProxy(param1:b2AABB, param2:*) : uint
|
||||||
|
{
|
||||||
|
var _loc5_:* = 0;
|
||||||
|
var _loc13_:b2Proxy = null;
|
||||||
|
var _loc10_:int = 0;
|
||||||
|
var _loc18_:Array = null;
|
||||||
|
var _loc19_:* = 0;
|
||||||
|
var _loc8_:* = 0;
|
||||||
|
var _loc4_:Array = null;
|
||||||
|
var _loc15_:Array = null;
|
||||||
|
var _loc20_:Array = null;
|
||||||
|
var _loc9_:int = 0;
|
||||||
|
var _loc14_:int = 0;
|
||||||
|
var _loc3_:b2Bound = null;
|
||||||
|
var _loc11_:b2Bound = null;
|
||||||
|
var _loc12_:b2Bound = null;
|
||||||
|
var _loc16_:int = 0;
|
||||||
|
var _loc22_:b2Proxy = null;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc23_:uint = m_freeProxy;
|
||||||
|
_loc13_ = m_proxyPool[_loc23_];
|
||||||
|
m_freeProxy = _loc13_.GetNext();
|
||||||
|
_loc13_.overlapCount = 0;
|
||||||
|
_loc13_.userData = param2;
|
||||||
|
var _loc17_:uint = 2 * m_proxyCount;
|
||||||
|
var _loc6_:Array = [];
|
||||||
|
var _loc21_:Array = [];
|
||||||
|
ComputeBounds(_loc6_,_loc21_,param1);
|
||||||
|
_loc10_ = 0;
|
||||||
|
while(_loc10_ < 2)
|
||||||
|
{
|
||||||
|
_loc18_ = m_bounds[_loc10_];
|
||||||
|
_loc4_ = [_loc19_];
|
||||||
|
_loc15_ = [_loc8_];
|
||||||
|
Query(_loc4_,_loc15_,_loc6_[_loc10_],_loc21_[_loc10_],_loc18_,_loc17_,_loc10_);
|
||||||
|
_loc19_ = uint(_loc4_[0]);
|
||||||
|
_loc8_ = uint(_loc15_[0]);
|
||||||
|
_loc20_ = [];
|
||||||
|
_loc14_ = _loc17_ - _loc8_;
|
||||||
|
_loc9_ = 0;
|
||||||
|
while(_loc9_ < _loc14_)
|
||||||
|
{
|
||||||
|
_loc20_[_loc9_] = new b2Bound();
|
||||||
|
_loc3_ = _loc20_[_loc9_];
|
||||||
|
_loc11_ = _loc18_[int(_loc8_ + _loc9_)];
|
||||||
|
_loc3_.value = _loc11_.value;
|
||||||
|
_loc3_.proxyId = _loc11_.proxyId;
|
||||||
|
_loc3_.stabbingCount = _loc11_.stabbingCount;
|
||||||
|
_loc9_++;
|
||||||
|
}
|
||||||
|
_loc14_ = int(_loc20_.length);
|
||||||
|
_loc16_ = _loc8_ + 2;
|
||||||
|
_loc9_ = 0;
|
||||||
|
while(_loc9_ < _loc14_)
|
||||||
|
{
|
||||||
|
_loc11_ = _loc20_[_loc9_];
|
||||||
|
_loc3_ = _loc18_[int(_loc16_ + _loc9_)];
|
||||||
|
_loc3_.value = _loc11_.value;
|
||||||
|
_loc3_.proxyId = _loc11_.proxyId;
|
||||||
|
_loc3_.stabbingCount = _loc11_.stabbingCount;
|
||||||
|
_loc9_++;
|
||||||
|
}
|
||||||
|
_loc20_ = [];
|
||||||
|
_loc14_ = _loc8_ - _loc19_;
|
||||||
|
_loc9_ = 0;
|
||||||
|
while(_loc9_ < _loc14_)
|
||||||
|
{
|
||||||
|
_loc20_[_loc9_] = new b2Bound();
|
||||||
|
_loc3_ = _loc20_[_loc9_];
|
||||||
|
_loc11_ = _loc18_[int(_loc19_ + _loc9_)];
|
||||||
|
_loc3_.value = _loc11_.value;
|
||||||
|
_loc3_.proxyId = _loc11_.proxyId;
|
||||||
|
_loc3_.stabbingCount = _loc11_.stabbingCount;
|
||||||
|
_loc9_++;
|
||||||
|
}
|
||||||
|
_loc14_ = int(_loc20_.length);
|
||||||
|
_loc16_ = _loc19_ + 1;
|
||||||
|
_loc9_ = 0;
|
||||||
|
while(_loc9_ < _loc14_)
|
||||||
|
{
|
||||||
|
_loc11_ = _loc20_[_loc9_];
|
||||||
|
_loc3_ = _loc18_[int(_loc16_ + _loc9_)];
|
||||||
|
_loc3_.value = _loc11_.value;
|
||||||
|
_loc3_.proxyId = _loc11_.proxyId;
|
||||||
|
_loc3_.stabbingCount = _loc11_.stabbingCount;
|
||||||
|
_loc9_++;
|
||||||
|
}
|
||||||
|
_loc8_++;
|
||||||
|
_loc3_ = _loc18_[_loc19_];
|
||||||
|
_loc11_ = _loc18_[_loc8_];
|
||||||
|
_loc3_.value = _loc6_[_loc10_];
|
||||||
|
_loc3_.proxyId = _loc23_;
|
||||||
|
_loc11_.value = _loc21_[_loc10_];
|
||||||
|
_loc11_.proxyId = _loc23_;
|
||||||
|
_loc12_ = _loc18_[int(_loc19_ - 1)];
|
||||||
|
_loc3_.stabbingCount = _loc19_ == 0 ? 0 : _loc12_.stabbingCount;
|
||||||
|
_loc12_ = _loc18_[int(_loc8_ - 1)];
|
||||||
|
_loc11_.stabbingCount = _loc12_.stabbingCount;
|
||||||
|
_loc5_ = _loc19_;
|
||||||
|
while(_loc5_ < _loc8_)
|
||||||
|
{
|
||||||
|
_loc12_ = _loc18_[_loc5_];
|
||||||
|
_loc12_.stabbingCount++;
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
_loc5_ = _loc19_;
|
||||||
|
while(_loc5_ < _loc17_ + 2)
|
||||||
|
{
|
||||||
|
_loc3_ = _loc18_[_loc5_];
|
||||||
|
_loc22_ = m_proxyPool[_loc3_.proxyId];
|
||||||
|
if(_loc3_.IsLower())
|
||||||
|
{
|
||||||
|
_loc22_.lowerBounds[_loc10_] = _loc5_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc22_.upperBounds[_loc10_] = _loc5_;
|
||||||
|
}
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
_loc10_++;
|
||||||
|
}
|
||||||
|
m_proxyCount = m_proxyCount + 1;
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < m_queryResultCount)
|
||||||
|
{
|
||||||
|
m_pairManager.AddBufferedPair(_loc23_,m_queryResults[_loc7_]);
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
m_pairManager.Commit();
|
||||||
|
m_queryResultCount = 0;
|
||||||
|
IncrementTimeStamp();
|
||||||
|
return _loc23_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function DestroyProxy(param1:uint) : void
|
||||||
|
{
|
||||||
|
var _loc2_:b2Bound = null;
|
||||||
|
var _loc11_:b2Bound = null;
|
||||||
|
var _loc10_:int = 0;
|
||||||
|
var _loc16_:Array = null;
|
||||||
|
var _loc17_:* = 0;
|
||||||
|
var _loc7_:* = 0;
|
||||||
|
var _loc9_:* = 0;
|
||||||
|
var _loc3_:* = 0;
|
||||||
|
var _loc18_:Array = null;
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
var _loc13_:int = 0;
|
||||||
|
var _loc14_:int = 0;
|
||||||
|
var _loc4_:* = 0;
|
||||||
|
var _loc19_:b2Proxy = null;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc6_:int = 0;
|
||||||
|
var _loc12_:b2Proxy = m_proxyPool[param1];
|
||||||
|
var _loc15_:int = 2 * m_proxyCount;
|
||||||
|
_loc10_ = 0;
|
||||||
|
while(_loc10_ < 2)
|
||||||
|
{
|
||||||
|
_loc16_ = m_bounds[_loc10_];
|
||||||
|
_loc17_ = uint(_loc12_.lowerBounds[_loc10_]);
|
||||||
|
_loc7_ = uint(_loc12_.upperBounds[_loc10_]);
|
||||||
|
_loc2_ = _loc16_[_loc17_];
|
||||||
|
_loc9_ = _loc2_.value;
|
||||||
|
_loc11_ = _loc16_[_loc7_];
|
||||||
|
_loc3_ = _loc11_.value;
|
||||||
|
_loc18_ = [];
|
||||||
|
_loc13_ = _loc7_ - _loc17_ - 1;
|
||||||
|
_loc8_ = 0;
|
||||||
|
while(_loc8_ < _loc13_)
|
||||||
|
{
|
||||||
|
_loc18_[_loc8_] = new b2Bound();
|
||||||
|
_loc2_ = _loc18_[_loc8_];
|
||||||
|
_loc11_ = _loc16_[int(_loc17_ + 1 + _loc8_)];
|
||||||
|
_loc2_.value = _loc11_.value;
|
||||||
|
_loc2_.proxyId = _loc11_.proxyId;
|
||||||
|
_loc2_.stabbingCount = _loc11_.stabbingCount;
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
_loc13_ = int(_loc18_.length);
|
||||||
|
_loc14_ = _loc17_;
|
||||||
|
_loc8_ = 0;
|
||||||
|
while(_loc8_ < _loc13_)
|
||||||
|
{
|
||||||
|
_loc11_ = _loc18_[_loc8_];
|
||||||
|
_loc2_ = _loc16_[int(_loc14_ + _loc8_)];
|
||||||
|
_loc2_.value = _loc11_.value;
|
||||||
|
_loc2_.proxyId = _loc11_.proxyId;
|
||||||
|
_loc2_.stabbingCount = _loc11_.stabbingCount;
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
_loc18_ = [];
|
||||||
|
_loc13_ = _loc15_ - _loc7_ - 1;
|
||||||
|
_loc8_ = 0;
|
||||||
|
while(_loc8_ < _loc13_)
|
||||||
|
{
|
||||||
|
_loc18_[_loc8_] = new b2Bound();
|
||||||
|
_loc2_ = _loc18_[_loc8_];
|
||||||
|
_loc11_ = _loc16_[int(_loc7_ + 1 + _loc8_)];
|
||||||
|
_loc2_.value = _loc11_.value;
|
||||||
|
_loc2_.proxyId = _loc11_.proxyId;
|
||||||
|
_loc2_.stabbingCount = _loc11_.stabbingCount;
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
_loc13_ = int(_loc18_.length);
|
||||||
|
_loc14_ = _loc7_ - 1;
|
||||||
|
_loc8_ = 0;
|
||||||
|
while(_loc8_ < _loc13_)
|
||||||
|
{
|
||||||
|
_loc11_ = _loc18_[_loc8_];
|
||||||
|
_loc2_ = _loc16_[int(_loc14_ + _loc8_)];
|
||||||
|
_loc2_.value = _loc11_.value;
|
||||||
|
_loc2_.proxyId = _loc11_.proxyId;
|
||||||
|
_loc2_.stabbingCount = _loc11_.stabbingCount;
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
_loc13_ = _loc15_ - 2;
|
||||||
|
_loc4_ = _loc17_;
|
||||||
|
while(_loc4_ < _loc13_)
|
||||||
|
{
|
||||||
|
_loc2_ = _loc16_[_loc4_];
|
||||||
|
_loc19_ = m_proxyPool[_loc2_.proxyId];
|
||||||
|
if(_loc2_.IsLower())
|
||||||
|
{
|
||||||
|
_loc19_.lowerBounds[_loc10_] = _loc4_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc19_.upperBounds[_loc10_] = _loc4_;
|
||||||
|
}
|
||||||
|
_loc4_++;
|
||||||
|
}
|
||||||
|
_loc13_ = _loc7_ - 1;
|
||||||
|
_loc5_ = _loc17_;
|
||||||
|
while(_loc5_ < _loc13_)
|
||||||
|
{
|
||||||
|
_loc2_ = _loc16_[_loc5_];
|
||||||
|
_loc2_.stabbingCount--;
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
Query([0],[0],_loc9_,_loc3_,_loc16_,_loc15_ - 2,_loc10_);
|
||||||
|
_loc10_++;
|
||||||
|
}
|
||||||
|
_loc6_ = 0;
|
||||||
|
while(_loc6_ < m_queryResultCount)
|
||||||
|
{
|
||||||
|
m_pairManager.RemoveBufferedPair(param1,m_queryResults[_loc6_]);
|
||||||
|
_loc6_++;
|
||||||
|
}
|
||||||
|
m_pairManager.Commit();
|
||||||
|
m_queryResultCount = 0;
|
||||||
|
IncrementTimeStamp();
|
||||||
|
_loc12_.userData = null;
|
||||||
|
_loc12_.overlapCount = 65535;
|
||||||
|
_loc12_.lowerBounds[0] = 65535;
|
||||||
|
_loc12_.lowerBounds[1] = 65535;
|
||||||
|
_loc12_.upperBounds[0] = 65535;
|
||||||
|
_loc12_.upperBounds[1] = 65535;
|
||||||
|
_loc12_.SetNext(m_freeProxy);
|
||||||
|
m_freeProxy = param1;
|
||||||
|
m_proxyCount = m_proxyCount - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function MoveProxy(param1:uint, param2:b2AABB) : void
|
||||||
|
{
|
||||||
|
var _loc16_:Array = null;
|
||||||
|
var _loc23_:int = 0;
|
||||||
|
var _loc12_:* = 0;
|
||||||
|
var _loc8_:* = 0;
|
||||||
|
var _loc7_:b2Bound = null;
|
||||||
|
var _loc17_:b2Bound = null;
|
||||||
|
var _loc21_:b2Bound = null;
|
||||||
|
var _loc22_:* = 0;
|
||||||
|
var _loc4_:b2Proxy = null;
|
||||||
|
var _loc19_:Array = null;
|
||||||
|
var _loc20_:* = 0;
|
||||||
|
var _loc9_:* = 0;
|
||||||
|
var _loc11_:* = 0;
|
||||||
|
var _loc6_:* = 0;
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc3_:int = 0;
|
||||||
|
var _loc10_:* = 0;
|
||||||
|
var _loc24_:b2Proxy = null;
|
||||||
|
if(param1 == b2Pair.b2_nullProxy || 512 <= param1)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(param2.IsValid() == false)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var _loc18_:uint = 2 * m_proxyCount;
|
||||||
|
var _loc15_:b2Proxy = m_proxyPool[param1];
|
||||||
|
var _loc13_:b2BoundValues = new b2BoundValues();
|
||||||
|
ComputeBounds(_loc13_.lowerValues,_loc13_.upperValues,param2);
|
||||||
|
var _loc14_:b2BoundValues = new b2BoundValues();
|
||||||
|
_loc12_ = 0;
|
||||||
|
while(_loc12_ < 2)
|
||||||
|
{
|
||||||
|
_loc7_ = m_bounds[_loc12_][_loc15_.lowerBounds[_loc12_]];
|
||||||
|
_loc14_.lowerValues[_loc12_] = _loc7_.value;
|
||||||
|
_loc7_ = m_bounds[_loc12_][_loc15_.upperBounds[_loc12_]];
|
||||||
|
_loc14_.upperValues[_loc12_] = _loc7_.value;
|
||||||
|
_loc12_++;
|
||||||
|
}
|
||||||
|
_loc12_ = 0;
|
||||||
|
while(_loc12_ < 2)
|
||||||
|
{
|
||||||
|
_loc19_ = m_bounds[_loc12_];
|
||||||
|
_loc20_ = uint(_loc15_.lowerBounds[_loc12_]);
|
||||||
|
_loc9_ = uint(_loc15_.upperBounds[_loc12_]);
|
||||||
|
_loc11_ = uint(_loc13_.lowerValues[_loc12_]);
|
||||||
|
_loc6_ = uint(_loc13_.upperValues[_loc12_]);
|
||||||
|
_loc7_ = _loc19_[_loc20_];
|
||||||
|
_loc5_ = _loc11_ - _loc7_.value;
|
||||||
|
_loc7_.value = _loc11_;
|
||||||
|
_loc7_ = _loc19_[_loc9_];
|
||||||
|
_loc3_ = _loc6_ - _loc7_.value;
|
||||||
|
_loc7_.value = _loc6_;
|
||||||
|
if(_loc5_ < 0)
|
||||||
|
{
|
||||||
|
_loc8_ = _loc20_;
|
||||||
|
while(_loc8_ > 0 && _loc11_ < (_loc19_[int(_loc8_ - 1)] as b2Bound).value)
|
||||||
|
{
|
||||||
|
_loc7_ = _loc19_[_loc8_];
|
||||||
|
_loc17_ = _loc19_[int(_loc8_ - 1)];
|
||||||
|
_loc10_ = _loc17_.proxyId;
|
||||||
|
_loc24_ = m_proxyPool[_loc17_.proxyId];
|
||||||
|
_loc17_.stabbingCount++;
|
||||||
|
if(_loc17_.IsUpper() == true)
|
||||||
|
{
|
||||||
|
if(TestOverlap(_loc13_,_loc24_))
|
||||||
|
{
|
||||||
|
m_pairManager.AddBufferedPair(param1,_loc10_);
|
||||||
|
}
|
||||||
|
_loc16_ = _loc24_.upperBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_++;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.stabbingCount++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc16_ = _loc24_.lowerBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_++;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.stabbingCount--;
|
||||||
|
}
|
||||||
|
_loc16_ = _loc15_.lowerBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_--;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.Swap(_loc17_);
|
||||||
|
_loc8_--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc3_ > 0)
|
||||||
|
{
|
||||||
|
_loc8_ = _loc9_;
|
||||||
|
while(_loc8_ < _loc18_ - 1 && (_loc19_[int(_loc8_ + 1)] as b2Bound).value <= _loc6_)
|
||||||
|
{
|
||||||
|
_loc7_ = _loc19_[_loc8_];
|
||||||
|
_loc21_ = _loc19_[int(_loc8_ + 1)];
|
||||||
|
_loc22_ = _loc21_.proxyId;
|
||||||
|
_loc4_ = m_proxyPool[_loc22_];
|
||||||
|
_loc21_.stabbingCount++;
|
||||||
|
if(_loc21_.IsLower() == true)
|
||||||
|
{
|
||||||
|
if(TestOverlap(_loc13_,_loc4_))
|
||||||
|
{
|
||||||
|
m_pairManager.AddBufferedPair(param1,_loc22_);
|
||||||
|
}
|
||||||
|
_loc16_ = _loc4_.lowerBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_--;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.stabbingCount++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc16_ = _loc4_.upperBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_--;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.stabbingCount--;
|
||||||
|
}
|
||||||
|
_loc16_ = _loc15_.upperBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_++;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.Swap(_loc21_);
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc5_ > 0)
|
||||||
|
{
|
||||||
|
_loc8_ = _loc20_;
|
||||||
|
while(_loc8_ < _loc18_ - 1 && (_loc19_[int(_loc8_ + 1)] as b2Bound).value <= _loc11_)
|
||||||
|
{
|
||||||
|
_loc7_ = _loc19_[_loc8_];
|
||||||
|
_loc21_ = _loc19_[int(_loc8_ + 1)];
|
||||||
|
_loc22_ = _loc21_.proxyId;
|
||||||
|
_loc4_ = m_proxyPool[_loc22_];
|
||||||
|
_loc21_.stabbingCount--;
|
||||||
|
if(_loc21_.IsUpper())
|
||||||
|
{
|
||||||
|
if(TestOverlap(_loc14_,_loc4_))
|
||||||
|
{
|
||||||
|
m_pairManager.RemoveBufferedPair(param1,_loc22_);
|
||||||
|
}
|
||||||
|
_loc16_ = _loc4_.upperBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_--;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.stabbingCount--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc16_ = _loc4_.lowerBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_--;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.stabbingCount++;
|
||||||
|
}
|
||||||
|
_loc16_ = _loc15_.lowerBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_++;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.Swap(_loc21_);
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc3_ < 0)
|
||||||
|
{
|
||||||
|
_loc8_ = _loc9_;
|
||||||
|
while(_loc8_ > 0 && _loc6_ < (_loc19_[int(_loc8_ - 1)] as b2Bound).value)
|
||||||
|
{
|
||||||
|
_loc7_ = _loc19_[_loc8_];
|
||||||
|
_loc17_ = _loc19_[int(_loc8_ - 1)];
|
||||||
|
_loc10_ = _loc17_.proxyId;
|
||||||
|
_loc24_ = m_proxyPool[_loc10_];
|
||||||
|
_loc17_.stabbingCount--;
|
||||||
|
if(_loc17_.IsLower() == true)
|
||||||
|
{
|
||||||
|
if(TestOverlap(_loc14_,_loc24_))
|
||||||
|
{
|
||||||
|
m_pairManager.RemoveBufferedPair(param1,_loc10_);
|
||||||
|
}
|
||||||
|
_loc16_ = _loc24_.lowerBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_++;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.stabbingCount--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc16_ = _loc24_.upperBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_++;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.stabbingCount++;
|
||||||
|
}
|
||||||
|
_loc16_ = _loc15_.upperBounds;
|
||||||
|
_loc23_ = int(_loc16_[_loc12_]);
|
||||||
|
_loc23_--;
|
||||||
|
_loc16_[_loc12_] = _loc23_;
|
||||||
|
_loc7_.Swap(_loc17_);
|
||||||
|
_loc8_--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc12_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Commit() : void
|
||||||
|
{
|
||||||
|
m_pairManager.Commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function QueryAABB(param1:b2AABB, param2:*, param3:int) : int
|
||||||
|
{
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc11_:int = 0;
|
||||||
|
var _loc10_:int = 0;
|
||||||
|
var _loc4_:b2Proxy = null;
|
||||||
|
var _loc9_:Array = [];
|
||||||
|
var _loc12_:Array = [];
|
||||||
|
ComputeBounds(_loc9_,_loc12_,param1);
|
||||||
|
var _loc5_:Array = [_loc7_];
|
||||||
|
var _loc6_:Array = [_loc11_];
|
||||||
|
Query(_loc5_,_loc6_,_loc9_[0],_loc12_[0],m_bounds[0],2 * m_proxyCount,0);
|
||||||
|
Query(_loc5_,_loc6_,_loc9_[1],_loc12_[1],m_bounds[1],2 * m_proxyCount,1);
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
_loc10_ = 0;
|
||||||
|
while(_loc10_ < m_queryResultCount && _loc8_ < param3)
|
||||||
|
{
|
||||||
|
_loc4_ = m_proxyPool[m_queryResults[_loc10_]];
|
||||||
|
param2[_loc10_] = _loc4_.userData;
|
||||||
|
_loc10_++;
|
||||||
|
++_loc8_;
|
||||||
|
}
|
||||||
|
m_queryResultCount = 0;
|
||||||
|
IncrementTimeStamp();
|
||||||
|
return _loc8_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Validate() : void
|
||||||
|
{
|
||||||
|
var _loc9_:* = null;
|
||||||
|
var _loc6_:* = null;
|
||||||
|
var _loc8_:* = null;
|
||||||
|
var _loc1_:Boolean = false;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc3_:b2Bound = null;
|
||||||
|
var _loc4_:* = 0;
|
||||||
|
var _loc10_:* = 0;
|
||||||
|
var _loc5_:* = 0;
|
||||||
|
var _loc2_:b2Bound = null;
|
||||||
|
_loc7_ = 0;
|
||||||
|
while(_loc7_ < 2)
|
||||||
|
{
|
||||||
|
_loc3_ = m_bounds[_loc7_];
|
||||||
|
_loc4_ = uint(2 * m_proxyCount);
|
||||||
|
_loc10_ = 0;
|
||||||
|
_loc5_ = 0;
|
||||||
|
while(_loc5_ < _loc4_)
|
||||||
|
{
|
||||||
|
_loc2_ = _loc3_[_loc5_];
|
||||||
|
if(_loc2_.IsLower() == true)
|
||||||
|
{
|
||||||
|
_loc10_++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc10_--;
|
||||||
|
}
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function ComputeBounds(param1:Array, param2:Array, param3:b2AABB) : void
|
||||||
|
{
|
||||||
|
var _loc4_:Number = param3.lowerBound.x;
|
||||||
|
var _loc5_:Number = param3.lowerBound.y;
|
||||||
|
_loc4_ = b2Math.b2Min(_loc4_,m_worldAABB.upperBound.x);
|
||||||
|
_loc5_ = b2Math.b2Min(_loc5_,m_worldAABB.upperBound.y);
|
||||||
|
_loc4_ = b2Math.b2Max(_loc4_,m_worldAABB.lowerBound.x);
|
||||||
|
_loc5_ = b2Math.b2Max(_loc5_,m_worldAABB.lowerBound.y);
|
||||||
|
var _loc6_:Number = param3.upperBound.x;
|
||||||
|
var _loc7_:Number = param3.upperBound.y;
|
||||||
|
_loc6_ = b2Math.b2Min(_loc6_,m_worldAABB.upperBound.x);
|
||||||
|
_loc7_ = b2Math.b2Min(_loc7_,m_worldAABB.upperBound.y);
|
||||||
|
_loc6_ = b2Math.b2Max(_loc6_,m_worldAABB.lowerBound.x);
|
||||||
|
_loc7_ = b2Math.b2Max(_loc7_,m_worldAABB.lowerBound.y);
|
||||||
|
param1[0] = uint(m_quantizationFactor.x * (_loc4_ - m_worldAABB.lowerBound.x)) & 65535 - 1;
|
||||||
|
param2[0] = uint(m_quantizationFactor.x * (_loc6_ - m_worldAABB.lowerBound.x)) & 0xFFFF | 1;
|
||||||
|
param1[1] = uint(m_quantizationFactor.y * (_loc5_ - m_worldAABB.lowerBound.y)) & 65535 - 1;
|
||||||
|
param2[1] = uint(m_quantizationFactor.y * (_loc7_ - m_worldAABB.lowerBound.y)) & 0xFFFF | 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function TestOverlapValidate(param1:b2Proxy, param2:b2Proxy) : Boolean
|
||||||
|
{
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc3_:Array = null;
|
||||||
|
var _loc6_:b2Bound = null;
|
||||||
|
var _loc4_:b2Bound = null;
|
||||||
|
_loc5_ = 0;
|
||||||
|
while(_loc5_ < 2)
|
||||||
|
{
|
||||||
|
_loc3_ = m_bounds[_loc5_];
|
||||||
|
_loc6_ = _loc3_[param1.lowerBounds[_loc5_]];
|
||||||
|
_loc4_ = _loc3_[param2.upperBounds[_loc5_]];
|
||||||
|
if(_loc6_.value > _loc4_.value)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_loc6_ = _loc3_[param1.upperBounds[_loc5_]];
|
||||||
|
_loc4_ = _loc3_[param2.lowerBounds[_loc5_]];
|
||||||
|
if(_loc6_.value < _loc4_.value)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function TestOverlap(param1:b2BoundValues, param2:b2Proxy) : Boolean
|
||||||
|
{
|
||||||
|
var _loc5_:int = 0;
|
||||||
|
var _loc4_:Array = null;
|
||||||
|
var _loc3_:b2Bound = null;
|
||||||
|
_loc5_ = 0;
|
||||||
|
while(_loc5_ < 2)
|
||||||
|
{
|
||||||
|
_loc4_ = m_bounds[_loc5_];
|
||||||
|
_loc3_ = _loc4_[param2.upperBounds[_loc5_]];
|
||||||
|
if(param1.lowerValues[_loc5_] > _loc3_.value)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_loc3_ = _loc4_[param2.lowerBounds[_loc5_]];
|
||||||
|
if(param1.upperValues[_loc5_] < _loc3_.value)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_loc5_++;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function Query(param1:Array, param2:Array, param3:uint, param4:uint, param5:Array, param6:uint, param7:int) : void
|
||||||
|
{
|
||||||
|
var _loc8_:b2Bound = null;
|
||||||
|
var _loc11_:* = 0;
|
||||||
|
var _loc10_:int = 0;
|
||||||
|
var _loc13_:int = 0;
|
||||||
|
var _loc12_:b2Proxy = null;
|
||||||
|
var _loc14_:uint = BinarySearch(param5,param6,param3);
|
||||||
|
var _loc9_:uint = BinarySearch(param5,param6,param4);
|
||||||
|
_loc11_ = _loc14_;
|
||||||
|
while(_loc11_ < _loc9_)
|
||||||
|
{
|
||||||
|
_loc8_ = param5[_loc11_];
|
||||||
|
if(_loc8_.IsLower())
|
||||||
|
{
|
||||||
|
IncrementOverlapCount(_loc8_.proxyId);
|
||||||
|
}
|
||||||
|
_loc11_++;
|
||||||
|
}
|
||||||
|
if(_loc14_ > 0)
|
||||||
|
{
|
||||||
|
_loc10_ = _loc14_ - 1;
|
||||||
|
_loc8_ = param5[_loc10_];
|
||||||
|
_loc13_ = int(_loc8_.stabbingCount);
|
||||||
|
while(_loc13_)
|
||||||
|
{
|
||||||
|
_loc8_ = param5[_loc10_];
|
||||||
|
if(_loc8_.IsLower())
|
||||||
|
{
|
||||||
|
_loc12_ = m_proxyPool[_loc8_.proxyId];
|
||||||
|
if(_loc14_ <= _loc12_.upperBounds[param7])
|
||||||
|
{
|
||||||
|
IncrementOverlapCount(_loc8_.proxyId);
|
||||||
|
_loc13_--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_loc10_--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
param1[0] = _loc14_;
|
||||||
|
param2[0] = _loc9_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function IncrementOverlapCount(param1:uint) : void
|
||||||
|
{
|
||||||
|
var _loc2_:b2Proxy = m_proxyPool[param1];
|
||||||
|
if(_loc2_.timeStamp < m_timeStamp)
|
||||||
|
{
|
||||||
|
_loc2_.timeStamp = m_timeStamp;
|
||||||
|
_loc2_.overlapCount = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc2_.overlapCount = 2;
|
||||||
|
m_queryResults[m_queryResultCount] = param1;
|
||||||
|
m_queryResultCount = m_queryResultCount + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function IncrementTimeStamp() : void
|
||||||
|
{
|
||||||
|
var _loc1_:* = 0;
|
||||||
|
if(m_timeStamp == 65535)
|
||||||
|
{
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < 512)
|
||||||
|
{
|
||||||
|
(m_proxyPool[_loc1_] as b2Proxy).timeStamp = 0;
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
m_timeStamp = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_timeStamp = m_timeStamp + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
public class b2BufferedPair
|
||||||
|
{
|
||||||
|
|
||||||
|
public var proxyId1:uint;
|
||||||
|
|
||||||
|
public var proxyId2:uint;
|
||||||
|
|
||||||
|
public function b2BufferedPair()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,590 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Collision.Shapes.*;
|
||||||
|
import Box2D.Common.*;
|
||||||
|
import Box2D.Common.Math.*;
|
||||||
|
|
||||||
|
public class b2Collision
|
||||||
|
{
|
||||||
|
|
||||||
|
public static const b2_nullFeature:uint = 255;
|
||||||
|
|
||||||
|
private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public function b2Collision()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function ClipSegmentToLine(param1:Array, param2:Array, param3:b2Vec2, param4:Number) : int
|
||||||
|
{
|
||||||
|
var _loc11_:ClipVertex = null;
|
||||||
|
var _loc9_:Number = NaN;
|
||||||
|
var _loc12_:b2Vec2 = null;
|
||||||
|
var _loc13_:ClipVertex = null;
|
||||||
|
var _loc10_:int = 0;
|
||||||
|
_loc11_ = param2[0];
|
||||||
|
var _loc6_:b2Vec2 = _loc11_.v;
|
||||||
|
_loc11_ = param2[1];
|
||||||
|
var _loc5_:b2Vec2 = _loc11_.v;
|
||||||
|
var _loc8_:Number = b2Math.b2Dot(param3,_loc6_) - param4;
|
||||||
|
var _loc7_:Number = b2Math.b2Dot(param3,_loc5_) - param4;
|
||||||
|
if(_loc8_ <= 0)
|
||||||
|
{
|
||||||
|
param1[_loc10_++] = param2[0];
|
||||||
|
}
|
||||||
|
if(_loc7_ <= 0)
|
||||||
|
{
|
||||||
|
param1[_loc10_++] = param2[1];
|
||||||
|
}
|
||||||
|
if(_loc8_ * _loc7_ < 0)
|
||||||
|
{
|
||||||
|
_loc9_ = _loc8_ / (_loc8_ - _loc7_);
|
||||||
|
_loc11_ = param1[_loc10_];
|
||||||
|
_loc12_ = _loc11_.v;
|
||||||
|
_loc12_.x = _loc6_.x + _loc9_ * (_loc5_.x - _loc6_.x);
|
||||||
|
_loc12_.y = _loc6_.y + _loc9_ * (_loc5_.y - _loc6_.y);
|
||||||
|
_loc11_ = param1[_loc10_];
|
||||||
|
if(_loc8_ > 0)
|
||||||
|
{
|
||||||
|
_loc13_ = param2[0];
|
||||||
|
_loc11_.id = _loc13_.id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc13_ = param2[1];
|
||||||
|
_loc11_.id = _loc13_.id;
|
||||||
|
}
|
||||||
|
_loc10_++;
|
||||||
|
}
|
||||||
|
return _loc10_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function EdgeSeparation(param1:b2PolygonShape, param2:b2XForm, param3:int, param4:b2PolygonShape, param5:b2XForm) : Number
|
||||||
|
{
|
||||||
|
var _loc23_:b2Mat22 = null;
|
||||||
|
var _loc22_:b2Vec2 = null;
|
||||||
|
var _loc20_:int = 0;
|
||||||
|
var _loc9_:Number = NaN;
|
||||||
|
var _loc6_:int = param1.m_vertexCount;
|
||||||
|
var _loc8_:Array = param1.m_vertices;
|
||||||
|
var _loc11_:Array = param1.m_normals;
|
||||||
|
var _loc7_:int = param4.m_vertexCount;
|
||||||
|
var _loc10_:Array = param4.m_vertices;
|
||||||
|
_loc23_ = param2.R;
|
||||||
|
_loc22_ = _loc11_[param3];
|
||||||
|
var _loc17_:Number = _loc23_.col1.x * _loc22_.x + _loc23_.col2.x * _loc22_.y;
|
||||||
|
var _loc15_:Number = _loc23_.col1.y * _loc22_.x + _loc23_.col2.y * _loc22_.y;
|
||||||
|
_loc23_ = param5.R;
|
||||||
|
var _loc18_:Number = _loc23_.col1.x * _loc17_ + _loc23_.col1.y * _loc15_;
|
||||||
|
var _loc16_:Number = _loc23_.col2.x * _loc17_ + _loc23_.col2.y * _loc15_;
|
||||||
|
var _loc19_:int = 0;
|
||||||
|
var _loc21_:Number = 1.7976931348623157e+308;
|
||||||
|
_loc20_ = 0;
|
||||||
|
while(_loc20_ < _loc7_)
|
||||||
|
{
|
||||||
|
_loc22_ = _loc10_[_loc20_];
|
||||||
|
_loc9_ = _loc22_.x * _loc18_ + _loc22_.y * _loc16_;
|
||||||
|
if(_loc9_ < _loc21_)
|
||||||
|
{
|
||||||
|
_loc21_ = _loc9_;
|
||||||
|
_loc19_ = _loc20_;
|
||||||
|
}
|
||||||
|
_loc20_++;
|
||||||
|
}
|
||||||
|
_loc22_ = _loc8_[param3];
|
||||||
|
_loc23_ = param2.R;
|
||||||
|
var _loc24_:Number = param2.position.x + (_loc23_.col1.x * _loc22_.x + _loc23_.col2.x * _loc22_.y);
|
||||||
|
var _loc25_:Number = param2.position.y + (_loc23_.col1.y * _loc22_.x + _loc23_.col2.y * _loc22_.y);
|
||||||
|
_loc22_ = _loc10_[_loc19_];
|
||||||
|
_loc23_ = param5.R;
|
||||||
|
var _loc14_:Number = param5.position.x + (_loc23_.col1.x * _loc22_.x + _loc23_.col2.x * _loc22_.y);
|
||||||
|
var _loc13_:Number = param5.position.y + (_loc23_.col1.y * _loc22_.x + _loc23_.col2.y * _loc22_.y);
|
||||||
|
_loc14_ -= _loc24_;
|
||||||
|
_loc13_ -= _loc25_;
|
||||||
|
return _loc14_ * _loc17_ + _loc13_ * _loc15_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function FindMaxSeparation(param1:Array, param2:b2PolygonShape, param3:b2XForm, param4:b2PolygonShape, param5:b2XForm) : Number
|
||||||
|
{
|
||||||
|
var _loc20_:b2Vec2 = null;
|
||||||
|
var _loc23_:b2Mat22 = null;
|
||||||
|
var _loc16_:int = 0;
|
||||||
|
var _loc7_:Number = NaN;
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
var _loc15_:Number = NaN;
|
||||||
|
var _loc9_:int = 0;
|
||||||
|
var _loc6_:int = param2.m_vertexCount;
|
||||||
|
var _loc11_:Array = param2.m_normals;
|
||||||
|
_loc23_ = param5.R;
|
||||||
|
_loc20_ = param4.m_centroid;
|
||||||
|
var _loc18_:Number = param5.position.x + (_loc23_.col1.x * _loc20_.x + _loc23_.col2.x * _loc20_.y);
|
||||||
|
var _loc19_:Number = param5.position.y + (_loc23_.col1.y * _loc20_.x + _loc23_.col2.y * _loc20_.y);
|
||||||
|
_loc23_ = param3.R;
|
||||||
|
_loc20_ = param2.m_centroid;
|
||||||
|
_loc18_ -= param3.position.x + (_loc23_.col1.x * _loc20_.x + _loc23_.col2.x * _loc20_.y);
|
||||||
|
_loc19_ -= param3.position.y + (_loc23_.col1.y * _loc20_.x + _loc23_.col2.y * _loc20_.y);
|
||||||
|
var _loc22_:Number = _loc18_ * param3.R.col1.x + _loc19_ * param3.R.col1.y;
|
||||||
|
var _loc21_:Number = _loc18_ * param3.R.col2.x + _loc19_ * param3.R.col2.y;
|
||||||
|
var _loc13_:int = 0;
|
||||||
|
var _loc10_:Number = -1.7976931348623157e+308;
|
||||||
|
_loc16_ = 0;
|
||||||
|
while(_loc16_ < _loc6_)
|
||||||
|
{
|
||||||
|
_loc20_ = _loc11_[_loc16_];
|
||||||
|
_loc7_ = _loc20_.x * _loc22_ + _loc20_.y * _loc21_;
|
||||||
|
if(_loc7_ > _loc10_)
|
||||||
|
{
|
||||||
|
_loc10_ = _loc7_;
|
||||||
|
_loc13_ = _loc16_;
|
||||||
|
}
|
||||||
|
_loc16_++;
|
||||||
|
}
|
||||||
|
var _loc17_:Number = EdgeSeparation(param2,param3,_loc13_,param4,param5);
|
||||||
|
if(_loc17_ > 0)
|
||||||
|
{
|
||||||
|
return _loc17_;
|
||||||
|
}
|
||||||
|
var _loc14_:int = _loc13_ - 1 >= 0 ? _loc13_ - 1 : _loc6_ - 1;
|
||||||
|
var _loc24_:Number = EdgeSeparation(param2,param3,_loc14_,param4,param5);
|
||||||
|
if(_loc24_ > 0)
|
||||||
|
{
|
||||||
|
return _loc24_;
|
||||||
|
}
|
||||||
|
var _loc12_:int = _loc13_ + 1 < _loc6_ ? _loc13_ + 1 : 0;
|
||||||
|
var _loc25_:Number = EdgeSeparation(param2,param3,_loc12_,param4,param5);
|
||||||
|
if(_loc25_ > 0)
|
||||||
|
{
|
||||||
|
return _loc25_;
|
||||||
|
}
|
||||||
|
if(_loc24_ > _loc17_ && _loc24_ > _loc25_)
|
||||||
|
{
|
||||||
|
_loc9_ = -1;
|
||||||
|
_loc8_ = _loc14_;
|
||||||
|
_loc15_ = _loc24_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(_loc25_ <= _loc17_)
|
||||||
|
{
|
||||||
|
param1[0] = _loc13_;
|
||||||
|
return _loc17_;
|
||||||
|
}
|
||||||
|
_loc9_ = 1;
|
||||||
|
_loc8_ = _loc12_;
|
||||||
|
_loc15_ = _loc25_;
|
||||||
|
}
|
||||||
|
while(true)
|
||||||
|
{
|
||||||
|
if(_loc9_ == -1)
|
||||||
|
{
|
||||||
|
_loc13_ = _loc8_ - 1 >= 0 ? _loc8_ - 1 : _loc6_ - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc13_ = _loc8_ + 1 < _loc6_ ? _loc8_ + 1 : 0;
|
||||||
|
}
|
||||||
|
_loc17_ = EdgeSeparation(param2,param3,_loc13_,param4,param5);
|
||||||
|
if(_loc17_ > 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(_loc17_ <= _loc15_)
|
||||||
|
{
|
||||||
|
param1[0] = _loc8_;
|
||||||
|
return _loc15_;
|
||||||
|
}
|
||||||
|
_loc8_ = _loc13_;
|
||||||
|
_loc15_ = _loc17_;
|
||||||
|
}
|
||||||
|
return _loc17_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function FindIncidentEdge(param1:Array, param2:b2PolygonShape, param3:b2XForm, param4:int, param5:b2PolygonShape, param6:b2XForm) : void
|
||||||
|
{
|
||||||
|
var _loc23_:b2Mat22 = null;
|
||||||
|
var _loc22_:b2Vec2 = null;
|
||||||
|
var _loc17_:int = 0;
|
||||||
|
var _loc13_:Number = NaN;
|
||||||
|
var _loc12_:ClipVertex = null;
|
||||||
|
var _loc7_:int = param2.m_vertexCount;
|
||||||
|
var _loc21_:Array = param2.m_normals;
|
||||||
|
var _loc8_:int = param5.m_vertexCount;
|
||||||
|
var _loc15_:Array = param5.m_vertices;
|
||||||
|
var _loc19_:Array = param5.m_normals;
|
||||||
|
_loc23_ = param3.R;
|
||||||
|
_loc22_ = _loc21_[param4];
|
||||||
|
var _loc11_:Number = _loc23_.col1.x * _loc22_.x + _loc23_.col2.x * _loc22_.y;
|
||||||
|
var _loc9_:Number = _loc23_.col1.y * _loc22_.x + _loc23_.col2.y * _loc22_.y;
|
||||||
|
_loc23_ = param6.R;
|
||||||
|
var _loc10_:Number = _loc23_.col1.x * _loc11_ + _loc23_.col1.y * _loc9_;
|
||||||
|
_loc9_ = _loc23_.col2.x * _loc11_ + _loc23_.col2.y * _loc9_;
|
||||||
|
_loc11_ = _loc10_;
|
||||||
|
var _loc16_:int = 0;
|
||||||
|
var _loc20_:Number = 1.7976931348623157e+308;
|
||||||
|
_loc17_ = 0;
|
||||||
|
while(_loc17_ < _loc8_)
|
||||||
|
{
|
||||||
|
_loc22_ = _loc19_[_loc17_];
|
||||||
|
_loc13_ = _loc11_ * _loc22_.x + _loc9_ * _loc22_.y;
|
||||||
|
if(_loc13_ < _loc20_)
|
||||||
|
{
|
||||||
|
_loc20_ = _loc13_;
|
||||||
|
_loc16_ = _loc17_;
|
||||||
|
}
|
||||||
|
_loc17_++;
|
||||||
|
}
|
||||||
|
var _loc14_:int = _loc16_;
|
||||||
|
var _loc18_:int = _loc14_ + 1 < _loc8_ ? _loc14_ + 1 : 0;
|
||||||
|
_loc12_ = param1[0];
|
||||||
|
_loc22_ = _loc15_[_loc14_];
|
||||||
|
_loc23_ = param6.R;
|
||||||
|
_loc12_.v.x = param6.position.x + (_loc23_.col1.x * _loc22_.x + _loc23_.col2.x * _loc22_.y);
|
||||||
|
_loc12_.v.y = param6.position.y + (_loc23_.col1.y * _loc22_.x + _loc23_.col2.y * _loc22_.y);
|
||||||
|
_loc12_.id.features.referenceEdge = param4;
|
||||||
|
_loc12_.id.features.incidentEdge = _loc14_;
|
||||||
|
_loc12_.id.features.incidentVertex = 0;
|
||||||
|
_loc12_ = param1[1];
|
||||||
|
_loc22_ = _loc15_[_loc18_];
|
||||||
|
_loc23_ = param6.R;
|
||||||
|
_loc12_.v.x = param6.position.x + (_loc23_.col1.x * _loc22_.x + _loc23_.col2.x * _loc22_.y);
|
||||||
|
_loc12_.v.y = param6.position.y + (_loc23_.col1.y * _loc22_.x + _loc23_.col2.y * _loc22_.y);
|
||||||
|
_loc12_.id.features.referenceEdge = param4;
|
||||||
|
_loc12_.id.features.incidentEdge = _loc18_;
|
||||||
|
_loc12_.id.features.incidentVertex = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2CollidePolygons(param1:b2Manifold, param2:b2PolygonShape, param3:b2XForm, param4:b2PolygonShape, param5:b2XForm) : void
|
||||||
|
{
|
||||||
|
var _loc34_:ClipVertex = null;
|
||||||
|
var _loc38_:b2PolygonShape = null;
|
||||||
|
var _loc37_:b2PolygonShape = null;
|
||||||
|
var _loc29_:int = 0;
|
||||||
|
var _loc21_:* = 0;
|
||||||
|
var _loc12_:Number = NaN;
|
||||||
|
_loc12_ = 0.98;
|
||||||
|
var _loc27_:Number = NaN;
|
||||||
|
_loc27_ = 0.001;
|
||||||
|
var _loc16_:b2Vec2 = null;
|
||||||
|
var _loc9_:int = 0;
|
||||||
|
var _loc28_:int = 0;
|
||||||
|
var _loc15_:Number = NaN;
|
||||||
|
var _loc31_:b2ManifoldPoint = null;
|
||||||
|
param1.pointCount = 0;
|
||||||
|
var _loc18_:int = 0;
|
||||||
|
var _loc22_:Array = [_loc18_];
|
||||||
|
var _loc23_:Number = FindMaxSeparation(_loc22_,param2,param3,param4,param5);
|
||||||
|
_loc18_ = int(_loc22_[0]);
|
||||||
|
if(_loc23_ > 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var _loc19_:int = 0;
|
||||||
|
var _loc6_:Array = [_loc19_];
|
||||||
|
var _loc24_:Number = FindMaxSeparation(_loc6_,param4,param5,param2,param3);
|
||||||
|
_loc19_ = int(_loc6_[0]);
|
||||||
|
if(_loc24_ > 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var _loc8_:b2XForm = new b2XForm();
|
||||||
|
var _loc10_:b2XForm = new b2XForm();
|
||||||
|
if(_loc24_ > 0.98 * _loc23_ + 0.001)
|
||||||
|
{
|
||||||
|
_loc38_ = param4;
|
||||||
|
_loc37_ = param2;
|
||||||
|
_loc8_.Set(param5);
|
||||||
|
_loc10_.Set(param3);
|
||||||
|
_loc29_ = _loc19_;
|
||||||
|
_loc21_ = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc38_ = param2;
|
||||||
|
_loc37_ = param4;
|
||||||
|
_loc8_.Set(param3);
|
||||||
|
_loc10_.Set(param5);
|
||||||
|
_loc29_ = _loc18_;
|
||||||
|
_loc21_ = 0;
|
||||||
|
}
|
||||||
|
var _loc32_:Array = [new ClipVertex(),new ClipVertex()];
|
||||||
|
FindIncidentEdge(_loc32_,_loc38_,_loc8_,_loc29_,_loc37_,_loc10_);
|
||||||
|
var _loc7_:int = _loc38_.m_vertexCount;
|
||||||
|
var _loc11_:Array = _loc38_.m_vertices;
|
||||||
|
var _loc36_:b2Vec2 = _loc11_[_loc29_];
|
||||||
|
var _loc17_:b2Vec2 = _loc36_.Copy();
|
||||||
|
if(_loc29_ + 1 < _loc7_)
|
||||||
|
{
|
||||||
|
_loc36_ = _loc11_[int(_loc29_ + 1)];
|
||||||
|
_loc16_ = _loc36_.Copy();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc36_ = _loc11_[0];
|
||||||
|
_loc16_ = _loc36_.Copy();
|
||||||
|
}
|
||||||
|
var _loc14_:b2Vec2 = b2Math.SubtractVV(_loc16_,_loc17_);
|
||||||
|
var _loc20_:b2Vec2 = b2Math.b2MulMV(_loc8_.R,b2Math.SubtractVV(_loc16_,_loc17_));
|
||||||
|
_loc20_.Normalize();
|
||||||
|
var _loc13_:b2Vec2 = b2Math.b2CrossVF(_loc20_,1);
|
||||||
|
_loc17_ = b2Math.b2MulX(_loc8_,_loc17_);
|
||||||
|
_loc16_ = b2Math.b2MulX(_loc8_,_loc16_);
|
||||||
|
var _loc30_:Number = b2Math.b2Dot(_loc13_,_loc17_);
|
||||||
|
var _loc39_:Number = -b2Math.b2Dot(_loc20_,_loc17_);
|
||||||
|
var _loc35_:Number = b2Math.b2Dot(_loc20_,_loc16_);
|
||||||
|
var _loc26_:Array = [new ClipVertex(),new ClipVertex()];
|
||||||
|
var _loc25_:Array = [new ClipVertex(),new ClipVertex()];
|
||||||
|
_loc9_ = ClipSegmentToLine(_loc26_,_loc32_,_loc20_.Negative(),_loc39_);
|
||||||
|
if(_loc9_ < 2)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_loc9_ = ClipSegmentToLine(_loc25_,_loc26_,_loc20_,_loc35_);
|
||||||
|
if(_loc9_ < 2)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
param1.normal = _loc21_ ? _loc13_.Negative() : _loc13_.Copy();
|
||||||
|
var _loc33_:int = 0;
|
||||||
|
_loc28_ = 0;
|
||||||
|
while(_loc28_ < 2)
|
||||||
|
{
|
||||||
|
_loc34_ = _loc25_[_loc28_];
|
||||||
|
_loc15_ = b2Math.b2Dot(_loc13_,_loc34_.v) - _loc30_;
|
||||||
|
if(_loc15_ <= 0)
|
||||||
|
{
|
||||||
|
_loc31_ = param1.points[_loc33_];
|
||||||
|
_loc31_.separation = _loc15_;
|
||||||
|
_loc31_.localPoint1 = b2Math.b2MulXT(param3,_loc34_.v);
|
||||||
|
_loc31_.localPoint2 = b2Math.b2MulXT(param5,_loc34_.v);
|
||||||
|
_loc31_.id.key = _loc34_.id._key;
|
||||||
|
_loc31_.id.features.flip = _loc21_;
|
||||||
|
_loc33_++;
|
||||||
|
}
|
||||||
|
_loc28_++;
|
||||||
|
}
|
||||||
|
param1.pointCount = _loc33_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2CollideCircles(param1:b2Manifold, param2:b2CircleShape, param3:b2XForm, param4:b2CircleShape, param5:b2XForm) : void
|
||||||
|
{
|
||||||
|
var _loc23_:b2Mat22 = null;
|
||||||
|
var _loc21_:b2Vec2 = null;
|
||||||
|
var _loc9_:Number = NaN;
|
||||||
|
var _loc7_:Number = NaN;
|
||||||
|
var _loc12_:Number = NaN;
|
||||||
|
param1.pointCount = 0;
|
||||||
|
_loc23_ = param3.R;
|
||||||
|
_loc21_ = param2.m_localPosition;
|
||||||
|
var _loc22_:Number = param3.position.x + (_loc23_.col1.x * _loc21_.x + _loc23_.col2.x * _loc21_.y);
|
||||||
|
var _loc24_:Number = param3.position.y + (_loc23_.col1.y * _loc21_.x + _loc23_.col2.y * _loc21_.y);
|
||||||
|
_loc23_ = param5.R;
|
||||||
|
_loc21_ = param4.m_localPosition;
|
||||||
|
var _loc11_:Number = param5.position.x + (_loc23_.col1.x * _loc21_.x + _loc23_.col2.x * _loc21_.y);
|
||||||
|
var _loc10_:Number = param5.position.y + (_loc23_.col1.y * _loc21_.x + _loc23_.col2.y * _loc21_.y);
|
||||||
|
var _loc19_:Number = _loc11_ - _loc22_;
|
||||||
|
var _loc20_:Number = _loc10_ - _loc24_;
|
||||||
|
var _loc15_:Number = _loc19_ * _loc19_ + _loc20_ * _loc20_;
|
||||||
|
var _loc25_:Number = param2.m_radius;
|
||||||
|
var _loc6_:Number = param4.m_radius;
|
||||||
|
var _loc8_:Number = _loc25_ + _loc6_;
|
||||||
|
if(_loc15_ > _loc8_ * _loc8_)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(_loc15_ < Number.MIN_VALUE)
|
||||||
|
{
|
||||||
|
_loc9_ = -_loc8_;
|
||||||
|
param1.normal.Set(0,1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc7_ = Math.sqrt(_loc15_);
|
||||||
|
_loc9_ = _loc7_ - _loc8_;
|
||||||
|
_loc12_ = 1 / _loc7_;
|
||||||
|
param1.normal.x = _loc12_ * _loc19_;
|
||||||
|
param1.normal.y = _loc12_ * _loc20_;
|
||||||
|
}
|
||||||
|
param1.pointCount = 1;
|
||||||
|
var _loc18_:b2ManifoldPoint = param1.points[0];
|
||||||
|
_loc18_.id.key = 0;
|
||||||
|
_loc18_.separation = _loc9_;
|
||||||
|
_loc22_ += _loc25_ * param1.normal.x;
|
||||||
|
_loc24_ += _loc25_ * param1.normal.y;
|
||||||
|
_loc11_ -= _loc6_ * param1.normal.x;
|
||||||
|
_loc10_ -= _loc6_ * param1.normal.y;
|
||||||
|
var _loc16_:Number = 0.5 * (_loc22_ + _loc11_);
|
||||||
|
var _loc17_:Number = 0.5 * (_loc24_ + _loc10_);
|
||||||
|
var _loc13_:Number = _loc16_ - param3.position.x;
|
||||||
|
var _loc14_:Number = _loc17_ - param3.position.y;
|
||||||
|
_loc18_.localPoint1.x = _loc13_ * param3.R.col1.x + _loc14_ * param3.R.col1.y;
|
||||||
|
_loc18_.localPoint1.y = _loc13_ * param3.R.col2.x + _loc14_ * param3.R.col2.y;
|
||||||
|
_loc13_ = _loc16_ - param5.position.x;
|
||||||
|
_loc14_ = _loc17_ - param5.position.y;
|
||||||
|
_loc18_.localPoint2.x = _loc13_ * param5.R.col1.x + _loc14_ * param5.R.col1.y;
|
||||||
|
_loc18_.localPoint2.y = _loc13_ * param5.R.col2.x + _loc14_ * param5.R.col2.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2CollidePolygonAndCircle(param1:b2Manifold, param2:b2PolygonShape, param3:b2XForm, param4:b2CircleShape, param5:b2XForm) : void
|
||||||
|
{
|
||||||
|
var _loc25_:b2ManifoldPoint = null;
|
||||||
|
var _loc28_:Number = NaN;
|
||||||
|
var _loc29_:Number = NaN;
|
||||||
|
var _loc8_:Number = NaN;
|
||||||
|
var _loc9_:Number = NaN;
|
||||||
|
var _loc31_:b2Vec2 = null;
|
||||||
|
var _loc32_:b2Mat22 = null;
|
||||||
|
var _loc7_:Number = NaN;
|
||||||
|
var _loc21_:int = 0;
|
||||||
|
var _loc27_:Number = NaN;
|
||||||
|
var _loc22_:Number = NaN;
|
||||||
|
var _loc20_:Number = NaN;
|
||||||
|
param1.pointCount = 0;
|
||||||
|
_loc32_ = param5.R;
|
||||||
|
_loc31_ = param4.m_localPosition;
|
||||||
|
var _loc14_:Number = param5.position.x + (_loc32_.col1.x * _loc31_.x + _loc32_.col2.x * _loc31_.y);
|
||||||
|
var _loc16_:Number = param5.position.y + (_loc32_.col1.y * _loc31_.x + _loc32_.col2.y * _loc31_.y);
|
||||||
|
_loc28_ = _loc14_ - param3.position.x;
|
||||||
|
_loc29_ = _loc16_ - param3.position.y;
|
||||||
|
_loc32_ = param3.R;
|
||||||
|
var _loc11_:Number = _loc28_ * _loc32_.col1.x + _loc29_ * _loc32_.col1.y;
|
||||||
|
var _loc10_:Number = _loc28_ * _loc32_.col2.x + _loc29_ * _loc32_.col2.y;
|
||||||
|
var _loc18_:* = 0;
|
||||||
|
var _loc15_:Number = -1.7976931348623157e+308;
|
||||||
|
var _loc17_:Number = param4.m_radius;
|
||||||
|
var _loc23_:int = param2.m_vertexCount;
|
||||||
|
var _loc6_:Array = param2.m_vertices;
|
||||||
|
var _loc34_:Array = param2.m_normals;
|
||||||
|
_loc21_ = 0;
|
||||||
|
while(_loc21_ < _loc23_)
|
||||||
|
{
|
||||||
|
_loc31_ = _loc6_[_loc21_];
|
||||||
|
_loc28_ = _loc11_ - _loc31_.x;
|
||||||
|
_loc29_ = _loc10_ - _loc31_.y;
|
||||||
|
_loc31_ = _loc34_[_loc21_];
|
||||||
|
_loc27_ = _loc31_.x * _loc28_ + _loc31_.y * _loc29_;
|
||||||
|
if(_loc27_ > _loc17_)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(_loc27_ > _loc15_)
|
||||||
|
{
|
||||||
|
_loc15_ = _loc27_;
|
||||||
|
_loc18_ = _loc21_;
|
||||||
|
}
|
||||||
|
_loc21_++;
|
||||||
|
}
|
||||||
|
if(_loc15_ < Number.MIN_VALUE)
|
||||||
|
{
|
||||||
|
param1.pointCount = 1;
|
||||||
|
_loc31_ = _loc34_[_loc18_];
|
||||||
|
_loc32_ = param3.R;
|
||||||
|
param1.normal.x = _loc32_.col1.x * _loc31_.x + _loc32_.col2.x * _loc31_.y;
|
||||||
|
param1.normal.y = _loc32_.col1.y * _loc31_.x + _loc32_.col2.y * _loc31_.y;
|
||||||
|
_loc25_ = param1.points[0];
|
||||||
|
_loc25_.id.features.incidentEdge = _loc18_;
|
||||||
|
_loc25_.id.features.incidentVertex = 255;
|
||||||
|
_loc25_.id.features.referenceEdge = 0;
|
||||||
|
_loc25_.id.features.flip = 0;
|
||||||
|
_loc8_ = _loc14_ - _loc17_ * param1.normal.x;
|
||||||
|
_loc9_ = _loc16_ - _loc17_ * param1.normal.y;
|
||||||
|
_loc28_ = _loc8_ - param3.position.x;
|
||||||
|
_loc29_ = _loc9_ - param3.position.y;
|
||||||
|
_loc32_ = param3.R;
|
||||||
|
_loc25_.localPoint1.x = _loc28_ * _loc32_.col1.x + _loc29_ * _loc32_.col1.y;
|
||||||
|
_loc25_.localPoint1.y = _loc28_ * _loc32_.col2.x + _loc29_ * _loc32_.col2.y;
|
||||||
|
_loc28_ = _loc8_ - param5.position.x;
|
||||||
|
_loc29_ = _loc9_ - param5.position.y;
|
||||||
|
_loc32_ = param5.R;
|
||||||
|
_loc25_.localPoint2.x = _loc28_ * _loc32_.col1.x + _loc29_ * _loc32_.col1.y;
|
||||||
|
_loc25_.localPoint2.y = _loc28_ * _loc32_.col2.x + _loc29_ * _loc32_.col2.y;
|
||||||
|
_loc25_.separation = _loc15_ - _loc17_;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var _loc26_:Number = _loc18_;
|
||||||
|
var _loc24_:int = _loc26_ + 1 < _loc23_ ? _loc26_ + 1 : 0;
|
||||||
|
_loc31_ = _loc6_[_loc26_];
|
||||||
|
var _loc33_:b2Vec2 = _loc6_[_loc24_];
|
||||||
|
var _loc12_:Number = _loc33_.x - _loc31_.x;
|
||||||
|
var _loc13_:Number = _loc33_.y - _loc31_.y;
|
||||||
|
var _loc19_:Number = Math.sqrt(_loc12_ * _loc12_ + _loc13_ * _loc13_);
|
||||||
|
_loc12_ /= _loc19_;
|
||||||
|
_loc13_ /= _loc19_;
|
||||||
|
_loc28_ = _loc11_ - _loc31_.x;
|
||||||
|
_loc29_ = _loc10_ - _loc31_.y;
|
||||||
|
var _loc30_:Number = _loc28_ * _loc12_ + _loc29_ * _loc13_;
|
||||||
|
_loc25_ = param1.points[0];
|
||||||
|
if(_loc30_ <= 0)
|
||||||
|
{
|
||||||
|
_loc20_ = _loc31_.x;
|
||||||
|
_loc22_ = _loc31_.y;
|
||||||
|
_loc25_.id.features.incidentEdge = 255;
|
||||||
|
_loc25_.id.features.incidentVertex = _loc26_;
|
||||||
|
}
|
||||||
|
else if(_loc30_ >= _loc19_)
|
||||||
|
{
|
||||||
|
_loc20_ = _loc33_.x;
|
||||||
|
_loc22_ = _loc33_.y;
|
||||||
|
_loc25_.id.features.incidentEdge = 255;
|
||||||
|
_loc25_.id.features.incidentVertex = _loc24_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc20_ = _loc12_ * _loc30_ + _loc31_.x;
|
||||||
|
_loc22_ = _loc13_ * _loc30_ + _loc31_.y;
|
||||||
|
_loc25_.id.features.incidentEdge = _loc18_;
|
||||||
|
_loc25_.id.features.incidentVertex = 255;
|
||||||
|
}
|
||||||
|
_loc28_ = _loc11_ - _loc20_;
|
||||||
|
_loc29_ = _loc10_ - _loc22_;
|
||||||
|
_loc7_ = Math.sqrt(_loc28_ * _loc28_ + _loc29_ * _loc29_);
|
||||||
|
_loc28_ /= _loc7_;
|
||||||
|
_loc29_ /= _loc7_;
|
||||||
|
if(_loc7_ > _loc17_)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
param1.pointCount = 1;
|
||||||
|
_loc32_ = param3.R;
|
||||||
|
param1.normal.x = _loc32_.col1.x * _loc28_ + _loc32_.col2.x * _loc29_;
|
||||||
|
param1.normal.y = _loc32_.col1.y * _loc28_ + _loc32_.col2.y * _loc29_;
|
||||||
|
_loc8_ = _loc14_ - _loc17_ * param1.normal.x;
|
||||||
|
_loc9_ = _loc16_ - _loc17_ * param1.normal.y;
|
||||||
|
_loc28_ = _loc8_ - param3.position.x;
|
||||||
|
_loc29_ = _loc9_ - param3.position.y;
|
||||||
|
_loc32_ = param3.R;
|
||||||
|
_loc25_.localPoint1.x = _loc28_ * _loc32_.col1.x + _loc29_ * _loc32_.col1.y;
|
||||||
|
_loc25_.localPoint1.y = _loc28_ * _loc32_.col2.x + _loc29_ * _loc32_.col2.y;
|
||||||
|
_loc28_ = _loc8_ - param5.position.x;
|
||||||
|
_loc29_ = _loc9_ - param5.position.y;
|
||||||
|
_loc32_ = param5.R;
|
||||||
|
_loc25_.localPoint2.x = _loc28_ * _loc32_.col1.x + _loc29_ * _loc32_.col1.y;
|
||||||
|
_loc25_.localPoint2.y = _loc28_ * _loc32_.col2.x + _loc29_ * _loc32_.col2.y;
|
||||||
|
_loc25_.separation = _loc7_ - _loc17_;
|
||||||
|
_loc25_.id.features.referenceEdge = 0;
|
||||||
|
_loc25_.id.features.flip = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2TestOverlap(param1:b2AABB, param2:b2AABB) : Boolean
|
||||||
|
{
|
||||||
|
var _loc6_:b2Vec2 = param2.lowerBound;
|
||||||
|
var _loc8_:b2Vec2 = param1.upperBound;
|
||||||
|
var _loc3_:Number = _loc6_.x - _loc8_.x;
|
||||||
|
var _loc7_:Number = _loc6_.y - _loc8_.y;
|
||||||
|
_loc6_ = param1.lowerBound;
|
||||||
|
_loc8_ = param2.upperBound;
|
||||||
|
var _loc5_:Number = _loc6_.x - _loc8_.x;
|
||||||
|
var _loc4_:Number = _loc6_.y - _loc8_.y;
|
||||||
|
if(_loc3_ > 0 || _loc7_ > 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(_loc5_ > 0 || _loc4_ > 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
public class b2ContactID
|
||||||
|
{
|
||||||
|
|
||||||
|
public var features:Features = new Features();
|
||||||
|
|
||||||
|
public var _key:uint;
|
||||||
|
|
||||||
|
public function b2ContactID()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
features._m_id = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Set(param1:b2ContactID) : void
|
||||||
|
{
|
||||||
|
key = param1._key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Copy() : b2ContactID
|
||||||
|
{
|
||||||
|
var _loc1_:b2ContactID = new b2ContactID();
|
||||||
|
_loc1_.key = key;
|
||||||
|
return _loc1_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get key() : uint
|
||||||
|
{
|
||||||
|
return _key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set key(param1:uint) : void
|
||||||
|
{
|
||||||
|
_key = param1;
|
||||||
|
features._referenceEdge = _key & 0xFF;
|
||||||
|
features._incidentEdge = (_key & 0xFF00) >> 8 & 0xFF;
|
||||||
|
features._incidentVertex = (_key & 0xFF0000) >> 16 & 0xFF;
|
||||||
|
features._flip = (_key & 0xFF000000) >> 24 & 0xFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Collision.Shapes.b2Shape;
|
||||||
|
import Box2D.Common.Math.b2Vec2;
|
||||||
|
|
||||||
|
public class b2ContactPoint
|
||||||
|
{
|
||||||
|
|
||||||
|
public var shape1:b2Shape;
|
||||||
|
|
||||||
|
public var shape2:b2Shape;
|
||||||
|
|
||||||
|
public var position:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var velocity:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var normal:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var separation:Number;
|
||||||
|
|
||||||
|
public var friction:Number;
|
||||||
|
|
||||||
|
public var restitution:Number;
|
||||||
|
|
||||||
|
public var id:b2ContactID = new b2ContactID();
|
||||||
|
|
||||||
|
public function b2ContactPoint()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,375 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Collision.Shapes.*;
|
||||||
|
import Box2D.Common.*;
|
||||||
|
import Box2D.Common.Math.*;
|
||||||
|
|
||||||
|
public class b2Distance
|
||||||
|
{
|
||||||
|
|
||||||
|
public static var g_GJK_Iterations:int = 0;
|
||||||
|
|
||||||
|
private static var s_p1s:Array = [new b2Vec2(),new b2Vec2(),new b2Vec2()];
|
||||||
|
|
||||||
|
private static var s_p2s:Array = [new b2Vec2(),new b2Vec2(),new b2Vec2()];
|
||||||
|
|
||||||
|
private static var s_points:Array = [new b2Vec2(),new b2Vec2(),new b2Vec2()];
|
||||||
|
|
||||||
|
private static var gPoint:b2Point = new b2Point();
|
||||||
|
|
||||||
|
public function b2Distance()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function ProcessTwo(param1:b2Vec2, param2:b2Vec2, param3:Array, param4:Array, param5:Array) : int
|
||||||
|
{
|
||||||
|
var _loc16_:b2Vec2 = param5[0];
|
||||||
|
var _loc17_:b2Vec2 = param5[1];
|
||||||
|
var _loc7_:b2Vec2 = param3[0];
|
||||||
|
var _loc9_:b2Vec2 = param3[1];
|
||||||
|
var _loc6_:b2Vec2 = param4[0];
|
||||||
|
var _loc8_:b2Vec2 = param4[1];
|
||||||
|
var _loc10_:Number = -_loc17_.x;
|
||||||
|
var _loc11_:Number = -_loc17_.y;
|
||||||
|
var _loc14_:Number = _loc16_.x - _loc17_.x;
|
||||||
|
var _loc15_:Number = _loc16_.y - _loc17_.y;
|
||||||
|
var _loc12_:Number = Math.sqrt(_loc14_ * _loc14_ + _loc15_ * _loc15_);
|
||||||
|
_loc14_ /= _loc12_;
|
||||||
|
_loc15_ /= _loc12_;
|
||||||
|
var _loc13_:Number = _loc10_ * _loc14_ + _loc11_ * _loc15_;
|
||||||
|
if(_loc13_ <= 0 || _loc12_ < Number.MIN_VALUE)
|
||||||
|
{
|
||||||
|
param1.SetV(_loc9_);
|
||||||
|
param2.SetV(_loc8_);
|
||||||
|
_loc7_.SetV(_loc9_);
|
||||||
|
_loc6_.SetV(_loc8_);
|
||||||
|
_loc16_.SetV(_loc17_);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
_loc13_ /= _loc12_;
|
||||||
|
param1.x = _loc9_.x + _loc13_ * (_loc7_.x - _loc9_.x);
|
||||||
|
param1.y = _loc9_.y + _loc13_ * (_loc7_.y - _loc9_.y);
|
||||||
|
param2.x = _loc8_.x + _loc13_ * (_loc6_.x - _loc8_.x);
|
||||||
|
param2.y = _loc8_.y + _loc13_ * (_loc6_.y - _loc8_.y);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function ProcessThree(param1:b2Vec2, param2:b2Vec2, param3:Array, param4:Array, param5:Array) : int
|
||||||
|
{
|
||||||
|
var _loc11_:Number = NaN;
|
||||||
|
var _loc21_:b2Vec2 = param5[0];
|
||||||
|
var _loc22_:b2Vec2 = param5[1];
|
||||||
|
var _loc23_:b2Vec2 = param5[2];
|
||||||
|
var _loc6_:b2Vec2 = param3[0];
|
||||||
|
var _loc7_:b2Vec2 = param3[1];
|
||||||
|
var _loc8_:b2Vec2 = param3[2];
|
||||||
|
var _loc24_:b2Vec2 = param4[0];
|
||||||
|
var _loc25_:b2Vec2 = param4[1];
|
||||||
|
var _loc26_:b2Vec2 = param4[2];
|
||||||
|
var _loc15_:Number = _loc21_.x;
|
||||||
|
var _loc16_:Number = _loc21_.y;
|
||||||
|
var _loc33_:Number = _loc22_.x;
|
||||||
|
var _loc37_:Number = _loc22_.y;
|
||||||
|
var _loc12_:Number = _loc23_.x;
|
||||||
|
var _loc13_:Number = _loc23_.y;
|
||||||
|
var _loc14_:Number = _loc33_ - _loc15_;
|
||||||
|
var _loc17_:Number = _loc37_ - _loc16_;
|
||||||
|
var _loc38_:Number = _loc12_ - _loc15_;
|
||||||
|
var _loc34_:Number = _loc13_ - _loc16_;
|
||||||
|
var _loc35_:Number = _loc12_ - _loc33_;
|
||||||
|
var _loc40_:Number = _loc13_ - _loc37_;
|
||||||
|
var _loc19_:Number = -(_loc15_ * _loc14_ + _loc16_ * _loc17_);
|
||||||
|
var _loc10_:Number = _loc33_ * _loc14_ + _loc37_ * _loc17_;
|
||||||
|
var _loc41_:Number = -(_loc15_ * _loc38_ + _loc16_ * _loc34_);
|
||||||
|
var _loc31_:Number = _loc12_ * _loc38_ + _loc13_ * _loc34_;
|
||||||
|
var _loc18_:Number = -(_loc33_ * _loc35_ + _loc37_ * _loc40_);
|
||||||
|
var _loc9_:Number = _loc12_ * _loc35_ + _loc13_ * _loc40_;
|
||||||
|
if(_loc31_ <= 0 && _loc9_ <= 0)
|
||||||
|
{
|
||||||
|
param1.SetV(_loc8_);
|
||||||
|
param2.SetV(_loc26_);
|
||||||
|
_loc6_.SetV(_loc8_);
|
||||||
|
_loc24_.SetV(_loc26_);
|
||||||
|
_loc21_.SetV(_loc23_);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
var _loc30_:Number = _loc14_ * _loc34_ - _loc17_ * _loc38_;
|
||||||
|
var _loc29_:Number = _loc30_ * (_loc15_ * _loc37_ - _loc16_ * _loc33_);
|
||||||
|
var _loc27_:Number = _loc30_ * (_loc33_ * _loc13_ - _loc37_ * _loc12_);
|
||||||
|
if(_loc27_ <= 0 && _loc18_ >= 0 && _loc9_ >= 0 && _loc18_ + _loc9_ > 0)
|
||||||
|
{
|
||||||
|
_loc11_ = _loc18_ / (_loc18_ + _loc9_);
|
||||||
|
param1.x = _loc7_.x + _loc11_ * (_loc8_.x - _loc7_.x);
|
||||||
|
param1.y = _loc7_.y + _loc11_ * (_loc8_.y - _loc7_.y);
|
||||||
|
param2.x = _loc25_.x + _loc11_ * (_loc26_.x - _loc25_.x);
|
||||||
|
param2.y = _loc25_.y + _loc11_ * (_loc26_.y - _loc25_.y);
|
||||||
|
_loc6_.SetV(_loc8_);
|
||||||
|
_loc24_.SetV(_loc26_);
|
||||||
|
_loc21_.SetV(_loc23_);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
var _loc28_:Number = _loc30_ * (_loc12_ * _loc16_ - _loc13_ * _loc15_);
|
||||||
|
if(_loc28_ <= 0 && _loc41_ >= 0 && _loc31_ >= 0 && _loc41_ + _loc31_ > 0)
|
||||||
|
{
|
||||||
|
_loc11_ = _loc41_ / (_loc41_ + _loc31_);
|
||||||
|
param1.x = _loc6_.x + _loc11_ * (_loc8_.x - _loc6_.x);
|
||||||
|
param1.y = _loc6_.y + _loc11_ * (_loc8_.y - _loc6_.y);
|
||||||
|
param2.x = _loc24_.x + _loc11_ * (_loc26_.x - _loc24_.x);
|
||||||
|
param2.y = _loc24_.y + _loc11_ * (_loc26_.y - _loc24_.y);
|
||||||
|
_loc7_.SetV(_loc8_);
|
||||||
|
_loc25_.SetV(_loc26_);
|
||||||
|
_loc22_.SetV(_loc23_);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
var _loc20_:Number = _loc27_ + _loc28_ + _loc29_;
|
||||||
|
_loc20_ = 1 / _loc20_;
|
||||||
|
var _loc32_:Number = _loc27_ * _loc20_;
|
||||||
|
var _loc36_:Number = _loc28_ * _loc20_;
|
||||||
|
var _loc39_:Number = 1 - _loc32_ - _loc36_;
|
||||||
|
param1.x = _loc32_ * _loc6_.x + _loc36_ * _loc7_.x + _loc39_ * _loc8_.x;
|
||||||
|
param1.y = _loc32_ * _loc6_.y + _loc36_ * _loc7_.y + _loc39_ * _loc8_.y;
|
||||||
|
param2.x = _loc32_ * _loc24_.x + _loc36_ * _loc25_.x + _loc39_ * _loc26_.x;
|
||||||
|
param2.y = _loc32_ * _loc24_.y + _loc36_ * _loc25_.y + _loc39_ * _loc26_.y;
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function InPoints(param1:b2Vec2, param2:Array, param3:int) : Boolean
|
||||||
|
{
|
||||||
|
var _loc8_:int = 0;
|
||||||
|
var _loc6_:b2Vec2 = null;
|
||||||
|
var _loc5_:Number = NaN;
|
||||||
|
var _loc7_:Number = NaN;
|
||||||
|
var _loc9_:Number = NaN;
|
||||||
|
var _loc10_:Number = NaN;
|
||||||
|
var _loc4_:Number = 100 * Number.MIN_VALUE;
|
||||||
|
_loc8_ = 0;
|
||||||
|
while(_loc8_ < param3)
|
||||||
|
{
|
||||||
|
_loc6_ = param2[_loc8_];
|
||||||
|
_loc5_ = Math.abs(param1.x - _loc6_.x);
|
||||||
|
_loc7_ = Math.abs(param1.y - _loc6_.y);
|
||||||
|
_loc9_ = Math.max(Math.abs(param1.x),Math.abs(_loc6_.x));
|
||||||
|
_loc10_ = Math.max(Math.abs(param1.y),Math.abs(_loc6_.y));
|
||||||
|
if(_loc5_ < _loc4_ * (_loc9_ + 1) && _loc7_ < _loc4_ * (_loc10_ + 1))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
_loc8_++;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function DistanceGeneric(param1:b2Vec2, param2:b2Vec2, param3:*, param4:b2XForm, param5:*, param6:b2XForm) : Number
|
||||||
|
{
|
||||||
|
var _loc20_:b2Vec2 = null;
|
||||||
|
var _loc9_:int = 0;
|
||||||
|
_loc9_ = 20;
|
||||||
|
var _loc14_:int = 0;
|
||||||
|
var _loc10_:Number = NaN;
|
||||||
|
var _loc12_:Number = NaN;
|
||||||
|
var _loc21_:b2Vec2 = null;
|
||||||
|
var _loc22_:b2Vec2 = null;
|
||||||
|
var _loc7_:Number = NaN;
|
||||||
|
var _loc11_:Number = NaN;
|
||||||
|
var _loc8_:Number = NaN;
|
||||||
|
var _loc23_:Number = NaN;
|
||||||
|
var _loc15_:int = 0;
|
||||||
|
var _loc19_:Array = s_p1s;
|
||||||
|
var _loc17_:Array = s_p2s;
|
||||||
|
var _loc16_:Array = s_points;
|
||||||
|
var _loc18_:int = 0;
|
||||||
|
param1.SetV(param3.GetFirstVertex(param4));
|
||||||
|
param2.SetV(param5.GetFirstVertex(param6));
|
||||||
|
var _loc13_:Number = 0;
|
||||||
|
_loc14_ = 0;
|
||||||
|
while(_loc14_ < 20)
|
||||||
|
{
|
||||||
|
_loc10_ = param2.x - param1.x;
|
||||||
|
_loc12_ = param2.y - param1.y;
|
||||||
|
_loc21_ = param3.Support(param4,_loc10_,_loc12_);
|
||||||
|
_loc22_ = param5.Support(param6,-_loc10_,-_loc12_);
|
||||||
|
_loc13_ = _loc10_ * _loc10_ + _loc12_ * _loc12_;
|
||||||
|
_loc7_ = _loc22_.x - _loc21_.x;
|
||||||
|
_loc11_ = _loc22_.y - _loc21_.y;
|
||||||
|
_loc8_ = _loc10_ * _loc7_ + _loc12_ * _loc11_;
|
||||||
|
if(_loc13_ - _loc8_ <= 0.01 * _loc13_)
|
||||||
|
{
|
||||||
|
if(_loc18_ == 0)
|
||||||
|
{
|
||||||
|
param1.SetV(_loc21_);
|
||||||
|
param2.SetV(_loc22_);
|
||||||
|
}
|
||||||
|
g_GJK_Iterations = _loc14_;
|
||||||
|
return Math.sqrt(_loc13_);
|
||||||
|
}
|
||||||
|
switch(_loc18_)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
_loc20_ = _loc19_[0];
|
||||||
|
_loc20_.SetV(_loc21_);
|
||||||
|
_loc20_ = _loc17_[0];
|
||||||
|
_loc20_.SetV(_loc22_);
|
||||||
|
_loc20_ = _loc16_[0];
|
||||||
|
_loc20_.x = _loc7_;
|
||||||
|
_loc20_.y = _loc11_;
|
||||||
|
param1.SetV(_loc19_[0]);
|
||||||
|
param2.SetV(_loc17_[0]);
|
||||||
|
_loc18_++;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
_loc20_ = _loc19_[1];
|
||||||
|
_loc20_.SetV(_loc21_);
|
||||||
|
_loc20_ = _loc17_[1];
|
||||||
|
_loc20_.SetV(_loc22_);
|
||||||
|
_loc20_ = _loc16_[1];
|
||||||
|
_loc20_.x = _loc7_;
|
||||||
|
_loc20_.y = _loc11_;
|
||||||
|
_loc18_ = ProcessTwo(param1,param2,_loc19_,_loc17_,_loc16_);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
_loc20_ = _loc19_[2];
|
||||||
|
_loc20_.SetV(_loc21_);
|
||||||
|
_loc20_ = _loc17_[2];
|
||||||
|
_loc20_.SetV(_loc22_);
|
||||||
|
_loc20_ = _loc16_[2];
|
||||||
|
_loc20_.x = _loc7_;
|
||||||
|
_loc20_.y = _loc11_;
|
||||||
|
_loc18_ = ProcessThree(param1,param2,_loc19_,_loc17_,_loc16_);
|
||||||
|
}
|
||||||
|
if(_loc18_ == 3)
|
||||||
|
{
|
||||||
|
g_GJK_Iterations = _loc14_;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_loc23_ = -1.7976931348623157e+308;
|
||||||
|
_loc15_ = 0;
|
||||||
|
while(_loc15_ < _loc18_)
|
||||||
|
{
|
||||||
|
_loc20_ = _loc16_[_loc15_];
|
||||||
|
_loc23_ = b2Math.b2Max(_loc23_,_loc20_.x * _loc20_.x + _loc20_.y * _loc20_.y);
|
||||||
|
_loc15_++;
|
||||||
|
}
|
||||||
|
if(_loc18_ == 3 || _loc13_ <= 100 * Number.MIN_VALUE * _loc23_)
|
||||||
|
{
|
||||||
|
g_GJK_Iterations = _loc14_;
|
||||||
|
_loc10_ = param2.x - param1.x;
|
||||||
|
_loc12_ = param2.y - param1.y;
|
||||||
|
_loc13_ = _loc10_ * _loc10_ + _loc12_ * _loc12_;
|
||||||
|
return Math.sqrt(_loc13_);
|
||||||
|
}
|
||||||
|
_loc14_++;
|
||||||
|
}
|
||||||
|
g_GJK_Iterations = 20;
|
||||||
|
return Math.sqrt(_loc13_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function DistanceCC(param1:b2Vec2, param2:b2Vec2, param3:b2CircleShape, param4:b2XForm, param5:b2CircleShape, param6:b2XForm) : Number
|
||||||
|
{
|
||||||
|
var _loc16_:b2Mat22 = null;
|
||||||
|
var _loc12_:b2Vec2 = null;
|
||||||
|
var _loc20_:Number = NaN;
|
||||||
|
var _loc8_:Number = NaN;
|
||||||
|
_loc16_ = param4.R;
|
||||||
|
_loc12_ = param3.m_localPosition;
|
||||||
|
var _loc13_:Number = param4.position.x + (_loc16_.col1.x * _loc12_.x + _loc16_.col2.x * _loc12_.y);
|
||||||
|
var _loc17_:Number = param4.position.y + (_loc16_.col1.y * _loc12_.x + _loc16_.col2.y * _loc12_.y);
|
||||||
|
_loc16_ = param6.R;
|
||||||
|
_loc12_ = param5.m_localPosition;
|
||||||
|
var _loc15_:Number = param6.position.x + (_loc16_.col1.x * _loc12_.x + _loc16_.col2.x * _loc12_.y);
|
||||||
|
var _loc14_:Number = param6.position.y + (_loc16_.col1.y * _loc12_.x + _loc16_.col2.y * _loc12_.y);
|
||||||
|
var _loc10_:Number = _loc15_ - _loc13_;
|
||||||
|
var _loc11_:Number = _loc14_ - _loc17_;
|
||||||
|
var _loc18_:Number = _loc10_ * _loc10_ + _loc11_ * _loc11_;
|
||||||
|
var _loc19_:Number = param3.m_radius - 0.04;
|
||||||
|
var _loc7_:Number = param5.m_radius - 0.04;
|
||||||
|
var _loc9_:Number = _loc19_ + _loc7_;
|
||||||
|
if(_loc18_ > _loc9_ * _loc9_)
|
||||||
|
{
|
||||||
|
_loc20_ = Math.sqrt(_loc18_);
|
||||||
|
_loc10_ /= _loc20_;
|
||||||
|
_loc11_ /= _loc20_;
|
||||||
|
_loc8_ = _loc20_ - _loc9_;
|
||||||
|
param1.x = _loc13_ + _loc19_ * _loc10_;
|
||||||
|
param1.y = _loc17_ + _loc19_ * _loc11_;
|
||||||
|
param2.x = _loc15_ - _loc7_ * _loc10_;
|
||||||
|
param2.y = _loc14_ - _loc7_ * _loc11_;
|
||||||
|
return _loc8_;
|
||||||
|
}
|
||||||
|
if(_loc18_ > Number.MIN_VALUE * Number.MIN_VALUE)
|
||||||
|
{
|
||||||
|
_loc20_ = Math.sqrt(_loc18_);
|
||||||
|
_loc10_ /= _loc20_;
|
||||||
|
_loc11_ /= _loc20_;
|
||||||
|
param1.x = _loc13_ + _loc19_ * _loc10_;
|
||||||
|
param1.y = _loc17_ + _loc19_ * _loc11_;
|
||||||
|
param2.x = param1.x;
|
||||||
|
param2.y = param1.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
param1.x = _loc13_;
|
||||||
|
param1.y = _loc17_;
|
||||||
|
param2.x = param1.x;
|
||||||
|
param2.y = param1.y;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function DistancePC(param1:b2Vec2, param2:b2Vec2, param3:b2PolygonShape, param4:b2XForm, param5:b2CircleShape, param6:b2XForm) : Number
|
||||||
|
{
|
||||||
|
var _loc13_:b2Mat22 = null;
|
||||||
|
var _loc12_:b2Vec2 = null;
|
||||||
|
var _loc10_:Number = NaN;
|
||||||
|
var _loc11_:Number = NaN;
|
||||||
|
var _loc14_:Number = NaN;
|
||||||
|
var _loc8_:b2Point = gPoint;
|
||||||
|
_loc12_ = param5.m_localPosition;
|
||||||
|
_loc13_ = param6.R;
|
||||||
|
_loc8_.p.x = param6.position.x + (_loc13_.col1.x * _loc12_.x + _loc13_.col2.x * _loc12_.y);
|
||||||
|
_loc8_.p.y = param6.position.y + (_loc13_.col1.y * _loc12_.x + _loc13_.col2.y * _loc12_.y);
|
||||||
|
var _loc7_:Number = DistanceGeneric(param1,param2,param3,param4,_loc8_,b2Math.b2XForm_identity);
|
||||||
|
var _loc9_:Number = param5.m_radius - 0.04;
|
||||||
|
if(_loc7_ > _loc9_)
|
||||||
|
{
|
||||||
|
_loc7_ -= _loc9_;
|
||||||
|
_loc10_ = param2.x - param1.x;
|
||||||
|
_loc11_ = param2.y - param1.y;
|
||||||
|
_loc14_ = Math.sqrt(_loc10_ * _loc10_ + _loc11_ * _loc11_);
|
||||||
|
_loc10_ /= _loc14_;
|
||||||
|
_loc11_ /= _loc14_;
|
||||||
|
param2.x -= _loc9_ * _loc10_;
|
||||||
|
param2.y -= _loc9_ * _loc11_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc7_ = 0;
|
||||||
|
param2.x = param1.x;
|
||||||
|
param2.y = param1.y;
|
||||||
|
}
|
||||||
|
return _loc7_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function Distance(param1:b2Vec2, param2:b2Vec2, param3:b2Shape, param4:b2XForm, param5:b2Shape, param6:b2XForm) : Number
|
||||||
|
{
|
||||||
|
var _loc8_:int = param3.m_type;
|
||||||
|
var _loc7_:int = param5.m_type;
|
||||||
|
if(_loc8_ == 0 && _loc7_ == 0)
|
||||||
|
{
|
||||||
|
return DistanceCC(param1,param2,param3 as b2CircleShape,param4,param5 as b2CircleShape,param6);
|
||||||
|
}
|
||||||
|
if(_loc8_ == 1 && _loc7_ == 0)
|
||||||
|
{
|
||||||
|
return DistancePC(param1,param2,param3 as b2PolygonShape,param4,param5 as b2CircleShape,param6);
|
||||||
|
}
|
||||||
|
if(_loc8_ == 0 && _loc7_ == 1)
|
||||||
|
{
|
||||||
|
return DistancePC(param2,param1,param5 as b2PolygonShape,param6,param3 as b2CircleShape,param4);
|
||||||
|
}
|
||||||
|
if(_loc8_ == 1 && _loc7_ == 1)
|
||||||
|
{
|
||||||
|
return DistanceGeneric(param1,param2,param3 as b2PolygonShape,param4,param5 as b2PolygonShape,param6);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Common.*;
|
||||||
|
import Box2D.Common.Math.*;
|
||||||
|
|
||||||
|
public class b2Manifold
|
||||||
|
{
|
||||||
|
|
||||||
|
public var points:Array;
|
||||||
|
|
||||||
|
public var normal:b2Vec2;
|
||||||
|
|
||||||
|
public var pointCount:int = 0;
|
||||||
|
|
||||||
|
public function b2Manifold()
|
||||||
|
{
|
||||||
|
var _loc1_:int = 0;
|
||||||
|
super();
|
||||||
|
points = new Array(2);
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < 2)
|
||||||
|
{
|
||||||
|
points[_loc1_] = new b2ManifoldPoint();
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
normal = new b2Vec2();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Reset() : void
|
||||||
|
{
|
||||||
|
var _loc1_:int = 0;
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < 2)
|
||||||
|
{
|
||||||
|
(points[_loc1_] as b2ManifoldPoint).Reset();
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
normal.SetZero();
|
||||||
|
pointCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Set(param1:b2Manifold) : void
|
||||||
|
{
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
pointCount = param1.pointCount;
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < 2)
|
||||||
|
{
|
||||||
|
(points[_loc2_] as b2ManifoldPoint).Set(param1.points[_loc2_]);
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
normal.SetV(param1.normal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Common.Math.b2Vec2;
|
||||||
|
|
||||||
|
public class b2ManifoldPoint
|
||||||
|
{
|
||||||
|
|
||||||
|
public var localPoint1:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var localPoint2:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var separation:Number;
|
||||||
|
|
||||||
|
public var normalImpulse:Number;
|
||||||
|
|
||||||
|
public var tangentImpulse:Number;
|
||||||
|
|
||||||
|
public var id:b2ContactID = new b2ContactID();
|
||||||
|
|
||||||
|
public function b2ManifoldPoint()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Reset() : void
|
||||||
|
{
|
||||||
|
localPoint1.SetZero();
|
||||||
|
localPoint2.SetZero();
|
||||||
|
separation = 0;
|
||||||
|
normalImpulse = 0;
|
||||||
|
tangentImpulse = 0;
|
||||||
|
id.key = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Set(param1:b2ManifoldPoint) : void
|
||||||
|
{
|
||||||
|
localPoint1.SetV(param1.localPoint1);
|
||||||
|
localPoint2.SetV(param1.localPoint2);
|
||||||
|
separation = param1.separation;
|
||||||
|
normalImpulse = param1.normalImpulse;
|
||||||
|
tangentImpulse = param1.tangentImpulse;
|
||||||
|
id.key = param1.id.key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Common.Math.b2Mat22;
|
||||||
|
import Box2D.Common.Math.b2Vec2;
|
||||||
|
|
||||||
|
public class b2OBB
|
||||||
|
{
|
||||||
|
|
||||||
|
public var R:b2Mat22 = new b2Mat22();
|
||||||
|
|
||||||
|
public var center:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var extents:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public function b2OBB()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
public class b2Pair
|
||||||
|
{
|
||||||
|
|
||||||
|
public static var b2_nullPair:uint = 65535;
|
||||||
|
|
||||||
|
public static var b2_nullProxy:uint = 65535;
|
||||||
|
|
||||||
|
public static var b2_tableCapacity:int = 4096;
|
||||||
|
|
||||||
|
public static var e_pairBuffered:uint = 1;
|
||||||
|
|
||||||
|
public static var e_pairRemoved:uint = 2;
|
||||||
|
|
||||||
|
public static var e_pairFinal:uint = 4;
|
||||||
|
|
||||||
|
public static var b2_tableMask:int = b2_tableCapacity - 1;
|
||||||
|
|
||||||
|
public var userData:* = null;
|
||||||
|
|
||||||
|
public var proxyId1:uint;
|
||||||
|
|
||||||
|
public var proxyId2:uint;
|
||||||
|
|
||||||
|
public var next:uint;
|
||||||
|
|
||||||
|
public var status:uint;
|
||||||
|
|
||||||
|
public function b2Pair()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetBuffered() : void
|
||||||
|
{
|
||||||
|
status |= e_pairBuffered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ClearBuffered() : void
|
||||||
|
{
|
||||||
|
status &= ~e_pairBuffered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function IsBuffered() : Boolean
|
||||||
|
{
|
||||||
|
return (status & e_pairBuffered) == e_pairBuffered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetRemoved() : void
|
||||||
|
{
|
||||||
|
status |= e_pairRemoved;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ClearRemoved() : void
|
||||||
|
{
|
||||||
|
status &= ~e_pairRemoved;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function IsRemoved() : Boolean
|
||||||
|
{
|
||||||
|
return (status & e_pairRemoved) == e_pairRemoved;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetFinal() : void
|
||||||
|
{
|
||||||
|
status |= e_pairFinal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function IsFinal() : Boolean
|
||||||
|
{
|
||||||
|
return (status & e_pairFinal) == e_pairFinal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
public class b2PairCallback
|
||||||
|
{
|
||||||
|
|
||||||
|
public function b2PairCallback()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function PairAdded(param1:*, param2:*) : *
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function PairRemoved(param1:*, param2:*, param3:*) : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Common.*;
|
||||||
|
import Box2D.Common.Math.*;
|
||||||
|
|
||||||
|
public class b2PairManager
|
||||||
|
{
|
||||||
|
|
||||||
|
public var m_broadPhase:b2BroadPhase;
|
||||||
|
|
||||||
|
public var m_callback:b2PairCallback;
|
||||||
|
|
||||||
|
public var m_pairs:Array;
|
||||||
|
|
||||||
|
public var m_freePair:uint;
|
||||||
|
|
||||||
|
public var m_pairCount:int;
|
||||||
|
|
||||||
|
public var m_pairBuffer:Array;
|
||||||
|
|
||||||
|
public var m_pairBufferCount:int;
|
||||||
|
|
||||||
|
public var m_hashTable:Array;
|
||||||
|
|
||||||
|
public function b2PairManager()
|
||||||
|
{
|
||||||
|
var _loc1_:* = 0;
|
||||||
|
super();
|
||||||
|
m_hashTable = new Array(b2Pair.b2_tableCapacity);
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < b2Pair.b2_tableCapacity)
|
||||||
|
{
|
||||||
|
m_hashTable[_loc1_] = b2Pair.b2_nullPair;
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
m_pairs = new Array(4096);
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < 4096)
|
||||||
|
{
|
||||||
|
m_pairs[_loc1_] = new b2Pair();
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
m_pairBuffer = new Array(4096);
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < 4096)
|
||||||
|
{
|
||||||
|
m_pairBuffer[_loc1_] = new b2BufferedPair();
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
_loc1_ = 0;
|
||||||
|
while(_loc1_ < 4096)
|
||||||
|
{
|
||||||
|
m_pairs[_loc1_].proxyId1 = b2Pair.b2_nullProxy;
|
||||||
|
m_pairs[_loc1_].proxyId2 = b2Pair.b2_nullProxy;
|
||||||
|
m_pairs[_loc1_].userData = null;
|
||||||
|
m_pairs[_loc1_].status = 0;
|
||||||
|
m_pairs[_loc1_].next = _loc1_ + 1;
|
||||||
|
_loc1_++;
|
||||||
|
}
|
||||||
|
m_pairs[4095].next = b2Pair.b2_nullPair;
|
||||||
|
m_pairCount = 0;
|
||||||
|
m_pairBufferCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function Hash(param1:uint, param2:uint) : uint
|
||||||
|
{
|
||||||
|
var _loc3_:uint = uint(param2 << 16 & 0xFFFF0000 | param1);
|
||||||
|
_loc3_ = ~_loc3_ + (_loc3_ << 15 & 0xFFFF8000);
|
||||||
|
_loc3_ ^= _loc3_ >> 12 & 0x0FFFFF;
|
||||||
|
_loc3_ += _loc3_ << 2 & 0xFFFFFFFC;
|
||||||
|
_loc3_ ^= _loc3_ >> 4 & 0x0FFFFFFF;
|
||||||
|
_loc3_ *= 2057;
|
||||||
|
return uint(_loc3_ ^ _loc3_ >> 16 & 0xFFFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function Equals(param1:b2Pair, param2:uint, param3:uint) : Boolean
|
||||||
|
{
|
||||||
|
return param1.proxyId1 == param2 && param1.proxyId2 == param3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function EqualsPair(param1:b2BufferedPair, param2:b2BufferedPair) : Boolean
|
||||||
|
{
|
||||||
|
return param1.proxyId1 == param2.proxyId1 && param1.proxyId2 == param2.proxyId2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Initialize(param1:b2BroadPhase, param2:b2PairCallback) : void
|
||||||
|
{
|
||||||
|
m_broadPhase = param1;
|
||||||
|
m_callback = param2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function AddBufferedPair(param1:int, param2:int) : void
|
||||||
|
{
|
||||||
|
var _loc3_:b2BufferedPair = null;
|
||||||
|
var _loc4_:b2Pair = AddPair(param1,param2);
|
||||||
|
if(_loc4_.IsBuffered() == false)
|
||||||
|
{
|
||||||
|
_loc4_.SetBuffered();
|
||||||
|
_loc3_ = m_pairBuffer[m_pairBufferCount];
|
||||||
|
_loc3_.proxyId1 = _loc4_.proxyId1;
|
||||||
|
_loc3_.proxyId2 = _loc4_.proxyId2;
|
||||||
|
m_pairBufferCount = m_pairBufferCount + 1;
|
||||||
|
}
|
||||||
|
_loc4_.ClearRemoved();
|
||||||
|
if(b2BroadPhase.s_validate)
|
||||||
|
{
|
||||||
|
ValidateBuffer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function RemoveBufferedPair(param1:int, param2:int) : void
|
||||||
|
{
|
||||||
|
var _loc3_:b2BufferedPair = null;
|
||||||
|
var _loc4_:b2Pair = Find(param1,param2);
|
||||||
|
if(_loc4_ == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(_loc4_.IsBuffered() == false)
|
||||||
|
{
|
||||||
|
_loc4_.SetBuffered();
|
||||||
|
_loc3_ = m_pairBuffer[m_pairBufferCount];
|
||||||
|
_loc3_.proxyId1 = _loc4_.proxyId1;
|
||||||
|
_loc3_.proxyId2 = _loc4_.proxyId2;
|
||||||
|
m_pairBufferCount = m_pairBufferCount + 1;
|
||||||
|
}
|
||||||
|
_loc4_.SetRemoved();
|
||||||
|
if(b2BroadPhase.s_validate)
|
||||||
|
{
|
||||||
|
ValidateBuffer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Commit() : void
|
||||||
|
{
|
||||||
|
var _loc1_:b2BufferedPair = null;
|
||||||
|
var _loc2_:int = 0;
|
||||||
|
var _loc6_:b2Pair = null;
|
||||||
|
var _loc4_:b2Proxy = null;
|
||||||
|
var _loc5_:b2Proxy = null;
|
||||||
|
var _loc7_:int = 0;
|
||||||
|
var _loc3_:Array = m_broadPhase.m_proxyPool;
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < m_pairBufferCount)
|
||||||
|
{
|
||||||
|
_loc1_ = m_pairBuffer[_loc2_];
|
||||||
|
_loc6_ = Find(_loc1_.proxyId1,_loc1_.proxyId2);
|
||||||
|
_loc6_.ClearBuffered();
|
||||||
|
_loc4_ = _loc3_[_loc6_.proxyId1];
|
||||||
|
_loc5_ = _loc3_[_loc6_.proxyId2];
|
||||||
|
if(_loc6_.IsRemoved())
|
||||||
|
{
|
||||||
|
if(_loc6_.IsFinal() == true)
|
||||||
|
{
|
||||||
|
m_callback.PairRemoved(_loc4_.userData,_loc5_.userData,_loc6_.userData);
|
||||||
|
}
|
||||||
|
_loc1_ = m_pairBuffer[_loc7_];
|
||||||
|
_loc1_.proxyId1 = _loc6_.proxyId1;
|
||||||
|
_loc1_.proxyId2 = _loc6_.proxyId2;
|
||||||
|
_loc7_++;
|
||||||
|
}
|
||||||
|
else if(_loc6_.IsFinal() == false)
|
||||||
|
{
|
||||||
|
_loc6_.userData = m_callback.PairAdded(_loc4_.userData,_loc5_.userData);
|
||||||
|
_loc6_.SetFinal();
|
||||||
|
}
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
_loc2_ = 0;
|
||||||
|
while(_loc2_ < _loc7_)
|
||||||
|
{
|
||||||
|
_loc1_ = m_pairBuffer[_loc2_];
|
||||||
|
RemovePair(_loc1_.proxyId1,_loc1_.proxyId2);
|
||||||
|
_loc2_++;
|
||||||
|
}
|
||||||
|
m_pairBufferCount = 0;
|
||||||
|
if(b2BroadPhase.s_validate)
|
||||||
|
{
|
||||||
|
ValidateTable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function AddPair(param1:uint, param2:uint) : b2Pair
|
||||||
|
{
|
||||||
|
var _loc3_:* = 0;
|
||||||
|
var _loc6_:b2Pair = null;
|
||||||
|
if(param1 > param2)
|
||||||
|
{
|
||||||
|
_loc3_ = param1;
|
||||||
|
param1 = param2;
|
||||||
|
param2 = _loc3_;
|
||||||
|
}
|
||||||
|
var _loc5_:uint = uint(Hash(param1,param2) & b2Pair.b2_tableMask);
|
||||||
|
_loc6_ = _loc6_ = FindHash(param1,param2,_loc5_);
|
||||||
|
if(_loc6_ != null)
|
||||||
|
{
|
||||||
|
return _loc6_;
|
||||||
|
}
|
||||||
|
var _loc4_:uint = m_freePair;
|
||||||
|
_loc6_ = m_pairs[_loc4_];
|
||||||
|
m_freePair = _loc6_.next;
|
||||||
|
_loc6_.proxyId1 = param1;
|
||||||
|
_loc6_.proxyId2 = param2;
|
||||||
|
_loc6_.status = 0;
|
||||||
|
_loc6_.userData = null;
|
||||||
|
_loc6_.next = m_hashTable[_loc5_];
|
||||||
|
m_hashTable[_loc5_] = _loc4_;
|
||||||
|
m_pairCount = m_pairCount + 1;
|
||||||
|
return _loc6_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function RemovePair(param1:uint, param2:uint) : *
|
||||||
|
{
|
||||||
|
var _loc8_:b2Pair = null;
|
||||||
|
var _loc4_:* = 0;
|
||||||
|
var _loc6_:* = 0;
|
||||||
|
var _loc5_:* = undefined;
|
||||||
|
if(param1 > param2)
|
||||||
|
{
|
||||||
|
_loc4_ = param1;
|
||||||
|
param1 = param2;
|
||||||
|
param2 = _loc4_;
|
||||||
|
}
|
||||||
|
var _loc9_:uint = uint(Hash(param1,param2) & b2Pair.b2_tableMask);
|
||||||
|
var _loc3_:uint = uint(m_hashTable[_loc9_]);
|
||||||
|
var _loc7_:b2Pair = null;
|
||||||
|
while(_loc3_ != b2Pair.b2_nullPair)
|
||||||
|
{
|
||||||
|
if(Equals(m_pairs[_loc3_],param1,param2))
|
||||||
|
{
|
||||||
|
_loc6_ = _loc3_;
|
||||||
|
_loc8_ = m_pairs[_loc3_];
|
||||||
|
if(_loc7_)
|
||||||
|
{
|
||||||
|
_loc7_.next = _loc8_.next;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_hashTable[_loc9_] = _loc8_.next;
|
||||||
|
}
|
||||||
|
_loc8_ = m_pairs[_loc6_];
|
||||||
|
_loc5_ = _loc8_.userData;
|
||||||
|
_loc8_.next = m_freePair;
|
||||||
|
_loc8_.proxyId1 = b2Pair.b2_nullProxy;
|
||||||
|
_loc8_.proxyId2 = b2Pair.b2_nullProxy;
|
||||||
|
_loc8_.userData = null;
|
||||||
|
_loc8_.status = 0;
|
||||||
|
m_freePair = _loc6_;
|
||||||
|
m_pairCount = m_pairCount - 1;
|
||||||
|
return _loc5_;
|
||||||
|
}
|
||||||
|
_loc7_ = m_pairs[_loc3_];
|
||||||
|
_loc3_ = _loc7_.next;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function Find(param1:uint, param2:uint) : b2Pair
|
||||||
|
{
|
||||||
|
var _loc3_:* = 0;
|
||||||
|
if(param1 > param2)
|
||||||
|
{
|
||||||
|
_loc3_ = param1;
|
||||||
|
param1 = param2;
|
||||||
|
param2 = _loc3_;
|
||||||
|
}
|
||||||
|
var _loc4_:uint = uint(Hash(param1,param2) & b2Pair.b2_tableMask);
|
||||||
|
return FindHash(param1,param2,_loc4_);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function FindHash(param1:uint, param2:uint, param3:uint) : b2Pair
|
||||||
|
{
|
||||||
|
var _loc5_:b2Pair = null;
|
||||||
|
var _loc4_:uint = uint(m_hashTable[param3]);
|
||||||
|
_loc5_ = m_pairs[_loc4_];
|
||||||
|
while(_loc4_ != b2Pair.b2_nullPair && Equals(_loc5_,param1,param2) == false)
|
||||||
|
{
|
||||||
|
_loc4_ = _loc5_.next;
|
||||||
|
_loc5_ = m_pairs[_loc4_];
|
||||||
|
}
|
||||||
|
if(_loc4_ == b2Pair.b2_nullPair)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return _loc5_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function ValidateBuffer() : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private function ValidateTable() : void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Common.Math.b2Vec2;
|
||||||
|
import Box2D.Common.Math.b2XForm;
|
||||||
|
|
||||||
|
public class b2Point
|
||||||
|
{
|
||||||
|
|
||||||
|
public var p:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public function b2Point()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Support(param1:b2XForm, param2:Number, param3:Number) : b2Vec2
|
||||||
|
{
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetFirstVertex(param1:b2XForm) : b2Vec2
|
||||||
|
{
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
public class b2Proxy
|
||||||
|
{
|
||||||
|
|
||||||
|
public var lowerBounds:Array = [0,0];
|
||||||
|
|
||||||
|
public var upperBounds:Array = [0,0];
|
||||||
|
|
||||||
|
public var overlapCount:uint;
|
||||||
|
|
||||||
|
public var timeStamp:uint;
|
||||||
|
|
||||||
|
public var userData:* = null;
|
||||||
|
|
||||||
|
public function b2Proxy()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetNext() : uint
|
||||||
|
{
|
||||||
|
return lowerBounds[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetNext(param1:uint) : void
|
||||||
|
{
|
||||||
|
lowerBounds[0] = param1 & 0xFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function IsValid() : Boolean
|
||||||
|
{
|
||||||
|
return overlapCount != 65535;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Common.*;
|
||||||
|
import Box2D.Common.Math.*;
|
||||||
|
|
||||||
|
public class b2Segment
|
||||||
|
{
|
||||||
|
|
||||||
|
public var p1:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var p2:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public function b2Segment()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function TestSegment(param1:Array, param2:b2Vec2, param3:b2Segment, param4:Number) : Boolean
|
||||||
|
{
|
||||||
|
var _loc16_:Number = NaN;
|
||||||
|
var _loc17_:Number = NaN;
|
||||||
|
var _loc5_:Number = NaN;
|
||||||
|
var _loc11_:Number = NaN;
|
||||||
|
var _loc14_:Number = NaN;
|
||||||
|
var _loc12_:b2Vec2 = param3.p1;
|
||||||
|
var _loc6_:Number = param3.p2.x - _loc12_.x;
|
||||||
|
var _loc7_:Number = param3.p2.y - _loc12_.y;
|
||||||
|
var _loc13_:Number = p2.x - p1.x;
|
||||||
|
var _loc15_:Number;
|
||||||
|
var _loc9_:Number = _loc15_ = p2.y - p1.y;
|
||||||
|
var _loc10_:Number = -_loc13_;
|
||||||
|
var _loc8_:Number = 100 * Number.MIN_VALUE;
|
||||||
|
var _loc18_:Number = -(_loc6_ * _loc9_ + _loc7_ * _loc10_);
|
||||||
|
if(_loc18_ > _loc8_)
|
||||||
|
{
|
||||||
|
_loc16_ = _loc12_.x - p1.x;
|
||||||
|
_loc17_ = _loc12_.y - p1.y;
|
||||||
|
_loc5_ = _loc16_ * _loc9_ + _loc17_ * _loc10_;
|
||||||
|
if(0 <= _loc5_ && _loc5_ <= param4 * _loc18_)
|
||||||
|
{
|
||||||
|
_loc11_ = -_loc6_ * _loc17_ + _loc7_ * _loc16_;
|
||||||
|
if(-_loc8_ * _loc18_ <= _loc11_ && _loc11_ <= _loc18_ * (1 + _loc8_))
|
||||||
|
{
|
||||||
|
_loc5_ /= _loc18_;
|
||||||
|
_loc14_ = Math.sqrt(_loc9_ * _loc9_ + _loc10_ * _loc10_);
|
||||||
|
_loc9_ /= _loc14_;
|
||||||
|
_loc10_ /= _loc14_;
|
||||||
|
param1[0] = _loc5_;
|
||||||
|
param2.Set(_loc9_,_loc10_);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package Box2D.Collision
|
||||||
|
{
|
||||||
|
import Box2D.Collision.Shapes.b2Shape;
|
||||||
|
import Box2D.Common.Math.b2Sweep;
|
||||||
|
import Box2D.Common.Math.b2Vec2;
|
||||||
|
import Box2D.Common.Math.b2XForm;
|
||||||
|
|
||||||
|
public class b2TimeOfImpact
|
||||||
|
{
|
||||||
|
|
||||||
|
public static var s_p1:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public static var s_p2:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public static var s_xf1:b2XForm = new b2XForm();
|
||||||
|
|
||||||
|
public static var s_xf2:b2XForm = new b2XForm();
|
||||||
|
|
||||||
|
public function b2TimeOfImpact()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function TimeOfImpact(param1:b2Shape, param2:b2Sweep, param3:b2Shape, param4:b2Sweep) : Number
|
||||||
|
{
|
||||||
|
var _loc11_:Number = NaN;
|
||||||
|
var _loc14_:Number = NaN;
|
||||||
|
var _loc26_:Number = NaN;
|
||||||
|
var _loc10_:b2XForm = null;
|
||||||
|
var _loc13_:b2XForm = null;
|
||||||
|
var _loc27_:Number = NaN;
|
||||||
|
var _loc15_:Number = NaN;
|
||||||
|
var _loc25_:Number = NaN;
|
||||||
|
var _loc24_:Number = NaN;
|
||||||
|
var _loc30_:Number = param1.m_sweepRadius;
|
||||||
|
var _loc5_:Number = param3.m_sweepRadius;
|
||||||
|
var _loc28_:Number = param2.t0;
|
||||||
|
var _loc29_:Number = param2.c.x - param2.c0.x;
|
||||||
|
var _loc31_:Number = param2.c.y - param2.c0.y;
|
||||||
|
var _loc18_:Number = param4.c.x - param4.c0.x;
|
||||||
|
var _loc17_:Number = param4.c.y - param4.c0.y;
|
||||||
|
var _loc21_:Number = param2.a - param2.a0;
|
||||||
|
var _loc20_:Number = param4.a - param4.a0;
|
||||||
|
var _loc16_:Number = 0;
|
||||||
|
var _loc6_:b2Vec2 = s_p1;
|
||||||
|
var _loc8_:b2Vec2 = s_p2;
|
||||||
|
var _loc19_:int = 20;
|
||||||
|
var _loc22_:int = 0;
|
||||||
|
var _loc7_:Number = 0;
|
||||||
|
var _loc9_:Number = 0;
|
||||||
|
var _loc12_:Number = 0;
|
||||||
|
var _loc23_:Number = 0;
|
||||||
|
while(true)
|
||||||
|
{
|
||||||
|
_loc26_ = (1 - _loc16_) * _loc28_ + _loc16_;
|
||||||
|
_loc10_ = s_xf1;
|
||||||
|
_loc13_ = s_xf2;
|
||||||
|
param2.GetXForm(_loc10_,_loc26_);
|
||||||
|
param4.GetXForm(_loc13_,_loc26_);
|
||||||
|
_loc12_ = b2Distance.Distance(_loc6_,_loc8_,param1,_loc10_,param3,_loc13_);
|
||||||
|
if(_loc22_ == 0)
|
||||||
|
{
|
||||||
|
if(_loc12_ > 2 * 0.04)
|
||||||
|
{
|
||||||
|
_loc23_ = 1.5 * 0.04;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc11_ = 0.05 * 0.04;
|
||||||
|
_loc14_ = _loc12_ - 0.5 * 0.04;
|
||||||
|
_loc23_ = _loc11_ > _loc14_ ? _loc11_ : _loc14_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_loc12_ - _loc23_ < 0.05 * 0.04 || _loc22_ == _loc19_)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc7_ = _loc8_.x - _loc6_.x;
|
||||||
|
_loc9_ = _loc8_.y - _loc6_.y;
|
||||||
|
_loc27_ = Math.sqrt(_loc7_ * _loc7_ + _loc9_ * _loc9_);
|
||||||
|
_loc7_ /= _loc27_;
|
||||||
|
_loc9_ /= _loc27_;
|
||||||
|
_loc15_ = _loc7_ * (_loc29_ - _loc18_) + _loc9_ * (_loc31_ - _loc17_) + (_loc21_ < 0 ? -_loc21_ : _loc21_) * _loc30_ + (_loc20_ < 0 ? -_loc20_ : _loc20_) * _loc5_;
|
||||||
|
if(_loc15_ == 0)
|
||||||
|
{
|
||||||
|
_loc16_ = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc25_ = (_loc12_ - _loc23_) / _loc15_;
|
||||||
|
_loc24_ = _loc16_ + _loc25_;
|
||||||
|
if(_loc24_ < 0 || 1 < _loc24_)
|
||||||
|
{
|
||||||
|
_loc16_ = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(_loc24_ < (1 + 100 * Number.MIN_VALUE) * _loc16_)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_loc16_ = _loc24_;
|
||||||
|
_loc22_++;
|
||||||
|
}
|
||||||
|
return _loc16_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
package Box2D.Common.Math
|
||||||
|
{
|
||||||
|
public class b2Mat22
|
||||||
|
{
|
||||||
|
|
||||||
|
public var col1:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var col2:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public function b2Mat22(param1:Number = 0, param2:b2Vec2 = null, param3:b2Vec2 = null)
|
||||||
|
{
|
||||||
|
var _loc4_:Number = NaN;
|
||||||
|
var _loc5_:Number = NaN;
|
||||||
|
super();
|
||||||
|
if(param2 != null && param3 != null)
|
||||||
|
{
|
||||||
|
col1.SetV(param2);
|
||||||
|
col2.SetV(param3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_loc4_ = Math.cos(param1);
|
||||||
|
_loc5_ = Math.sin(param1);
|
||||||
|
col1.x = _loc4_;
|
||||||
|
col2.x = -_loc5_;
|
||||||
|
col1.y = _loc5_;
|
||||||
|
col2.y = _loc4_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Set(param1:Number) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = Math.cos(param1);
|
||||||
|
var _loc3_:Number = Math.sin(param1);
|
||||||
|
col1.x = _loc2_;
|
||||||
|
col2.x = -_loc3_;
|
||||||
|
col1.y = _loc3_;
|
||||||
|
col2.y = _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetVV(param1:b2Vec2, param2:b2Vec2) : void
|
||||||
|
{
|
||||||
|
col1.SetV(param1);
|
||||||
|
col2.SetV(param2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Copy() : b2Mat22
|
||||||
|
{
|
||||||
|
return new b2Mat22(0,col1,col2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetM(param1:b2Mat22) : void
|
||||||
|
{
|
||||||
|
col1.SetV(param1.col1);
|
||||||
|
col2.SetV(param1.col2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function AddM(param1:b2Mat22) : void
|
||||||
|
{
|
||||||
|
col1.x += param1.col1.x;
|
||||||
|
col1.y += param1.col1.y;
|
||||||
|
col2.x += param1.col2.x;
|
||||||
|
col2.y += param1.col2.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetIdentity() : void
|
||||||
|
{
|
||||||
|
col1.x = 1;
|
||||||
|
col2.x = 0;
|
||||||
|
col1.y = 0;
|
||||||
|
col2.y = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetZero() : void
|
||||||
|
{
|
||||||
|
col1.x = 0;
|
||||||
|
col2.x = 0;
|
||||||
|
col1.y = 0;
|
||||||
|
col2.y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetAngle() : Number
|
||||||
|
{
|
||||||
|
return Math.atan2(col1.y,col1.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Invert(param1:b2Mat22) : b2Mat22
|
||||||
|
{
|
||||||
|
var _loc2_:Number = col1.x;
|
||||||
|
var _loc3_:Number = col2.x;
|
||||||
|
var _loc5_:Number = col1.y;
|
||||||
|
var _loc6_:Number = col2.y;
|
||||||
|
var _loc4_:Number = _loc2_ * _loc6_ - _loc3_ * _loc5_;
|
||||||
|
_loc4_ = 1 / _loc4_;
|
||||||
|
param1.col1.x = _loc4_ * _loc6_;
|
||||||
|
param1.col2.x = -_loc4_ * _loc3_;
|
||||||
|
param1.col1.y = -_loc4_ * _loc5_;
|
||||||
|
param1.col2.y = _loc4_ * _loc2_;
|
||||||
|
return param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Solve(param1:b2Vec2, param2:Number, param3:Number) : b2Vec2
|
||||||
|
{
|
||||||
|
var _loc4_:Number = col1.x;
|
||||||
|
var _loc8_:Number = col2.x;
|
||||||
|
var _loc6_:Number = col1.y;
|
||||||
|
var _loc5_:Number = col2.y;
|
||||||
|
var _loc7_:Number = _loc4_ * _loc5_ - _loc8_ * _loc6_;
|
||||||
|
_loc7_ = 1 / _loc7_;
|
||||||
|
param1.x = _loc7_ * (_loc5_ * param2 - _loc8_ * param3);
|
||||||
|
param1.y = _loc7_ * (_loc4_ * param3 - _loc6_ * param2);
|
||||||
|
return param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Abs() : void
|
||||||
|
{
|
||||||
|
col1.Abs();
|
||||||
|
col2.Abs();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,194 @@
|
|||||||
|
package Box2D.Common.Math
|
||||||
|
{
|
||||||
|
public class b2Math
|
||||||
|
{
|
||||||
|
|
||||||
|
public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0,0);
|
||||||
|
|
||||||
|
public static const b2Mat22_identity:b2Mat22 = new b2Mat22(0,new b2Vec2(1,0),new b2Vec2(0,1));
|
||||||
|
|
||||||
|
public static const b2XForm_identity:b2XForm = new b2XForm(b2Vec2_zero,b2Mat22_identity);
|
||||||
|
|
||||||
|
public function b2Math()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2IsValid(param1:Number) : Boolean
|
||||||
|
{
|
||||||
|
return isFinite(param1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2Dot(param1:b2Vec2, param2:b2Vec2) : Number
|
||||||
|
{
|
||||||
|
return param1.x * param2.x + param1.y * param2.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2CrossVV(param1:b2Vec2, param2:b2Vec2) : Number
|
||||||
|
{
|
||||||
|
return param1.x * param2.y - param1.y * param2.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2CrossVF(param1:b2Vec2, param2:Number) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(param2 * param1.y,-param2 * param1.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2CrossFV(param1:Number, param2:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(-param1 * param2.y,param1 * param2.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2MulMV(param1:b2Mat22, param2:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(param1.col1.x * param2.x + param1.col2.x * param2.y,param1.col1.y * param2.x + param1.col2.y * param2.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2MulTMV(param1:b2Mat22, param2:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(b2Dot(param2,param1.col1),b2Dot(param2,param1.col2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2MulX(param1:b2XForm, param2:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
var _loc3_:b2Vec2 = b2MulMV(param1.R,param2);
|
||||||
|
_loc3_.x += param1.position.x;
|
||||||
|
_loc3_.y += param1.position.y;
|
||||||
|
return _loc3_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2MulXT(param1:b2XForm, param2:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
var _loc3_:b2Vec2 = SubtractVV(param2,param1.position);
|
||||||
|
var _loc4_:Number = _loc3_.x * param1.R.col1.x + _loc3_.y * param1.R.col1.y;
|
||||||
|
_loc3_.y = _loc3_.x * param1.R.col2.x + _loc3_.y * param1.R.col2.y;
|
||||||
|
_loc3_.x = _loc4_;
|
||||||
|
return _loc3_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function AddVV(param1:b2Vec2, param2:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(param1.x + param2.x,param1.y + param2.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function SubtractVV(param1:b2Vec2, param2:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(param1.x - param2.x,param1.y - param2.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2Distance(param1:b2Vec2, param2:b2Vec2) : Number
|
||||||
|
{
|
||||||
|
var _loc3_:Number = param1.x - param2.x;
|
||||||
|
var _loc4_:Number = param1.y - param2.y;
|
||||||
|
return Math.sqrt(_loc3_ * _loc3_ + _loc4_ * _loc4_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2DistanceSquared(param1:b2Vec2, param2:b2Vec2) : Number
|
||||||
|
{
|
||||||
|
var _loc3_:Number = param1.x - param2.x;
|
||||||
|
var _loc4_:Number = param1.y - param2.y;
|
||||||
|
return _loc3_ * _loc3_ + _loc4_ * _loc4_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function MulFV(param1:Number, param2:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(param1 * param2.x,param1 * param2.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function AddMM(param1:b2Mat22, param2:b2Mat22) : b2Mat22
|
||||||
|
{
|
||||||
|
return new b2Mat22(0,AddVV(param1.col1,param2.col1),AddVV(param1.col2,param2.col2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2MulMM(param1:b2Mat22, param2:b2Mat22) : b2Mat22
|
||||||
|
{
|
||||||
|
return new b2Mat22(0,b2MulMV(param1,param2.col1),b2MulMV(param1,param2.col2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2MulTMM(param1:b2Mat22, param2:b2Mat22) : b2Mat22
|
||||||
|
{
|
||||||
|
var _loc4_:b2Vec2 = new b2Vec2(b2Dot(param1.col1,param2.col1),b2Dot(param1.col2,param2.col1));
|
||||||
|
var _loc5_:b2Vec2 = new b2Vec2(b2Dot(param1.col1,param2.col2),b2Dot(param1.col2,param2.col2));
|
||||||
|
return new b2Mat22(0,_loc4_,_loc5_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2Abs(param1:Number) : Number
|
||||||
|
{
|
||||||
|
return param1 > 0 ? param1 : -param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2AbsV(param1:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(b2Abs(param1.x),b2Abs(param1.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2AbsM(param1:b2Mat22) : b2Mat22
|
||||||
|
{
|
||||||
|
return new b2Mat22(0,b2AbsV(param1.col1),b2AbsV(param1.col2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2Min(param1:Number, param2:Number) : Number
|
||||||
|
{
|
||||||
|
return param1 < param2 ? param1 : param2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2MinV(param1:b2Vec2, param2:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(b2Min(param1.x,param2.x),b2Min(param1.y,param2.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2Max(param1:Number, param2:Number) : Number
|
||||||
|
{
|
||||||
|
return param1 > param2 ? param1 : param2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2MaxV(param1:b2Vec2, param2:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(b2Max(param1.x,param2.x),b2Max(param1.y,param2.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2Clamp(param1:Number, param2:Number, param3:Number) : Number
|
||||||
|
{
|
||||||
|
return b2Max(param2,b2Min(param1,param3));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2ClampV(param1:b2Vec2, param2:b2Vec2, param3:b2Vec2) : b2Vec2
|
||||||
|
{
|
||||||
|
return b2MaxV(param2,b2MinV(param1,param3));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2Swap(param1:Array, param2:Array) : void
|
||||||
|
{
|
||||||
|
var _loc3_:* = param1[0];
|
||||||
|
param1[0] = param2[0];
|
||||||
|
param2[0] = _loc3_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2Random() : Number
|
||||||
|
{
|
||||||
|
return Math.random() * 2 - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2RandomRange(param1:Number, param2:Number) : Number
|
||||||
|
{
|
||||||
|
var _loc3_:Number = Math.random();
|
||||||
|
return (param2 - param1) * _loc3_ + param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2NextPowerOfTwo(param1:uint) : uint
|
||||||
|
{
|
||||||
|
param1 |= param1 >> 1 & 0x7FFFFFFF;
|
||||||
|
param1 |= param1 >> 2 & 0x3FFFFFFF;
|
||||||
|
param1 |= param1 >> 4 & 0x0FFFFFFF;
|
||||||
|
param1 |= param1 >> 8 & 0xFFFFFF;
|
||||||
|
param1 |= param1 >> 16 & 0xFFFF;
|
||||||
|
return param1 + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2IsPowerOfTwo(param1:uint) : Boolean
|
||||||
|
{
|
||||||
|
return param1 > 0 && (param1 & param1 - 1) == 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package Box2D.Common.Math
|
||||||
|
{
|
||||||
|
public class b2Sweep
|
||||||
|
{
|
||||||
|
|
||||||
|
public var localCenter:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var c0:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var c:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var a0:Number;
|
||||||
|
|
||||||
|
public var a:Number;
|
||||||
|
|
||||||
|
public var t0:Number;
|
||||||
|
|
||||||
|
public function b2Sweep()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetXForm(param1:b2XForm, param2:Number) : void
|
||||||
|
{
|
||||||
|
var _loc3_:Number = NaN;
|
||||||
|
var _loc4_:Number = NaN;
|
||||||
|
if(1 - t0 > Number.MIN_VALUE)
|
||||||
|
{
|
||||||
|
_loc3_ = (param2 - t0) / (1 - t0);
|
||||||
|
param1.position.x = (1 - _loc3_) * c0.x + _loc3_ * c.x;
|
||||||
|
param1.position.y = (1 - _loc3_) * c0.y + _loc3_ * c.y;
|
||||||
|
_loc4_ = (1 - _loc3_) * a0 + _loc3_ * a;
|
||||||
|
param1.R.Set(_loc4_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
param1.position.SetV(c);
|
||||||
|
param1.R.Set(a);
|
||||||
|
}
|
||||||
|
var _loc5_:b2Mat22 = param1.R;
|
||||||
|
param1.position.x -= _loc5_.col1.x * localCenter.x + _loc5_.col2.x * localCenter.y;
|
||||||
|
param1.position.y -= _loc5_.col1.y * localCenter.x + _loc5_.col2.y * localCenter.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Advance(param1:Number) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = NaN;
|
||||||
|
if(t0 < param1 && 1 - t0 > Number.MIN_VALUE)
|
||||||
|
{
|
||||||
|
_loc2_ = (param1 - t0) / (1 - t0);
|
||||||
|
c0.x = (1 - _loc2_) * c0.x + _loc2_ * c.x;
|
||||||
|
c0.y = (1 - _loc2_) * c0.y + _loc2_ * c.y;
|
||||||
|
a0 = (1 - _loc2_) * a0 + _loc2_ * a;
|
||||||
|
t0 = param1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
package Box2D.Common.Math
|
||||||
|
{
|
||||||
|
public class b2Vec2
|
||||||
|
{
|
||||||
|
|
||||||
|
public var x:Number;
|
||||||
|
|
||||||
|
public var y:Number;
|
||||||
|
|
||||||
|
public function b2Vec2(param1:Number = 0, param2:Number = 0)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
x = param1;
|
||||||
|
y = param2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function Make(param1:Number, param2:Number) : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(param1,param2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetZero() : void
|
||||||
|
{
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Set(param1:Number = 0, param2:Number = 0) : void
|
||||||
|
{
|
||||||
|
x = param1;
|
||||||
|
y = param2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetV(param1:b2Vec2) : void
|
||||||
|
{
|
||||||
|
x = param1.x;
|
||||||
|
y = param1.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Negative() : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(-x,-y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Copy() : b2Vec2
|
||||||
|
{
|
||||||
|
return new b2Vec2(x,y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Add(param1:b2Vec2) : void
|
||||||
|
{
|
||||||
|
x += param1.x;
|
||||||
|
y += param1.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Subtract(param1:b2Vec2) : void
|
||||||
|
{
|
||||||
|
x -= param1.x;
|
||||||
|
y -= param1.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Multiply(param1:Number) : void
|
||||||
|
{
|
||||||
|
x *= param1;
|
||||||
|
y *= param1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function MulM(param1:b2Mat22) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = x;
|
||||||
|
x = param1.col1.x * _loc2_ + param1.col2.x * y;
|
||||||
|
y = param1.col1.y * _loc2_ + param1.col2.y * y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function MulTM(param1:b2Mat22) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = b2Math.b2Dot(this,param1.col1);
|
||||||
|
y = b2Math.b2Dot(this,param1.col2);
|
||||||
|
x = _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function CrossVF(param1:Number) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = x;
|
||||||
|
x = param1 * y;
|
||||||
|
y = -param1 * _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function CrossFV(param1:Number) : void
|
||||||
|
{
|
||||||
|
var _loc2_:Number = x;
|
||||||
|
x = -param1 * y;
|
||||||
|
y = param1 * _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function MinV(param1:b2Vec2) : void
|
||||||
|
{
|
||||||
|
x = x < param1.x ? x : param1.x;
|
||||||
|
y = y < param1.y ? y : param1.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function MaxV(param1:b2Vec2) : void
|
||||||
|
{
|
||||||
|
x = x > param1.x ? x : param1.x;
|
||||||
|
y = y > param1.y ? y : param1.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Abs() : void
|
||||||
|
{
|
||||||
|
if(x < 0)
|
||||||
|
{
|
||||||
|
x = -x;
|
||||||
|
}
|
||||||
|
if(y < 0)
|
||||||
|
{
|
||||||
|
y = -y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Length() : Number
|
||||||
|
{
|
||||||
|
return Math.sqrt(x * x + y * y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function LengthSquared() : Number
|
||||||
|
{
|
||||||
|
return x * x + y * y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Normalize() : Number
|
||||||
|
{
|
||||||
|
var _loc2_:Number = Math.sqrt(x * x + y * y);
|
||||||
|
if(_loc2_ < Number.MIN_VALUE)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
var _loc1_:Number = 1 / _loc2_;
|
||||||
|
x *= _loc1_;
|
||||||
|
y *= _loc1_;
|
||||||
|
return _loc2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function IsValid() : Boolean
|
||||||
|
{
|
||||||
|
return b2Math.b2IsValid(x) && b2Math.b2IsValid(y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package Box2D.Common.Math
|
||||||
|
{
|
||||||
|
public class b2XForm
|
||||||
|
{
|
||||||
|
|
||||||
|
public var position:b2Vec2 = new b2Vec2();
|
||||||
|
|
||||||
|
public var R:b2Mat22 = new b2Mat22();
|
||||||
|
|
||||||
|
public function b2XForm(param1:b2Vec2 = null, param2:b2Mat22 = null)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
if(param1)
|
||||||
|
{
|
||||||
|
position.SetV(param1);
|
||||||
|
R.SetM(param2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Initialize(param1:b2Vec2, param2:b2Mat22) : void
|
||||||
|
{
|
||||||
|
position.SetV(param1);
|
||||||
|
R.SetM(param2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetIdentity() : void
|
||||||
|
{
|
||||||
|
position.SetZero();
|
||||||
|
R.SetIdentity();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Set(param1:b2XForm) : void
|
||||||
|
{
|
||||||
|
position.SetV(param1.position);
|
||||||
|
R.SetM(param1.R);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package Box2D.Common
|
||||||
|
{
|
||||||
|
import Box2D.Common.Math.b2Math;
|
||||||
|
|
||||||
|
public class b2Color
|
||||||
|
{
|
||||||
|
|
||||||
|
private var _r:uint = 0;
|
||||||
|
|
||||||
|
private var _g:uint = 0;
|
||||||
|
|
||||||
|
private var _b:uint = 0;
|
||||||
|
|
||||||
|
public function b2Color(param1:Number, param2:Number, param3:Number)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
_r = 255 * b2Math.b2Clamp(param1,0,1);
|
||||||
|
_g = 255 * b2Math.b2Clamp(param2,0,1);
|
||||||
|
_b = 255 * b2Math.b2Clamp(param3,0,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Set(param1:Number, param2:Number, param3:Number) : void
|
||||||
|
{
|
||||||
|
_r = 255 * b2Math.b2Clamp(param1,0,1);
|
||||||
|
_g = 255 * b2Math.b2Clamp(param2,0,1);
|
||||||
|
_b = 255 * b2Math.b2Clamp(param3,0,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set r(param1:Number) : void
|
||||||
|
{
|
||||||
|
_r = 255 * b2Math.b2Clamp(param1,0,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set g(param1:Number) : void
|
||||||
|
{
|
||||||
|
_g = 255 * b2Math.b2Clamp(param1,0,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set b(param1:Number) : void
|
||||||
|
{
|
||||||
|
_b = 255 * b2Math.b2Clamp(param1,0,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get color() : uint
|
||||||
|
{
|
||||||
|
return _r | _g << 8 | _b << 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package Box2D.Common
|
||||||
|
{
|
||||||
|
public class b2Settings
|
||||||
|
{
|
||||||
|
|
||||||
|
public static const USHRT_MAX:int = 65535;
|
||||||
|
|
||||||
|
public static const b2_pi:Number = 3.141592653589793;
|
||||||
|
|
||||||
|
public static const b2_maxManifoldPoints:int = 2;
|
||||||
|
|
||||||
|
public static const b2_maxPolygonVertices:int = 8;
|
||||||
|
|
||||||
|
public static const b2_maxProxies:int = 512;
|
||||||
|
|
||||||
|
public static const b2_maxPairs:int = 4096;
|
||||||
|
|
||||||
|
public static const b2_linearSlop:Number = 0.005;
|
||||||
|
|
||||||
|
public static const b2_angularSlop:Number = 0.03490658503988659;
|
||||||
|
|
||||||
|
public static const b2_toiSlop:Number = 0.04;
|
||||||
|
|
||||||
|
public static const b2_maxTOIContactsPerIsland:int = 32;
|
||||||
|
|
||||||
|
public static const b2_velocityThreshold:Number = 1;
|
||||||
|
|
||||||
|
public static const b2_maxLinearCorrection:Number = 0.2;
|
||||||
|
|
||||||
|
public static const b2_maxAngularCorrection:Number = 0.13962634015954636;
|
||||||
|
|
||||||
|
public static const b2_maxLinearVelocity:Number = 200;
|
||||||
|
|
||||||
|
public static const b2_maxLinearVelocitySquared:Number = 40000;
|
||||||
|
|
||||||
|
public static const b2_maxAngularVelocity:Number = 250;
|
||||||
|
|
||||||
|
public static const b2_maxAngularVelocitySquared:Number = 62500;
|
||||||
|
|
||||||
|
public static const b2_contactBaumgarte:Number = 0.2;
|
||||||
|
|
||||||
|
public static const b2_timeToSleep:Number = 0.5;
|
||||||
|
|
||||||
|
public static const b2_linearSleepTolerance:Number = 0.01;
|
||||||
|
|
||||||
|
public static const b2_angularSleepTolerance:Number = 0.011111111111111112;
|
||||||
|
|
||||||
|
public function b2Settings()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function b2Assert(param1:Boolean) : void
|
||||||
|
{
|
||||||
|
var _loc2_:* = null;
|
||||||
|
if(!param1)
|
||||||
|
{
|
||||||
|
_loc2_.x++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loaded 100 of 7925 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user