Commit graph

27 commits

Author SHA1 Message Date
Blair
2e3153c502
Make DalamudPluginInterface into IDalamudPluginInterface (#1807)
* Make DalamudPluginInterface into IDalamudPluginInterface

* Interface UiBuilder
2024-06-29 00:00:57 +02:00
Blair
7947b896ea
Add interfaces to non public/sealed classes referenced in public interfaces (#1808)
* Add interfaces to non public/sealed classes referenced in public interfaces

* Fixed inheritdocs + made most classes internal

* Add missing properties to IFate and Fate, fix documentation

---------

Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
2024-06-28 23:05:34 +02:00
goat
448b0d16ea
Add "loading dialog" for service init, unify blocking logic (#1779)
* wip

* hacky fix for overlapping event text in profiler

* move IsResumeGameAfterPluginLoad logic to PluginManager

* fix some warnings

* handle exceptions properly

* remove ability to cancel, rename button to "hide" instead

* undo Dalamud.Service refactor for now

* warnings

* add explainer, show which plugins are still loading

* add some text if loading takes more than 3 minutes

* undo wrong CS merge
2024-04-21 17:28:37 +02: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
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
af1133f999 Determine optional assets availability on startup 2024-01-21 04:21:26 +09:00
goat
482a607335
fix warnings 2023-10-03 19:04:04 +02:00
goat
4a1b220d4a
fix: register interfaces for provided services 2023-09-30 01:09:25 +02:00
goat
c55b93d3c2
chore: remove IDalamudPlugin.Name 2023-09-23 11:17:53 +02:00
Kaz Wolfe
4f8de2e205
Obsolete (static) PluginLog for future removal
- Mark PluginLog as obsoleted and pending removal, encouraging users to switch to IPluginLog.
- Remove internal references to PluginLog.
2023-09-22 17:01:10 -07:00
KazWolfe
8c51bbf0f8
Add Scoped Plugin Log Service (#1341)
Adds a new `IPluginLog` service to Dalamud, which provides scoped logging on a per-plugin basis. This improves log performance for plugins, and paves the way for per-plugin log levels.

* Plugins must opt in to enable verbose logging by setting `IPluginLog.MinimumLogLevel` to `LogEventLevel.Verbose`. This option is automatically enabled for dev plugins and is currently not persisted.
    * All release plugins will default to `Debug` as their lowest allowed log level.
    * This setting does not override the global log level set in Dalamud.
2023-09-07 17:58:41 +00:00
goat
3272dbb0e2
feat: add OpenMainUi event on UiBuilder, respective button in PI 2023-08-22 22:29:09 +02:00
goat
aa2cd47ef3
fix warnings in injector 2023-06-09 23:38:15 +02:00
goat
daa9f72218
IOC: scoped/on-demand services (#1120) 2023-05-21 22:43:28 +02:00
goaaats
2d90598b70
refactor: make all PluginInterface classes explicitly disposable 2022-01-08 03:00:56 +01:00
Raymond
8b2271d88f Fix CorePlugin on Release 2021-08-27 22:29:32 -04:00
Raymond
a81681834c Update CorePlugin 2021-08-27 08:56:59 -04:00
goat
b5ccc2751a
fix: OpenConfigUi invocation 2021-08-24 19:13:03 +02:00
goat
5f19abd979
fix: wrong parameters for IoC 2021-08-24 01:49:26 +02:00
goat
48081bba7d
feat: inject properties before calling ctor 2021-08-24 00:39:17 +02:00
Raymond
2fe8ccb1da Implement ioc container 2021-08-21 14:03:06 -04:00
Raymond
ff1d7f2829 Implement service locator 2021-08-21 14:03:06 -04:00
goat
c8cd769ec5
refactor: OnOpenConfigUi -> OpenConfigUi 2021-08-11 02:43:02 +02:00
goat
3c65cc95ee
refactor: OnDraw, OnBuildUi -> Draw, 2021-08-11 02:41:51 +02:00
Raymond
9ba3d85b03 Tweak CorePlugin 2021-08-09 10:00:41 -04:00
Raymond
639c7b6183 Add window stub as default 2021-07-15 18:36:34 -04:00
Raymond Lynch
658eedca37 Magic the magic happen 2021-07-11 16:32:32 -04:00