diff --git a/CHANGELOG.md b/CHANGELOG.md index 26e00f5..849ed9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.1] - 2022-07-17 +### Added +- Notif component that displays a jumping exclamation point +- showAmount boolean to buyable displays +- Tab families now take option to style the tab buttons container +- Utility for creating text of a certain color +### Changed +- Improved typing of player.layers +- Improved typing of createCollapsibleModifierSections's parameters +- Made Particles vue component typed as GenericComponent due to issues generating documentation +- Minimized how much of pixi.js is included in the built site +- Split bundles into smaller bundles for faster loading +- Updated TypeScript +- Descriptions on buyables are now optional +- Improved tooltips performance +- Improved how MainDisplay displays effect strings +- MainDisplays are now sticky +- processComputable now binds uncached functions as well +### Fixed +- trackResetTime stopped working once its layer was removed and re-added +- Runtime compilation was disabled in vite config +- Websites had to be hosted on root directory to have assets load correctly +- Tooltips' persistent ref was lazily created +- In some situations Links would not update its bounding rect +- Achievements' and milestones' onComplete callbacks were firing on load +- Processed JSXFunctions were not considered coercable components by isCoercableComponent +- Error from passing in overlay text to bar component +### Removed +- lodash.cloneDeep dependency, which hasn't been used in awhile +- Some unused configs from vue-cli-service +### Documented +- Update vitepress, and updated the content of many pages +- Rest of /game +- Rest of /data +- layers.tsx +- Any type augmentations to Window object +- Various cleanup of docs comments +- Fixed doc generation being broken from switch to vite +### Tests +- Switched from jest to vitest + ## [0.5.0] - 2022-06-27 ### Added - Projects now cache for offline play, and show notification when an update is available diff --git a/package-lock.json b/package-lock.json index 0820549..a12d4ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "profectus", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "profectus", - "version": "0.5.0", + "version": "0.5.1", "dependencies": { "@pixi/app": "^6.4.2", "@pixi/core": "^6.4.2", diff --git a/package.json b/package.json index 103de9b..4d327dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "profectus", - "version": "0.5.0", + "version": "0.5.1", "private": true, "scripts": { "start": "vite", diff --git a/src/data/common.tsx b/src/data/common.tsx index 27cf420..f392741 100644 --- a/src/data/common.tsx +++ b/src/data/common.tsx @@ -232,28 +232,30 @@ export function createLayerTreeNode( }) as unknown as LayerTreeNode; } +/** An option object for a modifier display as a single section. **/ +export interface Section { + /** The header for this modifier. **/ + title: string; + /** A subtitle for this modifier, e.g. to explain the context for the modifier. **/ + subtitle?: string; + /** The modifier to be displaying in this section. **/ + modifier: WithRequired; + /** The base value being modified. **/ + base?: Computable; + /** The unit of measurement for the base. **/ + unit?: string; + /** The label to call the base amount. Defaults to "Base". **/ + baseText?: Computable; + /** Whether or not this section should be currently visible to the player. **/ + visible?: Computable; +} + /** * Takes an array of modifier "sections", and creates a JSXFunction that can render all those sections, and allow each section to be collapsed. * Also returns a list of persistent refs that are used to control which sections are currently collapsed. - * @param sections An array of options objects for each section to display. - * @param sections.title The header for this modifier. - * @param sections.subtitle A subtitle for this modifier, e.g. to explain the context for the modifier. - * @param sections.modifier The modifier to be displaying in this section. - * @param sections.base The base value being modified. - * @param sections.unit The unit of measurement for the base. - * @param sections.baseText The label to call the base amount. - * @param sections.visible Whether or not this section should be currently visible to the player. */ export function createCollapsibleModifierSections( - sections: { - title: string; - subtitle?: string; - modifier: WithRequired; - base?: Computable; - unit?: string; - baseText?: Computable; - visible?: Computable; - }[] + sections: Section[] ): [JSXFunction, Persistent[]] { const processedBase = sections.map(s => convertComputable(s.base)); const processedBaseText = sections.map(s => convertComputable(s.baseText)); @@ -314,6 +316,6 @@ export function createCollapsibleModifierSections( * @param textToColor The content to change the color of * @param color The color to change the content to look like. Defaults to the current theme's accent 2 variable. */ -export function colorText(textToColor: string, color = "var(--accent2)"): string { - return `${textToColor}`; +export function colorText(textToColor: string, color = "var(--accent2)"): JSX.Element { + return ${textToColor}; } diff --git a/src/game/player.ts b/src/game/player.ts index aa4e789..6271629 100644 --- a/src/game/player.ts +++ b/src/game/player.ts @@ -42,7 +42,7 @@ export type Player = ProxiedWithState; /** A layer's save data. Automatically unwraps refs. */ export type LayerData = { [P in keyof T]?: T[P] extends (infer U)[] - ? LayerData[] + ? Record> : T[P] extends Record ? never : T[P] extends Ref