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

Commit

Permalink
fix: fixed the case that no beneficial area positions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 19, 2023
1 parent 341dfc4 commit f58f73d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
3 changes: 2 additions & 1 deletion RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ private bool TargetAreaFriend(float range, bool mustUse, PlayerCharacter player)
switch (Service.Config.GetValue(PluginConfigInt.BeneficialAreaStrategy))
{
case 0: // Find from list
if (OtherConfiguration.BeneficialPositions.TryGetValue(Svc.ClientState.TerritoryType, out var pts))
if (OtherConfiguration.BeneficialPositions.TryGetValue(Svc.ClientState.TerritoryType, out var pts)
&& pts != null && pts.Length > 0)
{
var closest = pts.MinBy(p => Vector3.Distance(player.Position, p));
if(Vector3.Distance(player.Position, closest) < player.HitboxRadius + EffectRange)
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@
"ConfigWindow_Rotation_Configuration": "Configuration",
"ConfigWindow_Rotation_Rating": "Rating",
"ConfigWindow_Rotation_Information": "Information",
"ConfigWindow_Rotation_Rating_Description": "Here are some rating methods to analysis this rotation.",
"ConfigWindow_Rotation_Rating_CountOfLastUsing": "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. \nFor example, clipping the gcd, death, take some status that grated by some action off manually, etc.",
"ConfigWindow_Rotation_Rating_CountOfCombatTimeUsing": "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. \nFor example, engaged by others in the party, different gcd time, etc.",
"ConfigWindow_Rotation_Rating_Description": "Here are some rating methods to analysis this rotation. Most of these methods need your engagement.",
"ConfigWindow_Rotation_Rating_CountOfLastUsing": "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_CountOfCombatTimeUsing": "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_Actions_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_ForcedConditionSet": "Forced Condition",
"ConfigWindow_Actions_ForcedConditionSet_Description": "Conditions when automatic use of action is forced.",
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,9 @@ internal partial class Strings
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.";
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. \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. \nFor example, engaged by others in the party, different gcd time, etc.";
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.";

Expand Down
22 changes: 19 additions & 3 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,33 @@ public override void Draw()
{
ImGui.TableSetupColumn("Rotation Config Side Bar", ImGuiTableColumnFlags.WidthFixed, 100 * _scale);
ImGui.TableNextColumn();
DrawSideBar();

try
{
DrawSideBar();
}
catch (Exception ex)
{
PluginLog.Warning(ex, "Something wrong with sideBar");
}

ImGui.TableNextColumn();
DrawBody();

try
{
DrawBody();
}
catch (Exception ex)
{
PluginLog.Warning(ex, "Something wrong with body");
}

ImGui.EndTable();
}
}
catch(Exception ex)
{
PluginLog.Warning(ex, "Something wrong with new ui");
PluginLog.Warning(ex, "Something wrong with config window.");
}
}

Expand Down

0 comments on commit f58f73d

Please sign in to comment.