Commit graph

4615 commits

Author SHA1 Message Date
srkizer
ea43d65636
Fix memory ownership on AddFontFromImGuiHeapAllocatedMemory (#1651) 2024-02-14 23:52:40 +01:00
goat
34ed07ef1f
Merge pull request #1650 from Soreepeong/fix/dch-tspack-fix
DalamudCrashHandler: handle log-directory pointing to a file
2024-02-14 20:34:59 +01:00
Soreepeong
cce4f03403 Adjust logDir if logDir points to a .log file 2024-02-15 04:14:23 +09:00
Soreepeong
edc5826fe0 Dalamud.Boot: use unicode::convert 2024-02-15 03:55:00 +09:00
goat
45d30ed9d2
Merge pull request #1649 from Soreepeong/fix/ifontatlas-dock-windowdecoration
Temp fix insufficient ImDrawList texture handling
2024-02-14 18:51:20 +01:00
Soreepeong
2de9c8ed5b Fix insufficient ImDrawList implementation 2024-02-14 21:59:20 +09:00
Soreepeong
cf3091b409 If docked, force default font on window decoration
ImGui docking functions are called outside our drawing context (from
ImGui::NewFrame), which includes most of dock-related drawing calls.
However, ImGui::RenderWindowDecoration is called from ImGui::Begin,
which may be under the effect of other pushed font. As IG::RWD
references to the ImDrawList irrelevant to the global shared state, it
was trying to draw a rectangle referring to a pixel that is not
guaranteed to be a white pixel. This commit fixes that by forcing the
use of the default font for IG::RWD when the window is docked.
2024-02-14 13:05:45 +09:00
goat
86504dfd9e
build: 9.0.0.18 2024-02-13 23:25:18 +01:00
srkizer
3283d0cc11
Turn IDalamudAssetManager public (#1638) 2024-02-13 13:09:23 -08:00
srkizer
34daa73612
Implement FontChooserDialog (#1637)
* Implement FontChooserDialog

* Minor fixes

* Fixes 2

* Add Reset default font button

* Add failsafe

* reduce uninteresting exception message

* Add remarks to use AttachExtraGlyphsForDalamudLanguage

* Support advanced font configuration options

* fixes

* Shift ui elements

* more fixes

* Add To(Localized)String for IFontSpec

* Untie GlobalFontScale from default font size

* Layout fixes

* Make UiBuilder.DefaultFontSize point to user configured value

* Update example for NewDelegateFontHandle

* Font interfaces: write notes on not intended for plugins to implement

* Update default gamma to 1.7 to match closer to prev behavior (1.4**2)

* Fix console window layout
2024-02-13 20:09:46 +00:00
bleatbot
3b3823d4e6
Update ClientStructs (#1644)
Co-authored-by: github-actions[bot] <noreply@github.com>
2024-02-13 16:08:36 +00:00
bleatbot
0854b6d025
Update ClientStructs (#1643)
Co-authored-by: github-actions[bot] <noreply@github.com>
2024-02-12 17:12:54 -08:00
srkizer
0cc28fb39d
Changes to Dalamud Boot DLL so that it works in WINE (#1111)
* Changes to Dalamud Boot DLL so that it works in WINE

* Make asm clearer
2024-02-12 12:56:38 -08:00
marzent
386e5f245c
Make the crash handler work on wine properly (#1636)
* add LoadMethod to DalamudStartInfo
* add to_wstring utility function
* append full injector launch args for VEH
* remove usage of std::chrono::zoned_time
* fix injector arguments in crash handler restart
* enable VEH on wine
* remove dead wine detection code
* write out tspack with std::fstream
* fix off-by-one error in get_window_string()
* remove usage of std::chrono when writing tspack
* do not deadlock on crashing DalamudCrashHandler
2024-02-11 13:01:34 -08:00
bleatbot
16bc6b86e5
Update ClientStructs (#1630)
Co-authored-by: github-actions[bot] <noreply@github.com>
2024-02-11 10:20:26 -08:00
goat
22f4508bec
Merge pull request #1635 from marzent/exception-handler
Add more exception handler options to dev menu
2024-02-10 13:49:12 +01:00
marzent
df65d59f8b add more exception handler options to dev menu 2024-02-10 13:03:11 +01:00
goat
be965f8dd1
Merge pull request #1622 from Soreepeong/feature/ifontatlas-lock-safety
Lock font resources on Push and miscellaneous direct accesses
2024-02-08 19:53:53 +01:00
goat
47b1dfd7f9
Merge branch 'master' into feature/ifontatlas-lock-safety 2024-02-08 19:04:54 +01:00
KazWolfe
0d10a17966
Make CommandWidget look better (and expose more info) (#1631)
- Expose the plugin that owns the command.
2024-02-08 18:53:51 +01:00
goat
ecf4e8b0e7
Merge pull request #1632 from redstrate/fix-anti-anti-debug-label
Change "Enable AntiDebug" label to "Disable Debugging Protections" to make it clearer
2024-02-07 21:30:22 +01:00
Joshua Goins
8b30781b4c Change "Enable AntiDebug" label to make it clearer
You need to enable this to allow debugging, but the label has the
negative which doesn't make sense. Now it's called "Disable Debugging
Protections" which is what it actually does.
2024-02-07 13:43:16 -05:00
Joshua Goins
7112651b77
Remove EnableWindowsTargeting from build.sh's run step (#1633)
This removes the property that shouldn't be there, because it was
considered a target.
2024-02-07 10:37:55 -08:00
Joshua Goins
1d32e8fe45
Fix language selector throwing a exception, use native name for Taiwan (#1634)
The language selector has only been showing language codes and not the
actual language names since  dd0159ae5a
because "tw" (Taiwan Mandarin) was added and it's not supported by
CultureInfo.

This adds a specific check like the language code to work around this
and stop throwing exceptions. Also converts to a switch so it looks a
bit nicer.
2024-02-07 10:33:35 -08:00
bleatbot
65265b678e
Update ClientStructs (#1626)
Co-authored-by: github-actions[bot] <noreply@github.com>
2024-02-04 10:57:00 -08:00
bleatbot
866c41c2d8
Update ClientStructs (#1623)
Co-authored-by: github-actions[bot] <noreply@github.com>
2024-01-29 18:03:31 -08:00
MidoriKami
0e724be4f8 Fix loc typo 2024-01-28 20:37:30 -08:00
MidoriKami
e065f3e988 Show Name in text prompt 2024-01-28 20:37:30 -08:00
MidoriKami
31c3c1ecc0 Fix reset and reload not working 2024-01-28 20:37:30 -08:00
github-actions[bot]
9d6756fbca Update ClientStructs 2024-01-24 09:47:25 -08:00
Soreepeong
5161053cb3 Move IFontHandle.ImFontLocked to ILockedImFont+impl 2024-01-24 00:19:27 +09:00
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
3cbc689914
Merge pull request #1621 from Soreepeong/fix/fonthandlewrapper
Fix FontHandleWrapper and some docs
2024-01-23 12:21:04 +01:00
Soreepeong
d1291364e0 Fix FontHandleWrapper and some docs 2024-01-23 19:30:20 +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