Fix for mod credits overriding engine credits
This commit is contained in:
committed by
Paul Chote
parent
b1f7c5c4e3
commit
a107da0888
1
AUTHORS
1
AUTHORS
@@ -23,6 +23,7 @@ Previous developers included:
|
|||||||
* Tom Roostan (RoosterDragon)
|
* Tom Roostan (RoosterDragon)
|
||||||
|
|
||||||
Also thanks to:
|
Also thanks to:
|
||||||
|
* abmyii
|
||||||
* Adam Valy (Tschokky)
|
* Adam Valy (Tschokky)
|
||||||
* Akseli Virtanen (RAGEQUIT)
|
* Akseli Virtanen (RAGEQUIT)
|
||||||
* Alexander Fast (mizipzor)
|
* Alexander Fast (mizipzor)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
onExit();
|
onExit();
|
||||||
};
|
};
|
||||||
|
|
||||||
engineLines = ParseLines("AUTHORS");
|
engineLines = ParseLines(File.OpenRead(Platform.ResolvePath("./AUTHORS")));
|
||||||
|
|
||||||
var tabContainer = panel.Get("TAB_CONTAINER");
|
var tabContainer = panel.Get("TAB_CONTAINER");
|
||||||
var modTab = tabContainer.Get<ButtonWidget>("MOD_TAB");
|
var modTab = tabContainer.Get<ButtonWidget>("MOD_TAB");
|
||||||
@@ -57,7 +58,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (hasModCredits)
|
if (hasModCredits)
|
||||||
{
|
{
|
||||||
var modCredits = modData.Manifest.Get<ModCredits>();
|
var modCredits = modData.Manifest.Get<ModCredits>();
|
||||||
modLines = ParseLines(modCredits.ModCreditsFile);
|
modLines = ParseLines(modData.DefaultFileSystem.Open(modCredits.ModCreditsFile));
|
||||||
modTab.GetText = () => modCredits.ModTabTitle;
|
modTab.GetText = () => modCredits.ModTabTitle;
|
||||||
|
|
||||||
// Make space to show the tabs
|
// Make space to show the tabs
|
||||||
@@ -82,12 +83,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<string> ParseLines(string file)
|
IEnumerable<string> ParseLines(Stream file)
|
||||||
{
|
{
|
||||||
return modData.DefaultFileSystem.Open(file)
|
return file.ReadAllLines().Select(l => l.Replace("\t", " ").Replace("*", "\u2022")).ToList();
|
||||||
.ReadAllLines()
|
|
||||||
.Select(l => l.Replace("\t", " ").Replace("*", "\u2022"))
|
|
||||||
.ToList();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user