Commit graph

3669 commits

Author SHA1 Message Date
goat
2909c83521
build: 9.0.0.21 2024-02-18 17:16:35 +01:00
srkizer
2d8b71c647
Add SetFontScaleMode(ImFontPtr, FontScaleMode) (#1666)
* Add SetFontScaleMode(ImFontPtr, FontScaleMode)

`IgnoreGlobalScale` was advertised as "excludes the given font from
global scaling", but the intent I had in mind was "excludes the given
font from being scaled in any manner". As the latter functionality is
needed, obsoleted `IgnoreGlobalScale` and added `SetFontScaleMode`.

* Make it correct

* Name consistency
2024-02-18 15:08:07 +01:00
srkizer
7dc99c9307
Fix AddRectFilledDetour typo (#1667)
* Fix AddRectFilledDetour typo

* Skip drawing if zero opacity is specified for drawing
2024-02-18 07:03:51 +00:00
goat
7da47a8a33
build: 9.0.0.20 2024-02-17 19:07:18 +01:00
KazWolfe
c19e1f0fcd
Default Minimum/Maximum WindowSizeConstraints (#1574)
* feat: Default Minimum/Maximum WindowSizeConstraints

If `MinimumSize` or `MaximumSize` are not set when defining a `WindowSizeConstraints`, they will be effectively unbounded.

* chore: Make internal windows unbounded on max size

* Ignore max value if it's smaller than minimum in any dimension
2024-02-17 19:06:41 +01:00
goat
e21b64969f
build: 9.0.0.19 2024-02-17 15:22:27 +01:00
srkizer
cdaa538e1a
Revert "Warn if font files' hashes are unexpected (#1659)"
This reverts commit 307f0fcbe8.
2024-02-17 23:07:49 +09:00
Soreepeong
f825e86e86 Fix B4G4R4A4->B8G8R8A8 channel extraction
On systems without support for B4G4R4A4 pixel format (when DirectX
feature level 11_1 is missing), the conversion will take place; a
copy-and-paste error made the read pointer advance twice as fast as it
should have been.
2024-02-17 22:44:33 +09:00
KazWolfe
0bb69cbd5f
feat: Add /xlprofiler command (#1662)
Make it easier for end users to open the profiler to pull load time reports.
2024-02-17 10:25:43 +01:00
srkizer
307f0fcbe8
Warn if font files' hashes are unexpected (#1659) 2024-02-16 17:19:42 +01:00
srkizer
6497c62622
Change MemoryHelper to allocate less (#1657)
* Change MemoryHelper to allocate less

* Use StringBuilder pool for ReadSeStringAsString

* fix

* Use CreateReadOnlySpanFromNullTerminated where possible
2024-02-16 17:16:21 +01:00
goat
3c4ed64409
Merge pull request #1654 from Haselnussbomber/update-lumina-3.16.0
Bump Lumina to 3.16.0
2024-02-16 00:31:00 +01:00
goat
63f32322f5
Merge pull request #1653 from KazWolfe/crash-menu
feat: Add "deref nullptr in hook" crash item
2024-02-15 02:18:54 +01:00
Haselnussbomber
914cd363fd
Bump Lumina to 3.16.0 2024-02-15 01:45:10 +01:00
Kaz Wolfe
a8bb8cbec5
feat: Add "deref nullptr in hook" crash item
- Move all crash items into submenu
2024-02-14 16:34:45 -08:00
srkizer
ea43d65636
Fix memory ownership on AddFontFromImGuiHeapAllocatedMemory (#1651) 2024-02-14 23:52:40 +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
marzent
df65d59f8b add more exception handler options to dev menu 2024-02-10 13:03:11 +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
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
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
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
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
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
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