[Milestone] AssemblyLoader completed.
Details: - Assembly Mgmt Service for loading now a separate interface, not intended for normal use. - Assembly Loader work; implemented custom dictionary key and table. - Assembly loading work. - EventService completed. - Moved assembly extensions to ModUtils.cs - Work to event service. NetworkService work - Added ImpromptuInterfaces package. - Networking Service work to support NetVars - Event Service - Added assemblies references package for script compilation. Updated Roslyn version for compatibility. - Package Loading work. Swap Harmony to HarmonyX - More refactor conversion to FluentResults. - Updated StylesService to return Results. - Refactor of PackageService partially complete. - Made IService.Reset() required to return a Result. - Moved plugin/assembly related code to their own folder (same namespace). - Updated interfaces to reflect the use of Result<T>. - Partial refactor, incomplete. - Added 'FluentResults' so we can stop using cursed Exception-based flow control in loading code. - Added 'OneOf' nuget package: https://github.com/mcintyre321/OneOf for the implementation of the Optional<T> pattern and complex discrete return types instead of cursed enums (see current AssemblyManager.cs). - Reapplied old branch changes.
This commit is contained in:
@@ -2,15 +2,17 @@ using Microsoft.Xna.Framework;
|
||||
|
||||
namespace Barotrauma.LuaCs.Configuration;
|
||||
|
||||
public class DisplayableData : IDisplayableData
|
||||
public record DisplayableData : IDisplayableData
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public string ModName { get; private set; }
|
||||
public string DisplayName { get; private set; }
|
||||
public string DisplayModName { get; private set; }
|
||||
public string DisplayCategory { get; private set; }
|
||||
public string Tooltip { get; private set; }
|
||||
public string ImageIcon { get; private set; }
|
||||
public Point IconResolution { get; private set; }
|
||||
public bool ShowWhenNotLoaded { get; private set; }
|
||||
public string InternalName { get; init; }
|
||||
public ContentPackage OwnerPackage { get; init; }
|
||||
public string FallbackPackageName { get; init; }
|
||||
public string DisplayName { get; init; }
|
||||
public string DisplayModName { get; init; }
|
||||
public string DisplayCategory { get; init; }
|
||||
public string Tooltip { get; init; }
|
||||
public string ImageIcon { get; init; }
|
||||
public Point IconResolution { get; init; }
|
||||
public bool ShowWhenNotLoaded { get; init; }
|
||||
public string Description { get; init; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace Barotrauma.LuaCs.Configuration;
|
||||
|
||||
public interface IConfigControl : IConfigBase
|
||||
{
|
||||
event Action<IConfigControl> OnDown;
|
||||
KeyOrMouse Value { get; }
|
||||
bool IsAssignable(KeyOrMouse value);
|
||||
bool TrySetValue(KeyOrMouse value);
|
||||
bool IsDown();
|
||||
}
|
||||
+8
-11
@@ -1,4 +1,5 @@
|
||||
using System.Numerics;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace Barotrauma.LuaCs.Configuration;
|
||||
@@ -6,16 +7,8 @@ namespace Barotrauma.LuaCs.Configuration;
|
||||
/// <summary>
|
||||
/// Contains the Display Data for use with Menus.
|
||||
/// </summary>
|
||||
public interface IDisplayableData
|
||||
public interface IDisplayableData : IDataInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Internal name of the instance.
|
||||
/// </summary>
|
||||
string Name { get; }
|
||||
/// <summary>
|
||||
/// Internal mod name of the instance. ContentPackage name will be used by default.
|
||||
/// </summary>
|
||||
string ModName { get; }
|
||||
/// <summary>
|
||||
/// The name to display in GUIs and Menus.
|
||||
/// </summary>
|
||||
@@ -44,6 +37,10 @@ public interface IDisplayableData
|
||||
/// Whether to show the entry in the menu when not loaded.
|
||||
/// </summary>
|
||||
bool ShowWhenNotLoaded { get; }
|
||||
/// <summary>
|
||||
/// What does this setting do?
|
||||
/// </summary>
|
||||
string Description { get; }
|
||||
}
|
||||
|
||||
public interface IDisplayableInitialize
|
||||
@@ -53,8 +50,8 @@ public interface IDisplayableInitialize
|
||||
// copy this as needed
|
||||
/*public void Initialize(IDisplayableData values)
|
||||
{
|
||||
this.Name = values.Name;
|
||||
this.ModName = values.ModName;
|
||||
this.InternalName = values.InternalName;
|
||||
this.OwnerPackage = values.OwnerPackage;
|
||||
this.DisplayName = values.DisplayName;
|
||||
this.DisplayModName = values.DisplayModName;
|
||||
this.DisplayCategory = values.DisplayCategory;
|
||||
Reference in New Issue
Block a user