@@ -40,6 +40,7 @@ namespace AutoDuty.Windows;
4040using System . IO . Pipes ;
4141using System . Numerics ;
4242using System . Text ;
43+ using FFXIVClientStructs . FFXIV . Client . UI . Agent ;
4344using Achievement = Lumina . Excel . Sheets . Achievement ;
4445using ExitDutyHelper = Helpers . ExitDutyHelper ;
4546using Map = Lumina . Excel . Sheets . Map ;
@@ -1176,7 +1177,10 @@ public bool AutoDesynthSkillUp
11761177 AutoDesynth = false ;
11771178 }
11781179 }
1179- public int AutoDesynthSkillUpLimit = 50 ;
1180+ public int AutoDesynthSkillUpLimit = 50 ;
1181+ public bool AutoDesynthNoGearset = true ;
1182+ public ulong AutoDesynthCategories = 0x1 ;
1183+
11801184 internal bool autoGCTurnin = false ;
11811185 public bool AutoGCTurnin
11821186 {
@@ -2702,54 +2706,70 @@ public static void Draw()
27022706
27032707
27042708 ImGui . Columns ( 2 , "##DesynthColumns" ) ;
2709+ float columnY = ImGui . GetCursorPosY ( ) ;
27052710
27062711 if ( ImGui . Checkbox ( "Auto Desynth" , ref Configuration . autoDesynth ) )
27072712 {
27082713 Configuration . AutoDesynth = Configuration . autoDesynth ;
27092714 Configuration . Save ( ) ;
27102715 }
2711- ImGui . NextColumn ( ) ;
2712- //ImGui.SameLine(0, 5);
2713- using ( ImGuiHelper . RequiresPlugin ( ExternalPlugin . AutoRetainer , "GCTurnin" ) )
2716+ if ( Configuration . AutoDesynth )
27142717 {
2715- if ( ImGui . Checkbox ( "Auto GC Turnin" , ref Configuration . autoGCTurnin ) )
2718+ ImGui . Indent ( ) ;
2719+ if ( ImGui . Checkbox ( "Only Skill Ups" , ref Configuration . autoDesynthSkillUp ) )
27162720 {
2717- Configuration . AutoGCTurnin = Configuration . autoGCTurnin ;
2721+ Configuration . AutoDesynthSkillUp = Configuration . autoDesynthSkillUp ;
27182722 Configuration . Save ( ) ;
27192723 }
2720-
2721- ImGui . NextColumn ( ) ;
2724+ if ( Configuration . AutoDesynthSkillUp )
2725+ {
2726+ ImGui . Indent ( ) ;
2727+ ImGui . Text ( "Item Level Limit" ) ;
2728+ ImGuiComponents . HelpMarker ( "Stops desynthesising an item once your desynthesis skill reaches the Item Level + this limit." ) ;
2729+ ImGui . SameLine ( ) ;
2730+ ImGui . PushItemWidth ( ImGui . GetContentRegionAvail ( ) . X ) ;
2731+ if ( ImGui . SliderInt ( "##AutoDesynthSkillUpLimit" , ref Configuration . AutoDesynthSkillUpLimit , 0 , 50 ) )
2732+ {
2733+ Configuration . AutoDesynthSkillUpLimit = Math . Clamp ( Configuration . AutoDesynthSkillUpLimit , 0 , 50 ) ;
2734+ Configuration . Save ( ) ;
2735+ }
2736+ ImGui . PopItemWidth ( ) ;
2737+ ImGui . Unindent ( ) ;
2738+ }
2739+
2740+ if ( ImGui . Checkbox ( $ "Protect Gearsets##Desynth{ nameof ( Configuration . AutoDesynthNoGearset ) } ", ref Configuration . AutoDesynthNoGearset ) )
2741+ Configuration . Save ( ) ;
27222742
2723- //slightly cursed
2724- using ( ImRaii . Enabled ( ) )
2743+ if ( ImGui . CollapsingHeader ( "Desynth Categories" ) )
27252744 {
2726- if ( Configuration . AutoDesynth )
2745+ ImGui . Indent ( ) ;
2746+ AgentSalvage . SalvageItemCategory [ ] values = Enum . GetValues < AgentSalvage . SalvageItemCategory > ( ) ;
2747+ for ( int index = 0 ; index < values . Length ; index ++ )
27272748 {
2728- ImGui . Indent ( ) ;
2729- if ( ImGui . Checkbox ( "Only Skill Ups" , ref Configuration . autoDesynthSkillUp ) )
2730- {
2731- Configuration . AutoDesynthSkillUp = Configuration . autoDesynthSkillUp ;
2732- Configuration . Save ( ) ;
2733- }
2734- if ( Configuration . AutoDesynthSkillUp )
2735- {
2736- ImGui . Indent ( ) ;
2737- ImGui . Text ( "Item Level Limit" ) ;
2738- ImGuiComponents . HelpMarker ( "Stops desynthesising an item once your desynthesis skill reaches the Item Level + this limit." ) ;
2739- ImGui . SameLine ( ) ;
2740- ImGui . PushItemWidth ( ImGui . GetContentRegionAvail ( ) . X ) ;
2741- if ( ImGui . SliderInt ( "##AutoDesynthSkillUpLimit" , ref Configuration . AutoDesynthSkillUpLimit , 0 , 50 ) )
2742- {
2743- Configuration . AutoDesynthSkillUpLimit = Math . Clamp ( Configuration . AutoDesynthSkillUpLimit , 0 , 50 ) ;
2744- Configuration . Save ( ) ;
2745- }
2746- ImGui . PopItemWidth ( ) ;
2747- ImGui . Unindent ( ) ;
2748- }
2749- ImGui . Unindent ( ) ;
2749+ bool x = Bitmask . IsBitSet ( Configuration . AutoDesynthCategories , index ) ;
2750+ string categoryName = values [ index ] . ToCustomString ( ) ;
2751+ if ( ImGui . Checkbox ( categoryName + $ "##DesynthCategory{ categoryName } ", ref x ) )
2752+ if ( x )
2753+ Bitmask . SetBit ( ref Configuration . AutoDesynthCategories , index ) ;
2754+ else
2755+ Bitmask . ResetBit ( ref Configuration . AutoDesynthCategories , index ) ;
27502756 }
2757+ ImGui . Unindent ( ) ;
2758+ }
2759+
2760+ ImGui . Unindent ( ) ;
2761+ }
2762+
2763+ ImGui . NextColumn ( ) ;
2764+ ImGui . SetCursorPosY ( columnY ) ;
2765+ //ImGui.SameLine(0, 5);
2766+ using ( ImGuiHelper . RequiresPlugin ( ExternalPlugin . AutoRetainer , "GCTurnin" ) )
2767+ {
2768+ if ( ImGui . Checkbox ( "Auto GC Turnin" , ref Configuration . autoGCTurnin ) )
2769+ {
2770+ Configuration . AutoGCTurnin = Configuration . autoGCTurnin ;
2771+ Configuration . Save ( ) ;
27512772 }
2752- ImGui . NextColumn ( ) ;
27532773 if ( Configuration . AutoGCTurnin )
27542774 {
27552775 ImGui . Indent ( ) ;
0 commit comments