diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f0e18a..6f9a3fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ jobs: name: Build Mod runs-on: ubuntu-latest env: - MODKIT_VERSION: 0.11.1.3-beta-release-795 + MODKIT_VERSION: 0.11.1.9-beta-release-842 ECO_BRANCH: staging steps: - uses: actions/checkout@v4 @@ -21,15 +21,6 @@ jobs: run: dotnet restore ./EcoLawExtensionsMod/EcoLawExtensionsMod.csproj env: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 - - name: Cache Eco dlls - id: cache-eco-dlls - uses: actions/cache@v4 - with: - path: ./eco-dlls - key: ${{ env.MODKIT_VERSION }}-ref-dlls - - name: Download Eco dlls - if: steps.cache-eco-dlls.outputs.cache-hit != 'true' - run: sh fetch-eco-reference-assemblies.sh - name: Build run: dotnet build ./EcoLawExtensionsMod/EcoLawExtensionsMod.csproj --configuration Release --no-restore /p:AssemblyVersion=${{github.event.release.tag_name}} env: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index e7f667d..a1d78ce 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -10,7 +10,7 @@ jobs: name: Build Mod runs-on: ubuntu-latest env: - MODKIT_VERSION: 0.11.1.3-beta-release-795 + MODKIT_VERSION: 0.11.1.6-beta-release-842 ECO_BRANCH: staging steps: - uses: actions/checkout@v4 @@ -22,15 +22,6 @@ jobs: run: dotnet restore ./EcoLawExtensionsMod/EcoLawExtensionsMod.csproj env: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 - - name: Cache Eco dlls - id: cache-eco-dlls - uses: actions/cache@v4 - with: - path: ./eco-dlls - key: ${{ env.MODKIT_VERSION }}-ref-dlls - - name: Download Eco dlls - if: steps.cache-eco-dlls.outputs.cache-hit != 'true' - run: sh fetch-eco-reference-assemblies.sh - name: Build run: dotnet build ./EcoLawExtensionsMod/EcoLawExtensionsMod.csproj --configuration Release --no-restore env: diff --git a/EcoLawExtensionsMod/EcoLawExtensionsMod.csproj b/EcoLawExtensionsMod/EcoLawExtensionsMod.csproj index 50108d8..286b2ef 100644 --- a/EcoLawExtensionsMod/EcoLawExtensionsMod.csproj +++ b/EcoLawExtensionsMod/EcoLawExtensionsMod.csproj @@ -12,32 +12,8 @@ - - - - ..\eco-dlls\Eco.Core.dll - - - ..\eco-dlls\Eco.Gameplay.dll - - - ..\eco-dlls\Eco.ModKit.dll - - - ..\eco-dlls\Eco.Plugins.dll - - - ..\eco-dlls\Eco.Shared.dll - - - ..\eco-dlls\Eco.Simulation.dll - - - ..\eco-dlls\Eco.Stats.dll - - - + diff --git a/EcoLawExtensionsMod/LawExtensionsPlugin.cs b/EcoLawExtensionsMod/LawExtensionsPlugin.cs index 18e365a..fb5f811 100644 --- a/EcoLawExtensionsMod/LawExtensionsPlugin.cs +++ b/EcoLawExtensionsMod/LawExtensionsPlugin.cs @@ -48,6 +48,9 @@ public class LawExtensionsConfig { [LocDescription("Seconds between each power grid law tick. Set to 0 to disable.")] public int TickInterval { get; set; } = 30; + + [LocDescription("List of tags to be ignored by the TurnOnMachines-Action")] + public List TurnOnIgnoreTags { get; set; } = ["LargeDoor"]; } [Localized, LocDisplayName(nameof(LawExtensionsPlugin)), Priority(PriorityAttribute.High)] diff --git a/EcoLawExtensionsMod/LegalActions/TurnOnMachines.cs b/EcoLawExtensionsMod/LegalActions/TurnOnMachines.cs index 8941917..5966354 100644 --- a/EcoLawExtensionsMod/LegalActions/TurnOnMachines.cs +++ b/EcoLawExtensionsMod/LegalActions/TurnOnMachines.cs @@ -21,6 +21,7 @@ namespace Eco.Mods.LawExtensions using Gameplay.Components; using Gameplay.Settlements; using Gameplay.Economy.Transfer; + using Gameplay.Items; [Eco, LocCategory("Misc"), CreateComponentTabLoc("Eco Law Extensions", IconName = "Law"), LocDisplayName("Turn On Machines"), LocDescription("Tries to turn on all inactive machines that match a set of conditions.")] public class TurnOnMachines_LegalAction : LegalAction @@ -66,7 +67,9 @@ private PostResult Do(LocString description, IContextObject context, Settlement { int cnt = 0; var allRelevantObjects = WorldObjectUtil.AllObjsWithComponent() - .Where(x => x != null && !x.On && (jurisdictionSettlement?.Influences(x.Parent.WorldPosXZi()) ?? true)); + .Where(x => x != null && + !x.On && (jurisdictionSettlement?.Influences(x.Parent.WorldPosXZi()) ?? true) && + !x.Parent.TagNames().Intersect(LawExtensionsPlugin.Obj.Config.TurnOnIgnoreTags).Any()); foreach (var onOffComponent in allRelevantObjects) { var worldObject = onOffComponent.Parent; diff --git a/README.md b/README.md index f509719..438676f 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ Extracts the X/Z coordinate from a location. This will be an integer in whole bl #### Turn On Machines -Tries to turn on machines belonging to a citizen or group that are currently turned off. The filter can specify how the machines were turned off - for example, only try to turn on machines that were turned off legally (e.g. via prevent on Pollute Air). +Tries to turn on machines belonging to a citizen or group that are currently turned off. The filter can specify how the machines were turned off - for example, only try to turn on machines that were turned off legally (e.g. via prevent on Pollute Air). Note that anything configured by the server in the mod's 'TurnOnIgnoreTags' setting will be ignored by this action. | Property Name | Type | Description | | - | - | - | diff --git a/fetch-eco-reference-assemblies.sh b/fetch-eco-reference-assemblies.sh deleted file mode 100644 index 3eaf257..0000000 --- a/fetch-eco-reference-assemblies.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -MODKIT_FILENAME="EcoModKit_v$MODKIT_VERSION.zip" - -mkdir -p ./eco-dlls -if [ $ECO_BRANCH = "release" ] -then - wget "https://play.eco/s3/$ECO_BRANCH/$MODKIT_FILENAME" -else - wget "https://eco-releases-$ECO_BRANCH-eu.s3.eu-central-1.amazonaws.com/$MODKIT_FILENAME" -fi -unzip -o $MODKIT_FILENAME -d ./tmp -cp ./tmp/ReferenceAssemblies/*.dll ./eco-dlls -rm -r ./tmp -rm $MODKIT_FILENAME \ No newline at end of file