Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 931381e254 | |||
| dd3f464860 |
+1
-1
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<Authors>cultbaus</Authors>
|
||||
<Company>-</Company>
|
||||
<Version>0.0.3.10</Version>
|
||||
<Version>0.0.3.12</Version>
|
||||
<Description>This plugin manipulates flytext.</Description>
|
||||
<Copyright>-</Copyright>
|
||||
<PackageProjectUrl>https://github.com/cultbaus/CBT</PackageProjectUrl>
|
||||
|
||||
@@ -79,7 +79,7 @@ public unsafe class SheetManager : S.IDisposable
|
||||
|
||||
private Action? GetActionRow(int actionID)
|
||||
{
|
||||
var row = LuminaActionSheet?.GetRow((uint)actionID);
|
||||
var row = LuminaActionSheet?.GetRowOrDefault((uint)actionID);
|
||||
if (row != null)
|
||||
{
|
||||
this.actionCache[actionID] = row;
|
||||
@@ -90,7 +90,7 @@ public unsafe class SheetManager : S.IDisposable
|
||||
|
||||
private Status? GetStatusRow(int value1)
|
||||
{
|
||||
var row = LuminaStatusSheet?.GetRow((uint)value1);
|
||||
var row = LuminaStatusSheet?.GetRowOrDefault((uint)value1);
|
||||
if (row != null)
|
||||
{
|
||||
this.statusCache[value1] = row;
|
||||
@@ -101,7 +101,7 @@ public unsafe class SheetManager : S.IDisposable
|
||||
|
||||
private Item? GetItemRow(int value1)
|
||||
{
|
||||
var row = LuminaItemSheet?.GetRow((uint)value1);
|
||||
var row = LuminaItemSheet?.GetRowOrDefault((uint)value1);
|
||||
if (row != null)
|
||||
{
|
||||
this.itemCache[value1] = row;
|
||||
|
||||
@@ -48,6 +48,23 @@ public class KindTab : Tab
|
||||
}
|
||||
}
|
||||
|
||||
if (this.Current.InCategory(FlyTextCategory.AutoAttack))
|
||||
{
|
||||
GuiArtist.DrawLabelPrefix("Configure for", sameLine: false);
|
||||
ImGui.SameLine();
|
||||
var isTaken = this.UsePlayerAutoAttackTakenConfig;
|
||||
if (ImGui.RadioButton("Player AutoAttack Dealt", !isTaken))
|
||||
{
|
||||
this.UsePlayerAutoAttackTakenConfig = false;
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
if (ImGui.RadioButton("Player AutoAttack Taken", isTaken))
|
||||
{
|
||||
this.UsePlayerAutoAttackTakenConfig = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.CurrentEnabled)
|
||||
{
|
||||
this.DrawFontConfigurations();
|
||||
|
||||
@@ -32,6 +32,11 @@ public abstract class Tab
|
||||
/// </summary>
|
||||
protected bool UsePlayerDamageTakenConfig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When true and current kind is AutoAttack, configuration edits apply to Player AutoAttack Taken instead of Dealt.
|
||||
/// </summary>
|
||||
protected bool UsePlayerAutoAttackTakenConfig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether.
|
||||
/// </summary>
|
||||
@@ -241,7 +246,7 @@ public abstract class Tab
|
||||
public abstract void OnClose();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the config dictionary to use for the current kind (FlyTextKinds or FlyTextKindsPlayerDamageTaken for AbilityDamage when editing Taken).
|
||||
/// Gets the config dictionary to use for the current kind (FlyTextKinds or the appropriate Player * Taken dict when editing Taken).
|
||||
/// </summary>
|
||||
protected Dictionary<FlyTextKind, FlyTextConfiguration> GetCurrentConfigDictionary()
|
||||
{
|
||||
@@ -251,6 +256,12 @@ public abstract class Tab
|
||||
return Service.Configuration.FlyTextKindsPlayerDamageTaken;
|
||||
}
|
||||
|
||||
if (this.Current.InCategory(FlyTextCategory.AutoAttack) && this.UsePlayerAutoAttackTakenConfig
|
||||
&& Service.Configuration.FlyTextKindsPlayerAutoAttackTaken != null)
|
||||
{
|
||||
return Service.Configuration.FlyTextKindsPlayerAutoAttackTaken;
|
||||
}
|
||||
|
||||
return Service.Configuration.FlyTextKinds;
|
||||
}
|
||||
|
||||
|
||||
+17
-1
@@ -92,7 +92,7 @@ public sealed partial class Plugin : IDalamudPlugin
|
||||
=> this.configWindow.IsOpen = true;
|
||||
|
||||
/// <summary>
|
||||
/// Migrates existing config: ensures FlyTextKindsPlayerDamageTaken is populated for AbilityDamage kinds (e.g. from older saves).
|
||||
/// Migrates existing config: ensures FlyTextKindsPlayerDamageTaken and FlyTextKindsPlayerAutoAttackTaken are populated (e.g. from older saves).
|
||||
/// </summary>
|
||||
private static void MigratePlayerDamageTakenConfig()
|
||||
{
|
||||
@@ -112,6 +112,22 @@ public sealed partial class Plugin : IDalamudPlugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config.FlyTextKindsPlayerAutoAttackTaken == null || config.FlyTextKindsPlayerAutoAttackTaken.Count == 0)
|
||||
{
|
||||
config.FlyTextKindsPlayerAutoAttackTaken = [];
|
||||
foreach (var kind in FlyTextCategoryExtension.GetKindsFor(FlyTextCategory.AutoAttack))
|
||||
{
|
||||
if (config.FlyTextKinds.TryGetValue(kind, out var existing))
|
||||
{
|
||||
config.FlyTextKindsPlayerAutoAttackTaken[kind] = new FlyTextConfiguration(existing);
|
||||
}
|
||||
else
|
||||
{
|
||||
config.FlyTextKindsPlayerAutoAttackTaken[kind] = new FlyTextConfiguration();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -68,6 +68,12 @@ public class PluginConfiguration : IPluginConfiguration
|
||||
kind => kind,
|
||||
kind => new FlyTextConfiguration());
|
||||
|
||||
this.FlyTextKindsPlayerAutoAttackTaken = FlyTextCategoryExtension
|
||||
.GetKindsFor(FlyTextCategory.AutoAttack)
|
||||
.ToDictionary(
|
||||
kind => kind,
|
||||
kind => new FlyTextConfiguration());
|
||||
|
||||
FlyTextCategory.AbilityDamage
|
||||
.ForEachKind(kind =>
|
||||
{
|
||||
@@ -90,6 +96,9 @@ public class PluginConfiguration : IPluginConfiguration
|
||||
{
|
||||
this.FlyTextKinds[kind].Font.Color = new Vector4(1, 1, 1, 1);
|
||||
this.FlyTextKinds[kind].Font.Size = 18f;
|
||||
|
||||
this.FlyTextKindsPlayerAutoAttackTaken[kind].Font.Color = new Vector4(1, 1, 1, 1);
|
||||
this.FlyTextKindsPlayerAutoAttackTaken[kind].Font.Size = 18f;
|
||||
});
|
||||
|
||||
FlyTextCategory.AbilityHealing
|
||||
@@ -179,6 +188,27 @@ public class PluginConfiguration : IPluginConfiguration
|
||||
this.FlyTextKindsPlayerDamageTaken[kind].Filter.Self = false;
|
||||
}
|
||||
});
|
||||
|
||||
FlyTextCategoryExtension
|
||||
.GetKindsFor(FlyTextCategory.AutoAttack)
|
||||
.ToList()
|
||||
.ForEach(kind =>
|
||||
{
|
||||
if (kind.ShouldFilter(FlyTextFilter.Party))
|
||||
{
|
||||
this.FlyTextKindsPlayerAutoAttackTaken[kind].Filter.Party = false;
|
||||
}
|
||||
|
||||
if (kind.ShouldFilter(FlyTextFilter.Enemy))
|
||||
{
|
||||
this.FlyTextKindsPlayerAutoAttackTaken[kind].Filter.Enemy = false;
|
||||
}
|
||||
|
||||
if (kind.ShouldFilter(FlyTextFilter.Self))
|
||||
{
|
||||
this.FlyTextKindsPlayerAutoAttackTaken[kind].Filter.Self = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -197,6 +227,12 @@ public class PluginConfiguration : IPluginConfiguration
|
||||
/// </summary>
|
||||
public Dictionary<FlyTextKind, FlyTextConfiguration> FlyTextKindsPlayerDamageTaken { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the configuration for auto attack when the player is the target (auto attack taken).
|
||||
/// When the player deals auto attack, <see cref="FlyTextKinds"/> is used; when the player takes auto attack, this is used.
|
||||
/// </summary>
|
||||
public Dictionary<FlyTextKind, FlyTextConfiguration> FlyTextKindsPlayerAutoAttackTaken { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the FlyTextCategory Category Configuration options.
|
||||
/// </summary>
|
||||
|
||||
+13
-6
@@ -104,7 +104,7 @@ public unsafe partial class PluginManager
|
||||
=> Service.Configuration.FlyTextKinds.TryGetValue(kind, out var config) ? config : null;
|
||||
|
||||
/// <summary>
|
||||
/// Get the config for an event. For AbilityDamage kinds, returns Player Damage Taken config when the player is the target, otherwise the normal (Dealt) config.
|
||||
/// Get the config for an event. For AbilityDamage kinds, returns Player Damage Taken config when the player is the target; for AutoAttack, returns Player AutoAttack Taken config when the player is the target; otherwise the normal (Dealt) config.
|
||||
/// </summary>
|
||||
/// <param name="kind">Kind of the event.</param>
|
||||
/// <param name="source">Source character.</param>
|
||||
@@ -112,12 +112,19 @@ public unsafe partial class PluginManager
|
||||
/// <returns>The configuration to use for this event.</returns>
|
||||
public static FlyTextConfiguration? GetConfigForEvent(FlyTextKind kind, Character* source, Character* target)
|
||||
{
|
||||
if (kind.InCategory(FlyTextCategory.AbilityDamage)
|
||||
&& target != null
|
||||
&& IsPlayerCharacter(target)
|
||||
&& Service.Configuration.FlyTextKindsPlayerDamageTaken?.TryGetValue(kind, out var takenConfig) == true)
|
||||
if (target != null && IsPlayerCharacter(target))
|
||||
{
|
||||
return takenConfig;
|
||||
if (kind.InCategory(FlyTextCategory.AbilityDamage)
|
||||
&& Service.Configuration.FlyTextKindsPlayerDamageTaken?.TryGetValue(kind, out var damageTakenConfig) == true)
|
||||
{
|
||||
return damageTakenConfig;
|
||||
}
|
||||
|
||||
if (kind.InCategory(FlyTextCategory.AutoAttack)
|
||||
&& Service.Configuration.FlyTextKindsPlayerAutoAttackTaken?.TryGetValue(kind, out var autoAttackTakenConfig) == true)
|
||||
{
|
||||
return autoAttackTakenConfig;
|
||||
}
|
||||
}
|
||||
|
||||
return GetConfigForKind(kind);
|
||||
|
||||
Reference in New Issue
Block a user