diff --git a/1.5/Assemblies/RoadsOfTheRim.dll b/1.5/Assemblies/RoadsOfTheRim.dll new file mode 100644 index 0000000..bc70233 Binary files /dev/null and b/1.5/Assemblies/RoadsOfTheRim.dll differ diff --git a/1.5/Assemblies/VersionFromManifest.dll b/1.5/Assemblies/VersionFromManifest.dll new file mode 100644 index 0000000..456962b Binary files /dev/null and b/1.5/Assemblies/VersionFromManifest.dll differ diff --git a/1.5/Defs/MapGeneration/RotR_CleanBuiltRoads.xml b/1.5/Defs/MapGeneration/RotR_CleanBuiltRoads.xml new file mode 100644 index 0000000..a3f7b16 --- /dev/null +++ b/1.5/Defs/MapGeneration/RotR_CleanBuiltRoads.xml @@ -0,0 +1,8 @@ + + + + RotR_CleanBuiltRoads + 250 + + + \ No newline at end of file diff --git a/1.5/Defs/Misc/DesignatorDropdownGroupDef/DesignatorDropdownGroupDef.xml b/1.5/Defs/Misc/DesignatorDropdownGroupDef/DesignatorDropdownGroupDef.xml new file mode 100644 index 0000000..c13ace1 --- /dev/null +++ b/1.5/Defs/Misc/DesignatorDropdownGroupDef/DesignatorDropdownGroupDef.xml @@ -0,0 +1,6 @@ + + + + Bridge_Concrete + + \ No newline at end of file diff --git a/1.5/Defs/Misc/TerrainAffordanceDefs/TerrainAffordances.xml b/1.5/Defs/Misc/TerrainAffordanceDefs/TerrainAffordances.xml new file mode 100644 index 0000000..c24ec0d --- /dev/null +++ b/1.5/Defs/Misc/TerrainAffordanceDefs/TerrainAffordances.xml @@ -0,0 +1,9 @@ + + + + + BridgeableAny + + 2600 + + \ No newline at end of file diff --git a/1.5/Defs/ResearchProjectDefs/ResearchProject_RotR.xml b/1.5/Defs/ResearchProjectDefs/ResearchProject_RotR.xml new file mode 100644 index 0000000..4e075e4 --- /dev/null +++ b/1.5/Defs/ResearchProjectDefs/ResearchProject_RotR.xml @@ -0,0 +1,72 @@ + + + + ResearchProject_RotRStoneRoad + + Allows construction of Stone roads on the world map + 500 + Medieval + +
  • Stonecutting
  • +
    + LocoNekoMods + 1 + 0 +
    + + ResearchProject_RotRAsphaltRoad + + Allows construction of Asphalt roads on the world map + 2000 + Industrial + +
  • ResearchProject_RotRStoneRoad
  • +
    + LocoNekoMods + 2 + 0 +
    + + ResearchProject_RotRGlitterRoad + + Allows construction of Glitter roads on the world map + 6000 + Spacer + HiTechResearchBench + +
  • ResearchProject_RotRAsphaltRoad
  • +
    + LocoNekoMods + 3 + 0 +
    + + ResearchProject_RotRISR2G + + Allows construction of the In Situ Road Ressource Gatherer (ISR2G). Uses local resources when building roads, completely eliminating the need to bring wood and stone at the cost of 4 times the work. + 2000 + Industrial + +
  • ResearchProject_RotRStoneRoad
  • +
  • Machining
  • +
    + LocoNekoMods + 2 + 1 +
    + + ResearchProject_RotRAISR2G + + Allows construction of the Advanced In Situ Road Ressource Gatherer (AISR2G). Uses local resources when building roads, completely eliminating the need to bring wood, stone , steel, Chemfuel , Plasteel and Uranium at the cost of twice the work. + 4000 + Spacer + HiTechResearchBench + +
  • ResearchProject_RotRAsphaltRoad
  • +
  • Fabrication
  • +
    + LocoNekoMods + 3 + 1 +
    +
    \ No newline at end of file diff --git a/1.5/Defs/ResearchProjectDefs/ResearchTabs_LocoNekoMods.xml b/1.5/Defs/ResearchProjectDefs/ResearchTabs_LocoNekoMods.xml new file mode 100644 index 0000000..5bc2204 --- /dev/null +++ b/1.5/Defs/ResearchProjectDefs/ResearchTabs_LocoNekoMods.xml @@ -0,0 +1,7 @@ + + + + LocoNekoMods + + + \ No newline at end of file diff --git a/1.5/Defs/RoadBuildableDefs/RoadBuildableDefs.xml b/1.5/Defs/RoadBuildableDefs/RoadBuildableDefs.xml new file mode 100644 index 0000000..597ccf3 --- /dev/null +++ b/1.5/Defs/RoadBuildableDefs/RoadBuildableDefs.xml @@ -0,0 +1,55 @@ + + + + RoadsOfTheRim_DirtPath + + 0.75 + DirtPath + 0 + 600 + 0 + 0 + 0 + 0 + + + RoadsOfTheRim_DirtRoad + + 0.6 + DirtRoad + 0.25 + 1200 + 120 + 0 + 0 + 0 + + + RoadsOfTheRim_StoneRoad + + 0.5 + StoneRoad + 0.75 + 3600 + 240 + 1800 + 300 + 0 + + + RoadsOfTheRim_AsphaltRoad + + 0.4 + 1 + AncientAsphaltRoad + 5400 + 0 + 3600 + 600 + 300 + + + \ No newline at end of file diff --git a/1.5/Defs/RoadDefs/RoadDefs.xml b/1.5/Defs/RoadDefs/RoadDefs.xml new file mode 100644 index 0000000..e7805e3 --- /dev/null +++ b/1.5/Defs/RoadDefs/RoadDefs.xml @@ -0,0 +1,298 @@ + + + + DirtPathBuilt + + 10 + 0.75 + 15 + Avoid + +
  • + + +
  • (2, 1)
  • +
  • (2, 0)
  • + + + Bridge + 0 + true + + +
  • + + +
  • (0.6, 1)
  • +
  • (0.8, 0)
  • + + + DirtRecent + +
    + 0.5 + 0.2 + +
  • + Outline + 0.35 +
  • +
  • + Dirt + 0.2 +
  • +
    + Dirt + +
  • + true + + 200 + +
  • +
    +
    + + DirtRoadBuilt + + 20 + 0.6 + 15 + Avoid + +
  • + + +
  • (1.4, 1)
  • +
  • (1.4, 0)
  • + + + Bridge + 0 + true + + +
  • + + +
  • (2.5, 1)
  • +
  • (2.5, 0)
  • + + + DirtRecent + +
    + 0.5 + 0.2 + +
  • + Outline + 0.55 +
  • +
  • + Dirt + 0.4 +
  • +
    + Dirt + +
  • + true + 0.25 + 0.2 + 0 + + 400 + 120 + +
  • +
    +
    + + StoneRoadBuilt + + 30 + 0.5 + 25 + Avoid + +
  • + + +
  • (2, 1)
  • +
  • (2.1, 0)
  • + + + ConcreteBridge + 0 + true + + +
  • + + +
  • (3, 1)
  • +
  • (3.1, 0)
  • + + + 0 + StoneRecent + +
    + 0.2 + 0.10 + +
  • + Outline + 0.55 +
  • +
  • + Stone + 0.4 +
  • +
    + Stone + +
  • + true + 0.75 + 0.4 + 0 + Medieval + ResearchProject_RotRStoneRoad + + 1200 + 240 + 1800 + 300 + +
  • +
    +
    + + AsphaltRoad + + 40 + true + 0.4 + 100 + Bulldoze + +
  • + + +
  • (3, 1)
  • +
  • (3.1, 0)
  • + + + ConcreteBridge + 0 + true + + +
  • + + +
  • (3, 1)
  • +
  • (3.1, 0)
  • + + + AsphaltRecent + +
    + +
  • + Outline + 0.65 +
  • +
  • + Gravel + 0.5 +
  • +
  • + Asphalt + 0.25 +
  • +
    + Asphalt + +
  • + true + 1 + 0.6 + 0.2 + true + false + 6 + 0.25 + Industrial + ResearchProject_RotRAsphaltRoad + + 1800 + 3600 + 600 + 300 + +
  • +
    +
    + + GlitterRoad + + 40 + true + 0.25 + 100 + Bulldoze + +
  • + + +
  • (3, 1)
  • +
  • (3.1, 0)
  • + + + GlitterRoad + +
    + +
  • + Outline + 0.65 +
  • +
  • + Asphalt + 0.5 +
  • +
  • + WhiteLine + 0.15 +
  • +
    + Asphalt + +
  • + true + 1 + 1 + 1 + true + true + 8 + 0.25 + Spacer + ResearchProject_RotRGlitterRoad + + 3600 + 3600 + 900 + 300 + 290 + 35 + 20 + 10 + +
  • +
    +
    +
    \ No newline at end of file diff --git a/1.5/Defs/RoadDefs/RoadWorldLayerDefs.xml b/1.5/Defs/RoadDefs/RoadWorldLayerDefs.xml new file mode 100644 index 0000000..80cf1a8 --- /dev/null +++ b/1.5/Defs/RoadDefs/RoadWorldLayerDefs.xml @@ -0,0 +1,8 @@ + + + + WhiteLine + 500 + (1.0, 1.0, 1.0) + + \ No newline at end of file diff --git a/1.5/Defs/TerrainDefs/Terrain_Road.xml b/1.5/Defs/TerrainDefs/Terrain_Road.xml new file mode 100644 index 0000000..18a9b78 --- /dev/null +++ b/1.5/Defs/TerrainDefs/Terrain_Road.xml @@ -0,0 +1,169 @@ + + + + DirtRecent + + Terrain/Surfaces/PackedDirt + + FadeRough + 360 + 1 + Packed dirt for recently built paths and roads. Neither beautiful nor clean, they still make good surfaces for cheap roads. Deconstructing packed dirt yields no resources. + false + + 0 + + -1 + -1 + + 0.0 + +
  • Light
  • +
  • Medium
  • +
  • Heavy
  • + +
    + +
  • Unnatural
  • +
    + +
  • Road
  • +
    + + Rocky + Filth_Dirt +
    + + StoneRecent + + Terrain/Surfaces/Flagstone + (126,104,94) + FadeRough + 220 + 0 + Roughly-cut stone recently built tiles. These are not beautiful, but they make good surfaces for roads and outdoor walkways. Deconstructing flagstone yields no resources. + true + 0 + + + 0 + + 0 + +
  • Light
  • +
  • Medium
  • +
  • Heavy
  • +
    + +
  • Road
  • +
    + +
    + + AsphaltRecent + + Terrain/Surfaces/AsphaltRecent + (96,96,96) + FadeRough + 380 + 0 + Recently built Asphalt. Excellent for roads. Deconstructing asphalt yields no resources. + true + 0 + + -1 + 0 + + 0.0 + +
  • Light
  • +
  • Medium
  • + +
  • Heavy
  • +
    + +
  • Road
  • +
    +
    + + ConcreteBridge + + Terrain/Surfaces/AsphaltRecent + + (128,128,128) + + Hard + 400 + A concrete bridge to be built over water. Heavy structures can be built on these bridges, but they can still be destroyed. If a bridge falls, buildings on top of it fall as well. + true + true + 0 + + 4500 + 0.1 + + 0 + +
  • Light
  • +
  • Medium
  • +
  • Heavy
  • +
    + Terrain/Surfaces/ConcreteBridge_MenuIcon + +
  • Terrain
  • +
  • Unnatural
  • +
  • Natural
  • +
    + ConstructMetal + true + Bridge_Collapse + Bridge_CollapseWater + 105 + + 25 + + Structure + BridgeableAny + +
    + + GlitterRoad + + Terrain/Surfaces/GlitterRoad + Hard + 380 + 0 + Spacer level actively supported roads. Deconstructing glitter roads yields no resources. + true + 0 + + 0 + 0 + + 0.0 + +
  • Light
  • +
  • Medium
  • +
  • Heavy
  • +
    + +
  • None
  • +
    + +
  • Road
  • +
    +
    +
    \ No newline at end of file diff --git a/1.5/Defs/ThingCategoryDefs/ThingCategories.xml b/1.5/Defs/ThingCategoryDefs/ThingCategories.xml new file mode 100644 index 0000000..fa4b26d --- /dev/null +++ b/1.5/Defs/ThingCategoryDefs/ThingCategories.xml @@ -0,0 +1,10 @@ + + + + RoadEquipment + + Root + UI/Icons/ThingCategories/RoadEquipment + true + + \ No newline at end of file diff --git a/1.5/Defs/ThingDefs/RotR_Buildings.xml b/1.5/Defs/ThingDefs/RotR_Buildings.xml new file mode 100644 index 0000000..720eeb0 --- /dev/null +++ b/1.5/Defs/ThingDefs/RotR_Buildings.xml @@ -0,0 +1,197 @@ + + + + RotR_ISR2GNew + + ThingWithComps + In Situ Road Ressource Gatherer. Uses local resources when building roads, completely eliminating the need to bring wood and stone at the cost of 4 times the work. + + Buildings/ISR2G + Graphic_Single + + Item + +
  • RoadEquipment
  • +
    + true + Item + true + Never + true + 10 + true + + 200 + 8000 + 50 + 1.0 + -20 + + Industrial + + 120 + 10 + + + GeneralLaborSpeed + Crafting + Smith + Recipe_Smith + +
  • TableMachining
  • +
    + UnfinishedComponent + ResearchProject_RotRISR2G + + 4 + +
    +
    + + RotR_AISR2GNew + + ThingWithComps + Advanced In Situ Road Ressources Gatherer. Uses local resources when building roads, completely eliminating the need to bring wood, stone , steel, Chemfuel , Plasteel and Uranium at the cost of twice the work. + + Buildings/AISR2G + Graphic_Single + + Item + +
  • RoadEquipment
  • +
    + true + Item + true + Never + true + 10 + true + + 200 + 16000 + 70 + 1.0 + -20 + + Spacer + + 120 + 8 + 70 + 5 + + + GeneralLaborSpeed + Crafting + Smith + Recipe_Smith + +
  • TableMachining
  • +
    + UnfinishedComponent + ResearchProject_RotRAISR2G + + 6 + +
    +
    + + RotR_ISR2G + + In Situ Road Ressources Gatherer. Uses local resources when building roads, completely eliminating the need to bring wood and stone at the cost of 4 times the work. + + Buildings/ISR2G + Graphic_Multi + (2,2) + + Damage/Corner + Damage/Corner + Damage/Corner + Damage/Corner + + + Building + PassThroughOnly + 70 + true + true + 0.40 + Normal + MinifiedThing + +
  • BuildingsPower
  • +
    + + 200 + 8000 + 50 + 1.0 + -20 + + (2,2) + Light + 0.2 + ConstructMetal + false + +
  • + RoadsOfTheRim.OldDefsCleanupComp +
  • +
    +
    + + RotR_AISR2G + + Advanced In Situ Road Ressources Gatherer. Uses local resources when building roads, completely eliminating the need to bring wood, stone , steel, Chemfuel , Plasteel and Uranium at the cost of twice the work. + + Buildings/AISR2G + Graphic_Multi + (2,2) + + Damage/Corner + Damage/Corner + Damage/Corner + Damage/Corner + + + Building + PassThroughOnly + 70 + true + true + 0.40 + Normal + MinifiedThing + +
  • BuildingsPower
  • +
    + + 200 + 16000 + 70 + 1.0 + -20 + + (2,2) + + 290 + 5 + 290 + 10 + + Light + Production + 0.2 + ConstructMetal + false + +
  • ResearchProject_RotRAISR2G
  • +
    + +
  • + RoadsOfTheRim.OldDefsCleanupComp +
  • +
    +
    +
    \ No newline at end of file diff --git a/1.5/Defs/WorldObjectDefs/WorldObjects.xml b/1.5/Defs/WorldObjectDefs/WorldObjects.xml new file mode 100644 index 0000000..d520759 --- /dev/null +++ b/1.5/Defs/WorldObjectDefs/WorldObjects.xml @@ -0,0 +1,33 @@ + + + + RoadConstructionSite + + The site of a road under construction + RoadsOfTheRim.RoadConstructionSite + World/WorldObjects/ConstructionSite + true + true + World/WorldObjects/Expanding/ConstructionSite + 90 + +
  • + + + + + RoadConstructionLeg + + Section of a planned road + RoadsOfTheRim.RoadConstructionLeg + World/WorldObjects/ConstructionLeg + true + true + World/WorldObjects/ConstructionLeg + 90 + + \ No newline at end of file diff --git a/1.5/Patches/patches.xml b/1.5/Patches/patches.xml new file mode 100644 index 0000000..eecc555 --- /dev/null +++ b/1.5/Patches/patches.xml @@ -0,0 +1,157 @@ + + + + /Defs/RoadDef + +
  • + false +
  • + + + + /Defs/RoadDef[defName = "DirtPath"]/modExtensions/li[@Class = "RoadsOfTheRim.DefModExtension_RotR_RoadDef"] + + + 600 + + + + + /Defs/RoadDef[defName = "DirtRoad"]/modExtensions/li[@Class = "RoadsOfTheRim.DefModExtension_RotR_RoadDef"] + + 0.25 + 0.2 + 0 + + 1200 + 120 + + + + + /Defs/RoadDef[defName = "StoneRoad"]/modExtensions/li[@Class = "RoadsOfTheRim.DefModExtension_RotR_RoadDef"] + + 0.75 + 0.4 + 0 + + 3600 + 240 + 1800 + 300 + + + + + /Defs/RoadDef[defName = "AncientAsphaltRoad"]/modExtensions/li[@Class = "RoadsOfTheRim.DefModExtension_RotR_RoadDef"] + + 1 + 0.6 + 0.2 + + 5400 + 3600 + 600 + 300 + + + + + /Defs/RoadDef[defName = "AncientAsphaltHighway"]/modExtensions/li[@Class = "RoadsOfTheRim.DefModExtension_RotR_RoadDef"] + + 1 + 0.6 + 0.2 + + 5400 + 3600 + 600 + 300 + + + + + /Defs/RoadDef[defName = "DirtPath"]/movementCostMultiplier + + 0.75 + + + + /Defs/RoadDef[defName = "DirtRoad"]/movementCostMultiplier + + 0.6 + + + + /Defs/RoadDef[defName = "StoneRoad"]/movementCostMultiplier + + 0.5 + + + + /Defs/RoadDef[defName = "AncientAsphaltRoad"]/movementCostMultiplier + + 0.4 + + + + /Defs/RoadDef[defName = "AncientAsphaltHighway"]/movementCostMultiplier + + 0.4 + + + + /Defs/WorldObjectDef[defName="Caravan"]/comps + + /Defs/WorldObjectDef[defName="Caravan"] + + +
  • + RoadsOfTheRim.WorldObjectComp_Caravan +
  • +
    +
    +
    + + /Defs/WorldObjectDef[defName="Caravan"]/comps + +
  • + RoadsOfTheRim.WorldObjectComp_Caravan +
  • +
    +
    +
    + + /Defs/WorldObjectDef[defName="Caravan"]/inspectorTabs + +
  • RoadsOfTheRim.WITab_Caravan_Build
  • +
    +
    + + /Defs/MapGeneratorDef[@Name="MapCommonBase"]/genSteps + +
  • RotR_CleanBuiltRoads
  • +
    +
    + + Always + /Defs/TerrainDef[@Name="WaterDeepBase"]/changeable + + + /Defs/TerrainDef[@Name="WaterDeepBase"]/affordances + + /Defs/TerrainDef[@Name="WaterDeepBase"] + + +
  • BridgeableAny
  • +
    +
    +
    + + /Defs/TerrainDef[@Name="WaterDeepBase"]/affordances + +
  • BridgeableAny
  • +
    +
    +
    + \ No newline at end of file diff --git a/About/About.xml b/About/About.xml index 263a856..9060e88 100644 --- a/About/About.xml +++ b/About/About.xml @@ -10,6 +10,7 @@
  • 1.2
  • 1.3
  • 1.4
  • +
  • 1.5
  • @@ -200,10 +201,14 @@ It will save a lot of your time (and a little bit of mine ;-) ) [list] [*] See if the the error persists if you just have this mod and its requirements active. [*] If not, try adding your other mods until it happens again. -[*] Post your error-log using [url=https://steamcommunity.com/workshop/filedetails/?id=818773962]HugsLib[/url] and command Ctrl+F12 +[*] Post your error-log using [url=https://steamcommunity.com/workshop/filedetails/?id=818773962]HugsLib[/url] or the standalone [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2873415404]Uploader[/url] and command Ctrl+F12 [*] For best support, please use the Discord-channel for error-reporting. [*] Do not report errors by making a discussion-thread, I get no notification of that. [*] If you have the solution for a problem, please post it to the GitHub repository. +[*] Use [url=https://github.com/RimSort/RimSort/releases/latest]RimSort[/url] to sort your mods [/list] -[url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2280318231]Last updated 2023-08-31[/url] + +[url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2280318231][img]https://img.shields.io/github/v/release/emipa606/RoadsOfTheRim?label=latest%20version&style=plastic&color=9f1111&labelColor=black[/img][/url] + ModIcon/RoadsOfTheRim + 1.5.0 \ No newline at end of file diff --git a/About/Changelog.txt b/About/Changelog.txt index 974a6e0..9a381e9 100644 --- a/About/Changelog.txt +++ b/About/Changelog.txt @@ -1,5 +1,8 @@ # Changelog for RoadsOfTheRim +1.5.0 - Mod updated for 1.5 and passed autotests + + 1.4.5 - Added research-requirements diff --git a/About/Manifest.xml b/About/Manifest.xml index 02ba9b2..11fe739 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RoadsOfTheRim - 1.4.5 + 1.5.0 diff --git a/About/ModSync.xml b/About/ModSync.xml index a7e722c..f2244ca 100644 --- a/About/ModSync.xml +++ b/About/ModSync.xml @@ -2,7 +2,7 @@ 1a0c92d0-3054-4626-a0d1-2ed267af412e Roads of the Rim (Continued) - 1.4.5 + 1.5.0 False emipa606 diff --git a/About/Preview.png b/About/Preview.png index 231620d..e75edf6 100644 Binary files a/About/Preview.png and b/About/Preview.png differ diff --git a/README.md b/README.md index 134feca..3fc2127 100644 --- a/README.md +++ b/README.md @@ -182,10 +182,13 @@ It will save a lot of your time (and a little bit of mine ;-) ) - See if the the error persists if you just have this mod and its requirements active. - If not, try adding your other mods until it happens again. -- Post your error-log using https://steamcommunity.com/workshop/filedetails/?id=818773962]HugsLib and command Ctrl+F12 +- Post your error-log using https://steamcommunity.com/workshop/filedetails/?id=818773962]HugsLib or the standalone https://steamcommunity.com/sharedfiles/filedetails/?id=2873415404]Uploader and command Ctrl+F12 - For best support, please use the Discord-channel for error-reporting. - Do not report errors by making a discussion-thread, I get no notification of that. - If you have the solution for a problem, please post it to the GitHub repository. +- Use https://github.com/RimSort/RimSort/releases/latest]RimSort to sort your mods -https://steamcommunity.com/sharedfiles/filedetails/changelog/2280318231]Last updated 2023-08-31 + +https://steamcommunity.com/sharedfiles/filedetails/changelog/2280318231]![Image](https://img.shields.io/github/v/release/emipa606/RoadsOfTheRim?label=latest%20version&style=plastic&color=9f1111&labelColor=black) + diff --git a/Source/RoadsOfTheRim.csproj.oldversioncscproj b/Source/RoadsOfTheRim.csproj.oldversioncscproj index 7ae1f00..f1aa5d8 100644 --- a/Source/RoadsOfTheRim.csproj.oldversioncscproj +++ b/Source/RoadsOfTheRim.csproj.oldversioncscproj @@ -1,16 +1,16 @@ - ..\..\1.3\Assemblies - net472 - false + ..\..\1.4\Assemblies + net48 false false None latest + 1.4.6 - * + * runtime compile; build; native; contentfiles; analyzers; buildtransitive @@ -18,6 +18,6 @@ * runtime + - - + \ No newline at end of file diff --git a/Source/RoadsOfTheRim/ConstructionMenu.cs b/Source/RoadsOfTheRim/ConstructionMenu.cs index 094769c..f3c5cd5 100644 --- a/Source/RoadsOfTheRim/ConstructionMenu.cs +++ b/Source/RoadsOfTheRim/ConstructionMenu.cs @@ -8,7 +8,7 @@ namespace RoadsOfTheRim; /* -Nice looking cartridge-style option picker +Nice looking cartridge-style option picker Layout : 1 vertical cartridge per type of buidalble road Each cartridge has : - A square image at the top, representing the type of road @@ -19,7 +19,7 @@ Nice looking cartridge-style option picker > Stone > Steel > Chemfuel -> etc.. +> etc. Each line starts with the icon of the resource (work uses the construction site icon) Upon clicking outside, the cartridge is closed with no further actions Upon clicking on a road icon, we set the roaddef of the site to that road and start targeting the map to add legs @@ -28,11 +28,9 @@ Each line starts with the icon of the resource (work uses the construction site * Widgets many methods */ -public class ConstructionMenu : Window +public class ConstructionMenu(RoadConstructionSite site, Caravan caravan) : Window { - private readonly List buildableRoads; - private readonly Caravan caravan; - private readonly RoadConstructionSite site; + private readonly List buildableRoads = []; // TO DO : Use the below to dynamically draw the window based on number of buildable roads (which could include technolcogy limits) // public bool resizeable = true ; @@ -40,13 +38,7 @@ public class ConstructionMenu : Window // private Rect resizeLaterRect ; - public ConstructionMenu(RoadConstructionSite site, Caravan caravan) - { - this.site = site; - this.caravan = caravan; - buildableRoads = new List(); - // TO DO : COunt number of buildable roads, set the resize later rect based on that - } + // TO DO : COunt number of buildable roads, set the resize later rect based on that public override Vector2 InitialSize => new Vector2(676 + 128, 544 + 128); diff --git a/Source/RoadsOfTheRim/DefModExtension_RotR_RoadDef.cs b/Source/RoadsOfTheRim/DefModExtension_RotR_RoadDef.cs index 3acce5f..9a22212 100644 --- a/Source/RoadsOfTheRim/DefModExtension_RotR_RoadDef.cs +++ b/Source/RoadsOfTheRim/DefModExtension_RotR_RoadDef.cs @@ -8,40 +8,41 @@ namespace RoadsOfTheRim; public class DefModExtension_RotR_RoadDef : DefModExtension { - public static string[] allResources = - { "WoodLog", "Stone", "Steel", "Chemfuel", "Plasteel", "Uranium", "ComponentIndustrial", "ComponentSpacer" }; + public static readonly string[] allResources = + ["WoodLog", "Stone", "Steel", "Chemfuel", "Plasteel", "Uranium", "ComponentIndustrial", "ComponentSpacer"]; - public static string[] allResourcesAndWork = - { + public static readonly string[] allResourcesAndWork = + [ "Work", "WoodLog", "Stone", "Steel", "Chemfuel", "Plasteel", "Uranium", "ComponentIndustrial", "ComponentSpacer" - }; + ]; - public static string[] allResourcesWithoutModifiers = { "Uranium", "ComponentIndustrial", "ComponentSpacer" }; + public static readonly string[] allResourcesWithoutModifiers = + ["Uranium", "ComponentIndustrial", "ComponentSpacer"]; // Base roads (DirtPath, DirtRoad, StoneRoad, AncientAsphaltRoad, AncientAsphaltHighway) will have this set to false, // Built roads (DirtPath+, DirtRoad+, StoneRoad+, AsphaltRoad+, GlitterRoad) will have this set to true // Built roads will prevent rocks from being generated on top of them on maps - public float biomeModifier = 0f; - public bool built = false; // Whether or not this road is built or generated + public readonly float biomeModifier = 0f; + public readonly bool built = false; // Whether this road is built or generated - public bool canBuildOnImpassable = false; + public readonly bool canBuildOnImpassable = false; - public bool canBuildOnWater = false; + public readonly bool canBuildOnWater = false; - public List costs = new List(); + public readonly List costs = []; - public float hillinessModifier = 0f; + public readonly float hillinessModifier = 0f; - public float minConstruction = 0f; + public readonly float minConstruction = 0f; - public float percentageOfminConstruction = 0f; + public readonly float percentageOfminConstruction = 0f; - public TechLevel techlevelToBuild = TechLevel.Neolithic; + public readonly TechLevel techlevelToBuild = TechLevel.Neolithic; - public ResearchProjectDef techNeededToBuild = null; + public readonly ResearchProjectDef techNeededToBuild = null; - public float winterModifier = 0f; + public readonly float winterModifier = 0f; public string GetCosts() { diff --git a/Source/RoadsOfTheRim/GenStep_CleanBuiltRoads.cs b/Source/RoadsOfTheRim/GenStep_CleanBuiltRoads.cs index 9c25255..aa1209d 100644 --- a/Source/RoadsOfTheRim/GenStep_CleanBuiltRoads.cs +++ b/Source/RoadsOfTheRim/GenStep_CleanBuiltRoads.cs @@ -33,7 +33,7 @@ public override void Generate(Map map, GenStepParams parms) if (thingList.Count > 0) { - //RoadsOfTheRim.DebugLog("Placed " + thingList.Count + " things on top of " + terrainDefHere.label); + //RoadsOfTheRim.DebugLog ( "Placed " + thingList.Count + " things on top of " + terrainDefHere.label); MoveThings(map, current); } diff --git a/Source/RoadsOfTheRim/HarmonyPatches.cs b/Source/RoadsOfTheRim/HarmonyPatches/HarmonyPatches.cs similarity index 95% rename from Source/RoadsOfTheRim/HarmonyPatches.cs rename to Source/RoadsOfTheRim/HarmonyPatches/HarmonyPatches.cs index ea11764..953fff3 100644 --- a/Source/RoadsOfTheRim/HarmonyPatches.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/HarmonyPatches.cs @@ -4,7 +4,7 @@ using RimWorld; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [StaticConstructorOnStartup] public class HarmonyPatches @@ -47,7 +47,7 @@ static HarmonyPatches() // TO DO : Ideally, this should be a transpiler. But should I bother ? The code below does the job /* - * Patching roads so they cancel all or part of the Tile.biome.movementDifficulty and Hilliness + * Patching roads, so they cancel all or part of the Tile.biome.movementDifficulty and Hilliness * The actual rates are stored in static method RoadsOfTheRim.calculateRoadModifier */ diff --git a/Source/RoadsOfTheRim/Patch_Alert_CaravanIdle_GetExplanation.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Alert_CaravanIdle_GetExplanation.cs similarity index 95% rename from Source/RoadsOfTheRim/Patch_Alert_CaravanIdle_GetExplanation.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_Alert_CaravanIdle_GetExplanation.cs index 2c48bb8..89f1312 100644 --- a/Source/RoadsOfTheRim/Patch_Alert_CaravanIdle_GetExplanation.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Alert_CaravanIdle_GetExplanation.cs @@ -3,7 +3,7 @@ using RimWorld; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(Alert_CaravanIdle), "GetExplanation")] public static class Patch_Alert_CaravanIdle_GetExplanation diff --git a/Source/RoadsOfTheRim/Patch_Alert_CaravanIdle_GetReport.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Alert_CaravanIdle_GetReport.cs similarity index 95% rename from Source/RoadsOfTheRim/Patch_Alert_CaravanIdle_GetReport.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_Alert_CaravanIdle_GetReport.cs index f5a4f8a..5f3d05b 100644 --- a/Source/RoadsOfTheRim/Patch_Alert_CaravanIdle_GetReport.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Alert_CaravanIdle_GetReport.cs @@ -4,7 +4,7 @@ using RimWorld.Planet; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(Alert_CaravanIdle), "GetReport")] public static class Patch_Alert_CaravanIdle_GetReport diff --git a/Source/RoadsOfTheRim/Patch_CaravanUIUtility_AddPawnsSections.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_CaravanUIUtility_AddPawnsSections.cs similarity index 89% rename from Source/RoadsOfTheRim/Patch_CaravanUIUtility_AddPawnsSections.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_CaravanUIUtility_AddPawnsSections.cs index 703d7aa..32d919c 100644 --- a/Source/RoadsOfTheRim/Patch_CaravanUIUtility_AddPawnsSections.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_CaravanUIUtility_AddPawnsSections.cs @@ -4,12 +4,12 @@ using RimWorld.Planet; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(CaravanUIUtility), "AddPawnsSections")] /* -* Adds a Road equipment section to pawns & animals -*/ + * Adds a Road equipment section to pawns & animals + */ public static class Patch_CaravanUIUtility_AddPawnsSections { [HarmonyPostfix] diff --git a/Source/RoadsOfTheRim/Patch_CaravanUIUtility_CreateCaravanTransferableWidgets.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_CaravanUIUtility_CreateCaravanTransferableWidgets.cs similarity index 96% rename from Source/RoadsOfTheRim/Patch_CaravanUIUtility_CreateCaravanTransferableWidgets.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_CaravanUIUtility_CreateCaravanTransferableWidgets.cs index 71ec416..fab0530 100644 --- a/Source/RoadsOfTheRim/Patch_CaravanUIUtility_CreateCaravanTransferableWidgets.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_CaravanUIUtility_CreateCaravanTransferableWidgets.cs @@ -6,7 +6,7 @@ using RimWorld.Planet; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(CaravanUIUtility), "CreateCaravanTransferableWidgets")] //Remove Road equipment from Item tab when forming caravans diff --git a/Source/RoadsOfTheRim/Patch_Caravan_GetGizmos.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Caravan_GetGizmos.cs similarity index 97% rename from Source/RoadsOfTheRim/Patch_Caravan_GetGizmos.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_Caravan_GetGizmos.cs index 66eedf0..c8262c0 100644 --- a/Source/RoadsOfTheRim/Patch_Caravan_GetGizmos.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Caravan_GetGizmos.cs @@ -6,7 +6,7 @@ using RimWorld.Planet; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(Caravan), "GetGizmos")] public static class Patch_Caravan_GetGizmos diff --git a/Source/RoadsOfTheRim/Patch_Caravan_GetInspectString.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Caravan_GetInspectString.cs similarity index 98% rename from Source/RoadsOfTheRim/Patch_Caravan_GetInspectString.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_Caravan_GetInspectString.cs index b25f1cd..8cb0dd0 100644 --- a/Source/RoadsOfTheRim/Patch_Caravan_GetInspectString.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Caravan_GetInspectString.cs @@ -4,7 +4,7 @@ using RimWorld.Planet; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(Caravan), "GetInspectString")] public static class Patch_Caravan_GetInspectString diff --git a/Source/RoadsOfTheRim/Patch_Designator_RemoveBridge_CanDesignateCell.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Designator_RemoveBridge_CanDesignateCell.cs similarity index 93% rename from Source/RoadsOfTheRim/Patch_Designator_RemoveBridge_CanDesignateCell.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_Designator_RemoveBridge_CanDesignateCell.cs index 40809af..83e7aa5 100644 --- a/Source/RoadsOfTheRim/Patch_Designator_RemoveBridge_CanDesignateCell.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Designator_RemoveBridge_CanDesignateCell.cs @@ -2,7 +2,7 @@ using RimWorld; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(Designator_RemoveBridge), "CanDesignateCell")] public static class Patch_Designator_RemoveBridge_CanDesignateCell diff --git a/Source/RoadsOfTheRim/Patch_FactionDialogMaker_FactionDialogFor.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_FactionDialogMaker_FactionDialogFor.cs similarity index 93% rename from Source/RoadsOfTheRim/Patch_FactionDialogMaker_FactionDialogFor.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_FactionDialogMaker_FactionDialogFor.cs index f9913fc..b533706 100644 --- a/Source/RoadsOfTheRim/Patch_FactionDialogMaker_FactionDialogFor.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_FactionDialogMaker_FactionDialogFor.cs @@ -2,7 +2,7 @@ using RimWorld; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(FactionDialogMaker), "FactionDialogFor")] public static class Patch_FactionDialogMaker_FactionDialogFor diff --git a/Source/RoadsOfTheRim/Patch_GenConstruct_CanBuildOnTerrain.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_GenConstruct_CanBuildOnTerrain.cs similarity index 93% rename from Source/RoadsOfTheRim/Patch_GenConstruct_CanBuildOnTerrain.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_GenConstruct_CanBuildOnTerrain.cs index 5cc08c0..723c307 100644 --- a/Source/RoadsOfTheRim/Patch_GenConstruct_CanBuildOnTerrain.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_GenConstruct_CanBuildOnTerrain.cs @@ -2,7 +2,7 @@ using RimWorld; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(GenConstruct), "CanBuildOnTerrain")] public static class Patch_GenConstruct_CanBuildOnTerrain diff --git a/Source/RoadsOfTheRim/Patch_GenConstruct_CanPlaceBlueprintAt.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_GenConstruct_CanPlaceBlueprintAt.cs similarity index 93% rename from Source/RoadsOfTheRim/Patch_GenConstruct_CanPlaceBlueprintAt.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_GenConstruct_CanPlaceBlueprintAt.cs index 0f3b56f..fa2a9ba 100644 --- a/Source/RoadsOfTheRim/Patch_GenConstruct_CanPlaceBlueprintAt.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_GenConstruct_CanPlaceBlueprintAt.cs @@ -2,7 +2,7 @@ using RimWorld; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(GenConstruct), "CanPlaceBlueprintAt")] public static class Patch_GenConstruct_CanPlaceBlueprintAt diff --git a/Source/RoadsOfTheRim/Patch_RoadDefGenStep_Place_Place.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_RoadDefGenStep_Place_Place.cs similarity index 96% rename from Source/RoadsOfTheRim/Patch_RoadDefGenStep_Place_Place.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_RoadDefGenStep_Place_Place.cs index 56effc4..b2739be 100644 --- a/Source/RoadsOfTheRim/Patch_RoadDefGenStep_Place_Place.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_RoadDefGenStep_Place_Place.cs @@ -2,7 +2,7 @@ using RimWorld; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(RoadDefGenStep_Place), "Place")] public static class Patch_RoadDefGenStep_Place_Place diff --git a/Source/RoadsOfTheRim/Patch_ThingFilter_SetFromPreset.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_ThingFilter_SetFromPreset.cs similarity index 92% rename from Source/RoadsOfTheRim/Patch_ThingFilter_SetFromPreset.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_ThingFilter_SetFromPreset.cs index 3f45161..34d52c4 100644 --- a/Source/RoadsOfTheRim/Patch_ThingFilter_SetFromPreset.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_ThingFilter_SetFromPreset.cs @@ -2,7 +2,7 @@ using RimWorld; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(ThingFilter), "SetFromPreset")] //Remove Road equipment from Item tab when forming caravans diff --git a/Source/RoadsOfTheRim/Patch_Tile_Roads.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Tile_Roads.cs similarity index 89% rename from Source/RoadsOfTheRim/Patch_Tile_Roads.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_Tile_Roads.cs index 232bbe2..2c3b6f8 100644 --- a/Source/RoadsOfTheRim/Patch_Tile_Roads.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_Tile_Roads.cs @@ -2,7 +2,7 @@ using HarmonyLib; using RimWorld.Planet; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(Tile), "Roads", MethodType.Getter)] public static class Patch_Tile_Roads diff --git a/Source/RoadsOfTheRim/Patch_WorldGrid_GetRoadMovementDifficultyMultiplier.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_WorldGrid_GetRoadMovementDifficultyMultiplier.cs similarity index 94% rename from Source/RoadsOfTheRim/Patch_WorldGrid_GetRoadMovementDifficultyMultiplier.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_WorldGrid_GetRoadMovementDifficultyMultiplier.cs index ba3dd41..176abd2 100644 --- a/Source/RoadsOfTheRim/Patch_WorldGrid_GetRoadMovementDifficultyMultiplier.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_WorldGrid_GetRoadMovementDifficultyMultiplier.cs @@ -4,13 +4,13 @@ using RimWorld.Planet; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(WorldGrid), "GetRoadMovementDifficultyMultiplier")] public static class Patch_WorldGrid_GetRoadMovementDifficultyMultiplier { private static readonly MethodInfo HillinessMovementDifficultyOffset = AccessTools.Method(typeof(WorldPathGrid), - "HillinessMovementDifficultyOffset", new[] { typeof(Hilliness) }); + "HillinessMovementDifficultyOffset", [typeof(Hilliness)]); [HarmonyPostfix] public static void Postifx(ref float __result, WorldGrid __instance, ref int fromTile, ref int toTile, @@ -36,7 +36,7 @@ public static void Postifx(ref float __result, WorldGrid __instance, ref int fro var ToTileAsTile = Find.WorldGrid[toTile]; var HillinessOffset = - (float)HillinessMovementDifficultyOffset.Invoke(null, new object[] { ToTileAsTile.hilliness }); + (float)HillinessMovementDifficultyOffset.Invoke(null, [ToTileAsTile.hilliness]); if (HillinessOffset > 12f) { HillinessOffset = 12f; diff --git a/Source/RoadsOfTheRim/Patch_WorldPathGrid_CalculatedMovementDifficultyAt.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_WorldPathGrid_CalculatedMovementDifficultyAt.cs similarity index 98% rename from Source/RoadsOfTheRim/Patch_WorldPathGrid_CalculatedMovementDifficultyAt.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_WorldPathGrid_CalculatedMovementDifficultyAt.cs index 326db98..e5191e4 100644 --- a/Source/RoadsOfTheRim/Patch_WorldPathGrid_CalculatedMovementDifficultyAt.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_WorldPathGrid_CalculatedMovementDifficultyAt.cs @@ -4,7 +4,7 @@ using RimWorld.Planet; using Verse; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(WorldPathGrid), "CalculatedMovementDifficultyAt")] internal static class Patch_WorldPathGrid_CalculatedMovementDifficultyAt diff --git a/Source/RoadsOfTheRim/Patch_WorldTargeter_StopTargeting.cs b/Source/RoadsOfTheRim/HarmonyPatches/Patch_WorldTargeter_StopTargeting.cs similarity index 93% rename from Source/RoadsOfTheRim/Patch_WorldTargeter_StopTargeting.cs rename to Source/RoadsOfTheRim/HarmonyPatches/Patch_WorldTargeter_StopTargeting.cs index 7cb8bbf..e32a768 100644 --- a/Source/RoadsOfTheRim/Patch_WorldTargeter_StopTargeting.cs +++ b/Source/RoadsOfTheRim/HarmonyPatches/Patch_WorldTargeter_StopTargeting.cs @@ -1,7 +1,7 @@ using HarmonyLib; using RimWorld; -namespace RoadsOfTheRim; +namespace RoadsOfTheRim.HarmonyPatches; [HarmonyPatch(typeof(WorldTargeter), "StopTargeting")] public static class Patch_WorldTargeter_StopTargeting diff --git a/Source/RoadsOfTheRim/RoadConstructionLeg.cs b/Source/RoadsOfTheRim/RoadConstructionLeg.cs index 5130fd2..ea45f9d 100644 --- a/Source/RoadsOfTheRim/RoadConstructionLeg.cs +++ b/Source/RoadsOfTheRim/RoadConstructionLeg.cs @@ -227,7 +227,7 @@ public static void Target(RoadConstructionSite site) } /* - * Remove all legs up to and including the one passed in argument + * Remove all legs up to and including the one passed in argument */ public static void Remove(RoadConstructionLeg leg) { diff --git a/Source/RoadsOfTheRim/RoadConstructionSite.cs b/Source/RoadsOfTheRim/RoadConstructionSite.cs index 7346ad2..43a84b3 100644 --- a/Source/RoadsOfTheRim/RoadConstructionSite.cs +++ b/Source/RoadsOfTheRim/RoadConstructionSite.cs @@ -27,7 +27,7 @@ public class RoadConstructionSite : WorldObject /* Factions help - - Faction that helps + - Faction that helps - Tick at which help starts - Total amount of work that will be provided (helping factions are always considered having enough resources to help) - Amount of work that will be done per tick @@ -203,7 +203,7 @@ public override void PostAdd() } /* - * Returns the next leg in the chain, or null if all is left is the construction site (which should never happen, since it should get destroyed when the last leg is built) + * Returns the next leg in the chain, or null if all is left is the construction site (which should never happen, since it should get destroyed when the last leg is built) */ public RoadConstructionLeg GetNextLeg() { @@ -418,7 +418,7 @@ public float FactionHelp() helpAmount -= amountOfHelp; } - // Cancel help if the faction is not an ally any more + // Cancel help if the faction is not an ally anymore else { Find.LetterStack.ReceiveLetter( diff --git a/Source/RoadsOfTheRim/RoadsOfTheRim.cs b/Source/RoadsOfTheRim/RoadsOfTheRim.cs index 72ee601..74fe5af 100644 --- a/Source/RoadsOfTheRim/RoadsOfTheRim.cs +++ b/Source/RoadsOfTheRim/RoadsOfTheRim.cs @@ -14,7 +14,7 @@ public class RoadsOfTheRim : Mod { public static RoadsOfTheRimSettings settings; - public static readonly List builtRoadTerrains = new List(); + public static readonly List builtRoadTerrains = []; private static string currentVersion; public RoadsOfTheRim(ModContentPack content) : base(content) @@ -25,8 +25,8 @@ public RoadsOfTheRim(ModContentPack content) : base(content) /*********************************** - * Static links to WorldComponents * - ***********************************/ + * Static links to WorldComponents * + ***********************************/ public static WorldComponent_FactionRoadConstructionHelp FactionsHelp { @@ -100,17 +100,16 @@ public static float CalculateRoadModifier(RoadDef roadDef, float BiomeMovementDi Based on the Caravan's resources, Pawns & the road's cost (modified by terrain) : - Determine the amount of work done in a tick - Consume the caravan's resources - - Return whether or not the Caravan must now stop because it ran out of resources + - Return whether the Caravan must now stop because it ran out of resources - NOTE : Does this need to be here ? Maybe better in Mod.cs * Returns TRUE if work finished - * CALLED FROM : CompTick() of WorldObjectComp_Caravan + * CALLED FROM : CompTick() of WorldObjectComp_Caravan */ - public static bool DoSomeWork(Caravan caravan, RoadConstructionSite site, out bool noMoreResources) + public static bool DoSomeWork(Caravan caravan, RoadConstructionSite site) { var caravanComp = caravan.GetComponent(); var siteComp = site.GetComponent(); _ = site.roadDef.GetModExtension(); - noMoreResources = false; var useISR2G = caravanComp.UseISR2G(); var available = new Dictionary(); var needed = new Dictionary(); @@ -254,7 +253,7 @@ public static bool DoSomeWork(Caravan caravan, RoadConstructionSite site, out bo /*********************************** - * Settings * + * Settings * ***********************************/ public override string SettingsCategory() @@ -324,7 +323,7 @@ public override void DoSettingsWindowContents(Rect rect) } /******************************** - * Gizmos commands * + * Gizmos commands * ********************************/ public static Command AddConstructionSite(Caravan caravan) @@ -447,7 +446,7 @@ Remove Construction Site */ public static Command RemoveConstructionSite(int tile) { - // TO DO : Refactor this so we find the site first, to pass it to Deleteconstructionsite directly, or even get rid of that function all together + // TO DO : Refactor this, so we find the site first, to pass it to Deleteconstructionsite directly, or even get rid of that function all together var command_Action = new Command_Action { defaultLabel = "RoadsOfTheRimRemoveConstructionSite".Translate(), @@ -588,7 +587,7 @@ public static DiaOption HelpRoadConstruction(Faction faction, Pawn negotiator) /******************************** - * Convenience static functions * + * Convenience static functions * ********************************/ // Compares the movement cost multiplier of 2 roaddefs, returns TRUE if roadA is better or roadB is null. returns FALSE in all other cases @@ -608,7 +607,7 @@ public static bool IsRoadBetter(RoadDef roadA, RoadDef roadB) } /* - Tells me whether or not a ThingDef is what I want + Tells me whether a ThingDef is what I want */ private static bool IsThis(ThingDef def, string name) { diff --git a/Source/RoadsOfTheRim/RoadsOfTheRim.csproj b/Source/RoadsOfTheRim/RoadsOfTheRim.csproj index d2fc4cd..584d217 100644 --- a/Source/RoadsOfTheRim/RoadsOfTheRim.csproj +++ b/Source/RoadsOfTheRim/RoadsOfTheRim.csproj @@ -1,16 +1,16 @@ - ..\..\1.4\Assemblies + ..\..\1.5\Assemblies net48 false false None latest - 1.4.5 + 1.5.0 - * + 1.5.4045-beta runtime compile; build; native; contentfiles; analyzers; buildtransitive diff --git a/Source/RoadsOfTheRim/RotR_StaticConstructorOnStartup.cs b/Source/RoadsOfTheRim/RotR_StaticConstructorOnStartup.cs index 94a0157..13fb212 100644 --- a/Source/RoadsOfTheRim/RotR_StaticConstructorOnStartup.cs +++ b/Source/RoadsOfTheRim/RotR_StaticConstructorOnStartup.cs @@ -10,7 +10,7 @@ internal static class RotR_StaticConstructorOnStartup public static readonly Texture2D ConstructionLeg_MouseAttachment = ContentFinder.Get("UI/Overlays/ConstructionLeg"); - public static Material ConstructionLegLast_Material = MaterialPool.MatFrom( + public static readonly Material ConstructionLegLast_Material = MaterialPool.MatFrom( "World/WorldObjects/ConstructionLegLast", ShaderDatabase.WorldOverlayTransparentLit, WorldMaterials.DynamicObjectRenderQueue); } \ No newline at end of file diff --git a/Source/RoadsOfTheRim/SettlementInfo.cs b/Source/RoadsOfTheRim/SettlementInfo.cs index 173bab1..a2a65b7 100644 --- a/Source/RoadsOfTheRim/SettlementInfo.cs +++ b/Source/RoadsOfTheRim/SettlementInfo.cs @@ -3,13 +3,8 @@ namespace RoadsOfTheRim; public class SettlementInfo // Convenience class to store Settlements and their distance to the Site + (Settlement s, int d) { - public int distance; - public Settlement settlement; - - public SettlementInfo(Settlement s, int d) - { - settlement = s; - distance = d; - } + public readonly int distance = d; + public readonly Settlement settlement = s; } \ No newline at end of file diff --git a/Source/RoadsOfTheRim/TerrainDefOf.cs b/Source/RoadsOfTheRim/TerrainDefOf.cs index a7d2437..6140678 100644 --- a/Source/RoadsOfTheRim/TerrainDefOf.cs +++ b/Source/RoadsOfTheRim/TerrainDefOf.cs @@ -20,5 +20,5 @@ public static class TerrainDefOf /* * Both Concrete bridges, Stone Roads, and Asphalt roads must check the terrain they're placed on and : * - Change it (Marsh & marshy soil to be removed when a "good" road was placed - * - Be placed despite affordance (Concrete bridges on top of normal bridgeable water) + * - Be placed despite affordance (Concrete bridges on top of normal bridgeable water) */ \ No newline at end of file diff --git a/Source/RoadsOfTheRim/WorldComponent_FactionRoadConstructionHelp.cs b/Source/RoadsOfTheRim/WorldComponent_FactionRoadConstructionHelp.cs index cde178c..1f316a6 100644 --- a/Source/RoadsOfTheRim/WorldComponent_FactionRoadConstructionHelp.cs +++ b/Source/RoadsOfTheRim/WorldComponent_FactionRoadConstructionHelp.cs @@ -6,7 +6,7 @@ namespace RoadsOfTheRim; -public class WorldComponent_FactionRoadConstructionHelp : WorldComponent +public class WorldComponent_FactionRoadConstructionHelp(World world) : WorldComponent(world) { private const int helpCooldownTicks = @@ -22,20 +22,16 @@ private const int private const float helpPerTickVariance = 10f; private const float helpPerTickMin = 5f; - private List boolList_currentlyHelping = new List(); + private List boolList_currentlyHelping = []; private Dictionary canHelpAgainAtTick = new Dictionary(); private Dictionary currentlyHelping = new Dictionary(); // those lists are used for ExposeData() to load & save correctly - private List factionList_canHelpAgainAtTick = new List(); - private List factionList_currentlyHelping = new List(); - private List intList_canHelpAgainAtTick = new List(); - - public WorldComponent_FactionRoadConstructionHelp(World world) : base(world) - { - } + private List factionList_canHelpAgainAtTick = []; + private List factionList_currentlyHelping = []; + private List intList_canHelpAgainAtTick = []; public override void ExposeData() { diff --git a/Source/RoadsOfTheRim/WorldComponent_RoadBuildingState.cs b/Source/RoadsOfTheRim/WorldComponent_RoadBuildingState.cs index eafd4d7..7786e70 100644 --- a/Source/RoadsOfTheRim/WorldComponent_RoadBuildingState.cs +++ b/Source/RoadsOfTheRim/WorldComponent_RoadBuildingState.cs @@ -2,13 +2,8 @@ namespace RoadsOfTheRim; -public class WorldComponent_RoadBuildingState : WorldComponent +public class WorldComponent_RoadBuildingState(World world) : WorldComponent(world) { - public WorldComponent_RoadBuildingState(World world) : base(world) - { - CurrentlyTargeting = null; - } - public RoadConstructionSite CurrentlyTargeting { get; set; } public Caravan Caravan { get; set; } diff --git a/Source/RoadsOfTheRim/WorldObjectComp_Caravan.cs b/Source/RoadsOfTheRim/WorldObjectComp_Caravan.cs index b80bf46..9b37c59 100644 --- a/Source/RoadsOfTheRim/WorldObjectComp_Caravan.cs +++ b/Source/RoadsOfTheRim/WorldObjectComp_Caravan.cs @@ -94,7 +94,7 @@ public override void CompTick() { base.CompTick(); site.TryToSkipBetterRoads(caravan); // No need to work if there's a better road here - if (RoadsOfTheRim.DoSomeWork(caravan, GetSite(), out _)) + if (RoadsOfTheRim.DoSomeWork(caravan, GetSite())) { StopWorking(); UnsetSite(); @@ -179,10 +179,10 @@ public void StopWorking() } /* - * Amount of work : - * - Construction speed (0.5 + 0.15 per level) times the construct success chance (0.75 to 1.13 - lvl 8 is 1) - * - Pack animals help as well (see below) - */ + * Amount of work : + * - Construction speed (0.5 + 0.15 per level) times the construct success chance (0.75 to 1.13 - lvl 8 is 1) + * - Pack animals help as well (see below) + */ public float AmountOfWork(bool verbose = false) { var pawns = GetCaravan().PawnsListForReading; diff --git a/Source/RoadsOfTheRim/WorldObjectComp_ConstructionSite.cs b/Source/RoadsOfTheRim/WorldObjectComp_ConstructionSite.cs index e108c89..c684143 100644 --- a/Source/RoadsOfTheRim/WorldObjectComp_ConstructionSite.cs +++ b/Source/RoadsOfTheRim/WorldObjectComp_ConstructionSite.cs @@ -14,32 +14,25 @@ public class WorldObjectComp_ConstructionSite : WorldObjectComp private Dictionary costs = new Dictionary(); // Used for ExposeData() - private List costs_Keys = new List(); - private List costs_Values = new List(); + private List costs_Keys = []; + private List costs_Values = []; private Dictionary left = new Dictionary(); - private List left_Keys = new List(); - private List left_Values = new List(); + private List left_Keys = []; + private List left_Values = []; public CompProperties_RoadsOfTheRimConstructionSite Properties => (CompProperties_RoadsOfTheRimConstructionSite)props; public int GetCost(string name) { - return !costs.TryGetValue(name, out var value) - ? 0 - : // TO DO : Throwing an excepion would be bettah - value; + // TO DO : Throwing an excepion would be bettah + return costs.GetValueOrDefault(name, 0); } public float GetLeft(string name) { - if (!left.TryGetValue(name, out var value)) - { - return 0; // TO DO : Throwing an excepion would be bettah - } - - return value; + return left.GetValueOrDefault(name, 0); // TO DO : Throwing an excepion would be bettah } public void ReduceLeft(string name, float amount) @@ -84,7 +77,7 @@ private static void GetCostsModifiers(int fromTile_int, int toTile_int, ref floa : (toTile.elevation - settings.CostIncreaseElevationThreshold) / RoadsOfTheRimSettings.ElevationCostDouble; - // Hilliness and swampiness are the average between that of the from & to tiles + // Hilliness and swampiness are the average between that of the form & to tiles // Hilliness is 0 on flat terrain, never negative. It's between 0 (flat) and 5(Impassable) var hilliness = Math.Max((((float)fromTile.hilliness + (float)toTile.hilliness) / 2) - 1, 0); var swampiness = (fromTile.swampiness + toTile.swampiness) / 2; @@ -110,7 +103,7 @@ private static void GetCostsModifiers(int fromTile_int, int toTile_int, ref floa } /* - * For resources (including work) that are part of the cost of both the road to build and the best existing road, + * For resources (including work) that are part of the cost of both the road to build and the best existing road, * grant CostUpgradeRebate% (default 30%) of the best existing road build costs as a rebate on the costs of the road to be built * i.e. the exisitng road cost 300 stones, the new road cost 600 stones, the rebate is 300*30% = 90 stones */ @@ -179,7 +172,7 @@ public static string CostModifersDescription(int fromTile_int, int toTile_int, r /* - * Faction help must be handled here, since it's independent of whether or not a caravan is here. + * Faction help must be handled here, since it's independent of whether a caravan is here. * Make it with a delay of 1/50 s compared to the CaravanComp so both functions end up playing nicely along each other * Don't work at night ! */ @@ -347,7 +340,7 @@ public bool FinishWork(Caravan caravan = null) } else { - fromTile.potentialRoads = new List(); + fromTile.potentialRoads = []; } if (toTile.potentialRoads != null) @@ -363,7 +356,7 @@ public bool FinishWork(Caravan caravan = null) } else { - toTile.potentialRoads = new List(); + toTile.potentialRoads = []; } // Add the road to fromTile & toTile @@ -413,7 +406,7 @@ public bool FinishWork(Caravan caravan = null) public void EndConstruction(Caravan caravan = null) { // On the last leg, send letter & remove the construction site - if (!(parent is RoadConstructionSite parentSite)) + if (parent is not RoadConstructionSite parentSite) { return; } diff --git a/Source/metadata.json b/Source/metadata.json index e7c57ab..29166ec 100644 --- a/Source/metadata.json +++ b/Source/metadata.json @@ -2,5 +2,5 @@ "Continued": true, "CanAdd": "0", "CanRemove": "2", - "PreviewVersion": "1.4" + "PreviewVersion": "1.5" } diff --git a/About/ModIcon.png b/Textures/ModIcon/RoadsOfTheRim.png similarity index 100% rename from About/ModIcon.png rename to Textures/ModIcon/RoadsOfTheRim.png