Skip to content

Commit

Permalink
Update to playtest-20241116 engine.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Nov 16, 2024
1 parent d49b897 commit 56e4800
Show file tree
Hide file tree
Showing 35 changed files with 476 additions and 1,327 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Clone Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install .NET 6.0
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'

Expand All @@ -28,7 +28,7 @@ jobs:
run: |
make engine
mkdir -p build/linux
sudo apt install libfuse2
sudo apt-get install -y desktop-file-utils
./packaging/linux/buildpackage.sh "${GIT_TAG}" "${PWD}/build/linux"
- name: Upload Packages
Expand All @@ -42,13 +42,13 @@ jobs:

macos:
name: macOS Disk Image
runs-on: macos-11
runs-on: macos-13
steps:
- name: Clone Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install .NET 6.0
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'

Expand Down Expand Up @@ -81,10 +81,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Clone Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install .NET 6.0
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'

Expand All @@ -107,4 +107,4 @@ jobs:
tag: ${{ github.ref }}
overwrite: true
file_glob: true
file: build/windows/*
file: build/windows/*
90 changes: 90 additions & 0 deletions OpenRA.Mods.Mobius/FileSystem/RemasterFileSystemLoader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#region Copyright & License Information
/*
* Copyright (c) The OpenRA Developers and Contributors
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion

using System.Collections.Generic;
using System.IO;
using System.Linq;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.FileSystem;
using OpenRA.Mods.Common.Installer;

namespace OpenRA.Mods.Mobius.FileSystem
{
public class RemasterFileSystemLoader : IFileSystemLoader, IFileSystemExternalContent
{
[FieldLoader.Require]
public readonly string RemasterDataMount = null;
public readonly string InstallPromptMod = "remaster-content";
public readonly Dictionary<string, string> Packages = null;
public readonly Dictionary<string, string> RemasterPackages = null;

[FieldLoader.LoadUsing(nameof(LoadSources))]
readonly Dictionary<string, ModContent.ModSource> sources = null;

static object LoadSources(MiniYaml yaml)
{
var ret = new Dictionary<string, ModContent.ModSource>();
var sourcesNode = yaml.Nodes.Single(n => n.Key == "Sources");
foreach (var s in sourcesNode.Value.Nodes)
ret.Add(s.Key, new ModContent.ModSource(s.Value));

return ret;
}

bool contentAvailable = true;

public void Mount(OpenRA.FileSystem.FileSystem fileSystem, ObjectCreator objectCreator)
{
if (Packages != null)
foreach (var kv in Packages)
fileSystem.Mount(kv.Key, kv.Value);

if (RemasterPackages == null)
return;

foreach (var kv in sources)
{
var sourceResolver = objectCreator.CreateObject<ISourceResolver>($"{kv.Value.Type.Value}SourceResolver");
var path = sourceResolver.FindSourcePath(kv.Value);
if (path != null)
{
var dataPath = Path.Combine(path, "Data");
if (!Directory.Exists(dataPath))
{
contentAvailable = false;
continue;
}

fileSystem.Mount(dataPath, RemasterDataMount);
foreach (var p in RemasterPackages)
{
var package = fileSystem.OpenPackage(p.Key);
if (package == null)
{
contentAvailable = false;
continue;
}

fileSystem.Mount(package, p.Value);
}
}
}
}

bool IFileSystemExternalContent.InstallContentIfRequired(ModData modData)
{
if (!contentAvailable)
Game.InitializeMod(InstallPromptMod, new Arguments());

return !contentAvailable;
}
}
}
1 change: 0 additions & 1 deletion OpenRA.Mods.Mobius/RemasterContentPromptLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class RemasterContentPromptLogic : ChromeLogic
[ObjectCreator.UseCtor]
public RemasterContentPromptLogic(Widget widget, ModData modData)
{
widget.Get<LabelWidget>("VERSION_LABEL").Text = modData.Manifest.Metadata.Version;
widget.Get<ButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;
}
}
Expand Down
24 changes: 0 additions & 24 deletions OpenRA.Mods.Mobius/RemasterInstallPromptLoadScreen.cs

This file was deleted.

27 changes: 0 additions & 27 deletions OpenRA.Mods.Mobius/RemasterLoadScreen.cs

This file was deleted.

74 changes: 0 additions & 74 deletions OpenRA.Mods.Mobius/RemasterPackages.cs

This file was deleted.

Loading

0 comments on commit 56e4800

Please sign in to comment.