Skip to content

Commit

Permalink
Merge branch 'Dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxxa committed Feb 24, 2020
2 parents 6039b12 + 8944ae9 commit 5d7e8bb
Show file tree
Hide file tree
Showing 26 changed files with 425 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -12,3 +12,5 @@

Source/.vs/ED-Embrasures/v15/Server/sqlite3/
Source/.vs/ED-Embrasures/DesignTimeBuild/.dtbcache
**/.vs/
ED-Embrasures/1.1/Assemblies/0Harmony.xml
21 changes: 21 additions & 0 deletions ED-Embrasures/1.1/Defs/ThingDefs/Buildings_Embrasure.xml
@@ -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>
@@ -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>
@@ -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>
8 changes: 6 additions & 2 deletions ED-Embrasures/About/About.xml
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>ED-Embrasures</name>
<targetVersion>1.0.2059</targetVersion>
<packageId>Jaxxa.ED.Embrasures</packageId>
<supportedVersions>
<li>1.0</li>
<li>1.1</li>
</supportedVersions>
<author>Jaxxa</author>
<url>https://github.com/jaxxa/JaxxaRimworldReleaseCollection/blob/master/README.md</url>
<description>Version: 1.0.0.0
<description>Version: 2.0.0.0
Links to all my mods including non steam versions available at: https://github.com/jaxxa/JaxxaRimworldReleaseCollection/blob/master/README.md

Adds embrasures for that can be shot through, while blocking passage, giving your colonists an advantage in combat.
Expand Down
15 changes: 0 additions & 15 deletions ED-Embrasures/About/Manifest.xml

This file was deleted.

14 changes: 0 additions & 14 deletions ED-Embrasures/About/ModSync.xml

This file was deleted.

3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,9 @@ A mod for the Game Rimworld

#Change Log

2.0.0.0
* Updating to Rimworld 1.0 and 1.1

1.0.0.0
* Updating to Rimworld 1.0

Expand Down
Expand Up @@ -17,15 +17,15 @@
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\ED-Embrasures\Assemblies\</OutputPath>
<OutputPath>..\..\ED-Embrasures\1.0\Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\ED-Embrasures\Assemblies\</OutputPath>
<OutputPath>..\..\ED-Embrasures\1.0\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -35,7 +35,7 @@
<HintPath>..\..\..\..\RW-DLL\Harmony\1.2.0.1\Release\net35\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\RW-DLL\1.0\2059\Assembly-CSharp.dll</HintPath>
<HintPath>..\..\..\..\RW-DLL\1.0\2408\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
Expand All @@ -45,7 +45,7 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\RW-DLL\1.0\2059\UnityEngine.dll</HintPath>
<HintPath>..\..\..\..\RW-DLL\1.0\2408\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
83 changes: 83 additions & 0 deletions Source/1.1/ED-Embrasures_1.1.csproj
@@ -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>
50 changes: 50 additions & 0 deletions Source/1.1/Patch.cs
@@ -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
}
33 changes: 33 additions & 0 deletions Source/1.1/Patch_EmbrasureDef.cs
@@ -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;
}
}
}
52 changes: 52 additions & 0 deletions Source/1.1/Patcher.cs
@@ -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.");
}
}

}

}

0 comments on commit 5d7e8bb

Please sign in to comment.