Commit graph

4817 commits

Author SHA1 Message Date
github-actions[bot]
fe80490d5e Merge remote-tracking branch 'origin/master' into net8-rollup 2024-03-19 15:04:46 +00:00
srkizer
be63276a85
Rename to Framework.Run (#1728) 2024-03-19 08:04:21 -07:00
Kara
d393fa64b6
Add tests for GameVersionConverter and fix edge case (#1726)
- Adds tests for GameVersionConverter
- Refactors GameVersionConverter to reduce nesting
- Fixes an edge case in GameVersion deserialization in which the JsonConstructor will be invoked even if no properties match
- Adds a test for the GameVersion deserialization edge case
2024-03-18 20:12:34 -07:00
KazWolfe
7fcd10ecd8
Merge pull request #1724 from goatcorp/net8-rollup
[net8] Rollup changes from master
2024-03-18 20:11:31 -07:00
github-actions[bot]
990f04715f Merge remote-tracking branch 'origin/master' into net8-rollup 2024-03-19 03:11:08 +00:00
srkizer
5d473919a1
Hide scheduler from RunOnFrameworkThread (#1725)
* Hide scheduler from RunOnFrameworkThread

Creating new tasks via Task.Run and alike would fetch the current
scheduler, which we do not want in case of running stuff from the
framework thread. Change is to prevent the standard library from seeing
the "current scheduler". If one wants to use `await` with an async
function to be run in the framework thread, one can use
`RunOnFrameworkThreadAwaitable` instead now.

* TaskSchedulerWidget: test better stuff

* TaskSchedulerWidget: add freeze tests

* More comments

* Make TaskFactory a getter method instead of property to avoid bad suggestions

* Why are there stuff still not pushed
2024-03-18 20:10:47 -07:00
srkizer
c709ad1811
Make NotificationManager IInternalDisposableService (#1723)
Pull request merge order shenanigans.
2024-03-16 19:44:10 +00:00
goat
772117ef24
Merge pull request #1721 from goatcorp/net8-rollup
[net8] Rollup changes from master
2024-03-16 17:14:48 +01:00
github-actions[bot]
4abb3535fa Merge remote-tracking branch 'origin/master' into net8-rollup 2024-03-16 16:02:57 +00:00
srkizer
e52c2755cb
Fix CreateImGuiRangesFrom to omit null char (#1709)
* Fix CreateImGuiRangesFrom to omit null char

UnicodeRanges.BasicLatin is [0, 127], but ImGui stops reading the glyph
range list on encountering a zero. Fixed that by ensuring that 0 never
appears in the glyph range list.

* Make problems explicit

---------

Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
2024-03-16 16:02:36 +00:00
srkizer
87b9edb448
Add IInternal/PublicDisposableService (#1696)
* Add IInternal/PublicDisposableService

Plugins are exposed interfaces that are not inherited from
`IDisposable`, but services implementing plugin interfaces often
implement `IDisposable`. Some plugins may try to call
`IDisposable.Dispose` on everything provided, and it also is possible to
use `using` clause too eagerly while working on Dalamud itself, such as
writing `using var smth = await Service<SomeService>.GetAsync();`. Such
behaviors often lead to a difficult-to-debug errors, and making those
services either not an `IDisposable` or making `IDisposable.Dispose` do
nothing if the object has been loaded would prevent such errors. As
`ServiceManager` must be the only class dealing with construction and
disposal of services, `IInternalDisposableService` has been added to
limit who can dispose the object. `IPublicDisposableService` also has
been added to classes that can be constructed and accessed directly by
plugins; for those, `Dispose` will be ignored if the instance is a
service instance, and only `DisposeService` will respond.

In addition, `DalamudPluginInterface` and `UiBuilder` also have been
changed so that their `IDisposable.Dispose` no longer respond, and
instead, internal functions have been added to only allow disposal from
Dalamud.

* Cleanup

* Postmerge fixes

* More explanation on RunOnFrameworkThread(ClearHooks)

* Mark ReliableFileStorage public ctor obsolete

---------

Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
2024-03-16 15:58:05 +00:00
goat
dcec076ca7
Merge pull request #1681 from Soreepeong/feature/inotificationmanager
Implement INotificationManager
2024-03-16 16:46:12 +01:00
Ridan Vandenbergh
0656a524b1
Add missing space in cross-world PF links (#1717) 2024-03-16 16:45:19 +01:00
Kara
1e8fb2e363
Add tests for ReliableFileStorage (#1718) 2024-03-16 16:43:01 +01:00
wolfcomp
3f4a91b726
Handle static declares in AddonLifecycleWidget (#1720)
* Handle static declares

old way: <https://learn.microsoft.com/en-us/dotnet/api/system.delegate.target?view=net-8.0#property-value>

new way: <https://learn.microsoft.com/en-us/dotnet/api/system.reflection.memberinfo.declaringtype?view=net-8.0#property-value>

* get full name instead of class name
2024-03-16 16:42:24 +01:00
goat
44e847a5d6
Dalamud.Plugin.targets TFM => net8.0-windows 2024-03-16 16:41:44 +01:00
srkizer
710fff118d
Remove unnecessary stuff from ObjectTable (#1713)
* Remove unnecessary stuff from ObjectTable

* Remove unused

* fix
2024-03-14 14:37:52 -07:00
Kaz Wolfe
0d7a036ff1
fix: OT caching fix until Kizer can PR a better version 2024-03-13 21:47:47 -07:00
rootdarkarchon
2721e2df16
Resolve stale pointer issues (#1711)
* Resolve stale pointer issues

* remove unncessary FrameworkOnBeforeUpdate

---------

Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
2024-03-13 21:41:02 -07:00
KazWolfe
1128d93fec
Merge pull request #1712 from karashiiro/fix/gameversion-issues
Fix edge case in GameVersion instance creation and refactor
2024-03-13 21:40:36 -07:00
karashiiro
66a04cb45d Fix edge case in GameVersion and refactor
- Test coverage has been added for the entire class, and verbose/redundant code has been refactored
- Fixes JSON serialization: JsonConstructor requires that the ctor parameters match fields/properties of the target class.
Previously, this meant that the JSON constructor would always throw an ArgumentNullException, as `Input` was not a class property.
2024-03-13 21:40:25 -07:00
KazWolfe
e50f9cda99
Merge pull request #1710 from goatcorp/net8-rollup
[net8] Rollup changes from master
2024-03-13 21:40:02 -07:00
github-actions[bot]
458e48c088 Merge remote-tracking branch 'origin/master' into net8-rollup 2024-03-14 04:35:37 +00:00
srkizer
4c18f77f51
Fix log window layout (#1706)
* Fix log window layout

Fixed custom line rendering from not advancing ImGui cursor, and move
input boxes around as log window is resized to become narower.

* Undo unused change
2024-03-13 21:35:14 -07:00
Soreepeong
27e96e12ea Postmerge 2024-03-14 13:08:59 +09:00
Soreepeong
033a57d19d Merge remote-tracking branch 'upstream/master' into feature/inotificationmanager 2024-03-14 13:06:04 +09:00
Soreepeong
9724e511e9 Add INotification.RespectUiHidden 2024-03-14 13:05:46 +09:00
Soreepeong
ecfbcfe194 Draw DefaultIcon instead of installed/3pp icon if plugin is gone 2024-03-14 12:55:28 +09:00
Soreepeong
76ca202f38 Comments on RemoveNonDalamudInvocations 2024-03-14 12:54:12 +09:00
srkizer
cf4a9e3055
Easier SingleFontChooserDialog ctor, window pos/size/flags, and more docs (#1704)
* Make SingleFontChooserDialog ctor less confusing

The current constructor expects a new fresh instance of IFontAtlas,
which can be easy to miss, resulting in wasted time troubleshooting
without enough clues. New constructor is added that directly takes an
instance of UiBuilder, and the old constructor has been obsoleted and
should be changed to private on api 10.

* Add position, size, and window flags conf to SFCD

* Improve documentations

* Add test for PopupPosition/Size

---------

Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
2024-03-14 00:57:30 +01:00
srkizer
a26bb58fdb
Use custom TaskScheduler for Framework.RunOnTick (#1597)
* Use custom TaskScheduler for Framework.RunOnTick

* TaskSchedulerWidget: add example
2024-03-14 00:36:38 +01:00
srkizer
666feede4c
Suppress DAssetM dispose exceptions (#1707)
Whether an asset being unavailable should be an error is decided on
Dalamud startup time. This suppresses assets unavailable exceptions on
Dispose.
2024-03-13 23:36:43 +01:00
rootdarkarchon
31227016c1
Add Object Table Cache (#1708)
Proposed improvement to object table access speeds; prevents creating objects for every plugin iterating the object table.

---------

Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
Co-authored-by: Soreepeong <soreepeong@gmail.com>
2024-03-13 14:13:29 -07:00
Kaz Wolfe
6f2ebdc7a7
Upgrade ClientStructs to .NET 8 2024-03-11 09:15:45 -07:00
KazWolfe
27def97228
Merge pull request #1695 from goatcorp/net8-rollup
[net8] Rollup changes from master
2024-03-10 12:27:25 -07:00
github-actions[bot]
11c1759b60 Merge remote-tracking branch 'origin/master' into net8-rollup 2024-03-08 22:05:05 +00:00
goat
7ee20272de
Merge pull request #1699 from Soreepeong/fix/ime-perf
Fix Chinese IME lagging
2024-03-08 23:04:47 +01:00
goat
0c70d1c273
Merge pull request #1702 from Soreepeong/fix/log-racecon
ConsoleWindow racecon fix and highlight
2024-03-08 22:53:17 +01:00
Soreepeong
14a5e5b652 ConsoleWindow racecon fix and highlight
RollingList is not thread safe, but the lock around it was inconsistent,
resulting in occasional null value in the log list. Fixed by utilizing
ConcurrentQueue so that logs can be added from any thread without locks,
and reading from the queue and adding to the list from the framework
thread.

Also, added log line highlight feature.
2024-03-09 04:09:29 +09:00
Soreepeong
e7815c59d5 fix? 2024-03-09 00:19:00 +09:00
Soreepeong
637ba78956 At least make it not drop character after conversion with google IME 2024-03-09 00:01:54 +09:00
srkizer
88a8d45798
Accommodate nested AddonLifecycle event calls (#1698)
* Accommodate nested AddonLifecycle event calls

The game is free to call event handlers of another addon from one addon,
but the previous code was written under the assumption that only one
function may be called at a time. This changes the recycled addon args
into pooled args.

* Always clear addon name cache
2024-03-07 17:47:11 -08:00
bleatbot
4c0f7b7eba
Update ClientStructs (#1691)
Co-authored-by: github-actions[bot] <noreply@github.com>
2024-03-07 17:13:30 -08:00
Soreepeong
c326537f9f test 2024-03-07 00:37:46 +09:00
Asriel Camora
2cdc1f0171
Fix duty pop chat message italics (#1697) 2024-03-05 17:13:43 +00:00
Aireil
8a21fc721f
feat: add AdjustedTotalCastTime to BattleChara (#1694)
* feat: add AdjustedTotalCastTime to BattleChara

* Update Dalamud/Game/ClientState/Objects/Types/BattleChara.cs

Co-authored-by: KazWolfe <KazWolfe@users.noreply.github.com>

---------

Co-authored-by: KazWolfe <KazWolfe@users.noreply.github.com>
2024-03-04 09:51:25 -08:00
KazWolfe
324806341c
Merge pull request #1641 from goatcorp/net8-rollup
[net8] Rollup changes from master
2024-03-02 08:48:12 -08:00
github-actions[bot]
b68da56e74 Merge remote-tracking branch 'origin/master' into net8-rollup 2024-02-29 23:15:23 +00:00
Asriel Camora
5f62c703bf
Add IContextMenu service (#1682) 2024-02-29 15:15:02 -08:00
srkizer
3d59fa3da0
Sanitize PDB root name from loaded modules (#1687) 2024-02-29 15:13:33 -08:00