-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed custom haul work givers to prioritise correctly (thanks Zhentar!). Separated all custom work givers in the menu to be individually togglable.
- Loading branch information
1 parent
1f3ed27
commit f415372
Showing
6 changed files
with
95 additions
and
43 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,50 @@ | ||
using HugsLib; | ||
using RimWorld; | ||
|
||
[DefOf] | ||
public static class RWPDefs | ||
namespace RWP | ||
{ | ||
public static WorkGiverDef DoctorRescueHumanColonist; | ||
public static WorkGiverDef DoctorTreatHumanColonist; | ||
public static WorkGiverDef HaulRottable; | ||
public static WorkGiverDef HaulDeteriorating; | ||
} | ||
[DefOf] | ||
public static class RWPDefs | ||
{ | ||
public static WorkGiverDef DoctorRescueHumanColonist; | ||
public static WorkGiverDef DoctorTreatHumanColonist; | ||
public static WorkGiverDef HaulRottable; | ||
public static WorkGiverDef HaulDeteriorating; | ||
} | ||
|
||
public class RWPMenu : ModBase | ||
{ | ||
public override string ModIdentifier | ||
{ | ||
get | ||
{ | ||
return "RefactoredWorkPriorities"; | ||
} | ||
} | ||
|
||
public override void DefsLoaded() | ||
{ | ||
UpdateDefs(); | ||
} | ||
|
||
public override void SettingsChanged() | ||
{ | ||
UpdateDefs(); | ||
} | ||
|
||
private void UpdateDefs() | ||
{ | ||
var customDoctor = Settings.GetHandle<bool>("CustomDoctorPriorities", "Custom Doctor priorities", "Doctors will rescue and treat colonists before animals or outsiders.", true); | ||
RWPDefs.DoctorRescueHumanColonist.scanThings = customDoctor.Value; | ||
RWPDefs.DoctorTreatHumanColonist.scanThings = customDoctor.Value; | ||
|
||
var customHaul = Settings.GetHandle<bool>("CustomHaulPriorities", "Custom Haul priorities", "Haulers will haul rottable items (corn, meals etc.) and items which deteriorate over time (weapons, wood etc.) before generic things.", true); | ||
RWPDefs.HaulRottable.scanThings = customHaul.Value; | ||
RWPDefs.HaulDeteriorating.scanThings = customHaul.Value; | ||
} | ||
public class RWPMenu : ModBase | ||
{ | ||
public override string ModIdentifier | ||
{ | ||
get | ||
{ | ||
return "RefactoredWorkPriorities"; | ||
} | ||
} | ||
|
||
public override void DefsLoaded() | ||
{ | ||
UpdateDefs(); | ||
} | ||
|
||
public override void SettingsChanged() | ||
{ | ||
UpdateDefs(); | ||
} | ||
|
||
private void UpdateDefs() | ||
{ | ||
var doctorRescueColonist = Settings.GetHandle<bool>("DoctorRescueColonist", "[Doctor] Prioritise rescuing colonists", "Doctors will rescue allied colonists before rescuing animals or outsiders.", true); | ||
RWPDefs.DoctorRescueHumanColonist.scanThings = doctorRescueColonist.Value; | ||
|
||
var doctorTreatColonist = Settings.GetHandle<bool>("DoctorTreatColonist", "[Doctor] Prioritise treating colonists", "Doctors will treat colonist injuries before treating animals or outsiders.", true); | ||
RWPDefs.DoctorTreatHumanColonist.scanThings = doctorTreatColonist.Value; | ||
|
||
var haulRottables = Settings.GetHandle<bool>("HaulRottables", "[Haul] Prioritise hauling rottables", "Haulers will haul rottable items (corn, meals etc.) before generic things.", true); | ||
RWPDefs.HaulRottable.scanThings = haulRottables.Value; | ||
|
||
var haulDeterioratables = Settings.GetHandle<bool>("HaulDeterioratables", "[Haul] Prioritise hauling deterioratables", "Haulers will haul items which deteriorate over time (weapons, wood etc.) before generic things.", true); | ||
RWPDefs.HaulDeteriorating.scanThings = haulDeterioratables.Value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters