Skip to content

Commit

Permalink
merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CarnifexOptimus committed Oct 1, 2024
1 parent 182930e commit 99430a6
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 18 deletions.
2 changes: 1 addition & 1 deletion BossMod/ActionTweaks/OutOfCombatActionsTweak.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace BossMod;

[ConfigDisplay(Name = "Automatic out-of-combat utility actions", Parent = typeof(ActionTweaksConfig), Since = "0.0.0.245")]
[ConfigDisplay(Name = "Automatic out-of-combat utility actions", Parent = typeof(ActionTweaksConfig), Since = "7.2.0.146")]
class OutOfCombatActionsConfig : ConfigNode
{
[PropertyDisplay("Enable the feature")]
Expand Down
2 changes: 1 addition & 1 deletion BossMod/ActionTweaks/SmartRotationTweak.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace BossMod;

[ConfigDisplay(Name = "Smart character orientation", Parent = typeof(ActionTweaksConfig), Since = "0.0.0.229")]
[ConfigDisplay(Name = "Smart character orientation", Parent = typeof(ActionTweaksConfig), Since = "7.2.0.146")]
class SmartRotationConfig : ConfigNode
{
[PropertyDisplay("Enable the feature", tooltip: "Replace in-game 'auto face target' option with a smarter alternative.\nWhen using an action, changes direction only if target is not in frontal cone.\nDuring cast, keep character facing the target.")]
Expand Down
2 changes: 1 addition & 1 deletion BossMod/Autorotation/Utility/ClassSCHUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static RotationModuleDefinition Definition()
DefineSimpleConfig(res, Track.Resurrection, "Resurrection", "Raise", 10, SCH.AID.Resurrection);

// Pet Summons
res.Define(Track.PetActions).As<PetOption>("Pet", "", 180)
res.Define(Track.Summons).As<PetOption>("Pet", "", 180)
.AddOption(PetOption.None, "None", "Do not use automatically")
.AddOption(PetOption.Eos, "Eos", "Summon Eos", 2, 0, ActionTargets.Self, 4)
.AddOption(PetOption.Seraph, "Seraph", "Summon Seraph", 120, 22, ActionTargets.Self, 80)
Expand Down
2 changes: 1 addition & 1 deletion BossMod/BossModule/AIHintsVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace BossMod;

public class AIHintsVisualizer(AIHints hints, WorldState ws, Actor player, float preferredDistance)
public class AIHintsVisualizer(AIHints hints, WorldState ws, Actor player, ulong targetID, Func<AIHints.Enemy?, (AIHints.Enemy? enemy, float range, Positional pos, bool tank)> targetSelect)
{
private readonly MapVisualizer?[] _zoneVisualizers = new MapVisualizer?[hints.ForbiddenZones.Count];
private MapVisualizer? _pathfindVisualizer;
Expand Down
2 changes: 1 addition & 1 deletion BossMod/Config/ConfigChangelog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ConfigChangelogWindow : UIWindow
private readonly Version PreviousVersion;
private readonly List<VersionedField> Fields;

public ConfigChangelogWindow() : base("VBM Changelog", true, new(400, 300))
public ConfigChangelogWindow() : base("BMR Changelog", true, new(400, 300))
{
PreviousVersion = GetPreviousPluginVersion();
Service.Config.AssemblyVersion = GetCurrentPluginVersion();
Expand Down
8 changes: 7 additions & 1 deletion BossMod/Debug/DebugAutorotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ public void Draw()
var player = autorot.Bossmods.WorldState.Party[autorot.PlayerSlot];
if (player == null)
return;
new AIHintsVisualizer(autorot.Hints, autorot.Bossmods.WorldState, player, 3).Draw(_tree);
new AIHintsVisualizer(autorot.Hints, autorot.Bossmods.WorldState, player, player.TargetID, e =>
{
// TODO: ...
return (e, 3, Positional.Any, false);
//var t = e != null ? autorot.ClassActions.SelectBetterTarget(e) : new();
//return (t.Target, t.PreferredRange, t.PreferredPosition, t.PreferTanking);
}).Draw(_tree);
}
}
16 changes: 9 additions & 7 deletions BossMod/Debug/DebugCollision.cs
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,9 @@
// private void VisualizeOBB(Vector3 min, Vector3 max, CollisionObjectShape* obj) => Camera.Instance?.DrawWorldOBB(min, max, obj->World.M, Colors.Safe);
// private void VisualizeVertex(Vector3 v, CollisionObjectShape* obj) => Camera.Instance?.DrawWorldSphere(SharpDX.Vector3.TransformCoordinate(new(v.X, v.Y, v.Z), obj->World.M).ToSystem(), 0.1f, Colors.Danger);

// private void VisualizePrimitive(CollisionShapePCBData* data, int iPrim, CollisionObjectShape* obj, uint color = Colors.Danger)
// private void VisualizePrimitive(CollisionShapePCBData* data, int iPrim, CollisionObjectShape* obj, uint color = 0)
// {
// var colors = color == 0 ? Colors.Danger : color;
// var pRaw = (float*)(data + 1);
// var pCompr = (ushort*)(pRaw + 3 * data->NumVertsRaw);
// var pPrim = (CollisionShapePrimitive*)(pCompr + 3 * data->NumVertsCompressed);
Expand All @@ -541,19 +542,20 @@
// var w1 = SharpDX.Vector3.TransformCoordinate(new(v1.X, v1.Y, v1.Z), w).ToSystem();
// var w2 = SharpDX.Vector3.TransformCoordinate(new(v2.X, v2.Y, v2.Z), w).ToSystem();
// var w3 = SharpDX.Vector3.TransformCoordinate(new(v3.X, v3.Y, v3.Z), w).ToSystem();
// Camera.Instance?.DrawWorldLine(w1, w2, color);
// Camera.Instance?.DrawWorldLine(w2, w3, color);
// Camera.Instance?.DrawWorldLine(w3, w1, color);
// Camera.Instance?.DrawWorldLine(w1, w2, colors);
// Camera.Instance?.DrawWorldLine(w2, w3, colors);
// Camera.Instance?.DrawWorldLine(w3, w1, colors);
// }

// private void VisualizeShape(CollisionShapePCBData* data, CollisionObjectShape* obj, uint color = Colors.Danger)
// private void VisualizeShape(CollisionShapePCBData* data, CollisionObjectShape* obj, uint color = 0)
// {
// var colors = color == 0 ? Colors.Danger : color;
// for (int i = 0; i < data->NumPrims; ++i)
// VisualizePrimitive(data, i, obj, color);
// if (data->Child1Offset != 0)
// VisualizeShape((CollisionShapePCBData*)((byte*)data + data->Child1Offset), obj, color);
// VisualizeShape((CollisionShapePCBData*)((byte*)data + data->Child1Offset), obj, colors);
// if (data->Child2Offset != 0)
// VisualizeShape((CollisionShapePCBData*)((byte*)data + data->Child2Offset), obj, color);
// VisualizeShape((CollisionShapePCBData*)((byte*)data + data->Child2Offset), obj, colors);
// }

// private void VisualizeObject(CollisionObjectBase* obj)
Expand Down
2 changes: 1 addition & 1 deletion BossMod/Debug/MainDebugWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected override void Dispose(bool disposing)
_debugClassDefinitions.Dispose();
_debugAddon.Dispose();
// _debugCollision.Dispose();
//_debugVfx.Dispose();
// _debugVfx.Dispose();
base.Dispose(disposing);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme
}
}

class Finale(BossModule module) : Components.CastHint(module, ActionID.MakeSpell(AID.Finale), $"Enrage, destroy the Liar's Lyre!", true);
class Finale(BossModule module) : Components.CastHint(module, ActionID.MakeSpell(AID.Finale), "Enrage, destroy the Liar's Lyre!", true);

class CorrosiveBile(BossModule module) : Components.GenericAOEs(module)
{
Expand Down
7 changes: 6 additions & 1 deletion BossMod/Replay/Visualization/ReplayDetailsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,12 @@ private void DrawAI()
if (player == null)
return;

_pfVisu ??= new(_hints, _mgr.WorldState, player, _pfTargetRadius);
if (_pfVisu == null)
{
var playerAssignment = Service.Config.Get<PartyRolesConfig>()[_mgr.WorldState.Party.Members[_povSlot].ContentId];
var pfTank = playerAssignment == PartyRolesConfig.Assignment.MT || playerAssignment == PartyRolesConfig.Assignment.OT && !_mgr.WorldState.Party.WithoutSlot().Any(p => p != player && p.Role == Role.Tank);
_pfVisu = new(_hints, _mgr.WorldState, player, player.TargetID, e => (e, _pfTargetRadius, _pfPositional, pfTank));
}
_pfVisu.Draw(_pfTree);

var rebuild = false;
Expand Down
4 changes: 2 additions & 2 deletions BossMod/ThirdParty/Clipper2/Clipper.Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ protected void AddReuseableData(ReuseableDataContainer64 reuseableData)
}
}

// VBM/BMR edit: a version of AddReusableData that forces polytype; useful if same data is to be reused as subject or clip
// BMR edit: a version of AddReusableData that forces polytype; useful if same data is to be reused as subject or clip
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected void AddReuseableData(ReuseableDataContainer64 reuseableData, PathType typeOverride)
{
Expand Down Expand Up @@ -3163,7 +3163,7 @@ public class Clipper64 : ClipperBase
base.AddReuseableData(reuseableData);
}

// VBM/BMR edit: a version of AddReusableData that forces polytype; useful if same data is to be reused as subject or clip
// BMR edit: a version of AddReusableData that forces polytype; useful if same data is to be reused as subject or clip
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public new void AddReuseableData(ReuseableDataContainer64 reuseableData, PathType typeOverride)
{
Expand Down

0 comments on commit 99430a6

Please sign in to comment.