PeepingTom/Peeping Tom/Configuration.cs
Anna e9a2fb11a8 feat: use a thread to scan for targeters
Also make the poll interval configurable.

For the case of one targeter, the UI scans through the ActorTable to
find the relevant Actor, achieving either a partial or full scan. In
the case of more than one targeter, the UI constructs a Dictionary
mapping ActorId to Actor, then indexes that dictionary for each
targeter. This achieves one full scan, which may or may not be more
efficient than multiple partial scans, depending on where the actors
are located in the table.

The UI must do this because current targeters are no longer guaranteed
to be spawned anymore, especially with a high polling frequency, and
the UI needs accurate information about the targeters' address in
memory.
2020-08-08 16:59:06 -04:00

59 lines
2.2 KiB
C#

using Dalamud.Configuration;
using Dalamud.Plugin;
using System;
using System.Numerics;
namespace PeepingTom {
[Serializable]
class Configuration : IPluginConfiguration {
public int Version { get; set; } = 1;
[NonSerialized]
private DalamudPluginInterface pi;
public bool MarkTargeted { get; set; } = false;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2235:Mark all non-serializable fields", Justification = "it works?")]
public Vector4 TargetedColour { get; set; } = new Vector4(0f, 1f, 0f, 1f);
public float TargetedSize { get; set; } = 2f;
public bool MarkTargeting { get; set; } = false;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2235:Mark all non-serializable fields", Justification = "it works?")]
public Vector4 TargetingColour { get; set; } = new Vector4(1f, 0f, 0f, 1f);
public float TargetingSize { get; set; } = 2f;
public bool DebugMarkers { get; set; } = false;
public bool KeepHistory { get; set; } = true;
public bool HistoryWhenClosed { get; set; } = true;
public int NumHistory { get; set; } = 5;
public bool LogParty { get; set; } = true;
public bool LogAlliance { get; set; } = false;
public bool LogInCombat { get; set; } = false;
public bool LogSelf { get; set; } = false;
public bool FocusTargetOnHover { get; set; } = true;
public bool PlaySoundOnTarget { get; set; } = false;
public string SoundPath { get; set; } = null;
public float SoundCooldown { get; set; } = 10f;
public bool PlaySoundWhenClosed { get; set; } = false;
public bool OpenOnLogin { get; set; } = false;
public bool AllowMovement { get; set; } = true;
public bool ShowInCombat { get; set; } = false;
public bool ShowInInstance { get; set; } = false;
public bool ShowInCutscenes { get; set; } = false;
public int PollFrequency { get; set; } = 100;
public void Initialize(DalamudPluginInterface pluginInterface) {
this.pi = pluginInterface;
}
public void Save() {
this.pi.SavePluginConfig(this);
}
}
}