- Added float, double settingentry types. Adjusted display formatting.

- Added menu refresh on Apply button.
- Fixed package name resolution for invalid chars.
- Added helper console command to get xml-safe name for use in localization files.
- Made error messages for bad settings xml more descriptive.
- Modified GUISlider.
- Converted HarmonyEventPatchesService to a System.
- Fixed package name resolution for incompatible names in Xml and files, in many places.
- Fixed base textbox implementation for settings.
This commit is contained in:
MapleWheels
2026-03-05 15:45:00 -05:00
parent f38a7bd574
commit 1fe68aa861
16 changed files with 203 additions and 27 deletions
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
using Barotrauma.LuaCs.Data;
using FluentResults;
@@ -75,7 +76,7 @@ public sealed class SettingsFileParserService :
continue;
}
var packageIdent = res.path.ContentPackage!.Name;
var packageIdent = XmlConvert.EncodeLocalName(res.path.ContentPackage!.Name);
foreach (var element in settingElements)
{
@@ -108,7 +109,7 @@ public sealed class SettingsFileParserService :
};
if (!IsInfoValid(newSetting))
{
return ReturnFail($"A setting was invalid. ContentPackage: {res.path.ContentPackage}");
return ReturnFail($"A setting was invalid. ContentPackage: {res.path.ContentPackage.Name}. Name: {newSetting?.InternalName}");
}
parsedInfo.Add(newSetting);
}
@@ -128,7 +129,6 @@ public sealed class SettingsFileParserService :
return info.OwnerPackage != null
&& !info.InternalName.IsNullOrWhiteSpace()
&& !info.DataType.IsNullOrWhiteSpace()
&& !info.DataType.IsNullOrWhiteSpace()
&& info.Element != null
#if CLIENT
&& !info.DisplayName.IsNullOrWhiteSpace()