Skip to content

Commit 5cdd2d8

Browse files
committed
Update to 1.1
1 parent 21eebb2 commit 5cdd2d8

19 files changed

Lines changed: 271 additions & 46 deletions

build.ps1

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,46 @@ function removePath($path)
3737

3838
function getInstallDir
3939
{
40+
Write-Host "Looking for RimWorld installation..."
4041
$installSubDir = "Steam\SteamApps\common\RimWorld"
4142
$installDir = "$(${Env:ProgramFiles(x86)})\$($installSubDir)"
43+
Write-Host "Checking $installDir"
4244
if (Test-Path $installDir)
4345
{
4446
return $installDir
4547
}
4648

4749
$installDir = "$($Env:ProgramFiles)\$($installSubDir)"
50+
Write-Host "Checking $installDir"
4851
if (Test-Path $installDir)
4952
{
5053
return $installDir
5154
}
5255

56+
Write-Host "RimWorld not found"
5357
return $null
5458
}
5559

60+
$installDir = getInstallDir
61+
5662
function getProjectDir
5763
{
5864
return "$PSScriptRoot\src\$targetName"
5965
}
6066

6167
$assemblyInfoFile = "$(getProjectDir)\properties\AssemblyInfo.cs"
6268

69+
function getGameVersion
70+
{
71+
$gameVersionFile = "$installDir\Version.txt"
72+
$gameVersionWithRev = Get-Content $gameVersionFile
73+
$version = [version] ($gameVersionWithRev.Split(" "))[0]
74+
75+
return "$($version.Major).$($version.Minor)"
76+
}
77+
6378
function updateToGameVersion
6479
{
65-
$installDir = getInstallDir
6680
if (!$installDir)
6781
{
6882
Write-Host -ForegroundColor Red `
@@ -71,12 +85,10 @@ function updateToGameVersion
7185
return
7286
}
7387

74-
$gameVersionFile = "$installDir\Version.txt"
75-
$gameVersionWithRev = Get-Content $gameVersionFile
76-
$version = [version] ($gameVersionWithRev.Split(" "))[0]
88+
$gameVersion = getGameVersion
7789

7890
$content = Get-Content -Raw $assemblyInfoFile
79-
$newContent = $content -replace '"\d+\.\d+(\.\d+\.\d+")', "`"$($version.Major).$($version.Minor)`$1"
91+
$newContent = $content -replace '"\d+\.\d+(\.\d+\.\d+")', "`"$gameVersion`$1"
8092

8193
if ($newContent -eq $content)
8294
{
@@ -88,12 +100,7 @@ function updateToGameVersion
88100
function copyDependencies
89101
{
90102
$thirdpartyDir = "$PSScriptRoot\ThirdParty"
91-
if (Test-Path "$thirdpartyDir\*.dll")
92-
{
93-
return
94-
}
95103

96-
$installDir = getInstallDir
97104
if (!$installDir)
98105
{
99106
Write-Host -ForegroundColor Red `
@@ -105,8 +112,12 @@ function copyDependencies
105112
$depsDir = "$installDir\RimWorldWin64_Data\Managed"
106113
Write-Host "Copying dependencies from installation directory"
107114
if (!(Test-Path $thirdpartyDir)) { mkdir $thirdpartyDir | Out-Null }
108-
Copy-Item -Force "$depsDir\UnityEngine.dll" "$thirdpartyDir\"
109-
Copy-Item -Force "$depsDir\Assembly-CSharp.dll" "$thirdpartyDir\"
115+
116+
& robocopy /mir $depsDir $thirdpartyDir "Unity*.dll" "Assembly-CSharp.dll"
117+
if ($LASTEXITCODE -gt 4)
118+
{
119+
throw "Sync of RimWorld DLLs failed"
120+
}
110121
}
111122

112123
function doPreBuild
@@ -123,12 +134,14 @@ function doPostBuild
123134

124135
$targetDir = "$(getProjectDir)\bin\Release"
125136
$targetPath = "$targetDir\$targetName.dll"
126-
$distAssemblyDir = "$distTargetDir\Assemblies"
137+
138+
$gameVersion =
139+
140+
$distAssemblyDir = "$distTargetDir\v$(getGameVersion)\Assemblies"
127141
mkdir $distAssemblyDir | Out-Null
128142

129143
Copy-Item -Recurse -Force "$PSScriptRoot\mod-structure\*" $distTargetDir
130144
Copy-Item -Force $targetPath $distAssemblyDir
131-
Copy-Item -Force "$targetDir\*HugsLibChecker.dll" $distAssemblyDir
132145

133146
Write-Host "Creating distro package"
134147
$content = Get-Content -Raw $assemblyInfoFile
@@ -150,7 +163,6 @@ function doPostBuild
150163
Write-Host "Created $distZip"
151164

152165

153-
$installDir = getInstallDir
154166
if (!$installDir)
155167
{
156168
Write-Host -ForegroundColor Yellow `

mod-structure/About/About.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<ModMetaData>
33
<name>Avoid Friendly Fire</name>
4+
<packageId>falconne.AFF</packageId>
45
<author>Falconne</author>
56
<description>Adds an new shooting mode for ranged colonists that tells them not to shoot if there are friendlies in harms way.</description>
7+
68
<supportedVersions>
79
<li>1.0</li>
10+
<li>1.1</li>
811
</supportedVersions>
12+
13+
<modDependencies>
14+
<li>
15+
<packageId>UnlimitedHugs.HugsLib</packageId>
16+
<displayName>HugsLib</displayName>
17+
<downloadUrl>https://github.com/UnlimitedHugs/RimworldHugsLib/releases/latest</downloadUrl>
18+
<steamWorkshopUrl>steam://url/CommunityFilePage/818773962</steamWorkshopUrl>
19+
</li>
20+
</modDependencies>
21+
<loadAfter>
22+
<li>UnlimitedHugs.HugsLib</li>
23+
</loadAfter>
924
</ModMetaData>
16 KB
Binary file not shown.
26 KB
Binary file not shown.

mod-structure/LoadFolders.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<loadFolders>
2+
<v1.1>
3+
<li>/</li>
4+
<li>v1.1</li>
5+
</v1.1>
6+
</loadFolders>

src/AvoidFriendlyFire/AvoidFriendlyFire.csproj

Lines changed: 193 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>AvoidFriendlyFire</RootNamespace>
1111
<AssemblyName>AvoidFriendlyFire</AssemblyName>
12-
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />
1515
</PropertyGroup>
@@ -20,29 +20,213 @@
2020
<DefineConstants>TRACE</DefineConstants>
2121
<ErrorReport>prompt</ErrorReport>
2222
<WarningLevel>4</WarningLevel>
23+
<Prefer32Bit>false</Prefer32Bit>
2324
</PropertyGroup>
2425
<ItemGroup>
25-
<Reference Include="%24HugsLibChecker, Version=0.5.0.0, Culture=neutral, processorArchitecture=MSIL">
26-
<HintPath>..\packages\UnlimitedHugs.Rimworld.HugsLibChecker.5.0.0\lib\net35\$HugsLibChecker.dll</HintPath>
26+
<Reference Include="0Harmony, Version=2.0.0.8, Culture=neutral, processorArchitecture=MSIL">
27+
<HintPath>..\packages\Lib.Harmony.2.0.0.8\lib\net472\0Harmony.dll</HintPath>
2728
</Reference>
28-
<Reference Include="0Harmony, Version=1.2.0.1, Culture=neutral, processorArchitecture=MSIL">
29-
<HintPath>..\packages\UnlimitedHugs.Rimworld.HugsLib.6.1.1\lib\net35\0Harmony.dll</HintPath>
30-
</Reference>
31-
<Reference Include="Assembly-CSharp">
29+
<Reference Include="Assembly-CSharp, Version=0.19.6814.14609, Culture=neutral, processorArchitecture=MSIL">
30+
<SpecificVersion>False</SpecificVersion>
3231
<HintPath>..\..\ThirdParty\Assembly-CSharp.dll</HintPath>
3332
</Reference>
3433
<Reference Include="HugsLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
35-
<HintPath>..\packages\UnlimitedHugs.Rimworld.HugsLib.6.1.1\lib\net35\HugsLib.dll</HintPath>
34+
<HintPath>..\packages\UnlimitedHugs.Rimworld.HugsLib.7.0.2\lib\net472\HugsLib.dll</HintPath>
3635
</Reference>
3736
<Reference Include="System" />
3837
<Reference Include="System.Core" />
38+
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
3939
<Reference Include="System.Xml.Linq" />
4040
<Reference Include="System.Data.DataSetExtensions" />
4141
<Reference Include="System.Data" />
4242
<Reference Include="System.Xml" />
43-
<Reference Include="UnityEngine">
43+
<Reference Include="Unity.TextMeshPro">
44+
<HintPath>..\..\ThirdParty\Unity.TextMeshPro.dll</HintPath>
45+
</Reference>
46+
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
47+
<SpecificVersion>False</SpecificVersion>
4448
<HintPath>..\..\ThirdParty\UnityEngine.dll</HintPath>
4549
</Reference>
50+
<Reference Include="UnityEngine.AccessibilityModule">
51+
<HintPath>..\..\ThirdParty\UnityEngine.AccessibilityModule.dll</HintPath>
52+
</Reference>
53+
<Reference Include="UnityEngine.AIModule">
54+
<HintPath>..\..\ThirdParty\UnityEngine.AIModule.dll</HintPath>
55+
</Reference>
56+
<Reference Include="UnityEngine.AndroidJNIModule">
57+
<HintPath>..\..\ThirdParty\UnityEngine.AndroidJNIModule.dll</HintPath>
58+
</Reference>
59+
<Reference Include="UnityEngine.AnimationModule">
60+
<HintPath>..\..\ThirdParty\UnityEngine.AnimationModule.dll</HintPath>
61+
</Reference>
62+
<Reference Include="UnityEngine.ARModule">
63+
<HintPath>..\..\ThirdParty\UnityEngine.ARModule.dll</HintPath>
64+
</Reference>
65+
<Reference Include="UnityEngine.AssetBundleModule">
66+
<HintPath>..\..\ThirdParty\UnityEngine.AssetBundleModule.dll</HintPath>
67+
</Reference>
68+
<Reference Include="UnityEngine.AudioModule">
69+
<HintPath>..\..\ThirdParty\UnityEngine.AudioModule.dll</HintPath>
70+
</Reference>
71+
<Reference Include="UnityEngine.ClothModule">
72+
<HintPath>..\..\ThirdParty\UnityEngine.ClothModule.dll</HintPath>
73+
</Reference>
74+
<Reference Include="UnityEngine.ClusterInputModule">
75+
<HintPath>..\..\ThirdParty\UnityEngine.ClusterInputModule.dll</HintPath>
76+
</Reference>
77+
<Reference Include="UnityEngine.ClusterRendererModule">
78+
<HintPath>..\..\ThirdParty\UnityEngine.ClusterRendererModule.dll</HintPath>
79+
</Reference>
80+
<Reference Include="UnityEngine.CoreModule">
81+
<HintPath>..\..\ThirdParty\UnityEngine.CoreModule.dll</HintPath>
82+
</Reference>
83+
<Reference Include="UnityEngine.CrashReportingModule">
84+
<HintPath>..\..\ThirdParty\UnityEngine.CrashReportingModule.dll</HintPath>
85+
</Reference>
86+
<Reference Include="UnityEngine.DirectorModule">
87+
<HintPath>..\..\ThirdParty\UnityEngine.DirectorModule.dll</HintPath>
88+
</Reference>
89+
<Reference Include="UnityEngine.DSPGraphModule">
90+
<HintPath>..\..\ThirdParty\UnityEngine.DSPGraphModule.dll</HintPath>
91+
</Reference>
92+
<Reference Include="UnityEngine.FileSystemHttpModule">
93+
<HintPath>..\..\ThirdParty\UnityEngine.FileSystemHttpModule.dll</HintPath>
94+
</Reference>
95+
<Reference Include="UnityEngine.GameCenterModule">
96+
<HintPath>..\..\ThirdParty\UnityEngine.GameCenterModule.dll</HintPath>
97+
</Reference>
98+
<Reference Include="UnityEngine.GridModule">
99+
<HintPath>..\..\ThirdParty\UnityEngine.GridModule.dll</HintPath>
100+
</Reference>
101+
<Reference Include="UnityEngine.HotReloadModule">
102+
<HintPath>..\..\ThirdParty\UnityEngine.HotReloadModule.dll</HintPath>
103+
</Reference>
104+
<Reference Include="UnityEngine.ImageConversionModule">
105+
<HintPath>..\..\ThirdParty\UnityEngine.ImageConversionModule.dll</HintPath>
106+
</Reference>
107+
<Reference Include="UnityEngine.IMGUIModule">
108+
<HintPath>..\..\ThirdParty\UnityEngine.IMGUIModule.dll</HintPath>
109+
</Reference>
110+
<Reference Include="UnityEngine.InputLegacyModule">
111+
<HintPath>..\..\ThirdParty\UnityEngine.InputLegacyModule.dll</HintPath>
112+
</Reference>
113+
<Reference Include="UnityEngine.InputModule">
114+
<HintPath>..\..\ThirdParty\UnityEngine.InputModule.dll</HintPath>
115+
</Reference>
116+
<Reference Include="UnityEngine.JSONSerializeModule">
117+
<HintPath>..\..\ThirdParty\UnityEngine.JSONSerializeModule.dll</HintPath>
118+
</Reference>
119+
<Reference Include="UnityEngine.LocalizationModule">
120+
<HintPath>..\..\ThirdParty\UnityEngine.LocalizationModule.dll</HintPath>
121+
</Reference>
122+
<Reference Include="UnityEngine.ParticleSystemModule">
123+
<HintPath>..\..\ThirdParty\UnityEngine.ParticleSystemModule.dll</HintPath>
124+
</Reference>
125+
<Reference Include="UnityEngine.PerformanceReportingModule">
126+
<HintPath>..\..\ThirdParty\UnityEngine.PerformanceReportingModule.dll</HintPath>
127+
</Reference>
128+
<Reference Include="UnityEngine.Physics2DModule">
129+
<HintPath>..\..\ThirdParty\UnityEngine.Physics2DModule.dll</HintPath>
130+
</Reference>
131+
<Reference Include="UnityEngine.PhysicsModule">
132+
<HintPath>..\..\ThirdParty\UnityEngine.PhysicsModule.dll</HintPath>
133+
</Reference>
134+
<Reference Include="UnityEngine.ProfilerModule">
135+
<HintPath>..\..\ThirdParty\UnityEngine.ProfilerModule.dll</HintPath>
136+
</Reference>
137+
<Reference Include="UnityEngine.ScreenCaptureModule">
138+
<HintPath>..\..\ThirdParty\UnityEngine.ScreenCaptureModule.dll</HintPath>
139+
</Reference>
140+
<Reference Include="UnityEngine.SharedInternalsModule">
141+
<HintPath>..\..\ThirdParty\UnityEngine.SharedInternalsModule.dll</HintPath>
142+
</Reference>
143+
<Reference Include="UnityEngine.SpriteMaskModule">
144+
<HintPath>..\..\ThirdParty\UnityEngine.SpriteMaskModule.dll</HintPath>
145+
</Reference>
146+
<Reference Include="UnityEngine.SpriteShapeModule">
147+
<HintPath>..\..\ThirdParty\UnityEngine.SpriteShapeModule.dll</HintPath>
148+
</Reference>
149+
<Reference Include="UnityEngine.StreamingModule">
150+
<HintPath>..\..\ThirdParty\UnityEngine.StreamingModule.dll</HintPath>
151+
</Reference>
152+
<Reference Include="UnityEngine.SubstanceModule">
153+
<HintPath>..\..\ThirdParty\UnityEngine.SubstanceModule.dll</HintPath>
154+
</Reference>
155+
<Reference Include="UnityEngine.TerrainModule">
156+
<HintPath>..\..\ThirdParty\UnityEngine.TerrainModule.dll</HintPath>
157+
</Reference>
158+
<Reference Include="UnityEngine.TerrainPhysicsModule">
159+
<HintPath>..\..\ThirdParty\UnityEngine.TerrainPhysicsModule.dll</HintPath>
160+
</Reference>
161+
<Reference Include="UnityEngine.TextCoreModule">
162+
<HintPath>..\..\ThirdParty\UnityEngine.TextCoreModule.dll</HintPath>
163+
</Reference>
164+
<Reference Include="UnityEngine.TextRenderingModule">
165+
<HintPath>..\..\ThirdParty\UnityEngine.TextRenderingModule.dll</HintPath>
166+
</Reference>
167+
<Reference Include="UnityEngine.TilemapModule">
168+
<HintPath>..\..\ThirdParty\UnityEngine.TilemapModule.dll</HintPath>
169+
</Reference>
170+
<Reference Include="UnityEngine.TLSModule">
171+
<HintPath>..\..\ThirdParty\UnityEngine.TLSModule.dll</HintPath>
172+
</Reference>
173+
<Reference Include="UnityEngine.UI">
174+
<HintPath>..\..\ThirdParty\UnityEngine.UI.dll</HintPath>
175+
</Reference>
176+
<Reference Include="UnityEngine.UIElementsModule">
177+
<HintPath>..\..\ThirdParty\UnityEngine.UIElementsModule.dll</HintPath>
178+
</Reference>
179+
<Reference Include="UnityEngine.UIModule">
180+
<HintPath>..\..\ThirdParty\UnityEngine.UIModule.dll</HintPath>
181+
</Reference>
182+
<Reference Include="UnityEngine.UmbraModule">
183+
<HintPath>..\..\ThirdParty\UnityEngine.UmbraModule.dll</HintPath>
184+
</Reference>
185+
<Reference Include="UnityEngine.UNETModule">
186+
<HintPath>..\..\ThirdParty\UnityEngine.UNETModule.dll</HintPath>
187+
</Reference>
188+
<Reference Include="UnityEngine.UnityAnalyticsModule">
189+
<HintPath>..\..\ThirdParty\UnityEngine.UnityAnalyticsModule.dll</HintPath>
190+
</Reference>
191+
<Reference Include="UnityEngine.UnityConnectModule">
192+
<HintPath>..\..\ThirdParty\UnityEngine.UnityConnectModule.dll</HintPath>
193+
</Reference>
194+
<Reference Include="UnityEngine.UnityTestProtocolModule">
195+
<HintPath>..\..\ThirdParty\UnityEngine.UnityTestProtocolModule.dll</HintPath>
196+
</Reference>
197+
<Reference Include="UnityEngine.UnityWebRequestAssetBundleModule">
198+
<HintPath>..\..\ThirdParty\UnityEngine.UnityWebRequestAssetBundleModule.dll</HintPath>
199+
</Reference>
200+
<Reference Include="UnityEngine.UnityWebRequestAudioModule">
201+
<HintPath>..\..\ThirdParty\UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
202+
</Reference>
203+
<Reference Include="UnityEngine.UnityWebRequestModule">
204+
<HintPath>..\..\ThirdParty\UnityEngine.UnityWebRequestModule.dll</HintPath>
205+
</Reference>
206+
<Reference Include="UnityEngine.UnityWebRequestTextureModule">
207+
<HintPath>..\..\ThirdParty\UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
208+
</Reference>
209+
<Reference Include="UnityEngine.UnityWebRequestWWWModule">
210+
<HintPath>..\..\ThirdParty\UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
211+
</Reference>
212+
<Reference Include="UnityEngine.VehiclesModule">
213+
<HintPath>..\..\ThirdParty\UnityEngine.VehiclesModule.dll</HintPath>
214+
</Reference>
215+
<Reference Include="UnityEngine.VFXModule">
216+
<HintPath>..\..\ThirdParty\UnityEngine.VFXModule.dll</HintPath>
217+
</Reference>
218+
<Reference Include="UnityEngine.VideoModule">
219+
<HintPath>..\..\ThirdParty\UnityEngine.VideoModule.dll</HintPath>
220+
</Reference>
221+
<Reference Include="UnityEngine.VRModule">
222+
<HintPath>..\..\ThirdParty\UnityEngine.VRModule.dll</HintPath>
223+
</Reference>
224+
<Reference Include="UnityEngine.WindModule">
225+
<HintPath>..\..\ThirdParty\UnityEngine.WindModule.dll</HintPath>
226+
</Reference>
227+
<Reference Include="UnityEngine.XRModule">
228+
<HintPath>..\..\ThirdParty\UnityEngine.XRModule.dll</HintPath>
229+
</Reference>
46230
</ItemGroup>
47231
<ItemGroup>
48232
<Compile Include="CachedFireCone.cs" />

0 commit comments

Comments
 (0)