Skip to content

Commit b274d59

Browse files
committed
Version 3.3.17
- Changed preview image. - Fixed users not being able to force repair when right clicking a building. - Added a Repair designator: * Used to flag buildings that will not be automatically repaired due to the current Repair Threshold setting. * Flagged buildings will ignore the threshold. * The designator will be removed when the building's current HP reaches its Maximum HP. - Added a Repair keybinding to the Architect section of the keybindings menu. - Repair icon courtesy of mrofa (credits can be found in the Steam Workshop page or Ludeon forums thread). - Minor code consistency changes.
1 parent 9a7c735 commit b274d59

19 files changed

Lines changed: 264 additions & 59 deletions

About/Preview.png

199 KB
Loading
4.5 KB
Binary file not shown.

Defs/Designations/Designations.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<DesignationDefs>
3+
4+
<DesignationDef>
5+
<defName>RWP_ForcedRepair</defName>
6+
<texturePath>Designations/ForcedRepair</texturePath>
7+
<targetType>Thing</targetType>
8+
<removeIfBuildingDespawned>true</removeIfBuildingDespawned>
9+
</DesignationDef>
10+
11+
</DesignationDefs>

Defs/KeyBindings/KeyBindings.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<KeyBindingDefs>
3+
4+
<!-- Repair designator keybinding -->
5+
6+
<KeyBindingDef ParentName="ArchitectBase">
7+
<defName>DesignatorForcedRepair</defName>
8+
<label>Repair &lt;b&gt;&lt;color=orange&gt;[Refactored Work Priorities]&lt;/color&gt;&lt;/b&gt;</label>
9+
<category>Architect</category>
10+
</KeyBindingDef>
11+
12+
</KeyBindingDefs>

Languages/ChineseSimplified/Keyed/ChineseSimplified.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@
1515
<RWP_setting_haulDeterioratables_HealthThresholdInt>&lt;b&gt;[Haul]&lt;/b&gt; Deterioratable HP threshold percentage: &lt;b&gt;&lt;color=orange&gt;{0}%&lt;/color&gt;&lt;/b&gt;</RWP_setting_haulDeterioratables_HealthThresholdInt>
1616
<RWP_setting_haulDeterioratables_HealthThresholdInt_desc>If "Prioritise hauling deterioratables" is enabled, skip items if their current health falls below this percentage.</RWP_setting_haulDeterioratables_HealthThresholdInt_desc>
1717

18+
<Designator_ForcedRepair>Repair (Ignore Threshold)</Designator_ForcedRepair>
19+
<Designator_ForcedRepairDesc>Instruct colonists to repair the designated buildings even if their HP is above the assigned Repair Threshold.</Designator_ForcedRepairDesc>
20+
1821
</LanguageData>

Languages/English/Keyed/English.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@
1515
<RWP_setting_haulDeterioratables_HealthThresholdInt>&lt;b&gt;[Haul]&lt;/b&gt; Deterioratable HP threshold percentage: &lt;b&gt;&lt;color=orange&gt;{0}%&lt;/color&gt;&lt;/b&gt;</RWP_setting_haulDeterioratables_HealthThresholdInt>
1616
<RWP_setting_haulDeterioratables_HealthThresholdInt_desc>If "Prioritise hauling deterioratables" is enabled, skip items if their current health falls below this percentage.</RWP_setting_haulDeterioratables_HealthThresholdInt_desc>
1717

18+
<Designator_ForcedRepair>Repair (Ignore Threshold)</Designator_ForcedRepair>
19+
<Designator_ForcedRepairDesc>Instruct colonists to repair the designated buildings even if their HP is above the assigned Repair Threshold.</Designator_ForcedRepairDesc>
20+
1821
</LanguageData>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Patch>
3+
4+
<Operation Class="PatchOperationAdd">
5+
<xpath>/Defs/DesignationCategoryDef[defName = "Orders"]/specialDesignatorClasses</xpath>
6+
<value>
7+
<li>RWP.Designator_ForcedRepair</li>
8+
</value>
9+
</Operation>
10+
11+
</Patch>

Patches/JobDefs/Jobs_Work.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Patch>
3+
4+
<!-- Replace Repair driverClass -->
5+
6+
<Operation Class="PatchOperationReplace">
7+
<xpath>/Defs/JobDef[defName = "Repair"]/driverClass</xpath>
8+
<value>
9+
<driverClass>RWP.JobDriver_RepairCustom</driverClass>
10+
</value>
11+
</Operation>
12+
13+
</Patch>
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
2-
<Patch>
3-
4-
<!-- Remove feeding sick animals from doctors, given to handlers -->
5-
6-
<Operation Class="PatchOperationReplace">
7-
<xpath>/WorkGivers/WorkGiverDef[defName = "DoctorFeedAnimals"]/workType</xpath>
8-
<value>
9-
<workType>Handling</workType>
10-
</value>
11-
</Operation>
12-
13-
<Operation Class="PatchOperationReplace">
14-
<xpath>/WorkGivers/WorkGiverDef[defName = "DoctorFeedAnimals"]/priorityInType</xpath>
15-
<value>
16-
<priorityInType>110</priorityInType>
17-
</value>
18-
</Operation>
19-
20-
<!-- Replace Repair giverClass -->
21-
22-
<Operation Class="PatchOperationReplace">
23-
<xpath>/WorkGivers/WorkGiverDef[defName = "Repair"]/giverClass</xpath>
24-
<value>
25-
<giverClass>RWP.WorkGiver_RepairCustom</giverClass>
26-
</value>
27-
</Operation>
28-
29-
<!-- Prioritise roof removal over building roofs -->
30-
31-
<Operation Class="PatchOperationReplace">
32-
<xpath>/WorkGivers/WorkGiverDef[defName = "RemoveRoofs"]/priorityInType</xpath>
33-
<value>
34-
<priorityInType>70</priorityInType>
35-
</value>
36-
</Operation>
37-
38-
<Operation Class="PatchOperationReplace">
39-
<xpath>/WorkGivers/WorkGiverDef[defName = "BuildRoofs"]/priorityInType</xpath>
40-
<value>
41-
<priorityInType>60</priorityInType>
42-
</value>
43-
</Operation>
44-
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Patch>
3+
4+
<!-- Remove feeding sick animals from doctors, given to handlers -->
5+
6+
<Operation Class="PatchOperationReplace">
7+
<xpath>/WorkGivers/WorkGiverDef[defName = "DoctorFeedAnimals"]/workType</xpath>
8+
<value>
9+
<workType>Handling</workType>
10+
</value>
11+
</Operation>
12+
13+
<Operation Class="PatchOperationReplace">
14+
<xpath>/WorkGivers/WorkGiverDef[defName = "DoctorFeedAnimals"]/priorityInType</xpath>
15+
<value>
16+
<priorityInType>110</priorityInType>
17+
</value>
18+
</Operation>
19+
20+
<!-- Replace Repair giverClass -->
21+
22+
<Operation Class="PatchOperationReplace">
23+
<xpath>/WorkGivers/WorkGiverDef[defName = "Repair"]/giverClass</xpath>
24+
<value>
25+
<giverClass>RWP.WorkGiver_RepairCustom</giverClass>
26+
</value>
27+
</Operation>
28+
29+
<!-- Prioritise roof removal over building roofs -->
30+
31+
<Operation Class="PatchOperationReplace">
32+
<xpath>/WorkGivers/WorkGiverDef[defName = "RemoveRoofs"]/priorityInType</xpath>
33+
<value>
34+
<priorityInType>70</priorityInType>
35+
</value>
36+
</Operation>
37+
38+
<Operation Class="PatchOperationReplace">
39+
<xpath>/WorkGivers/WorkGiverDef[defName = "BuildRoofs"]/priorityInType</xpath>
40+
<value>
41+
<priorityInType>60</priorityInType>
42+
</value>
43+
</Operation>
44+
4545
</Patch>

Source/Controller.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using UnityEngine;
2-
using RimWorld;
1+
using RimWorld;
2+
using UnityEngine;
33
using Verse;
44

55
namespace RWP
@@ -11,8 +11,9 @@ public Controller(ModContentPack content) : base(content)
1111
GetSettings<Settings>();
1212
}
1313

14-
public WorkGiverDef DefOf_HaulRottable => DefDatabase<WorkGiverDef>.GetNamed("HaulRottable");
15-
public WorkGiverDef DefOf_HaulDeteriorating => DefDatabase<WorkGiverDef>.GetNamed("HaulDeteriorating");
14+
public static WorkGiverDef DefOf_HaulRottable => DefDatabase<WorkGiverDef>.GetNamed("HaulRottable");
15+
public static WorkGiverDef DefOf_HaulDeteriorating => DefDatabase<WorkGiverDef>.GetNamed("HaulDeteriorating");
16+
public static DesignationDef DefOf_RWP_ForcedRepair => DefDatabase<DesignationDef>.GetNamed("RWP_ForcedRepair");
1617

1718
public override void WriteSettings()
1819
{

0 commit comments

Comments
 (0)