Skip to content

Commit

Permalink
Ported to 1.1 (#11)
Browse files Browse the repository at this point in the history
* Ported to 1.1 (minimum)
  Changed .NET Framework version (3.5 -> 4.7.2);
  Adapted methods and property;
  Updated About.xml.

* Multiple version support
  • Loading branch information
AirDeeEx authored Apr 3, 2020
1 parent a6bec48 commit 53147fe
Show file tree
Hide file tree
Showing 24 changed files with 79 additions and 26 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
################################################################################
# Данный GITIGNORE-файл был автоматически создан Microsoft(R) Visual Studio.
################################################################################

/.vs
File renamed without changes.
26 changes: 13 additions & 13 deletions RuntimeGC/Defs/MainButton.xml → RuntimeGC/1.0/Defs/MainButton.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<MainButtonDef>
<defName>RGC_UI</defName>
<label>RuntimeGC</label>
<description>No_Need_To_Translate_This_File_Because_This_Text_Is_Replaced_In_Dll</description>
<tabWindowClass>RuntimeGC.UserInterface</tabWindowClass>
<workerClass>RuntimeGC.MainButtonWorker_RuntimeGC</workerClass>
<order>177</order>
<!--<defaultHotKey>F12</defaultHotKey>-->
<validWithoutMap>true</validWithoutMap>
</MainButtonDef>
</Defs>
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<MainButtonDef>
<defName>RGC_UI</defName>
<label>RuntimeGC</label>
<description>No_Need_To_Translate_This_File_Because_This_Text_Is_Replaced_In_Dll</description>
<tabWindowClass>RuntimeGC.UserInterface</tabWindowClass>
<workerClass>RuntimeGC.MainButtonWorker_RuntimeGC</workerClass>
<order>177</order>
<!--<defaultHotKey>F12</defaultHotKey>-->
<validWithoutMap>true</validWithoutMap>
</MainButtonDef>
</Defs>
Binary file added RuntimeGC/1.1/Assemblies/RuntimeGC.dll
Binary file not shown.
13 changes: 13 additions & 0 deletions RuntimeGC/1.1/Defs/MainButton.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<MainButtonDef>
<defName>RGC_UI</defName>
<label>RuntimeGC</label>
<description>No_Need_To_Translate_This_File_Because_This_Text_Is_Replaced_In_Dll</description>
<tabWindowClass>RuntimeGC.UserInterface</tabWindowClass>
<workerClass>RuntimeGC.MainButtonWorker_RuntimeGC</workerClass>
<order>177</order>
<!--<defaultHotKey>F12</defaultHotKey>-->
<validWithoutMap>true</validWithoutMap>
</MainButtonDef>
</Defs>
6 changes: 5 additions & 1 deletion RuntimeGC/About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
<ModMetaData>
<name>RuntimeGC</name>
<author>user19990313</author>
<packageId>user19990313.RuntimeGC</packageId>
<url>https://ludeon.com/forums/index.php?topic=46581.0</url>
<targetVersion>1.0.2059</targetVersion>
<supportedVersions>
<li>1.0</li>
<li>1.1</li>
</supportedVersions>
<description>

&lt;size=20&gt;RuntimeGC In-Game Cleaner&lt;/size&gt;
Expand Down
9 changes: 9 additions & 0 deletions RuntimeGC/Folders.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<loadFolders>
<v1.0>
<li>Common</li>
</v1.0>
<v1.1>
<li>Common</li>
<li>1.1</li>
</v1.1>
</loadFolders>
Binary file added src/RuntimeGC/.vs/RuntimeGC/v16/.suo
Binary file not shown.
Binary file modified src/RuntimeGC/Release/RuntimeGC.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions src/RuntimeGC/RuntimeGC/RuntimeGC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class RuntimeGC:Mod

public RuntimeGC(ModContentPack pack) : base(pack)
{
Settings = LoadedModManager.ReadModSettings<RuntimeGCSettings>(Content.Identifier, this.GetType().Name);
Settings = LoadedModManager.ReadModSettings<RuntimeGCSettings>(Content.PackageId, this.GetType().Name);
Toolbox.Launcher.Launch(Settings.AutoCleanModMetaData, Settings.AutoCleanLanguageData, Settings.AutoCleanDefPackage);
Mute.Launcher.Launch(Settings.DoMuteGC, Settings.DoMuteBL);
Verse.Log.Message("[RuntimeGC] Mod settings loaded.");
Expand All @@ -19,7 +19,7 @@ public RuntimeGC(ModContentPack pack) : base(pack)
public override void WriteSettings()
{
Settings.UpdateCache();
LoadedModManager.WriteModSettings(Content.Identifier, "RuntimeGC", Settings);
LoadedModManager.WriteModSettings(Content.PackageId, "RuntimeGC", Settings);
if (Settings.RequiresRestart())
{
Find.WindowStack.Add(Dialog_MessageBox.CreateConfirmation("DlgTextRestartRequest".Translate(), delegate
Expand Down
18 changes: 15 additions & 3 deletions src/RuntimeGC/RuntimeGC/RuntimeGC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RuntimeGC</RootNamespace>
<AssemblyName>RuntimeGC</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -22,6 +22,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -31,11 +32,13 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=1.0.6774.31363, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\_dependency_\2059\x64\Assembly-CSharp.dll</HintPath>
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -46,7 +49,16 @@
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\_dependency_\2059\x64\UnityEngine.dll</HintPath>
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/RuntimeGC/RuntimeGC/Toolbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void CleanModMetaData()
else
{
s2.AppendWithComma(list[i].Name);
list[i].previewImage = new Texture2D(0, 0);
list[i].UnsetPreviewImage();
b++;
}
}
Expand Down Expand Up @@ -89,8 +89,8 @@ public static void CleanDefPackage()
foreach (ModContentPack pack in LoadedModManager.RunningMods)
{
if (pack.IsCoreMod) coreMod = pack;
a += ((List<DefPackage>)defPackages.GetValue(pack)).Count;
defPackages.SetValue(pack, new List<DefPackage>());
a += ((List<Def>)defPackages.GetValue(pack)).Count;
defPackages.SetValue(pack, new List<Def>());
}

Verse.Log.Message("[DefPackageCleaner] Cleaned " + a + " DefPackages.");
Expand Down
4 changes: 2 additions & 2 deletions src/RuntimeGC/RuntimeGC/UserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public override void DoWindowContents(Rect canvas)
Text.Font = GameFont.Medium;
std.Label("RuntimeGCTitle".Translate());
Text.Font = GameFont.Small;
std.Label("RuntimeGCVer".Translate("1.0"));
std.Label("RuntimeGCVer".Translate("1.1"));
std.Label("By user19990313");
std.Gap();
std.Label(string.Concat(new object[]{"pawnsAlive:",
Expand Down Expand Up @@ -167,7 +167,7 @@ public void GC_wrapped(bool verbose=false)
j);
Find.WindowStack.Add(new Dialog_MessageBox(str + "\n\n" + (i == j ?
"DlgTextGCAdvice1".Translate() : "DlgTextGCAdvice2".Translate(i - j))
+ (verbose ? "\n\n" + "DlgTextGCV".Translate() : "")
+ (verbose ? "\n\n" + (string)"DlgTextGCV".Translate() : "")
));
if(RuntimeGC.Settings.ArchiveGCDialog)
Find.Archive.Add(new ArchivedDialog(str, "DlgArchiveTitle".Translate(), null));
Expand Down
Binary file modified src/RuntimeGC/RuntimeGC/bin/Release/RuntimeGC.dll
Binary file not shown.
Binary file modified src/RuntimeGC/RuntimeGC/bin/Release/RuntimeGC.pdb
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d60b52f1cce8489d08cb1798f524e95e6589fb6a
86204394c73f165acc6c9b04efd7d785ff5b8557
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ D:\CSharp\Workspace\Projects\RuntimeGC\RuntimeGC\obj\Debug\RuntimeGC.csproj.Core
D:\CSharp\Workspace\Projects\RuntimeGC\RuntimeGC\obj\Debug\RuntimeGC.csproj.CopyComplete
D:\CSharp\Workspace\Projects\RuntimeGC\RuntimeGC\obj\Debug\RuntimeGC.dll
D:\CSharp\Workspace\Projects\RuntimeGC\RuntimeGC\obj\Debug\RuntimeGC.pdb
D:\Games\Steam\steamapps\common\RimWorld\Mods\RGC\src\RuntimeGC\RuntimeGC\obj\Debug\RuntimeGC.csprojAssemblyReference.cache
D:\Games\Steam\steamapps\common\RimWorld\Mods\RGC\src\RuntimeGC\RuntimeGC\obj\Debug\RuntimeGC.csproj.CoreCompileInputs.cache
D:\Games\Steam\steamapps\common\RimWorld\Mods\RGC\src\RuntimeGC\RuntimeGC\obj\Debug\RuntimeGC.dll
D:\Games\Steam\steamapps\common\RimWorld\Mods\RGC\src\RuntimeGC\RuntimeGC\obj\Debug\RuntimeGC.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d60b52f1cce8489d08cb1798f524e95e6589fb6a
a88d89317d8aeb4f6a6a4ad0a07d440eb96f6f32
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ D:\CSharp\Workspace\Projects\RuntimeGC\RuntimeGC\obj\Release\RuntimeGC.csproj.Co
D:\CSharp\Workspace\Projects\RuntimeGC\RuntimeGC\obj\Release\RuntimeGC.csproj.CopyComplete
D:\CSharp\Workspace\Projects\RuntimeGC\RuntimeGC\obj\Release\RuntimeGC.dll
D:\CSharp\Workspace\Projects\RuntimeGC\RuntimeGC\obj\Release\RuntimeGC.pdb
D:\Games\Steam\steamapps\common\RimWorld\Mods\RGC\src\RuntimeGC\RuntimeGC\bin\Release\RuntimeGC.dll
D:\Games\Steam\steamapps\common\RimWorld\Mods\RGC\src\RuntimeGC\RuntimeGC\bin\Release\RuntimeGC.pdb
D:\Games\Steam\steamapps\common\RimWorld\Mods\RGC\src\RuntimeGC\RuntimeGC\obj\Release\RuntimeGC.csprojAssemblyReference.cache
D:\Games\Steam\steamapps\common\RimWorld\Mods\RGC\src\RuntimeGC\RuntimeGC\obj\Release\RuntimeGC.csproj.CoreCompileInputs.cache
D:\Games\Steam\steamapps\common\RimWorld\Mods\RGC\src\RuntimeGC\RuntimeGC\obj\Release\RuntimeGC.dll
D:\Games\Steam\steamapps\common\RimWorld\Mods\RGC\src\RuntimeGC\RuntimeGC\obj\Release\RuntimeGC.pdb
Binary file not shown.
Binary file modified src/RuntimeGC/RuntimeGC/obj/Release/RuntimeGC.dll
Binary file not shown.
Binary file modified src/RuntimeGC/RuntimeGC/obj/Release/RuntimeGC.pdb
Binary file not shown.

0 comments on commit 53147fe

Please sign in to comment.