[CharacterSwitch] Don't print error in chat when building DTR on unknown character
This commit is contained in:
parent
0fe6450ab1
commit
ee9e43c707
@ -75,7 +75,7 @@ internal sealed class CharacterSwitch : IDisposable
|
||||
UpdateDtrBar();
|
||||
}
|
||||
|
||||
private Target? FindCharacter(int direction)
|
||||
private Target? FindCharacter(int direction, bool showError = true)
|
||||
{
|
||||
_pluginLog.Verbose($"Switching characters ({direction})");
|
||||
|
||||
@ -83,7 +83,8 @@ internal sealed class CharacterSwitch : IDisposable
|
||||
int index = characterIds.IndexOf(_clientState.LocalContentId);
|
||||
if (index < 0)
|
||||
{
|
||||
_chatGui.PrintError("[KitchenSink] Current character not known.");
|
||||
if (showError)
|
||||
_chatGui.PrintError("[KitchenSink] Current character not known.");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -94,7 +95,8 @@ internal sealed class CharacterSwitch : IDisposable
|
||||
target = _autoRetainerApi.GetOfflineCharacterData(characterIds[index]);
|
||||
if (target?.CID == _clientState.LocalContentId)
|
||||
{
|
||||
_chatGui.PrintError("[KitchenSink] No character to switch to found.");
|
||||
if (showError)
|
||||
_chatGui.PrintError("[KitchenSink] No character to switch to found.");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -184,8 +186,8 @@ internal sealed class CharacterSwitch : IDisposable
|
||||
{
|
||||
_dtrBarEntry.Text = seIconChar.ToIconString();
|
||||
|
||||
var previous = FindCharacter(-1);
|
||||
var next = FindCharacter(1);
|
||||
var previous = FindCharacter(-1, showError: false);
|
||||
var next = FindCharacter(1, showError: false);
|
||||
if (previous != null && next != null)
|
||||
_dtrBarEntry.Tooltip = $"Prev: {previous.Name}\nNext: {next.Name}";
|
||||
else if (previous != null)
|
||||
|
Loading…
Reference in New Issue
Block a user