I would make the class Designator_PathAvoid abstract since it doesn't function if initialized with just the empty constructor. The call to Initialize would be missing if it is used in the vanilla fashion. Then I would define classes for each designator like this:
Now your buttons can be used without a custom category in xml, which allows modding them(both through patching or rimmsqol).
The only thing missing from the custom category is the visibility of the preferred designator which is handled through GameRules.SetAllowDesignator(typeof(PathAvoid.Designator_PathAvoid_Preferred), false).
Code Select
public class Designator_PathAvoid_Normal extends Designator_PathAvoid {
public Designator_PathAvoid_Normal() {
Initialize(DefDatabase<PathAvoidDef>.GetNamed("PathAvoidNormal"));
}
}
public class Designator_PathAvoid_Dislike extends Designator_PathAvoid {
public Designator_PathAvoid_Dislike() {
Initialize(DefDatabase<PathAvoidDef>.GetNamed("PathAvoidDislike"));
}
}
...
Now your buttons can be used without a custom category in xml, which allows modding them(both through patching or rimmsqol).
Code Select
<DesignationCategoryDef>
<defName>Pathing</defName>
<label>pathing</label>
<description>Allows you to customize pathing</description>
<order>0</order>
<showPowerGrid>false</showPowerGrid>
<specialDesignatorClasses>
<li>PathAvoid.Designator_PathAvoid_Normal</li>
<li>PathAvoid.Designator_PathAvoid_Dislike</li>
...
</specialDesignatorClasses>
</DesignationCategoryDef>
The only thing missing from the custom category is the visibility of the preferred designator which is handled through GameRules.SetAllowDesignator(typeof(PathAvoid.Designator_PathAvoid_Preferred), false).