Skip to content

Commit

Permalink
Merge pull request #164 from RimWorldCCLTeam/development
Browse files Browse the repository at this point in the history
v0.14.3 - I'm Too Tired To Be Clever
  • Loading branch information
ForsakenShell authored Aug 23, 2016
2 parents fc2e84d + d70bd19 commit 3c04f18
Show file tree
Hide file tree
Showing 151 changed files with 3,569 additions and 777 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
*.userprefs
*.sln.docstates
DLL_Project/bin/*.dll
DLL_Project/*.bat
DLL_Project/CCLModTweaks/bin/*.dll
*.bat

# Build results
[Dd]ebug/
Expand Down
8 changes: 8 additions & 0 deletions CommunityCoreLibrary.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 12.0.30110.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityCoreLibrary", "DLL_Project\CommunityCoreLibrary.csproj", "{A36BEEB2-7379-475B-B537-827E34571962}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CCLModTweaks", "DLL_Project\CCLModTweaks\CCLModTweaks.csproj", "{1F8C3C2D-E04E-4475-A20A-FE69CB96FB29}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -18,6 +20,12 @@ Global
{A36BEEB2-7379-475B-B537-827E34571962}.Developer|Any CPU.Build.0 = Developer|Any CPU
{A36BEEB2-7379-475B-B537-827E34571962}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A36BEEB2-7379-475B-B537-827E34571962}.Release|Any CPU.Build.0 = Release|Any CPU
{1F8C3C2D-E04E-4475-A20A-FE69CB96FB29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F8C3C2D-E04E-4475-A20A-FE69CB96FB29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F8C3C2D-E04E-4475-A20A-FE69CB96FB29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F8C3C2D-E04E-4475-A20A-FE69CB96FB29}.Release|Any CPU.Build.0 = Release|Any CPU
{1F8C3C2D-E04E-4475-A20A-FE69CB96FB29}.Developer|Any CPU.ActiveCfg = Debug|Any CPU
{1F8C3C2D-E04E-4475-A20A-FE69CB96FB29}.Developer|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
BaseDirectory = DLL_Project
Expand Down
63 changes: 63 additions & 0 deletions DLL_Project/CCLModTweaks/CCLModTweaks.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1F8C3C2D-E04E-4475-A20A-FE69CB96FB29}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>CCLModTweaks</RootNamespace>
<AssemblyName>CCLModTweaks</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ReleaseVersion>0.14.0</ReleaseVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Community Core Library">
<HintPath>..\bin\Community Core Library.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\bin\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\bin\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="DefInjectionQualifiers\WorkTableCompPowerLowIdleDrawTickerChangerQualifier.cs" />
<Compile Include="DefInjectionQualifiers\WorkTableCompPowerLowIdleDrawCompAdderQualifier.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="DefInjectionQualifiers\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>call "$(ProjectDir)PostBuild.bat" $(ConfigurationName) "$(TargetPath)" $(SolutionDir)</PostBuildEvent>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;

using CommunityCoreLibrary;
using RimWorld;
using Verse;

namespace CCLModTweaks
{

public class WorkTableCompPowerLowIdleDrawCompAdderQualifier : DefInjectionQualifier
{

public override bool Test( Def def )
{
var thingDef = def as ThingDef;
if( thingDef == null )
{
return false;
}
if(
( thingDef.thingClass != typeof( Building_WorkTable ) )&&
( thingDef.thingClass != typeof( Building_WorkTable_HeatPush ) )
)
{
return false;
}
if( !thingDef.HasComp( typeof( CompPowerTrader ) ) )
{
return false;
}
if( thingDef.HasComp( typeof( CompPowerLowIdleDraw) ) )
{
return false;
}
return true;
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;

using CommunityCoreLibrary;
using RimWorld;
using Verse;

namespace CCLModTweaks
{

public class WorkTableCompPowerLowIdleDrawTickerChangerQualifier : DefInjectionQualifier
{

public override bool Test( Def def )
{
var thingDef = def as ThingDef;
if( thingDef == null )
{
return false;
}
if(
( thingDef.thingClass != typeof( Building_WorkTable ) )&&
( thingDef.thingClass != typeof( Building_WorkTable_HeatPush ) )
)
{
return false;
}
if( !thingDef.HasComp( typeof( CompPowerTrader ) ) )
{
return false;
}
if( !thingDef.HasComp( typeof( CompPowerLowIdleDraw) ) )
{
return false;
}
if( thingDef.tickerType != TickerType.Never )
{
return false;
}
return true;
}

}
}
41 changes: 41 additions & 0 deletions DLL_Project/CCLModTweaks/PostBuild.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
REM Copy this file to "PostBuild.bat"
REM This is a local file copy after build. Get it once and your .gitignore
REM should handle it after that. Make all your local copies at the end.

REM Set this to your local RimWorld install path and CCL Mod Tweaks Assemblies directory
REM Example:
REM Set InstalledCCLAssemblies="C:\Games\Steam\steamapps\common\RimWorld\Mods\Community Core Library - Mod Tweaks\Assemblies"
Set InstalledCCLAssemblies="/badkarma/"

if NOT EXIST %InstalledCCLAssemblies% (
echo Missing or invalid copy target:
echo %InstalledCCLAssemblies%
EXIT -1
)

echo Build Config: %1
echo Build Target: %2
echo Solution Path: %3
echo CCL Install Path: %InstalledCCLAssemblies%

del "%3DLL_Project\CCLModTweaks\bin\CCLModTweaks.pdb"

echo Copy to RimWorld

copy %2 %InstalledCCLAssemblies%

if %1 == Release (
echo Copy to User Release
copy %2 "%3_Mod\User Release\Community Core Library - Mod Tweaks\Assemblies"
) else (
echo Copy to Modders Resource
copy %2 "%3_Mod\Modders Resource\Community Core Library - Mod Tweaks\Assemblies"
)

REM Add any other local copies here
REM See example below

rem echo Copy to ModPile
rem copy %2 "C:\Utils\dev\Projects\ModPile\Source-DLLs"

:Finished
18 changes: 18 additions & 0 deletions DLL_Project/CCLModTweaks/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Reflection;
using System.Runtime.CompilerServices;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle( "CCLModTweaks" )]
[assembly: AssemblyCompany("RimWorldCCLTeam")]
[assembly: AssemblyProduct("CCLModTweaks")]
[assembly: AssemblyCopyright("The Unlicense")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("0.14.0")]
[assembly: AssemblyFileVersion("0.14.0")]

35 changes: 35 additions & 0 deletions DLL_Project/Classes/Abstract/DefInjectionQualifier.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;

using RimWorld;
using Verse;

namespace CommunityCoreLibrary
{

public abstract class DefInjectionQualifier
{
public abstract bool Test( Def def );

public static List<ThingDef> FilteredThingDefs( Type qualifier, ref DefInjectionQualifier qualifierInt, List<string> targetDefs )
{
if( !targetDefs.NullOrEmpty() )
{
return DefDatabase<ThingDef>.AllDefs.Where( def => targetDefs.Contains( def.defName ) ).ToList();
}
if( qualifierInt == null )
{
qualifierInt = (DefInjectionQualifier) Activator.CreateInstance( qualifier );
if( qualifierInt == null )
{
return null;
}
}
return DefDatabase<ThingDef>.AllDefs.Where( qualifierInt.Test ).ToList();
}

}

}

15 changes: 15 additions & 0 deletions DLL_Project/Classes/Abstract/ToggleSetting.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;

using Verse;

namespace CommunityCoreLibrary
{

public abstract class ToggleSetting
{

public abstract bool Value{ get; set; }

}

}
2 changes: 1 addition & 1 deletion DLL_Project/Classes/Static/XML_Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityCoreLibrary
public static class XML_Helper
{

// TODO: Move this method to an extension class (question, under what though?)
// TODO: Remove this as Scribe.EnterNode returns a bool and does the same job
public static bool HasChildNode( this XmlNode xmlNode, string childNode )
{
var xmlEnumerator = xmlNode.ChildNodes.GetEnumerator();
Expand Down
21 changes: 20 additions & 1 deletion DLL_Project/CommunityCoreLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
<Compile Include="Interfaces\IInjector.cs" />
<Compile Include="Defs\ModHelperDef\Facilities.cs" />
<Compile Include="Structures\StockGeneratorInjectionSet.cs" />
<Compile Include="Defs\ModHelperDef\TraderKinds.cs" />
<Compile Include="Defs\ModHelperDef\StockGenerators.cs" />
<Compile Include="Detours\MainMenuDrawer.cs" />
<Compile Include="Windows\Window_ModConfigurationMenu.cs" />
<Compile Include="Extensions\GenTemperature_Extensions.cs" />
Expand Down Expand Up @@ -293,6 +293,24 @@
<Compile Include="ThinkNodes\ThinkNode_PrioritySorter_SubtreesByTag.cs" />
<Compile Include="Detours\Pawn_RelationsTracker.cs" />
<Compile Include="Detours\VersionControl.cs" />
<Compile Include="Detours\Toils_Ingest.cs" />
<Compile Include="Structures\ITabInjectionSet.cs" />
<Compile Include="Defs\ModHelperDef\ITabInjectors.cs" />
<Compile Include="Classes\Abstract\DefInjectionQualifier.cs" />
<Compile Include="MiniMapOverlays\MiniMapOverlay_PlanningTool.cs" />
<Compile Include="MiniMapOverlays\MiniMapOverlay_Mining.cs" />
<Compile Include="Defs\ToggleSettingDef.cs" />
<Compile Include="Classes\Abstract\ToggleSetting.cs" />
<Compile Include="ToggleSettings\ToggleSetting_ShowZones.cs" />
<Compile Include="Detours\PlaySettings.cs" />
<Compile Include="ToggleSettings\ToggleSetting_ShowBeauty.cs" />
<Compile Include="ToggleSettings\ToggleSetting_AutoHomeArea.cs" />
<Compile Include="ToggleSettings\ToggleSetting_ShowColonistBar.cs" />
<Compile Include="ToggleSettings\ToggleSetting_ShowRoomStats.cs" />
<Compile Include="ToggleSettings\ToggleSetting_UseWorkPriorities.cs" />
<Compile Include="ToggleSettings\ToggleSetting_ResourceReadoutCategorized.cs" />
<Compile Include="ToggleSettings\ToggleSetting_ShowMiniMap.cs" />
<Compile Include="MainMenus\MainMenu_QuickStart.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand All @@ -312,5 +330,6 @@
<ItemGroup />
<ItemGroup>
<Folder Include="ThinkNodes\" />
<Folder Include="ToggleSettings\" />
</ItemGroup>
</Project>
22 changes: 22 additions & 0 deletions DLL_Project/Defs/BackstoryDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class BackstoryDef : Def
public List<WorkTags> workDisables = new List<WorkTags>();
public List<BackstoryDefSkillListItem> skillGains = new List<BackstoryDefSkillListItem>();
public List<string> spawnCategories = new List<string>();
public List<TraitEntry> forcedTraits = new List<TraitEntry>();
public List<TraitEntry> disallowedTraits = new List<TraitEntry>();
public string saveKeyIdentifier;

#endregion
Expand Down Expand Up @@ -99,6 +101,26 @@ public override void ResolveReferences()
}
b.skillGains = skillGains.ToDictionary(i => i.defName, i => i.amount);

if( forcedTraits.Count > 0 )
{
b.forcedTraits = new List<TraitEntry>();
foreach( var trait in forcedTraits )
{
var newTrait = new TraitEntry( trait.def, trait.degree );
b.forcedTraits.Add( newTrait );
}
}

if( disallowedTraits.Count > 0 )
{
b.disallowedTraits = new List<TraitEntry>();
foreach( var trait in disallowedTraits )
{
var newTrait = new TraitEntry( trait.def, trait.degree );
b.disallowedTraits.Add( newTrait );
}
}

b.ResolveReferences();
b.PostLoad();
b.uniqueSaveKey = this.UniqueSaveKey();
Expand Down
Loading

0 comments on commit 3c04f18

Please sign in to comment.