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

Commit

Permalink
fix: removed the positional feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed May 29, 2023
1 parent 18ab4dc commit d98bf95
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 57 deletions.
1 change: 1 addition & 0 deletions Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
8367,
8581,
9523,
9808,
13262,
13314,
13343,
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public virtual EnemyPositional EnemyPositional
{
if (ConfigurationHelper.ActionPositional.TryGetValue((ActionID)AdjustedID, out var location))
{
return location.Pos;
return location;
}
return EnemyPositional.None;
}
Expand Down
2 changes: 0 additions & 2 deletions RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public class PluginConfiguration : IPluginConfiguration
public bool AddEnemyListToHostile = true;
public bool UseTinctures = false;
public bool UseHealPotions = false;
public bool PositionalFeedback = true;
public bool DrawPositional = true;
public bool DrawMeleeRange = true;
public bool DrawMeleeOffset = true;
Expand Down Expand Up @@ -152,7 +151,6 @@ public class PluginConfiguration : IPluginConfiguration
public bool OnlyHotOnTanks = false;
public bool BeneficialAreaOnTarget = false;

public string PositionalErrorText = string.Empty;
public float CountDownAhead = 0.6f;

public int NamePlateIconId = 61437; // 61435, 0
Expand Down
29 changes: 14 additions & 15 deletions RotationSolver.Basic/Helpers/ConfigurationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@ namespace RotationSolver.Basic.Helpers;

public static class ConfigurationHelper
{
public record PositionalInfo(EnemyPositional Pos, byte[] Tags);
public static readonly SortedList<ActionID, PositionalInfo> ActionPositional = new()
public static readonly SortedList<ActionID, EnemyPositional> ActionPositional = new()
{
{ActionID.FangandClaw, new(EnemyPositional.Flank, new byte[] { 13, 10 })},
{ActionID.WheelingThrust, new(EnemyPositional.Rear, new byte[] { 10, 13 }) },
{ActionID.ChaosThrust, new(EnemyPositional.Rear, new byte[] { 61, 28 }) },
{ActionID.ChaoticSpring, new(EnemyPositional.Rear, new byte[] { 66, 28 }) },
{ActionID.Demolish, new(EnemyPositional.Rear, new byte[] { 46, 60 }) },
{ActionID.SnapPunch, new(EnemyPositional.Flank, new byte[] { 19, 21 }) },
{ActionID.TrickAttack, new(EnemyPositional.Rear, new byte[] { 25 }) },
{ActionID.AeolianEdge,new(EnemyPositional.Rear, new byte[] { 30, 68 }) },
{ActionID.ArmorCrush, new(EnemyPositional.Flank, new byte[] { 30, 66 }) },
{ActionID.Gibbet, new(EnemyPositional.Flank , new byte[] { 11 })},
{ActionID.Gallows, new(EnemyPositional.Rear, new byte[] { 11 }) },
{ActionID.Gekko, new(EnemyPositional.Rear , new byte[] { 68, 29, 72 })},
{ActionID.Kasha, new(EnemyPositional.Flank, new byte[] { 29, 68, 72 }) },
{ActionID.FangandClaw, EnemyPositional.Flank},
{ActionID.WheelingThrust, EnemyPositional.Rear},
{ActionID.ChaosThrust, EnemyPositional.Rear },
{ActionID.ChaoticSpring, EnemyPositional.Rear },
{ActionID.Demolish, EnemyPositional.Rear },
{ActionID.SnapPunch, EnemyPositional.Flank },
{ActionID.TrickAttack, EnemyPositional.Rear },
{ActionID.AeolianEdge,EnemyPositional.Rear },
{ActionID.ArmorCrush, EnemyPositional.Flank },
{ActionID.Gibbet, EnemyPositional.Flank},
{ActionID.Gallows, EnemyPositional.Rear },
{ActionID.Gekko, EnemyPositional.Rear},
{ActionID.Kasha, EnemyPositional.Flank },
};

public static readonly uint[] BadStatus = new uint[]
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"ConfigWindow_Helper_GameVersion": "Game Version",
"ConfigWindow_Helper_OpenSource": "Open the source code URL",
"ConfigWindow_Helper_RunCommand": "Click to execute the command",
"ConfigWindow_Helper_CopyCommand": "Right-click to copy command",
"ConfigWindow_Helper_CopyCommand": "Right-click to copy the command",
"ConfigWindow_Helper_InsertCommand": "Insert \"{0}\" first in {1}s",
"ConfigWindow_Rotation_Description": "You can enable the function for each job you want and configure the setting about how to use actions.",
"ConfigWindow_Rotation_KeyName": "The key name is",
Expand Down
8 changes: 2 additions & 6 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ internal partial class Strings
public string ConfigWindow_Helper_GameVersion { get; set; } = "Game Version";
public string ConfigWindow_Helper_OpenSource { get; set; } = "Open the source code URL";
public string ConfigWindow_Helper_RunCommand { get; set; } = "Click to execute the command";
public string ConfigWindow_Helper_CopyCommand { get; set; } = "Right-click to copy command";
public string ConfigWindow_Helper_CopyCommand { get; set; } = "Right-click to copy the command";
public string ConfigWindow_Helper_InsertCommand { get; set; } = "Insert \"{0}\" first in {1}s";
public string ConfigWindow_Rotation_Description { get; set; } = "You can enable the function for each job you want and configure the setting about how to use actions.";

Expand Down Expand Up @@ -152,18 +152,14 @@ internal partial class Strings
public string ConfigWindow_Param_VoiceVolume { get; set; } = "Voice volume";
public string ConfigWindow_Param_ToastPositional { get; set; } = "Hint positional anticipation by Toast";
public string ConfigWindow_Param_SayPositional { get; set; } = "Hint positional anticipation by shouting";
public string ConfigWindow_Param_PositionalFeedback { get; set; } = "Positional error feedback on flytext";
public string ConfigWindow_Param_DrawPositional { get; set; } = "Draw Positional on the screen";
public string ConfigWindow_Param_DrawMeleeRange { get; set; } = "Draw the range of melee on the screen";

public string ConfigWindow_Param_DrawMeleeOffset { get; set; } = "Draw the offset of melee on the screen";
public string ConfigWindow_Param_AlphaInFill { get; set; } = "The alpha value in fill.";
public string ConfigWindow_Param_ShowMoveTarget { get; set; } = "Show the target of the move action";
public string ConfigWindow_Param_ShowTarget { get; set; } = "Show Target";
public string ConfigWindow_Param_PositionalFeedbackDesc { get; set; } = "Attention: Positional anticipation is experimental, just for reference only.";
public string ConfigWindow_Param_PositionalErrorText { get; set; } = "Positional error prompt";
public string ConfigWindow_Params_LocationWrongTextDesc { get; set; } = "How do you want to be scolded if you have a positional error ?!";
public string ConfigWindow_Param_SayOutStateChanged { get; set; } = "Saying the state changes out";
public string ConfigWindow_Param_SayOutStateChanged { get; set; } = "Saying the state changes out";
public string ConfigWindow_Param_ShowInfoOnDtr { get; set; } = "Display plugin state on server info";
public string ConfigWindow_Param_ShowInfoOnToast { get; set; } = "Display plugin state on toast";
public string ConfigWindow_Param_NamePlateIconId { get; set; } = "Player's name plate icon id when state is on. Recommend 61435, 61437";
Expand Down
7 changes: 1 addition & 6 deletions RotationSolver/UI/OverlayWindow.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
using Dalamud.Interface.Colors;
using Dalamud.Logging;
using Dalamud.Logging;
using ECommons.DalamudServices;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.Game.Event;
using FFXIVClientStructs.FFXIV.Client.Graphics;
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Common.Component.BGCollision;
using RotationSolver.Updaters;
using System.Drawing;

namespace RotationSolver.UI;

Expand Down
11 changes: 1 addition & 10 deletions RotationSolver/UI/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ private void DrawParamAdvanced()
DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_SayPositional,
ref Service.Config.SayPositional, Service.Default.SayPositional);

DrawInputText(LocalizationManager.RightLang.ConfigWindow_Param_PositionalErrorText,
ref Service.Config.PositionalErrorText, 100,
LocalizationManager.RightLang.ConfigWindow_Params_LocationWrongTextDesc);

ImGui.Separator();

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_PoslockCasting,
Expand Down Expand Up @@ -251,15 +247,10 @@ private void DrawParamDisplay()
DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_ToastPositional,
ref Service.Config.ToastPositional, Service.Default.ToastPositional);

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_PositionalFeedback,
ref Service.Config.PositionalFeedback, Service.Default.PositionalFeedback,
LocalizationManager.RightLang.ConfigWindow_Param_PositionalFeedbackDesc);

if (useOverlayWindow)
{
DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_DrawPositional,
ref Service.Config.DrawPositional, Service.Default.DrawPositional,
LocalizationManager.RightLang.ConfigWindow_Param_PositionalFeedbackDesc);
ref Service.Config.DrawPositional, Service.Default.DrawPositional);

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_DrawMeleeRange,
ref Service.Config.DrawMeleeRange, Service.Default.DrawMeleeRange);
Expand Down
5 changes: 2 additions & 3 deletions RotationSolver/Updaters/MajorUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ internal static class MajorUpdater
&& Player.Available && !SocialUpdater.InPvp;

public static bool ShouldPreventActions => Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActions)
&& Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActionsDuty)
&& (Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActionsDuty)
&& Svc.Condition[ConditionFlag.BoundByDuty]
&& !Svc.DutyState.IsDutyStarted
|| Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActions)
&& !DataCenter.HasHostilesInMaxRange;
|| !DataCenter.HasHostilesInMaxRange);

#if DEBUG
private static readonly Dictionary<int, bool> _values = new();
Expand Down
13 changes: 0 additions & 13 deletions RotationSolver/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,5 @@ private static void ActionFromSelf(ActionEffectSet set)
Svc.FlyText.AddFlyText(Dalamud.Game.Gui.FlyText.FlyTextKind.NamedIcon, 0, 0, 0, "Flag:" + flag.ToString(), "",
ImGui.GetColorU32(ImGuiColors.DPSRed), 0, action.Icon);
}

//Positional
if (Service.Config.PositionalFeedback
&& ConfigurationHelper.ActionPositional.TryGetValue((ActionID)action.RowId, out var pos)
&& pos.Tags.Length > 0 && !pos.Tags.Contains(flag))
{
Svc.FlyText.AddFlyText(Dalamud.Game.Gui.FlyText.FlyTextKind.NamedIcon, 0, 0, 0, pos.Pos.ToName(), "",
ImGui.GetColorU32(ImGuiColors.DPSRed), 94662, action.Icon);
if (!string.IsNullOrEmpty(Service.Config.PositionalErrorText))
{
SpeechHelper.Speak(Service.Config.PositionalErrorText);
}
}
}
}
Binary file not shown.

0 comments on commit d98bf95

Please sign in to comment.