diff --git a/1.3/Assemblies/RJW_PlasticSurgeries.dll b/1.3/Assemblies/RJW_PlasticSurgeries.dll index d78883b..2761384 100644 Binary files a/1.3/Assemblies/RJW_PlasticSurgeries.dll and b/1.3/Assemblies/RJW_PlasticSurgeries.dll differ diff --git a/1.4/Assemblies/RJW_PlasticSurgeries.dll b/1.4/Assemblies/RJW_PlasticSurgeries.dll index 1fe8c29..512eb3e 100644 Binary files a/1.4/Assemblies/RJW_PlasticSurgeries.dll and b/1.4/Assemblies/RJW_PlasticSurgeries.dll differ diff --git a/1.5/Assemblies/RJW_PlasticSurgeries.dll b/1.5/Assemblies/RJW_PlasticSurgeries.dll new file mode 100644 index 0000000..717f787 Binary files /dev/null and b/1.5/Assemblies/RJW_PlasticSurgeries.dll differ diff --git a/Source/RJW_PlasticSurgeries/1.3/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml b/1.5/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml similarity index 100% rename from Source/RJW_PlasticSurgeries/1.3/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml rename to 1.5/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml diff --git a/Source/RJW_PlasticSurgeries/1.3/Defs/Recipe_Surgery/Recipes_Surgery_Mammoplasty.xml b/1.5/Defs/Recipe_Surgery/Recipes_Surgery_Mammoplasty.xml similarity index 100% rename from Source/RJW_PlasticSurgeries/1.3/Defs/Recipe_Surgery/Recipes_Surgery_Mammoplasty.xml rename to 1.5/Defs/Recipe_Surgery/Recipes_Surgery_Mammoplasty.xml diff --git a/Source/RJW_PlasticSurgeries/1.3/Defs/Recipe_Surgery/Recipes_Surgery_Penoplasty.xml b/1.5/Defs/Recipe_Surgery/Recipes_Surgery_Penoplasty.xml similarity index 100% rename from Source/RJW_PlasticSurgeries/1.3/Defs/Recipe_Surgery/Recipes_Surgery_Penoplasty.xml rename to 1.5/Defs/Recipe_Surgery/Recipes_Surgery_Penoplasty.xml diff --git a/Source/RJW_PlasticSurgeries/1.3/Defs/Recipe_Surgery/Recipes_Surgery_Sphinctoplasty.xml b/1.5/Defs/Recipe_Surgery/Recipes_Surgery_Sphinctoplasty.xml similarity index 100% rename from Source/RJW_PlasticSurgeries/1.3/Defs/Recipe_Surgery/Recipes_Surgery_Sphinctoplasty.xml rename to 1.5/Defs/Recipe_Surgery/Recipes_Surgery_Sphinctoplasty.xml diff --git a/Source/RJW_PlasticSurgeries/1.3/Defs/Recipe_Surgery/Recipes_Surgery_Vaginoplasty.xml b/1.5/Defs/Recipe_Surgery/Recipes_Surgery_Vaginoplasty.xml similarity index 100% rename from Source/RJW_PlasticSurgeries/1.3/Defs/Recipe_Surgery/Recipes_Surgery_Vaginoplasty.xml rename to 1.5/Defs/Recipe_Surgery/Recipes_Surgery_Vaginoplasty.xml diff --git a/About/About.xml b/About/About.xml index dfd4a34..55aab1b 100644 --- a/About/About.xml +++ b/About/About.xml @@ -6,6 +6,7 @@
  • 1.3
  • 1.4
  • +
  • 1.5
  • Stardust3D.RJW.PlasticSurgeries Surgically alter pawn's genitals. @@ -21,16 +22,10 @@ steam://url/CommunityFilePage/2009463077 https://github.com/pardeike/HarmonyRimWorld/releases/latest -
  • Ludeon.RimWorld
  • rim.job.world
  • -
  • NuttySquabble.Dyspareunia
  • LustLicentia.RJWLabs
  • \ No newline at end of file diff --git a/About/Manifest.xml b/About/Manifest.xml index fb74105..cb4e292 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -2,5 +2,5 @@ RJW PlasticSurgeries - 5230.0.1.6 + 5400.0.1.8 \ No newline at end of file diff --git a/Source/RJW_PlasticSurgeries.sln b/Source/RJW_PlasticSurgeries.sln index a650eca..9b720f4 100644 --- a/Source/RJW_PlasticSurgeries.sln +++ b/Source/RJW_PlasticSurgeries.sln @@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RJW_PlasticSurgeries_1.3", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RJW_PlasticSurgeries_1.4", "RJW_PlasticSurgeries\RJW_PlasticSurgeries_1.4.csproj", "{F17C6B3F-BA9D-4133-A201-1265A64BCB72}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RJW_PlasticSurgeries_1.5", "RJW_PlasticSurgeries\RJW_PlasticSurgeries_1.5.csproj", "{02AA6D85-913F-44B8-9C32-6E8024261824}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {F17C6B3F-BA9D-4133-A201-1265A64BCB72}.Debug|Any CPU.Build.0 = Release|Any CPU {F17C6B3F-BA9D-4133-A201-1265A64BCB72}.Release|Any CPU.ActiveCfg = Release|Any CPU {F17C6B3F-BA9D-4133-A201-1265A64BCB72}.Release|Any CPU.Build.0 = Release|Any CPU + {02AA6D85-913F-44B8-9C32-6E8024261824}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {02AA6D85-913F-44B8-9C32-6E8024261824}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02AA6D85-913F-44B8-9C32-6E8024261824}.Release|Any CPU.ActiveCfg = Release|Any CPU + {02AA6D85-913F-44B8-9C32-6E8024261824}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Source/RJW_PlasticSurgeries/1.5/Recipe_Plastic_Surgery.cs b/Source/RJW_PlasticSurgeries/1.5/Recipe_Plastic_Surgery.cs new file mode 100644 index 0000000..0277836 --- /dev/null +++ b/Source/RJW_PlasticSurgeries/1.5/Recipe_Plastic_Surgery.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; +using RimWorld; +using rjw; +using Verse; + +namespace RJW_PlasticSurgeries +{ + public abstract class Recipe_Plastic_Surgery : Recipe_Surgery + { + protected readonly bool HasLicentia = ModLister.HasActiveModWithName("RimJobWorld - Licentia Labs"); + + public override IEnumerable GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) + { + var part = GetPartCandidate(pawn); + if (part != null) + { + var hediffs = Genital_Helper.get_PartsHediffList(pawn, part); + if (HasPart(pawn, hediffs)) yield return part; + } + } + + protected abstract BodyPartRecord GetPartCandidate(Pawn pawn); + protected abstract bool HasPart(Pawn pawn, List hediffs); + + public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List ingredients, + Bill bill) + { + if (billDoer != null) + { + TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn); + SurgeryResult(pawn); + } + } + + protected abstract void SurgeryResult(Pawn pawn); + + protected void SurgeryX(Pawn pawn, float severity, bool damagePart = false) + { + GetHediffs(pawn).ForEach(hed => + { + hed.Severity = severity; + if (damagePart && HasLicentia) + { + var (type, damage) = GetLicentiaDamage(); + LicentiaLabs.DamageHelper.ApplyDamage(pawn, hed.Part, type, damage); + } + }); + } + + protected abstract List GetHediffs(Pawn pawn); + protected abstract (HediffDef, float) GetLicentiaDamage(); + } +} \ No newline at end of file diff --git a/Source/RJW_PlasticSurgeries/1.5/Recipe_Surgery_Beautify.cs b/Source/RJW_PlasticSurgeries/1.5/Recipe_Surgery_Beautify.cs new file mode 100644 index 0000000..bdf4023 --- /dev/null +++ b/Source/RJW_PlasticSurgeries/1.5/Recipe_Surgery_Beautify.cs @@ -0,0 +1,61 @@ +using System.Collections.Generic; +using RimWorld; +using Verse; +using static rjw.VanillaTraitDefOf; + +namespace RJW_PlasticSurgeries +{ + /// + public abstract class Recipe_Surgery_Beautify : Recipe_Surgery + { + /// + public override IEnumerable GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) + { + if (!pawn.story.traits.HasTrait(Beauty) || + pawn.story.traits.HasTrait(Beauty) && pawn.story.traits.GetTrait(Beauty).Degree < 2) + yield return pawn.RaceProps.body.corePart; + } + + /// + public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List ingredients, + Bill bill) + { + if (billDoer != null) + { + TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn); + SurgeryResult(pawn); + } + } + + /// + /// + /// + /// + public abstract void SurgeryResult(Pawn pawn); + + /// + /// Setts the severity of the Beautiful trait for the selected pawn. + /// If the trait doesn't exist in the pawns traits, it will be added. + /// + /// the pawn to modify + /// the new severity of the pawn's Beautiful trait + protected void SurgeryX(Pawn pawn, int severity) + { + if (pawn.story.traits.HasTrait(Beauty)) + { + pawn.story.traits.allTraits.FindAll(t => Beauty.ConflictsWith(t)) + .ForEach(t => pawn.story.traits.RemoveTrait(t)); + pawn.story.traits.RemoveTrait(pawn.story.traits.allTraits.Find(t => t.def == Beauty)); + } + + pawn.story.traits.GainTrait(new Trait(Beauty, severity)); + } + } + + /// + public class Recipe_Surgery_Beautify_Beautiful : Recipe_Surgery_Beautify + { + /// + public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 2); + } +} \ No newline at end of file diff --git a/Source/RJW_PlasticSurgeries/1.5/VanillaTraitDefOf.cs b/Source/RJW_PlasticSurgeries/1.5/VanillaTraitDefOf.cs new file mode 100644 index 0000000..918c7ca --- /dev/null +++ b/Source/RJW_PlasticSurgeries/1.5/VanillaTraitDefOf.cs @@ -0,0 +1,26 @@ +using Verse; +using RimWorld; + +namespace rjw +{ + [DefOf] + public static class VanillaTraitDefOf + { + public static TraitDef Tough; + + public static TraitDef Nerves; + + public static TraitDef Beauty; + + public static TraitDef TooSmart; + + public static TraitDef NaturalMood; + + public static TraitDef Cannibal; + + static VanillaTraitDefOf() + { + DefOfHelper.EnsureInitializedInCtor(typeof(VanillaTraitDefOf)); + } + } +} \ No newline at end of file diff --git a/Source/RJW_PlasticSurgeries/About/About.xml b/Source/RJW_PlasticSurgeries/About/About.xml index dfd4a34..55aab1b 100644 --- a/Source/RJW_PlasticSurgeries/About/About.xml +++ b/Source/RJW_PlasticSurgeries/About/About.xml @@ -6,6 +6,7 @@
  • 1.3
  • 1.4
  • +
  • 1.5
  • Stardust3D.RJW.PlasticSurgeries Surgically alter pawn's genitals. @@ -21,16 +22,10 @@ steam://url/CommunityFilePage/2009463077 https://github.com/pardeike/HarmonyRimWorld/releases/latest -
  • Ludeon.RimWorld
  • rim.job.world
  • -
  • NuttySquabble.Dyspareunia
  • LustLicentia.RJWLabs
  • \ No newline at end of file diff --git a/Source/RJW_PlasticSurgeries/About/Manifest.xml b/Source/RJW_PlasticSurgeries/About/Manifest.xml index fb74105..cb4e292 100644 --- a/Source/RJW_PlasticSurgeries/About/Manifest.xml +++ b/Source/RJW_PlasticSurgeries/About/Manifest.xml @@ -2,5 +2,5 @@ RJW PlasticSurgeries - 5230.0.1.6 + 5400.0.1.8 \ No newline at end of file diff --git a/Source/RJW_PlasticSurgeries/1.4/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml b/Source/RJW_PlasticSurgeries/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml similarity index 100% rename from Source/RJW_PlasticSurgeries/1.4/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml rename to Source/RJW_PlasticSurgeries/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml diff --git a/Source/RJW_PlasticSurgeries/1.4/Defs/Recipe_Surgery/Recipes_Surgery_Mammoplasty.xml b/Source/RJW_PlasticSurgeries/Defs/Recipe_Surgery/Recipes_Surgery_Mammoplasty.xml similarity index 100% rename from Source/RJW_PlasticSurgeries/1.4/Defs/Recipe_Surgery/Recipes_Surgery_Mammoplasty.xml rename to Source/RJW_PlasticSurgeries/Defs/Recipe_Surgery/Recipes_Surgery_Mammoplasty.xml diff --git a/Source/RJW_PlasticSurgeries/1.4/Defs/Recipe_Surgery/Recipes_Surgery_Penoplasty.xml b/Source/RJW_PlasticSurgeries/Defs/Recipe_Surgery/Recipes_Surgery_Penoplasty.xml similarity index 100% rename from Source/RJW_PlasticSurgeries/1.4/Defs/Recipe_Surgery/Recipes_Surgery_Penoplasty.xml rename to Source/RJW_PlasticSurgeries/Defs/Recipe_Surgery/Recipes_Surgery_Penoplasty.xml diff --git a/Source/RJW_PlasticSurgeries/1.4/Defs/Recipe_Surgery/Recipes_Surgery_Sphinctoplasty.xml b/Source/RJW_PlasticSurgeries/Defs/Recipe_Surgery/Recipes_Surgery_Sphinctoplasty.xml similarity index 100% rename from Source/RJW_PlasticSurgeries/1.4/Defs/Recipe_Surgery/Recipes_Surgery_Sphinctoplasty.xml rename to Source/RJW_PlasticSurgeries/Defs/Recipe_Surgery/Recipes_Surgery_Sphinctoplasty.xml diff --git a/Source/RJW_PlasticSurgeries/1.4/Defs/Recipe_Surgery/Recipes_Surgery_Vaginoplasty.xml b/Source/RJW_PlasticSurgeries/Defs/Recipe_Surgery/Recipes_Surgery_Vaginoplasty.xml similarity index 100% rename from Source/RJW_PlasticSurgeries/1.4/Defs/Recipe_Surgery/Recipes_Surgery_Vaginoplasty.xml rename to Source/RJW_PlasticSurgeries/Defs/Recipe_Surgery/Recipes_Surgery_Vaginoplasty.xml diff --git a/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.3.csproj b/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.3.csproj index 8f2f72b..71b95a0 100644 --- a/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.3.csproj +++ b/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.3.csproj @@ -8,15 +8,15 @@ Properties RJW_PlasticSurgeries RJW_PlasticSurgeries - net48 + net472 512 11 - ©2022 Stardust3D + ©2024 Stardust3D Stardust3D - 5230.0.1.6 - 5230.0.1.6 + 5400.0.1.8 + 5400.0.1.8 true RJW_PlasticSurgeries.snk Surgically alter pawn's genitals. @@ -27,17 +27,15 @@ + - + - + - - ..\..\..\dyspareunia\1.3\Assemblies\Dyspareunia.dll - ..\..\..\licentia-labs\Assemblies\LicentiaLabs.dll @@ -46,9 +44,11 @@ - + + - + + \ No newline at end of file diff --git a/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.4.csproj b/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.4.csproj index 5f0366c..ea6ba56 100644 --- a/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.4.csproj +++ b/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.4.csproj @@ -8,15 +8,15 @@ Properties RJW_PlasticSurgeries RJW_PlasticSurgeries - net48 + net472 512 11 - ©2022 Stardust3D + ©2024 Stardust3D Stardust3D - 5230.0.1.6 - 5230.0.1.6 + 5400.0.1.8 + 5400.0.1.8 true RJW_PlasticSurgeries.snk Surgically alter pawn's genitals. @@ -27,17 +27,15 @@ + - + - - + + - - ..\..\..\dyspareunia\1.4\Assemblies\Dyspareunia.dll - ..\..\..\licentia-labs\Assemblies\LicentiaLabs.dll @@ -46,10 +44,12 @@ - + + - + + diff --git a/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.5.csproj b/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.5.csproj new file mode 100644 index 0000000..8961655 --- /dev/null +++ b/Source/RJW_PlasticSurgeries/RJW_PlasticSurgeries_1.5.csproj @@ -0,0 +1,56 @@ + + + + Debug + AnyCPU + {02aa6d85-913f-44b8-9c32-6e8024261824} + Library + Properties + RJW_PlasticSurgeries + RJW_PlasticSurgeries + net472 + 512 + + + 11 + ©2024 Stardust3D + Stardust3D + 5400.0.1.8 + 5400.0.1.8 + true + RJW_PlasticSurgeries.snk + Surgically alter pawn's genitals. + + + bin\Release\1.5\ + + + + + + + + + + + + + + + ..\..\..\licentia-labs\Assemblies\LicentiaLabs.dll + + + ..\..\..\rjw-base\1.5\Assemblies\RJW.dll + + + + + + + + + + + + + diff --git a/Source/RJW_PlasticSurgeries/Recipe_Plastic_Surgery.cs b/Source/RJW_PlasticSurgeries/Recipe_Plastic_Surgery.cs index 829a5b4..0277836 100644 --- a/Source/RJW_PlasticSurgeries/Recipe_Plastic_Surgery.cs +++ b/Source/RJW_PlasticSurgeries/Recipe_Plastic_Surgery.cs @@ -1,15 +1,12 @@ using System.Collections.Generic; -using Dyspareunia; using RimWorld; using rjw; using Verse; -using DamageDefOf = Dyspareunia.DamageDefOf; namespace RJW_PlasticSurgeries { public abstract class Recipe_Plastic_Surgery : Recipe_Surgery { - protected readonly bool HasDyspareunia = ModLister.HasActiveModWithName("Dyspareunia"); protected readonly bool HasLicentia = ModLister.HasActiveModWithName("RimJobWorld - Licentia Labs"); public override IEnumerable GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) @@ -37,17 +34,11 @@ namespace RJW_PlasticSurgeries protected abstract void SurgeryResult(Pawn pawn); - private static void DamageHediff(Hediff hed) - { - PenetrationUtility.AddDamageHediff(DamageDefOf.SexStretch, 0.5f, hed, null); - } - protected void SurgeryX(Pawn pawn, float severity, bool damagePart = false) { GetHediffs(pawn).ForEach(hed => { hed.Severity = severity; - if (damagePart && HasDyspareunia) DamageHediff(hed); if (damagePart && HasLicentia) { var (type, damage) = GetLicentiaDamage(); diff --git a/Source/RJW_PlasticSurgeries/Recipe_Surgery_Penoplasty.cs b/Source/RJW_PlasticSurgeries/Recipe_Surgery_Penoplasty.cs index 3e11c72..3a2408b 100644 --- a/Source/RJW_PlasticSurgeries/Recipe_Surgery_Penoplasty.cs +++ b/Source/RJW_PlasticSurgeries/Recipe_Surgery_Penoplasty.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using LicentiaLabs; using rjw; using Verse; @@ -23,8 +24,15 @@ namespace RJW_PlasticSurgeries return pawn.GetGenitalsList().FindAll(Genital_Helper.is_penis); } - protected override (HediffDef, float) GetLicentiaDamage() => - (Licentia.HediffDefs.StretchTear, 0.2f); + protected override (HediffDef, float) GetLicentiaDamage() + { + if (HasLicentia) + { + return (Licentia.HediffDefs.StretchTear, 0.2f); + } + + throw new NotSupportedException(); + } } public class Recipe_Surgery_Penoplasty_Micro : Recipe_Surgery_Penoplasty diff --git a/Source/RJW_PlasticSurgeries/Recipe_Surgery_Sphinctoplasty.cs b/Source/RJW_PlasticSurgeries/Recipe_Surgery_Sphinctoplasty.cs index 796268f..fbbd9ae 100644 --- a/Source/RJW_PlasticSurgeries/Recipe_Surgery_Sphinctoplasty.cs +++ b/Source/RJW_PlasticSurgeries/Recipe_Surgery_Sphinctoplasty.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using LicentiaLabs; using rjw; using Verse; @@ -21,9 +22,16 @@ namespace RJW_PlasticSurgeries { return pawn.GetAnusList(); } - - protected override (HediffDef, float) GetLicentiaDamage() => - (Licentia.HediffDefs.StretchTear, 0.2f); + + protected override (HediffDef, float) GetLicentiaDamage() + { + if (HasLicentia) + { + return (Licentia.HediffDefs.StretchTear, 0.2f); + } + + throw new NotSupportedException(); + } } public class Recipe_Surgery_Sphinctoplasty_Micro : Recipe_Surgery_Sphinctoplasty diff --git a/Source/RJW_PlasticSurgeries/Recipe_Surgery_Vaginoplasty.cs b/Source/RJW_PlasticSurgeries/Recipe_Surgery_Vaginoplasty.cs index 68a7803..33f13fc 100644 --- a/Source/RJW_PlasticSurgeries/Recipe_Surgery_Vaginoplasty.cs +++ b/Source/RJW_PlasticSurgeries/Recipe_Surgery_Vaginoplasty.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using LicentiaLabs; using rjw; using Verse; @@ -21,9 +22,16 @@ namespace RJW_PlasticSurgeries { return pawn.GetGenitalsList().FindAll(Genital_Helper.is_vagina); } - - protected override (HediffDef, float) GetLicentiaDamage() => - (Licentia.HediffDefs.StretchTear, 0.2f); + + protected override (HediffDef, float) GetLicentiaDamage() + { + if (HasLicentia) + { + return (Licentia.HediffDefs.StretchTear, 0.2f); + } + + throw new NotSupportedException(); + } } public class Recipe_Surgery_Vaginoplasty_Micro : Recipe_Surgery_Vaginoplasty diff --git a/Source/build.gradle.kts b/Source/build.gradle.kts index 07c1fdf..8e3c668 100644 --- a/Source/build.gradle.kts +++ b/Source/build.gradle.kts @@ -1,16 +1,9 @@ -/* - * This file was generated by the Gradle "init" task. - * - * This is a general purpose Gradle build. - * Learn more about Gradle by exploring our samples at https://docs.gradle.org/7.3/samples - * This project uses @Incubating APIs which are subject to change. - */ - plugins { - id("com.ullink.msbuild") version "3.15" + alias(libs.plugins.msbuild) + alias(libs.plugins.versions) } -version = "5230.0.1.6" +version = "5400.0.1.8" val friendlyName = "rjw-plasticsurgeries" tasks.register("buildC#_1.3") { @@ -37,9 +30,21 @@ tasks.register("buildC#_1.4") { // destinationDir = "build/msbuild/bin" } +tasks.register("buildC#_1.5") { + // either a solution file + // solutionFile = "${rootProject.name}.sln" + // or a project file (.csproj or .vbproj) + projectFile = file("${rootProject.name}/${rootProject.name}_1.5.csproj") + + targets = listOf("Clean", "Rebuild") + configuration = "Release" + + // destinationDir = "build/msbuild/bin" +} + tasks.register("sign_1.3") { dependsOn("buildC#_1.3") - workingDir = project.projectDir.resolve("${rootProject.name}/bin/Release/1.3/net48") + workingDir = project.projectDir.resolve("${rootProject.name}/bin/Release/1.3/net472") executable = "H:\\Windows Kits\\10\\bin\\10.0.22621.0\\x64\\signtool.exe" args = listOf( "sign", @@ -57,7 +62,25 @@ tasks.register("sign_1.3") { tasks.register("sign_1.4") { dependsOn("buildC#_1.4") - workingDir = project.projectDir.resolve("${rootProject.name}/bin/Release/1.4/net48") + workingDir = project.projectDir.resolve("${rootProject.name}/bin/Release/1.4/net472") + executable = "H:\\Windows Kits\\10\\bin\\10.0.22621.0\\x64\\signtool.exe" + args = listOf( + "sign", + "/seal", + "/t", + "http://timestamp.digicert.com", + "/a", + "/n", + "Stardust3D", + "/fd", + "certHash", + "${rootProject.name}.dll" + ) +} + +tasks.register("sign_1.5") { + dependsOn("buildC#_1.5") + workingDir = project.projectDir.resolve("${rootProject.name}/bin/Release/1.5/net472") executable = "H:\\Windows Kits\\10\\bin\\10.0.22621.0\\x64\\signtool.exe" args = listOf( "sign", @@ -74,7 +97,7 @@ tasks.register("sign_1.4") { } tasks.register("copy") { - dependsOn("copy_1.3", "copy_1.4", "copy_about") + dependsOn("copy_1.3", "copy_1.4", "copy_1.5", "copy_about") } tasks.register("copy_about") { @@ -84,28 +107,67 @@ tasks.register("copy_about") { tasks.register("copy_1.3") { dependsOn("copyDll_1.3") - from(project.projectDir.resolve("${rootProject.name}/1.3")) + dependsOn("copyDefs_1.3") + + from(project.projectDir.resolve("${rootProject.name}/1.3")){ + exclude("**/*.cs") + } into(project.projectDir.parentFile.resolve("1.3")) } tasks.register("copy_1.4") { dependsOn("copyDll_1.4") - from(project.projectDir.resolve("${rootProject.name}/1.4")) + dependsOn("copyDefs_1.4") + + from(project.projectDir.resolve("${rootProject.name}/1.4")){ + exclude("**/*.cs") + } into(project.projectDir.parentFile.resolve("1.4")) } +tasks.register("copy_1.5") { + dependsOn("copyDll_1.5") + dependsOn("copyDefs_1.5") + + from(project.projectDir.resolve("${rootProject.name}/1.5")){ + exclude("**/*.cs") + } + into(project.projectDir.parentFile.resolve("1.5")) +} + tasks.register("copyDll_1.3") { dependsOn("sign_1.3") - from(project.projectDir.resolve("${rootProject.name}/bin/Release/1.3/net48/${rootProject.name}.dll")) + from(project.projectDir.resolve("${rootProject.name}/bin/Release/1.3/net472/${rootProject.name}.dll")) into(project.projectDir.parentFile.resolve("1.3/Assemblies")) } tasks.register("copyDll_1.4") { dependsOn("sign_1.4") - from(project.projectDir.resolve("${rootProject.name}/bin/Release/1.4/net48/${rootProject.name}.dll")) + from(project.projectDir.resolve("${rootProject.name}/bin/Release/1.4/net472/${rootProject.name}.dll")) into(project.projectDir.parentFile.resolve("1.4/Assemblies")) } +tasks.register("copyDll_1.5") { + dependsOn("sign_1.5") + from(project.projectDir.resolve("${rootProject.name}/bin/Release/1.5/net472/${rootProject.name}.dll")) + into(project.projectDir.parentFile.resolve("1.5/Assemblies")) +} + +tasks.register("copyDefs_1.3") { + from(project.projectDir.resolve("${rootProject.name}/Defs")) + into(project.projectDir.parentFile.resolve("1.3/Defs")) +} + +tasks.register("copyDefs_1.4") { + from(project.projectDir.resolve("${rootProject.name}/Defs")) + into(project.projectDir.parentFile.resolve("1.4/Defs")) +} + +tasks.register("copyDefs_1.5") { + from(project.projectDir.resolve("${rootProject.name}/Defs")) + into(project.projectDir.parentFile.resolve("1.5/Defs")) +} + tasks.register("buildZip") { dependsOn("clean", ":copy") into("$friendlyName/1.3") { @@ -114,6 +176,9 @@ tasks.register("buildZip") { into("$friendlyName/1.4") { from(project.projectDir.parentFile.resolve("1.4")) } + into("$friendlyName/1.5") { + from(project.projectDir.parentFile.resolve("1.5")) + } into("$friendlyName/About") { from(project.projectDir.parentFile.resolve("About")) } @@ -123,12 +188,14 @@ tasks.register("buildZip") { into("$friendlyName/Source/${rootProject.name}") { from(project.projectDir.parentFile.resolve("Source/${rootProject.name}")) excludes.add("**/obj/**") + excludes.add("**/bin/**") } } tasks.clean { delete.add(project.projectDir.parentFile.resolve("1.3")) delete.add(project.projectDir.parentFile.resolve("1.4")) + delete.add(project.projectDir.parentFile.resolve("1.5")) delete.add(project.projectDir.parentFile.resolve("About")) } diff --git a/Source/global.json b/Source/global.json index 1bcf6c0..2ddda36 100644 --- a/Source/global.json +++ b/Source/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.0", + "version": "8.0.0", "rollForward": "latestMinor", "allowPrerelease": false } diff --git a/Source/gradle/libs.versions.toml b/Source/gradle/libs.versions.toml new file mode 100644 index 0000000..de22e81 --- /dev/null +++ b/Source/gradle/libs.versions.toml @@ -0,0 +1,11 @@ +[versions] +versions = "0.51.0" +msbuild = "4.6" + +[libraries] + +[bundles] + +[plugins] +versions = { id = "com.github.ben-manes.versions", version.ref = "versions" } +msbuild = { id = "com.ullink.msbuild", version.ref = "msbuild" } diff --git a/Source/gradle/wrapper/gradle-wrapper.jar b/Source/gradle/wrapper/gradle-wrapper.jar index 7454180..e644113 100644 Binary files a/Source/gradle/wrapper/gradle-wrapper.jar and b/Source/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Source/gradle/wrapper/gradle-wrapper.properties b/Source/gradle/wrapper/gradle-wrapper.properties index ae04661..a441313 100644 --- a/Source/gradle/wrapper/gradle-wrapper.properties +++ b/Source/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/Source/gradlew b/Source/gradlew index c53aefa..b740cf1 100644 --- a/Source/gradlew +++ b/Source/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,10 +32,10 @@ # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: # * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». # # Important for patching: # @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -205,6 +214,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/Source/gradlew.bat b/Source/gradlew.bat index 107acd3..25da30d 100644 --- a/Source/gradlew.bat +++ b/Source/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +41,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal