Commit Graph

7 Commits

Author SHA1 Message Date
NightKev
69ed6258b2 Apply Biome safe fixes 2025-06-19 17:44:52 -07:00
NightKev
7c6189e812
[Refactor] Create utility function coerceArray (#5723)
* [Refactor] Create utility function `makeArray`

This replaces the `if(!Array.isArray(var)) { var = [var] }` pattern

* Replace `if` with ternary, rename to `coerceArray`

* Add TSDocs

* Improve type inferencing

* Replace missed `Array.isArray` checks

* Apply Biome

* Re-apply changes to phase manager

* Re-apply to `SpeciesFormChangeStatusEffectTrigger` constructor

Apply to new instances in test mocks
2025-06-12 21:30:01 -07:00
Sirz Benjie
14e01c3da1
[Test] Add missing methods to many mocks (#5891) 2025-05-29 20:27:39 -07:00
Sirz Benjie
f9e6785c35
[Test] Fix mocks' add method to match phaser signature (#5885) 2025-05-28 20:18:06 -07:00
Sirz Benjie
d5789105f3
[Refactor][UI/UX] Cleanup battle-info ui code (#5696)
* Create battle-info directory and move battle-info.ts to it

* Move player and enemy battle info to their own files

* Move subclass specific parts of constructor to subclass constructor

* Fixup mock gameobject methods to match phaser gameobject returns

* Make statOrder specific to subclass

* Create getShinyDescriptor function in utils

* Move icon construction to its own function

* Cleanup enemybattleinfo constructor to use chaining

* Make flyout exclusive to EnemyBattleInfo

* Move EnemyPokemon specific init Logic to its class

* Break up initInfo into different methods

* Remove hp bar segment dividers from base battle info

* Move setMini to pokemoninfo

* Breakup updateInfo into smaller parts

* Remove hp info handling from base updateInfo

* Use phaser object chaining methods

* Add some docs

* Add missing chain usage

* Use getShinyDescriptor in pokemon-info-container

* Minor cleanup of updatePokemonExp

* Fixup setSizeToFrame mock

* Ensure pokemon hp numbers are not visible during stat display

* Update src/utils/common.ts

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>

* Make summary-ui-handler use new shinyDescriptor method

* Remove `undefined` parameter pass

Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>

* Address kev's review comments

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Ensure hp number display fades in/out

* Ensure ribbon and caught indicator fade with stat display

* Update src/ui/battle-info/battle-info.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* Move construction of stats and type icons to their own methods

* Make setPositionRelative return this

* Improve doc comment on paddingX param

* Fix mock sprite's setPositionRelative

---------

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-05-28 17:29:03 +00:00
Sirz Benjie
408b66f913
[Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495)
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-03-09 14:13:25 -07:00
Sirz Benjie
a51a504155
[Test] Move test folder out of src (#5398)
* move test folder

* Update vitest files

* rename test/utils to test/testUtils

* Remove stray utils/gameManager

Got put back from a rebase
2025-02-22 22:52:07 -06:00