feat: add minimum combatant thresholds
This commit is contained in:
parent
7e77b5100a
commit
57467788ea
@ -35,6 +35,8 @@ public class Configuration : IPluginConfiguration {
|
||||
[Evaluation.Poor] = 0.25f,
|
||||
[Evaluation.Awful] = 0f,
|
||||
};
|
||||
public int EvaluationMinCombatants;
|
||||
public int EvaluationMinSameRole;
|
||||
}
|
||||
|
||||
public enum MeterMode {
|
||||
|
@ -219,6 +219,10 @@ public class Plugin : IDalamudPlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.Client.Data.Combatants.Count < this.Config.EvaluationMinCombatants) {
|
||||
return;
|
||||
}
|
||||
|
||||
var combatants = this.Client.Data.Combatants.Values
|
||||
.Where(combatant => {
|
||||
var job = this.DataManager.GetExcelSheet<ClassJob>()!
|
||||
@ -227,6 +231,10 @@ public class Plugin : IDalamudPlugin {
|
||||
return job?.Role == player.ClassJob.GameData?.Role;
|
||||
})
|
||||
.ToList();
|
||||
if (combatants.Count < this.Config.EvaluationMinSameRole) {
|
||||
return;
|
||||
}
|
||||
|
||||
combatants.Sort((a, b) => a.EncDps.CompareTo(b.EncDps));
|
||||
var youIndex = combatants.FindIndex(combatant => combatant.Name == "YOU");
|
||||
if (youIndex == -1) {
|
||||
|
@ -162,6 +162,9 @@ public class PluginUi : IDisposable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
anyChanged |= ImGui.SliderInt("Minimum players to show evaluation", ref this.Plugin.Config.EvaluationMinCombatants, 0, 24);
|
||||
anyChanged |= ImGui.SliderInt("Minimum players on the same role to show evaluation", ref this.Plugin.Config.EvaluationMinSameRole, 0, 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user