Strip soft hyphens
This commit is contained in:
@@ -14,7 +14,7 @@ using Craftimizer.Utils;
|
|||||||
using Lumina.Text.ReadOnly;
|
using Lumina.Text.ReadOnly;
|
||||||
using Lumina.Text.Payloads;
|
using Lumina.Text.Payloads;
|
||||||
using Lumina.Excel.Sheets;
|
using Lumina.Excel.Sheets;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.Event;
|
using Dalamud.Utility;
|
||||||
|
|
||||||
namespace Craftimizer.Plugin;
|
namespace Craftimizer.Plugin;
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ internal static class ClassJobUtils
|
|||||||
public static string GetName(this ClassJob me)
|
public static string GetName(this ClassJob me)
|
||||||
{
|
{
|
||||||
var job = LuminaSheets.ClassJobSheet.GetRow(me.GetClassJobIndex());
|
var job = LuminaSheets.ClassJobSheet.GetRow(me.GetClassJobIndex());
|
||||||
return job.Name.ExtractText().ToLowerInvariant();
|
return job.Name.ExtractCleanText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetNameArticle(this ClassJob me)
|
public static string GetNameArticle(this ClassJob me)
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
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)
|
if (input.ItemId == 0)
|
||||||
return "None";
|
return "None";
|
||||||
|
|
||||||
var name = LuminaSheets.ItemSheet.GetRowOrDefault(input.ItemId)?.Name.ExtractText() ?? $"Unknown ({input.ItemId})";
|
var name = LuminaSheets.ItemSheet.GetRowOrDefault(input.ItemId)?.Name.ExtractCleanText() ?? $"Unknown ({input.ItemId})";
|
||||||
return input.IsHQ ? $"{name} (HQ)" : name;
|
return input.IsHQ ? $"{name} (HQ)" : name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -778,11 +778,11 @@ public sealed class MacroEditor : Window, IDisposable
|
|||||||
searchableRecipes,
|
searchableRecipes,
|
||||||
fontHandle,
|
fontHandle,
|
||||||
ImGui.GetContentRegionAvail().X - rightSideWidth,
|
ImGui.GetContentRegionAvail().X - rightSideWidth,
|
||||||
r => r.Recipe.ItemResult.Value.Name.ExtractText(),
|
r => r.Recipe.ItemResult.Value.Name.ExtractCleanText(),
|
||||||
r => r.Recipe.RowId.ToString(),
|
r => r.Recipe.RowId.ToString(),
|
||||||
r =>
|
r =>
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted($"{r.Recipe.ItemResult.Value.Name.ExtractText()}");
|
ImGui.TextUnformatted($"{r.Recipe.ItemResult.Value.Name.ExtractCleanText()}");
|
||||||
|
|
||||||
var classJob = (ClassJob)r.Recipe.CraftType.RowId;
|
var classJob = (ClassJob)r.Recipe.CraftType.RowId;
|
||||||
var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(r.Recipe.RecipeLevelTable.Value!.ClassJobLevel);
|
var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(r.Recipe.RecipeLevelTable.Value!.ClassJobLevel);
|
||||||
@@ -964,10 +964,10 @@ public sealed class MacroEditor : Window, IDisposable
|
|||||||
{
|
{
|
||||||
var perItem = RecipeData.CalculateItemStartingQuality(idx, 1);
|
var perItem = RecipeData.CalculateItemStartingQuality(idx, 1);
|
||||||
var total = RecipeData.CalculateItemStartingQuality(idx, hqCount);
|
var total = RecipeData.CalculateItemStartingQuality(idx, hqCount);
|
||||||
ImGuiUtils.Tooltip($"{ingredient.Item.Name.ExtractText()} {SeIconChar.HighQuality.ToIconString()}\n+{perItem} Quality/Item{(total > 0 ? $"\n+{total} Quality" : "")}");
|
ImGuiUtils.Tooltip($"{ingredient.Item.Name.ExtractCleanText()} {SeIconChar.HighQuality.ToIconString()}\n+{perItem} Quality/Item{(total > 0 ? $"\n+{total} Quality" : "")}");
|
||||||
}
|
}
|
||||||
else if (ingredient.Amount != 0)
|
else if (ingredient.Amount != 0)
|
||||||
ImGuiUtils.Tooltip($"{ingredient.Item.Name.ExtractText()}");
|
ImGuiUtils.Tooltip($"{ingredient.Item.Name.ExtractCleanText()}");
|
||||||
}
|
}
|
||||||
ImGui.SameLine(0, 5);
|
ImGui.SameLine(0, 5);
|
||||||
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - (5 + ImGui.CalcTextSize("/").X + 5 + ImGui.CalcTextSize($"99").X));
|
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - (5 + ImGui.CalcTextSize("/").X + 5 + ImGui.CalcTextSize($"99").X));
|
||||||
@@ -1240,7 +1240,7 @@ public sealed class MacroEditor : Window, IDisposable
|
|||||||
{
|
{
|
||||||
var status = effect.Status();
|
var status = effect.Status();
|
||||||
using var _reset = ImRaii.DefaultFont();
|
using var _reset = ImRaii.DefaultFont();
|
||||||
ImGuiUtils.Tooltip($"{status.Name.ExtractText()}\n{status.Description.ExtractText()}");
|
ImGuiUtils.Tooltip($"{status.Name.ExtractCleanText()}\n{status.Description.ExtractCleanText()}");
|
||||||
}
|
}
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
|||||||
case CraftableStatus.RequiredItem:
|
case CraftableStatus.RequiredItem:
|
||||||
{
|
{
|
||||||
var item = RecipeData.Recipe.ItemRequired.Value!;
|
var item = RecipeData.Recipe.ItemRequired.Value!;
|
||||||
var itemName = item.Name.ExtractText();
|
var itemName = item.Name.ExtractCleanText();
|
||||||
var imageSize = ImGui.GetFrameHeight();
|
var imageSize = ImGui.GetFrameHeight();
|
||||||
|
|
||||||
ImGuiUtils.TextCentered($"You are missing the required equipment.");
|
ImGuiUtils.TextCentered($"You are missing the required equipment.");
|
||||||
@@ -644,7 +644,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
|||||||
case CraftableStatus.RequiredStatus:
|
case CraftableStatus.RequiredStatus:
|
||||||
{
|
{
|
||||||
var status = RecipeData.Recipe.StatusRequired.Value!;
|
var status = RecipeData.Recipe.StatusRequired.Value!;
|
||||||
var statusName = status.Name.ExtractText();
|
var statusName = status.Name.ExtractCleanText();
|
||||||
var statusIcon = Service.IconManager.GetIconCached(status.Icon);
|
var statusIcon = Service.IconManager.GetIconCached(status.Icon);
|
||||||
var imageSize = new Vector2(ImGui.GetFrameHeight() * (statusIcon.AspectRatio ?? 1), ImGui.GetFrameHeight());
|
var imageSize = new Vector2(ImGui.GetFrameHeight() * (statusIcon.AspectRatio ?? 1), ImGui.GetFrameHeight());
|
||||||
|
|
||||||
@@ -1158,7 +1158,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
|||||||
private static (string NpcName, string Territory, Vector2 MapLocation, MapLinkPayload Payload) ResolveLevelData(uint levelRowId)
|
private static (string NpcName, string Territory, Vector2 MapLocation, MapLinkPayload Payload) ResolveLevelData(uint levelRowId)
|
||||||
{
|
{
|
||||||
var level = LuminaSheets.LevelSheet.GetRow(levelRowId);
|
var level = LuminaSheets.LevelSheet.GetRow(levelRowId);
|
||||||
var territory = level.Territory.Value.PlaceName.Value.Name.ExtractText();
|
var territory = level.Territory.Value.PlaceName.Value.Name.ExtractCleanText();
|
||||||
var location = WorldToMap2(new(level.X, level.Z), level.Map.Value!);
|
var location = WorldToMap2(new(level.X, level.Z), level.Map.Value!);
|
||||||
|
|
||||||
return (ResolveNpcResidentName(level.Object.RowId), territory, location, new(level.Territory.RowId, level.Map.RowId, location.X, location.Y));
|
return (ResolveNpcResidentName(level.Object.RowId), territory, 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();
|
var status = effect.Status();
|
||||||
using var _reset = ImRaii.DefaultFont();
|
using var _reset = ImRaii.DefaultFont();
|
||||||
ImGuiUtils.Tooltip($"{status.Name.ExtractText()}\n{status.Description.ExtractText()}");
|
ImGuiUtils.Tooltip($"{status.Name.ExtractCleanText()}\n{status.Description.ExtractCleanText()}");
|
||||||
}
|
}
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user