Commit graph

4582 commits

Author SHA1 Message Date
Soreepeong
68dc16803c Turn ImFontLocked into a class
As `ImFontLocked` utilizes a reference counter, changed it to a class so that at worst case we still got the destructor to decrease the reference count.
2024-01-23 23:50:17 +09:00
Soreepeong
df89472d4c Consistent BuildTask resolution timing
`BuildFontsImmediately` and `BuildFontsAsync` set `BuildTask` to completion at different point of build process, and changed the code to make it consistent that `BuildTask` is set to completion after `PromoteBuiltData` returns.
2024-01-23 23:50:04 +09:00
Soreepeong
871deca6e9 Remove PostPromotion event
`PostPromotion` is removed, as `IFontHandle.ImFontChanged` now does the job. It also removes the possibility that resources may get disposed while post promotion callback is in progress.

* `IFontHandle.ImFontChanged` is now called with a locked instance of the font.
* `IFontHandle.ImFontLocked`: Added `NewRef` to increase reference count.
2024-01-23 23:49:57 +09:00
Soreepeong
fb8beb9370 Move PostPromotion modification functions to PostBuild
These changes are done to ensure that `IFontHandle.Lock` will be guaranteed to obtain a fully built font that will not be modified any further (unless `PostPromotion` is being used for modifying fonts, which should not be done by clients.)

* Moved `CopyGlyphsAcrossFonts` and `BuildLookupTable` from `PostPromotion` to `PostBuild` build toolkit.
* `IFontAtlasBuildToolkit`: Added `GetFont` to enable retrieving font corresponding to a handle being built.
* `InterfaceManager`: Use `OnPostBuild` for copying glyphs from Mono to Default.
* `FontAtlasBuildStep`:
    * Removed `Invalid` to prevent an unnecessary switch-case warnings.
    * Added contracts on when `IFontAtlas.BuildStepChanged` will be called.
2024-01-23 23:49:47 +09:00
Soreepeong
5479149e79 Lock font resources on Push and miscellaneous direct accesses
These changes ensure that using a font under some other thread's ownership from the UI thread for rendering into ImGui purposes always work.

* `FontHandle`:
    * Moved common code from `DelegateFontHandle` and `GamePrebakedFontHandle`.
    * Added `LockUntilPostFrame` so that the obtained `ImFontPtr` and its accompanying resources are kept valid until everything is rendered.
    * Added more code comments to `Try/Lock`.
    * Moved font access thread checking logic from `InterfaceManager` to `LockUntilPostFrame`.
    * `Push`ing a font will now also perform `LockUntilPostFrame`.
* `GameFontHandle`: Make the property `ImFont` a forwarder to `FontHandle.LockUntilPostFrame`.
* `InterfaceManager`:
    * Added companion logic to `FontHandle.LockUntilPostFrame`.
    * Accessing default/icon/mono fonts will forward to `FontHandle.LockUntilPostFrame`.
    * Changed `List<T>` to `ConcurrentBag<T>` as texture disposal can be done outside the main thread, and a race condition is possible.
2024-01-23 23:49:34 +09:00
goat
e20daed848
Merge pull request #1619 from Soreepeong/feature/ifontatlas-lockable-fonts
Make `IFontHandle` lockable, and add font change event
2024-01-23 08:58:31 +01:00
goat
f338c470e2
Merge pull request #1614 from goaaats/wpid_profiles
Use WorkingPluginId as identifier for plugins, take 2
2024-01-22 17:23:47 +01:00
Soreepeong
fc4d08927b Fix Dalamud Configuration revert not rebuilding fonts 2024-01-21 15:11:31 +09:00
Soreepeong
29b3e0aa97 Make IFontHandle.Push return IDisposable, and add IFontHandle.Pop 2024-01-21 13:15:36 +09:00
github-actions[bot]
500df36cae Update ClientStructs 2024-01-20 16:09:15 -08:00
Soreepeong
a409ea60d6 Update docs 2024-01-21 04:55:03 +09:00
Soreepeong
3e3297f7a8 Use Lock instead of .ImFont 2024-01-21 04:49:51 +09:00
Soreepeong
af1133f999 Determine optional assets availability on startup 2024-01-21 04:21:26 +09:00
Soreepeong
127b91f4b0 Fix doc 2024-01-21 04:12:40 +09:00
Soreepeong
0701d7805a BuildFonts remarks 2024-01-21 04:07:58 +09:00
Soreepeong
967ae97308 Expose wrapped default font handle 2024-01-21 03:41:26 +09:00
Soreepeong
d70b430e0d Add IFontHandle.Lock and WaitAsync 2024-01-21 03:10:41 +09:00
goat
620f3999d2
Merge pull request #1618 from Soreepeong/fix/ifontatlas-compat-fix-2
IFontAtlas API9 compat: support reading GameFontHandle.ImFont during UiBuilder.After/BuildFonts
2024-01-20 17:09:53 +01:00
Soreepeong
7c1ca4001d Docs 2024-01-21 00:47:09 +09:00
Soreepeong
8afe277c02 Make IFontHandle.Pop return a concrete struct 2024-01-21 00:45:46 +09:00
Soreepeong
dd5cbdfd5d IFontAtlas API9 compat: support reading GameFontHandle.ImFont during UiBuilder.After/BuildFonts 2024-01-21 00:15:12 +09:00
goat
11c1b4658b
Merge pull request #1617 from Soreepeong/fix/ifontatlas-defaultfont
Set ImGui default font upon default font atlas update
2024-01-20 10:16:29 +01:00
Soreepeong
1a19cbf277 Set ImGui default font upon default font atlas update 2024-01-20 10:21:50 +09:00
goaaats
4f4f604ef8
show all plugins - be it dev, installed, available, orphaned - in the available tab 2024-01-20 01:10:07 +01:00
goaaats
af2f0f290f
dev plugins are now allowed to be in profiles 2024-01-19 23:43:24 +01:00
goaaats
57b8a5d932
prevent double-lookup for dev plugins in non-default profiles 2024-01-19 23:42:44 +01:00
goaaats
4e95d4fe37
allow load of devPlugins in non-default profile 2024-01-19 23:32:39 +01:00
goaaats
d26db7e053
don't tell people to wait for an update, if one is available 2024-01-19 23:26:59 +01:00
goaaats
b415f5a874
never offer updates for dev plugins 2024-01-19 23:12:32 +01:00
goat
f6b699d18f
Merge pull request #1615 from Soreepeong/fix/ifontatlas-compat-fix-1
Fallback behavior for bad use of DstFont values
2024-01-19 20:06:04 +01:00
Soreepeong
ad12045c86 Fix notifications font 2024-01-19 08:31:08 +09:00
Soreepeong
0c2a722f83 Fallback behavior for bad use of DstFont values 2024-01-19 08:11:33 +09:00
Soreepeong
63b16bcc7c Reapply "IFontAtlas: font atlas per plugin"
This reverts commit b5696afe94.
2024-01-19 07:26:56 +09:00
goaaats
23ddc78241
add bodge "match to plugin" UI for installed plugins 2024-01-18 22:53:17 +01:00
goaaats
9024c9b00c
track internal name nonetheless 2024-01-18 22:47:56 +01:00
goaaats
256f4989f7
add some validation code to catch issues 2024-01-18 22:39:18 +01:00
goaaats
d827151ee5
add icon for dev plugins 2024-01-18 22:21:37 +01:00
goaaats
b3740d0539
add Profile.RemoveByInternalNameAsync() 2024-01-18 22:03:14 +01:00
goat
b5696afe94 Revert "IFontAtlas: font atlas per plugin" 2024-01-18 12:51:58 -08:00
goaaats
b446fcc191
merge 2024-01-18 21:51:18 +01:00
Kurochi51
14c5ad1605
Expose CharacterData.ShieldValue to Dalamud's Character wrapper. (#1608) 2024-01-18 20:56:12 +01:00
goat
d59d5a4cbc
Merge pull request #1531 from Soreepeong/feature/separate-atlas-per-plugin
IFontAtlas: font atlas per plugin
2024-01-18 20:55:47 +01:00
Infi
a1a96d762a Fix swapped U and V check 2024-01-17 22:35:04 -08:00
goat
59278224f7
build: 9.0.0.17 2024-01-16 20:00:37 +01:00
github-actions[bot]
d71da3f2c0 Update ClientStructs 2024-01-16 07:28:36 -08:00
github-actions[bot]
7d7ab4bc8b Update ClientStructs 2024-01-15 09:16:15 -08:00
srkizer
5caed2f3b0
Merge branch 'master' into feature/separate-atlas-per-plugin 2024-01-15 18:05:23 +09:00
github-actions[bot]
a71b81c82e Update ClientStructs 2024-01-13 15:34:51 -08:00
goat
96ef5e18cd
build: 9.0.0.16 2024-01-13 20:17:57 +01:00
KazWolfe
86b7c29e94
fix: Make auto-update work again, the lazy way (#1592)
* fix: Make auto-update work again, the lazy way.

- Move auto-update to run on the first `Notice` message for parity with the welcome message.
- Add some logging in a few critical places to make things nicer.

* fix overzealous IDE complaints

* code-review comments

- Remove stray imports that the IDE included
- Remove fixme to move auto-updates (for now)

* Lazy retry auto-update
2024-01-13 20:17:26 +01:00