Remove RequiredMods logic.
This commit is contained in:
@@ -333,18 +333,6 @@ namespace OpenRA
|
||||
InitializeMod(Settings.Game.Mod, args);
|
||||
}
|
||||
|
||||
public static bool IsModInstalled(string modId)
|
||||
{
|
||||
return Mods.ContainsKey(modId) && Mods[modId].RequiresMods.All(IsModInstalled);
|
||||
}
|
||||
|
||||
public static bool IsModInstalled(KeyValuePair<string, string> mod)
|
||||
{
|
||||
return Mods.ContainsKey(mod.Key)
|
||||
&& Mods[mod.Key].Metadata.Version == mod.Value
|
||||
&& IsModInstalled(mod.Key);
|
||||
}
|
||||
|
||||
public static void InitializeMod(string mod, Arguments args)
|
||||
{
|
||||
// Clear static state if we have switched mods
|
||||
@@ -372,8 +360,8 @@ namespace OpenRA
|
||||
|
||||
ModData = null;
|
||||
|
||||
// Fall back to default if the mod doesn't exist or has missing prerequisites.
|
||||
if (mod == null || !IsModInstalled(mod))
|
||||
// Fall back to default if the mod doesn't exist
|
||||
if (mod == null)
|
||||
mod = args.GetValue("Engine.DefaultMod", "modchooser");
|
||||
|
||||
Console.WriteLine("Loading mod: {0}", mod);
|
||||
|
||||
@@ -55,8 +55,6 @@ namespace OpenRA
|
||||
public readonly IReadOnlyDictionary<string, string> Packages;
|
||||
public readonly IReadOnlyDictionary<string, string> MapFolders;
|
||||
public readonly MiniYaml LoadScreen;
|
||||
|
||||
public readonly Dictionary<string, string> RequiresMods;
|
||||
public readonly Dictionary<string, Pair<string, int>> Fonts;
|
||||
|
||||
public readonly string[] SoundFormats = { };
|
||||
@@ -115,8 +113,6 @@ namespace OpenRA
|
||||
return Pair.New(nd["Font"].Value, Exts.ParseIntegerInvariant(nd["Size"].Value));
|
||||
});
|
||||
|
||||
RequiresMods = yaml["RequiresMods"].ToDictionary(my => my.Value);
|
||||
|
||||
// Allow inherited mods to import parent maps.
|
||||
var compat = new List<string> { Id };
|
||||
|
||||
|
||||
@@ -615,7 +615,6 @@
|
||||
<Compile Include="Widgets\Logic\Ingame\SupportPowerBinLogic.cs" />
|
||||
<Compile Include="Widgets\Logic\Ingame\SupportPowerTooltipLogic.cs" />
|
||||
<Compile Include="Widgets\Logic\Ingame\WorldTooltipLogic.cs" />
|
||||
<Compile Include="Widgets\Logic\Installation\InstallModLogic.cs" />
|
||||
<Compile Include="Widgets\Logic\Lobby\ClientTooltipLogic.cs" />
|
||||
<Compile Include="Widgets\Logic\Lobby\KickClientLogic.cs" />
|
||||
<Compile Include="Widgets\Logic\Lobby\KickSpectatorsLogic.cs" />
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2017 The OpenRA Developers (see AUTHORS)
|
||||
* 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.Linq;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
public class InstallModLogic : ChromeLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public InstallModLogic(Widget widget, Manifest mod)
|
||||
{
|
||||
var panel = widget.Get("INSTALL_MOD_PANEL");
|
||||
|
||||
var mods = mod.RequiresMods.Where(m => !Game.IsModInstalled(m)).Select(m => "{0} ({1})".F(m.Key, m.Value));
|
||||
var text = string.Join(", ", mods);
|
||||
panel.Get<LabelWidget>("MOD_LIST").Text = text;
|
||||
|
||||
panel.Get<ButtonWidget>("BACK_BUTTON").OnClick = Ui.CloseWindow;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,18 +180,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
void LoadMod(Manifest mod)
|
||||
{
|
||||
var modId = mod.Id;
|
||||
if (!Game.IsModInstalled(modId))
|
||||
{
|
||||
var widgetArgs = new WidgetArgs
|
||||
{
|
||||
{ "mod", selectedMod },
|
||||
{ "content", content[selectedMod] },
|
||||
};
|
||||
|
||||
Ui.OpenWindow("INSTALL_MOD_PANEL", widgetArgs);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsModInstalled(mod))
|
||||
{
|
||||
var widgetArgs = new WidgetArgs
|
||||
|
||||
@@ -5,8 +5,6 @@ Metadata:
|
||||
Hidden: true
|
||||
Description: Depending on all DLLs.
|
||||
|
||||
RequiresMods:
|
||||
|
||||
Packages:
|
||||
.
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@ Metadata:
|
||||
Version: {DEV_VERSION}
|
||||
Author: the OpenRA Developers
|
||||
|
||||
RequiresMods:
|
||||
modchooser: {DEV_VERSION}
|
||||
|
||||
Packages:
|
||||
~^Content/cnc
|
||||
~^Content/cnc/movies
|
||||
|
||||
@@ -4,9 +4,6 @@ Metadata:
|
||||
Version: {DEV_VERSION}
|
||||
Author: the OpenRA Developers
|
||||
|
||||
RequiresMods:
|
||||
modchooser: {DEV_VERSION}
|
||||
|
||||
Packages:
|
||||
~^Content/d2k/v2/
|
||||
~^Content/d2k/v2/GAMESFX
|
||||
|
||||
@@ -340,51 +340,3 @@ Background@CONTENT_PROMPT_PANEL:
|
||||
Text: Back
|
||||
Font: Bold
|
||||
Key: escape
|
||||
|
||||
Container@INSTALL_MOD_PANEL:
|
||||
Logic: InstallModLogic
|
||||
X: (WINDOW_RIGHT - WIDTH)/2
|
||||
Y: (WINDOW_BOTTOM - HEIGHT)/2
|
||||
Width: 500
|
||||
Height: 177
|
||||
Children:
|
||||
Background:
|
||||
Width: PARENT_RIGHT
|
||||
Height: PARENT_BOTTOM
|
||||
Background: panel-bg
|
||||
Background@RULE:
|
||||
X: 30
|
||||
Y: 50
|
||||
Width: 440
|
||||
Height: 150
|
||||
Background: panel-rule
|
||||
Label@TITLE:
|
||||
X: 0
|
||||
Y: 12
|
||||
Width: PARENT_RIGHT
|
||||
Height: 25
|
||||
Text: Missing dependencies
|
||||
Align: Center
|
||||
Font: MediumBold
|
||||
Label@DESC:
|
||||
X: 0
|
||||
Y: 65
|
||||
Width: PARENT_RIGHT
|
||||
Height: 25
|
||||
Align: Center
|
||||
Text: Please fully install the following mods then try again:
|
||||
Label@MOD_LIST:
|
||||
X: 0
|
||||
Y: 85
|
||||
Width: PARENT_RIGHT
|
||||
Height: 25
|
||||
Align: Center
|
||||
Button@BACK_BUTTON:
|
||||
X: PARENT_RIGHT - 130
|
||||
Y: PARENT_BOTTOM - 52
|
||||
Background: button-highlighted
|
||||
Width: 110
|
||||
Height: 32
|
||||
Text: Back
|
||||
Font: Bold
|
||||
Key: escape
|
||||
|
||||
@@ -4,8 +4,6 @@ Metadata:
|
||||
Author: The OpenRA Developers
|
||||
Hidden: true
|
||||
|
||||
RequiresMods:
|
||||
|
||||
Packages:
|
||||
.
|
||||
./mods/modchooser: modchooser
|
||||
|
||||
@@ -4,9 +4,6 @@ Metadata:
|
||||
Version: {DEV_VERSION}
|
||||
Author: the OpenRA Developers
|
||||
|
||||
RequiresMods:
|
||||
modchooser: {DEV_VERSION}
|
||||
|
||||
Packages:
|
||||
~^Content/ra/v2/
|
||||
~^Content/ra/v2/expand
|
||||
|
||||
@@ -4,9 +4,6 @@ Metadata:
|
||||
Version: {DEV_VERSION}
|
||||
Author: the OpenRA Developers
|
||||
|
||||
RequiresMods:
|
||||
modchooser: {DEV_VERSION}
|
||||
|
||||
Packages:
|
||||
~^Content/ts
|
||||
~^Content/ts/firestorm
|
||||
|
||||
Reference in New Issue
Block a user