diff --git a/config.js b/config.js index 1d4425b..9768f79 100644 --- a/config.js +++ b/config.js @@ -132,7 +132,9 @@ module.exports = { // 41: the game's text says "Burrow" where it said Animal Jam. // 48: the item giver (the item finder renamed) with previews and hex colours; // 49 and 50: its link to a colour picker. - buildVersion: env.AJ_BUILD_VERSION || "60", + // 61: the Owner, Moderator and Verified name tag badges seen by everyone. + // 62: "Custom pictures" in the settings menu, to hide players' item pictures. + buildVersion: env.AJ_BUILD_VERSION || "62", // what the official CDN is asked for; not ours to change. upstreamBuildVersion: "3", @@ -273,11 +275,9 @@ module.exports = { // can switch in the settings menu (gui.ServerSelector). the game names // world N after the Nth name of its own list (551 Aldan, 552 Congo..., // generic list 16), so the names here are only for the panels and logs. - // AJ_WORLDS: how many. A local server starts with one shared world so two - // players in the same land can always see one another; set AJ_WORLDS=2 or - // more to opt into separate copies of every land. + // AJ_WORLDS: how many (the tests' is one). shards: ["Aldan", "Congo", "Draa", "Grande", "Kama", "Nile", "Pecos", "Ramu", "Tigris", "Zambezi"] - .slice(0, Math.min(10, Math.max(1, Number(env.AJ_WORLDS) || 1))).map((name, i) => ({id: i + 1, name})), + .slice(0, Math.min(10, Math.max(1, Number(env.AJ_WORLDS) || 2))).map((name, i) => ({id: i + 1, name})), maxUsersPerRoom: 40, // everything in every shop for nothing (AJ_FREE_SHOPS=1). off unless // asked for: what the game's shops make of a price of 0 has not been seen. diff --git a/lib/badges.js b/lib/badges.js index 2202b8d..438fbe6 100644 --- a/lib/badges.js +++ b/lib/badges.js @@ -33,7 +33,9 @@ const cdn = require("./cdn.js"); // there are no more than a hundred (lib/accounts.js); the admin may give // it and take it away like any other. -// in the order they are listed and drawn. +// in the order they are listed and drawn. the Verified, Owner and Moderator +// name tags show their badge to everyone, not only to buddies: their def ids +// are in PUBLIC_BADGE_IDS of swf-src/AvatarWorldView.as. const BADGES = [ // first, so its tick comes straight after the name, as on other sites. {id: "verified", label: "Verified", tag: {def: 76, media: 20014, bit: 21}}, diff --git a/swf-src/AJClient.as b/swf-src/AJClient.as index d4fb25d..6a18dd6 100644 --- a/swf-src/AJClient.as +++ b/swf-src/AJClient.as @@ -579,17 +579,31 @@ package // the pictures as bitmaps, for wearing: "kind:id" -> {bmp, art, waiting} private static var _artBitmaps:Object = {}; + // "Custom pictures" in the settings menu (gui.ItemWindowToggle): the + // pictures players give their items, shown (the default) or not, when + // every item is drawn with its base's art. user var 9006, 1 for hidden. + public static function customArtOn() : Boolean + { + return settingOf(9006) != 1; + } + + // an item's picture version, or null for none or with them hidden + private static function artOf(param1:String, param2:int) : String + { + return customArtOn() ? _customArt[param1 + ":" + param2] : null; + } + // the look a worn item has, or null for one drawn as the game draws it public static function customArtMode(param1:String, param2:int) : String { - return _customArt[param1 + ":" + param2] == null ? null : _customArtMode[param1 + ":" + param2]; + return artOf(param1,param2) == null ? null : _customArtMode[param1 + ":" + param2]; } // what makes a painted frame of it different from its base's, for a // cache key ("" for none) public static function customArtKey(param1:String, param2:int) : String { - var _loc3_:String = _customArt[param1 + ":" + param2]; + var _loc3_:String = artOf(param1,param2); return _loc3_ == null ? "" : param2 + ":" + _loc3_ + ":" + _customArtMode[param1 + ":" + param2]; } @@ -598,7 +612,7 @@ package public static function customArtBitmap(param1:String, param2:int, param3:Object = null) : BitmapData { var _loc4_:String = param1 + ":" + param2; - var _loc5_:String = _customArt[_loc4_]; + var _loc5_:String = artOf(param1,param2); var _loc6_:Object = _artBitmaps[_loc4_]; if(_loc5_ == null) { @@ -653,7 +667,7 @@ package // the picture's address, or null when the item has none. public static function customArtUrl(param1:String, param2:int) : String { - var _loc3_:String = _customArt[param1 + ":" + param2]; + var _loc3_:String = artOf(param1,param2); return _loc3_ == null ? null : gMainFrame.clientInfo.websiteURL + "itemart/" + param1 + "/" + param2 + ".png?v=" + encodeURIComponent(_loc3_); } diff --git a/swf-src/AvatarWorldView.as b/swf-src/AvatarWorldView.as index 70b47e3..4110296 100644 --- a/swf-src/AvatarWorldView.as +++ b/swf-src/AvatarWorldView.as @@ -63,6 +63,11 @@ package avatar private static const ATTACHMENT_Y_OFFSET:int = -320; private static const SLIDE_FRAME_TIME:Number = 41.666666666666664; + + // name tag badges everyone sees, buddy or not, as the game shows its + // News Crew camera (NameBar.isVIPBadge): the Owner, Moderator and + // Verified badges of lib/badges.js, by their def ids. + private static const PUBLIC_BADGE_IDS:Array = [63,64,76]; private static const GLOW_LAND_DEFAULT_COLOR:int = 5586479; @@ -2185,7 +2190,7 @@ package avatar { _loc2_ = param1; } - if(BuddyManager.isBuddy(_avatar.userName) || isSelf || _isMember && NameBar.isVIPBadge(_loc2_)) + if(BuddyManager.isBuddy(_avatar.userName) || isSelf || _isMember && (NameBar.isVIPBadge(_loc2_) || PUBLIC_BADGE_IDS.indexOf((_loc2_ >> 8 & 0xFF) + 1) != -1)) { _namebar.setNubType(NameBar.BUDDY); } diff --git a/swf-src/ItemWindowToggle.as b/swf-src/ItemWindowToggle.as index 1257931..7006907 100644 --- a/swf-src/ItemWindowToggle.as +++ b/swf-src/ItemWindowToggle.as @@ -179,6 +179,9 @@ package gui.itemWindows case "hideBlocked": showHideBlocked(); break; + case "customArt": + showCustomArt(); + break; case "wasd": showWasd(); break; @@ -457,6 +460,24 @@ package gui.itemWindows showHideBlocked(); } + // "Custom pictures": the pictures players give their items, or every + // item with its base's art (AJClient.customArtOn). user var 9006. + private function showCustomArt() : void + { + var _loc1_:String = AJClient.customArtOn() ? "Hide" : "Show"; + _window.goNowBtn.down.txt.text = _loc1_; + _window.goNowBtn.mouse.mouse.txt.text = _loc1_; + _window.goNowBtn.mouse.up.txt.text = _loc1_; + _window.labelTxtCont.labelTxt.text = AJClient.customArtOn() ? "Custom pictures: shown" : "Custom pictures: hidden"; + } + + private function setCustomArt(param1:Boolean) : void + { + gMainFrame.userInfo.userVarCache.updateUserVar(9006,param1 ? 0 : 1); + AchievementXtCommManager.requestSetUserVar(9006,param1 ? 0 : 1); + showCustomArt(); + } + private function handleMouseDown(param1:MouseEvent) : void { var _loc2_:Number = NaN; @@ -682,6 +703,9 @@ package gui.itemWindows case "hideBlocked": setHideBlocked(!blockedAreHidden()); break; + case "customArt": + setCustomArt(!AJClient.customArtOn()); + break; case "wasd": setWasd(!AJClient.wasdOn()); break; diff --git a/swf-src/MySettings.as b/swf-src/MySettings.as index ceaac49..6e4d8cd 100644 --- a/swf-src/MySettings.as +++ b/swf-src/MySettings.as @@ -220,6 +220,11 @@ package gui "type":TOGGLE_TYPE_JOIN, "frame":"hideBlocked", "iconFrame":"buddyRequest" + },{ + // the pictures players give their items (AJClient.customArtOn) + "type":TOGGLE_TYPE_JOIN, + "frame":"customArt", + "iconFrame":"redeemCode" },{ "type":TOGGLE_TYPE_JOIN, "frame":"redeemCode",