Commit graph

188 commits

Author SHA1 Message Date
68da6c352e Complete the rewrite
Renderables no longer get wrapped in computed refs, because JSX.Elements don't like that (desyncs with the DOM)
Relatedly, a lot of display functions got fairly simplified, removing unnecessary local components
Added `MaybeGetter` utility type for something that may be a getter function or a static value (but not a ref)
Made Achievement.vue use a Renderable for the display. The object of components can still be passed to `createAchievement`
Made Challenge.vue use a Renderable for the display. The object of components can still be passed to `createChallenge`
Fixed some issues introduced by the rewrite that broke particles systems
2024-12-11 14:28:17 -06:00
4ce1b60a3d Merge remote-tracking branch 'template/feature/feat-and-board-rewrite' into feat/board-feature-rewrite 2024-12-11 14:27:38 -06:00
83d41428eb Feature rewrite
- Removed `jsx()` and `JSXFunction`. You can now use `JSX.Element` like any other `Computable` value
- `joinJSX` now always requires a joiner. Just pass the array of elements or wrap them in `<>` and `</>` if there's no joiner
- Removed `coerceComponent`, `computeComponent`, and `computeOptionalComponent`; just use the `render` function now
- It's recommended to now do `<MyComponent />` instead of `<component :is="myComponent" />`
- All features no longer take the options as a type parameter, and all generic forms have been removed as a result
- Fixed `forceHideGoBack` not being respected
- Removed `deepUnref` as now things don't get unreffed before being passed into vue components by default
- Moved MarkNode to new wrapper, and removed existing `mark` properties
- Moved Tooltip to new wrapper, and made it take an options function instead of raw object
- VueFeature component now wraps all vue features, and applies styling, classes, and visibility in the wrapping div. It also adds the Node component so features don't need to
- `mergeAdjacent` now works with grids (perhaps should've used scss to reduce the amount of css this took)
- `CoercableComponent` renamed to `Renderable` since it should be used with `render`
- Replaced `isCoercableComponent` with `isJSXElement`
- Replaced `Computable` and `ProcessedComputable` with the vue built-ins `MaybeRefOrGetter` and `MaybeRef`
- `convertComputable` renamed to `processGetter`
- Also removed `GetComputableTypeWithDefault` and `GetComputableType`, which can similarly be replaced
- `dontMerge` is now a property on rows and columns rather than an undocumented css class you'd have to include on every feature within the row or column
- Fixed saves manager not being imported in addiction warning component
- Created `vueFeatureMixin` for simplifying the vue specific parts of a feature. Passes the component's properties in explicitly and directly from the feature itself
- All features should now return an object that includes props typed to omit the options object and satisfies the feature. This will ensure type correctness and pass-through custom properties. (see existing features for more thorough examples of changes)
- Replaced decorators with mixins, which won't require casting. Bonus amount decorators converted into generic bonus amount mixin. Removed effect decorator
- All `render` functions now return `JSX.Element`. The `JSX` variants (e.g. `renderJSX`) (except `joinJSX`) have been removed
- Moved all features that use the clickable component into the clickable folder
- Removed `small` property from clickable, since its a single css rule (`min-height: unset`) (you could add a small css class and pass small to any vue feature's classes property, though)
- Upgrades now use the clickable component
- Added ConversionType symbol
- Removed setDefault, just use `??=`
- Added isType function that uses a type symbol to check
- General cleanup
2024-11-29 08:02:24 -06:00
99511288c9 Merge branch 'feat/update-deps' into feat/board-rewrite 2024-11-29 07:52:52 -06:00
528e703c88 Ran lint:fix 2024-10-20 11:46:09 -05:00
052a01d3f7 Fix build issues 2024-10-18 09:26:10 -05:00
88abd53faf Update eslint and prettier 2024-10-18 07:04:33 -05:00
80d7a743bc Update TS 2024-10-18 07:04:29 -05:00
1e13da1129 Revert "Add link to docs in setupDraggableNode docstring"
This reverts commit 1c7824b550.
2024-10-18 07:02:34 -05:00
643bfccada Add link to docs in setupDraggableNode docstring 2024-10-18 07:02:34 -05:00
99227a2cb2 Move common board node CSS to class 2024-10-18 07:02:34 -05:00
e0da9588d2 Move board to src/game 2024-10-18 07:02:34 -05:00
6ba25f9abd Removed dynamic imports 2024-10-18 07:02:32 -05:00
2d28be84a9 Add modal to take a mental health break 2024-10-17 16:17:32 +00:00
b98f6db1c4 Move printFormula to Formula.stringify and add tests for it 2024-03-29 00:24:31 -05:00
563eaa7539 Lint 2024-03-29 00:19:57 -05:00
dfb14acc6e Allow null and undefined values in persistent refs 2024-03-29 04:39:56 +00:00
68e6e3f37a Revert "Add link to docs in setupDraggableNode docstring"
This reverts commit 1c7824b550.
2024-03-12 21:52:19 -05:00
1c7824b550 Add link to docs in setupDraggableNode docstring 2024-03-10 09:37:02 -05:00
0e7ca27e3b Move common board node CSS to class 2024-03-09 21:59:17 -06:00
2cfa450d96 Move board to src/game 2024-03-09 20:36:41 -06:00
cfba55d2c6 Add galaxy api 2024-03-05 22:47:11 -06:00
5f8e35478d Merge remote-tracking branch 'upstream/main' into feat/enforce-eslint 2024-02-20 22:37:17 -06:00
a39e65852d Remove unused imports 2024-02-21 01:25:52 +00:00
2e0e221010 Made modifier typing a lot less nasty 2024-02-21 01:25:52 +00:00
4092cd6d56 Add regression test for modifier.getFormula respecting enabled 2024-02-21 01:25:52 +00:00
143b0773e7 Add eslint workflow action and CONTRIBUTING.md that says to lint first 2024-02-17 20:16:00 -06:00
Seth Posner
cf6265d8ce Keep disabled modifiers when making formulas 2024-02-12 07:58:39 -08:00
eee5ac3e2d Fix passthroughs for inversions and make more operations invertible 2023-05-30 22:54:46 -05:00
210c2290f0
Fix #9 2023-05-19 10:12:24 -05:00
7deacb41e1 Fixed tests 2023-05-17 08:23:10 -05:00
ab3b180db8 Improve error handling 2023-05-16 23:49:25 -05:00
500e412fdb Rebalance resource levels and implement portal costs 2023-05-15 21:10:52 -05:00
bbe0aaa31e Fix directSum breaking formulas 2023-05-14 18:51:15 -05:00
f8095a9694 Made calculateMaxAffordable, calculateCost, and cost requirements interface a bit cleaner 2023-05-14 18:51:15 -05:00
0991ef0865 Fix some persistence issues 2023-05-13 17:14:29 -05:00
8284baa1a0 Fix step-wise formulas causing issues with reactivity 2023-05-12 01:40:51 -05:00
4d7f03d543 Fix crash when calculating formula cost
Happened when spend resource was false and the formula was non-integrable, but the amount to buy were all going to be summed anyways
2023-05-05 19:11:57 -05:00
04f14c17bd Fix extends undefined checks 2023-04-30 11:49:49 -05:00
bffc27344a Fixed isInvertible and isIntegrable not working nested correctly 2023-04-30 11:49:43 -05:00
7a81157bcc Fix remaining typing issues with formula typing change 2023-04-22 18:10:32 -05:00
6363062ce6 Gate integration operations 2023-04-22 18:04:15 -05:00
f7f4d0aa9f Fix non-integrable requirements crashing in cost requirements with spendResources true
(Which should be valid in the event the dev doesn't want to maximize)
2023-04-22 17:59:09 -05:00
97fcd28fe2 Change formula typing to work better 2023-04-22 17:59:05 -05:00
b6317a47e8 Fix calculate max affordable edge case 2023-04-21 23:48:19 -05:00
8806910f5e Resolving problems 2023-04-19 21:37:28 -05:00
a262d6fd03 Make formulas unwrap persistent refs automatically 2023-04-18 20:56:53 -05:00
632da10aca Make lazy proxies and options funcs pass along base object 2023-04-18 20:56:47 -05:00
0f2cc45a7e Add else statement to conditional formulas 2023-04-18 20:56:23 -05:00
80722bd64b Make noPersist work on objects as well 2023-04-16 21:17:17 -05:00