- SettingsMenuService added.

- Added Settings Tab to vanilla SettingsMenu
- Fixed ISystem implementation.
This commit is contained in:
MapleWheels
2026-02-25 15:19:01 -05:00
parent d9d980122d
commit 94556fd6e7
11 changed files with 133 additions and 37 deletions
@@ -0,0 +1,7 @@
namespace Barotrauma.LuaCs;
public interface IClientLoggerService : IReusableService
{
void AddToGUIUpdateList();
void ShowErrorOverlay(string message, float time = 5f, float duration = 1.5f);
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using Barotrauma.LuaCs.Configuration;
using Barotrauma.LuaCs.Data;
using Barotrauma.LuaCs;
using Barotrauma.Networking;
namespace Barotrauma.LuaCs;
public partial interface IConfigService
{
ImmutableArray<IDisplayableConfigBase> GetDisplayableConfigs();
ImmutableArray<IDisplayableConfigBase> GetDisplayableConfigsForPackage(ContentPackage package);
FluentResults.Result<ISettingControl> AddConfigControl(IConfigInfo configInfo);
}
@@ -0,0 +1,6 @@
namespace Barotrauma.LuaCs;
public interface ISettingsMenuSystem : ISystem
{
}
@@ -0,0 +1,75 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using Barotrauma.LuaCs.Data;
using FluentResults;
namespace Barotrauma.LuaCs;
public interface IUIStylesCollection : IService
{
public interface IFactory : IService
{
/// <summary>
/// Returns a new <see cref="IUIStylesCollection"/> for-each <see cref="ContentPath"/> in the given
/// <see cref="IStylesResourceInfo.FilePaths"/> or empty is none.
/// </summary>
/// <param name="info"></param>
/// <param name="storageService"></param>
/// <returns></returns>
IEnumerable<IUIStylesCollection> CreateInstance(IStylesResourceInfo info, IStorageService storageService);
}
/// <summary>
/// The assigned/target <see cref="ContentPath"/> for this collection.
/// </summary>
public ContentPath Path { get; }
/// <summary>
/// Gets the <see cref="GUIFont"/> with the given name.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public Result<GUIFont> GetFont(string name);
/// <summary>
/// Gets the <see cref="GUISprite"/> with the given name.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public Result<GUISprite> GetSprite(string name);
/// <summary>
/// Gets the <see cref="GUISpriteSheet"/> with the given name.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public Result<GUISpriteSheet> GetSpriteSheet(string name);
/// <summary>
/// Gets the <see cref="GUICursor"/> with the given name.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public Result<GUICursor> GetCursor(string name);
/// <summary>
/// Gets the <see cref="GUIColor"/> with the given name.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public Result<GUIColor> GetColor(string name);
#region BAROTRAUMA.UISTYLEFILE
/// <summary>
/// Definition of <see cref="HashlessFile.LoadFile"/>
/// </summary>
internal void LoadFile();
/// <summary>
/// Definition of <see cref="HashlessFile.UnloadFile"/>
/// </summary>
internal void UnloadFile();
/// <summary>
/// Definition of <see cref="HashlessFile.Sort"/>
/// </summary>
internal void Sort();
#endregion
}
@@ -0,0 +1,57 @@
using System.Collections.Immutable;
using Barotrauma.LuaCs.Data;
using FluentResults;
namespace Barotrauma.LuaCs;
public interface IUIStylesService : IReusableService
{
/// <summary>
/// Gets the first loaded <see cref="GUIColor"/>.
/// </summary>
/// <param name="package">The target <see cref="ContentPackage"/></param>
/// <param name="internalName">The targets <see cref="IDataInfo.InternalName"/> as specified in the ModConfig.xml.</param>
/// <param name="assetName">The asset's name as specified in the styles XML file.</param>
/// <returns>A <see cref="FluentResults.Result"/> indicating success, and the target if succeeded.</returns>
public Result<GUIColor> GetColor(ContentPackage package, string internalName, string assetName);
/// <summary>
/// Gets the loaded <see cref="GUICursor"/>.
/// </summary>
/// <param name="package">The target <see cref="ContentPackage"/></param>
/// <param name="internalName">The targets <see cref="IDataInfo.InternalName"/> as specified in the ModConfig.xml.</param>
/// <param name="assetName">The asset's name as specified in the styles XML file.</param>
/// <returns>A <see cref="FluentResults.Result"/> indicating success, and the target if succeeded.</returns>
public Result<GUICursor> GetCursor(ContentPackage package, string internalName, string assetName);
/// <summary>
/// Gets the loaded <see cref="GUIFont"/>.
/// </summary>
/// <param name="package">The target <see cref="ContentPackage"/></param>
/// <param name="internalName">The targets <see cref="IDataInfo.InternalName"/> as specified in the ModConfig.xml.</param>
/// <param name="assetName">The asset's name as specified in the styles XML file.</param>
/// <returns>A <see cref="FluentResults.Result"/> indicating success, and the target if succeeded.</returns>
public Result<GUIFont> GetFont(ContentPackage package, string internalName, string assetName);
/// <summary>
/// Gets the loaded <see cref="GUISprite"/>.
/// </summary>
/// <param name="package">The target <see cref="ContentPackage"/></param>
/// <param name="internalName">The targets <see cref="IDataInfo.InternalName"/> as specified in the ModConfig.xml.</param>
/// <param name="assetName">The asset's name as specified in the styles XML file.</param>
/// <returns>A <see cref="FluentResults.Result"/> indicating success, and the target if succeeded.</returns>
public Result<GUISprite> GetSprite(ContentPackage package, string internalName, string assetName);
/// <summary>
/// Gets the loaded <see cref="GUISpriteSheet"/>.
/// </summary>
/// <param name="package">The target <see cref="ContentPackage"/></param>
/// <param name="internalName">The targets <see cref="IDataInfo.InternalName"/> as specified in the ModConfig.xml.</param>
/// <param name="assetName">The asset's name as specified in the styles XML file.</param>
/// <returns>A <see cref="FluentResults.Result"/> indicating success, and the target if succeeded.</returns>
public Result<GUISpriteSheet> GetSpriteSheet(ContentPackage package, string internalName, string assetName);
public FluentResults.Result LoadAssets(ImmutableArray<IStylesResourceInfo> resources);
public FluentResults.Result UnloadPackages(ImmutableArray<ContentPackage> packages);
public FluentResults.Result UnloadPackage(ContentPackage package);
public FluentResults.Result UnloadAllPackages();
}