As usual, /r/kingdomdeath has really been coming through with support, signal amplification and assistance. Thanks again!
The first round of alpha testing and tickets brought our attention several non-trivial issues related to how we manage assets behind the scenes in the API. Release 2.59.1125, therefore, is mostly focused on those issues, i.e. on the back-end, e.g. tightening up how game asset definitions are typed/retrieved, correcting some bad math, etc.
This is important to users of the Manager because the high volume of big-deal back-end updates in this release basically guarantees that there will be some unintended downstream consequences, e.g. errors in the legacy webapp at http://kdm-manager.com.
Please report all issues! Every bug you submit against the legacy webapp helps improve The Watcher and, at this point, we need all the help we can get!
(And thanks in advance for your patience as we work through these growing pains!)
Finally, in terms of what's going on in the legacy webapp, this release (finally) implements API support for survivor avatars! In fact, all avatar-related code has been deprecated and removed from the legacy webapp which a.) fixes some outstanding issues that I have been ignoring for...like a year and b.) will improve UI/UX by no longer requiring the Survivor Sheet to refresh/reload when changing an avatar.
Corrections and Fixes
- Fixed a typo in the "Cannibalize" description. -Dave F
- Fixed an issue where Survivors with Matchmaker A&I did not cause their endeavor to show up in the settlement endeavors in certain cases.
- Addressed an issue where creating a new survivor with an avatar threw an encoding error when posting to the API. -Fenris XL
- Addressed a presentation issue where survivor Quick Menus did not display well at laptop resolution. -Wayforger
- Updated the no-www redirect in the Nginx config for the API server so that http://www.thewatcher.io goes to the landing page, rather than the API documentation. -Caleb
- Addressed an issue where attempting to use non-ascii/upper-ascii characters in a custom Cause of Death threw un-labeled errors. -laterite
- Addressed an issue where settlement death count was not calculated correctly on the Settlement Sheet. -Dave F, paddirn
- Updated the JSON encoder in the legacy webapp's api.post_JSON_to_API() method so that it can encode images (to base 64). This Stack was helpful: shouts to Martijn Pieters!
- Deprecated support for survivor avatars:
- removed the avatar_size setting from the legacy 'settings.cfg' file
- Deprecated the assets.Survivors.update_avatar() method
- Removed support for the 'survivor_avatar' key from assets.Survivors.modify()
- Removed the (wicked hack) from the Survivor Sheet that used a hidden form to post avatar changes to the legacy webapp.
- Refactored survivor avatar management to use the API:
- creating new survivors with avatars is once again supported.
- Added a JS-based avatar changer to the Survivor Sheet. Created a custom directive in survivorSheet.js. Hat tip to sqren!
- Added base64 conversion (for use with API methods below) to survivorSheet.js. Hat tip to eliseosoto!
- Made a spinner and built some fancy presentation logic for setting a new avatar without reloading the Survivor Sheet. Feature demo here.
- Added a new breakpoint for laptops (and landscape tablets, I suppose).
- Removed/deprecated support for toggling admin status from the legacy webapp admin.py
- Deprecated the code from assets.User.mark_usage() that used the user-level activity log feature (which is deprecated af).
- Updated the "Twelve Fingers" A&I so that it sets the 'cannot use two-handed weapons' flag on a survivor.
- The controls for editing storage (on the Settlement Sheet) no longer show up before storage is loaded (i.e. and let you load a blank screen where you can wait or reload).
|This is...a huge release.|
- The API now supports avatars and new survivors can once again be created with avatars!
- Updated the survivors.Survivor.new() method to check for incoming avatars on creation
- Added a set_avatar() method to the Survivor class methods (that basically is a port of the legacy webapp's update_avatar() method).
- The set_avatar() method is called during survivors.Survivor.new() and includes optional 'save' and 'log_event' kwargs (that are used to avoid issues during creation, etc.)
- Created a route: /survivor/set_avatar/<oid> that can be used to hit the new method.
- Updated the documentation and included some helpful sample JS code for my front-end peoples.
- Massively revised how asset lookups work in preparation for public "release" of the API:
- Deprecated the root-level game asset lookups in favor of /game_asset/asset_class
- Added 410 deprecation warnings for the old lookup end points.
- Added a 404 warning to request_broker.get_game_asset() if we get a request for an asset collection that we currently don't support lookups for.
- Added support for /game_asset/gear, /game_asset/resource, /game_asset/storage (i.e. storage locations) and /game_asset/abilities_and_impairments
- Updated the docs to reference a.) the deprecated endpoints and b.) the proper way to do asset lookups
- Also added short references to supported lookup endpoints
- Refactored Models.GameAsset.set_assets_from_root_module() to set the 'type' from the asset file name and the 'sub_type' from a.) the asset or b.) the asset's dictionary handle. -Caleb
- Models.AssetCollection.set_pretty_types() now sets sub_type_pretty attributes on all asset definitions (defaulting to JS null or Python None).
- Updated assets.locations.py so that locations are now 'gear' type assets.
- Revised models.campaigns.py to initialize using a root module (i.e. to bring it into compliance with our other models).
- Created handling for the AssetCollection known as self.type_override, which is intended to be used with a root module when initializing an asset collection and which will override the type attribute of ALL assets in the collection after they are initialized.
- Setting self.type_override when initializing an AssetCollection object sets that value as the selt.type of the collection (e.g. so that you can print a descriptive __repr__, e.g. in logging)
- Revised assets/campaigns.py so that helper dictionaries start with an underscore (to exempt them from being initialized as campaign asset modules. Split the actual campaign definitions into two dictionaries, i.e. one for core and one for expansions.
- models.cursed_items.py now initializes its AssetCollection using a root module now as well.
- Removed custom AssetCollection code in models.expansions.py and swapped it out for root module type initialization.
- admin.py now supports toggling 'admin' status on/off for a user.
- Admin Panel updates (for creepin' the users):
- updated the color-coding so that free users are grey and subscribers are yellow (used material design)
- updated the conditional formatting so that active users/subscribers are (slightly) different colors
- Updated the admin panel to use the new lookup routes
- Calling Models.log_event() from a user asset (e.g. settlement, survivor, etc.) now calls the User class method set_latest_action(), which is a (rough) port of the legacy mark_usage() method that eschews the user activity log (which is deprecated as of the dashboard redesign).