Skip to content
Merged
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
11 changes: 1 addition & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
26 changes: 1 addition & 25 deletions EcoLawExtensionsMod/EcoLawExtensionsMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,8 @@
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>

<ItemGroup>
<Reference Include="Eco.Core">
<HintPath>..\eco-dlls\Eco.Core.dll</HintPath>
</Reference>
<Reference Include="Eco.Gameplay">
<HintPath>..\eco-dlls\Eco.Gameplay.dll</HintPath>
</Reference>
<Reference Include="Eco.ModKit">
<HintPath>..\eco-dlls\Eco.ModKit.dll</HintPath>
</Reference>
<Reference Include="Eco.Plugins">
<HintPath>..\eco-dlls\Eco.Plugins.dll</HintPath>
</Reference>
<Reference Include="Eco.Shared">
<HintPath>..\eco-dlls\Eco.Shared.dll</HintPath>
</Reference>
<Reference Include="Eco.Simulation">
<HintPath>..\eco-dlls\Eco.Simulation.dll</HintPath>
</Reference>
<Reference Include="Eco.Stats">
<HintPath>..\eco-dlls\Eco.Stats.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Eco.ReferenceAssemblies" Version="0.11.1.12-beta-release-881" />
<PackageReference Include="NetFabric.Hyperlinq.Abstractions" Version="1.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="ConcurrentHashSet" Version="1.3.0" />
Expand Down
3 changes: 3 additions & 0 deletions EcoLawExtensionsMod/LawExtensionsPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> TurnOnIgnoreTags { get; set; } = ["LargeDoor"];
}

[Localized, LocDisplayName(nameof(LawExtensionsPlugin)), Priority(PriorityAttribute.High)]
Expand Down
5 changes: 4 additions & 1 deletion EcoLawExtensionsMod/LegalActions/TurnOnMachines.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -66,7 +67,9 @@ private PostResult Do(LocString description, IContextObject context, Settlement
{
int cnt = 0;
var allRelevantObjects = WorldObjectUtil.AllObjsWithComponent<OnOffComponent>()
.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;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| - | - | - |
Expand Down
15 changes: 0 additions & 15 deletions fetch-eco-reference-assemblies.sh

This file was deleted.