diff --git a/RotationSolver.Basic/Configuration/Conditions/DelayCondition.cs b/RotationSolver.Basic/Configuration/Conditions/DelayCondition.cs index ee61175f2..945404db3 100644 --- a/RotationSolver.Basic/Configuration/Conditions/DelayCondition.cs +++ b/RotationSolver.Basic/Configuration/Conditions/DelayCondition.cs @@ -50,7 +50,7 @@ public virtual bool CheckBefore(ICustomRotation rotation) return Player.Available; } - internal static bool CheckBaseAction(ICustomRotation rotation, ActionID id, ref IBaseAction action) + internal static bool CheckBaseAction(ICustomRotation rotation, ActionID id, ref IBaseAction? action) { if (id != ActionID.None && (action == null || (ActionID)action.ID != id)) { diff --git a/RotationSolver.Basic/Configuration/Conditions/MajorConditionSet.cs b/RotationSolver.Basic/Configuration/Conditions/MajorConditionSet.cs index 97d4920a6..d24168ffa 100644 --- a/RotationSolver.Basic/Configuration/Conditions/MajorConditionSet.cs +++ b/RotationSolver.Basic/Configuration/Conditions/MajorConditionSet.cs @@ -53,7 +53,7 @@ public Dictionary DisableConditionDict public ConditionSet HealSingleConditionSet { get; set; } = new(); public ConditionSet DefenseAreaConditionSet { get; set; } = new(); public ConditionSet DefenseSingleConditionSet { get; set; } = new(); - public ConditionSet EsunaStanceNorthConditionSet { get; set; } = new(); + public ConditionSet DispelStancePositionalConditionSet { get; set; } = new(); public ConditionSet RaiseShirkConditionSet { get; set; } = new(); public ConditionSet MoveForwardConditionSet { get; set; } = new(); public ConditionSet MoveBackConditionSet { get; set; } = new(); diff --git a/RotationSolver.Basic/Configuration/Configs.cs b/RotationSolver.Basic/Configuration/Configs.cs index 93a586037..9019c084e 100644 --- a/RotationSolver.Basic/Configuration/Configs.cs +++ b/RotationSolver.Basic/Configuration/Configs.cs @@ -1,547 +1,749 @@ -//using Dalamud.Configuration; -//using Dalamud.Utility; -//using ECommons.DalamudServices; -//using ECommons.ExcelServices; - -//namespace RotationSolver.Basic.Configuration; - -//#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member -//public class PluginConfig : IPluginConfiguration -//{ -// public static PluginConfig Create() -// { -// Svc.Log.Warning("You created a new configuration!"); -// var result = new PluginConfig(); -// result.SetValue(Job.WAR, JobConfigInt.HostileType, 0); -// result.SetValue(Job.DRK, JobConfigInt.HostileType, 0); -// result.SetValue(Job.PLD, JobConfigInt.HostileType, 0); -// result.SetValue(Job.GNB, JobConfigInt.HostileType, 0); -// return result; -// } - -// [JsonProperty] -// private readonly Dictionary _jobsConfig = []; -// public GlobalConfig GlobalConfig { get; private set; } = new(); -// public int Version { get; set; } = 7; - -// public int GetValue(JobConfigInt config) -// => GetJobConfig(DataCenter.Job).Ints.GetValue(config); - -// public float GetValue(JobConfigFloat config) -// => GetJobConfig(DataCenter.Job).Floats.GetValue(config); - -// public int GetValue(PluginConfigInt config) -// => GlobalConfig.Ints.GetValue(config); - -// public bool GetValue(PluginConfigBool config) -// { -// if (config != PluginConfigBool.UseAdditionalConditions -// && GetBoolRaw(PluginConfigBool.UseAdditionalConditions)) -// { -// var rotation = DataCenter.RightNowRotation; -// var set = DataCenter.RightSet; -// if (rotation != null && set != null) -// { -// if (GetEnableBoolRaw(config) && set.GetEnableCondition(config).IsTrue(rotation)) return true; -// if (GetDisableBoolRaw(config) && set.GetDisableCondition(config).IsTrue(rotation)) return false; -// } -// } - -// return GetBoolRaw(config); -// } - -// public bool GetBoolRaw(PluginConfigBool config) -// => GlobalConfig.Bools.GetValue(config); - -// public bool GetDisableBoolRaw(PluginConfigBool config) -// => GlobalConfig.ForcedDisableBools.GetValue(config); -// public bool GetEnableBoolRaw(PluginConfigBool config) -// => GlobalConfig.ForcedEnableBools.GetValue(config); - -// public float GetValue(PluginConfigFloat config) -// => GlobalConfig.Floats.GetValue(config); - -// public Vector4 GetValue(PluginConfigVector4 config) -// => GlobalConfig.Vectors.GetValue(config); - -// public int GetDefault(JobConfigInt config) -// => GetJobConfig(DataCenter.Job).Ints.GetDefault(config); - -// public float GetDefault(JobConfigFloat config) -// => GetJobConfig(DataCenter.Job).Floats.GetDefault(config); - -// public int GetDefault(PluginConfigInt config) -// => GlobalConfig.Ints.GetDefault(config); - -// public bool GetBoolRawDefault(PluginConfigBool config) -// => GlobalConfig.Bools.GetDefault(config); - -// public float GetDefault(PluginConfigFloat config) -// => GlobalConfig.Floats.GetDefault(config); - -// public Vector4 GetDefault(PluginConfigVector4 config) -// => GlobalConfig.Vectors.GetDefault(config); - -// public void SetValue(JobConfigInt config, int value) -// => SetValue(DataCenter.Job, config, value); - -// private void SetValue(Job job, JobConfigInt config, int value) -// { -// var attr = config.GetAttribute(); -// if (attr != null) -// { -// var min = attr.Min; var max = attr.Max; -// if (min != null && max != null) -// { -// value = Math.Min(Math.Max(value, (int)min), (int)max); -// } -// } -// GetJobConfig(job).Ints.SetValue(config, value); -// } - -// public void SetValue(JobConfigFloat config, float value) -// => SetValue(DataCenter.Job, config, value); - -// private void SetValue(Job job, JobConfigFloat config, float value) -// { -// var attr = config.GetAttribute(); -// if (attr != null) -// { -// var min = attr.Min; var max = attr.Max; -// if (min != null && max != null) -// { -// value = MathF.Min(MathF.Max(value, (float)min), (float)max); -// } -// } -// GetJobConfig(job).Floats.SetValue(config, value); -// } - -// public void SetValue(PluginConfigInt config, int value) -// { -// var attr = config.GetAttribute(); -// if (attr != null) -// { -// var min = attr.Min; var max = attr.Max; -// if (min != null && max != null) -// { -// value = Math.Min(Math.Max(value, (int)min), (int)max); -// } -// } -// GlobalConfig.Ints.SetValue(config, value); -// } -// public void SetBoolRaw(PluginConfigBool config, bool value) -// => GlobalConfig.Bools.SetValue(config, value); -// public void SetDisableBoolRaw(PluginConfigBool config, bool value) -// => GlobalConfig.ForcedDisableBools.SetValue(config, value); -// public void SetEnableBoolRaw(PluginConfigBool config, bool value) -// => GlobalConfig.ForcedEnableBools.SetValue(config, value); -// public void SetValue(PluginConfigFloat config, float value) -// { -// var attr = config.GetAttribute(); -// if (attr != null) -// { -// var min = attr.Min; var max = attr.Max; -// if (min != null && max != null) -// { -// value = MathF.Min(MathF.Max(value, (float)min), (float)max); -// } -// } -// GlobalConfig.Floats.SetValue(config, value); -// } - -// public void SetValue(PluginConfigVector4 config, Vector4 value) -// => GlobalConfig.Vectors.SetValue(config, value); - -// public JobConfig GetJobConfig(Job job) -// { -// if (_jobsConfig.TryGetValue(job, out var config)) return config; -// return _jobsConfig[job] = new JobConfig(); -// } - -// public void Save() -// { -//#if DEBUG -// Svc.Log.Information("Saved configurations."); -//#endif -// File.WriteAllText(Svc.PluginInterface.ConfigFile.FullName, -// JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() -// { -// TypeNameHandling = TypeNameHandling.Objects, -// })); -// } -//} - -//#region Job Config -//public class JobConfig -//{ -// public string RotationChoice { get; set; } -// public string PvPRotationChoice { get; set; } -// public DictionConfig Floats { get; set; } = new(); - -// public DictionConfig Ints { get; set; } = new(); -// public Dictionary> RotationsConfigurations { get; set; } = new(); -//} - -//public enum JobConfigInt : byte -//{ -// [Default(2)] HostileType, -// [Default(2, 0, 3)] AddDotGCDCount, -//} - -//public enum JobConfigFloat : byte -//{ -// [Default(0.55f), Unit(ConfigUnitType.Percent)] HealthAreaAbilityHot, -// [Default(0.55f), Unit(ConfigUnitType.Percent)] HealthAreaSpellHot, -// [Default(0.75f), Unit(ConfigUnitType.Percent)] HealthAreaAbility, -// [Default(0.65f), Unit(ConfigUnitType.Percent)] HealthAreaSpell, -// [Default(0.6f), Unit(ConfigUnitType.Percent)] HealthSingleAbilityHot, -// [Default(0.45f), Unit(ConfigUnitType.Percent)] HealthSingleSpellHot, -// [Default(0.7f), Unit(ConfigUnitType.Percent)] HealthSingleAbility, -// [Default(0.55f), Unit(ConfigUnitType.Percent)] HealthSingleSpell, - -// [Default(0.15f), Unit(ConfigUnitType.Percent)] HealthForDyingTanks, -// [Default(1f), Unit(ConfigUnitType.Percent)] HealthForAutoDefense, - -// [Default(0.08f, 0f, 0.5f), Unit(ConfigUnitType.Seconds)] ActionAhead, -//} -//#endregion - -//#region Global -//[Serializable] -//public class GlobalConfig -//{ -// public DictionConfig Ints { get; private set; } = new(); -// public DictionConfig Bools { get; private set; } = new(); -// public DictionConfig ForcedEnableBools { get; private set; } = new(defaultGetter: cmd => false); -// public DictionConfig ForcedDisableBools { get; private set; } = new(defaultGetter: cmd => false); - -// public DictionConfig Floats { get; private set; } = new(); -// public DictionConfig Vectors { get; private set; } = new(new() -// { -// { PluginConfigVector4.TeachingModeColor, new (0f, 1f, 0.8f, 1f)}, -// { PluginConfigVector4.TTKTextColor, new (0f, 1f, 0.8f, 1f)}, -// { PluginConfigVector4.MovingTargetColor, new (0f, 1f, 0.8f, 0.6f)}, -// { PluginConfigVector4.BeneficialPositionColor, new (0.5f, 0.9f, 0.1f, 0.7f)}, -// { PluginConfigVector4.HoveredBeneficialPositionColor, new (1f, 0.5f, 0f, 0.8f)}, - -// { PluginConfigVector4.TargetColor, new (1f, 0.2f, 0f, 0.8f)}, -// { PluginConfigVector4.SubTargetColor, new (1f, 0.9f, 0f, 0.8f)}, -// { PluginConfigVector4.ControlWindowLockBg, new (0, 0, 0, 0.55f)}, -// { PluginConfigVector4.ControlWindowUnlockBg, new (0, 0, 0, 0.75f)}, -// { PluginConfigVector4.InfoWindowBg, new (0, 0, 0, 0.4f)}, -// }); - -// public SortedSet DisabledJobs { get; private set; } = new(); -// public SortedSet DisabledActions { get; private set; } = new(); -// public SortedSet NotInCoolDownActions { get; private set; } = new(); -// public SortedSet NotInMistakeActions { get; private set; } = new(); -// public SortedSet DisabledItems { get; private set; } = new(); -// public SortedSet NotInCoolDownItems { get; private set; } = new(); -// public List Events { get; private set; } = []; - -// public string[] OtherLibs = Array.Empty(); - -// public string[] GitHubLibs = Array.Empty(); -// public List TargetingTypes { get; set; } = new List(); - -// public MacroInfo DutyStart { get; set; } = new MacroInfo(); -// public MacroInfo DutyEnd { get; set; } = new MacroInfo(); -//} - -//public enum PluginConfigInt : byte -//{ -// [Default(0)] ActionSequencerIndex, -// [Default(0)] PoslockModifier, -// [Default(0, 0, 10000)] LessMPNoRaise, - -// [Default(2, 0, 5)] KeyBoardNoiseMin, -// [Default(3)] KeyBoardNoiseMax, - -// [Default(0)] TargetingIndex, -// [Default(0)] BeneficialAreaStrategy, -// [Default(2, 1, 8)] AutoDefenseNumber, -//} - -//public enum PluginConfigBool : byte -//{ -// [Default(true)] DrawIconAnimation, -// [Default(true)] AutoOffBetweenArea, -// [Default(true)] AutoOffCutScene, -// [Default(true)] AutoOffWhenDead, -// [Default(true)] AutoOffWhenDutyCompleted, -// [Default(true)] ChangeTargetForFate, -// [Default(true)] MoveTowardsScreenCenter, -// [Default(true)] SayOutStateChanged, -// [Default(true)] ShowInfoOnDtr, -// [Default(false)] HealOutOfCombat, -// [Default(true)] ShowInfoOnToast, -// [Default(false)] RaiseAll, - -// [Default(false)] PoslockCasting, -// [Default(false)] PosPassageOfArms, -// [Default(true)] PosTenChiJin, -// [Default(false)] PosFlameThrower, -// [Default(false)] PosImprovisation, - -// [Default(true)] RaisePlayerByCasting, -// [Default(true)] RaiseBrinkOfDeath, -// [Default(true)] AddEnemyListToHostile, -// [Default(false)] OnlyAttackInEnemyList, -// [Default(false)] UseTinctures, -// [Default(false)] UseHealPotions, - -// [Default(true)] DrawMeleeOffset, - -// [Default(true)] ShowMoveTarget, -// [Default(false)] ShowTargetTimeToKill, -// [Default(true)] ShowTarget, -// [Default(true)] ChooseAttackMark, -// [Default(true)] CanAttackMarkAOE, -// [Default(true)] FilterStopMark, -// [Default(true)] ShowHostilesIcons, - -// [Default(true)] TeachingMode, -// [Default(true)] UseOverlayWindow, -// [Default(true)] KeyBoardNoise, - -// [Default(true)] MoveAreaActionFarthest, -// [Default(true)] StartOnCountdown, -// [Default(false)] StartOnAttackedBySomeone, -// [Default(false)] NoNewHostiles, - -// [Default(true)] UseHealWhenNotAHealer, -// [Default(false)] SwitchTargetFriendly, - -// [Default(true)] InterruptibleMoreCheck, - -// [Default(false)] UseWorkTask, -// [Default(false)] UseStopCasting, -// [Default(false)] EsunaAll, -// [Default(false)] OnlyAttackInView, -// [Default(false)] OnlyAttackInVisionCone, -// [Default(false)] OnlyHotOnTanks, - -// [Default(false)] InDebug, -// [Default(true)] AutoUpdateLibs, -// [Default(true)] DownloadRotations, -// [Default(true)] AutoUpdateRotations, - -// [Default(false)] ToggleManual, -// [Default(false)] ToggleAuto, -// [Default(true)] OnlyShowWithHostileOrInDuty, -// [Default(false)] ShowControlWindow, -// [Default(false)] IsControlWindowLock, -// [Default(true)] ShowNextActionWindow, -// [Default(false)] IsInfoWindowNoInputs, -// [Default(false)] IsInfoWindowNoMove, -// [Default(false)] ShowItemsCooldown, -// [Default(false)] ShowGCDCooldown, -// [Default(true)] UseOriginalCooldown, - -// [Default(true)] ShowTooltips, -// [Default(false)] AutoLoadCustomRotations, - -// [Default(true)] TargetFatePriority, -// [Default(true)] TargetHuntingRelicLevePriority, -// [Default(true)] TargetQuestPriority, -// [Default(true)] ShowToastsAboutDoAction, - -// [Default(true)] UseAOEAction, -// [Default(false)] UseAOEWhenManual, -// [Default(true)] AutoBurst, -// [Default(true)] AutoHeal, -// [Default(true)] UseAbility, -// [Default(true)] UseDefenseAbility, -// [Default(true)] AutoTankStance, -// [Default(true)] AutoProvokeForTank, -// [Default(true)] AutoUseTrueNorth, -// [Default(true)] RaisePlayerBySwift, -// [Default(true)] AutoSpeedOutOfCombat, -// [Default(true)] UseGroundBeneficialAbility, -// [Default(false)] UseGroundBeneficialAbilityWhenMoving, -// [Default(false)] TargetAllForFriendly, -// [Default(false)] ShowCooldownWindow, - -// [Default(true)] RecordCastingArea, - -// [Default(true)] AutoOffAfterCombat, -// [Default(false)] AutoOpenChest, -// [Default(true)] AutoCloseChestWindow, - -// [Default(true)] ShowStateIcon, -// [Default(true)] ShowBeneficialPositions, -// [Default(false)] HideWarning, - -// [Default(true)] HealWhenNothingTodo, -// [Default(true)] UseResourcesAction, -// [Default(true)] SayHelloToAll, -// [Default(true)] SayHelloToUsers, -// [Default(false)] JustSayHelloOnce, - -// [Default(false)] UseAdditionalConditions, -// [Default(false)] OnlyHealSelfWhenNoHealer, - -// [Default(true)] ShowToggledActionInChat, -//} - -//public enum PluginConfigFloat : byte -//{ -// [Default(30f, 0f, 600f), Unit(ConfigUnitType.Seconds)] AutoOffAfterCombatTime, -// [Default(3f, 0f, 8f), Unit(ConfigUnitType.Yalms)] DrawingHeight, -// [Default(0.2f, 0.005f, 0.05f), Unit(ConfigUnitType.Yalms)] SampleLength, -// [Default(45f, 0f, 90f), Unit(ConfigUnitType.Degree)] AngleOfVisionCone, - - -// [Default(0.25f, 0f, 0.5f), Unit(ConfigUnitType.Percent)] HealthDifference, -// [Default(1f, 0f, 5f), Unit(ConfigUnitType.Yalms)] MeleeRangeOffset, -// [Default(0.1f, 0f, 0.4f), Unit(ConfigUnitType.Seconds)] MinLastAbilityAdvanced, -// [Default(0.8f, 0f, 1f), Unit(ConfigUnitType.Percent)] HealWhenNothingTodoBelow, -// [Default(0.6f, 0f, 1f), Unit(ConfigUnitType.Pixels)] TargetIconSize, - -// [Default(0f, 0f, 1f), Unit(ConfigUnitType.Percent)] MistakeRatio, - -// [Default(0.4f, 0f, 1f), Unit(ConfigUnitType.Percent)] HealthTankRatio, -// [Default(0.4f, 0f, 1f), Unit(ConfigUnitType.Percent)] HealthHealerRatio, - -// [Default(3f, 1f, 20f), Unit(ConfigUnitType.Seconds)] SpecialDuration, - -// [Default(0.06f, 0f, 0.5f), Unit(ConfigUnitType.Seconds)] ActionAheadForLast0GCD, - -// [Default(0f, 0f, 1f), Unit(ConfigUnitType.Seconds)] WeaponDelayMin, -// [Default(0f)] WeaponDelayMax, - -// [Default(1f, 0f, 3f), Unit(ConfigUnitType.Seconds)] DeathDelayMin, -// [Default(1.5f)] DeathDelayMax, - -// [Default(0.5f, 0f, 3f), Unit(ConfigUnitType.Seconds)] WeakenDelayMin, -// [Default(1f)] WeakenDelayMax, - -// [Default(0f, 0f, 3f), Unit(ConfigUnitType.Seconds)] HostileDelayMin, -// [Default(0f)] HostileDelayMax, - -// [Default(0f, 0f, 3f), Unit(ConfigUnitType.Seconds)] HealDelayMin, -// [Default(0f)] HealDelayMax, - -// [Default(0.5f, 0f, 3f), Unit(ConfigUnitType.Seconds)] StopCastingDelayMin, -// [Default(1f)] StopCastingDelayMax, - -// [Default(0.5f, 0f, 3f), Unit(ConfigUnitType.Seconds)] InterruptDelayMin, -// [Default(1f)] InterruptDelayMax, - -// [Default(3f, 0f, 10f), Unit(ConfigUnitType.Seconds)] NotInCombatDelayMin, -// [Default(4f)] NotInCombatDelayMax, - -// [Default(0.1f, 0.05f, 0.25f), Unit(ConfigUnitType.Seconds)] ClickingDelayMin, -// [Default(0.15f)] ClickingDelayMax, - -// [Default(0.5f, 0f, 10f), Unit(ConfigUnitType.Seconds)] ProvokeDelayMin, -// [Default(1f)] ProvokeDelayMax, - -// [Default(0.5f, 0f, 5f), Unit(ConfigUnitType.Seconds)] HealWhenNothingTodoMin, -// [Default(1f)] HealWhenNothingTodoMax, - -// [Default(0.5f, 0f, 3f), Unit(ConfigUnitType.Seconds)] CountdownDelayMin, -// [Default(1f), Unit(ConfigUnitType.Seconds)] CountdownDelayMax, -// [Default(0.4f, 0f, 0.7f), Unit(ConfigUnitType.Seconds)] CountDownAhead, - -// [Default(24f, 0f, 90f), Unit(ConfigUnitType.Degree)] MoveTargetAngle, -// [Default(90f, 10f, 1800f), Unit(ConfigUnitType.Seconds)] BossTimeToKill, -// [Default(10f, 0f, 60f), Unit(ConfigUnitType.Seconds)] DyingTimeToKill, - -// [Default(16f, 9.6f, 96f), Unit(ConfigUnitType.Pixels)] CooldownFontSize, - -// [Default(40f, 0f, 80f), Unit(ConfigUnitType.Pixels)] ControlWindowGCDSize, -// [Default(30f, 0f, 80f), Unit(ConfigUnitType.Pixels)] ControlWindow0GCDSize, -// [Default(30f, 0f, 80f), Unit(ConfigUnitType.Pixels)] CooldownWindowIconSize, -// [Default(1.5f, 0f, 10f), Unit(ConfigUnitType.Percent)] ControlWindowNextSizeRatio, -// [Default(8f), Unit(ConfigUnitType.Pixels)] ControlProgressHeight, -// [Default(1.2f, 0f, 30f), Unit(ConfigUnitType.Yalms)] DistanceForMoving, -// [Default(0.2f, 0.01f, 0.5f), Unit(ConfigUnitType.Seconds)] MaxPing, - -// [Default(8f, 0f, 30f), Unit(ConfigUnitType.Seconds)] AutoHealTimeToKill, -// [Default(0.5f, 0f, 10f), Unit(ConfigUnitType.Pixels)] HostileIconHeight, -// [Default(1f, 0.1f, 10f), Unit(ConfigUnitType.Percent)] HostileIconSize, - -// [Default(1f, 0f, 3f), Unit(ConfigUnitType.Pixels)] StateIconHeight, -// [Default(1f, 0.2f, 10f), Unit(ConfigUnitType.Percent)] StateIconSize, - -// [Default(0.02f, 0f, 1f), Unit(ConfigUnitType.Seconds)] MinUpdatingTime, -// [Default(0.15f), Unit(ConfigUnitType.Percent)] HealthForGuard, -//} - -//public enum PluginConfigVector4 : byte -//{ -// TeachingModeColor, -// MovingTargetColor, -// TargetColor, -// SubTargetColor, -// BeneficialPositionColor, -// HoveredBeneficialPositionColor, -// ControlWindowLockBg, -// ControlWindowUnlockBg, -// InfoWindowBg, -// TTKTextColor, -//} -//#endregion - -//[AttributeUsage(AttributeTargets.Field)] -//public class DefaultAttribute : Attribute -//{ -// public object Default { get; set; } -// public object Min { get; set; } -// public object Max { get; set; } +using Dalamud.Configuration; +using ECommons.DalamudServices; +using ECommons.ExcelServices; -// public DefaultAttribute(object @default, object min = null, object max = null) -// { -// Default = @default; -// Min = min; -// Max = max; -// } -//} - - - - -//public class DictionConfig where TConfig : struct, Enum -//{ -// [JsonProperty] -// private readonly Dictionary configs = new(); - -// private readonly SortedList _defaults; - -// private readonly Func _defaultGetter; - -// public DictionConfig(SortedList @default = null, Func defaultGetter = null) -// { -// _defaults = @default; -// _defaultGetter = defaultGetter ?? ((command) => -// { -// return (TValue)command.GetAttribute()?.Default ?? default; -// }); -// } - -// public TValue GetValue(TConfig command) -// => configs.TryGetValue(command, out var value) ? value -// : GetDefault(command); - -// public TValue GetDefault(TConfig command) -// => _defaults?.TryGetValue(command, out var value) ?? false ? value -// : Get_Default(command); - -// private TValue Get_Default(TConfig command) -// { -// try -// { -// return _defaultGetter(command); -// } -// catch (Exception ex) -// { -// Svc.Log.Warning(ex, "Failed to load the default value."); -// return default; -// } -// } - -// public void SetValue(TConfig command, TValue value) -// => configs[command] = value; -//} -//#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member +namespace RotationSolver.Basic.Configuration; + +internal partial class Configs : IPluginConfiguration +{ + [JsonIgnore] + public const string + BasicTimer = "BasicTimer", + BasicAutoSwitch = "BasicAutoSwitch", + BasicParams = "BasicParams", + UiInformation = "UiInformation", + UiOverlay = "UiOverlay", + UiWindows = "UiWindows", + AutoActionUsage = "AutoActionUsage", + AutoActionCondition = "AutoActionCondition", + TargetConfig = "TargetConfig", + Extra = "Extra", + Rotations = "Rotations", + List = "List", + Debug = "Debug"; + + public int Version { get; set; } = 8; + + public List Events { get; private set; } = []; + public SortedSet DisabledJobs { get; private set; } = []; + + public string[] OtherLibs { get; set; } = []; + + public string[] GitHubLibs { get; set; } = []; + public List TargetingTypes { get; set; } = []; + + public MacroInfo DutyStart { get; set; } = new MacroInfo(); + public MacroInfo DutyEnd { get; set; } = new MacroInfo(); + + [ConditionBool, UI("Show RS logo animation", + Filter =UiWindows)] + private static readonly bool _drawIconAnimation = true; + + [ConditionBool, UI("Auto turn off when player is moving between areas.", + Filter =BasicAutoSwitch)] + private static readonly bool _autoOffBetweenArea = true; + + [ConditionBool, UI("Auto turn off during cutscenes.", + Filter =BasicAutoSwitch)] + private static readonly bool _autoOffCutScene = true; + + [ConditionBool, UI("Auto turn off when dead.", + Filter =BasicAutoSwitch)] + private static readonly bool _autoOffWhenDead = true; + + [ConditionBool, UI("Auto turn off when duty completed.", + Filter =BasicAutoSwitch)] + private static readonly bool _autoOffWhenDutyCompleted = true; + + [ConditionBool, UI("Select only Fate targets in Fate", + Filter = TargetConfig, Section = 1)] + private static readonly bool _changeTargetForFate = true; + + [ConditionBool, UI("Using movement actions towards the object in the center of the screen", + Description = "Using movement actions towards the object in the center of the screen, otherwise toward the facing object.", + Filter = TargetConfig, Section = 2)] + private static readonly bool _moveTowardsScreenCenter = true; + + [ConditionBool, UI("Audio notification for when the status changes", + Filter =UiInformation)] + private static readonly bool _sayOutStateChanged = true; + + [ConditionBool, UI("Display plugin status on server info", + Filter =UiInformation)] + private static readonly bool _showInfoOnDtr = true; + + [ConditionBool, UI("Heal party members outside of combat.", + Filter = AutoActionCondition, Section =1)] + private static readonly bool _healOutOfCombat = false; + + [ConditionBool, UI("Display plugin status on toast", + Filter =UiInformation)] + private static readonly bool _showInfoOnToast = true; + + + + [ConditionBool, UI("Lock the movement when casting or when doing some actions.", + Description = "LT is for gamepad player", Filter = Extra)] + private static readonly bool _poslockCasting = false; + + [UI("", Action = ActionID.PassageOfArmsPvE, Parent = nameof(PoslockCasting))] + public bool PosPassageOfArms { get; set; } = false; + + [UI("", Action = ActionID.TenChiJinPvE, Parent = nameof(PoslockCasting))] + public bool PosTenChiJin { get; set; } = true; + + [UI("", Action = ActionID.FlamethrowerPvE, Parent = nameof(PoslockCasting))] + public bool PosFlameThrower { get; set; } = false; + + [UI("", Action = ActionID.ImprovisationPvE, Parent = nameof(PoslockCasting))] + public bool PosImprovisation { get; set; } = false; + + [ConditionBool, UI("Raise player while swiftcast is on cooldown", + Parent = AutoActionUsage, Section = 2, + PvEFilter = JobFilterType.Raise, PvPFilter = JobFilterType.NoJob)] + private static readonly bool _raisePlayerByCasting = true; + + [ConditionBool, UI("Raise any player in range (even if they are not in your party)", + Parent = AutoActionUsage, Section = 2, + PvEFilter = JobFilterType.Raise, PvPFilter = JobFilterType.NoJob)] + private static readonly bool _raiseAll = false; + + [ConditionBool, UI("Raise players that even have Brink of Death debuff", + Parent = AutoActionUsage, Section = 2, + PvEFilter = JobFilterType.Raise, PvPFilter = JobFilterType.NoJob)] + private static readonly bool _raiseBrinkOfDeath = true; + + [ConditionBool, UI("Add enemy list to the hostile targets.", + Filter = TargetConfig)] + private static readonly bool _addEnemyListToHostile = true; + + [ConditionBool, UI("Only attack the targets in enemy list.", + Parent = nameof(AddEnemyListToHostile))] + private static readonly bool _onlyAttackInEnemyList = false; + + [ConditionBool, UI("Use Tinctures", Filter = AutoActionUsage)] + private static readonly bool _useTinctures = false; + + [ConditionBool, UI("Use HP Potions", Filter = AutoActionUsage)] + private static readonly bool _useHpPotions = false; + + [ConditionBool, UI("Use MP Potions", Filter = AutoActionUsage)] + private static readonly bool _useMpPotions = false; + + [ConditionBool, UI("Draw the offset of melee on the screen", + Filter =UiOverlay)] + private static readonly bool _drawMeleeOffset = true; + + [ConditionBool, UI("Show the target of the move action", + Filter =UiOverlay)] + private static readonly bool _showMoveTarget = true; + + [ConditionBool, UI("Show Target", + Parent =UiOverlay)] + private static readonly bool _showTarget = true; + + [ConditionBool, UI("Show the target's time to kill.", + Parent = UiOverlay)] + private static readonly bool _showTargetTimeToKill = false; + + [ConditionBool, UI("Priority attack targets with attack markers", + Filter = TargetConfig)] + private static readonly bool _chooseAttackMark = true; + + [ConditionBool, UI("Allowed use of AoE to attack more mobs.", + Parent = nameof(ChooseAttackMark))] + private static readonly bool _canAttackMarkAOE = true; + + [ConditionBool, UI("Never attack targets with stop markers", + Filter = TargetConfig)] + private static readonly bool _filterStopMark = true; + + [ConditionBool, UI ("Show the hostile target icon", + Filter = UiOverlay)] + private static readonly bool _showHostilesIcons = true; + + [ConditionBool, UI ("Teaching mode", Filter =UiOverlay)] + private static readonly bool _teachingMode = true; + + [ConditionBool, UI("Display UI Overlay", Description = "This top window is used to display some extra information on your game window, such as target's positional, target and sub-target, etc.", + Filter = UiOverlay)] + private static readonly bool _useOverlayWindow = true; + + [ConditionBool, UI("Simulate the effect of pressing abilities", + Filter =UiInformation)] + private static readonly bool _keyBoardNoise = true; + + [ConditionBool, UI("Target movement area ability to the farthest possible location", Description = "Move to the furthest position for targeting are movement actions.", + Filter = TargetConfig, Section = 2)] + private static readonly bool _moveAreaActionFarthest = true; + + [ConditionBool, UI("Auto mode activation delay on countdown start", + Filter =BasicAutoSwitch, Section = 1)] + private static readonly bool _startOnCountdown = true; + + [ConditionBool, UI("Automatically turn on manual mode and target enemy when being attacked", + Filter =BasicAutoSwitch, Section =1)] + private static readonly bool _startOnAttackedBySomeone = false; + + [ConditionBool, UI("Don't attack new mobs by AoE", Description = "Never use any AoE action when this may attack the mobs that are not hostile targets.", + Parent =nameof(UseAoeAction))] + private static readonly bool _noNewHostiles = false; + + [ConditionBool, UI("Use healing abilities when playing a non-healer role", + Filter = AutoActionCondition, Section = 1, + PvEFilter = JobFilterType.NoHealer, PvPFilter = JobFilterType.NoJob)] + private static readonly bool _useHealWhenNotAHealer = true; + + [ConditionBool, UI("Target allies for friendly actions.", + Filter = TargetConfig, Section = 3)] + private static readonly bool _switchTargetFriendly = false; + + [ConditionBool, UI("Use interrupt abilities if possible.", + Filter = AutoActionCondition, Section = 3, + PvEFilter = JobFilterType.Interrupt, + PvPFilter = JobFilterType.NoJob)] + private static readonly bool _interruptibleMoreCheck = true; + + [ConditionBool, UI("Use work task for acceleration.", + Filter =BasicParams)] + private static readonly bool _useWorkTask = false; + + [ConditionBool, UI("Stops casting when the target is dead.", Filter = Extra)] + private static readonly bool _useStopCasting = false; + + [ConditionBool, UI("Cleanse all dispellable debuffs.", + Filter = AutoActionCondition, Section = 3, + PvEFilter = JobFilterType.Dispel, PvPFilter = JobFilterType.NoJob)] + private static readonly bool _dispelAll = false; + + [ConditionBool, UI("Only attack the target in view.", + Filter = TargetConfig, Section = 1)] + private static readonly bool _onlyAttackInView = false; + + [ConditionBool, UI("Only attack the targets in vision cone", + Filter = TargetConfig, Section = 1)] + private static readonly bool _onlyAttackInVisionCone = false; + + [ConditionBool, UI("Use single target healing over time actions only on tanks", + Filter = AutoActionCondition, Section = 1, + PvEFilter = JobFilterType.Healer, PvPFilter = JobFilterType.Healer)] + private static readonly bool _onlyHotOnTanks = false; + + [ConditionBool, UI("Debug Mode", Filter = Debug)] + private static readonly bool _inDebug = false; + public bool AutoUpdateLibs { get; set; } = true; + + [ConditionBool, UI("Auto Download Rotations", Filter = Rotations)] + private static readonly bool _downloadRotations = true; + + [ConditionBool, UI("Auto Update Rotations", Parent = nameof(DownloadRotations))] + private static readonly bool _autoUpdateRotations = true; + + [ConditionBool, UI("Make /rotation Manual as a toggle command.", + Filter = BasicParams)] + private static readonly bool _toggleManual = false; + + [ConditionBool, UI("Make /rotation Auto as a toggle command.", + Filter =BasicParams)] + private static readonly bool _toggleAuto = false; + + [ConditionBool, UI("Only show these windows if there are enemies in or in duty", + Filter =UiWindows)] + private static readonly bool _onlyShowWithHostileOrInDuty = true; + + [ConditionBool, UI("Show Control Window", + Filter =UiWindows)] + private static readonly bool _showControlWindow = false; + + [ConditionBool, UI("Is Control Window Lock", + Filter = UiWindows)] + private static readonly bool _isControlWindowLock = false; + + [ConditionBool, UI("Show Next Action Window", Filter = UiWindows)] + private static readonly bool _showNextActionWindow = true; + + [ConditionBool, UI("No Inputs", Parent = nameof(ShowNextActionWindow))] + private static readonly bool _isInfoWindowNoInputs = false; + + [ConditionBool, UI("No Move", Parent = nameof(ShowNextActionWindow))] + private static readonly bool _isInfoWindowNoMove = false; + + [ConditionBool, UI("Show Items' Cooldown", + Parent = nameof(ShowCooldownWindow))] + private static readonly bool _showItemsCooldown = false; + + [ConditionBool, UI("Show GCD' Cooldown", + Parent = nameof(ShowCooldownWindow))] + private static readonly bool _showGCDCooldown = false; + + [ConditionBool, UI("Show Original Cooldown", + Parent = nameof(ShowCooldownWindow))] + private static readonly bool _useOriginalCooldown = true; + + [ConditionBool, UI("Show tooltips", + Filter = UiInformation)] + private static readonly bool _showTooltips = true; + + [ConditionBool, UI("Auto load rotations", + Filter = Rotations)] + private static readonly bool _autoLoadCustomRotations = false; + + [ConditionBool, UI("Target Fate priority", + Filter = TargetConfig, Section = 1)] + private static readonly bool _targetFatePriority = true; + + [ConditionBool, UI("Target Hunt/Relic/Leve priority.", + Filter = TargetConfig, Section = 1)] + private static readonly bool _targetHuntingRelicLevePriority = true; + + [ConditionBool, UI("Target quest priority.", + Filter = TargetConfig, Section = 1)] + + private static readonly bool _targetQuestPriority = true; + + [ConditionBool, UI("Display do action feedback on toast", + Filter =UiInformation)] + private static readonly bool _showToastsAboutDoAction = true; + + [ConditionBool, UI("Use AoE actions", Filter = AutoActionUsage)] + private static readonly bool _useAOEAction = true; + + [ConditionBool, UI("Use AoE actions in manual mode", Parent = nameof(UseAoeAction))] + private static readonly bool _useAOEWhenManual = false; + + [ConditionBool, UI("Automatically trigger dps burst phase", Filter = AutoActionCondition)] + private static readonly bool _autoBurst = true; + + [ConditionBool, UI("Automatic Heal")] + private static readonly bool _autoHeal = true; + + [ConditionBool, UI("Auto-use abilities", Filter = AutoActionUsage)] + private static readonly bool _useAbility = true; + + [ConditionBool, UI("Use defensive abilities", Description = "It is recommended to check this option if you are playing Raids or you can plan the heal and defense ability usage by yourself.", + Parent = nameof(UseAbility))] + private static readonly bool _useDefenseAbility = true; + + [ConditionBool, UI("Automatically activate tank stance", Parent =nameof(UseAbility), + PvEFilter = JobFilterType.Tank)] + private static readonly bool _autoTankStance = true; + + [ConditionBool, UI("Auto provoke non-tank attacking targets", Description = "Automatically use provoke when an enemy is attacking a non-tank member of the party.", + Parent = nameof(UseAbility), PvEFilter = JobFilterType.Tank)] + private static readonly bool _autoProvokeForTank = true; + + [ConditionBool, UI("Auto TrueNorth (Melee)", + Parent = nameof(UseAbility), + PvEFilter = JobFilterType.Melee)] + private static readonly bool _autoUseTrueNorth = true; + + [ConditionBool, UI("Raise player by using swiftcast if avaliable", + Parent = nameof(UseAbility), + PvEFilter = JobFilterType.Healer)] + private static readonly bool _raisePlayerBySwift = true; + + [ConditionBool, UI("Use movement speed increase abilities when out of combat.", Parent = nameof(UseAbility))] + private static readonly bool _autoSpeedOutOfCombat = true; + + [ConditionBool, UI("Use beneficial ground-targeted actions", Parent = nameof(UseAbility), + PvEFilter = JobFilterType.Healer)] + private static readonly bool _useGroundBeneficialAbility = true; + + [ConditionBool, UI("Use beneficial AoE actions when moving.", Parent = nameof(UseGroundBeneficialAbility))] + private static readonly bool _useGroundBeneficialAbilityWhenMoving = false; + + [ConditionBool, UI("Target all for friendly actions (include passerby)", + Filter = TargetConfig, Section = 3)] + private static readonly bool _targetAllForFriendly = false; + + [ConditionBool, UI("Show Cooldown Window", Filter = UiWindows)] + private static readonly bool _showCooldownWindow = false; + + [ConditionBool, UI("Record AOE actions", Filter = List)] + private static readonly bool _recordCastingArea = true; + + [ConditionBool, UI("Auto turn off RS when combat is over more for more then...", + Filter =BasicAutoSwitch)] + private static readonly bool _autoOffAfterCombat = true; + + [ConditionBool, UI("Auto Open the treasure chest", + Filter = Extra)] + private static readonly bool _autoOpenChest = false; + + [ConditionBool, UI("Auto close the loot window when auto opened the chest.", + Parent = nameof(AutoOpenChest))] + private static readonly bool _autoCloseChestWindow = true; + + [ConditionBool, UI("Show RS state icon", Filter = UiOverlay)] + private static readonly bool _showStateIcon = true; + + [ConditionBool, UI("Show beneficial AoE locations.", Filter = UiOverlay)] + private static readonly bool _showBeneficialPositions = true; + + [ConditionBool, UI("Hide all warnings", + Filter = UiInformation)] + private static readonly bool _hideWarning = false; + + [ConditionBool, UI("Healing the members with GCD if there is nothing to do in combat.", + Filter = AutoActionCondition, Section = 1)] + private static readonly bool _healWhenNothingTodo = true; + + //[ConditionBool, UI("Use actions that use resources", Filter = AutoActionUsage)] + //private static readonly bool _useResourcesAction = true; + + [ConditionBool, UI("Say hello to all users of Rotation Solver.", + Filter =BasicParams)] + private static readonly bool _sayHelloToAll = true; + + [ConditionBool, UI("Say hello to the users of Rotation Solver.", Description = "It can only be disabled for users, not authors and contributors.\nIf you want to be greeted by other users, please DM ArchiTed in Discord Server with your Hash!", + Parent =nameof(SayHelloToAll))] + private static readonly bool _sayHelloToUsers = true; + + [ConditionBool, UI("Just say hello once to the same user.", + Parent = nameof(SayHelloToAll))] + private static readonly bool _justSayHelloOnce = false; + + [ConditionBool, UI("Only Heal self When Not a healer", + Filter = AutoActionCondition, Section = 1, + PvPFilter = JobFilterType.NoHealer, PvEFilter = JobFilterType.NoHealer)] + private static readonly bool _onlyHealSelfWhenNoHealer = false; + + [ConditionBool, UI("Display toggle action feedback on chat", + Filter =UiInformation)] + private static readonly bool _showToggledActionInChat = true; + + [UI("Use additional conditions", Filter = BasicParams)] + public bool UseAdditionalConditions { get; set; } = false; + + #region Float + [UI("Auto turn off RS when combat is over more for more then...", + Parent =nameof(AutoOffAfterCombat))] + [Range(0, 600, ConfigUnitType.Seconds)] + public float AutoOffAfterCombatTime { get; set; } = 30; + + [UI("The height of the drawing things.", Parent =nameof(UseOverlayWindow))] + [Range(0, 8, ConfigUnitType.Yalms, 0.02f)] + public float DrawingHeight { get; set; } = 3; + + [UI("Drawing smoothness.", Parent = nameof(UseOverlayWindow))] + [Range(0.005f, 0.05f, ConfigUnitType.Yalms, 0.001f)] + public float SampleLength { get; set; } = 0.2f; + + [UI("The angle of your vision cone", Parent = nameof(OnlyAttackInVisionCone))] + [Range(0, 90, ConfigUnitType.Degree, 0.02f)] + public float AngleOfVisionCone { get; set; } = 45; + + [UI("HP for standard deviation for using AoE heal.", Parent = nameof(UseHealWhenNotAHealer))] + [Range(0, 0.5f, ConfigUnitType.Percent, 0.02f)] + public float HealthDifference { get; set; } = 0.25f; + + [UI("Melee Range action using offset", + Filter = AutoActionCondition, Section = 3, + PvEFilter = JobFilterType.Melee, PvPFilter = JobFilterType.NoJob)] + [Range(0, 5, ConfigUnitType.Yalms, 0.02f)] + public float MeleeRangeOffset { get; set; } = 1; + + [UI("The time ahead of the last oGCD before the next GCD being avaliable to start trying using it (may affect skill weaving)", + Filter = BasicTimer)] + [Range(0, 0.4f, ConfigUnitType.Seconds, 0.002f)] + public float MinLastAbilityAdvanced { get; set; } = 0.1f; + + [UI("When their minimum HP is lower than this.", Parent = nameof(HealWhenNothingTodo))] + [Range(0, 1, ConfigUnitType.Percent, 0.002f)] + public float HealWhenNothingTodoBelow { get; set; } = 0.8f; + + [UI("The size of the next ability that will be used icon.", + Parent =nameof(ShowTarget))] + [Range(0, 1, ConfigUnitType.Pixels, 0.002f)] + public float TargetIconSize { get; set; } = 0.6f; + + [UI("How likely is it that RS will click the wrong action.", + Filter = BasicParams)] + [Range(0, 1, ConfigUnitType.Percent, 0.002f)] + public float MistakeRatio { get; set; } = 0; + + [UI("Heal tank first if its HP is lower than this.", + Filter = AutoActionCondition, Section = 1, + PvEFilter = JobFilterType.Healer, PvPFilter = JobFilterType.Healer)] + [Range(0, 1, ConfigUnitType.Percent, 0.02f)] + public float HealthTankRatio { get; set; } = 0.4f; + + [UI("Heal healer first if its HP is lower than this.", + Filter = AutoActionCondition, Section = 1, + PvEFilter = JobFilterType.Healer, PvPFilter = JobFilterType.Healer)] + [Range(0, 1, ConfigUnitType.Percent, 0.02f)] + public float HealthHealerRatio { get; set; } = 0.4f; + + [UI("The duration of special windows set by commands", + Filter =BasicTimer, Section = 1)] + [Range(1, 20, ConfigUnitType.Seconds, 1f)] + public float SpecialDuration { get; set; } = 3; + + [UI("The time before an oGCD is avaliable to start trying using it", + Filter = BasicTimer)] + [Range(0, 0.5f, ConfigUnitType.Seconds, 0.002f)] + public float ActionAheadForLast0GCD { get; set; } = 0.06f; + + [UI("This is the delay time.")] + [Range(0, 3, ConfigUnitType.Seconds)] + public Vector2 TargetDelay { get; set; } = new(0, 0); + + [UI("This is the clipping time.\nGCD is over. However, RS forgets to click the next action.", + Filter = BasicTimer)] + [Range(0, 1, ConfigUnitType.Seconds, 0.002f)] + public Vector2 WeaponDelay { get; set; } = new(0, 0); + + [UI("The range of random delay for stopping casting when the target is dead or immune to damage.", + Parent = nameof(UseStopCasting))] + [Range(0, 3, ConfigUnitType.Seconds, 0.002f)] + public Vector2 StopCastingDelay { get; set; } = new(0.5f, 1); + + [UI("The range of random delay for interrupting hostile targets.", + Filter = AutoActionCondition, Section = 3, + PvEFilter = JobFilterType.Interrupt, PvPFilter = JobFilterType.NoJob)] + [Range(0, 3, ConfigUnitType.Seconds, 0.002f)] + public Vector2 InterruptDelay { get; set; } = new(0.5f, 1); + + [UI("The delay of provoke.", Parent = nameof(AutoProvokeForTank))] + [Range(0, 10, ConfigUnitType.Seconds, 0.05f)] + public Vector2 ProvokeDelay { get; set; } = new(0.5f, 1); + + [UI("The range of random delay for Not In Combat.", + Filter =BasicParams)] + [Range(0, 10, ConfigUnitType.Seconds, 0.002f)] + public Vector2 NotInCombatDelay { get; set; } = new(3, 4); + + [UI("The range of random delay for clicking actions.", + Filter =BasicTimer)] + [Range(0.05f, 0.25f, ConfigUnitType.Seconds, 0.002f)] + public Vector2 ClickingDelay { get; set; } = new(0.1f, 0.15f); + + [UI("The delay of this type of healing.", Parent = nameof(HealWhenNothingTodo))] + [Range(0, 5, ConfigUnitType.Seconds, 0.05f)] + public Vector2 HealWhenNothingTodoDelay { get; set; } = new(0.5f, 1); + + [UI("The random delay between which auto mode activation on countdown varies.", + Parent =nameof(StartOnCountdown))] + [Range(0, 3, ConfigUnitType.Seconds, 0.002f)] + public Vector2 CountdownDelay { get; set; } = new(0.5f, 1); + + [UI("The starting when abilities will be used before finishing the countdown", + Filter =BasicTimer, Section = 1, PvPFilter = JobFilterType.NoJob)] + [Range(0, 0.7f, ConfigUnitType.Seconds, 0.002f)] + public float CountDownAhead { get; set; } = 0.4f; + + [UI("The size of the sector angle that can be selected as the moveable target", + Description = "If the selection mode is based on character facing, i.e., targets within the character's viewpoint are moveable targets. \nIf the selection mode is screen-centered, i.e., targets within a sector drawn upward from the character's point are movable targets.", + Filter = TargetConfig, Section = 2)] + [Range(0, 90, ConfigUnitType.Degree, 0.02f)] + public float MoveTargetAngle { get; set; } = 24; + + [UI("If target's time until death is higher than this, regard it as boss.", + Filter = TargetConfig, Section = 1)] + [Range(10, 1800, ConfigUnitType.Seconds, 0.02f)] + public float BossTimeToKill { get; set; } = 90; + + + [UI("If target's time until death is lower than this, regard it is dying.", + Filter = TargetConfig, Section = 1)] + [Range(0, 60, ConfigUnitType.Seconds, 0.02f)] + public float DyingTimeToKill { get; set; } = 10; + + [UI("Change the cooldown font size.", Parent = nameof(ShowCooldownWindow))] + [Range(9.6f, 96, ConfigUnitType.Pixels, 0.1f)] + public float CooldownFontSize { get; set; } = 16; + + [UI("Cooldown window icon size", Parent = nameof(ShowCooldownWindow))] + [Range(0, 80, ConfigUnitType.Pixels, 0.2f)] + public float CooldownWindowIconSize { get; set; } = 30; + + [UI("Next Action Size Ratio", Parent = nameof(ShowControlWindow))] + [Range(0, 10, ConfigUnitType.Percent, 0.02f)] + public float ControlWindowNextSizeRatio { get; set; } = 1.5f; + + [UI("GCD icon size", Parent = nameof(ShowControlWindow))] + [Range(0, 80, ConfigUnitType.Pixels, 0.2f)] + public float ControlWindowGCDSize { get; set; } = 40; + + [UI("oGCD icon size", Parent = nameof(ShowControlWindow))] + [Range(0, 80, ConfigUnitType.Pixels, 0.2f)] + public float ControlWindow0GCDSize { get; set; } = 30; + + [UI("Control Progress Height")] + [Range( 2, 30, ConfigUnitType.Yalms)] + public float ControlProgressHeight { get; set; } = 8; + + [UI("Use gapcloser as a damage ability if the distance to your target is less then this.", + Filter = TargetConfig, Section = 2)] + [Range(0, 30, ConfigUnitType.Yalms, 1f)] + public float DistanceForMoving { get; set; } = 1.2f; + + [UI("The max ping that RS can get to before skipping to the next action.", + Filter = BasicTimer)] + [Range(0.01f, 0.5f, ConfigUnitType.Seconds, 0.002f)] + public float MaxPing { get; set; } = 0.2f; + + [UI("Stop healing when time to kill is lower then...", Parent = nameof(UseHealWhenNotAHealer))] + [Range(0, 30, ConfigUnitType.Seconds, 0.02f)] + public float AutoHealTimeToKill { get; set; } = 8f; + + [UI("Hostile Icon height from position", Parent =nameof(ShowHostilesIcons))] + [Range(0, 10, ConfigUnitType.Pixels, 0.002f)] + public float HostileIconHeight { get; set; } = 0.5f; + + [UI("Hostile Icon size", Parent = nameof(ShowHostilesIcons))] + [Range(0.1f, 10, ConfigUnitType.Percent, 0.002f)] + public float HostileIconSize { get; set; } = 1; + + [UI("State icon height", Parent =nameof(ShowStateIcon))] + [Range(0, 3, ConfigUnitType.Pixels, 0.002f)] + public float StateIconHeight { get; set; } = 1; + + [UI("State icon size", Parent = nameof(ShowStateIcon))] + [Range(0.2f, 10, ConfigUnitType.Percent, 0.002f)] + public float StateIconSize { get; set; } = 1; + + [UI("The minimum time between updating RS information.", + Filter = BasicTimer)] + [Range(0, 1, ConfigUnitType.Seconds, 0.002f)] + public float MinUpdatingTime { get; set; } = 0.02f; + + [UI("The HP for using Guard.", + Filter = AutoActionCondition, Section = 3, + PvEFilter = JobFilterType.NoJob)] + [Range(0, 1, ConfigUnitType.Percent, 0.02f)] + public float HealthForGuard { get; set; } = 0.15f; + + [UI("Prompt box color of teaching mode", Parent =nameof(TeachingMode))] + public Vector4 TeachingModeColor { get; set; } = new(0f, 1f, 0.8f, 1f); + + [UI("Prompt box color of moving target", Parent =nameof(ShowMoveTarget))] + public Vector4 MovingTargetColor { get; set; } = new(0f, 1f, 0.8f, 0.6f); + + [UI("Target color", Parent =nameof(TargetColor))] + public Vector4 TargetColor { get; set; } = new(1f, 0.2f, 0f, 0.8f); + + [UI("Sub-target color", Parent = nameof(TargetColor))] + public Vector4 SubTargetColor { get; set; } = new(1f, 0.9f, 0f, 0.8f); + + [UI("The color of beneficial AoE positions", Parent =nameof(ShowBeneficialPositions))] + public Vector4 BeneficialPositionColor { get; set; } = new(0.5f, 0.9f, 0.1f, 0.7f); + + [UI("The color of the hovered beneficial position", Parent = nameof(ShowBeneficialPositions))] + public Vector4 HoveredBeneficialPositionColor { get; set; } = new(1f, 0.5f, 0f, 0.8f); + + [UI("Locked Control Window's Background", Parent = nameof(ShowControlWindow))] + public Vector4 ControlWindowLockBg { get; set; } = new (0, 0, 0, 0.55f); + + [UI("Unlocked Control Window's Background", Parent =nameof(ShowControlWindow))] + public Vector4 ControlWindowUnlockBg { get; set; } = new(0, 0, 0, 0.75f); + + [UI("Info Window's Background", Filter =UiWindows)] + public Vector4 InfoWindowBg { get; set; } = new(0, 0, 0, 0.4f); + + [UI("The text color of the time to kill indicator.", Parent =nameof(ShowTargetTimeToKill))] + public Vector4 TTKTextColor { get; set; } = new(0f, 1f, 0.8f, 1f); + #endregion + + #region Integer + + public int ActionSequencerIndex { get; set; } + + [UI("The modifier key to unlock the movement temporary", Parent = nameof(PoslockCasting))] + public ConsoleModifiers PoslockModifier { get; set; } + + [Range(0, 10000, ConfigUnitType.None, 200)] + [UI("Never raise player if MP is less than the set value", + Filter = AutoActionUsage, + PvEFilter = JobFilterType.Raise)] + public int LessMPNoRaise { get; set; } + + [Range(0, 5, ConfigUnitType.None, 1)] + [UI("Effect times", Parent =nameof(KeyBoardNoise))] + public Vector2Int KeyboardNoise { get; set; } = new (2, 3); + + [Range(0, 10, ConfigUnitType.None)] + public int TargetingIndex { get; set; } + + [UI("Beneficial AoE strategy", Parent = nameof(UseGroundBeneficialAbility))] + public BeneficialAreaStrategy BeneficialAreaStrategy { get; set; } = BeneficialAreaStrategy.OnCalculated; + + [UI("Number of hostiles", Parent = nameof(UseDefenseAbility), + PvEFilter = JobFilterType.Tank)] + [Range(1, 8, ConfigUnitType.None, 0.05f)] + public int AutoDefenseNumber { get; set; } = 2; + #endregion + + #region Jobs + [JobConfig, Range(0, 1, ConfigUnitType.Percent)] + private readonly float _healthAreaAbilityHot = 0.55f; + + [JobConfig, Range(0, 1, ConfigUnitType.Percent)] + private readonly float _healthAreaSpellHot = 0.55f; + + [JobConfig, Range(0, 1, ConfigUnitType.Percent)] + private readonly float _healthAreaAbility = 0.75f; + + [JobConfig, Range(0, 1, ConfigUnitType.Percent)] + private readonly float _healthAreaSpell = 0.65f; + + [JobConfig, Range(0, 1, ConfigUnitType.Percent)] + private readonly float _healthSingleAbilityHot = 0.65f; + + [JobConfig, Range(0, 1, ConfigUnitType.Percent)] + private readonly float _healthSingleSpellHot = 0.45f; + + [JobConfig, Range(0, 1, ConfigUnitType.Percent)] + private readonly float _healthSingleAbility = 0.7f; + + [JobConfig, Range(0, 1, ConfigUnitType.Percent)] + private readonly float _healthSingleSpell = 0.55f; + + [JobConfig, Range(0, 1, ConfigUnitType.Percent, 0.02f)] + [UI("The HP%% for tank to use invulnerability", + Filter = AutoActionCondition, Section = 3, + PvEFilter = JobFilterType.Tank, PvPFilter = JobFilterType.NoJob)] + private readonly float _healthForDyingTanks = 0.15f; + + [JobConfig, Range(0, 1, ConfigUnitType.Percent, 0.02f)] + [UI("HP%% about defense single of Tanks", Parent = nameof(UseDefenseAbility), + PvEFilter = JobFilterType.Tank)] + private readonly float _healthForAutoDefense = 1; + + [LinkDescription($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Images/HowAndWhenToClick.svg", + "This plugin helps you to use the right action during the combat. Here is a guide about the different options.")] + [JobConfig, Range(0, 0.5f, ConfigUnitType.Seconds)] + [UI("Action Ahead")] + private readonly float _actionAhead = 0.08f; + + [JobConfig, UI("Engage settings", Filter = TargetConfig, PvPFilter = JobFilterType.NoJob)] + private readonly TargetHostileType _hostileType; + + [JobConfig] + private readonly string _PvPRotationChoice = string.Empty; + + [JobConfig] + private readonly string _rotationChoice = string.Empty; + #endregion + + [JobConfig] + private readonly Dictionary _rotationActionConfig = []; + + [JobConfig] + private readonly Dictionary _rotationItemConfig = []; + + [JobChoiceConfig] + private readonly Dictionary _rotationsConfigurations = []; + + public void Save() + { +#if DEBUG + Svc.Log.Information("Saved configurations."); +#endif + File.WriteAllText(Svc.PluginInterface.ConfigFile.FullName, + JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() + { + TypeNameHandling = TypeNameHandling.Objects, + })); + } +} diff --git a/RotationSolver.Basic/Configuration/ConfigsNew.cs b/RotationSolver.Basic/Configuration/ConfigsNew.cs deleted file mode 100644 index 25e1a2708..000000000 --- a/RotationSolver.Basic/Configuration/ConfigsNew.cs +++ /dev/null @@ -1,749 +0,0 @@ -using Dalamud.Configuration; -using ECommons.DalamudServices; -using ECommons.ExcelServices; - -namespace RotationSolver.Basic.Configuration; - -internal partial class ConfigsNew : IPluginConfiguration -{ - [JsonIgnore] - public const string - BasicTimer = "BasicTimer", - BasicAutoSwitch = "BasicAutoSwitch", - BasicParams = "BasicParams", - UiInformation = "UiInformation", - UiOverlay = "UiOverlay", - UiWindows = "UiWindows", - AutoActionUsage = "AutoActionUsage", - AutoActionCondition = "AutoActionCondition", - TargetConfig = "TargetConfig", - Extra = "Extra", - Rotations = "Rotations", - List = "List", - Debug = "Debug"; - - public int Version { get; set; } = 8; - - public List Events { get; private set; } = []; - public SortedSet DisabledJobs { get; private set; } = []; - - public string[] OtherLibs { get; set; } = []; - - public string[] GitHubLibs { get; set; } = []; - public List TargetingTypes { get; set; } = []; - - public MacroInfo DutyStart { get; set; } = new MacroInfo(); - public MacroInfo DutyEnd { get; set; } = new MacroInfo(); - - [ConditionBool, UI("Show RS logo animation", - Filter =UiWindows)] - private static readonly bool _drawIconAnimation = true; - - [ConditionBool, UI("Auto turn off when player is moving between areas.", - Filter =BasicAutoSwitch)] - private static readonly bool _autoOffBetweenArea = true; - - [ConditionBool, UI("Auto turn off during cutscenes.", - Filter =BasicAutoSwitch)] - private static readonly bool _autoOffCutScene = true; - - [ConditionBool, UI("Auto turn off when dead.", - Filter =BasicAutoSwitch)] - private static readonly bool _autoOffWhenDead = true; - - [ConditionBool, UI("Auto turn off when duty completed.", - Filter =BasicAutoSwitch)] - private static readonly bool _autoOffWhenDutyCompleted = true; - - [ConditionBool, UI("Select only Fate targets in Fate", - Filter = TargetConfig, Section = 1)] - private static readonly bool _changeTargetForFate = true; - - [ConditionBool, UI("Using movement actions towards the object in the center of the screen", - Description = "Using movement actions towards the object in the center of the screen, otherwise toward the facing object.", - Filter = TargetConfig, Section = 2)] - private static readonly bool _moveTowardsScreenCenter = true; - - [ConditionBool, UI("Audio notification for when the status changes", - Filter =UiInformation)] - private static readonly bool _sayOutStateChanged = true; - - [ConditionBool, UI("Display plugin status on server info", - Filter =UiInformation)] - private static readonly bool _showInfoOnDtr = true; - - [ConditionBool, UI("Heal party members outside of combat.", - Filter = AutoActionCondition, Section =1)] - private static readonly bool _healOutOfCombat = false; - - [ConditionBool, UI("Display plugin status on toast", - Filter =UiInformation)] - private static readonly bool _showInfoOnToast = true; - - - - [ConditionBool, UI("Lock the movement when casting or when doing some actions.", - Description = "LT is for gamepad player", Filter = Extra)] - private static readonly bool _poslockCasting = false; - - [UI("", Action = ActionID.PassageOfArmsPvE, Parent = nameof(PoslockCasting))] - public bool PosPassageOfArms { get; set; } = false; - - [UI("", Action = ActionID.TenChiJinPvE, Parent = nameof(PoslockCasting))] - public bool PosTenChiJin { get; set; } = true; - - [UI("", Action = ActionID.FlamethrowerPvE, Parent = nameof(PoslockCasting))] - public bool PosFlameThrower { get; set; } = false; - - [UI("", Action = ActionID.ImprovisationPvE, Parent = nameof(PoslockCasting))] - public bool PosImprovisation { get; set; } = false; - - [ConditionBool, UI("Raise player while swiftcast is on cooldown", - Parent = AutoActionUsage, Section = 2, - PvEFilter = JobFilterType.Raise, PvPFilter = JobFilterType.NoJob)] - private static readonly bool _raisePlayerByCasting = true; - - [ConditionBool, UI("Raise any player in range (even if they are not in your party)", - Parent = AutoActionUsage, Section = 2, - PvEFilter = JobFilterType.Raise, PvPFilter = JobFilterType.NoJob)] - private static readonly bool _raiseAll = false; - - [ConditionBool, UI("Raise players that even have Brink of Death debuff", - Parent = AutoActionUsage, Section = 2, - PvEFilter = JobFilterType.Raise, PvPFilter = JobFilterType.NoJob)] - private static readonly bool _raiseBrinkOfDeath = true; - - [ConditionBool, UI("Add enemy list to the hostile targets.", - Filter = TargetConfig)] - private static readonly bool _addEnemyListToHostile = true; - - [ConditionBool, UI("Only attack the targets in enemy list.", - Parent = nameof(AddEnemyListToHostile))] - private static readonly bool _onlyAttackInEnemyList = false; - - [ConditionBool, UI("Use Tinctures", Filter = AutoActionUsage)] - private static readonly bool _useTinctures = false; - - [ConditionBool, UI("Use HP Potions", Filter = AutoActionUsage)] - private static readonly bool _useHpPotions = false; - - [ConditionBool, UI("Use MP Potions", Filter = AutoActionUsage)] - private static readonly bool _useMpPotions = false; - - [ConditionBool, UI("Draw the offset of melee on the screen", - Filter =UiOverlay)] - private static readonly bool _drawMeleeOffset = true; - - [ConditionBool, UI("Show the target of the move action", - Filter =UiOverlay)] - private static readonly bool _showMoveTarget = true; - - [ConditionBool, UI("Show Target", - Parent =UiOverlay)] - private static readonly bool _showTarget = true; - - [ConditionBool, UI("Show the target's time to kill.", - Parent = UiOverlay)] - private static readonly bool _showTargetTimeToKill = false; - - [ConditionBool, UI("Priority attack targets with attack markers", - Filter = TargetConfig)] - private static readonly bool _chooseAttackMark = true; - - [ConditionBool, UI("Allowed use of AoE to attack more mobs.", - Parent = nameof(ChooseAttackMark))] - private static readonly bool _canAttackMarkAOE = true; - - [ConditionBool, UI("Never attack targets with stop markers", - Filter = TargetConfig)] - private static readonly bool _filterStopMark = true; - - [ConditionBool, UI ("Show the hostile target icon", - Filter = UiOverlay)] - private static readonly bool _showHostilesIcons = true; - - [ConditionBool, UI ("Teaching mode", Filter =UiOverlay)] - private static readonly bool _teachingMode = true; - - [ConditionBool, UI("Display UI Overlay", Description = "This top window is used to display some extra information on your game window, such as target's positional, target and sub-target, etc.", - Filter = UiOverlay)] - private static readonly bool _useOverlayWindow = true; - - [ConditionBool, UI("Simulate the effect of pressing abilities", - Filter =UiInformation)] - private static readonly bool _keyBoardNoise = true; - - [ConditionBool, UI("Target movement area ability to the farthest possible location", Description = "Move to the furthest position for targeting are movement actions.", - Filter = TargetConfig, Section = 2)] - private static readonly bool _moveAreaActionFarthest = true; - - [ConditionBool, UI("Auto mode activation delay on countdown start", - Filter =BasicAutoSwitch, Section = 1)] - private static readonly bool _startOnCountdown = true; - - [ConditionBool, UI("Automatically turn on manual mode and target enemy when being attacked", - Filter =BasicAutoSwitch, Section =1)] - private static readonly bool _startOnAttackedBySomeone = false; - - [ConditionBool, UI("Don't attack new mobs by AoE", Description = "Never use any AoE action when this may attack the mobs that are not hostile targets.", - Parent =nameof(UseAoeAction))] - private static readonly bool _noNewHostiles = false; - - [ConditionBool, UI("Use healing abilities when playing a non-healer role", - Filter = AutoActionCondition, Section = 1, - PvEFilter = JobFilterType.NoHealer, PvPFilter = JobFilterType.NoJob)] - private static readonly bool _useHealWhenNotAHealer = true; - - [ConditionBool, UI("Target allies for friendly actions.", - Filter = TargetConfig, Section = 3)] - private static readonly bool _switchTargetFriendly = false; - - [ConditionBool, UI("Use interrupt abilities if possible.", - Filter = AutoActionCondition, Section = 3, - PvEFilter = JobFilterType.Interrupt, - PvPFilter = JobFilterType.NoJob)] - private static readonly bool _interruptibleMoreCheck = true; - - [ConditionBool, UI("Use work task for acceleration.", - Filter =BasicParams)] - private static readonly bool _useWorkTask = false; - - [ConditionBool, UI("Stops casting when the target is dead.", Filter = Extra)] - private static readonly bool _useStopCasting = false; - - [ConditionBool, UI("Cleanse all dispellable debuffs.", - Filter = AutoActionCondition, Section = 3, - PvEFilter = JobFilterType.Dispel, PvPFilter = JobFilterType.NoJob)] - private static readonly bool _dispelAll = false; - - [ConditionBool, UI("Only attack the target in view.", - Filter = TargetConfig, Section = 1)] - private static readonly bool _onlyAttackInView = false; - - [ConditionBool, UI("Only attack the targets in vision cone", - Filter = TargetConfig, Section = 1)] - private static readonly bool _onlyAttackInVisionCone = false; - - [ConditionBool, UI("Use single target healing over time actions only on tanks", - Filter = AutoActionCondition, Section = 1, - PvEFilter = JobFilterType.Healer, PvPFilter = JobFilterType.Healer)] - private static readonly bool _onlyHotOnTanks = false; - - [ConditionBool, UI("Debug Mode", Filter = Debug)] - private static readonly bool _inDebug = false; - public bool AutoUpdateLibs { get; set; } = true; - - [ConditionBool, UI("Auto Download Rotations", Filter = Rotations)] - private static readonly bool _downloadRotations = true; - - [ConditionBool, UI("Auto Update Rotations", Parent = nameof(DownloadRotations))] - private static readonly bool _autoUpdateRotations = true; - - [ConditionBool, UI("Make /rotation Manual as a toggle command.", - Filter = BasicParams)] - private static readonly bool _toggleManual = false; - - [ConditionBool, UI("Make /rotation Auto as a toggle command.", - Filter =BasicParams)] - private static readonly bool _toggleAuto = false; - - [ConditionBool, UI("Only show these windows if there are enemies in or in duty", - Filter =UiWindows)] - private static readonly bool _onlyShowWithHostileOrInDuty = true; - - [ConditionBool, UI("Show Control Window", - Filter =UiWindows)] - private static readonly bool _showControlWindow = false; - - [ConditionBool, UI("Is Control Window Lock", - Filter = UiWindows)] - private static readonly bool _isControlWindowLock = false; - - [ConditionBool, UI("Show Next Action Window", Filter = UiWindows)] - private static readonly bool _showNextActionWindow = true; - - [ConditionBool, UI("No Inputs", Parent = nameof(ShowNextActionWindow))] - private static readonly bool _isInfoWindowNoInputs = false; - - [ConditionBool, UI("No Move", Parent = nameof(ShowNextActionWindow))] - private static readonly bool _isInfoWindowNoMove = false; - - [ConditionBool, UI("Show Items' Cooldown", - Parent = nameof(ShowCooldownWindow))] - private static readonly bool _showItemsCooldown = false; - - [ConditionBool, UI("Show GCD' Cooldown", - Parent = nameof(ShowCooldownWindow))] - private static readonly bool _showGCDCooldown = false; - - [ConditionBool, UI("Show Original Cooldown", - Parent = nameof(ShowCooldownWindow))] - private static readonly bool _useOriginalCooldown = true; - - [ConditionBool, UI("Show tooltips", - Filter = UiInformation)] - private static readonly bool _showTooltips = true; - - [ConditionBool, UI("Auto load rotations", - Filter = Rotations)] - private static readonly bool _autoLoadCustomRotations = false; - - [ConditionBool, UI("Target Fate priority", - Filter = TargetConfig, Section = 1)] - private static readonly bool _targetFatePriority = true; - - [ConditionBool, UI("Target Hunt/Relic/Leve priority.", - Filter = TargetConfig, Section = 1)] - private static readonly bool _targetHuntingRelicLevePriority = true; - - [ConditionBool, UI("Target quest priority.", - Filter = TargetConfig, Section = 1)] - - private static readonly bool _targetQuestPriority = true; - - [ConditionBool, UI("Display do action feedback on toast", - Filter =UiInformation)] - private static readonly bool _showToastsAboutDoAction = true; - - [ConditionBool, UI("Use AoE actions", Filter = AutoActionUsage)] - private static readonly bool _useAOEAction = true; - - [ConditionBool, UI("Use AoE actions in manual mode", Parent = nameof(UseAoeAction))] - private static readonly bool _useAOEWhenManual = false; - - [ConditionBool, UI("Automatically trigger dps burst phase", Filter = AutoActionCondition)] - private static readonly bool _autoBurst = true; - - [ConditionBool, UI("Automatic Heal")] - private static readonly bool _autoHeal = true; - - [ConditionBool, UI("Auto-use abilities", Filter = AutoActionUsage)] - private static readonly bool _useAbility = true; - - [ConditionBool, UI("Use defensive abilities", Description = "It is recommended to check this option if you are playing Raids or you can plan the heal and defense ability usage by yourself.", - Parent = nameof(UseAbility))] - private static readonly bool _useDefenseAbility = true; - - [ConditionBool, UI("Automatically activate tank stance", Parent =nameof(UseAbility), - PvEFilter = JobFilterType.Tank)] - private static readonly bool _autoTankStance = true; - - [ConditionBool, UI("Auto provoke non-tank attacking targets", Description = "Automatically use provoke when an enemy is attacking a non-tank member of the party.", - Parent = nameof(UseAbility), PvEFilter = JobFilterType.Tank)] - private static readonly bool _autoProvokeForTank = true; - - [ConditionBool, UI("Auto TrueNorth (Melee)", - Parent = nameof(UseAbility), - PvEFilter = JobFilterType.Melee)] - private static readonly bool _autoUseTrueNorth = true; - - [ConditionBool, UI("Raise player by using swiftcast if avaliable", - Parent = nameof(UseAbility), - PvEFilter = JobFilterType.Healer)] - private static readonly bool _raisePlayerBySwift = true; - - [ConditionBool, UI("Use movement speed increase abilities when out of combat.", Parent = nameof(UseAbility))] - private static readonly bool _autoSpeedOutOfCombat = true; - - [ConditionBool, UI("Use beneficial ground-targeted actions", Parent = nameof(UseAbility), - PvEFilter = JobFilterType.Healer)] - private static readonly bool _useGroundBeneficialAbility = true; - - [ConditionBool, UI("Use beneficial AoE actions when moving.", Parent = nameof(UseGroundBeneficialAbility))] - private static readonly bool _useGroundBeneficialAbilityWhenMoving = false; - - [ConditionBool, UI("Target all for friendly actions (include passerby)", - Filter = TargetConfig, Section = 3)] - private static readonly bool _targetAllForFriendly = false; - - [ConditionBool, UI("Show Cooldown Window", Filter = UiWindows)] - private static readonly bool _showCooldownWindow = false; - - [ConditionBool, UI("Record AOE actions", Filter = List)] - private static readonly bool _recordCastingArea = true; - - [ConditionBool, UI("Auto turn off RS when combat is over more for more then...", - Filter =BasicAutoSwitch)] - private static readonly bool _autoOffAfterCombat = true; - - [ConditionBool, UI("Auto Open the treasure chest", - Filter = Extra)] - private static readonly bool _autoOpenChest = false; - - [ConditionBool, UI("Auto close the loot window when auto opened the chest.", - Parent = nameof(AutoOpenChest))] - private static readonly bool _autoCloseChestWindow = true; - - [ConditionBool, UI("Show RS state icon", Filter = UiOverlay)] - private static readonly bool _showStateIcon = true; - - [ConditionBool, UI("Show beneficial AoE locations.", Filter = UiOverlay)] - private static readonly bool _showBeneficialPositions = true; - - [ConditionBool, UI("Hide all warnings", - Filter = UiInformation)] - private static readonly bool _hideWarning = false; - - [ConditionBool, UI("Healing the members with GCD if there is nothing to do in combat.", - Filter = AutoActionCondition, Section = 1)] - private static readonly bool _healWhenNothingTodo = true; - - //[ConditionBool, UI("Use actions that use resources", Filter = AutoActionUsage)] - //private static readonly bool _useResourcesAction = true; - - [ConditionBool, UI("Say hello to all users of Rotation Solver.", - Filter =BasicParams)] - private static readonly bool _sayHelloToAll = true; - - [ConditionBool, UI("Say hello to the users of Rotation Solver.", Description = "It can only be disabled for users, not authors and contributors.\nIf you want to be greeted by other users, please DM ArchiTed in Discord Server with your Hash!", - Parent =nameof(SayHelloToAll))] - private static readonly bool _sayHelloToUsers = true; - - [ConditionBool, UI("Just say hello once to the same user.", - Parent = nameof(SayHelloToAll))] - private static readonly bool _justSayHelloOnce = false; - - [ConditionBool, UI("Only Heal self When Not a healer", - Filter = AutoActionCondition, Section = 1, - PvPFilter = JobFilterType.NoHealer, PvEFilter = JobFilterType.NoHealer)] - private static readonly bool _onlyHealSelfWhenNoHealer = false; - - [ConditionBool, UI("Display toggle action feedback on chat", - Filter =UiInformation)] - private static readonly bool _showToggledActionInChat = true; - - [UI("Use additional conditions", Filter = BasicParams)] - public bool UseAdditionalConditions { get; set; } = false; - - #region Float - [UI("Auto turn off RS when combat is over more for more then...", - Parent =nameof(AutoOffAfterCombat))] - [Range(0, 600, ConfigUnitType.Seconds)] - public float AutoOffAfterCombatTime { get; set; } = 30; - - [UI("The height of the drawing things.", Parent =nameof(UseOverlayWindow))] - [Range(0, 8, ConfigUnitType.Yalms, 0.02f)] - public float DrawingHeight { get; set; } = 3; - - [UI("Drawing smoothness.", Parent = nameof(UseOverlayWindow))] - [Range(0.005f, 0.05f, ConfigUnitType.Yalms, 0.001f)] - public float SampleLength { get; set; } = 0.2f; - - [UI("The angle of your vision cone", Parent = nameof(OnlyAttackInVisionCone))] - [Range(0, 90, ConfigUnitType.Degree, 0.02f)] - public float AngleOfVisionCone { get; set; } = 45; - - [UI("HP for standard deviation for using AoE heal.", Parent = nameof(UseHealWhenNotAHealer))] - [Range(0, 0.5f, ConfigUnitType.Percent, 0.02f)] - public float HealthDifference { get; set; } = 0.25f; - - [UI("Melee Range action using offset", - Filter = AutoActionCondition, Section = 3, - PvEFilter = JobFilterType.Melee, PvPFilter = JobFilterType.NoJob)] - [Range(0, 5, ConfigUnitType.Yalms, 0.02f)] - public float MeleeRangeOffset { get; set; } = 1; - - [UI("The time ahead of the last oGCD before the next GCD being avaliable to start trying using it (may affect skill weaving)", - Filter = BasicTimer)] - [Range(0, 0.4f, ConfigUnitType.Seconds, 0.002f)] - public float MinLastAbilityAdvanced { get; set; } = 0.1f; - - [UI("When their minimum HP is lower than this.", Parent = nameof(HealWhenNothingTodo))] - [Range(0, 1, ConfigUnitType.Percent, 0.002f)] - public float HealWhenNothingTodoBelow { get; set; } = 0.8f; - - [UI("The size of the next ability that will be used icon.", - Parent =nameof(ShowTarget))] - [Range(0, 1, ConfigUnitType.Pixels, 0.002f)] - public float TargetIconSize { get; set; } = 0.6f; - - [UI("How likely is it that RS will click the wrong action.", - Filter = BasicParams)] - [Range(0, 1, ConfigUnitType.Percent, 0.002f)] - public float MistakeRatio { get; set; } = 0; - - [UI("Heal tank first if its HP is lower than this.", - Filter = AutoActionCondition, Section = 1, - PvEFilter = JobFilterType.Healer, PvPFilter = JobFilterType.Healer)] - [Range(0, 1, ConfigUnitType.Percent, 0.02f)] - public float HealthTankRatio { get; set; } = 0.4f; - - [UI("Heal healer first if its HP is lower than this.", - Filter = AutoActionCondition, Section = 1, - PvEFilter = JobFilterType.Healer, PvPFilter = JobFilterType.Healer)] - [Range(0, 1, ConfigUnitType.Percent, 0.02f)] - public float HealthHealerRatio { get; set; } = 0.4f; - - [UI("The duration of special windows set by commands", - Filter =BasicTimer, Section = 1)] - [Range(1, 20, ConfigUnitType.Seconds, 1f)] - public float SpecialDuration { get; set; } = 3; - - [UI("The time before an oGCD is avaliable to start trying using it", - Filter = BasicTimer)] - [Range(0, 0.5f, ConfigUnitType.Seconds, 0.002f)] - public float ActionAheadForLast0GCD { get; set; } = 0.06f; - - [UI("This is the delay time.")] - [Range(0, 3, ConfigUnitType.Seconds)] - public Vector2 TargetDelay { get; set; } = new(0, 0); - - [UI("This is the clipping time.\nGCD is over. However, RS forgets to click the next action.", - Filter = BasicTimer)] - [Range(0, 1, ConfigUnitType.Seconds, 0.002f)] - public Vector2 WeaponDelay { get; set; } = new(0, 0); - - [UI("The range of random delay for stopping casting when the target is dead or immune to damage.", - Parent = nameof(UseStopCasting))] - [Range(0, 3, ConfigUnitType.Seconds, 0.002f)] - public Vector2 StopCastingDelay { get; set; } = new(0.5f, 1); - - [UI("The range of random delay for interrupting hostile targets.", - Filter = AutoActionCondition, Section = 3, - PvEFilter = JobFilterType.Interrupt, PvPFilter = JobFilterType.NoJob)] - [Range(0, 3, ConfigUnitType.Seconds, 0.002f)] - public Vector2 InterruptDelay { get; set; } = new(0.5f, 1); - - [UI("The delay of provoke.", Parent = nameof(AutoProvokeForTank))] - [Range(0, 10, ConfigUnitType.Seconds, 0.05f)] - public Vector2 ProvokeDelay { get; set; } = new(0.5f, 1); - - [UI("The range of random delay for Not In Combat.", - Filter =BasicParams)] - [Range(0, 10, ConfigUnitType.Seconds, 0.002f)] - public Vector2 NotInCombatDelay { get; set; } = new(3, 4); - - [UI("The range of random delay for clicking actions.", - Filter =BasicTimer)] - [Range(0.05f, 0.25f, ConfigUnitType.Seconds, 0.002f)] - public Vector2 ClickingDelay { get; set; } = new(0.1f, 0.15f); - - [UI("The delay of this type of healing.", Parent = nameof(HealWhenNothingTodo))] - [Range(0, 5, ConfigUnitType.Seconds, 0.05f)] - public Vector2 HealWhenNothingTodoDelay { get; set; } = new(0.5f, 1); - - [UI("The random delay between which auto mode activation on countdown varies.", - Parent =nameof(StartOnCountdown))] - [Range(0, 3, ConfigUnitType.Seconds, 0.002f)] - public Vector2 CountdownDelay { get; set; } = new(0.5f, 1); - - [UI("The starting when abilities will be used before finishing the countdown", - Filter =BasicTimer, Section = 1, PvPFilter = JobFilterType.NoJob)] - [Range(0, 0.7f, ConfigUnitType.Seconds, 0.002f)] - public float CountDownAhead { get; set; } = 0.4f; - - [UI("The size of the sector angle that can be selected as the moveable target", - Description = "If the selection mode is based on character facing, i.e., targets within the character's viewpoint are moveable targets. \nIf the selection mode is screen-centered, i.e., targets within a sector drawn upward from the character's point are movable targets.", - Filter = TargetConfig, Section = 2)] - [Range(0, 90, ConfigUnitType.Degree, 0.02f)] - public float MoveTargetAngle { get; set; } = 24; - - [UI("If target's time until death is higher than this, regard it as boss.", - Filter = TargetConfig, Section = 1)] - [Range(10, 1800, ConfigUnitType.Seconds, 0.02f)] - public float BossTimeToKill { get; set; } = 90; - - - [UI("If target's time until death is lower than this, regard it is dying.", - Filter = TargetConfig, Section = 1)] - [Range(0, 60, ConfigUnitType.Seconds, 0.02f)] - public float DyingTimeToKill { get; set; } = 10; - - [UI("Change the cooldown font size.", Parent = nameof(ShowCooldownWindow))] - [Range(9.6f, 96, ConfigUnitType.Pixels, 0.1f)] - public float CooldownFontSize { get; set; } = 16; - - [UI("Cooldown window icon size", Parent = nameof(ShowCooldownWindow))] - [Range(0, 80, ConfigUnitType.Pixels, 0.2f)] - public float CooldownWindowIconSize { get; set; } = 30; - - [UI("Next Action Size Ratio", Parent = nameof(ShowControlWindow))] - [Range(0, 10, ConfigUnitType.Percent, 0.02f)] - public float ControlWindowNextSizeRatio { get; set; } = 1.5f; - - [UI("GCD icon size", Parent = nameof(ShowControlWindow))] - [Range(0, 80, ConfigUnitType.Pixels, 0.2f)] - public float ControlWindowGCDSize { get; set; } = 40; - - [UI("oGCD icon size", Parent = nameof(ShowControlWindow))] - [Range(0, 80, ConfigUnitType.Pixels, 0.2f)] - public float ControlWindow0GCDSize { get; set; } = 30; - - [UI("Control Progress Height")] - [Range( 2, 30, ConfigUnitType.Yalms)] - public float ControlProgressHeight { get; set; } = 8; - - [UI("Use gapcloser as a damage ability if the distance to your target is less then this.", - Filter = TargetConfig, Section = 2)] - [Range(0, 30, ConfigUnitType.Yalms, 1f)] - public float DistanceForMoving { get; set; } = 1.2f; - - [UI("The max ping that RS can get to before skipping to the next action.", - Filter = BasicTimer)] - [Range(0.01f, 0.5f, ConfigUnitType.Seconds, 0.002f)] - public float MaxPing { get; set; } = 0.2f; - - [UI("Stop healing when time to kill is lower then...", Parent = nameof(UseHealWhenNotAHealer))] - [Range(0, 30, ConfigUnitType.Seconds, 0.02f)] - public float AutoHealTimeToKill { get; set; } = 8f; - - [UI("Hostile Icon height from position", Parent =nameof(ShowHostilesIcons))] - [Range(0, 10, ConfigUnitType.Pixels, 0.002f)] - public float HostileIconHeight { get; set; } = 0.5f; - - [UI("Hostile Icon size", Parent = nameof(ShowHostilesIcons))] - [Range(0.1f, 10, ConfigUnitType.Percent, 0.002f)] - public float HostileIconSize { get; set; } = 1; - - [UI("State icon height", Parent =nameof(ShowStateIcon))] - [Range(0, 3, ConfigUnitType.Pixels, 0.002f)] - public float StateIconHeight { get; set; } = 1; - - [UI("State icon size", Parent = nameof(ShowStateIcon))] - [Range(0.2f, 10, ConfigUnitType.Percent, 0.002f)] - public float StateIconSize { get; set; } = 1; - - [UI("The minimum time between updating RS information.", - Filter = BasicTimer)] - [Range(0, 1, ConfigUnitType.Seconds, 0.002f)] - public float MinUpdatingTime { get; set; } = 0.02f; - - [UI("The HP for using Guard.", - Filter = AutoActionCondition, Section = 3, - PvEFilter = JobFilterType.NoJob)] - [Range(0, 1, ConfigUnitType.Percent, 0.02f)] - public float HealthForGuard { get; set; } = 0.15f; - - [UI("Prompt box color of teaching mode", Parent =nameof(TeachingMode))] - public Vector4 TeachingModeColor { get; set; } = new(0f, 1f, 0.8f, 1f); - - [UI("Prompt box color of moving target", Parent =nameof(ShowMoveTarget))] - public Vector4 MovingTargetColor { get; set; } = new(0f, 1f, 0.8f, 0.6f); - - [UI("Target color", Parent =nameof(TargetColor))] - public Vector4 TargetColor { get; set; } = new(1f, 0.2f, 0f, 0.8f); - - [UI("Sub-target color", Parent = nameof(TargetColor))] - public Vector4 SubTargetColor { get; set; } = new(1f, 0.9f, 0f, 0.8f); - - [UI("The color of beneficial AoE positions", Parent =nameof(ShowBeneficialPositions))] - public Vector4 BeneficialPositionColor { get; set; } = new(0.5f, 0.9f, 0.1f, 0.7f); - - [UI("The color of the hovered beneficial position", Parent = nameof(ShowBeneficialPositions))] - public Vector4 HoveredBeneficialPositionColor { get; set; } = new(1f, 0.5f, 0f, 0.8f); - - [UI("Locked Control Window's Background", Parent = nameof(ShowControlWindow))] - public Vector4 ControlWindowLockBg { get; set; } = new (0, 0, 0, 0.55f); - - [UI("Unlocked Control Window's Background", Parent =nameof(ShowControlWindow))] - public Vector4 ControlWindowUnlockBg { get; set; } = new(0, 0, 0, 0.75f); - - [UI("Info Window's Background", Filter =UiWindows)] - public Vector4 InfoWindowBg { get; set; } = new(0, 0, 0, 0.4f); - - [UI("The text color of the time to kill indicator.", Parent =nameof(ShowTargetTimeToKill))] - public Vector4 TTKTextColor { get; set; } = new(0f, 1f, 0.8f, 1f); - #endregion - - #region Integer - - public int ActionSequencerIndex { get; set; } - - [UI("The modifier key to unlock the movement temporary", Parent = nameof(PoslockCasting))] - public ConsoleModifiers PoslockModifier { get; set; } - - [Range(0, 10000, ConfigUnitType.None, 200)] - [UI("Never raise player if MP is less than the set value", - Filter = AutoActionUsage, - PvEFilter = JobFilterType.Raise)] - public int LessMPNoRaise { get; set; } - - [Range(0, 5, ConfigUnitType.None, 1)] - [UI("Effect times", Parent =nameof(KeyBoardNoise))] - public Vector2Int KeyboardNoise { get; set; } = new (2, 3); - - [Range(0, 10, ConfigUnitType.None)] - public int TargetingIndex { get; set; } - - [UI("Beneficial AoE strategy", Parent = nameof(UseGroundBeneficialAbility))] - public BeneficialAreaStrategy BeneficialAreaStrategy { get; set; } = BeneficialAreaStrategy.OnCalculated; - - [UI("Number of hostiles", Parent = nameof(UseDefenseAbility), - PvEFilter = JobFilterType.Tank)] - [Range(1, 8, ConfigUnitType.None, 0.05f)] - public int AutoDefenseNumber { get; set; } = 2; - #endregion - - #region Jobs - [JobConfig, Range(0, 1, ConfigUnitType.Percent)] - private readonly float _healthAreaAbilityHot = 0.55f; - - [JobConfig, Range(0, 1, ConfigUnitType.Percent)] - private readonly float _healthAreaSpellHot = 0.55f; - - [JobConfig, Range(0, 1, ConfigUnitType.Percent)] - private readonly float _healthAreaAbility = 0.75f; - - [JobConfig, Range(0, 1, ConfigUnitType.Percent)] - private readonly float _healthAreaSpell = 0.65f; - - [JobConfig, Range(0, 1, ConfigUnitType.Percent)] - private readonly float _healthSingleAbilityHot = 0.65f; - - [JobConfig, Range(0, 1, ConfigUnitType.Percent)] - private readonly float _healthSingleSpellHot = 0.45f; - - [JobConfig, Range(0, 1, ConfigUnitType.Percent)] - private readonly float _healthSingleAbility = 0.7f; - - [JobConfig, Range(0, 1, ConfigUnitType.Percent)] - private readonly float _healthSingleSpell = 0.55f; - - [JobConfig, Range(0, 1, ConfigUnitType.Percent, 0.02f)] - [UI("The HP%% for tank to use invulnerability", - Filter = AutoActionCondition, Section = 3, - PvEFilter = JobFilterType.Tank, PvPFilter = JobFilterType.NoJob)] - private readonly float _healthForDyingTanks = 0.15f; - - [JobConfig, Range(0, 1, ConfigUnitType.Percent, 0.02f)] - [UI("HP%% about defense single of Tanks", Parent = nameof(UseDefenseAbility), - PvEFilter = JobFilterType.Tank)] - private readonly float _healthForAutoDefense = 1; - - [LinkDescription($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Images/HowAndWhenToClick.svg", - "This plugin helps you to use the right action during the combat. Here is a guide about the different options.")] - [JobConfig, Range(0, 0.5f, ConfigUnitType.Seconds)] - [UI("Action Ahead")] - private readonly float _actionAhead = 0.08f; - - [JobConfig, UI("Engage settings", Filter = TargetConfig, PvPFilter = JobFilterType.NoJob)] - private readonly TargetHostileType _hostileType; - - [JobConfig] - private readonly string _PvPRotationChoice = string.Empty; - - [JobConfig] - private readonly string _rotationChoice = string.Empty; - #endregion - - [JobConfig] - private readonly Dictionary _rotationActionConfig = []; - - [JobConfig] - private readonly Dictionary _rotationItemConfig = []; - - [JobChoiceConfig] - private readonly Dictionary _rotationsConfigurations = []; - - public void Save() - { -#if DEBUG - Svc.Log.Information("Saved configurations."); -#endif - File.WriteAllText(Svc.PluginInterface.ConfigFile.FullName, - JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() - { - TypeNameHandling = TypeNameHandling.Objects, - })); - } -} diff --git a/RotationSolver.Basic/Data/RSCommandType.cs b/RotationSolver.Basic/Data/RSCommandType.cs index 365c13d4e..6c7ae30f7 100644 --- a/RotationSolver.Basic/Data/RSCommandType.cs +++ b/RotationSolver.Basic/Data/RSCommandType.cs @@ -146,6 +146,7 @@ public enum OtherCommandType : byte /// /// /// + [Description("Do the next action")] NextAction, } diff --git a/RotationSolver.Basic/Service.cs b/RotationSolver.Basic/Service.cs index 44b25e696..eeb0cac98 100644 --- a/RotationSolver.Basic/Service.cs +++ b/RotationSolver.Basic/Service.cs @@ -38,8 +38,8 @@ internal static unsafe bool CanMove } public static float CountDownTime => Countdown.TimeRemaining; - public static ConfigsNew Config { get; set; } = null!; - public static ConfigsNew ConfigDefault { get; set; } = new ConfigsNew(); + public static Configs Config { get; set; } = null!; + public static Configs ConfigDefault { get; set; } = new Configs(); public Service() { diff --git a/RotationSolver/Commands/RSCommands_Actions.cs b/RotationSolver/Commands/RSCommands_Actions.cs index 783b8cf70..1e4f27611 100644 --- a/RotationSolver/Commands/RSCommands_Actions.cs +++ b/RotationSolver/Commands/RSCommands_Actions.cs @@ -45,7 +45,7 @@ public static void DoAction() if (wrong) { - Svc.Toasts.ShowError(string.Format("ClickingMistakeMessage".Local("OOOps! RS clicked the wrong action ({0})!"), nextAction)); + Svc.Toasts.ShowError(string.Format(UiString.ClickingMistakeMessage.Local(), nextAction)); ControlWindow.Wrong = nextAction; ControlWindow.DidTime = DateTime.Now; } diff --git a/RotationSolver/Commands/RSCommands_BasicInfo.cs b/RotationSolver/Commands/RSCommands_BasicInfo.cs index 99baf4f76..da3e957ec 100644 --- a/RotationSolver/Commands/RSCommands_BasicInfo.cs +++ b/RotationSolver/Commands/RSCommands_BasicInfo.cs @@ -9,7 +9,7 @@ public static partial class RSCommands internal static void Enable() => Svc.Commands.AddHandler(Service.COMMAND, new CommandInfo(OnCommand) { - HelpMessage = "Commands_Rotation".Local("Open config window."), + HelpMessage = UiString.Commands_Rotation.Local(), ShowInHelp = true, }); diff --git a/RotationSolver/Commands/RSCommands_OtherCommand.cs b/RotationSolver/Commands/RSCommands_OtherCommand.cs index 82fefb36c..d44d3019b 100644 --- a/RotationSolver/Commands/RSCommands_OtherCommand.cs +++ b/RotationSolver/Commands/RSCommands_OtherCommand.cs @@ -41,7 +41,7 @@ private static void DoSettingCommand(string str) var strs = str.Split(' '); var value = strs.LastOrDefault(); - foreach (var property in typeof(ConfigsNew).GetRuntimeProperties() + foreach (var property in typeof(Configs).GetRuntimeProperties() .Where(p => (p.GetMethod?.IsPublic ?? false) && (p.SetMethod?.IsPublic ?? false))) { if (!str.StartsWith(property.Name, StringComparison.OrdinalIgnoreCase)) continue; @@ -79,13 +79,13 @@ private static void DoSettingCommand(string str) value = v.ToString(); //Say out. - Svc.Chat.Print(string.Format( "CommandsChangeSettingsValue".Local("Modify {0} to {1}"), property.Name, value)); + Svc.Chat.Print(string.Format(UiString.CommandsChangeSettingsValue.Local(), property.Name, value)); return; } - Svc.Chat.PrintError("CommandsCannotFindConfig".Local("Failed to find the config in this rotation, please check it.")); + Svc.Chat.PrintError(UiString.CommandsCannotFindConfig.Local()); } private static void ToggleActionCommand(string str) @@ -123,7 +123,7 @@ private static void DoActionCommand(string str) if (Service.Config.ShowToastsAboutDoAction) { - Svc.Toasts.ShowQuest(string.Format("CommandsInsertAction".Local("Will use it within {0}s"), time), + Svc.Toasts.ShowQuest(string.Format(UiString.CommandsInsertAction.Local(), time), new Dalamud.Game.Gui.Toast.QuestToastOptions() { IconId = iAct.IconID, @@ -135,7 +135,7 @@ private static void DoActionCommand(string str) } } - Svc.Chat.PrintError("CommandsInsertActionFailure".Local("Can not find the action, please check the action name.")); + Svc.Chat.PrintError(UiString.CommandsInsertActionFailure.Local()); } @@ -146,13 +146,13 @@ private static void DoRotationCommand(ICustomRotation customCombo, string str) { if (config.DoCommand(configs, str)) { - Svc.Chat.Print(string.Format("CommandsChangeSettingsValue".Local("Modify {0} to {1}"), + Svc.Chat.Print(string.Format(UiString.CommandsInsertAction.Local(), config.DisplayName, configs.GetDisplayString(config.Name))); return; } } - Svc.Chat.PrintError("CommandsCannotFindConfig".Local("Failed to find the config, please check it.")); + Svc.Chat.PrintError(UiString.CommandsInsertActionFailure.Local()); } } diff --git a/RotationSolver/Localization/EnumTranslations.cs b/RotationSolver/Localization/EnumTranslations.cs index 93959bb98..ff645bd8e 100644 --- a/RotationSolver/Localization/EnumTranslations.cs +++ b/RotationSolver/Localization/EnumTranslations.cs @@ -5,49 +5,49 @@ internal static class EnumTranslations internal static string ToSayout(this SpecialCommandType type, JobRole role) => type switch { SpecialCommandType.EndSpecial => type.ToSpecialString(role), - _ => "SpecialCommandType_Start".Local("Start ") + type.ToSpecialString(role), + _ => UiString.SpecialCommandType_Start.Local() + type.ToSpecialString(role), }; internal static string ToSayout(this StateCommandType type, JobRole role) => type switch { - StateCommandType.Cancel => "SpecialCommandType_Cancel".Local("Cancel"), + StateCommandType.Cancel => UiString.SpecialCommandType_Cancel.Local(), _ => type.ToStateString(role), }; internal static string ToSpecialString(this SpecialCommandType type, JobRole role) => type switch { - SpecialCommandType.HealArea => "SpecialCommandType_HealArea".Local("Heal Area"), - SpecialCommandType.HealSingle => "SpecialCommandType_HealSingle".Local("Heal Single"), - SpecialCommandType.DefenseArea => "SpecialCommandType_DefenseArea".Local("Defense Area"), - SpecialCommandType.DefenseSingle => "SpecialCommandType_DefenseSingle".Local("Defense Single"), + SpecialCommandType.HealArea => UiString.SpecialCommandType_HealArea.Local(), + SpecialCommandType.HealSingle => UiString.SpecialCommandType_HealSingle.Local(), + SpecialCommandType.DefenseArea => UiString.SpecialCommandType_DefenseArea.Local(), + SpecialCommandType.DefenseSingle => UiString.SpecialCommandType_DefenseSingle.Local(), SpecialCommandType.DispelStancePositional => role switch { - JobRole.Tank => "SpecialCommandType_TankStance".Local("Tank Stance"), - JobRole.Healer => "SpecialCommandType_Dispel".Local("Dispel"), - JobRole.Melee => "SpecialCommandType_Positional".Local("Positional"), + JobRole.Tank => UiString.SpecialCommandType_TankStance.Local(), + JobRole.Healer => UiString.SpecialCommandType_Dispel.Local(), + JobRole.Melee => UiString.SpecialCommandType_Positional.Local(), _ => nameof(SpecialCommandType.DispelStancePositional), }, SpecialCommandType.RaiseShirk => role switch { - JobRole.Tank => "SpecialCommandType_Shirk".Local("Shirk"), - JobRole.Healer => "SpecialCommandType_Raise".Local("Raise"), + JobRole.Tank => UiString.SpecialCommandType_Shirk.Local(), + JobRole.Healer => UiString.SpecialCommandType_Raise.Local(), _ => nameof(SpecialCommandType.RaiseShirk), }, - SpecialCommandType.MoveForward => "SpecialCommandType_MoveForward".Local("Move Forward"), - SpecialCommandType.MoveBack => "SpecialCommandType_MoveBack".Local("Move Back"), - SpecialCommandType.AntiKnockback => "SpecialCommandType_AntiKnockback".Local("Anti Knockback"), - SpecialCommandType.Burst => "SpecialCommandType_Burst".Local("Burst"), - SpecialCommandType.EndSpecial => "SpecialCommandType_EndSpecial".Local("End Special"), - SpecialCommandType.Speed => "SpecialCommandType_Speed".Local("Speed"), - SpecialCommandType.LimitBreak => "SpecialCommandType_LimitBreak".Local("Limit Break"), + SpecialCommandType.MoveForward => UiString.SpecialCommandType_MoveForward.Local(), + SpecialCommandType.MoveBack => UiString.SpecialCommandType_MoveBack.Local(), + SpecialCommandType.AntiKnockback => UiString.SpecialCommandType_AntiKnockback.Local(), + SpecialCommandType.Burst => UiString.SpecialCommandType_Burst.Local(), + SpecialCommandType.EndSpecial => UiString.SpecialCommandType_EndSpecial.Local(), + SpecialCommandType.Speed => UiString.SpecialCommandType_Speed.Local(), + SpecialCommandType.LimitBreak => UiString.SpecialCommandType_LimitBreak.Local(), _ => string.Empty, }; internal static string ToStateString(this StateCommandType type, JobRole _) => type switch { - StateCommandType.Auto => "SpecialCommandType_Smart".Local("Auto Target ") + DataCenter.TargetingType.Local(), - StateCommandType.Manual => "SpecialCommandType_Manual".Local("Manual Target"), - StateCommandType.Cancel => "SpecialCommandType_Off".Local("Off"), + StateCommandType.Auto => UiString.SpecialCommandType_Smart.Local() + DataCenter.TargetingType.Local(), + StateCommandType.Manual => UiString.SpecialCommandType_Manual.Local(), + StateCommandType.Cancel => UiString.SpecialCommandType_Off.Local(), _ => string.Empty, }; } diff --git a/RotationSolver/Localization/LocalizationManager.cs b/RotationSolver/Localization/LocalizationManager.cs index ca32a6922..929fdd96b 100644 --- a/RotationSolver/Localization/LocalizationManager.cs +++ b/RotationSolver/Localization/LocalizationManager.cs @@ -24,7 +24,7 @@ public static string Local(this Type type) return (type.FullName ?? type.Name).Local(type.GetCustomAttribute()?.Description ?? type.ToString()!); } - public static string Local(this string key, string @default) + internal static string Local(this string key, string @default) { if (_rightLang.TryGetValue(key, out var value)) return value; diff --git a/RotationSolver/Localization/Strings.cs b/RotationSolver/Localization/Strings.cs deleted file mode 100644 index bc0a60974..000000000 --- a/RotationSolver/Localization/Strings.cs +++ /dev/null @@ -1,368 +0,0 @@ -//namespace RotationSolver.Localization; - -//[Obsolete] -//internal class Strings -//{ -// #region Commands -// public string Commands_CannotFindConfig { get; set; } = "Failed to find the config, please check it."; -// #endregion - -// #region ConfigWindow -// public string ConfigWindow_Header { get; set; } = "Rotation Solver Settings v"; -// public string ConfigWindow_EventItem { get; set; } = "Event"; - -// public string ConfigWindow_HelpItem_NextAction { get; set; } = "Do the next action"; - -// public string ConfigWindow_Helper_SwitchRotation { get; set; } = "Click to switch rotations"; -// public string ConfigWindow_Helper_GameVersion { get; set; } = "Game"; - -// public string ConfigWindow_Events_AddEvent { get; set; } = "AddEvents"; -// public string ConfigWindow_Events_ActionName { get; set; } = "Action Name"; -// public string ConfigWindow_Events_RemoveEvent { get; set; } = "Delete Event"; -// public string ConfigWindow_Events_DutyStart { get; set; } = "Duty Start: "; -// public string ConfigWindow_Events_DutyEnd { get; set; } = "Duty End: "; - -// public string ConfigWindow_Param_CountDownAhead { get; set; } = "The starting when abilities will be used before finishing the countdown"; -// public string ConfigWindow_Param_AddDotGCDCount { get; set; } = "The number of GCDs in advance for DOT refreshing"; - - -// public string ConfigWindow_Param_WeakenDelay { get; set; } = "The range of random delay for cleansing dispellable debuffs."; - -// public string ConfigWindow_Param_HealDelay { get; set; } = "The range of random delay for healing."; - -// public string ConfigWindow_Param_CountdownDelay { get; set; } = "The random delay between which auto mode activation on countdown varies."; - - -// public string ConfigWindow_Param_DyingTimeToKill { get; set; } = "If target's time until death is lower than this, regard it is dying."; - - - -// public string ConfigWindow_Param_LessMPNoRaise { get; set; } = "Never raise player if MP is less than the set value"; -// public string ConfigWindow_Param_InterruptibleMoreCheck { get; set; } = "Use interrupt abilities if possible."; - -// public string ConfigWindow_Param_RightNowTargetToHostileType { get; set; } = "Engage settings"; -// public string ConfigWindow_Param_AddEnemyListToHostile { get; set; } = "Add enemy list to the hostile targets."; -// public string ConfigWindow_Param_AttackMarkAOEDesc { get; set; } = "Attention: Checking this option , AA will attack as many hostile targets as possible, while ignoring whether the attack will reach the marked target."; -// public string ConfigWindow_Param_MoveTargetAngle { get; set; } = "The size of the sector angle that can be selected as the moveable target"; -// public string ConfigWindow_Param_MoveTargetAngleDesc { get; set; } = "If the selection mode is based on character facing, i.e., targets within the character's viewpoint are moveable targets. \nIf the selection mode is screen-centered, i.e., targets within a sector drawn upward from the character's point are movable targets."; - - - -// public string ConfigWindow_Param_RaiseBrinkOfDeath { get; set; } = "Raise players that even have Brink of Death debuff"; - -// public string ConfigWindow_Param_HostileCondition { get; set; } = "Hostile target selection condition"; -// public string ConfigWindow_Control_CooldownWindowIconSize { get; set; } = "Cooldown icon size"; -// public string ConfigWindow_Rotation_BetaRotation { get; set; } = "Beta Rotation!"; - -// public string ConfigWindow_Rotation_InvalidRotation { get; set; } = "Invalid Rotation! \nPlease update to the latest version or contact to the {0}!"; - -// public string ConfigWindow_List_Description { get; set; } = "In this window, you can set the parameters that can be customised using lists."; -// public string ConfigWindow_List_Hostile { get; set; } = "Hostile"; - -// public string ConfigWindow_List_Invincibility { get; set; } = "Invulnerability"; -// public string ConfigWindow_List_Priority { get; set; } = "Priority"; -// public string ConfigWindow_List_InvincibilityDesc { get; set; } = "Ignores target if it has one of this statuses"; -// public string ConfigWindow_List_PriorityDesc { get; set; } = "Attacks the target first if it has one of this statuses"; -// public string ConfigWindow_List_DangerousStatus { get; set; } = "Dispellable debuffs"; - -// public string ConfigWindow_List_DangerousStatusDesc { get; set; } = "Esuna dispellable debuffs list"; - -// public string ConfigWindow_List_HostileCastingTank { get; set; } = "Tank Buster"; - -// public string ConfigWindow_List_HostileCastingTankDesc { get; set; } = "Use tank personal damage mitigation abilities if the target is casting any of these actions"; - -// public string ConfigWindow_List_HostileCastingArea { get; set; } = "AoE"; - -// public string ConfigWindow_List_HostileCastingAreaDesc { get; set; } = "Use AoE damage mitigation abilities if the target is casting any of these actions"; - -// public string ConfigWindow_List_NoHostile { get; set; } = "Don't target"; -// public string ConfigWindow_List_NoProvoke { get; set; } = "Don't provoke"; -// public string ConfigWindow_List_NoHostileDesc { get; set; } = "Enemies that will never be targeted."; -// public string ConfigWindow_List_NoProvokeDesc { get; set; } = "Enemies that will never be provoked."; - -// #endregion - -// #region Action Sequencer -// public string ActionSequencer_Load { get; set; } = "Load From folder."; -// public string ActionSequencer_TimeOffset { get; set; } = "Time Offset"; - -// public string ActionSequencer_AOECount { get; set; } = "AOE Count"; -// public string ActionSequencer_Charges { get; set; } = "Charges"; -// public string ActionSequencer_ConditionSet { get; set; } = "Condition Set"; -// public string ActionSequencer_ActionCondition { get; set; } = "Action Condition"; -// public string ActionSequencer_TargetCondition { get; set; } = "Target Condition"; -// public string ActionSequencer_RotationCondition { get; set; } = "Rotation Condition"; -// public string ActionSequencer_NamedCondition { get; set; } = "Named Condition"; -// public string ActionSequencer_TerritoryCondition { get; set; } = "Territory Condition"; -// public string ActionSequencer_FromClipboard { get; set; } = "From Clipboard"; -// public string ActionSequencer_TraitCondition { get; set; } = "Trait Condition"; -// public string ActionSequencer_ActionTarget { get; set; } = "{0}'s target"; -// public string ActionSequencer_Target { get; set; } = "Target"; -// public string ActionSequencer_HostileTarget { get; set; } = "Hostile Target"; -// public string ActionSequencer_Player { get; set; } = "Player"; -// public string ActionSequencer_Original { get; set; } = "Original"; -// public string ActionSequencer_Adjusted { get; set; } = "Adjusted"; -// public string ActionSequencer_StatusSelf { get; set; } = "From Self"; -// public string ActionSequencer_StatusAll { get; set; } = "From All"; -// public string ActionSequencer_Delay_Description { get; set; } = "Delay its turning to true."; -// public string ActionSequencer_NotDescription { get; set; } = "Click to make it reverse.\nIs reversed : {0}"; -// #endregion - -// #region Actions -// public string Action_Friendly { get; set; } = "Support"; -// public string Action_Ability { get; set; } = "0GCD"; -// public string Action_Attack { get; set; } = "Attack"; -// #endregion - -// public Dictionary MemberInfoName { get; set; } = new Dictionary() -// { -// #region BLM -// { nameof(BLM_Base.UmbralIceStacks), "Umbral Ice Stacks" }, -// { nameof(BLM_Base.AstralFireStacks), "Astral Fire Stacks" }, -// { nameof(BLM_Base.PolyglotStacks), "Polyglot Stacks" }, -// { nameof(BLM_Base.UmbralHearts), "Umbral Hearts" }, -// { nameof(BLM_Base.IsParadoxActive), "Is Paradox Active" }, -// { nameof(BLM_Base.InUmbralIce), "In Umbral Ice" }, -// { nameof(BLM_Base.InAstralFire), "In Astral Fire" }, -// { nameof(BLM_Base.IsEnochianActive), "Is Enochian Active" }, -// { nameof(BLM_Base.IsPolyglotStacksMaxed), "IsPolyglot Stacks Maxed" }, -// { nameof(BLM_Base.EnochianTime), "Enochian Time" }, -// #endregion - -// #region BRD -// { nameof(BRD_Base.Repertoire), "Repertoire" }, -// { nameof(BRD_Base.SoulVoice), "Soul Voice" }, -// { nameof(BRD_Base.SongTime), "Soul Time" }, -// #endregion - -// #region DNC -// { nameof(DNC_Base.IsDancing), "Is Dancing"}, -// { nameof(DNC_Base.Esprit), "Esprit"}, -// { nameof(DNC_Base.Feathers), "Feathers"}, -// { nameof(DNC_Base.CompletedSteps), "Completed Steps"}, -// #endregion - -// #region DRG -// { nameof(DRG_Base.EyeCount), "Eye Count"}, -// { nameof(DRG_Base.FocusCount), "Focus Count"}, -// { nameof(DRG_Base.LOTDTime), "LOTD Time"}, -// #endregion - -// #region DRK -// { nameof(DRK_Base.Blood), "Blood"}, -// { nameof(DRK_Base.HasDarkArts), "Has Dark Arts"}, -// { nameof(DRK_Base.DarkSideTime), "Dark Side Time"}, -// { nameof(DRK_Base.ShadowTime), "Shadow Side Time"}, -// #endregion - -// #region GNB -// { nameof(GNB_Base.Ammo), "Ammo"}, -// { nameof(GNB_Base.AmmoComboStep), "Ammo Combo Step"}, -// { nameof(GNB_Base.MaxAmmo), "Max Ammo"}, -// #endregion - -// #region MCH -// { nameof(MCH_Base.IsOverheated), "Is Overheated"}, -// { nameof(MCH_Base.Heat), "Heat"}, -// { nameof(MCH_Base.Battery), "Battery"}, -// { nameof(MCH_Base.OverheatTime), "Overheat Time Remaining"}, -// #endregion - -// #region MNK -// { nameof(MNK_Base.Chakra), "Chakra"}, -// { nameof(MNK_Base.HasSolar), "Has Solar"}, -// { nameof(MNK_Base.HasLunar), "Has Lunar"}, -// #endregion - -// #region NIN -// { nameof(NIN_Base.Ninki), "Ninki"}, -// { nameof(NIN_Base.HutonTime), "Huton Time"}, -// #endregion - -// #region PLD -// { nameof(PLD_Base.HasDivineMight), "Has Divine Might"}, -// { nameof(PLD_Base.HasFightOrFlight), "Has Fight Or Flight"}, -// { nameof(PLD_Base.OathGauge), "OathGauge"}, -// #endregion - -// #region RDM -// { nameof(RDM_Base.WhiteMana), "White Mana"}, -// { nameof(RDM_Base.BlackMana), "Black Mana"}, -// { nameof(RDM_Base.ManaStacks), "Mana Stacks"}, -// { nameof(RDM_Base.IsWhiteManaLargerThanBlackMana), "Is White Mana Larger Than Black Mana"}, -// #endregion - -// #region RPR -// { nameof(RPR_Base.HasEnshrouded), "Has Enshrouded"}, -// { nameof(RPR_Base.HasSoulReaver), "Has Soul Reaver"}, -// { nameof(RPR_Base.Soul), "Soul"}, -// { nameof(RPR_Base.Shroud), "Shroud"}, -// { nameof(RPR_Base.LemureShroud), "Lemure Shroud"}, -// { nameof(RPR_Base.VoidShroud), "Void Shroud"}, -// #endregion - -// #region SAM -// { nameof(SAM_Base.HasMoon), "Has Moon"}, -// { nameof(SAM_Base.HasFlower), "Has Flower"}, -// { nameof(SAM_Base.IsMoonTimeLessThanFlower), "Is MoonTime Less Than Flower"}, -// { nameof(SAM_Base.HasSetsu), "Has Setsu"}, -// { nameof(SAM_Base.HasGetsu), "Has Getsu"}, -// { nameof(SAM_Base.HasKa), "Has Ka"}, -// { nameof(SAM_Base.Kenki), "Kenki"}, -// { nameof(SAM_Base.MeditationStacks), "Meditation Stacks"}, -// { nameof(SAM_Base.SenCount), "Sen Count"}, -// #endregion - -// #region SCH -// { nameof(SCH_Base.FairyGauge), "Fairy Gauge"}, -// { nameof(SCH_Base.HasAetherflow), "Has Aetherflow"}, -// { nameof(SCH_Base.SeraphTime), "Seraph Time"}, -// #endregion - -// #region SGE -// { nameof(SGE_Base.HasEukrasia), "Has Eukrasia"}, -// { nameof(SGE_Base.Addersgall), "Addersgall"}, -// { nameof(SGE_Base.Addersting), "Addersting"}, -// { nameof(SGE_Base.AddersgallTime), "Addersgall Time"}, -// #endregion - -// #region SMN -// { nameof(SMN_Base.InBahamut), "In Bahamut"}, -// { nameof(SMN_Base.InPhoenix), "In Phoenix"}, -// { nameof(SMN_Base.HasAetherflowStacks), "Has Aetherflow Stacks"}, -// { nameof(SMN_Base.Attunement), "Attunement"}, -// { nameof(SMN_Base.IsIfritReady), "Is Ifrit Ready"}, -// { nameof(SMN_Base.IsTitanReady), "Is Titan Ready"}, -// { nameof(SMN_Base.IsGarudaReady), "Is Garuda Ready"}, -// { nameof(SMN_Base.InIfrit), "In Ifrit"}, -// { nameof(SMN_Base.InTitan), "In Titan"}, -// { nameof(SMN_Base.InGaruda), "In Garuda"}, -// { nameof(SMN_Base.SummonTime), "Summon Time"}, -// { nameof(SMN_Base.AttunmentTime), "Attunement Time"}, -// #endregion - -// #region WAR -// { nameof(WAR_Base.BeastGauge), "Beast Gauge"}, -// #endregion - -// #region WHM -// { nameof(WHM_Base.Lily), "Lily"}, -// { nameof(WHM_Base.BloodLily), "Blood Lily"}, -// { nameof(WHM_Base.LilyTime), "Lily Time"}, -// #endregion -// }; - -// [Obsolete] -// public string HighEndWarning { get; set; } = "Please separately keybind damage reduction / shield cooldowns in case RS fails at a crucial moment in {0}!"; -// public string TextToTalkWarning { get; set; } = "TextToTalk addon was not detected, please install it to make Rotation Solver give audio notifications!"; -// public string AvariceWarning { get; set; } = "Avarice addon was not detected, please install it if you want to get the positional indicators for Rotation Solver!"; - -// public string ClickingMistakeMessage { get; set; } = "OOOps! RS clicked the wrong action ({0})!"; - -// public string ConfigWindow_About_Punchline { get; set; } = "Analyses PvE combat information every frame and finds the best action."; -// public string ConfigWindow_About_Description { get; set; } = "This means almost all the information available in one frame in combat, including the status of all players in the party, the status of any hostile targets, skill cooldowns, the MP and HP of characters, the location of characters, casting status of the hostile target, combo, combat duration, player level, etc.\n\nThen, it will highlight the best action on the hot bar, or help you to click on it."; - -// public string ConfigWindow_About_Warning { get; set; } = "It is designed for GENERAL COMBAT, not for savage or ultimate. Use it carefully."; - -// public string ConfigWindow_About_Macros { get; set; } = "Macros"; -// public string ConfigWindow_About_Links { get; set; } = "Links"; -// public string ConfigWindow_About_Compatibility { get; set; } = "Compatibility"; -// public string ConfigWindow_About_Supporters { get; set; } = "Supporters"; -// public string ConfigWindow_About_Compatibility_Description { get; set; } = "Literally, Rotation Solver helps you to choose the target and then click the action. So any plugin that changes these will affect its decision.\n\nHere is a list of known incompatible plugins:"; -// public string ConfigWindow_About_Compatibility_Others { get; set; } = "Please don't relog without closing the game. Crashes may occur."; - -// public string ConfigWindow_About_Compatibility_Mistake { get; set; } = "Can't properly execute the behavior that RS wants to do."; -// public string ConfigWindow_About_Compatibility_Mislead { get; set; } = "Misleading RS to make the right decision."; -// public string ConfigWindow_About_Compatibility_Crash { get; set; } = "Causes the game to crash."; - -// public string ConfigWindow_Rotation_Description { get; set; } = "Description"; -// public string ConfigWindow_Rotation_Status { get; set; } = "Status"; -// public string ConfigWindow_Rotation_Configuration { get; set; } = "Configuration"; -// public string ConfigWindow_Rotation_Rating { get; set; } = "Rating"; -// public string ConfigWindow_Rotation_Information { get; set; } = "Information"; -// public string ConfigWindow_Rotation_Rating_Description { get; set; } = "Here are some rating methods to analysis this rotation. Most of these methods need your engagement."; -// public string ConfigWindow_Rotation_Rating_CountOfLastUsing { get; set; } = "This is the count of using last action checking in this rotation. First is average one, second is maximum one. The less the better.\nLast used action is not a part of information from the game, it is recorded by player or author. \nIt can't accurately describe the current state of combat, which may make this rotation not general. \nFor example, clipping the gcd, death, take some status that grated by some action off manually, etc."; -// public string ConfigWindow_Rotation_Rating_CountOfCombatTimeUsing { get; set; } = "This is the count of using combat time in this rotation. First is average one, second is maximum one. The less the better.\nCombat time is not a part of information from the game, it is recorded by player or author. \nIt can't accurately describe the current state of combat, which may make this rotation not general.\nFor example, engaged by others in the party, different gcd time, etc."; - -// public string ConfigWindow_Actions_Description { get; set; } = "To customize when Rotation Solver uses specific actions automatically, click on an action's icon in the left list. Below, you may set the conditions for when that specific action is used. Each action can have a different set of conditions to override the default rotation behavior."; - -// public string ConfigWindow_Actions_ForcedConditionSet { get; set; } = "Forced Condition"; -// public string ConfigWindow_Actions_ForcedConditionSet_Description { get; set; } = "Conditions for forced automatic use of action."; -// public string ConfigWindow_Actions_DisabledConditionSet { get; set; } = "Disabled Condition"; -// public string ConfigWindow_Actions_DisabledConditionSet_Description { get; set; } = "Conditions for automatic use of action being disabled."; -// public string ConfigWindow_Actions_ShowOnCDWindow { get; set; } = "Show on CD window"; -// public string ConfigWindow_Actions_IsInMistake { get; set; } = "Can be used by mistake"; - -// public string ConfigWindow_Rotations_Settings { get; set; } = "Settings"; -// public string ConfigWindow_Rotations_Loaded { get; set; } = "Loaded"; -// public string ConfigWindow_Rotations_GitHub { get; set; } = "GitHub"; -// public string ConfigWindow_Rotations_Libraries { get; set; } = "Libraries"; - -// public string ConfigWindow_Rotations_UserName { get; set; } = "User Name"; -// public string ConfigWindow_Rotations_Repository { get; set; } = "Repository"; - -// public string ConfigWindow_Rotations_FileName { get; set; } = "File Name"; - -// public string ConfigWindow_Rotations_Library { get; set; } = "The folder contains rotation libs or the download url about rotation lib."; - -// public string ConfigWindow_List_Statuses { get; set; } = "Statuses"; -// public string ConfigWindow_List_Actions { get; set; } = "Actions"; -// public string ConfigWindow_List_Territories { get; set; } = "Map specific settings"; -// public string ConfigWindow_List_StatusNameOrId { get; set; } = "Status name or id"; -// public string ConfigWindow_Actions_MemberName { get; set; } = "Member Name"; -// public string ConfigWindow_List_AddStatus { get; set; } = "Add Status"; -// public string ConfigWindow_List_Remove { get; set; } = "Remove"; - -// public string ConfigWindow_List_ActionNameOrId { get; set; } = "Action name or id"; -// public string ConfigWindow_List_AddAction { get; set; } = "Add Action"; - -// public string ConfigWindow_List_BeneficialPositions { get; set; } = "Beneficial AoE locations"; -// public string ConfigWindow_List_NoHostilesName { get; set; } = "The name of the enemy that you don't want to be targeted"; -// public string ConfigWindow_List_NoProvokeName { get; set; } = "The name of the enemy that you don't want to be provoked"; - -// public string ConfigWindow_Basic_Timer { get; set; } = "Timer"; -// public string ConfigWindow_Extra_Others { get; set; } = "Others"; -// public string ConfigWindow_Extra_Description { get; set; } = "Rotation Solver focuses on the rotation itself. These are side features. If there are some other plugins can do that, these features will be deleted."; -// public string ConfigWindow_Search_Result { get; set; } = "Search Result"; -// public string ConfigWindow_List_AddPosition { get; set; } = "Add beneficial AoE location"; -// public string ConfigWindow_Actions_MoveUp { get; set; } = "Move Up"; -// public string ConfigWindow_Actions_MoveDown { get; set; } = "Move Down"; -// public string ConfigWindow_Actions_Copy { get; set; } = "Copy to Clipboard"; - -// public string ConfigWindow_About_OpenConfigFolder { get; set; } = "Open Config Folder"; -// public string ConfigWindow_About_ClickingCount { get; set; } = "Rotation Solver helped you by clicking actions {0:N0} times."; -// public string ConfigWindow_About_SayHelloCount { get; set; } = "You have said hello to other users {0:N0} times!"; - - -// public string ConfigWindow_Auto_AutoDefenseNumber { get; set; } = "The number hostile targets attacking you. If it's larger than this RS uses personal mitigation abilities."; - -// public string ConfigWindow_Auto_ProvokeDelay { get; set; } = "The delay of provoke."; - - -// public string ConfigWindow_Actions_AOECount { get; set; } = "How many targets are needed to use this action."; -// public string ConfigWindow_Actions_TTK { get; set; } = "TTK that this action needs the target be."; -// public string ConfigWindow_Actions_HealRatio { get; set; } = "The HP ratio to auto heal"; -// public string ConfigWindow_Actions_ConditionDescription { get; set; } = "Forced Conditions have a higher priority. If Forced Conditions are met, Disabled Condition will be ignored."; - -// public string ConfigWindow_Basic_SayHelloToUsers { get; set; } = "Say hello to the users of Rotation Solver."; - - -// public string ConfigWindow_About_Clicking100k { get; set; } = "Well, you must be a lazy player!"; -// public string ConfigWindow_About_Clicking500k { get; set; } = "You're tiring RS out, give it a break!"; - -// public string ConfigWindow_About_ThanksToSupporters { get; set; } = "Many thanks to the sponsors."; -// public string ConfigWindow_Rotations_Download { get; set; } = "Download Rotations"; -// public string ConfigWindow_Rotations_Links { get; set; } = "Links of the rotations online"; -// public string ConfigWindow_ConditionSetDesc { get; set; } = "The Condition set you chose, click to modify."; - -// public string ConfigWindow_Condition_RotationNullWarning { get; set; } = "Rotation is null, please login or switch the job!"; - -// public string ConfigWindow_Condition_NoItemsWarning { get; set; } = "There are no items!"; - -// public string ConfigWindow_Condition_ConditionName { get; set; } = "Condition Name"; - -// public string ConfigWindow_Condition_TerritoryName { get; set; } = "Territory Name"; - -// public string ConfigWindow_Condition_DutyName { get; set; } = "Duty Name"; -// public string ConfigWindow_Condition_TargetWarning { get; set; } = "You'd better not use it. Because this target isn't the action's target. Try to pick it from action."; -//} \ No newline at end of file diff --git a/RotationSolver/Localization/UiString.cs b/RotationSolver/Localization/UiString.cs new file mode 100644 index 000000000..ab798fa91 --- /dev/null +++ b/RotationSolver/Localization/UiString.cs @@ -0,0 +1,602 @@ +using System.ComponentModel; + +namespace RotationSolver.Localization; +internal enum UiString +{ + [Description("The Condition set you chose, click to modify.")] + ConfigWindow_ConditionSetDesc, + + [Description("Remove")] + ConfigWindow_List_Remove, + + [Description("Load From folder.")] + ActionSequencer_Load, + + [Description("Analyses PvE combat information in every frame and finds the best action.")] + ConfigWindow_About_Punchline, + + [Description("Game")] + ConfigWindow_Helper_GameVersion, + + [Description("Invalid Rotation! \nPlease update to the latest version or contact to the {0}!")] + ConfigWindow_Rotation_InvalidRotation, + + [Description("Beta Rotation!")] + ConfigWindow_Rotation_BetaRotation, + + [Description("Click to switch rotations")] + ConfigWindow_Helper_SwitchRotation, + + [Description("Search Result")] + ConfigWindow_Search_Result, + + [Description("Well, you must be a lazy player!")] + ConfigWindow_About_Clicking100k, + + [Description("You're tiring RS out, give it a break!")] + ConfigWindow_About_Clicking500k, + + [Description("This means almost all the information available in one frame in combat, including the status of all players in the party, the status of any hostile targets, skill cooldowns, the MP and HP of characters, the location of characters, casting status of the hostile target, combo, combat duration, player level, etc.\n\nThen, it will highlight the best action on the hot bar, or help you to click on it.")] + ConfigWindow_About_Description, + + [Description("It is designed for GENERAL COMBAT, not for savage or ultimate. Use it carefully.")] + ConfigWindow_About_Warning, + + [Description("Rotation Solver helped you by clicking actions {0:N0} times.")] + ConfigWindow_About_ClickingCount, + + [Description("You have said hello to other users {0:N0} times!")] + ConfigWindow_About_SayHelloCount, + + [Description("Macro")] + ConfigWindow_About_Macros, + + [Description("Compatibility")] + ConfigWindow_About_Compatibility, + + [Description("Supporters")] + ConfigWindow_About_Supporters, + + [Description("Links")] + ConfigWindow_About_Links, + + [Description("Please don't relog without closing the game. Crashes may occur.")] + ConfigWindow_About_Compatibility_Others, + + [Description("Literally, Rotation Solver helps you to choose the target and then click the action. So any plugin that changes these will affect its decision.\n\nHere is a list of known incompatible plugins:")] + ConfigWindow_About_Compatibility_Description, + + [Description("Can't properly execute the behavior that RS wants to do.")] + ConfigWindow_About_Compatibility_Mistake, + + [Description("Misleading RS to make the right decision.")] + ConfigWindow_About_Compatibility_Mislead, + + [Description("Causes the game to crash.")] + ConfigWindow_About_Compatibility_Crash, + + [Description("Many thanks to the sponsors.")] + ConfigWindow_About_ThanksToSupporters, + + [Description("Open Config Folder")] + ConfigWindow_About_OpenConfigFolder, + + [Description("Description")] + ConfigWindow_Rotation_Description, + + [Description("Configuration")] + ConfigWindow_Rotation_Configuration, + + [Description("Rating")] + ConfigWindow_Rotation_Rating, + + [Description("Information")] + ConfigWindow_Rotation_Information, + + [Description("Here are some rating methods to analysis this rotation. Most of these methods need your engagement.")] + ConfigWindow_Rotation_Rating_Description, + + [Description("This is the count of using last action checking in this rotation. First is average one, second is maximum one. The less the better.\nLast used action is not a part of information from the game, it is recorded by player or author. \nIt can't accurately describe the current state of combat, which may make this rotation not general. \nFor example, clipping the gcd, death, take some status that grated by some action off manually, etc.")] + ConfigWindow_Rotation_Rating_CountOfLastUsing, + + [Description("This is the count of using combat time in this rotation. First is average one, second is maximum one. The less the better.\nCombat time is not a part of information from the game, it is recorded by player or author. \nIt can't accurately describe the current state of combat, which may make this rotation not general.\nFor example, engaged by others in the party, different gcd time, etc.")] + ConfigWindow_Rotation_Rating_CountOfCombatTimeUsing, + + [Description("Status")] + ConfigWindow_Rotation_Status, + + [Description("To customize when Rotation Solver uses specific actions automatically, click on an action's icon in the left list. Below, you may set the conditions for when that specific action is used. Each action can have a different set of conditions to override the default rotation behavior.")] + ConfigWindow_Actions_Description, + + [Description("Show on CD window")] + ConfigWindow_Actions_ShowOnCDWindow, + + [Description("Can be used by mistake")] + ConfigWindow_Actions_IsInMistake, + + [Description("TTK that this action needs the target be.")] + ConfigWindow_Actions_TTK, + + [Description("How many targets are needed to use this action.")] + ConfigWindow_Actions_AoeCount, + + [Description("The HP ratio to auto heal")] + ConfigWindow_Actions_HealRatio, + + [Description("Forced Conditions have a higher priority. If Forced Conditions are met, Disabled Condition will be ignored.")] + ConfigWindow_Actions_ConditionDescription, + + [Description("Forced Condition")] + ConfigWindow_Actions_ForcedConditionSet, + + [Description("Conditions for forced automatic use of action.")] + ConfigWindow_Actions_ForcedConditionSet_Description, + + [Description("Disabled Condition")] + ConfigWindow_Actions_DisabledConditionSet, + + [Description("Conditions for automatic use of action being disabled.")] + ConfigWindow_Actions_DisabledConditionSet_Description, + + [Description("Download Rotations")] + ConfigWindow_Rotations_Download, + + [Description("Links of the rotations online")] + ConfigWindow_Rotations_Links, + + [Description("Settings")] + ConfigWindow_Rotations_Settings, + + [Description("Loaded")] + ConfigWindow_Rotations_Loaded, + + [Description("Github")] + ConfigWindow_Rotations_GitHub, + + [Description("Libraries")] + ConfigWindow_Rotations_Libraries, + + [Description("User Name")] + ConfigWindow_Rotations_UserName, + + [Description("Repository")] + ConfigWindow_Rotations_Repository, + + [Description("File Name")] + ConfigWindow_Rotations_FileName, + + [Description("The folder contains rotation libs or the download url about rotation lib.")] + ConfigWindow_Rotations_Library, + + [Description("In this window, you can set the parameters that can be customised using lists.")] + ConfigWindow_List_Description, + + [Description("Statuses")] + ConfigWindow_List_Statuses, + + [Description("Actions")] + ConfigWindow_List_Actions, + + [Description("Map specific settings")] + ConfigWindow_List_Territories, + + [Description("Status name or id")] + ConfigWindow_List_StatusNameOrId, + + [Description("Invulnerability")] + ConfigWindow_List_Invincibility, + + [Description("Priority")] + ConfigWindow_List_Priority, + + [Description("Dispellable debuffs")] + ConfigWindow_List_DangerousStatus, + + [Description("Ignores target if it has one of this statuses")] + ConfigWindow_List_InvincibilityDesc, + + [Description("Attacks the target first if it has one of this statuses")] + ConfigWindow_List_PriorityDesc, + + [Description("Dispellable debuffs list")] + ConfigWindow_List_DangerousStatusDesc, + + [Description("Copy to Clipboard")] + ConfigWindow_Actions_Copy, + + [Description("From Clipboard")] + ActionSequencer_FromClipboard, + + [Description("Add Status")] + ConfigWindow_List_AddStatus, + + [Description("Action name or id")] + ConfigWindow_List_ActionNameOrId, + + [Description("Tank Buster")] + ConfigWindow_List_HostileCastingTank, + + [Description("AoE")] + ConfigWindow_List_HostileCastingArea, + + [Description("Use tank personal damage mitigation abilities if the target is casting any of these actions")] + ConfigWindow_List_HostileCastingTankDesc, + + [Description("Use AoE damage mitigation abilities if the target is casting any of these actions")] + ConfigWindow_List_HostileCastingAreaDesc, + + [Description("Add Action")] + ConfigWindow_List_AddAction, + + [Description("Don't target")] + ConfigWindow_List_NoHostile, + + [Description("Don't provoke")] + ConfigWindow_List_NoProvoke, + + [Description("Beneficial AoE locations")] + ConfigWindow_List_BeneficialPositions, + + [Description("Enemies that will never be targeted.")] + ConfigWindow_List_NoHostileDesc, + + [Description("The name of the enemy that you don't want to be targeted")] + ConfigWindow_List_NoHostilesName, + + [Description("Enemies that will never be provoked.")] + ConfigWindow_List_NoProvokeDesc, + + [Description("The name of the enemy that you don't want to be provoked")] + ConfigWindow_List_NoProvokeName, + + [Description("Add beneficial AoE location")] + ConfigWindow_List_AddPosition, + + [Description("OOOps! RS clicked the wrong action ({0})!")] + ClickingMistakeMessage, + + [Description("Ability")] + ActionAbility, + + [Description("Friendly")] + ActionFriendly, + + [Description("Attack")] + ActionAttack, + + [Description("Normal Targets")] + NormalTargets, + + [Description("Targets with HOT")] + HotTargets, + + [Description("HP for AoE healing oGCDs")] + HpAoe0Gcd, + + [Description("HP for AoE healing GCDs")] + HpAoeGcd, + + [Description("HP for ST healing oGCDs")] + HpSingle0Gcd, + + [Description("HP for ST healing GCDs")] + HpSingleGcd, + + [Description("No Move")] + InfoWindowNoMove, + + [Description("Move")] + InfoWindowMove, + + [Description("Search... ")] + ConfigWindow_Searching, + + [Description("Timer")] + ConfigWindow_Basic_Timer, + + [Description("Auto Switch")] + ConfigWindow_Basic_AutoSwitch, + + [Description("Named Conditions")] + ConfigWindow_Basic_NamedConditions, + + [Description("Others")] + ConfigWindow_Basic_Others, + + [Description("The ping time.\nIn RS, it means the time from sending the action request to receiving the using success message from the server.")] + ConfigWindow_Basic_Ping, + + [Description("The Animation lock time from individual actions. Here is 0.6s for example.")] + ConfigWindow_Basic_AnimationLockTime, + + [Description("The clicking duration, RS will try to click at this moment.")] + ConfigWindow_Basic_ClickingDuration, + + [Description("The ideal click time.")] + ConfigWindow_Basic_IdealClickingTime, + + [Description("The real click time.")] + ConfigWindow_Basic_RealClickingTime, + + [Description("Auto turn off conditions")] + ConfigWindow_Basic_SwitchCancelConditionSet, + + [Description("Auto turn manual conditions")] + ConfigWindow_Basic_SwitchManualConditionSet, + + [Description("Auto turn auto conditions")] + ConfigWindow_Basic_SwitchAutoConditionSet, + + [Description("Condition Name")] + ConfigWindow_Condition_ConditionName, + + [Description("Information")] + ConfigWindow_UI_Information, + + [Description("Overlay")] + ConfigWindow_UI_Overlay, + + [Description("Windows")] + ConfigWindow_UI_Windows, + + [Description("Change the way that RS atomatically uses actions.")] + ConfigWindow_Auto_Description, + + [Description("Action Usage")] + ConfigWindow_Auto_ActionUsage, + + [Description("Which actions Rotation Solver can use.")] + ConfigWindow_Auto_ActionUsage_Description, + + [Description("Action Condition")] + ConfigWindow_Auto_ActionCondition, + + [Description("State Condition")] + ConfigWindow_Auto_StateCondition, + + [Description("Heal Area Forced Condition")] + ConfigWindow_Auto_HealAreaConditionSet, + + [Description("Heal Single Forced Condition")] + ConfigWindow_Auto_HealSingleConditionSet, + + [Description("Defense Area Forced Condition")] + ConfigWindow_Auto_DefenseAreaConditionSet, + + [Description("Defense Single Forced Condition")] + ConfigWindow_Auto_DefenseSingleConditionSet, + + [Description("Esuna Stance North Forced Condition")] + ConfigWindow_Auto_DispelStancePositionalConditionSet, + + [Description("Raise Shirk Forced Condition")] + ConfigWindow_Auto_RaiseShirkConditionSet, + + [Description("Move Forward Forced Condition")] + ConfigWindow_Auto_MoveForwardConditionSet, + + [Description("Move Back Forced Condition")] + ConfigWindow_Auto_MoveBackConditionSet, + + [Description("Anti Knockback Forced Condition")] + ConfigWindow_Auto_AntiKnockbackConditionSet, + + [Description("Speed Forced Condition")] + ConfigWindow_Auto_SpeedConditionSet, + + [Description("Limit Break Condition")] + ConfigWindow_Auto_LimitBreakConditionSet, + + [Description("This will change the way that Rotation Solver uses actions.")] + ConfigWindow_Auto_ActionCondition_Description, + + [Description("Configuration")] + ConfigWindow_Target_Config, + + [Description("Hostile")] + ConfigWindow_List_Hostile, + + [Description("You can The logic of hostile target selection to allow flexibility in switching the logic of selecting hostile in battle.")] + ConfigWindow_Param_HostileDesc, + + [Description("Move Up")] + ConfigWindow_Actions_MoveUp, + + [Description("Move Down")] + ConfigWindow_Actions_MoveDown, + + [Description("Hostile target selection condition")] + ConfigWindow_Param_HostileCondition, + + [Description("Rotation Solver focuses on the rotation itself. These are side features. If there are some other plugins can do that, these features will be deleted.")] + ConfigWindow_Extra_Description, + + [Description("Event")] + ConfigWindow_EventItem, + + [Description("Others")] + ConfigWindow_Extra_Others, + + [Description("Add Events")] + ConfigWindow_Events_AddEvent, + + [Description("In this window, you can set what macro will be trigger after using an action.")] + ConfigWindow_Events_Description, + + [Description("Duty Start: ")] + ConfigWindow_Events_DutyStart, + + [Description("Duty End: ")] + ConfigWindow_Events_DutyEnd, + + [Description("Delete Event")] + ConfigWindow_Events_RemoveEvent, + + [Description("Click to make it reverse.\nIs reversed : {0}")] + ActionSequencer_NotDescription, + + [Description("Member Name")] + ConfigWindow_Actions_MemberName, + + [Description("Rotation is null, please login or switch the job!")] + ConfigWindow_Condition_RotationNullWarning, + + [Description("Delay its turning to true.")] + ActionSequencer_Delay_Description, + + [Description("Enought Level")] + ActionConditionType_EnoughLevel, + + [Description("Time Offset")] + ActionSequencer_TimeOffset, + + [Description("Charges")] + ActionSequencer_Charges, + + [Description("Original")] + ActionSequencer_Original, + + [Description("Adjusted")] + ActionSequencer_Adjusted, + + [Description("{0}'s target")] + ActionSequencer_ActionTarget, + + [Description("From All")] + ActionSequencer_StatusAll, + + [Description("From Self")] + ActionSequencer_StatusSelf, + + [Description("You'd better not use it. Because this target isn't the action's target. Try to pick it from action.")] + ConfigWindow_Condition_TargetWarning, + + [Description("Territory Name")] + ConfigWindow_Condition_TerritoryName, + + [Description("Duty Name")] + ConfigWindow_Condition_DutyName, + + [Description("Please separately keybind damage reduction / shield cooldowns in case RS fails at a crucial moment in {0}!")] + HighEndWarning, + + [Description("Avarice addon was not detected, please install it if you want to get the positional indicators for Rotation Solver!")] + AvariceWarning, + + [Description("TextToTalk addon was not detected, please install it to make Rotation Solver give audio notifications!")] + TextToTalkWarning, + + [Description("Use Forced Enable Condition")] + ForcedEnableCondition, + + [Description("The conditions of forced to make it true.")] + ForcedEnableConditionDesc, + + [Description("Use Forced Disable Condition")] + ForcedDisableCondition, + + [Description("The conditions of forced to make it false.")] + ForcedDisableConditionDesc, + + [Description("Click to execute the command")] + ConfigWindow_Helper_RunCommand, + + [Description("Right-click to copy the command")] + ConfigWindow_Helper_CopyCommand, + + [Description("Macro No.")] + ConfigWindow_Events_MacroIndex, + + [Description("Is Shared")] + ConfigWindow_Events_ShareMacro, + + [Description("Action Name")] + ConfigWindow_Events_ActionName, + + [Description("Modify {0} to {1}")] + CommandsChangeSettingsValue, + + [Description("Failed to find the config in this rotation, please check it.")] + CommandsCannotFindConfig, + + [Description("Will use it within {0}s")] + CommandsInsertAction, + + [Description("Can not find the action, please check the action name.")] + CommandsInsertActionFailure, + + [Description("Start ")] + SpecialCommandType_Start, + + [Description("Cancel")] + SpecialCommandType_Cancel, + + [Description("Heal Area")] + SpecialCommandType_HealArea, + + [Description("Heal Single")] + SpecialCommandType_HealSingle, + + [Description("Defense Area")] + SpecialCommandType_DefenseArea, + + [Description("Defense Single")] + SpecialCommandType_DefenseSingle, + + [Description("Tank Stance")] + SpecialCommandType_TankStance, + + [Description("Dispel")] + SpecialCommandType_Dispel, + + [Description("Positional")] + SpecialCommandType_Positional, + + [Description("Shirk")] + SpecialCommandType_Shirk, + + [Description("Raise")] + SpecialCommandType_Raise, + + [Description("Move Forward")] + SpecialCommandType_MoveForward, + + [Description("Move Back")] + SpecialCommandType_MoveBack, + + [Description("Anti Knockback")] + SpecialCommandType_AntiKnockback, + + [Description("Burst")] + SpecialCommandType_Burst, + + [Description("End Special")] + SpecialCommandType_EndSpecial, + + [Description("Speed")] + SpecialCommandType_Speed, + + [Description("Limit Break")] + SpecialCommandType_LimitBreak, + + [Description("Auto Target ")] + SpecialCommandType_Smart, + + [Description("Manual Target")] + SpecialCommandType_Manual, + + [Description("Off")] + SpecialCommandType_Off, + + [Description("Open config window.")] + Commands_Rotation, + + [Description("Rotation Solver Settings v")] + ConfigWindowHeader, + + [Description("This config is job specific")] + JobConfigTip, + + [Description("This option is unavailable while using your current job\n \nRoles or jobs needed:\n{0}")] + NotInJob, +} diff --git a/RotationSolver/RotationSolverPlugin.cs b/RotationSolver/RotationSolverPlugin.cs index 0864bd042..d7338ea7f 100644 --- a/RotationSolver/RotationSolverPlugin.cs +++ b/RotationSolver/RotationSolverPlugin.cs @@ -43,7 +43,7 @@ public RotationSolverPlugin(DalamudPluginInterface pluginInterface) _dis.Add(new Service()); try { - Service.Config = JsonConvert.DeserializeObject( + Service.Config = JsonConvert.DeserializeObject( File.ReadAllText(Svc.PluginInterface.ConfigFile.FullName), new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.Objects, @@ -53,12 +53,12 @@ public RotationSolverPlugin(DalamudPluginInterface pluginInterface) args.ErrorContext.Handled = true; }!, }) - ?? new ConfigsNew(); + ?? new Configs(); } catch (Exception ex) { Svc.Log.Warning(ex, "Failed to load config"); - Service.Config = new ConfigsNew(); + Service.Config = new Configs(); } _rotationConfigWindow = new(); @@ -103,7 +103,7 @@ public RotationSolverPlugin(DalamudPluginInterface pluginInterface) internal static void ChangeUITranslation() { - _rotationConfigWindow!.WindowName = "ConfigWindowHeader".Local("Rotation Solver Settings v") + _rotationConfigWindow!.WindowName = UiString.ConfigWindowHeader.Local() + typeof(RotationConfigWindow).Assembly.GetName().Version?.ToString() ?? "?.?.?"; RSCommands.Disable(); diff --git a/RotationSolver/UI/ConditionDrawer.cs b/RotationSolver/UI/ConditionDrawer.cs index 22f914377..13e17fe42 100644 --- a/RotationSolver/UI/ConditionDrawer.cs +++ b/RotationSolver/UI/ConditionDrawer.cs @@ -39,7 +39,7 @@ internal static void DrawCondition(bool? tag, string id, ref bool isNot) isNot = !isNot; } - ImguiTooltips.HoveredTooltip(string.Format("ActionSequencer_NotDescription".Local("Click to make it reverse.\nIs reversed : {0}"), isNot)); + ImguiTooltips.HoveredTooltip(string.Format(UiString.ActionSequencer_NotDescription.Local(), isNot)); } } else @@ -52,7 +52,7 @@ internal static void DrawCondition(bool? tag, string id, ref bool isNot) { isNot = !isNot; } - ImguiTooltips.HoveredTooltip(string.Format("ActionSequencer_NotDescription".Local("Click to make it reverse.\nIs reversed : {0}"), isNot)); + ImguiTooltips.HoveredTooltip(string.Format(UiString.ActionSequencer_NotDescription.Local(), isNot)); } } } @@ -128,7 +128,7 @@ public static bool DrawCondition(ICondition condition, ref int index) internal static void SearchItemsReflection(string popId, string name, ref string searchTxt, MemberInfo[] actions, Action selectAction) { - SearchItems(popId, name, ref searchTxt, actions, LocalizationManager.Local, selectAction, "ConfigWindow_Actions_MemberName".Local("Member Name")); + SearchItems(popId, name, ref searchTxt, actions, LocalizationManager.Local, selectAction, UiString.ConfigWindow_Actions_MemberName.Local()); } internal static void SearchItems(string popId, string name, ref string searchTxt, T[] items, Func getSearchName, Action selectAction, string searchingHint) @@ -157,7 +157,7 @@ internal static void SearchItems(string popId, string name, ref string search ImGui.Spacing(); - ImRaii.IEndObject child = null; + ImRaii.IEndObject? child = null; if (members.Count() >= 15) { ImGui.SetNextWindowSizeConstraints(new Vector2(0, 300), new Vector2(500, 300)); @@ -232,7 +232,7 @@ public static void Draw(this ICondition condition, ICustomRotation rotation) { if (rotation == null) { - ImGui.TextColored(ImGuiColors.DalamudRed, "ConfigWindow_Condition_RotationNullWarning".Local("Rotation is null, please login or switch the job!")); + ImGui.TextColored(ImGuiColors.DalamudRed, UiString.ConfigWindow_Condition_RotationNullWarning.Local()); return; } @@ -258,7 +258,7 @@ private static void DrawDelay(this DelayCondition condition) condition.DelayMin = Math.Max(Math.Min(condition.DelayMin, condition.DelayMax), MIN); condition.DelayMax = Math.Min(Math.Max(condition.DelayMin, condition.DelayMax), MAX); } - ImguiTooltips.HoveredTooltip("ActionSequencer_Delay_Description".Local("Delay its turning to true.") + + ImguiTooltips.HoveredTooltip(UiString.ActionSequencer_Delay_Description.Local() + "\n" + ConfigUnitType.Seconds.Local()); } @@ -310,7 +310,7 @@ private static void DrawAfter(this NamedCondition namedCondition, ICustomRotatio DataCenter.RightSet.NamedConditions.Select(p => p.Name).ToArray(), i => i.ToString(), i => { namedCondition.ConditionName = i; - }, "ConfigWindow_Condition_ConditionName".Local("Condition Name")); + }, UiString.ConfigWindow_Condition_ConditionName.Local()); ImGui.SameLine(); } @@ -372,7 +372,7 @@ private static void DrawAfter(this TraitCondition traitCondition, ICustomRotatio var i = 0; ImGuiHelper.SelectableCombo($"##Category{traitCondition.GetHashCode()}", [ - "ActionConditionType_EnoughLevel".Local("Enough Level") + UiString.ActionConditionType_EnoughLevel.Local() ], ref i); ImGui.SameLine(); } @@ -419,7 +419,7 @@ private static void DrawAfter(this ActionCondition actionCondition, ICustomRotat { actionCondition.Param1 = Math.Max(0, actionCondition.Param1); } - if (DrawDragInt($"{"ActionSequencer_TimeOffset".Local("Time Offset")}##Ability{actionCondition.GetHashCode()}", ref actionCondition.Param2)) + if (DrawDragInt($"{UiString.ActionSequencer_TimeOffset.Local()}##Ability{actionCondition.GetHashCode()}", ref actionCondition.Param2)) { actionCondition.Param2 = Math.Max(0, actionCondition.Param2); } @@ -462,7 +462,7 @@ private static void DrawAfter(this ActionCondition actionCondition, ICustomRotat case ActionConditionType.MaxCharges: DrawCondition(actionCondition, ref actionCondition.Param2); - if (DrawDragInt($"{"ActionSequencer_Charges".Local("Charges")}##Charges{actionCondition.GetHashCode()}", ref actionCondition.Param1)) + if (DrawDragInt($"{UiString.ActionSequencer_Charges.Local()}##Charges{actionCondition.GetHashCode()}", ref actionCondition.Param1)) { actionCondition.Param1 = Math.Max(0, actionCondition.Param1); } @@ -510,10 +510,10 @@ void Copy() var key = $"Condition Pop Up: {condition.GetHashCode()}"; ImGuiHelper.DrawHotKeysPopup(key, string.Empty, - ("ConfigWindow_List_Remove".Local("Remove"), Delete, ["Delete"]), - ("ConfigWindow_Actions_MoveUp".Local("Move Up"), Up, ["↑"]), - ("ConfigWindow_Actions_MoveDown".Local("Move Down"), Down, ["↓"]), - ("ConfigWindow_Actions_Copy".Local("Copy to Clipboard"), Copy, ["Ctrl"])); + (UiString.ConfigWindow_List_Remove.Local(), Delete, ["Delete"]), + (UiString.ConfigWindow_Actions_MoveUp.Local(), Up, ["↑"]), + (UiString.ConfigWindow_Actions_MoveDown.Local(), Down, ["↓"]), + (UiString.ConfigWindow_Actions_Copy.Local(), Copy, ["Ctrl"])); if (condition is DelayCondition delay) { @@ -525,10 +525,10 @@ void Copy() } ImGuiHelper.ExecuteHotKeysPopup(key, string.Empty, string.Empty, true, - (Delete, new VirtualKey[] { VirtualKey.DELETE }), - (Up, new VirtualKey[] { VirtualKey.UP }), - (Down, new VirtualKey[] { VirtualKey.DOWN }), - (Copy, new VirtualKey[] { VirtualKey.CONTROL })); + (Delete, [VirtualKey.DELETE]), + (Up, [VirtualKey.UP]), + (Down, [VirtualKey.DOWN]), + (Copy, [VirtualKey.CONTROL])); ImGui.SameLine(); @@ -554,7 +554,7 @@ void AddButton() AddOneCondition(); AddOneCondition(); AddOneCondition(); - if (ImGui.Selectable("ActionSequencer_FromClipboard".Local("From Clipboard"))) + if (ImGui.Selectable(UiString.ActionSequencer_FromClipboard.Local())) { var str = ImGui.GetClipboardText(); try @@ -661,11 +661,11 @@ private static void DrawAfter(this RotationCondition rotationCondition, ICustomR } ImGui.SameLine(); - ImGuiHelper.SelectableCombo($"##Adjust{rotationCondition.GetHashCode()}", new string[] - { - "ActionSequencer_Original".Local("Original"), - "ActionSequencer_Adjusted".Local("Adjusted"), - }, ref rotationCondition.Param1); + ImGuiHelper.SelectableCombo($"##Adjust{rotationCondition.GetHashCode()}", + [ + UiString.ActionSequencer_Original.Local(), + UiString.ActionSequencer_Adjusted.Local(), + ], ref rotationCondition.Param1); break; } } @@ -726,7 +726,7 @@ private static void DrawAfter(this TargetCondition targetCondition, ICustomRotat } ImGuiHelper.DrawActionOverlay(cursor, IconSize, 1); - var description = targetCondition._action != null ? string.Format("ActionSequencer_ActionTarget".Local("{0}'s target"), targetCondition._action.Name) + var description = targetCondition._action != null ? string.Format(UiString.ActionSequencer_ActionTarget.Local(), targetCondition._action.Name) : targetCondition.TargetType.Local(); ImguiTooltips.HoveredTooltip(description); } @@ -766,8 +766,8 @@ void DrawStatusIcon() var check = targetCondition.FromSelf ? 1 : 0; if (ImGuiHelper.SelectableCombo($"From Self {targetCondition.GetHashCode()}", [ - "ActionSequencer_StatusAll".Local("From All"), - "ActionSequencer_StatusSelf".Local("From Self"), + UiString.ActionSequencer_StatusAll.Local(), + UiString.ActionSequencer_StatusSelf.Local(), ], ref check)) { targetCondition.FromSelf = check != 0; @@ -783,8 +783,8 @@ void DrawStatusIcon() check = targetCondition.FromSelf ? 1 : 0; if (ImGuiHelper.SelectableCombo($"From Self {targetCondition.GetHashCode()}", [ - "ActionSequencer_StatusAll".Local("From All"), - "ActionSequencer_StatusSelf".Local("From Self"), + UiString.ActionSequencer_StatusAll.Local(), + UiString.ActionSequencer_StatusSelf.Local(), ], ref check)) { targetCondition.FromSelf = check != 0; @@ -805,15 +805,15 @@ void DrawStatusIcon() check = targetCondition.FromSelf ? 1 : 0; if (ImGuiHelper.SelectableCombo($"From Self {targetCondition.GetHashCode()}", [ - "ActionSequencer_StatusAll".Local("From All"), - "ActionSequencer_StatusSelf".Local("From Self"), + UiString.ActionSequencer_StatusAll.Local(), + UiString.ActionSequencer_StatusSelf.Local(), ], ref check)) { targetCondition.FromSelf = check != 0; } DrawDragInt($"GCD##GCD{targetCondition.GetHashCode()}", ref targetCondition.GCD); - DrawDragFloat(ConfigUnitType.Seconds, $"{"ActionSequencer_TimeOffset".Local("Time Offset")}##Ability{targetCondition.GetHashCode()}", ref targetCondition.DistanceOrTime); + DrawDragFloat(ConfigUnitType.Seconds, $"{UiString.ActionSequencer_TimeOffset.Local()}##Ability{targetCondition.GetHashCode()}", ref targetCondition.DistanceOrTime); break; case TargetConditionType.Distance: @@ -889,8 +889,8 @@ void DrawStatusIcon() check = targetCondition.FromSelf ? 1 : 0; if (ImGuiHelper.SelectableCombo($"From Self {targetCondition.GetHashCode()}", [ - "ActionSequencer_StatusAll".Local("From All"), - "ActionSequencer_StatusSelf".Local("From Self"), + UiString.ActionSequencer_StatusAll.Local(), + UiString.ActionSequencer_StatusSelf.Local(), ], ref check)) { targetCondition.FromSelf = check != 0; @@ -922,8 +922,8 @@ void DrawStatusIcon() check = targetCondition.FromSelf ? 1 : 0; if (ImGuiHelper.SelectableCombo($"From Self {targetCondition.GetHashCode()}", [ - "ActionSequencer_StatusAll".Local("From All"), - "ActionSequencer_StatusSelf".Local("From Self"), + UiString.ActionSequencer_StatusAll.Local(), + UiString.ActionSequencer_StatusSelf.Local(), ], ref check)) { targetCondition.FromSelf = check != 0; @@ -934,7 +934,7 @@ void DrawStatusIcon() if (targetCondition._action == null && targetCondition.TargetType == TargetType.Target) { using var style = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed); - ImGui.TextWrapped("ConfigWindow_Condition_TargetWarning".Local("You'd better not use it. Because this target isn't the action's target. Try to pick it from action.")); + ImGui.TextWrapped(UiString.ConfigWindow_Condition_TargetWarning.Local()); } } @@ -968,7 +968,7 @@ private static void DrawAfter(this TerritoryCondition territoryCondition, ICusto TerritoryNames, i => i.ToString(), i => { territoryCondition.Name = i; - }, "ConfigWindow_Condition_TerritoryName".Local("Territory Name")); + }, UiString.ConfigWindow_Condition_TerritoryName.Local()); break; case TerritoryConditionType.DutyName: @@ -978,7 +978,7 @@ private static void DrawAfter(this TerritoryCondition territoryCondition, ICusto DutyNames, i => i.ToString(), i => { territoryCondition.Name = i; - }, "ConfigWindow_Condition_DutyName".Local("Duty Name")); + }, UiString.ConfigWindow_Condition_DutyName.Local()); break; case TerritoryConditionType.MapEffect: diff --git a/RotationSolver/UI/ControlWindow.cs b/RotationSolver/UI/ControlWindow.cs index 11f7be126..0a431ac2b 100644 --- a/RotationSolver/UI/ControlWindow.cs +++ b/RotationSolver/UI/ControlWindow.cs @@ -63,8 +63,8 @@ public override unsafe void Draw() var value = Service.Config.IsControlWindowLock ? 0 : 1; if (ImGuiHelper.SelectableCombo("Rotation Solver Lock the Control Window", [ - "InfoWindowNoMove".Local("No Move"), - "InfoWindowMove".Local("Move"), + UiString.InfoWindowNoMove.Local(), + UiString.InfoWindowMove.Local(), ], ref value)) { Service.Config.IsControlWindowLock.Value = value == 0; diff --git a/RotationSolver/UI/ImGuiHelper.cs b/RotationSolver/UI/ImGuiHelper.cs index e01cbae4b..5f5c0bdee 100644 --- a/RotationSolver/UI/ImGuiHelper.cs +++ b/RotationSolver/UI/ImGuiHelper.cs @@ -33,7 +33,7 @@ internal static void DisplayCommandHelp(this Enum command, string extraCommand = } if (ImGui.IsItemHovered()) { - ImguiTooltips.ShowTooltip($"{"ConfigWindow_Helper_RunCommand".Local("Click to execute the command")}: {cmdStr}\n{"ConfigWindow_Helper_CopyCommand".Local("Right-click to copy the command")}: {cmdStr}"); + ImguiTooltips.ShowTooltip($"{UiString.ConfigWindow_Helper_RunCommand.Local()}: {cmdStr}\n{UiString.ConfigWindow_Helper_CopyCommand.Local()}: {cmdStr}"); if (ImGui.IsMouseClicked(ImGuiMouseButton.Right)) { @@ -63,7 +63,7 @@ internal static void DisplayCommandHelp(this Enum command, string extraCommand = public static void DisplayMacro(this MacroInfo info) { ImGui.SetNextItemWidth(50); - if (ImGui.DragInt($"{"ConfigWindow_Events_MacroIndex".Local("Macro No.")}##MacroIndex{info.GetHashCode()}", + if (ImGui.DragInt($"{UiString.ConfigWindow_Events_MacroIndex.Local()}##MacroIndex{info.GetHashCode()}", ref info.MacroIndex, 1, -1, 99)) { Service.Config.Save(); @@ -71,7 +71,7 @@ public static void DisplayMacro(this MacroInfo info) ImGui.SameLine(); - if (ImGui.Checkbox($"{"ConfigWindow_Events_ShareMacro".Local("Is Shared")}##ShareMacro{info.GetHashCode()}", + if (ImGui.Checkbox($"{UiString.ConfigWindow_Events_ShareMacro.Local()}##ShareMacro{info.GetHashCode()}", ref info.IsShared)) { Service.Config.Save(); @@ -80,7 +80,7 @@ public static void DisplayMacro(this MacroInfo info) public static void DisplayEvent(this ActionEventInfo info) { - if (ImGui.InputText($"{"ConfigWindow_Events_ActionName".Local("Action Name")}##ActionName{info.GetHashCode()}", + if (ImGui.InputText($"{UiString.ConfigWindow_Events_ActionName.Local()}##ActionName{info.GetHashCode()}", ref info.Name, 100)) { Service.Config.Save(); diff --git a/RotationSolver/UI/RotationConfigWindow.cs b/RotationSolver/UI/RotationConfigWindow.cs index 111548272..ae3e7fdc3 100644 --- a/RotationSolver/UI/RotationConfigWindow.cs +++ b/RotationSolver/UI/RotationConfigWindow.cs @@ -121,7 +121,7 @@ private void DrawConditionSet() { ImGui.OpenPopup(popUpId); } - ImguiTooltips.HoveredTooltip("ConfigWindow_ConditionSetDesc".Local("The Condition set you chose, click to modify.")); + ImguiTooltips.HoveredTooltip(UiString.ConfigWindow_ConditionSetDesc.Local()); using var popup = ImRaii.Popup(popUpId); if (popup.Success) @@ -142,7 +142,7 @@ void DeleteFile() else { var key = "Condition Set At " + i.ToString(); - ImGuiHelper.DrawHotKeysPopup(key, string.Empty, ("ConfigWindow_List_Remove".Local("Remove"), DeleteFile, ["Delete"])); + ImGuiHelper.DrawHotKeysPopup(key, string.Empty, (UiString.ConfigWindow_List_Remove.Local(), DeleteFile, ["Delete"])); if (ImGui.Selectable(combos[i].Name)) { @@ -169,7 +169,7 @@ void DeleteFile() } ImGui.PopFont(); - ImguiTooltips.HoveredTooltip("ActionSequencer_Load".Local("Load From folder.")); + ImguiTooltips.HoveredTooltip(UiString.ActionSequencer_Load.Local()); } } @@ -348,7 +348,7 @@ private void DrawHeader(float wholeWidth) _activeTab = RotationConfigWindowTab.About; _searchResults = []; } - ImguiTooltips.HoveredTooltip("ConfigWindow_About_Punchline".Local("Analyses PvE combat information in every frame and finds the best action.")); + ImguiTooltips.HoveredTooltip(UiString.ConfigWindow_About_Punchline.Local()); var frame = Environment.TickCount / 34 % FRAME_COUNT; if (frame <= 0) frame += FRAME_COUNT; @@ -382,7 +382,7 @@ private void DrawHeader(float wholeWidth) const string slash = " - "; var gameVersionSize = ImGui.CalcTextSize(slash + rotation.GameVersion).X + ImGui.GetStyle().ItemSpacing.X; - var gameVersion = "ConfigWindow_Helper_GameVersion".Local("Game") + ": "; + var gameVersion = UiString.ConfigWindow_Helper_GameVersion.Local() + ": "; var drawCenter = ImGui.CalcTextSize(slash + gameVersion + rotation.GameVersion).X + iconSize + ImGui.GetStyle().ItemSpacing.X * 3 < wholeWidth; if (drawCenter) gameVersionSize += ImGui.CalcTextSize(gameVersion).X + ImGui.GetStyle().ItemSpacing.X; @@ -506,13 +506,13 @@ private static void DrawRotationCombo(float comboSize, ICustomRotation[] rotatio } var warning = gameVersion + rotation.GameVersion; - if (!rotation.IsValid) warning += "\n" + string.Format("ConfigWindow_Rotation_InvalidRotation" - .Local("Invalid Rotation! \nPlease update to the latest version or contact to the {0}!"), + if (!rotation.IsValid) warning += "\n" + string.Format(UiString.ConfigWindow_Rotation_InvalidRotation + .Local(), rotation.GetType().Assembly.GetInfo().Author); - if (rotation.IsBeta()) warning += "\n" + "ConfigWindow_Rotation_BetaRotation".Local("Beta Rotation!"); + if (rotation.IsBeta()) warning += "\n" + UiString.ConfigWindow_Rotation_BetaRotation.Local(); - warning += "\n \n" + "ConfigWindow_Helper_SwitchRotation".Local("Click to switch rotations"); + warning += "\n \n" + UiString.ConfigWindow_Helper_SwitchRotation.Local(); ImguiTooltips.HoveredTooltip(warning); } @@ -527,7 +527,7 @@ private void DrawBody() using (var font = ImRaii.PushFont(ImGuiHelper.GetFont(18))) { using var color = ImRaii.PushColor(ImGuiCol.Text, ImGui.ColorConvertFloat4ToU32(ImGuiColors.DalamudYellow)); - ImGui.TextWrapped("ConfigWindow_Search_Result".Local("Search Result")); + ImGui.TextWrapped(UiString.ConfigWindow_Search_Result.Local()); } ImGui.Spacing(); @@ -592,8 +592,8 @@ private void DrawBody() #region About private static readonly SortedList CountStringPair = new() { - { 100_000, "ConfigWindow_About_Clicking100k".Local("Well, you must be a lazy player!") }, - { 500_000, "ConfigWindow_About_Clicking500k".Local("You're tiring RS out, give it a break!") }, + { 100_000, UiString.ConfigWindow_About_Clicking100k.Local() }, + { 500_000, UiString.ConfigWindow_About_Clicking500k.Local() }, }; private static void DrawAbout() @@ -601,17 +601,17 @@ private static void DrawAbout() using (var font = ImRaii.PushFont(ImGuiHelper.GetFont(18))) { using var color = ImRaii.PushColor(ImGuiCol.Text, ImGui.ColorConvertFloat4ToU32(ImGuiColors.DalamudYellow)); - ImGui.TextWrapped("ConfigWindow_About_Punchline".Local("Analyses PvE combat information in every frame and finds the best action.")); + ImGui.TextWrapped(UiString.ConfigWindow_About_Punchline.Local()); } ImGui.Spacing(); - ImGui.TextWrapped("ConfigWindow_About_Description".Local("This means almost all the information available in one frame in combat, including the status of all players in the party, the status of any hostile targets, skill cooldowns, the MP and HP of characters, the location of characters, casting status of the hostile target, combo, combat duration, player level, etc.\n\nThen, it will highlight the best action on the hot bar, or help you to click on it.")); + ImGui.TextWrapped(UiString.ConfigWindow_About_Description.Local()); ImGui.Spacing(); using (var color = ImRaii.PushColor(ImGuiCol.Text, ImGui.ColorConvertFloat4ToU32(ImGuiColors.DalamudOrange))) { - ImGui.TextWrapped("ConfigWindow_About_Warning".Local("It is designed for GENERAL COMBAT, not for savage or ultimate. Use it carefully.")); + ImGui.TextWrapped(UiString.ConfigWindow_About_Warning.Local()); } var width = ImGui.GetWindowWidth(); @@ -624,7 +624,7 @@ private static void DrawAbout() if (clickingCount > 0) { using var color = ImRaii.PushColor(ImGuiCol.Text, new Vector4(0.2f, 0.6f, 0.95f, 1)); - var countStr = string.Format("ConfigWindow_About_ClickingCount".Local("Rotation Solver helped you by clicking actions {0:N0} times."), + var countStr = string.Format(UiString.ConfigWindow_About_ClickingCount.Local(), clickingCount); ImGuiHelper.DrawItemMiddle(() => { @@ -649,7 +649,7 @@ private static void DrawAbout() if (sayHelloCount > 0) { using var color = ImRaii.PushColor(ImGuiCol.Text, new Vector4(0.2f, 0.8f, 0.95f, 1)); - var countStr = string.Format("ConfigWindow_About_SayHelloCount".Local("You have said hello to other users {0:N0} times!"), sayHelloCount); + var countStr = string.Format(UiString.ConfigWindow_About_SayHelloCount.Local(), sayHelloCount); ImGuiHelper.DrawItemMiddle(() => { @@ -662,10 +662,10 @@ private static void DrawAbout() private static readonly CollapsingHeaderGroup _aboutHeaders = new(new() { - { () => "ConfigWindow_About_Macros".Local("Macros"), DrawAboutMacros}, - { () => "ConfigWindow_About_Compatibility".Local("Compatibility"), DrawAboutCompatibility}, - { () => "ConfigWindow_About_Supporters".Local("Supporters"), DrawAboutSupporters}, - { () => "ConfigWindow_About_Links".Local("Links"), DrawAboutLinks}, + { UiString.ConfigWindow_About_Macros.Local, DrawAboutMacros}, + { UiString.ConfigWindow_About_Compatibility.Local, DrawAboutCompatibility}, + { UiString.ConfigWindow_About_Supporters.Local, DrawAboutSupporters}, + { UiString.ConfigWindow_About_Links.Local, DrawAboutLinks}, }); private static void DrawAboutMacros() @@ -678,7 +678,7 @@ private static void DrawAboutMacros() StateCommandType.Cancel.DisplayCommandHelp(getHelp: LocalizationManager.Local); - OtherCommandType.NextAction.DisplayCommandHelp(getHelp: i => "ConfigWindow_HelpItem_NextAction".Local("Do the next action")); + OtherCommandType.NextAction.DisplayCommandHelp(getHelp: LocalizationManager.Local); ImGui.NewLine(); @@ -711,9 +711,9 @@ private static void DrawAboutMacros() private static void DrawAboutCompatibility() { - ImGui.TextWrapped("ConfigWindow_About_Compatibility_Others".Local("Please don't relog without closing the game. Crashes may occur.")); + ImGui.TextWrapped(UiString.ConfigWindow_About_Compatibility_Others.Local()); - ImGui.TextWrapped("ConfigWindow_About_Compatibility_Description".Local("Literally, Rotation Solver helps you to choose the target and then click the action. So any plugin that changes these will affect its decision.\n\nHere is a list of known incompatible plugins:")); + ImGui.TextWrapped(UiString.ConfigWindow_About_Compatibility_Description.Local()); ImGui.Spacing(); @@ -767,24 +767,24 @@ private static void DrawAboutCompatibility() if (item.Type.HasFlag(CompatibleType.Skill_Usage)) { ImGui.TextColored(ImGuiColors.DalamudYellow, CompatibleType.Skill_Usage.ToString().Replace('_', ' ')); - ImguiTooltips.HoveredTooltip("ConfigWindow_About_Compatibility_Mistake".Local("Can't properly execute the behavior that RS wants to do.")); + ImguiTooltips.HoveredTooltip(UiString.ConfigWindow_About_Compatibility_Mistake.Local()); } if (item.Type.HasFlag(CompatibleType.Skill_Selection)) { ImGui.TextColored(ImGuiColors.DalamudOrange, CompatibleType.Skill_Selection.ToString().Replace('_', ' ')); - ImguiTooltips.HoveredTooltip("ConfigWindow_About_Compatibility_Mislead".Local("Misleading RS to make the right decision.")); + ImguiTooltips.HoveredTooltip(UiString.ConfigWindow_About_Compatibility_Mislead.Local()); } if (item.Type.HasFlag(CompatibleType.Crash)) { ImGui.TextColored(ImGuiColors.DalamudRed, CompatibleType.Crash.ToString().Replace('_', ' ')); - ImguiTooltips.HoveredTooltip("ConfigWindow_About_Compatibility_Crash".Local("Causes the game to crash.")); + ImguiTooltips.HoveredTooltip(UiString.ConfigWindow_About_Compatibility_Crash.Local()); } } } } private static void DrawAboutSupporters() { - ImGui.TextWrapped("ConfigWindow_About_ThanksToSupporters".Local("Many thanks to the sponsors.")); + ImGui.TextWrapped(UiString.ConfigWindow_About_ThanksToSupporters.Local()); var width = ImGui.GetWindowWidth(); using var font = ImRaii.PushFont(ImGuiHelper.GetFont(12)); @@ -824,7 +824,7 @@ private static void DrawAboutLinks() }, width, textWidth); - text = "ConfigWindow_About_OpenConfigFolder".Local("Open Config Folder"); + text = UiString.ConfigWindow_About_OpenConfigFolder.Local(); textWidth = ImGuiHelpers.GetButtonSize(text).X; ImGuiHelper.DrawItemMiddle(() => { @@ -961,14 +961,14 @@ private static bool DrawRating(float value1, int value2, float max) private static readonly CollapsingHeaderGroup _rotationHeader = new(new() { - { () => "ConfigWindow_Rotation_Description".Local("Description"), DrawRotationDescription }, + { UiString.ConfigWindow_Rotation_Description.Local, DrawRotationDescription }, { GetRotationStatusHead, DrawRotationStatus }, - { () => "ConfigWindow_Rotation_Configuration".Local("Configuration"), DrawRotationConfiguration }, - { () => "ConfigWindow_Rotation_Rating".Local("Rating"), DrawRotationRating }, + { UiString.ConfigWindow_Rotation_Configuration.Local, DrawRotationConfiguration }, + { UiString.ConfigWindow_Rotation_Rating.Local, DrawRotationRating }, - { () => "ConfigWindow_Rotation_Information".Local("Information"), DrawRotationInformation }, + { UiString.ConfigWindow_Rotation_Information.Local, DrawRotationInformation }, }); private static void DrawRotationRating() @@ -976,15 +976,15 @@ private static void DrawRotationRating() var rotation = DataCenter.RightNowRotation; if (rotation == null) return; - ImGui.TextWrapped("ConfigWindow_Rotation_Rating_Description".Local("Here are some rating methods to analysis this rotation. Most of these methods need your engagement.")); + ImGui.TextWrapped(UiString.ConfigWindow_Rotation_Rating_Description.Local()); if (DrawRating((float)rotation.AverageCountOfLastUsing, rotation.MaxCountOfLastUsing, 10)) { - ImguiTooltips.ShowTooltip("ConfigWindow_Rotation_Rating_CountOfLastUsing".Local("This is the count of using last action checking in this rotation. First is average one, second is maximum one. The less the better.\nLast used action is not a part of information from the game, it is recorded by player or author. \nIt can't accurately describe the current state of combat, which may make this rotation not general. \nFor example, clipping the gcd, death, take some status that grated by some action off manually, etc.")); + ImguiTooltips.ShowTooltip(UiString.ConfigWindow_Rotation_Rating_CountOfLastUsing.Local()); } if (DrawRating((float)rotation.AverageCountOfCombatTimeUsing, rotation.MaxCountOfCombatTimeUsing, 20)) { - ImguiTooltips.ShowTooltip("ConfigWindow_Rotation_Rating_CountOfCombatTimeUsing".Local("This is the count of using combat time in this rotation. First is average one, second is maximum one. The less the better.\nCombat time is not a part of information from the game, it is recorded by player or author. \nIt can't accurately describe the current state of combat, which may make this rotation not general.\nFor example, engaged by others in the party, different gcd time, etc.")); + ImguiTooltips.ShowTooltip(UiString.ConfigWindow_Rotation_Rating_CountOfCombatTimeUsing.Local()); } } @@ -1084,7 +1084,7 @@ internal static void DrawLinkDescription(LinkDescription link, float wholeWidth, Util.OpenLink(link.Url); } - ImGui.TextWrapped(link.Description.Local(link.Description)); + ImGui.TextWrapped(link.Description); if (drawQuestion && !hasTexture && !string.IsNullOrEmpty(link.Url)) { @@ -1098,7 +1098,7 @@ internal static void DrawLinkDescription(LinkDescription link, float wholeWidth, private static string GetRotationStatusHead() { var rotation = DataCenter.RightNowRotation; - var status = "ConfigWindow_Rotation_Status".Local("Status"); + var status = UiString.ConfigWindow_Rotation_Status.Local(); if (Service.Config.InDebug) { return status; @@ -1296,7 +1296,7 @@ private static void DrawRotationInformation() #region Actions private static unsafe void DrawActions() { - ImGui.TextWrapped("ConfigWindow_Actions_Description".Local("To customize when Rotation Solver uses specific actions automatically, click on an action's icon in the left list. Below, you may set the conditions for when that specific action is used. Each action can have a different set of conditions to override the default rotation behavior.")); + ImGui.TextWrapped(UiString.ConfigWindow_Actions_Description.Local()); using var table = ImRaii.Table("Rotation Solver Actions", 2, ImGuiTableFlags.Resizable); @@ -1426,7 +1426,7 @@ private static unsafe void DrawActions() ImGuiHelper.ExecuteHotKeysPopup(key, cmd, string.Empty, false); enable = _activeAction.IsInCooldown; - if (ImGui.Checkbox($"{"ConfigWindow_Actions_ShowOnCDWindow".Local("Show on CD window")}##{_activeAction.Name}InCooldown", ref enable)) + if (ImGui.Checkbox($"{UiString.ConfigWindow_Actions_ShowOnCDWindow.Local()}##{_activeAction.Name}InCooldown", ref enable)) { _activeAction.IsInCooldown = enable; } @@ -1440,7 +1440,7 @@ private static unsafe void DrawActions() && a.Setting.TargetType != TargetType.Move) { enable = config.IsInMistake; - if (ImGui.Checkbox($"{"ConfigWindow_Actions_IsInMistake".Local("Can be used by mistake")}##{a.Name}InMistake", ref enable)) + if (ImGui.Checkbox($"{UiString.ConfigWindow_Actions_IsInMistake.Local()}##{a.Name}InMistake", ref enable)) { config.IsInMistake = enable; } @@ -1450,7 +1450,7 @@ private static unsafe void DrawActions() var ttk = config.TimeToKill; ImGui.SetNextItemWidth(Scale * 150); - if (ImGui.DragFloat($"{"ConfigWindow_Actions_TTK".Local("TTK that this action needs the target be.")}##{a}", + if (ImGui.DragFloat($"{UiString.ConfigWindow_Actions_TTK.Local()}##{a}", ref ttk, 0.1f, 0, 120, $"{ttk:F2}{ConfigUnitType.Seconds.ToSymbol()}")) { config.TimeToKill = ttk; @@ -1461,7 +1461,7 @@ private static unsafe void DrawActions() { var aoeCount = (int)config.AoeCount; ImGui.SetNextItemWidth(Scale * 150); - if (ImGui.DragInt($"{"ConfigWindow_Actions_AoeCount".Local("How many targets are needed to use this action.")}##{a}", + if (ImGui.DragInt($"{UiString.ConfigWindow_Actions_AoeCount.Local()}##{a}", ref aoeCount, 0.05f, 1, 10)) { config.AoeCount = (byte)aoeCount; @@ -1470,7 +1470,7 @@ private static unsafe void DrawActions() var ratio = config.AutoHealRatio; ImGui.SetNextItemWidth(Scale * 150); - if (ImGui.DragFloat($"{"ConfigWindow_Actions_HealRatio".Local("The HP ratio to auto heal")}##{a}", + if (ImGui.DragFloat($"{UiString.ConfigWindow_Actions_HealRatio.Local()}##{a}", ref ratio, 0.002f, 0, 1, $"{ratio * 100:F1}{ConfigUnitType.Percent.ToSymbol()}")) { config.AutoHealRatio = ratio; @@ -1481,7 +1481,7 @@ private static unsafe void DrawActions() ImGui.Separator(); } - ImGui.TextWrapped("ConfigWindow_Actions_ConditionDescription".Local("Forced Conditions have a higher priority. If Forced Conditions are met, Disabled Condition will be ignored.")); + ImGui.TextWrapped(UiString.ConfigWindow_Actions_ConditionDescription.Local()); _sequencerList?.Draw(); } } @@ -1495,9 +1495,9 @@ private static unsafe void DrawActions() private static readonly CollapsingHeaderGroup _sequencerList = new(new() { - { () => "ConfigWindow_Actions_ForcedConditionSet".Local("Forced Condition"), () => + { UiString.ConfigWindow_Actions_ForcedConditionSet.Local, () => { - ImGui.TextWrapped("ConfigWindow_Actions_ForcedConditionSet_Description".Local("Conditions for forced automatic use of action.")); + ImGui.TextWrapped(UiString.ConfigWindow_Actions_ForcedConditionSet_Description.Local()); var rotation = DataCenter.RightNowRotation; var set = DataCenter.RightSet; @@ -1506,9 +1506,9 @@ private static unsafe void DrawActions() set.GetCondition(_activeAction.ID)?.DrawMain(rotation); } }, - { () => "ConfigWindow_Actions_DisabledConditionSet".Local("Disabled Condition"), () => + { UiString.ConfigWindow_Actions_DisabledConditionSet.Local, () => { - ImGui.TextWrapped("ConfigWindow_Actions_DisabledConditionSet_Description".Local("Conditions for automatic use of action being disabled.")); + ImGui.TextWrapped(UiString.ConfigWindow_Actions_DisabledConditionSet_Description.Local()); var rotation = DataCenter.RightNowRotation; var set = DataCenter.RightSet; @@ -1527,7 +1527,7 @@ private static void DrawRotations() { var width = ImGui.GetWindowWidth(); - var text = "ConfigWindow_Rotations_Download".Local("Download Rotations"); + var text = UiString.ConfigWindow_Rotations_Download.Local(); var textWidth = ImGuiHelpers.GetButtonSize(text).X; ImGuiHelper.DrawItemMiddle(() => @@ -1541,7 +1541,7 @@ private static void DrawRotations() } }, width, textWidth); - text = "ConfigWindow_Rotations_Links".Local("Links of the rotations online"); + text = UiString.ConfigWindow_Rotations_Links.Local(); textWidth = ImGuiHelpers.GetButtonSize(text).X; ImGuiHelper.DrawItemMiddle(() => { @@ -1555,15 +1555,15 @@ private static void DrawRotations() } private static readonly CollapsingHeaderGroup _rotationsHeader = new(new() { - {() => "ConfigWindow_Rotations_Settings".Local("Settings"), DrawRotationsSettings}, - {() => "ConfigWindow_Rotations_Loaded".Local("Loaded"), DrawRotationsLoaded}, - {() => "ConfigWindow_Rotations_GitHub".Local("Github"), DrawRotationsGitHub}, - {() => "ConfigWindow_Rotations_Libraries".Local("Libraries"), DrawRotationsLibraries}, + { UiString.ConfigWindow_Rotations_Settings.Local, DrawRotationsSettings}, + { UiString.ConfigWindow_Rotations_Loaded.Local, DrawRotationsLoaded}, + { UiString.ConfigWindow_Rotations_GitHub.Local, DrawRotationsGitHub}, + { UiString.ConfigWindow_Rotations_Libraries.Local, DrawRotationsLibraries}, }); private static void DrawRotationsSettings() { - _allSearchables.DrawItems(ConfigsNew.Rotations); + _allSearchables.DrawItems(Configs.Rotations); } private static void DrawRotationsLoaded() @@ -1735,15 +1735,15 @@ private static void DrawRotationsGitHub() width /= 3; ImGui.SetNextItemWidth(width); - changed |= ImGui.InputTextWithHint($"##GitHubLib{i}UserName", "ConfigWindow_Rotations_UserName".Local("User Name"), ref userName, 1024); + changed |= ImGui.InputTextWithHint($"##GitHubLib{i}UserName", UiString.ConfigWindow_Rotations_UserName.Local(), ref userName, 1024); ImGui.SameLine(); ImGui.SetNextItemWidth(width); - changed |= ImGui.InputTextWithHint($"##GitHubLib{i}Repository", "ConfigWindow_Rotations_Repository".Local("Repository"), ref repository, 1024); + changed |= ImGui.InputTextWithHint($"##GitHubLib{i}Repository", UiString.ConfigWindow_Rotations_Repository.Local(), ref repository, 1024); ImGui.SameLine(); ImGui.SetNextItemWidth(width); - changed |= ImGui.InputTextWithHint($"##GitHubLib{i}FileName", "ConfigWindow_Rotations_FileName".Local("File Name"), ref fileName, 1024); + changed |= ImGui.InputTextWithHint($"##GitHubLib{i}FileName", UiString.ConfigWindow_Rotations_FileName.Local(), ref fileName, 1024); ImGui.SameLine(); if (changed) @@ -1779,7 +1779,7 @@ private static void DrawRotationsLibraries() for (int i = 0; i < Service.Config.OtherLibs.Length; i++) { ImGui.SetNextItemWidth(width); - ImGui.InputTextWithHint($"##Rotation Solver OtherLib{i}", "ConfigWindow_Rotations_Library".Local("The folder contains rotation libs or the download url about rotation lib."), ref Service.Config.OtherLibs[i], 1024); + ImGui.InputTextWithHint($"##Rotation Solver OtherLib{i}", UiString.ConfigWindow_Rotations_Library.Local(), ref Service.Config.OtherLibs[i], 1024); ImGui.SameLine(); if (ImGuiEx.IconButton(FontAwesomeIcon.Ban, $"##Rotation Solver Remove OtherLibs{i}")) @@ -1820,19 +1820,19 @@ internal static GAction[] AllActions private static void DrawList() { - ImGui.TextWrapped("ConfigWindow_List_Description".Local("In this window, you can set the parameters that can be customised using lists.")); + ImGui.TextWrapped(UiString.ConfigWindow_List_Description.Local()); _idsHeader?.Draw(); } private static readonly CollapsingHeaderGroup _idsHeader = new(new() { - { () => "ConfigWindow_List_Statuses".Local("Statuses"), DrawListStatuses}, - { () => Service.Config.UseDefenseAbility ? "ConfigWindow_List_Actions".Local("Actions") : string.Empty, DrawListActions}, - { () => "ConfigWindow_List_Territories".Local("Map specific settings"), DrawListTerritories}, + { UiString.ConfigWindow_List_Statuses.Local, DrawListStatuses}, + { () => Service.Config.UseDefenseAbility ? UiString.ConfigWindow_List_Actions.Local() : string.Empty, DrawListActions}, + { UiString.ConfigWindow_List_Territories.Local, DrawListTerritories}, }); private static void DrawListStatuses() { ImGui.SetNextItemWidth(ImGui.GetWindowWidth()); - ImGui.InputTextWithHint("##Searching the action", "ConfigWindow_List_StatusNameOrId".Local("Status name or id"), ref _statusSearching, 128); + ImGui.InputTextWithHint("##Searching the action", UiString.ConfigWindow_List_StatusNameOrId.Local(), ref _statusSearching, 128); using var table = ImRaii.Table("Rotation Solver List Statuses", 3, ImGuiTableFlags.BordersInner | ImGuiTableFlags.Resizable | ImGuiTableFlags.SizingStretchSame); if (table) @@ -1841,36 +1841,36 @@ private static void DrawListStatuses() ImGui.TableNextRow(ImGuiTableRowFlags.Headers); ImGui.TableNextColumn(); - ImGui.TableHeader("ConfigWindow_List_Invincibility".Local("Invulnerability")); + ImGui.TableHeader(UiString.ConfigWindow_List_Invincibility.Local()); ImGui.TableNextColumn(); - ImGui.TableHeader("ConfigWindow_List_Priority".Local("Priority")); + ImGui.TableHeader(UiString.ConfigWindow_List_Priority.Local()); ImGui.TableNextColumn(); - ImGui.TableHeader("ConfigWindow_List_DangerousStatus".Local("Dispellable debuffs")); + ImGui.TableHeader(UiString.ConfigWindow_List_DangerousStatus.Local()); ImGui.TableNextRow(); ImGui.TableNextColumn(); - ImGui.TextWrapped("ConfigWindow_List_InvincibilityDesc".Local("Ignores target if it has one of this statuses")); + ImGui.TextWrapped(UiString.ConfigWindow_List_InvincibilityDesc.Local()); DrawStatusList(nameof(OtherConfiguration.InvincibleStatus), OtherConfiguration.InvincibleStatus, AllStatus); ImGui.TableNextColumn(); - ImGui.TextWrapped("ConfigWindow_List_PriorityDesc".Local("Attacks the target first if it has one of this statuses")); + ImGui.TextWrapped(UiString.ConfigWindow_List_PriorityDesc.Local()); DrawStatusList(nameof(OtherConfiguration.PriorityStatus), OtherConfiguration.PriorityStatus, AllStatus); ImGui.TableNextColumn(); - ImGui.TextWrapped("ConfigWindow_List_DangerousStatusDesc".Local("Dispellable debuffs list")); + ImGui.TextWrapped(UiString.ConfigWindow_List_DangerousStatusDesc.Local()); DrawStatusList(nameof(OtherConfiguration.DangerousStatus), OtherConfiguration.DangerousStatus, AllDispelStatus); } } private static void FromClipBoardButton(HashSet items) { - if (ImGui.Button("ConfigWindow_Actions_Copy".Local("Copy to Clipboard"))) + if (ImGui.Button(UiString.ConfigWindow_Actions_Copy.Local())) { try { @@ -1884,7 +1884,7 @@ private static void FromClipBoardButton(HashSet items) ImGui.SameLine(); - if (ImGui.Button("ActionSequencer_FromClipboard".Local("From Clipboard"))) + if (ImGui.Button(UiString.ActionSequencer_FromClipboard.Local())) { try { @@ -1934,7 +1934,7 @@ private static void DrawStatusList(string name, HashSet statuses, Status[] { if (!ImGui.IsPopupOpen(popupId)) ImGui.OpenPopup(popupId); } - ImguiTooltips.HoveredTooltip("ConfigWindow_List_AddStatus".Local("Add Status")); + ImguiTooltips.HoveredTooltip(UiString.ConfigWindow_List_AddStatus.Local()); } foreach (var status in statuses.Select(a => Service.GetSheet().GetRow(a)) @@ -1945,7 +1945,7 @@ private static void DrawStatusList(string name, HashSet statuses, Status[] var key = "Status" + status!.RowId.ToString(); - ImGuiHelper.DrawHotKeysPopup(key, string.Empty, ("ConfigWindow_List_Remove".Local("Remove"), Delete, ["Delete"])); + ImGuiHelper.DrawHotKeysPopup(key, string.Empty, (UiString.ConfigWindow_List_Remove.Local(), Delete, ["Delete"])); if (IconSet.GetTexture(status.Icon, out var texture, notLoadId)) { @@ -1973,7 +1973,7 @@ internal static void StatusPopUp(string popupId, Status[] allStatus, ref string if (popup) { ImGui.SetNextItemWidth(200 * Scale); - ImGui.InputTextWithHint("##Searching the status", "ConfigWindow_List_StatusNameOrId".Local("Status name or id"), ref searching, 128); + ImGui.InputTextWithHint("##Searching the status", UiString.ConfigWindow_List_StatusNameOrId.Local(), ref searching, 128); ImGui.Spacing(); @@ -2007,7 +2007,7 @@ internal static void StatusPopUp(string popupId, Status[] allStatus, ref string private static void DrawListActions() { ImGui.SetNextItemWidth(ImGui.GetWindowWidth()); - ImGui.InputTextWithHint("##Searching the action", "ConfigWindow_List_ActionNameOrId".Local("Action name or id"), ref _actionSearching, 128); + ImGui.InputTextWithHint("##Searching the action", UiString.ConfigWindow_List_ActionNameOrId.Local(), ref _actionSearching, 128); using var table = ImRaii.Table("Rotation Solver List Actions", 2, ImGuiTableFlags.BordersInner | ImGuiTableFlags.Resizable | ImGuiTableFlags.SizingStretchSame); if (table) @@ -2016,22 +2016,22 @@ private static void DrawListActions() ImGui.TableNextRow(ImGuiTableRowFlags.Headers); ImGui.TableNextColumn(); - ImGui.TableHeader("ConfigWindow_List_HostileCastingTank".Local("Tank Buster")); + ImGui.TableHeader(UiString.ConfigWindow_List_HostileCastingTank.Local()); ImGui.TableNextColumn(); - ImGui.TableHeader("ConfigWindow_List_HostileCastingArea".Local("AoE")); + ImGui.TableHeader(UiString.ConfigWindow_List_HostileCastingArea.Local()); ImGui.TableNextRow(); ImGui.TableNextColumn(); - ImGui.TextWrapped("ConfigWindow_List_HostileCastingTankDesc".Local("Use tank personal damage mitigation abilities if the target is casting any of these actions")); + ImGui.TextWrapped(UiString.ConfigWindow_List_HostileCastingTankDesc.Local()); DrawActionsList(nameof(OtherConfiguration.HostileCastingTank), OtherConfiguration.HostileCastingTank); ImGui.TableNextColumn(); - _allSearchables.DrawItems(ConfigsNew.List); + _allSearchables.DrawItems(Configs.List); - ImGui.TextWrapped("ConfigWindow_List_HostileCastingAreaDesc".Local("Use AoE damage mitigation abilities if the target is casting any of these actions")); + ImGui.TextWrapped(UiString.ConfigWindow_List_HostileCastingAreaDesc.Local()); DrawActionsList(nameof(OtherConfiguration.HostileCastingArea), OtherConfiguration.HostileCastingArea); } @@ -2044,7 +2044,7 @@ private static void DrawActionsList(string name, HashSet actions) var popupId = "Rotation Solver Action Popup" + name; - if (ImGui.Button("ConfigWindow_List_AddAction".Local("Add Action") + "##" + name)) + if (ImGui.Button(UiString.ConfigWindow_List_AddAction.Local() + "##" + name)) { if (!ImGui.IsPopupOpen(popupId)) ImGui.OpenPopup(popupId); } @@ -2062,7 +2062,7 @@ private static void DrawActionsList(string name, HashSet actions) var key = "Action" + action!.RowId.ToString(); - ImGuiHelper.DrawHotKeysPopup(key, string.Empty, ("ConfigWindow_List_Remove".Local("Remove"), Reset, ["Delete"])); + ImGuiHelper.DrawHotKeysPopup(key, string.Empty, (UiString.ConfigWindow_List_Remove.Local(), Reset, ["Delete"])); ImGui.Selectable($"{action.Name} ({action.RowId})"); @@ -2079,7 +2079,7 @@ private static void DrawActionsList(string name, HashSet actions) if (popup) { ImGui.SetNextItemWidth(200 * Scale); - ImGui.InputTextWithHint("##Searching the action pop up", "ConfigWindow_List_ActionNameOrId".Local("Action name or id"), ref _actionSearching, 128); + ImGui.InputTextWithHint("##Searching the action pop up", UiString.ConfigWindow_List_ActionNameOrId.Local(), ref _actionSearching, 128); ImGui.Spacing(); @@ -2143,19 +2143,19 @@ private static void DrawListTerritories() ImGui.TableNextRow(ImGuiTableRowFlags.Headers); ImGui.TableNextColumn(); - ImGui.TableHeader("ConfigWindow_List_NoHostile".Local("Don't target")); + ImGui.TableHeader(UiString.ConfigWindow_List_NoHostile.Local()); ImGui.TableNextColumn(); - ImGui.TableHeader("ConfigWindow_List_NoProvoke".Local("Don't provoke")); + ImGui.TableHeader(UiString.ConfigWindow_List_NoProvoke.Local()); ImGui.TableNextColumn(); - ImGui.TableHeader("ConfigWindow_List_BeneficialPositions".Local("Beneficial AoE locations")); + ImGui.TableHeader(UiString.ConfigWindow_List_BeneficialPositions.Local()); ImGui.TableNextRow(); ImGui.TableNextColumn(); - ImGui.TextWrapped("ConfigWindow_List_NoHostileDesc".Local("Enemies that will never be targeted.")); + ImGui.TextWrapped(UiString.ConfigWindow_List_NoHostileDesc.Local()); var width = ImGui.GetColumnWidth() - ImGuiEx.CalcIconSize(FontAwesomeIcon.Ban).X - ImGui.GetStyle().ItemSpacing.X - 10 * Scale; @@ -2174,7 +2174,7 @@ private static void DrawListTerritories() for (int i = 0; i < libs.Length; i++) { ImGui.SetNextItemWidth(width); - if (ImGui.InputTextWithHint($"##Rotation Solver Territory Target Name {i}", "ConfigWindow_List_NoHostilesName".Local("The name of the enemy that you don't want to be targeted"), ref libs[i], 1024)) + if (ImGui.InputTextWithHint($"##Rotation Solver Territory Target Name {i}", UiString.ConfigWindow_List_NoHostilesName.Local(), ref libs[i], 1024)) { OtherConfiguration.NoHostileNames[territoryId] = libs; OtherConfiguration.SaveNoHostileNames(); @@ -2195,7 +2195,7 @@ private static void DrawListTerritories() } ImGui.TableNextColumn(); - ImGui.TextWrapped("ConfigWindow_List_NoProvokeDesc".Local("Enemies that will never be provoked.")); + ImGui.TextWrapped(UiString.ConfigWindow_List_NoProvokeDesc.Local()); width = ImGui.GetColumnWidth() - ImGuiEx.CalcIconSize(FontAwesomeIcon.Ban).X - ImGui.GetStyle().ItemSpacing.X - 10 * Scale; @@ -2212,7 +2212,7 @@ private static void DrawListTerritories() for (int i = 0; i < libs.Length; i++) { ImGui.SetNextItemWidth(width); - if (ImGui.InputTextWithHint($"##Rotation Solver Territory Provoke Name {i}", "ConfigWindow_List_NoProvokeName".Local("The name of the enemy that you don't want to be provoked"), ref libs[i], 1024)) + if (ImGui.InputTextWithHint($"##Rotation Solver Territory Provoke Name {i}", UiString.ConfigWindow_List_NoProvokeName.Local(), ref libs[i], 1024)) { OtherConfiguration.NoProvokeNames[territoryId] = libs; OtherConfiguration.SaveNoProvokeNames(); @@ -2239,7 +2239,7 @@ private static void DrawListTerritories() OtherConfiguration.BeneficialPositions[territoryId] = pts = []; } - if (ImGui.Button("ConfigWindow_List_AddPosition".Local("Add beneficial AoE location")) && Player.Available) unsafe + if (ImGui.Button(UiString.ConfigWindow_List_AddPosition.Local()) && Player.Available) unsafe { var point = Player.Object.Position; int* unknown = stackalloc int[] { 0x4000, 0, 0x4000, 0 }; @@ -2264,7 +2264,7 @@ private static void DrawListTerritories() var key = "Beneficial Positions" + i.ToString(); - ImGuiHelper.DrawHotKeysPopup(key, string.Empty, ("ConfigWindow_List_Remove".Local("Remove"), Reset, ["Delete"])); + ImGuiHelper.DrawHotKeysPopup(key, string.Empty, (UiString.ConfigWindow_List_Remove.Local(), Reset, ["Delete"])); ImGui.Selectable(pts[i].ToString()); @@ -2289,7 +2289,7 @@ private static void DrawListTerritories() #region Debug private static void DrawDebug() { - _allSearchables.DrawItems(ConfigsNew.Debug); + _allSearchables.DrawItems(Configs.Debug); if (!Player.Available || !Service.Config.InDebug) return; diff --git a/RotationSolver/UI/RotationConfigWindow_Config.cs b/RotationSolver/UI/RotationConfigWindow_Config.cs index 194e143bb..bbaa4b595 100644 --- a/RotationSolver/UI/RotationConfigWindow_Config.cs +++ b/RotationSolver/UI/RotationConfigWindow_Config.cs @@ -22,7 +22,7 @@ public partial class RotationConfigWindow private void SearchingBox() { - if (ImGui.InputTextWithHint("##Rotation Solver Search Box", "ConfigWindow_Searching".Local("Search... "), ref _searchText, 128, ImGuiInputTextFlags.AutoSelectAll)) + if (ImGui.InputTextWithHint("##Rotation Solver Search Box", UiString.ConfigWindow_Searching.Local(), ref _searchText, 128, ImGuiInputTextFlags.AutoSelectAll)) { _searchResults = _allSearchables.SearchItems(_searchText); } @@ -36,10 +36,10 @@ private static void DrawBasic() private static readonly CollapsingHeaderGroup _baseHeader = new(new() { - { () => "ConfigWindow_Basic_Timer".Local("Timer"), DrawBasicTimer }, - { () => "ConfigWindow_Basic_AutoSwitch".Local("Auto Switch"), DrawBasicAutoSwitch }, - { () => "ConfigWindow_Basic_NamedConditions".Local("Named Conditions"), DrawBasicNamedConditions }, - { () => "ConfigWindow_Basic_Others".Local("Others"), DrawBasicOthers }, + { UiString.ConfigWindow_Basic_Timer.Local, DrawBasicTimer }, + { UiString.ConfigWindow_Basic_AutoSwitch.Local, DrawBasicAutoSwitch }, + { UiString.ConfigWindow_Basic_NamedConditions.Local, DrawBasicNamedConditions }, + { UiString.ConfigWindow_Basic_Others.Local, DrawBasicOthers }, }); private static readonly uint PING_COLOR = ImGui.ColorConvertFloat4ToU32(ImGuiColors.ParsedGreen); @@ -57,7 +57,7 @@ private static void AddPingLockTime(ImDrawListPtr drawList, Vector2 lineStart, f drawList.AddRectFilled(lineStart, lineStart + size, ChangeAlpha(PING_COLOR)); if (ImGuiHelper.IsInRect(lineStart, size)) { - ImguiTooltips.ShowTooltip("ConfigWindow_Basic_Ping".Local("The ping time.\nIn RS, it means the time from sending the action request to receiving the using success message from the server.")); + ImguiTooltips.ShowTooltip(UiString.ConfigWindow_Basic_Ping.Local()); } var rectStart = lineStart + new Vector2(ping * sizePerTime, 0); @@ -65,7 +65,7 @@ private static void AddPingLockTime(ImDrawListPtr drawList, Vector2 lineStart, f drawList.AddRectFilled(rectStart, rectStart + size, ChangeAlpha(LOCK_TIME_COLOR)); if (ImGuiHelper.IsInRect(rectStart, size)) { - ImguiTooltips.ShowTooltip("ConfigWindow_Basic_AnimationLockTime".Local("The Animation lock time from individual actions. Here is 0.6s for example.")); + ImguiTooltips.ShowTooltip(UiString.ConfigWindow_Basic_AnimationLockTime.Local()); } drawList.AddLine(lineStart - new Vector2(0, spacingHeight), lineStart + new Vector2(0, pingHeight * 2 + spacingHeight / 2), IDEAL_CLICK_TIME_COLOR, 1.5f); @@ -77,15 +77,15 @@ private static void AddPingLockTime(ImDrawListPtr drawList, Vector2 lineStart, f { ImguiTooltips.ShowTooltip(() => { - ImGui.TextWrapped("ConfigWindow_Basic_ClickingDuration".Local("The clicking duration, RS will try to click at this moment.")); + ImGui.TextWrapped(UiString.ConfigWindow_Basic_ClickingDuration.Local()); ImGui.Separator(); ImGui.TextColored(ImGui.ColorConvertU32ToFloat4(IDEAL_CLICK_TIME_COLOR), - "ConfigWindow_Basic_IdealClickingTime".Local("The ideal click time.")); + UiString.ConfigWindow_Basic_IdealClickingTime.Local()); ImGui.TextColored(ImGui.ColorConvertU32ToFloat4(CLICK_TIME_COLOR), - "ConfigWindow_Basic_RealClickingTime".Local("The real click time.")); + UiString.ConfigWindow_Basic_RealClickingTime.Local()); }); } @@ -141,7 +141,7 @@ private static void DrawBasicTimer() drawList.AddRect(start, start + rectSize, uint.MaxValue, 0, ImDrawFlags.Closed, 2); if (ImGuiHelper.IsInRect(start, rectSize)) { - ImguiTooltips.ShowTooltip(typeof(ConfigsNew).GetProperty(nameof(ConfigsNew.WeaponDelay))!.Local()); + ImguiTooltips.ShowTooltip(typeof(Configs).GetProperty(nameof(Configs.WeaponDelay))!.Local()); } drawList.AddLine(lineStart + new Vector2((gcdTime + weaponDelay) * sizePerTime, -spacingHeight), lineStart + new Vector2((gcdTime + weaponDelay) * sizePerTime, pingHeight * 2 + spacingHeight), IDEAL_CLICK_TIME_COLOR, 2); @@ -188,26 +188,30 @@ private static void DrawBasicTimer() ImGui.Spacing(); - _allSearchables.DrawItems(ConfigsNew.BasicTimer); + _allSearchables.DrawItems(Configs.BasicTimer); } private static readonly CollapsingHeaderGroup _autoSwitch = new(new() { - { () => "ConfigWindow_Basic_SwitchCancelConditionSet".Local("Auto turn off conditions"), - () => DataCenter.RightSet.SwitchCancelConditionSet?.DrawMain(DataCenter.RightNowRotation) }, - - { () => "ConfigWindow_Basic_SwitchManualConditionSet".Local("Auto turn manual conditions"), - () => DataCenter.RightSet.SwitchManualConditionSet?.DrawMain(DataCenter.RightNowRotation) }, - - { () => "ConfigWindow_Basic_SwitchAutoConditionSet".Local("Auto turn auto conditions"), - () => DataCenter.RightSet.SwitchAutoConditionSet?.DrawMain(DataCenter.RightNowRotation) }, + { + UiString.ConfigWindow_Basic_SwitchCancelConditionSet.Local, + () => DataCenter.RightSet.SwitchCancelConditionSet?.DrawMain(DataCenter.RightNowRotation) + }, + { + UiString.ConfigWindow_Basic_SwitchManualConditionSet.Local, + () => DataCenter.RightSet.SwitchManualConditionSet?.DrawMain(DataCenter.RightNowRotation) + }, + { + UiString.ConfigWindow_Basic_SwitchAutoConditionSet.Local, + () => DataCenter.RightSet.SwitchAutoConditionSet?.DrawMain(DataCenter.RightNowRotation) + }, }) { HeaderSize = 18, }; private static void DrawBasicAutoSwitch() { - _allSearchables.DrawItems(ConfigsNew.BasicAutoSwitch); + _allSearchables.DrawItems(Configs.BasicAutoSwitch); _autoSwitch?.Draw(); } @@ -231,7 +235,7 @@ private static void DrawBasicNamedConditions() - ImGuiEx.CalcIconSize(toggle).X - ImGui.GetStyle().ItemSpacing.X * 2 - 20 * Scale; ImGui.SetNextItemWidth(width); - ImGui.InputTextWithHint($"##Rotation Solver Named Condition{i}", "ConfigWindow_Condition_ConditionName".Local("Condition Name"), + ImGui.InputTextWithHint($"##Rotation Solver Named Condition{i}", UiString.ConfigWindow_Condition_ConditionName.Local(), ref DataCenter.RightSet.NamedConditions[i].Name, 1024); ImGui.SameLine(); @@ -263,7 +267,7 @@ private static void DrawBasicNamedConditions() private static void DrawBasicOthers() { - _allSearchables.DrawItems(ConfigsNew.BasicParams); + _allSearchables.DrawItems(Configs.BasicParams); if (Service.Config.SayHelloToAll) { @@ -299,16 +303,16 @@ private static void DrawUI() private static readonly CollapsingHeaderGroup _UIHeader = new(new() { { - () => "ConfigWindow_UI_Information".Local("Information"), - () => _allSearchables.DrawItems(ConfigsNew.UiInformation) + UiString.ConfigWindow_UI_Information.Local, + () => _allSearchables.DrawItems(Configs.UiInformation) }, { - () => "ConfigWindow_UI_Overlay".Local("Overlay"), - () =>_allSearchables.DrawItems(ConfigsNew.UiOverlay) + UiString.ConfigWindow_UI_Overlay.Local, + () =>_allSearchables.DrawItems(Configs.UiOverlay) }, - { - () => "ConfigWindow_UI_Windows".Local("Windows"), - () =>_allSearchables.DrawItems(ConfigsNew.UiWindows) + { + UiString.ConfigWindow_UI_Windows.Local, + () =>_allSearchables.DrawItems(Configs.UiWindows) }, }); @@ -317,80 +321,80 @@ private static void DrawUI() #region Auto private static void DrawAuto() { - ImGui.TextWrapped("ConfigWindow_Auto_Description".Local("Change the way that RS atomatically uses actions.")); + ImGui.TextWrapped(UiString.ConfigWindow_Auto_Description.Local()); _autoHeader?.Draw(); } private static readonly CollapsingHeaderGroup _autoHeader = new(new() { - { () => "ConfigWindow_Auto_ActionUsage".Local("Action Usage"), () => + { UiString.ConfigWindow_Auto_ActionUsage.Local, () => { - ImGui.TextWrapped("ConfigWindow_Auto_ActionUsage_Description" - .Local("Which actions Rotation Solver can use.")); + ImGui.TextWrapped(UiString.ConfigWindow_Auto_ActionUsage_Description + .Local()); ImGui.Separator(); - _allSearchables.DrawItems(ConfigsNew.AutoActionUsage); + _allSearchables.DrawItems(Configs.AutoActionUsage); } }, - { () => "ConfigWindow_Auto_ActionCondition".Local("Action Condition"), DrawAutoActionCondition }, - { () => "ConfigWindow_Auto_StateCondition".Local("State Condition"), () => _autoState?.Draw() }, + { UiString.ConfigWindow_Auto_ActionCondition.Local, DrawAutoActionCondition }, + { UiString.ConfigWindow_Auto_StateCondition.Local, () => _autoState?.Draw() }, }); private static readonly CollapsingHeaderGroup _autoState = new(new() { { - () => "ConfigWindow_Auto_HealAreaConditionSet".Local("Heal Area Forced Condition"), + UiString.ConfigWindow_Auto_HealAreaConditionSet.Local, () => DataCenter.RightSet.HealAreaConditionSet?.DrawMain(DataCenter.RightNowRotation) }, - { - () => "ConfigWindow_Auto_HealSingleConditionSet".Local("Heal Single Forced Condition"), + { + UiString.ConfigWindow_Auto_HealSingleConditionSet.Local, () => DataCenter.RightSet.HealSingleConditionSet?.DrawMain(DataCenter.RightNowRotation) }, - { - () => "ConfigWindow_Auto_DefenseAreaConditionSet".Local("Defense Area Forced Condition"), + { + UiString.ConfigWindow_Auto_DefenseAreaConditionSet.Local, () => DataCenter.RightSet.DefenseAreaConditionSet?.DrawMain(DataCenter.RightNowRotation) }, - { - () =>"ConfigWindow_Auto_DefenseSingleConditionSet".Local("Defense Single Forced Condition"), + { + UiString.ConfigWindow_Auto_DefenseSingleConditionSet.Local, () => DataCenter.RightSet.DefenseSingleConditionSet?.DrawMain(DataCenter.RightNowRotation) }, - { - () => "Esuna Stance North Forced Condition".Local("Esuna Stance North Forced Condition"), - () => DataCenter.RightSet.EsunaStanceNorthConditionSet?.DrawMain(DataCenter.RightNowRotation) + { + UiString.ConfigWindow_Auto_DispelStancePositionalConditionSet.Local, + () => DataCenter.RightSet.DispelStancePositionalConditionSet?.DrawMain(DataCenter.RightNowRotation) }, - { - () => "ConfigWindow_Auto_RaiseShirkConditionSet".Local("Raise Shirk Forced Condition"), + { + UiString.ConfigWindow_Auto_RaiseShirkConditionSet.Local, () => DataCenter.RightSet.RaiseShirkConditionSet?.DrawMain(DataCenter.RightNowRotation) }, - { - () => "ConfigWindow_Auto_MoveForwardConditionSet".Local("Move Forward Forced Condition"), + { + UiString.ConfigWindow_Auto_MoveForwardConditionSet.Local, () => DataCenter.RightSet.MoveForwardConditionSet?.DrawMain(DataCenter.RightNowRotation) }, { - () => "ConfigWindow_Auto_MoveBackConditionSet".Local("Move Back Forced Condition"), + UiString.ConfigWindow_Auto_MoveBackConditionSet.Local, () => DataCenter.RightSet.MoveBackConditionSet?.DrawMain(DataCenter.RightNowRotation) }, - { - () => "ConfigWindow_Auto_AntiKnockbackConditionSet".Local("Anti Knockback Forced Condition"), + { + UiString.ConfigWindow_Auto_AntiKnockbackConditionSet.Local, () => DataCenter.RightSet.AntiKnockbackConditionSet?.DrawMain(DataCenter.RightNowRotation) }, - { - () => "ConfigWindow_Auto_SpeedConditionSet".Local("Speed Forced Condition"), + { + UiString.ConfigWindow_Auto_SpeedConditionSet.Local, () => DataCenter.RightSet.SpeedConditionSet?.DrawMain(DataCenter.RightNowRotation) }, { - () => "ConfigWindow_Auto_LimitBreakConditionSet".Local("Limit Break Condition"), + UiString.ConfigWindow_Auto_LimitBreakConditionSet.Local, () => DataCenter.RightSet.LimitBreakConditionSet?.DrawMain(DataCenter.RightNowRotation) }, }) @@ -400,10 +404,10 @@ private static void DrawAuto() private static void DrawAutoActionCondition() { - ImGui.TextWrapped("ConfigWindow_Auto_ActionCondition_Description".Local("This will change the way that Rotation Solver uses actions.")); + ImGui.TextWrapped(UiString.ConfigWindow_Auto_ActionCondition_Description.Local()); ImGui.Separator(); - _allSearchables.DrawItems(ConfigsNew.AutoActionCondition); + _allSearchables.DrawItems(Configs.AutoActionCondition); } #endregion @@ -415,13 +419,13 @@ private static void DrawTarget() private static readonly CollapsingHeaderGroup _targetHeader = new(new() { - { () => "ConfigWindow_Target_Config".Local( "Configuration"), DrawTargetConfig }, - { () => "ConfigWindow_List_Hostile".Local( "Hostile"), DrawTargetHostile }, + { UiString.ConfigWindow_Target_Config.Local, DrawTargetConfig }, + { UiString.ConfigWindow_List_Hostile.Local, DrawTargetHostile }, }); private static void DrawTargetConfig() { - _allSearchables.DrawItems(ConfigsNew.TargetConfig); + _allSearchables.DrawItems(Configs.TargetConfig); } private static void DrawTargetHostile() @@ -431,7 +435,7 @@ private static void DrawTargetHostile() Service.Config.TargetingTypes.Add(TargetingType.Big); } ImGui.SameLine(); - ImGui.TextWrapped("ConfigWindow_Param_HostileDesc".Local("You can The logic of hostile target selection to allow flexibility in switching the logic of selecting hostile in battle.")); + ImGui.TextWrapped(UiString.ConfigWindow_Param_HostileDesc.Local()); for (int i = 0; i < Service.Config.TargetingTypes.Count; i++) { @@ -456,13 +460,13 @@ void Down() var key = $"Targeting Type Pop Up: {i}"; ImGuiHelper.DrawHotKeysPopup(key, string.Empty, - ("ConfigWindow_List_Remove".Local("Remove"), Delete, ["Delete"]), - ("ConfigWindow_Actions_MoveUp".Local("Move Up"), Up, ["↑"]), - ("ConfigWindow_Actions_MoveDown".Local("Move Down"), Down, ["↓"])); + (UiString.ConfigWindow_List_Remove.Local(), Delete, ["Delete"]), + (UiString.ConfigWindow_Actions_MoveUp.Local(), Up, ["↑"]), + (UiString.ConfigWindow_Actions_MoveDown.Local(), Down, ["↓"])); var names = Enum.GetNames(typeof(TargetingType)); var targingType = (int)Service.Config.TargetingTypes[i]; - var text = "ConfigWindow_Param_HostileCondition".Local("Hostile target selection condition"); + var text = UiString.ConfigWindow_Param_HostileCondition.Local(); ImGui.SetNextItemWidth(ImGui.CalcTextSize(text).X + 30 * Scale); if (ImGui.Combo(text + "##HostileCondition" + i.ToString(), ref targingType, names, names.Length)) { @@ -480,34 +484,34 @@ void Down() #region Extra private static void DrawExtra() { - ImGui.TextWrapped("ConfigWindow_Extra_Description".Local("Rotation Solver focuses on the rotation itself. These are side features. If there are some other plugins can do that, these features will be deleted.")); + ImGui.TextWrapped(UiString.ConfigWindow_Extra_Description.Local()); _extraHeader?.Draw(); } private static readonly CollapsingHeaderGroup _extraHeader = new(new() { - { () => "ConfigWindow_EventItem".Local("Event"), DrawEventTab }, + { UiString.ConfigWindow_EventItem.Local, DrawEventTab }, - { - () => "ConfigWindow_Extra_Others".Local("Others"), - () => _allSearchables.DrawItems(ConfigsNew.Extra) + { + UiString.ConfigWindow_Extra_Others.Local, + () => _allSearchables.DrawItems(Configs.Extra) }, }); private static void DrawEventTab() { - if (ImGui.Button("ConfigWindow_Events_AddEvent".Local("Add Events"))) + if (ImGui.Button(UiString.ConfigWindow_Events_AddEvent.Local())) { Service.Config.Events.Add(new ActionEventInfo()); } ImGui.SameLine(); - ImGui.TextWrapped("ConfigWindow_Events_Description".Local("In this window, you can set what macro will be trigger after using an action.")); + ImGui.TextWrapped(UiString.ConfigWindow_Events_Description.Local()); - ImGui.Text("ConfigWindow_Events_DutyStart".Local("Duty Start: ")); + ImGui.Text(UiString.ConfigWindow_Events_DutyStart.Local()); ImGui.SameLine(); Service.Config.DutyStart.DisplayMacro(); - ImGui.Text("ConfigWindow_Events_DutyEnd".Local("Duty End: ")); + ImGui.Text(UiString.ConfigWindow_Events_DutyEnd.Local()); ImGui.SameLine(); Service.Config.DutyEnd.DisplayMacro(); @@ -520,7 +524,7 @@ private static void DrawEventTab() ImGui.SameLine(); - if (ImGui.Button($"{"ConfigWindow_Events_RemoveEvent".Local("Delete Event")}##RemoveEvent{eve.GetHashCode()}")) + if (ImGui.Button($"{UiString.ConfigWindow_Events_RemoveEvent.Local()}##RemoveEvent{eve.GetHashCode()}")) { remove = eve; } diff --git a/RotationSolver/UI/SearchableCollection.cs b/RotationSolver/UI/SearchableCollection.cs index b4bdbd256..2b3fc0395 100644 --- a/RotationSolver/UI/SearchableCollection.cs +++ b/RotationSolver/UI/SearchableCollection.cs @@ -12,7 +12,7 @@ internal class SearchableCollection public SearchableCollection() { - var properties = typeof(ConfigsNew).GetRuntimeProperties(); + var properties = typeof(Configs).GetRuntimeProperties(); var count = properties.Count(); var pairs = new List(count); var parents = new Dictionary(count); @@ -50,7 +50,7 @@ public SearchableCollection() { var type = property.PropertyType; - if (property.Name == nameof(ConfigsNew.AutoHeal)) + if (property.Name == nameof(Configs.AutoHeal)) { return new AutoHealCheckBox(property); } diff --git a/RotationSolver/UI/SearchableConfigs/AutoHealCheckBox.cs b/RotationSolver/UI/SearchableConfigs/AutoHealCheckBox.cs index bc28d19cd..aa031f761 100644 --- a/RotationSolver/UI/SearchableConfigs/AutoHealCheckBox.cs +++ b/RotationSolver/UI/SearchableConfigs/AutoHealCheckBox.cs @@ -20,14 +20,14 @@ internal class AutoHealCheckBox(PropertyInfo property, params ISearchable[] othe private readonly ISearchable[] _otherChildren = otherChildren; private static readonly DragFloatSearch - _healthAreaAbility = new(typeof(ConfigsNew).GetRuntimeProperty(nameof(ConfigsNew.HealthAreaAbility))!), - _healthAreaAbilityHot = new(typeof(ConfigsNew).GetRuntimeProperty(nameof(ConfigsNew.HealthAreaAbilityHot))!), - _healthAreaSpell = new(typeof(ConfigsNew).GetRuntimeProperty(nameof(ConfigsNew.HealthAreaSpell))!), - _healthAreaSpellHot = new (typeof(ConfigsNew).GetRuntimeProperty(nameof(ConfigsNew.HealthAreaSpellHot))!), - _healthSingleAbility = new (typeof(ConfigsNew).GetRuntimeProperty(nameof(ConfigsNew.HealthSingleAbility))!), - _healthSingleAbilityHot = new (typeof(ConfigsNew).GetRuntimeProperty(nameof(ConfigsNew.HealthSingleAbilityHot))!), - _healthSingleSpell = new (typeof(ConfigsNew).GetRuntimeProperty(nameof(ConfigsNew.HealthSingleSpell))!), - _healthSingleSpellHot = new (typeof(ConfigsNew).GetRuntimeProperty(nameof(ConfigsNew.HealthSingleSpellHot))!); + _healthAreaAbility = new(typeof(Configs).GetRuntimeProperty(nameof(Configs.HealthAreaAbility))!), + _healthAreaAbilityHot = new(typeof(Configs).GetRuntimeProperty(nameof(Configs.HealthAreaAbilityHot))!), + _healthAreaSpell = new(typeof(Configs).GetRuntimeProperty(nameof(Configs.HealthAreaSpell))!), + _healthAreaSpellHot = new (typeof(Configs).GetRuntimeProperty(nameof(Configs.HealthAreaSpellHot))!), + _healthSingleAbility = new (typeof(Configs).GetRuntimeProperty(nameof(Configs.HealthSingleAbility))!), + _healthSingleAbilityHot = new (typeof(Configs).GetRuntimeProperty(nameof(Configs.HealthSingleAbilityHot))!), + _healthSingleSpell = new (typeof(Configs).GetRuntimeProperty(nameof(Configs.HealthSingleSpell))!), + _healthSingleSpellHot = new (typeof(Configs).GetRuntimeProperty(nameof(Configs.HealthSingleSpellHot))!); protected override void DrawChildren() { @@ -47,14 +47,14 @@ protected override void DrawChildren() ImGui.TableHeader(""); ImGui.TableNextColumn(); - ImGui.TableHeader("NormalTargets".Local("Normal Targets")); + ImGui.TableHeader(UiString.NormalTargets.Local()); ImGui.TableNextColumn(); - ImGui.TableHeader("HotTargets".Local("Targets with HOT")); + ImGui.TableHeader(UiString.HotTargets.Local()); ImGui.TableNextRow(); ImGui.TableNextColumn(); - ImGui.Text("HpAoe0Gcd".Local("HP for AoE healing oGCDs")); + ImGui.Text(UiString.HpAoe0Gcd.Local()); ImGui.TableNextColumn(); @@ -66,7 +66,7 @@ protected override void DrawChildren() ImGui.TableNextRow(); ImGui.TableNextColumn(); - ImGui.Text("HpAoeGcd".Local("HP for AoE healing GCDs")); + ImGui.Text(UiString.HpAoeGcd.Local()); ImGui.TableNextColumn(); @@ -79,7 +79,7 @@ protected override void DrawChildren() ImGui.TableNextRow(); ImGui.TableNextColumn(); - ImGui.Text("HpSingle0Gcd".Local("HP for ST healing oGCDs")); + ImGui.Text(UiString.HpSingle0Gcd.Local()); ImGui.TableNextColumn(); @@ -91,7 +91,7 @@ protected override void DrawChildren() ImGui.TableNextRow(); ImGui.TableNextColumn(); - ImGui.Text("HpSingleGcd".Local("HP for ST healing GCDs")); + ImGui.Text(UiString.HpSingleGcd.Local()); ImGui.TableNextColumn(); diff --git a/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs b/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs index acaab5b1e..e0fa45252 100644 --- a/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs @@ -48,9 +48,9 @@ public override void ResetToDefault() private class CheckBoxDisable(PropertyInfo property) : CheckBoxConditionAbstract(property) { - public override string Name => "ForcedDisableCondition".Local("Use Forced Disable Condition"); + public override string Name => UiString.ForcedDisableCondition.Local(); - public override string Description => "ForcedEnableConditionDesc ".Local("The conditions of forced to make it true."); + public override string Description => UiString.ForcedDisableConditionDesc.Local(); protected override bool Value { @@ -67,9 +67,9 @@ protected override ConditionSet GetCondition() private class CheckBoxEnable(PropertyInfo property) : CheckBoxConditionAbstract(property) { - public override string Name => "ForcedEnableCondition".Local("Use Forced Enable Condition"); + public override string Name => UiString.ForcedEnableCondition.Local(); - public override string Description => "ForcedEnableConditionDesc".Local("The conditions of forced to make it true."); + public override string Description => UiString.ForcedEnableConditionDesc.Local(); protected override bool Value { diff --git a/RotationSolver/UI/SearchableConfigs/Searchable.cs b/RotationSolver/UI/SearchableConfigs/Searchable.cs index e6c3d274b..83852931b 100644 --- a/RotationSolver/UI/SearchableConfigs/Searchable.cs +++ b/RotationSolver/UI/SearchableConfigs/Searchable.cs @@ -123,7 +123,7 @@ public string Description { var roleOrJob = string.Join("\n", AllJobs.Select(job => Svc.Data.GetExcelSheet()?.GetRow((uint)job)?.Name ?? job.ToString())); - return string.Format("NotInJob".Local("This option is unavailable while using your current job\n \nRoles or jobs needed:\n{0}"), roleOrJob); + return string.Format(UiString.NotInJob.Local(), roleOrJob); } } } @@ -257,7 +257,7 @@ protected static void DrawJobIcon() if (IconSet.GetTexture(IconSet.GetJobIcon(DataCenter.Job, IconType.Framed), out var texture)) { ImGui.Image(texture.ImGuiHandle, Vector2.One * 24 * ImGuiHelpers.GlobalScale); - ImguiTooltips.HoveredTooltip("JobConfigTip".Local("This config is job specific")); + ImguiTooltips.HoveredTooltip(UiString.JobConfigTip.Local()); } } diff --git a/RotationSolver/Updaters/MajorUpdater.cs b/RotationSolver/Updaters/MajorUpdater.cs index 2d4429198..e1335836c 100644 --- a/RotationSolver/Updaters/MajorUpdater.cs +++ b/RotationSolver/Updaters/MajorUpdater.cs @@ -136,11 +136,11 @@ private static void ShowWarning() if (!Svc.PluginInterface.InstalledPlugins.Any(p => p.InternalName == "Avarice")) { - "AvariceWarning".Local("Avarice addon was not detected, please install it if you want to get the positional indicators for Rotation Solver!").ShowWarning(0); + UiString.AvariceWarning.Local().ShowWarning(0); } if (!Svc.PluginInterface.InstalledPlugins.Any(p => p.InternalName == "TextToTalk")) { - "TextToTalkWarning".Local("TextToTalk addon was not detected, please install it to make Rotation Solver give audio notifications!").ShowWarning(0); + UiString.TextToTalkWarning.Local().ShowWarning(0); } } diff --git a/RotationSolver/Updaters/RotationUpdater.cs b/RotationSolver/Updaters/RotationUpdater.cs index 88ac8ced3..b38600e58 100644 --- a/RotationSolver/Updaters/RotationUpdater.cs +++ b/RotationSolver/Updaters/RotationUpdater.cs @@ -409,16 +409,16 @@ public static IEnumerable>? AllGroupedActions } else { - result = "ActionAbility".Local("Ability"); + result = UiString.ActionAbility.Local(); } if (act.Setting.IsFriendly) { - result += "-" + "ActionFriendly".Local("Friendly"); + result += "-" + UiString.ActionFriendly.Local(); } else { - result += "-" + "ActionAttack".Local("Attack"); + result += "-" + UiString.ActionAttack.Local(); } return result; } diff --git a/RotationSolver/Updaters/SocialUpdater.cs b/RotationSolver/Updaters/SocialUpdater.cs index 57f3495b2..c7ae0df6a 100644 --- a/RotationSolver/Updaters/SocialUpdater.cs +++ b/RotationSolver/Updaters/SocialUpdater.cs @@ -114,7 +114,7 @@ static void DutyState_DutyStarted(object? sender, ushort e) if (DataCenter.IsInHighEndDuty) { - string.Format("HighEndWarning".Local("Please separately keybind damage reduction / shield cooldowns in case RS fails at a crucial moment in {0}!"), + string.Format(UiString.HighEndWarning.Local(), DataCenter.ContentFinderName).ShowWarning(); } } diff --git a/RotationSolver/Updaters/StateUpdater.cs b/RotationSolver/Updaters/StateUpdater.cs index 95c320d2b..d4a3568c8 100644 --- a/RotationSolver/Updaters/StateUpdater.cs +++ b/RotationSolver/Updaters/StateUpdater.cs @@ -232,7 +232,7 @@ private static AutoStatus StatusFromCmdOrCondition() AddStatus(ref status, AutoStatus.DefenseSingle, DataCenter.RightSet.DefenseSingleConditionSet); AddStatus(ref status, AutoStatus.Dispel | AutoStatus.TankStance | AutoStatus.Positional, - DataCenter.RightSet.EsunaStanceNorthConditionSet); + DataCenter.RightSet.DispelStancePositionalConditionSet); AddStatus(ref status, AutoStatus.Raise | AutoStatus.Shirk, DataCenter.RightSet.RaiseShirkConditionSet); AddStatus(ref status, AutoStatus.MoveForward, DataCenter.RightSet.MoveForwardConditionSet); AddStatus(ref status, AutoStatus.MoveBack, DataCenter.RightSet.MoveBackConditionSet);