Skip to content

Commit

Permalink
Update to 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Herigony committed Mar 9, 2020
1 parent c401df1 commit e9d23e8
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 10 deletions.
File renamed without changes.
2 changes: 2 additions & 0 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<author>Herigony</author>
<supportedVersions>
<li>1.0</li>
<li>1.1</li>
</supportedVersions>
<packageId>Herigony.MapEditTools</packageId>
<description>Adds new tools that make editing the map easier.
To use, just open Architect -> MapTools
Tools:
Expand Down
8 changes: 8 additions & 0 deletions About/LoadFolders.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<loadFolders>
<v1.1>
<li>1.1</li>
<li>Common</li>
<li>/</li>
</v1.1>
</loadFolders>
19 changes: 19 additions & 0 deletions Common/Defs/DesignationCategories.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>

<DesignationCategoryDef>
<defName>MapEdit</defName>
<label>mapEdit</label>
<order>0</order>
<specialDesignatorClasses>
<li>Designator_Cancel</li>
<li>Designator_Deconstruct</li>
<li>MapEditTools.Designator_BuildRoof</li>
<li>MapEditTools.Designator_RemoveRoof</li>
<li>MapEditTools.Designator_SetTerrain</li>
<li>MapEditTools.Designator_SmoothSurface</li>
<li>MapEditTools.Designator_AddFog</li>
<li>MapEditTools.Designator_RemoveFog</li>
</specialDesignatorClasses>
</DesignationCategoryDef>
</Defs>
6 changes: 6 additions & 0 deletions Languages/English/Keyed/MapEditTools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@
<MapEditTools.DesignatorSetTerrain>Set Terrain</MapEditTools.DesignatorSetTerrain>
<MapEditTools.DesignatorSetTerrainDesc>Set the terrain.</MapEditTools.DesignatorSetTerrainDesc>

<MapEditTools.DesignatorAddFog>Add Fog</MapEditTools.DesignatorAddFog>
<MapEditTools.DesignatorAddFogDesc>Add fog on the map.</MapEditTools.DesignatorAddFogDesc>

<MapEditTools.DesignatorRemoveFog>Remove Fog</MapEditTools.DesignatorRemoveFog>
<MapEditTools.DesignatorRemoveFogDesc>Remove fog on the map.</MapEditTools.DesignatorRemoveFogDesc>

</LanguageData>
4 changes: 2 additions & 2 deletions Source/FloorEdit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class Designator_SetTerrain : MapEditDesignator

public Designator_SetTerrain() : base()
{
this.defaultLabel = "MapEditTools.DesignatorSetTerrain".Translate();
this.defaultDesc = "MapEditTools.DesignatorSetTerrainDesc".Translate();
this.defaultLabel = "MapEditTools.DesignatorSetTerrain".Translate().Resolve();
this.defaultDesc = "MapEditTools.DesignatorSetTerrainDesc".Translate().Resolve();
}

public override void DesignateSingleCell(IntVec3 c)
Expand Down
47 changes: 47 additions & 0 deletions Source/FogEdit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Verse;

namespace MapEditTools
{
class Designator_AddFog : MapEditDesignator
{
public Designator_AddFog() : base()
{
this.defaultLabel = "MapEditTools.DesignatorAddFog".Translate().Resolve();
this.defaultDesc = "MapEditTools.DesignatorAddFogDesc".Translate().Resolve();
}

public override AcceptanceReport CanDesignateCell(IntVec3 loc)
{
return !Map.fogGrid.IsFogged(loc);
}

public override void DesignateSingleCell(IntVec3 c)
{
Map.fogGrid.fogGrid[Map.cellIndices.CellToIndex(c)] = true;
Map.mapDrawer.MapMeshDirty(c, MapMeshFlag.FogOfWar);
}
}

class Designator_RemoveFog : MapEditDesignator
{
public Designator_RemoveFog() : base()
{
this.defaultLabel = "MapEditTools.DesignatorRemoveFog".Translate().Resolve();
this.defaultDesc = "MapEditTools.DesignatorRemoveFogDesc".Translate().Resolve();
}

public override AcceptanceReport CanDesignateCell(IntVec3 loc)
{
return Map.fogGrid.IsFogged(loc);
}

public override void DesignateSingleCell(IntVec3 c)
{
Map.fogGrid.Unfog(c);
}
}
}
16 changes: 14 additions & 2 deletions Source/MapEditTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MapEditTools</RootNamespace>
<AssemblyName>MapEditTools</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>false</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -22,14 +23,16 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>false</RunCodeAnalysis>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Assemblies\</OutputPath>
<OutputPath>..\1.1\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
Expand All @@ -46,9 +49,18 @@
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="FloorEdit.cs" />
<Compile Include="FogEdit.cs" />
<Compile Include="MapEditDesignator.cs" />
<Compile Include="MapEditTools.cs" />
<Compile Include="RoofEdit.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.1.0")]
[assembly: AssemblyVersion("1.2.0.0")]
8 changes: 4 additions & 4 deletions Source/RoofEdit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public class Designator_BuildRoof : Designator_SetRoof
{
public Designator_BuildRoof() : base()
{
this.defaultLabel = "MapEditTools.DesignatorBuildRoof".Translate();
this.defaultDesc = "MapEditTools.DesignatorBuildRoofDesc".Translate();
this.defaultLabel = "MapEditTools.DesignatorBuildRoof".Translate().Resolve();
this.defaultDesc = "MapEditTools.DesignatorBuildRoofDesc".Translate().Resolve();
this.icon = ContentFinder<Texture2D>.Get("UI/Designators/BuildRoofArea");
}

Expand Down Expand Up @@ -63,8 +63,8 @@ public class Designator_RemoveRoof : Designator_SetRoof
{
public Designator_RemoveRoof() : base()
{
this.defaultLabel = "MapEditTools.DesignatorRemoveRoof".Translate();
this.defaultDesc = "MapEditTools.DesignatorRemoveRoofDesc".Translate();
this.defaultLabel = "MapEditTools.DesignatorRemoveRoof".Translate().Resolve();
this.defaultDesc = "MapEditTools.DesignatorRemoveRoofDesc".Translate().Resolve();
this.icon = ContentFinder<Texture2D>.Get("UI/Designators/NoRoofArea");
this.soundSucceeded = SoundDefOf.Designate_Deconstruct;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/SmoothTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public Designator_SmoothSurface() : base() { }
public override AcceptanceReport CanDesignateCell(IntVec3 c)
{
AcceptanceReport report = base.CanDesignateCell(c);
if (report.Accepted || report.Reason == "SurfaceBeingSmoothed".Translate() || report.Reason == "TooCloseToMapEdge".Translate())
if (report.Accepted || report.Reason == "SurfaceBeingSmoothed".Translate().Resolve() || report.Reason == "TooCloseToMapEdge".Translate().Resolve())
return true;
return report;
}
Expand Down

0 comments on commit e9d23e8

Please # to comment.