Skip to content

Commit

Permalink
Merge branch 'Release2.0.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Glyceri committed Jul 26, 2024
2 parents 9293620 + 2007927 commit c53b74c
Show file tree
Hide file tree
Showing 23 changed files with 107 additions and 427 deletions.
1 change: 0 additions & 1 deletion PetNicknames/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ internal class Configuration : IPluginConfiguration
public bool showOnTargetBars = true;
public bool showOnPartyList = true;
// --------------------------- UI SETTINGS ---------------------------
public bool quickButtonsToggle = false;
public bool showKofiButton = true;
public float petNicknamesUIScale = 1.5f;
public bool uiFlare = true;
Expand Down
2 changes: 1 addition & 1 deletion PetNicknames/PetNicknames.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Authors>Glyceri</Authors>
<Company></Company>
<Version>2.0.0.0</Version>
<Version>2.0.0.1</Version>
<Description>A pet nickname plugin.</Description>
<Copyright></Copyright>
<PackageProjectUrl>https://github.com/Glyceri/FFXIVPetRenamer</PackageProjectUrl>
Expand Down
4 changes: 0 additions & 4 deletions PetNicknames/PetNicknames/Hooking/HookTypes/SimpleTextHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,11 @@ public virtual void Setup(DalamudServices services, IPettableUserList userList,

void OnName(INamesDatabase nameDatabase)
{
if (lastPettableUser == null) return;
if (lastPettableUser.DataBaseEntry.ActiveDatabase != nameDatabase) return;
SetDirty();
}

void OnEntry(IPettableDatabaseEntry entry)
{
if (lastPettableUser == null) return;
if (lastPettableUser.DataBaseEntry != entry) return;
SetDirty();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using PetRenamer.PetNicknames.PettableDatabase.Interfaces;
using PetRenamer.PetNicknames.Services;
using System;

namespace PetRenamer.PetNicknames.PettableDatabase;
Expand All @@ -11,13 +10,6 @@ internal class PettableDirtyHandler : IPettableDirtyListener, IPettableDirtyCall
Action<IPettableDatabaseEntry>? OnClear = _ => { };
Action<INamesDatabase>? OnName = _ => { };

readonly DalamudServices DalamudServices;

public PettableDirtyHandler(DalamudServices dalamudServices)
{
DalamudServices = dalamudServices;
}

public void ClearEntry(in IPettableDatabaseEntry entry)
{
OnClear?.Invoke(entry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ namespace PetRenamer.PetNicknames.PettableDatabase;

internal class PettableNameDatabase : INamesDatabase
{
public int[] IDs { get; private set; } = new int[0];
public string[] Names { get; private set; } = new string[0];
public int[] IDs { get; private set; } = [];
public string[] Names { get; private set; } = [];
public int Length { get => IDs.Length; }

IPettableDirtyCaller? DirtyCaller = null;
readonly IPettableDirtyCaller? DirtyCaller = null;

public PettableNameDatabase(int[] ids, string[] names, in IPettableDirtyCaller dirtyCaller)
{
Expand Down
5 changes: 1 addition & 4 deletions PetNicknames/PetNicknames/Serialization/SaveHandler.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
using PetRenamer.PetNicknames.IPC.Interfaces;
using PetRenamer.PetNicknames.PettableDatabase.Interfaces;
using PetRenamer.PetNicknames.PettableUsers.Interfaces;
using PetRenamer.PetNicknames.Services;
using System;

namespace PetRenamer.PetNicknames.Serialization;

internal class SaveHandler : IDisposable
{
readonly DalamudServices DalamudServices;
readonly Configuration Configuration;
readonly IPettableUserList UserList;
readonly IIpcProvider IpcProvider;
readonly IPettableDirtyListener DirtyListener;

public SaveHandler(in DalamudServices dalamudServices, in Configuration configuration, in IPettableUserList userList, in IIpcProvider ipcProvider, in IPettableDirtyListener dirtyListener)
public SaveHandler(in Configuration configuration, in IPettableUserList userList, in IIpcProvider ipcProvider, in IPettableDirtyListener dirtyListener)
{
DalamudServices = dalamudServices;
Configuration = configuration;
UserList = userList;
IpcProvider = ipcProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,17 @@ readonly string GermanReplace(string baseString, sbyte pronoun)
{
try
{
baseString = baseString.Replace("[p]", "");
baseString = baseString.Replace("[a]", checked(pronounList[pronoun]));
return baseString;
}
catch
{
return baseString;
}
baseString = baseString.Replace("[p]", "", System.StringComparison.InvariantCultureIgnoreCase);
baseString = baseString.Replace("[a]", checked(pronounList[pronoun]), System.StringComparison.InvariantCultureIgnoreCase);
} catch { }

return baseString;
}

readonly string[] pronounList = ["er", "e", "es", "en"];
readonly string[] englishStarters = ["the ", string.Empty];
readonly string[] germanStarters = ["den ", "des ", "dem ", "die ", "der ", "das ", string.Empty];
readonly string[] frenchStarters = ["le ", "la ", string.Empty];
readonly string[] frenchStarters = ["le ", "la ", "l'", string.Empty];
readonly string[] japaneseStarters = [string.Empty];

readonly string[] GetList(ClientLanguage clientLanguage) => clientLanguage switch
Expand Down
Loading

0 comments on commit c53b74c

Please sign in to comment.