99using System . Web ;
1010using DailyRoutines . Abstracts ;
1111using DailyRoutines . Managers ;
12- using Dalamud . Game . ClientState . Party ;
12+ using Dalamud . Game . Addon . Lifecycle ;
13+ using Dalamud . Game . Addon . Lifecycle . AddonArgTypes ;
1314using Dalamud . Game . ClientState . Conditions ;
15+ using Dalamud . Game . ClientState . Party ;
1416using Dalamud . Interface . Utility . Raii ;
1517using FFXIVClientStructs . FFXIV . Client . Game ;
1618using FFXIVClientStructs . FFXIV . Client . UI . Agent ;
1719using FFXIVClientStructs . FFXIV . Component . GUI ;
1820using Newtonsoft . Json ;
19- using Dalamud . Game . Addon . Lifecycle ;
20- using Dalamud . Game . Addon . Lifecycle . AddonArgTypes ;
21- using LuminaAction = Lumina . Excel . GeneratedSheets . Action ;
21+ using LuminaAction = Lumina . Excel . Sheets . Action ;
2222
2323namespace DailyRoutines . Modules ;
2424
@@ -72,7 +72,7 @@ public override void ConfigUI()
7272 {
7373 // auto play card
7474 ImGui . TextColored ( LightSkyBlue , GetLoc ( "ASTHelper-AutoPlayCardTitle" ) ) ;
75- ImGuiOm . HelpMarker ( GetLoc ( "ASTHelper-AutoPlayCardDescription" , LuminaCache . GetRow < LuminaAction > ( 17055 ) . Name . ExtractText ( ) ) ) ;
75+ ImGuiOm . HelpMarker ( GetLoc ( "ASTHelper-AutoPlayCardDescription" , LuminaCache . GetRow < LuminaAction > ( 17055 ) ! . Value . Name . ExtractText ( ) ) ) ;
7676
7777 ImGui . Spacing ( ) ;
7878
@@ -209,7 +209,7 @@ public override void ConfigUI()
209209 if ( ImGui . SliderFloat ( "##MarkScale" , ref ModuleConfig . MarkScale , 0.1f , 1.0f , "%.2f" ) )
210210 {
211211 SaveConfig ( ModuleConfig ) ;
212- NewMark ( 0 , LuminaCache . GetRow < LuminaAction > ( 37023 ) . Icon ) ;
212+ NewMark ( 0 , LuminaCache . GetRow < LuminaAction > ( 37023 ) ! . Value . Icon ) ;
213213 DService . Framework . RunOnTick ( async ( ) => await PreviewTimer ( ( ) => DelMark ( 0 ) , 6000 ) ) ;
214214 RefreshMarks ( true ) ;
215215 }
@@ -219,7 +219,7 @@ public override void ConfigUI()
219219 if ( ImGui . SliderFloat2 ( "##MarkMargin" , ref ModuleConfig . MarkOffset , - 50f , 50f , "%.2f" ) )
220220 {
221221 SaveConfig ( ModuleConfig ) ;
222- NewMark ( 0 , LuminaCache . GetRow < LuminaAction > ( 37023 ) . Icon ) ;
222+ NewMark ( 0 , LuminaCache . GetRow < LuminaAction > ( 37023 ) ! . Value . Icon ) ;
223223 DService . Framework . RunOnTick ( async ( ) => await PreviewTimer ( ( ) => DelMark ( 0 ) , 6000 ) ) ;
224224 RefreshMarks ( true ) ;
225225 }
@@ -254,8 +254,8 @@ private static void OnPreUseAction(
254254 if ( member != null )
255255 {
256256 var name = member . Name . ExtractText ( ) ;
257- var classJobIcon = member . ClassJob . GameData . ToBitmapFontIcon ( ) ;
258- var classJobName = member . ClassJob . GameData . Name . ExtractText ( ) ;
257+ var classJobIcon = member . ClassJob . ValueNullable . ToBitmapFontIcon ( ) ;
258+ var classJobName = member . ClassJob . Value . Name . ExtractText ( ) ;
259259
260260 var locKey = actionID switch
261261 {
@@ -296,8 +296,8 @@ private static void OnPreUseAction(
296296 if ( member != null )
297297 {
298298 var name = member . Name . ExtractText ( ) ;
299- var classJobIcon = member . ClassJob . GameData . ToBitmapFontIcon ( ) ;
300- var classJobName = member . ClassJob . GameData . Name . ExtractText ( ) ;
299+ var classJobIcon = member . ClassJob . ValueNullable . ToBitmapFontIcon ( ) ;
300+ var classJobName = member . ClassJob . Value . Name . ExtractText ( ) ;
301301
302302 if ( ModuleConfig . SendChat )
303303 Chat ( GetSLoc ( "ASTHealer-EasyHeal-Message" , name , classJobIcon , classJobName ) ) ;
@@ -306,7 +306,8 @@ private static void OnPreUseAction(
306306 if ( ModuleConfig . OverlayMark )
307307 {
308308 var idx = FetchMemberIndex ( ( uint ) targetID ) ?? 0 ;
309- NewMark ( idx , LuminaCache . GetRow < LuminaAction > ( actionID ) . Icon ) ;
309+ if ( ! LuminaCache . TryGetRow < LuminaAction > ( actionID , out var actionRow ) ) return ;
310+ NewMark ( idx , actionRow . Icon ) ;
310311 DService . Framework . RunOnTick ( async ( ) => await MarkTimer ( ( ) => DelMark ( idx ) , 6000 ) ) ;
311312 }
312313 }
@@ -384,7 +385,7 @@ public static unsafe void OnPartyListPostDraw(AddonEvent type, AddonArgs args)
384385 if ( meleeIdx != MeleeCandidateIdxCache )
385386 {
386387 DelMark ( MeleeCandidateIdxCache ) ;
387- NewMark ( meleeIdx , LuminaCache . GetRow < LuminaAction > ( 37023 ) . Icon ) ;
388+ NewMark ( meleeIdx , LuminaCache . GetRow < LuminaAction > ( 37023 ) ! . Value . Icon ) ;
388389 MeleeCandidateIdxCache = meleeIdx ;
389390 }
390391
@@ -394,7 +395,7 @@ public static unsafe void OnPartyListPostDraw(AddonEvent type, AddonArgs args)
394395 if ( rangeIdx != RangeCandidateIdxCache )
395396 {
396397 DelMark ( RangeCandidateIdxCache ) ;
397- NewMark ( rangeIdx , LuminaCache . GetRow < LuminaAction > ( 37026 ) . Icon ) ;
398+ NewMark ( rangeIdx , LuminaCache . GetRow < LuminaAction > ( 37026 ) ! . Value . Icon ) ;
398399 RangeCandidateIdxCache = rangeIdx ;
399400 }
400401 }
@@ -439,7 +440,7 @@ private static void OrderCandidates()
439440
440441 // find card candidates
441442 var partyList = DService . PartyList ; // role [1 tank, 2 melee, 3 range, 4 healer]
442- if ( partyList . Length is 0 || DService . ClientState . LocalPlayer . ClassJob . GameData . Abbreviation != "AST" || ModuleConfig . AutoPlayCard == AutoPlayCardStatus . Disable )
443+ if ( partyList . Length is 0 || DService . ClientState . LocalPlayer . ClassJob . Value . Abbreviation != "AST" || ModuleConfig . AutoPlayCard == AutoPlayCardStatus . Disable )
443444 return ;
444445
445446 // advance fallback when no valid zone id or invalid key
@@ -461,15 +462,15 @@ private static void OrderCandidates()
461462 var meleeOrder = MeleeOrder [ orderLabel ] ;
462463 for ( var idx = 0 ; idx < meleeOrder . Length ; idx ++ )
463464 {
464- var member = partyList . FirstOrDefault ( m => m . ClassJob . GameData . NameEnglish == meleeOrder [ idx ] ) ;
465+ var member = partyList . FirstOrDefault ( m => m . ClassJob . Value . NameEnglish == meleeOrder [ idx ] ) ;
465466 if ( member is not null && MeleeCandidateOrder . All ( m => m . id != member . ObjectId ) )
466467 MeleeCandidateOrder . Add ( ( member . ObjectId , 2 - ( idx * 0.1 ) ) ) ;
467468 }
468469
469470 var rangeOrder = RangeOrder [ orderLabel ] ;
470471 for ( var idx = 0 ; idx < rangeOrder . Length ; idx ++ )
471472 {
472- var member = partyList . FirstOrDefault ( m => m . ClassJob . GameData . NameEnglish == rangeOrder [ idx ] ) ;
473+ var member = partyList . FirstOrDefault ( m => m . ClassJob . Value . NameEnglish == rangeOrder [ idx ] ) ;
473474 if ( member is not null && RangeCandidateOrder . All ( m => m . id != member . ObjectId ) )
474475 RangeCandidateOrder . Add ( ( member . ObjectId , 2 - ( idx * 0.1 ) ) ) ;
475476 }
@@ -486,7 +487,7 @@ private static void OrderCandidates()
486487 var scale = 1 / ( 1 + Math . Exp ( - ( bestRecord . Percentile - 50 ) / 8.33 ) ) ;
487488
488489 // update priority
489- if ( member . ClassJob . GameData . Role is ( 1 or 2 ) )
490+ if ( member . ClassJob . Value . Role is ( 1 or 2 ) )
490491 {
491492 var idx = MeleeCandidateOrder . FindIndex ( m => m . id == member . ObjectId ) ;
492493 if ( idx != - 1 )
@@ -495,7 +496,7 @@ private static void OrderCandidates()
495496 MeleeCandidateOrder [ idx ] = ( member . ObjectId , priority ) ;
496497 }
497498 }
498- else if ( member . ClassJob . GameData . Role is 3 )
499+ else if ( member . ClassJob . Value . Role is 3 )
499500 {
500501 var idx = RangeCandidateOrder . FindIndex ( m => m . id == member . ObjectId ) ;
501502 if ( idx != - 1 )
@@ -510,14 +511,14 @@ private static void OrderCandidates()
510511 // fallback: select the first dps in party list
511512 if ( MeleeCandidateOrder . Count is 0 )
512513 {
513- var firstRange = partyList . FirstOrDefault ( m => m . ClassJob . GameData . Role is ( 1 or 3 ) ) ;
514+ var firstRange = partyList . FirstOrDefault ( m => m . ClassJob . Value . Role is ( 1 or 3 ) ) ;
514515 if ( firstRange is not null )
515516 MeleeCandidateOrder . Add ( ( firstRange . ObjectId , - 5 ) ) ;
516517 }
517518
518519 if ( RangeCandidateOrder . Count is 0 )
519520 {
520- var firstMelee = partyList . FirstOrDefault ( m => m . ClassJob . GameData . Role is 2 ) ;
521+ var firstMelee = partyList . FirstOrDefault ( m => m . ClassJob . Value . Role is 2 ) ;
521522 if ( firstMelee is not null )
522523 RangeCandidateOrder . Add ( ( firstMelee . ObjectId , - 5 ) ) ;
523524 }
@@ -630,7 +631,7 @@ private async Task CheckKeyStatus()
630631
631632 private static string GetRegion ( )
632633 {
633- return DService . ClientState . LocalPlayer . CurrentWorld . GameData . DataCenter . Value . Region switch
634+ return DService . ClientState . LocalPlayer . CurrentWorld . Value . DataCenter . Value . Region switch
634635 {
635636 1 => "JP" ,
636637 2 => "NA" ,
@@ -649,9 +650,9 @@ private static string GetRegion()
649650
650651 // get character info
651652 var charaName = member . Name ;
652- var serverSlug = member . World . GameData . Name ;
653+ var serverSlug = member . World . Value . Name . ExtractText ( ) ;
653654 var region = GetRegion ( ) ;
654- var job = member . ClassJob . GameData . NameEnglish ;
655+ var job = member . ClassJob . Value . NameEnglish . ExtractText ( ) ;
655656
656657 // fetch record
657658 try
0 commit comments