Extensions:Character Frames

From Lorekeeper Wiki
Revision as of 12:41, 16 November 2021 by Mercury (talk | contribs)
Jump to navigation Jump to search
Character Frames
Description Adds frames which are applied to character images.
Author(s) Mercury
Status Testing
Github extension/character-frames
LK Version 2.0.0
Contains a Migration






Note that this is a significant rework of character image handling. If you are not certain you wish to use this extension, it is advised that you test it locally on an independent branch before committing.

Adds frame categories and frames-- images with both a background and foreground "frame" component that the character is sandwiched between-- and reworks character image processing to suit. Frames can be unlocked for characters via items with an included item tag (which can be set to unlock any given non-default frame by site staff).

Frames have the following properties:

  • Name
  • Category (Optional)
  • Species (Optional)
  • Subtype (Optional)
  • Description (Optional)
  • Is Default
  • Front image
  • Back image

Species and subtype restrictions are not cosmetic and do fully restrict the frame(s). This is to account for the fact that different species and/or subtype combinations can be configured to use frames of different dimensions. Likewise, there can be multiple "default" frames, each corresponding to a given size of frame. This is to attempt to ensure that there is always a valid frame for any given character.

Display for frames and frame categories in /world is included as well.

Characters by default have access only to the default frame/to the default frame for their species and/or subtype combination. More frames can be unlocked via the character's owner using an item with the included tag that unlocks a specific frame for the character; frames are then attached to the character and unlocked in perpetuity. This is also logged in the character's change log, and the character's unlocked frames are publicly displayed in the new "Frames" image info tab.

The character's owner as well as staff with the Manage Masterlist permission can then change the character's frame at will via the Frames tab. Note that this is enabled by storing a cropped version of the character's image! The thumbnail cropper is repurposed to this end and resized to relevant dimensions. (This means on design updates, admins update the cropped version of the image rather than the thumbnail).

Character thumbnails, then, are automatically generated as small, squared (with extra transparent space added as necessary) versions of the full masterlist image. Otherwise, most functionality from Extensions:Watermarking is preserved and should function as expected.

Installation

Pull the branch; run php artisan migrate and php artisan update-extension-tracker.

Configuration

  1. Configure default frame size and any species and/or subtype specific frame dimensions in config/lorekeeper/settings.php
  2. (Optional) Create frame categories from the site's admin panel
  3. Upload frames as desired, taking care to ensure all required default frames are present. If in doubt, the frames index displays information on configured dimensions and which combinations do and/or do not have default frames
  4. Add and configure the included item tag for any items as desired

Usage

Note that pre-existing character images are not immediately compatible (but should cause no errors). A new image must be created (via admin upload or design update) or the existing image must be reuploaded so that a cropped version for use with frames is created.

Troubleshooting

Find me in the Lorekeeper server!

Images

See Also