Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
425 additions
and
38 deletions.
There are no files selected for viewing
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Defs> | ||
|
||
<!--Embrasure from ED-Embrasure --> | ||
<ThingDef Name="ED_Embrasure" ParentName="Wall"> | ||
<defName>ED_Embrasure</defName> | ||
<label>Embrasure</label> | ||
<description>An opening in the metal wall allows shooting and throwing grenades from the safety of your home.</description> | ||
<costStuffCount>15</costStuffCount> | ||
<statBases> | ||
<WorkToBuild>600</WorkToBuild> | ||
</statBases> | ||
<fillPercent>0.70</fillPercent> | ||
<uiIconPath>UI/ED-Embrasures</uiIconPath> | ||
<graphicData> | ||
<texPath>Things/Building/Linked/Embrasure</texPath> | ||
<graphicClass>Graphic_Appearances</graphicClass> | ||
</graphicData> | ||
</ThingDef> | ||
|
||
</Defs> |
20 changes: 20 additions & 0 deletions
20
ED-Embrasures/1.1/Languages/ChineseSimplified/DefInjected/ThingDef/Buildings_Embrasure.xml
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LanguageData> | ||
|
||
<!-- Wall definition from the Base Game, but made Abstract. --> | ||
|
||
<!--[Core] <Wall.label>墙</Wall.label>--> | ||
<!--[Core] <Wall.description>一面无法通过的墙。可以支撑起屋顶。</Wall.description>--> | ||
<!--[Core] <Wall_Blueprint.label>墙(蓝图)</Wall_Blueprint.label>--> | ||
<!--[Core] <Wall_Frame.label>墙(建造中)</Wall_Frame.label>--> | ||
|
||
|
||
<!-- Embrasure from ED-Embrasure --> | ||
|
||
<Embrasure.label>御敌墙</Embrasure.label> | ||
<Embrasure.description>通过墙上的枪洞在家安全地射击敌人和投掷手榴弹。</Embrasure.description> | ||
<Embrasure_Blueprint.label>御敌墙(蓝图)</Embrasure_Blueprint.label> | ||
<Embrasure_Frame.label>御敌墙(建造中)</Embrasure_Frame.label> | ||
|
||
|
||
</LanguageData> |
10 changes: 10 additions & 0 deletions
10
ED-Embrasures/1.1/Languages/Korean/DefInjected/ThingDefs/Buildings_Embrasure.xml
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LanguageData> | ||
|
||
<!--<Wall.label>벽</Wall.label> --> | ||
<!--<Wall.description>An impassable wall. Capable of holding up a roof.</Wall.description> --> | ||
|
||
<Embrasure.label>총안구</Embrasure.label> | ||
<Embrasure.description>An opening in the metal wall allows shooting and throwing grenades from the safety of your home.</Embrasure.description> | ||
|
||
</LanguageData> |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{D88CE886-7F4A-4CC2-BAEF-5851B24BC19C}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>EnhancedDevelopment.Embrasures</RootNamespace> | ||
<AssemblyName>ED-Embrasures</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>false</DebugSymbols> | ||
<DebugType>none</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>..\..\ED-Embrasures\1.1\Assemblies\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<Prefer32Bit>false</Prefer32Bit> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>none</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>..\..\ED-Embrasures\1.1\Assemblies\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<Prefer32Bit>false</Prefer32Bit> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="0Harmony"> | ||
<HintPath>..\..\..\..\RW-DLL\Harmony\~Release 4.7.2\0Harmony.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Assembly-CSharp"> | ||
<HintPath>..\..\..\..\RW-DLL\1.1\Assembly-CSharp.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="UnityEngine"> | ||
<HintPath>..\..\..\..\RW-DLL\1.1\UnityEngine.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="UnityEngine.CoreModule"> | ||
<HintPath>..\..\..\..\RW-DLL\1.1\UnityEngine.CoreModule.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="UnityEngine.IMGUIModule"> | ||
<HintPath>..\..\..\..\RW-DLL\1.1\UnityEngine.IMGUIModule.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="UnityEngine.TextRenderingModule"> | ||
<HintPath>..\..\..\..\RW-DLL\1.1\UnityEngine.TextRenderingModule.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Patch.cs" /> | ||
<Compile Include="Patcher.cs" /> | ||
<Compile Include="Patch_EmbrasureDef.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Settings\ModSettings_Embrasures.cs" /> | ||
<Compile Include="Settings\Mod_Embrasures.cs" /> | ||
</ItemGroup> | ||
<ItemGroup /> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using HarmonyLib; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Verse; | ||
|
||
namespace EnhancedDevelopment.Embrasures | ||
{ | ||
abstract class Patch | ||
{ | ||
/// <summary> | ||
/// Checks if this Patch should be applied now. | ||
/// </summary> | ||
/// <returns>Returns true if the Patch should be applied.</returns> | ||
protected abstract bool ShouldPatchApply(); | ||
|
||
/// <summary> | ||
/// Apply the patch. | ||
/// </summary> | ||
protected abstract void ApplyPatch(Harmony harmony = null); | ||
|
||
/// <summary> | ||
/// The Description of this patch. | ||
/// Mainly used for logging. | ||
/// </summary> | ||
/// <returns>The Patch Description.</returns> | ||
protected abstract string PatchDescription(); | ||
|
||
/// <summary> | ||
/// Checks if this Patch needs to be applied, and applies if needed. | ||
/// </summary> | ||
public void ApplyPatchIfRequired(Harmony harmony = null) | ||
{ | ||
string _LogLocation = "EnhancedDevelopment.Embrasures.ApplyPatchIfRequired: "; | ||
|
||
if (this.ShouldPatchApply()) | ||
{ | ||
Log.Message(_LogLocation + "Applying Patch: " + this.PatchDescription()); | ||
this.ApplyPatch(harmony); | ||
Log.Message(_LogLocation + "Applied Patch: " + this.PatchDescription()); | ||
} | ||
else | ||
{ | ||
Log.Message(_LogLocation + "Skipping Applying Patch: " + this.PatchDescription()); | ||
} | ||
} | ||
|
||
} //PAtch | ||
} |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using EnhancedDevelopment.Embrasures.Settings; | ||
using HarmonyLib; | ||
using RimWorld; | ||
using Verse; | ||
|
||
namespace EnhancedDevelopment.Embrasures | ||
{ | ||
class Patch_EmbrasureDef : Patch | ||
{ | ||
protected override void ApplyPatch(Harmony harmony = null) | ||
{ | ||
ThingDef _EmbrasureDef = ThingDef.Named("ED_Embrasure"); | ||
|
||
_EmbrasureDef.fillPercent = (float)(Mod_Embrasures.Settings.FillPercent)/100f; | ||
|
||
_EmbrasureDef.costStuffCount = Mod_Embrasures.Settings.StuffCost; | ||
} | ||
|
||
protected override string PatchDescription() | ||
{ | ||
return "Embrasures"; | ||
} | ||
|
||
protected override bool ShouldPatchApply() | ||
{ | ||
return Mod_Embrasures.Settings.ChangesEnabled; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Verse; | ||
using HarmonyLib; | ||
|
||
namespace EnhancedDevelopment.Embrasures | ||
{ | ||
[StaticConstructorOnStartup] | ||
internal class Patcher | ||
{ | ||
static Patcher() | ||
{ | ||
string _LogLocation = "EnhancedDevelopment.Embrasures.Patcher(): "; | ||
|
||
Log.Message(_LogLocation + "Starting."); | ||
|
||
//Create List of Patches | ||
List<Patch> _Patches = new List<Patch>(); | ||
_Patches.Add(new Patch_EmbrasureDef()); | ||
|
||
//Create Harmony Instance | ||
Harmony _Harmony = new Harmony("EnhancedDevelopment.Embrasures"); | ||
|
||
//Iterate Patches | ||
_Patches.ForEach(p => p.ApplyPatchIfRequired(_Harmony)); | ||
|
||
Log.Message(_LogLocation + "Complete."); | ||
} | ||
|
||
/// <summary> | ||
/// Debug Logging Helper | ||
/// </summary> | ||
/// <param name="objectToTest"></param> | ||
/// <param name="name"></param> | ||
/// <param name="logSucess"></param> | ||
public static void LogNULL(object objectToTest, String name, bool logSucess = false) | ||
{ | ||
if (objectToTest == null) | ||
{ | ||
Log.Error(name + " Is NULL."); | ||
} | ||
else if (logSucess) | ||
{ | ||
Log.Message(name + " Is Not NULL."); | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.