Skip to content

Commit

Permalink
Merge pull request #9 from RimWorldCCLTeam/development
Browse files Browse the repository at this point in the history
Alpha 12 Release
  • Loading branch information
ForsakenShell committed Aug 23, 2015
2 parents 7a6188e + 38d3143 commit 7962933
Show file tree
Hide file tree
Showing 134 changed files with 4,002 additions and 2,461 deletions.
4 changes: 2 additions & 2 deletions CommunityCoreLibrary.sln
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ Global
$30.inheritsSet = VisualStudio
$30.inheritsScope = text/plain
$30.scope = text/plain
description = RimWorld Alpha 11 Community Core Library
version = 0.11.5
description = RimWorld Alpha 12 Community Core Library
version = 0.12.0
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
33 changes: 10 additions & 23 deletions DLL_Project/CommunityCoreLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<ReleaseVersion>0.11.5</ReleaseVersion>
<ReleaseVersion>0.12.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -47,6 +47,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Defs\MainTab_HelpMenuDef.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PlaceWorkers\PlaceWorker_OnlyUnderRoof.cs" />
<Compile Include="PlaceWorkers\PlaceWorker_WallAttachment.cs" />
Expand Down Expand Up @@ -76,10 +77,8 @@
<Compile Include="Alerts\Alert_NeedBatteries.cs" />
<Compile Include="Defs\HelpCategoryDef.cs" />
<Compile Include="Defs\HelpDef.cs" />
<Compile Include="OTabs\OTab_ModHelp.cs" />
<Compile Include="Defs\CCLVersionDef.cs" />
<Compile Include="MainTabs\MainTabWindow_ModHelp.cs" />
<Compile Include="ITabs\ModInit.cs" />
<Compile Include="MonoBehaviour\Controller.cs" />
<Compile Include="Commands\ChangeColor.cs" />
<Compile Include="Commands\DefOrThingCompInRoom.cs" />
<Compile Include="Commands\TouchingByThingComp.cs" />
Expand All @@ -89,7 +88,6 @@
<Compile Include="Enumerations\LowIdleDrawMode.cs" />
<Compile Include="Structures\ColorName.cs" />
<Compile Include="Structures\ResearchCompletePair.cs" />
<Compile Include="MapComponents\ResearchControl.cs" />
<Compile Include="Extensions\Thing_Extensions.cs" />
<Compile Include="Extensions\ThingComp_Extensions.cs" />
<Compile Include="Extensions\ThingDef_Extensions.cs" />
Expand All @@ -98,6 +96,12 @@
<Compile Include="CompProperties\RestrictedPlacement_Properties.cs" />
<Compile Include="ThingComps\RestrictedPlacement_Comp.cs" />
<Compile Include="ThingComps\CompHeatPusherPowered.cs" />
<Compile Include="MonoBehaviour\ModController.cs" />
<Compile Include="MapComponents\ResearchController.cs" />
<Compile Include="Defs\ModHelperDef.cs" />
<Compile Include="Structures\DesignatorData.cs" />
<Compile Include="Extensions\TerrainWithComps.cs" />
<Compile Include="Extensions\BuildableDef_Extensions.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 @@ -110,22 +114,5 @@
<ItemGroup />
<PropertyGroup>
</PropertyGroup>
<ItemGroup>
<Folder Include="PlaceWorkers\" />
<Folder Include="MapComponents\" />
<Folder Include="ThingComps\" />
<Folder Include="CompProperties\" />
<Folder Include="Toils\" />
<Folder Include="Buildings\" />
<Folder Include="Defs\" />
<Folder Include="StaticClasses\" />
<Folder Include="Commands\" />
<Folder Include="Alerts\" />
<Folder Include="OTabs\" />
<Folder Include="ITabs\" />
<Folder Include="MonoBehaviour\" />
<Folder Include="Enumerations\" />
<Folder Include="Structures\" />
<Folder Include="Extensions\" />
</ItemGroup>
<ItemGroup />
</Project>
2 changes: 1 addition & 1 deletion DLL_Project/CompProperties/CompProperties_LowIdleDraw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class CompProperties_LowIdleDraw : CompProperties

public float idlePowerFactor;
public LowIdleDrawMode operationalMode = LowIdleDrawMode.InUse;
public int cycleLowTicks = 30;
public int cycleLowTicks = -1;
public int cycleHighTicks = -1;

#endregion
Expand Down
108 changes: 106 additions & 2 deletions DLL_Project/CompProperties/RestrictedPlacement_Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,121 @@ public class RestrictedPlacement_Properties : CompProperties

#region XML Data

// Maximum count of a thing which may exist at any given time
public int MaxCount = -1;
public List< TerrainDef > RestrictedTerrain;
public List< ThingDef > RestrictedThing;

// These only apply to terrain restrictions, use them to auto-add
// Rough of Smooth stone terrain to the list of Restricted Terrain
// without having to list each one individually
public bool IncludeRoughStone;
public bool IncludeSmoothStone;

// List of terrain to filter by
public List< TerrainDef > terrainDefs;

// List of things to filter by
public List< ThingDef > thingDefs;

#endregion

[Unsaved]

#region Instance Data

List< TerrainDef > restrictedTerrain;
List< ThingDef > restrictedThing;

#endregion

#region Process State

public RestrictedPlacement_Properties()
{
compClass = typeof( RestrictedPlacement_Properties );
}

#endregion

#region Query State

public List< TerrainDef > RestrictedTerrain
{
get
{
if( restrictedTerrain == null )
{
// Create cache
restrictedTerrain = new List< TerrainDef >();

// Add xml defined terrain
if( ( terrainDefs != null )&&
( terrainDefs.Count > 0 ) )
{
restrictedTerrain.AddRange( terrainDefs );
}

// Now check for auto-adds
if( IncludeRoughStone )
{
var roughStone = DefDatabase<TerrainDef>.AllDefsListForReading
.FindAll( t =>
( t.defName.Contains( "_Rough" ) )
);
if( ( roughStone != null )&&
( roughStone.Count > 0 ) )
{
restrictedTerrain.AddRange( roughStone );
}
}

if( IncludeSmoothStone )
{
var smoothStone = DefDatabase<TerrainDef>.AllDefsListForReading
.FindAll( t =>
( t.defName.Contains( "_Smooth" ) )
);
if( ( smoothStone != null )&&
( smoothStone.Count > 0 ) )
{
restrictedTerrain.AddRange( smoothStone );
}
}

#if DEBUG
if( ( restrictedTerrain == null )||
( restrictedTerrain.Count == 0 ) )
{
Log.Error( "Community Core Library :: Restricted Placement Properties :: Restricted terrain comp used with no terrainDefs!" );
}
#endif

}
return restrictedTerrain;
}
}

public List< ThingDef > RestrictedThing
{
get
{
if( restrictedThing == null )
{
// Create cache
restrictedThing = new List< ThingDef >();

// Add xml defined things
if( ( thingDefs != null )&&
( thingDefs.Count > 0 ) )
{
restrictedThing.AddRange( thingDefs );
}
}
return restrictedThing;
}
}

#endregion

}

}
Loading

0 comments on commit 7962933

Please sign in to comment.