Skip to content

Commit

Permalink
- Moved plugin/assembly related code to their own folder (same namesp…
Browse files Browse the repository at this point in the history
…ace).

- Updated interfaces to reflect the use of Result<T>.
- Partial refactor, incomplete.
  • Loading branch information
MapleWheels committed Nov 10, 2024
1 parent a493ff5 commit 93a3f02
Show file tree
Hide file tree
Showing 19 changed files with 356 additions and 283 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public interface IStylesService : IService
/// <param name="package"></param>
/// <param name="path"></param>
/// <returns></returns>
bool TryLoadStylesFile(ContentPackage package, ContentPath path);
FluentResults.Result LoadStylesFile(ContentPackage package, ContentPath path);
/// <summary>
/// Unloads all styles assets and UIStyleProcessor instances.
/// </summary>
void UnloadAllStyles();
FluentResults.Result UnloadAllStyles();

/// <summary>
/// Tries to the get the font asset by xml asset name, returns null on failure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ public partial class PackageService : IStylesResourcesInfo
private readonly Lazy<IStylesService> _stylesService;

public PackageService(
Lazy<IXmlModConfigConverterService> converterService,
Lazy<ILegacyConfigService> legacyConfigService,
Lazy<IModConfigParserService> configParserService,
Lazy<ILuaScriptService> luaScriptService,
Lazy<ILocalizationService> localizationService,
Lazy<IPluginService> pluginService,
Expand All @@ -22,8 +21,7 @@ public PackageService(
IStorageService storageService,
ILoggerService loggerService)
{
_modConfigConverterService = converterService;
_legacyConfigService = legacyConfigService;
_configParserService = configParserService;
_luaScriptService = luaScriptService;
_localizationService = localizationService;
_pluginService = pluginService;
Expand All @@ -36,7 +34,7 @@ public PackageService(

public ImmutableArray<IStylesResourceInfo> StylesResourceInfos => ModConfigInfo?.StylesResourceInfos ?? ImmutableArray<IStylesResourceInfo>.Empty;

public void LoadStyles([NotNull]IStylesResourcesInfo stylesInfo)
public FluentResults.Result LoadStyles([NotNull]IStylesResourcesInfo stylesInfo)
{
throw new NotImplementedException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ namespace Barotrauma.LuaCs.Services;
public partial class PackageService
{
public PackageService(
Lazy<IXmlModConfigConverterService> converterService,
Lazy<ILegacyConfigService> legacyConfigService,
Lazy<IModConfigParserService> configParserService,
Lazy<ILuaScriptService> luaScriptService,
Lazy<ILocalizationService> localizationService,
Lazy<IPluginService> pluginService,
Expand All @@ -18,8 +17,7 @@ public PackageService(
IStorageService storageService,
ILoggerService loggerService)
{
_modConfigConverterService = converterService;
_legacyConfigService = legacyConfigService;
_configParserService = configParserService;
_luaScriptService = luaScriptService;
_localizationService = localizationService;
_pluginService = pluginService;
Expand Down
Loading

0 comments on commit 93a3f02

Please sign in to comment.