Load default packages from the default mod
This commit is contained in:
@@ -38,6 +38,7 @@ namespace OpenRa.FileFormats
|
||||
|
||||
public class Manifest
|
||||
{
|
||||
public readonly string[] Folders = { };
|
||||
public readonly string[] Packages = { };
|
||||
public readonly string[] LegacyRules = { };
|
||||
public readonly string[] Rules = { };
|
||||
@@ -50,6 +51,7 @@ namespace OpenRa.FileFormats
|
||||
.Select(m => MiniYaml.FromFile("mods/" + m + "/mod.yaml"))
|
||||
.Aggregate(MiniYaml.Merge);
|
||||
|
||||
Folders = YamlList(yaml, "Folders");
|
||||
Packages = YamlList(yaml, "Packages");
|
||||
LegacyRules = YamlList(yaml, "LegacyRules");
|
||||
Rules = YamlList(yaml, "Rules");
|
||||
|
||||
@@ -35,6 +35,19 @@ namespace OpenRa
|
||||
internal static Session LobbyInfo = new Session();
|
||||
static bool changePending;
|
||||
|
||||
public static void LoadModPackages(Manifest manifest)
|
||||
{
|
||||
FileSystem.UnmountTemporaryPackages();
|
||||
Timer.Time("reset: {0}");
|
||||
|
||||
foreach (var dir in manifest.Folders)
|
||||
FileSystem.MountTemporary(new Folder(dir));
|
||||
|
||||
foreach (var pkg in manifest.Packages)
|
||||
FileSystem.MountTemporary(new Package(pkg));
|
||||
Timer.Time("mount tempory packages: {0}");
|
||||
}
|
||||
|
||||
public static void ChangeMap(string mapName)
|
||||
{
|
||||
Timer.Time( "----ChangeMap" );
|
||||
@@ -42,16 +55,11 @@ namespace OpenRa
|
||||
var manifest = new Manifest(LobbyInfo.GlobalSettings.Mods);
|
||||
Timer.Time( "manifest: {0}" );
|
||||
|
||||
chat.AddLine(Color.White, "Debug", "Map change {0} -> {1}".F(Game.mapName, mapName));
|
||||
Game.changePending = false;
|
||||
Game.mapName = mapName;
|
||||
SheetBuilder.Initialize(renderer);
|
||||
FileSystem.UnmountTemporaryPackages();
|
||||
Timer.Time( "reset: {0}" );
|
||||
|
||||
foreach (var pkg in manifest.Packages)
|
||||
FileSystem.MountTemporary(new Package(pkg));
|
||||
Timer.Time( "mount tempory packages: {0}" );
|
||||
LoadModPackages(manifest);
|
||||
|
||||
Rules.LoadRules(mapName, manifest);
|
||||
Timer.Time( "load rules: {0}" );
|
||||
@@ -82,6 +90,7 @@ namespace OpenRa
|
||||
Timer.Time( "chrome: {0}" );
|
||||
|
||||
Timer.Time( "----end ChangeMap" );
|
||||
chat.AddLine(Color.White, "Debug", "Map change {0} -> {1}".F(Game.mapName, mapName));
|
||||
}
|
||||
|
||||
internal static void Initialize(string mapName, Renderer renderer, int2 clientSize, int localPlayer, Controller controller)
|
||||
|
||||
@@ -50,12 +50,13 @@ namespace OpenRa
|
||||
|
||||
LoadUserSettings(settings);
|
||||
|
||||
// Load the default mod to access required files
|
||||
Game.LoadModPackages(new Manifest(Game.LobbyInfo.GlobalSettings.Mods));
|
||||
|
||||
UiOverlay.ShowUnitDebug = Game.Settings.UnitDebug;
|
||||
WorldRenderer.ShowUnitPaths = Game.Settings.PathDebug;
|
||||
Renderer.SheetSize = Game.Settings.SheetSize;
|
||||
|
||||
FileSystem.MountDefaultPackages();
|
||||
|
||||
bool windowed = !Game.Settings.Fullscreen;
|
||||
renderer = new Renderer(this, GetResolution(settings), windowed);
|
||||
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
# Classic Red Alert Mod -- Package Manifest
|
||||
|
||||
Folders:
|
||||
./
|
||||
|
||||
Packages:
|
||||
main.mix
|
||||
redalert.mix
|
||||
conquer.mix
|
||||
hires.mix
|
||||
general.mix
|
||||
local.mix
|
||||
sounds.mix
|
||||
speech.mix
|
||||
allies.mix
|
||||
russian.mix
|
||||
temperat.mix
|
||||
snow.mix
|
||||
interior.mix
|
||||
|
||||
LegacyRules:
|
||||
mods/ra/rules.ini: More or less original Red Alert rules file.
|
||||
|
||||
Reference in New Issue
Block a user