Remove RequiredMods logic.
This commit is contained in:
@@ -333,18 +333,6 @@ namespace OpenRA
|
|||||||
InitializeMod(Settings.Game.Mod, args);
|
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)
|
public static void InitializeMod(string mod, Arguments args)
|
||||||
{
|
{
|
||||||
// Clear static state if we have switched mods
|
// Clear static state if we have switched mods
|
||||||
@@ -372,8 +360,8 @@ namespace OpenRA
|
|||||||
|
|
||||||
ModData = null;
|
ModData = null;
|
||||||
|
|
||||||
// Fall back to default if the mod doesn't exist or has missing prerequisites.
|
// Fall back to default if the mod doesn't exist
|
||||||
if (mod == null || !IsModInstalled(mod))
|
if (mod == null)
|
||||||
mod = args.GetValue("Engine.DefaultMod", "modchooser");
|
mod = args.GetValue("Engine.DefaultMod", "modchooser");
|
||||||
|
|
||||||
Console.WriteLine("Loading mod: {0}", mod);
|
Console.WriteLine("Loading mod: {0}", mod);
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ namespace OpenRA
|
|||||||
public readonly IReadOnlyDictionary<string, string> Packages;
|
public readonly IReadOnlyDictionary<string, string> Packages;
|
||||||
public readonly IReadOnlyDictionary<string, string> MapFolders;
|
public readonly IReadOnlyDictionary<string, string> MapFolders;
|
||||||
public readonly MiniYaml LoadScreen;
|
public readonly MiniYaml LoadScreen;
|
||||||
|
|
||||||
public readonly Dictionary<string, string> RequiresMods;
|
|
||||||
public readonly Dictionary<string, Pair<string, int>> Fonts;
|
public readonly Dictionary<string, Pair<string, int>> Fonts;
|
||||||
|
|
||||||
public readonly string[] SoundFormats = { };
|
public readonly string[] SoundFormats = { };
|
||||||
@@ -115,8 +113,6 @@ namespace OpenRA
|
|||||||
return Pair.New(nd["Font"].Value, Exts.ParseIntegerInvariant(nd["Size"].Value));
|
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.
|
// Allow inherited mods to import parent maps.
|
||||||
var compat = new List<string> { Id };
|
var compat = new List<string> { Id };
|
||||||
|
|
||||||
|
|||||||
@@ -615,7 +615,6 @@
|
|||||||
<Compile Include="Widgets\Logic\Ingame\SupportPowerBinLogic.cs" />
|
<Compile Include="Widgets\Logic\Ingame\SupportPowerBinLogic.cs" />
|
||||||
<Compile Include="Widgets\Logic\Ingame\SupportPowerTooltipLogic.cs" />
|
<Compile Include="Widgets\Logic\Ingame\SupportPowerTooltipLogic.cs" />
|
||||||
<Compile Include="Widgets\Logic\Ingame\WorldTooltipLogic.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\ClientTooltipLogic.cs" />
|
||||||
<Compile Include="Widgets\Logic\Lobby\KickClientLogic.cs" />
|
<Compile Include="Widgets\Logic\Lobby\KickClientLogic.cs" />
|
||||||
<Compile Include="Widgets\Logic\Lobby\KickSpectatorsLogic.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)
|
void LoadMod(Manifest mod)
|
||||||
{
|
{
|
||||||
var modId = mod.Id;
|
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))
|
if (!IsModInstalled(mod))
|
||||||
{
|
{
|
||||||
var widgetArgs = new WidgetArgs
|
var widgetArgs = new WidgetArgs
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ Metadata:
|
|||||||
Hidden: true
|
Hidden: true
|
||||||
Description: Depending on all DLLs.
|
Description: Depending on all DLLs.
|
||||||
|
|
||||||
RequiresMods:
|
|
||||||
|
|
||||||
Packages:
|
Packages:
|
||||||
.
|
.
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ Metadata:
|
|||||||
Version: {DEV_VERSION}
|
Version: {DEV_VERSION}
|
||||||
Author: the OpenRA Developers
|
Author: the OpenRA Developers
|
||||||
|
|
||||||
RequiresMods:
|
|
||||||
modchooser: {DEV_VERSION}
|
|
||||||
|
|
||||||
Packages:
|
Packages:
|
||||||
~^Content/cnc
|
~^Content/cnc
|
||||||
~^Content/cnc/movies
|
~^Content/cnc/movies
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ Metadata:
|
|||||||
Version: {DEV_VERSION}
|
Version: {DEV_VERSION}
|
||||||
Author: the OpenRA Developers
|
Author: the OpenRA Developers
|
||||||
|
|
||||||
RequiresMods:
|
|
||||||
modchooser: {DEV_VERSION}
|
|
||||||
|
|
||||||
Packages:
|
Packages:
|
||||||
~^Content/d2k/v2/
|
~^Content/d2k/v2/
|
||||||
~^Content/d2k/v2/GAMESFX
|
~^Content/d2k/v2/GAMESFX
|
||||||
|
|||||||
@@ -340,51 +340,3 @@ Background@CONTENT_PROMPT_PANEL:
|
|||||||
Text: Back
|
Text: Back
|
||||||
Font: Bold
|
Font: Bold
|
||||||
Key: escape
|
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
|
Author: The OpenRA Developers
|
||||||
Hidden: true
|
Hidden: true
|
||||||
|
|
||||||
RequiresMods:
|
|
||||||
|
|
||||||
Packages:
|
Packages:
|
||||||
.
|
.
|
||||||
./mods/modchooser: modchooser
|
./mods/modchooser: modchooser
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ Metadata:
|
|||||||
Version: {DEV_VERSION}
|
Version: {DEV_VERSION}
|
||||||
Author: the OpenRA Developers
|
Author: the OpenRA Developers
|
||||||
|
|
||||||
RequiresMods:
|
|
||||||
modchooser: {DEV_VERSION}
|
|
||||||
|
|
||||||
Packages:
|
Packages:
|
||||||
~^Content/ra/v2/
|
~^Content/ra/v2/
|
||||||
~^Content/ra/v2/expand
|
~^Content/ra/v2/expand
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ Metadata:
|
|||||||
Version: {DEV_VERSION}
|
Version: {DEV_VERSION}
|
||||||
Author: the OpenRA Developers
|
Author: the OpenRA Developers
|
||||||
|
|
||||||
RequiresMods:
|
|
||||||
modchooser: {DEV_VERSION}
|
|
||||||
|
|
||||||
Packages:
|
Packages:
|
||||||
~^Content/ts
|
~^Content/ts
|
||||||
~^Content/ts/firestorm
|
~^Content/ts/firestorm
|
||||||
|
|||||||
Reference in New Issue
Block a user