diff --git a/config.js b/config.js index 9196869..9768f79 100644 --- a/config.js +++ b/config.js @@ -133,7 +133,8 @@ module.exports = { // 48: the item giver (the item finder renamed) with previews and hex colours; // 49 and 50: its link to a colour picker. // 61: the Owner, Moderator and Verified name tag badges seen by everyone. - buildVersion: env.AJ_BUILD_VERSION || "61", + // 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", 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/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", diff --git a/swf/ajclient.swf b/swf/ajclient.swf index bde81ea..35b20de 100644 Binary files a/swf/ajclient.swf and b/swf/ajclient.swf differ