No more ExtractText or soft hyphens
This commit is contained in:
@@ -76,7 +76,7 @@ internal static class ActionUtils
|
||||
public static string GetName(this ActionType me, ClassJob classJob)
|
||||
{
|
||||
var (craftAction, action) = GetActionRow(me, classJob);
|
||||
return (craftAction?.Name ?? action?.Name)?.AsSpan().ExtractText() ?? "Unknown";
|
||||
return (craftAction?.Name ?? action?.Name)?.AsSpan().ToString() ?? "Unknown";
|
||||
}
|
||||
|
||||
public static ITextureIcon GetIcon(this ActionType me, ClassJob classJob)
|
||||
@@ -163,7 +163,7 @@ internal static class ClassJobUtils
|
||||
public static string GetName(this ClassJob me)
|
||||
{
|
||||
var job = LuminaSheets.ClassJobSheet.GetRow(me.GetClassJobIndex());
|
||||
return job.Name.ExtractCleanText();
|
||||
return job.Name.ToString();
|
||||
}
|
||||
|
||||
public static string GetNameArticle(this ClassJob me)
|
||||
@@ -180,7 +180,7 @@ internal static class ClassJobUtils
|
||||
public static string GetAbbreviation(this ClassJob me)
|
||||
{
|
||||
var job = LuminaSheets.ClassJobSheet.GetRow(me.GetClassJobIndex());
|
||||
return job.Abbreviation.ExtractText();
|
||||
return job.Abbreviation.ToString();
|
||||
}
|
||||
|
||||
public static Quest GetUnlockQuest(this ClassJob me) =>
|
||||
@@ -298,13 +298,13 @@ internal static class ConditionUtils
|
||||
}
|
||||
|
||||
public static string Name(this Condition me) =>
|
||||
LuminaSheets.AddonSheet.GetRow(me.AddonIds().Name).Text.ExtractText();
|
||||
LuminaSheets.AddonSheet.GetRow(me.AddonIds().Name).Text.ToString();
|
||||
|
||||
public static string Description(this Condition me, bool isRelic)
|
||||
{
|
||||
var text = LuminaSheets.AddonSheet.GetRow(me.AddonIds().Description).Text;
|
||||
if (!text.Any(p => p is { Type: ReadOnlySePayloadType.Macro, MacroCode: MacroCode.Float }))
|
||||
return text.ExtractText();
|
||||
return text.ToString();
|
||||
|
||||
ReadOnlySeString finalText = new();
|
||||
foreach (var payload in text)
|
||||
@@ -314,7 +314,7 @@ internal static class ConditionUtils
|
||||
else
|
||||
finalText += payload;
|
||||
}
|
||||
return finalText.ExtractText();
|
||||
return finalText.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ internal static class EffectUtils
|
||||
{
|
||||
var status = me.Status();
|
||||
var name = new StringBuilder();
|
||||
name.Append(status.Name.ExtractText());
|
||||
name.Append(status.Name.ToString());
|
||||
if (status.MaxStacks != 0)
|
||||
name.Append($" {strength}");
|
||||
if (!status.IsPermanent)
|
||||
|
||||
@@ -129,7 +129,7 @@ public static unsafe class Gearsets
|
||||
}
|
||||
|
||||
public static bool IsSplendorousTool(GearsetItem item) =>
|
||||
LuminaSheets.ItemSheetEnglish.GetRow(item.ItemId).Description.ExtractText().Contains("Increases to quality are 1.75 times higher than normal when material condition is Good.", StringComparison.Ordinal);
|
||||
LuminaSheets.ItemSheetEnglish.GetRow(item.ItemId).Description.ToString().Contains("Increases to quality are 1.75 times higher than normal when material condition is Good.", StringComparison.Ordinal);
|
||||
|
||||
// https://github.com/ffxiv-teamcraft/ffxiv-teamcraft/blob/24d0db2d9676f264edf53651b21005305267c84c/apps/client/src/app/modules/gearsets/materia.service.ts#L265
|
||||
private static int CalculateParamCap(Item item, uint paramId)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
using Dalamud.Utility;
|
||||
using Lumina.Text.ReadOnly;
|
||||
|
||||
namespace Craftimizer.Utils;
|
||||
|
||||
public static class ReadOnlySeStringExtensions
|
||||
{
|
||||
public static string ExtractCleanText(this ReadOnlySeString self)
|
||||
{
|
||||
return self.ExtractText().StripSoftHyphen();
|
||||
}
|
||||
}
|
||||
@@ -572,7 +572,7 @@ public sealed class MacroEditor : Window, IDisposable
|
||||
if (input.ItemId == 0)
|
||||
return "None";
|
||||
|
||||
var name = LuminaSheets.ItemSheet.GetRowOrDefault(input.ItemId)?.Name.ExtractCleanText() ?? $"Unknown ({input.ItemId})";
|
||||
var name = LuminaSheets.ItemSheet.GetRowOrDefault(input.ItemId)?.Name.ToString() ?? $"Unknown ({input.ItemId})";
|
||||
return input.IsHQ ? $"{name} (HQ)" : name;
|
||||
}
|
||||
|
||||
@@ -788,11 +788,11 @@ public sealed class MacroEditor : Window, IDisposable
|
||||
searchableRecipes,
|
||||
fontHandle,
|
||||
ImGui.GetContentRegionAvail().X - rightSideWidth,
|
||||
r => r.Recipe.ItemResult.Value.Name.ExtractCleanText(),
|
||||
r => r.Recipe.ItemResult.Value.Name.ToString(),
|
||||
r => r.Recipe.RowId.ToString(),
|
||||
r =>
|
||||
{
|
||||
ImGui.TextUnformatted($"{r.Recipe.ItemResult.Value.Name.ExtractCleanText()}");
|
||||
ImGui.TextUnformatted($"{r.Recipe.ItemResult.Value.Name}");
|
||||
|
||||
var classJob = (ClassJob)r.Recipe.CraftType.RowId;
|
||||
var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(r.Recipe.RecipeLevelTable.Value!.ClassJobLevel);
|
||||
@@ -975,10 +975,10 @@ public sealed class MacroEditor : Window, IDisposable
|
||||
{
|
||||
var perItem = RecipeData.CalculateItemStartingQuality(idx, 1);
|
||||
var total = RecipeData.CalculateItemStartingQuality(idx, hqCount);
|
||||
ImGuiUtils.Tooltip($"{ingredient.Item.Name.ExtractCleanText()} {SeIconChar.HighQuality.ToIconString()}\n+{perItem} Quality/Item{(total > 0 ? $"\n+{total} Quality" : "")}");
|
||||
ImGuiUtils.Tooltip($"{ingredient.Item.Name} {SeIconChar.HighQuality.ToIconString()}\n+{perItem} Quality/Item{(total > 0 ? $"\n+{total} Quality" : "")}");
|
||||
}
|
||||
else if (ingredient.Amount != 0)
|
||||
ImGuiUtils.Tooltip($"{ingredient.Item.Name.ExtractCleanText()}");
|
||||
ImGuiUtils.Tooltip($"{ingredient.Item.Name}");
|
||||
}
|
||||
ImGui.SameLine(0, 5);
|
||||
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - (5 + ImGui.CalcTextSize("/").X + 5 + ImGui.CalcTextSize($"99").X));
|
||||
@@ -1247,7 +1247,7 @@ public sealed class MacroEditor : Window, IDisposable
|
||||
{
|
||||
var status = effect.Status();
|
||||
using var _reset = ImRaii.DefaultFont();
|
||||
ImGuiUtils.Tooltip($"{status.Name.ExtractCleanText()}\n{status.Description.ExtractCleanText()}");
|
||||
ImGuiUtils.Tooltip($"{status.Name}\n{status.Description}");
|
||||
}
|
||||
ImGui.SameLine();
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
||||
case CraftableStatus.RequiredItem:
|
||||
{
|
||||
var item = RecipeData.Recipe.ItemRequired.Value!;
|
||||
var itemName = item.Name.ExtractCleanText();
|
||||
var itemName = item.Name.ToString();
|
||||
var imageSize = ImGui.GetFrameHeight();
|
||||
|
||||
ImGuiUtils.TextCentered($"You are missing the required equipment.");
|
||||
@@ -621,7 +621,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
||||
case CraftableStatus.RequiredStatus:
|
||||
{
|
||||
var status = RecipeData.Recipe.StatusRequired.Value!;
|
||||
var statusName = status.Name.ExtractCleanText();
|
||||
var statusName = status.Name.ToString();
|
||||
var statusIcon = Service.IconManager.GetIconCached(status.Icon);
|
||||
var imageSize = new Vector2(ImGui.GetFrameHeight() * (statusIcon.AspectRatio ?? 1), ImGui.GetFrameHeight());
|
||||
|
||||
@@ -1136,7 +1136,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
||||
private static (string NpcName, string Territory, Vector2 MapLocation, MapLinkPayload Payload) ResolveLevelData(uint levelRowId)
|
||||
{
|
||||
var level = LuminaSheets.LevelSheet.GetRow(levelRowId);
|
||||
var placeName = level.Territory.Value.PlaceName.Value.Name.ExtractCleanText();
|
||||
var placeName = level.Territory.Value.PlaceName.Value.Name.ToString();
|
||||
var location = WorldToMap2(new(level.X, level.Z), level.Map.Value!);
|
||||
|
||||
return (ResolveNpcResidentName(level.Object.RowId), placeName, location, new(level.Territory.RowId, level.Map.RowId, location.X, location.Y));
|
||||
|
||||
@@ -392,7 +392,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
|
||||
{
|
||||
var status = effect.Status();
|
||||
using var _reset = ImRaii.DefaultFont();
|
||||
ImGuiUtils.Tooltip($"{status.Name.ExtractCleanText()}\n{status.Description.ExtractCleanText()}");
|
||||
ImGuiUtils.Tooltip($"{status.Name}\n{status.Description}");
|
||||
}
|
||||
ImGui.SameLine();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user