Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: fixed some replacing bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 25, 2024
1 parent 7215584 commit ab93fed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 12 additions & 6 deletions FakeName/Hooker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ private unsafe void Framework_Update(IFramework framework)
Replacement.Clear();
Replacement[GetNamesSimple(player.Name.TextValue)] = Service.Config.FakeNameText;

foreach ((var key, var value) in Service.Config.NameDict)
{
Replacement[new string[] { key }] = value;
}

if (!Service.Config.AllPlayerReplace) return;

foreach (var obj in Service.ObjectTable)
Expand Down Expand Up @@ -141,7 +146,8 @@ private unsafe void Framework_Update(IFramework framework)
var item = list->ItemRendererList[i];
var textNode = item.AtkComponentListItemRenderer->AtkComponentButton.ButtonTextNode;

if (Service.Config.FriendList.Add(textNode->NodeText.ToString()))
var text = textNode->NodeText.ToString();
if (!text.Contains('.') && Service.Config.FriendList.Add(text))
{
Service.Config.SaveConfig();
}
Expand Down Expand Up @@ -209,15 +215,15 @@ private static string[] GetNamesFull(string name)

var first = names[0];
var last = names[1];
var firstShort = first.ToUpper()[0] + ".";
var lastShort = last.ToUpper()[0] + ".";
//var firstShort = first.ToUpper()[0] + ".";
//var lastShort = last.ToUpper()[0] + ".";

return new string[]
{
name,
$"{first} {lastShort}",
$"{firstShort} {last}",
$"{firstShort} {lastShort}",
//$"{first} {lastShort}",
//$"{firstShort} {last}",
//$"{firstShort} {lastShort}",
first, last,
};
}
Expand Down
4 changes: 0 additions & 4 deletions FakeName/Windows/ConfigWindow.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using Dalamud.Interface;
using Dalamud.Interface.Windowing;
using FFXIVClientStructs.FFXIV.Client.UI;
using ImGuiNET;
using System;
using System.Drawing;
using System.Linq;
using static Dalamud.Interface.Utility.Raii.ImRaii;

namespace FakeName.Windows;

Expand Down

0 comments on commit ab93fed

Please sign in to comment.