Skip to content

Commit f022125

Browse files
MinmooseAsgardXIVHoloWiseBronya-Rand
authored
Brio 0.6.0 Part 1 (#158)
* Update Configuration.cs * DRAFT/DEMO: Goop demo (#120) * Goop demo * Rename var * Typo * Initial Individual Pose auto-save implementation (#141) * Initial implementation of .pose backups of individual actors in a scene * Adapt CleanAllSaves to clean folder structure, general cleanup * Update ActorVFXService.cs * Fix autosave being disabled once you open the FileDialogManager * refactor: goodbye `KeyBindEvents`, hello `InputAction` * feat: implement bone flipping * chore: remove refactor changes from posing * fix: buttons in settings menu * fix: inputs triggering with UI boxes * chore: adjust logic for cameras on new input system * chore: merge code from current drive to git * Refactor keybind config and handling logic * Refactor settings and appearance windows UI, enable dynamic pose * Add UI commands to open Glamourer and CustomizePlus * Update EntityHierarchyView.cs * Hiding this away somewhere :p * Add contributor and supporter data files * Update debug entity, bring in upstream changes * Refactor transform handling in posing overlay * Add multi-entity selection and multi-entity undo support Current bugs / issues: - Does not deselect entity on removal of entity - Allow selections of entities that should not be selectable - Dose not show currently selected actors visually very well with overlay - Should probably have better handling of gizmo, maybe center it with all selected actors? - Probably should also make it so that not all things in the scene manager are useable when in multi-entity mode, maybe even make a custom screen when multiple entities are selected - Maybe show the Actors bones disabled as a way to show what actors are selected * Add accent color to IK button when enabled * Prevent ESC key from being handled when a free cam is active * Use collection expression for Stack initialization * Add snapshot after bone flip * Refactor facewear handling * Improve UI layout and controls in appearance editors * Optimize HasStacks property check * Renamed GroupedHistoryService -> HistoryService Also moved it to where it was meant to be whoops :p * fix build * Add Moonfire Faire 2024 & 2025 festival and update service logic * dev updates * Update UpdateWindow * Update WelcomeService.cs * Fix crash when leaving GPose, and other smaller fixes * Add "Dynamic Face Control" * Update UpdateWindow.cs * Update PosingGraphicalWindow.cs * Update ActorDynamicPoseWidget.cs * Add ImBrioText * Update UpdateWindow.cs * Add new input actions and improve keybind handling * Add option to hide name in GPose settings window * Integrate MCDFService state into UI and autosave logic * Refactor settings UI and add new keybinds * Disable additional bone categories in OverlayFilter * Prevent concurrent MCDF loading and improve UI feedback * Fix warnings * change default target * reset dfc properly * Add supporters and contributors display to UpdateWindow * Update window titles --------- Co-authored-by: Asgard <[email protected]> Co-authored-by: HoloWise <[email protected]> Co-authored-by: Bronya-Rand <[email protected]> Co-authored-by: Azariel <[email protected]>
1 parent 9647701 commit f022125

File tree

97 files changed

+3363
-1378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3363
-1378
lines changed

Brio/Brio.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using Brio.MCDF.Game.Services;
2121
using Brio.Resources;
2222
using Brio.UI;
23+
using Brio.UI.Controls.Stateless;
2324
using Brio.UI.Windows;
2425
using Brio.UI.Windows.Specialized;
2526
using Brio.Web;
@@ -33,7 +34,7 @@ namespace Brio;
3334

3435
public class Brio : IDalamudPlugin
3536
{
36-
public const string Name = "Brio";
37+
public const string Name = "BRIO DEV";
3738

3839
private static ServiceProvider? _services = null;
3940

@@ -119,13 +120,16 @@ private static ServiceCollection SetupServices(DalamudServices dalamudServices)
119120
serviceCollection.AddSingleton<ResourceProvider>();
120121
serviceCollection.AddSingleton<GameDataProvider>();
121122
serviceCollection.AddSingleton<WelcomeService>();
122-
serviceCollection.AddSingleton<InputService>();
123+
serviceCollection.AddSingleton<InputManagerService>();
123124
serviceCollection.AddSingleton<SceneService>();
124125
serviceCollection.AddSingleton<ProjectSystem>();
125126
serviceCollection.AddSingleton<AutoSaveService>();
127+
serviceCollection.AddSingleton<HistoryService>();
126128
serviceCollection.AddSingleton<FileCacheService>();
127129
serviceCollection.AddSingleton<MCDFService>();
128130
serviceCollection.AddSingleton<TransientResourceService>();
131+
serviceCollection.AddSingleton<ActorLookAtService>();
132+
serviceCollection.AddSingleton<CharacterHandlerService>();
129133

130134
// IPC
131135
serviceCollection.AddSingleton<BrioIPCService>();
@@ -145,6 +149,7 @@ private static ServiceCollection SetupServices(DalamudServices dalamudServices)
145149
serviceCollection.AddSingleton<ActorSpawnService>();
146150
serviceCollection.AddSingleton<ActorRedrawService>();
147151
serviceCollection.AddSingleton<ActorAppearanceService>();
152+
serviceCollection.AddSingleton<ActorVFXService>();
148153
serviceCollection.AddSingleton<ActionTimelineService>();
149154
serviceCollection.AddSingleton<GPoseService>();
150155
serviceCollection.AddSingleton<CommandHandlerService>();
@@ -161,7 +166,8 @@ private static ServiceCollection SetupServices(DalamudServices dalamudServices)
161166
serviceCollection.AddSingleton<PhysicsService>();
162167
serviceCollection.AddSingleton<GameInputService>();
163168
serviceCollection.AddSingleton<VirtualCameraManager>();
164-
169+
serviceCollection.AddSingleton<AutoSaveWindow>();
170+
serviceCollection.AddSingleton<MCDFWindow>();
165171
serviceCollection.AddSingleton<CutsceneManager>();
166172

167173
// Library
@@ -195,6 +201,7 @@ private static ServiceCollection SetupServices(DalamudServices dalamudServices)
195201
serviceCollection.AddSingleton<PosingTransformWindow>();
196202
serviceCollection.AddSingleton<CameraWindow>();
197203
serviceCollection.AddSingleton<PosingGraphicalWindow>();
204+
serviceCollection.AddSingleton<ImBrioText>();
198205

199206
return serviceCollection;
200207
}

Brio/Capabilities/Actor/ActorAppearanceCapability.cs

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class ActorAppearanceCapability : ActorCharacterCapability
2828
private readonly CustomizePlusService _customizePlusService;
2929
private readonly GlamourerService _glamourerService;
3030

31+
private readonly CharacterHandlerService _characterHandlerService;
32+
3133
private readonly GPoseService _gposeService;
3234
private readonly IFramework _framework;
3335
private readonly MCDFService _mCDFService;
@@ -71,9 +73,11 @@ public class ActorAppearanceCapability : ActorCharacterCapability
7173
public bool CanMCDF => _mCDFService.IsIPCAvailable;
7274
public bool IsSelf => _targetService.IsSelf(GameObject);
7375

76+
public bool IsAnyMCDFLoading => _mCDFService.IsApplyingMCDF;
77+
7478
public bool IsHidden => CurrentAppearance.ExtendedAppearance.Transparency == 0;
7579

76-
public ActorAppearanceCapability(ActorEntity parent, MCDFService mCDFService, IFramework framework, ActorAppearanceService actorAppearanceService,
80+
public ActorAppearanceCapability(ActorEntity parent,CharacterHandlerService characterHandlerService, MCDFService mCDFService, IFramework framework, ActorAppearanceService actorAppearanceService,
7781
CustomizePlusService customizePlusService, PenumbraService penumbraService, TargetService targetService, GlamourerService glamourerService,
7882
GPoseService gPoseService) : base(parent)
7983
{
@@ -85,17 +89,24 @@ public ActorAppearanceCapability(ActorEntity parent, MCDFService mCDFService, IF
8589
_framework = framework;
8690
_mCDFService = mCDFService;
8791
_targetService = targetService;
92+
_characterHandlerService = characterHandlerService;
8893

8994
Widget = new ActorAppearanceWidget(this);
9095

9196
_gposeService.OnGPoseStateChange += OnGPoseStateChanged;
9297
_penumbraService.OnPenumbraRedraw += OnPenumbraRedraw;
9398
}
9499

95-
public async Task LoadMcdf(string path)
100+
public async Task LoadMCDF(string path)
96101
{
97102
try
98103
{
104+
if(_mCDFService.IsApplyingMCDF)
105+
{
106+
Brio.NotifyError("Another MCDF is loading, Please wait for it to finish.");
107+
return;
108+
}
109+
99110
Entity.LoadingDescription = "Loading MCDF...";
100111
Entity.IsLoading = true;
101112

@@ -139,15 +150,15 @@ public void SetCollection(Guid collection)
139150
if(!IsCollectionOverridden)
140151
_oldCollection = old.ToString();
141152

142-
_ = _actorAppearanceService.Redraw(Character);
153+
_ = _actorAppearanceService.Redraw(Character, HasMCDF);
143154
}
144155
public void ResetCollection()
145156
{
146157
if(IsCollectionOverridden)
147158
{
148159
_penumbraService.SetCollectionForObject(Character, Guid.Parse(_oldCollection!));
149160
_oldCollection = null;
150-
_ = _actorAppearanceService.Redraw(Character);
161+
_ = _actorAppearanceService.Redraw(Character, HasMCDF);
151162
}
152163
}
153164

@@ -334,8 +345,9 @@ public Task ApplyEmperors()
334345
}
335346

336347
public async Task Redraw()
337-
{
338-
await _actorAppearanceService.Redraw(Character);
348+
{
349+
await _actorAppearanceService.Redraw(Character, HasMCDF);
350+
339351
ApplyShaderOverride();
340352

341353
if(Entity is ActorEntity actor && actor.IsProp == true)
@@ -351,7 +363,7 @@ public async Task ResetAppearance()
351363
{
352364
if(HasMCDF)
353365
{
354-
_ = _actorAppearanceService.RevertMCDF(GameObject);
366+
_ = _characterHandlerService.Revert(GameObject);
355367
HasMCDF = false;
356368
}
357369
else

Brio/Capabilities/Actor/ActorDebugCapability.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Brio.Capabilities.Posing;
22
using Brio.Config;
33
using Brio.Entities.Actor;
4+
using Brio.Game.Actor;
45
using Brio.UI.Widgets.Actor;
56
using System.Collections.Generic;
67

@@ -12,10 +13,12 @@ public class ActorDebugCapability : ActorCharacterCapability
1213
public bool IsDebug => _configService.IsDebug;
1314

1415
private readonly ConfigurationService _configService;
16+
private readonly ActorVFXService _vfxService;
1517

16-
public ActorDebugCapability(ActorEntity parent, ConfigurationService configService) : base(parent)
18+
public ActorDebugCapability(ActorEntity parent, ConfigurationService configService, ActorVFXService actorVFXService) : base(parent)
1719
{
1820
_configService = configService;
21+
_vfxService = actorVFXService;
1922

2023
Widget = new ActorDebugWidget(this);
2124
}
@@ -30,4 +33,6 @@ public Dictionary<string, int> SkeletonStacks
3033
return [];
3134
}
3235
}
36+
37+
public ActorVFXService VFXService => _vfxService;
3338
}
Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,71 @@
11
using Brio.Entities.Actor;
22
using Brio.Game.Actor;
3+
using Brio.Game.Actor.Extensions;
4+
using Brio.Game.Camera;
35
using Brio.Game.GPose;
46
using Brio.UI.Widgets.Actor;
7+
using Dalamud.Game.ClientState.Objects.Types;
8+
using Microsoft.Extensions.DependencyInjection;
9+
using System;
10+
using System.Numerics;
11+
using static Brio.Capabilities.Actor.CompanionCapability;
512

613
namespace Brio.Capabilities.Actor;
714
public class ActorDynamicPoseCapability : ActorCharacterCapability
815
{
16+
private readonly ActorLookAtService _actorLookAtService;
917
private readonly ActorAppearanceService _actorAppearanceService;
1018
private readonly GPoseService _gposeService;
19+
private readonly VirtualCameraManager _virtualCameraManager;
1120

12-
public ActorDynamicPoseCapability(ActorEntity parent, ActorAppearanceService actorAppearanceService, GPoseService gPoseService) : base(parent)
21+
public VirtualCamera? Camera => _virtualCameraManager.CurrentCamera;
22+
23+
public ActorDynamicPoseCapability(ActorEntity parent, ActorLookAtService actorLookAtService, VirtualCameraManager virtualCameraManager, ActorAppearanceService actorAppearanceService, GPoseService gPoseService) : base(parent)
1324
{
25+
_actorLookAtService = actorLookAtService;
1426
_actorAppearanceService = actorAppearanceService;
1527
_gposeService = gPoseService;
28+
_virtualCameraManager = virtualCameraManager;
1629

1730
Widget = new ActorDynamicPoseWidget(this);
1831
}
1932

20-
public unsafe void TESTactorlook()
33+
public unsafe void StartLookAt()
2134
{
22-
_actorAppearanceService.TESTactorlook(GameObject);
35+
_actorLookAtService.AddObjectToLook(GameObject);
2336
}
2437

25-
public unsafe void TESTactorlookClear()
38+
public unsafe void StopLookAt()
2639
{
27-
_actorAppearanceService.TESTactorlookClear(GameObject);
40+
_actorLookAtService.RemoveObjectFromLook(GameObject);
41+
}
42+
43+
public unsafe void SetMode(LookAtTargetMode lookAtTargetMode)
44+
{
45+
_actorLookAtService.SetTargetMode(GameObject, lookAtTargetMode);
46+
}
47+
48+
public void SetTargetLock(bool doLock, LookAtTargetType targetType, Vector3 target)
49+
{
50+
_actorLookAtService.SetTargetLock(GameObject, doLock, targetType, target);
51+
}
52+
53+
public void SetTargetType(LookAtTargetType lookAtTarget)
54+
{
55+
_actorLookAtService.SetTargetType(GameObject, lookAtTarget);
56+
}
57+
58+
public LookAtDataHolder? GetData()
59+
{
60+
return _actorLookAtService.GetTargetDataHolder(GameObject);
61+
}
62+
63+
public static ActorDynamicPoseCapability? CreateIfEligible(IServiceProvider provider, ActorEntity entity)
64+
{
65+
if(entity.GameObject is IBattleChara)
66+
return ActivatorUtilities.CreateInstance<ActorDynamicPoseCapability>(provider, entity);
67+
68+
return null;
2869
}
2970

3071
}

Brio/Capabilities/Camera/BrioCameraCapability.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ public class BrioCameraCapability : CameraCapability
1313
private readonly CameraWindow _cameraWindow;
1414
private readonly VirtualCameraManager _virtualCameraService;
1515

16-
public BrioCameraCapability(CameraEntity parent, VirtualCameraManager virtualCameraService, CutsceneManager _cutsceneManager, ConfigurationService _configService, GPoseService gPoseService, CameraWindow cameraWindow) : base(parent, gPoseService)
16+
public BrioCameraCapability(CameraEntity parent, VirtualCameraManager virtualCameraService, GPoseService gPoseService, CameraWindow cameraWindow) : base(parent, gPoseService)
1717
{
1818
_virtualCameraService = virtualCameraService;
1919
_cameraWindow = cameraWindow;
2020

21-
Widget = new BrioCameraWidget(this, _cutsceneManager, _configService);
21+
Widget = new BrioCameraWidget(this);
2222
}
2323

2424
public override void OnEntitySelected()

0 commit comments

Comments
 (0)