88using Dalamud . Game . ClientState . Objects . SubKinds ;
99using Dalamud . Game . ClientState . Objects . Types ;
1010using Dalamud . Game . Gui . Dtr ;
11- using Dalamud . Interface . Internal . Notifications ;
11+ using Dalamud . Interface . ImGuiNotification ;
1212using Dalamud . Interface . Utility ;
1313using Dalamud . Interface . Windowing ;
1414using Dalamud . IoC ;
@@ -27,7 +27,7 @@ public class Plugin: IDalamudPlugin {
2727 // lineIndexToRad and circleSegmentIdxToRad are fixed and only need to be calculated once at the start,
2828 // since neither the number of lines nor the number of circle segments change
2929 private readonly float [ ] lineIndexToAngle = Enumerable . Range ( Configuration . IndexFront , Configuration . IndexFrontLeft + 1 ) . Select ( idx => ( float ) ( idx * Math . PI / 4 ) ) . ToArray ( ) ;
30- private readonly float [ ] circleSegmentIdxToAngle = Enumerable . Range ( 0 , circleSegmentCount ) . Select ( idx => ( float ) ( idx * ( 2.0 * Math . PI / circleSegmentCount ) ) ) . ToArray ( ) ;
30+ private readonly float [ ] circleSegmentIdxToAngle = Enumerable . Range ( 0 , circleSegmentCount ) . Select ( idx => ( float ) ( idx * ( 2.0 * Math . PI / circleSegmentCount ) ) ) . ToArray ( ) ;
3131 private readonly Vector4 [ ] circleSegmentIdxToColour = new Vector4 [ circleSegmentCount ] ;
3232
3333 private enum CircleTypes { Target , Outer } ;
@@ -39,7 +39,7 @@ private enum CircleTypes { Target, Outer };
3939
4040 [ PluginService ] public static IGameGui Gui { get ; private set ; } = null ! ;
4141 [ PluginService ] public static IChatGui Chat { get ; private set ; } = null ! ;
42- [ PluginService ] public static DalamudPluginInterface Interface { get ; private set ; } = null ! ;
42+ [ PluginService ] public static IDalamudPluginInterface Interface { get ; private set ; } = null ! ;
4343 [ PluginService ] public static ICommandManager Commands { get ; private set ; } = null ! ;
4444 [ PluginService ] public static IClientState Client { get ; private set ; } = null ! ;
4545 [ PluginService ] public static ITargetManager Targets { get ; private set ; } = null ! ;
@@ -50,7 +50,7 @@ private enum CircleTypes { Target, Outer };
5050
5151 private readonly WindowSystem windowSystem ;
5252 private readonly ConfigWindow configWindow ;
53- private readonly DtrBarEntry dtrEntry ;
53+ private readonly IDtrBarEntry dtrEntry ;
5454
5555 public Plugin ( IDtrBar dtrBar ) {
5656 this . Config = Interface . GetPluginConfig ( ) as Configuration ?? new ( ) ;
@@ -117,10 +117,10 @@ internal void Draw() {
117117 if ( ! this . Config . Enabled )
118118 return ;
119119
120- if ( Targets . Target is not BattleChara target )
120+ if ( Targets . Target is not IBattleNpc target )
121121 return ;
122122
123- if ( Client . LocalPlayer is not PlayerCharacter player )
123+ if ( Client . LocalPlayer is not IPlayerCharacter player )
124124 return ;
125125
126126 if ( target . ObjectKind is ObjectKind . Player ) {
@@ -174,16 +174,17 @@ internal void Draw() {
174174 for ( int lineIndex = Configuration . IndexFront ; lineIndex <= Configuration . IndexFrontLeft ; ++ lineIndex ) {
175175 if ( ! this . Config . DrawGuides [ lineIndex ] )
176176 continue ;
177- anyLineActive = true ;
177+ anyLineActive = true ;
178178
179179 Vector3 rotated = RotatePoint ( targetPos , guidelineBasePoint2 , targetFacing + this . lineIndexToAngle [ lineIndex ] ) ;
180180 bool endpointOnScreen = Gui . WorldToScreen ( rotated , out Vector2 coord ) ;
181- if ( limitEither ) {
182- if ( ! targetOnScreen && ! endpointOnScreen )
183- continue ;
184- } else if ( limitOuter && ! endpointOnScreen ) {
185- continue ;
186- }
181+ if ( limitEither ) {
182+ if ( ! targetOnScreen && ! endpointOnScreen )
183+ continue ;
184+ }
185+ else if ( limitOuter && ! endpointOnScreen ) {
186+ continue ;
187+ }
187188 drawing . AddLine ( centre , coord , ImGui . GetColorU32 ( this . Config . LineColours [ lineIndex ] ) , this . Config . LineThickness ) ;
188189 }
189190
@@ -264,13 +265,13 @@ private void DrawCircle(ImDrawListPtr drawing, Vector3 targetPos, Vector3 basePo
264265 case CircleTypes . Outer :
265266 circleColour = this . Config . LineColours [ Configuration . IndexOuterCircle ] ;
266267 forceCircleColour = this . Config . AlwaysUseCircleColours || this . Config . AlwaysUseCircleColoursOuter || ! anyLineActive ;
267- circleBasePoint += new Vector3 ( 0 , 0 , this . Config . SoftOuterCircleRange ) ;
268+ circleBasePoint += new Vector3 ( 0 , 0 , this . Config . SoftOuterCircleRange ) ;
268269 break ;
269270 }
270271
271272 Vector3 startPoint = RotatePoint ( targetPos , circleBasePoint , targetFacing ) ;
272273 Vector3 [ ] points = CirclePoints ( targetPos , startPoint , this . circleSegmentIdxToAngle ) . ToArray ( ) ;
273-
274+
274275 ( Vector2 point , bool render ) [ ] screenPoints = new ( Vector2 point , bool render ) [ points . Length ] ;
275276 for ( int i = 0 ; i < points . Length ; ++ i ) {
276277 bool render = Gui . WorldToScreen ( points [ i ] , out Vector2 screenPoint ) ;
@@ -310,7 +311,7 @@ private static Vector3 RotatePoint(Vector3 centre, Vector3 originalPoint, double
310311
311312 private static double AngleBetween ( Vector2 vertex , Vector2 a , Vector2 b ) => Math . Atan2 ( b . Y - vertex . Y , b . X - vertex . X ) - Math . Atan2 ( a . Y - vertex . Y , a . X - vertex . X ) ;
312313 private static double AngleBetween ( Vector3 vertex , Vector3 a , Vector3 b ) => AngleBetween ( new Vector2 ( vertex . X , vertex . Z ) , new Vector2 ( a . X , a . Z ) , new Vector2 ( b . X , b . Z ) ) ;
313- private static float AngleDifference ( float a , float b ) => ( float ) ( Math . Min ( Math . Abs ( a - b ) , Math . Abs ( Math . Abs ( a - b ) - ( 2 * Math . PI ) ) ) ) ;
314+ private static float AngleDifference ( float a , float b ) => ( float ) Math . Min ( Math . Abs ( a - b ) , Math . Abs ( Math . Abs ( a - b ) - ( 2 * Math . PI ) ) ) ;
314315
315316 private static IEnumerable < Vector2 > CirclePoints ( Vector2 centre , Vector2 start , float [ ] angles ) {
316317 foreach ( float angle in angles )
0 commit comments