Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<url>https://github.com/Jvella94/PublisherPlus</url>
<supportedVersions>
<li>1.1</li>
<li>1.3</li>
</supportedVersions>
<modDependencies>
<li>
Expand Down
5 changes: 1 addition & 4 deletions Source/Compatibility/ModManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ public static ModMetaData GetSelectedMod()
var selectedModButton = Traverse.Create(page).Property("Selected")?.GetValue();
if (selectedModButton == null) { return null; }

var buttonManager = Assembly.GetType("ModManager.ModButtonManager");
var method = AccessTools.Method(buttonManager, "AttributesFor", new[] { Assembly.GetType("ModManager.ModButton") });
var value = method.Invoke(null, new[] { selectedModButton });
return Traverse.Create(value).Property<ModMetaData>("Mod").Value;
return Traverse.Create(selectedModButton).Property("Selected")?.GetValue() as ModMetaData;
}
}
}
8 changes: 4 additions & 4 deletions Source/Interface/Dialog_Publish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@

namespace PublisherPlus.Interface
{
internal class Dialog_Publish : Window
internal class Dialog_Publish : Dialog_MessageBox
{
private const float Padding = 12f;
private const float ScrollBarWidth = 20f;
private const float ButtonHeight = 50f;
private new const float ButtonHeight = 50f;

private readonly WorkshopPackage _pack;
private Vector2 _scroll;
public override Vector2 InitialSize => new Vector2(600f, 600f);

private int _page;

public Dialog_Publish(WorkshopItemHook hook)
public Dialog_Publish(WorkshopItemHook hook) : base(null)
{
_pack = new WorkshopPackage(hook);
doCloseButton = false;
Expand Down Expand Up @@ -84,7 +84,7 @@ public override void DoWindowContents(Rect inRect)
else if (_page == 2) { DoFinalize(contentRect); }

var buttonRect = new Rect(inRect.x, contentRect.yMax + Padding, inRect.width, ButtonHeight);
var grid = new GridLayout(buttonRect, 6);
var grid = new Verse.GridLayout(buttonRect, 6);

if (WidgetsPlus.ButtonText(grid.GetCellRect(0, 0, 2), _page == 0 ? Lang.Get("Button.Close") : Lang.Get("Button.Back"))) { PreviousPage(); }
if (WidgetsPlus.ButtonText(grid.GetCellRect(2, 0), Lang.Get("Button.Default"))) { ResetConfig(); }
Expand Down
2 changes: 1 addition & 1 deletion Source/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ internal static class Mod
{
public const string Id = "PublisherPlus";
public const string Name = Id;
public const string Version = "1.4.0.0";
public const string Version = "1.5.0.0";

public static bool ExperimentalMode { get; set; }

Expand Down
8 changes: 4 additions & 4 deletions Source/Patch/Verse_Dialog_MessageBox_CreateConfirmation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace PublisherPlus.Patch
{
[HarmonyPatch(typeof(Dialog_MessageBox), "CreateConfirmation")]
[HarmonyPatch(typeof(Dialog_MessageBox), nameof(Dialog_MessageBox.CreateConfirmation))]
internal static class Verse_Dialog_MessageBox_CreateConfirmation
{
private static bool Prefix(ref Window __result, TaggedString text)
public static bool Prefix(ref Window __result, TaggedString text)
{
if (text != "ConfirmSteamWorkshopUpload".Translate()) { return true; }
if (text != "ConfirmContentAuthor".Translate()) return true;

var selectedMod = Access.GetSelectedMod();
if (selectedMod == null) { return false; }
if (selectedMod == null) return false;
__result = new Dialog_Publish(selectedMod.GetWorkshopItemHook());

return false;
Expand Down
2 changes: 1 addition & 1 deletion Source/Patch/Verse_Steam_Workshop_OnItemSubmitted.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PublisherPlus.Patch
{
[HarmonyPatch(typeof(Workshop), "OnItemSubmitted")]
[HarmonyPatch(typeof(Workshop), nameof(Workshop.OnItemSubmitted))]
internal static class Verse_Steam_Workshop_OnItemSubmitted
{
private static void Postfix() => WorkshopPackage.OnUploaded();
Expand Down
151 changes: 61 additions & 90 deletions Source/PublisherPlus.csproj
Original file line number Diff line number Diff line change
@@ -1,100 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B5FA2312-C6FB-4782-A8E0-6FF2B74F4C34}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PublisherPlus</RootNamespace>
<AssemblyName>PublisherPlus</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<AllowedReferenceRelatedFileExtensions>None</AllowedReferenceRelatedFileExtensions>
<TargetFramework>net472</TargetFramework>
<LangVersion>8.0</LangVersion>
<PlatformTarget>x64</PlatformTarget>
<OutputPath>..\1.3\Assemblies\</OutputPath>
<Optimize>true</Optimize>
<DebugType>none</DebugType>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants>TRACE;NDEBUG</DefineConstants>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\v1.1\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG</DefineConstants>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Optimize>false</Optimize>
</PropertyGroup>

<ItemGroup>
<Reference Include="0Harmony, Version=2.0.0.10, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Lib.Harmony.2.0.0.10\lib\net472\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>D:\Games\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>D:\Games\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="UnityEngine">
<HintPath>D:\Games\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>D:\Games\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>D:\Games\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Mod.cs" />
<Compile Include="Compatibility\ModManager.cs" />
<Compile Include="Data\Lang.cs" />
<Compile Include="Data\WorkshopPackage.cs" />
<Compile Include="Interface\Dialog_Publish.cs" />
<Compile Include="Interface\ListingPlus.cs" />
<Compile Include="Interface\WidgetsPlus.cs" />
<Compile Include="Patch\Access.cs" />
<Compile Include="Patch\Extensions.cs" />
<Compile Include="Patch\Verse_Dialog_MessageBox_CreateConfirmation.cs" />
<Compile Include="Patch\Verse_Steam_Workshop_OnItemSubmitted.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\README.md">
<Link>README.md</Link>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="..\About\About.xml">
<Link>-Mod Files\About\About.xml</Link>
</Content>
<Content Include="..\About\Manifest.xml">
<Link>-Mod Files\About\Manifest.xml</Link>
</Content>
<Content Include="..\About\Preview.png">
<Link>-Mod Files\About\Preview.png</Link>
</Content>
<Content Include="..\Languages\English\Keyed\Keys.xml">
<Link>-Mod Files\Languages\English\Keyed\Keys.xml</Link>
</Content>
<PackageReference Include="Krafs.Rimworld.Ref" Version="*-*" GeneratePathProperty="true" />
<PackageReference Include="Lib.Harmony" Version="*" ExcludeAssets="runtime" />
<PackageReference Include="TaskPubliciser" Version="*" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="*" />
<PackageReference Include="UnlimitedHugs.Rimworld.HugsLib" Version="*" ExcludeAssets="runtime" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />


<Target Name="MyCode" BeforeTargets="UpdateReferences">
<!-- Set our variables -->
<PropertyGroup>
<AssemblyCSharp>$(PkgKrafs_Rimworld_Ref)\ref\net472\Assembly-CSharp.dll</AssemblyCSharp>
<PubliciseOutputPath>$(PkgKrafs_Rimworld_Ref)\ref\net472\</PubliciseOutputPath>
<AssemblyCSharp_Publicised>$(PubliciseOutputPath)Assembly-CSharp_publicised.dll</AssemblyCSharp_Publicised>
</PropertyGroup>

<!-- Publicise the dlls (if required) -->
<Message Importance="High" Text="Publicising Rimworld Assembly ..." />
<Publicise TargetAssemblyPath="$(AssemblyCSharp)" OutputPath="$(PubliciseOutputPath)" Condition="Exists('$(AssemblyCSharp)')" />

<!-- Add references to the new publicised dlls -->
<Message Importance="High" Text="Replacing reference to un-publicised assemblies with publicised equivalents ..." />

<ItemGroup>
<Reference Include="$(AssemblyCSharp_Publicised)">
<SpecificVersion>false</SpecificVersion>
<HintPath>$(AssemblyCSharp_Publicised)</HintPath>
<Implicit>true</Implicit>
<Private>false</Private>
</Reference>
</ItemGroup>
</Target>

<Target Name="UpdateReferences" AfterTargets="ResolveLockFileReferences">
<Message Importance="High" Text="Remove References ..." />

<ItemGroup>
<Reference Remove="$(PkgKrafs_Rimworld_Ref)\ref\net472\Assembly-CSharp.dll" />
</ItemGroup>
</Target>


</Project>
4 changes: 0 additions & 4 deletions Source/packages.config

This file was deleted.