mirror of
https://github.com/flibitijibibo/RogueLegacy1.git
synced 2025-12-05 18:20:42 -08:00
Replace some uses of System.IO.File with TitleContainer.OpenStream
Some checks are pending
CI / Linux (push) Waiting to run
Some checks are pending
CI / Linux (push) Waiting to run
This commit is contained in:
parent
c3f14e756d
commit
db4d7a734b
4 changed files with 9 additions and 6 deletions
|
|
@ -950,7 +950,7 @@ namespace RogueCastle
|
||||||
{
|
{
|
||||||
m_maleChineseNamesLoaded = false;
|
m_maleChineseNamesLoaded = false;
|
||||||
|
|
||||||
using (StreamReader sr = new StreamReader(Path.Combine("Content","HeroNames.txt")))
|
using (StreamReader sr = new StreamReader(TitleContainer.OpenStream(Path.Combine(Content.RootDirectory, "HeroNames.txt"))))
|
||||||
{
|
{
|
||||||
// A test to make sure no special characters are used in the game.
|
// A test to make sure no special characters are used in the game.
|
||||||
SpriteFont junicode = Content.Load<SpriteFont>("Fonts\\Junicode");
|
SpriteFont junicode = Content.Load<SpriteFont>("Fonts\\Junicode");
|
||||||
|
|
@ -1047,7 +1047,7 @@ namespace RogueCastle
|
||||||
{
|
{
|
||||||
m_femaleChineseNamesLoaded = false;
|
m_femaleChineseNamesLoaded = false;
|
||||||
|
|
||||||
using (StreamReader sr = new StreamReader(Path.Combine("Content", "HeroineNames.txt")))
|
using (StreamReader sr = new StreamReader(TitleContainer.OpenStream(Path.Combine(Content.RootDirectory, "HeroineNames.txt"))))
|
||||||
{
|
{
|
||||||
// A test to make sure no special characters are used in the game.
|
// A test to make sure no special characters are used in the game.
|
||||||
SpriteFont junicode = Content.Load<SpriteFont>("Fonts\\Junicode");
|
SpriteFont junicode = Content.Load<SpriteFont>("Fonts\\Junicode");
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Content;
|
using Microsoft.Xna.Framework.Content;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
|
@ -27,10 +28,12 @@ namespace RogueCastle
|
||||||
settings.IgnoreWhitespace = true;
|
settings.IgnoreWhitespace = true;
|
||||||
XmlReader reader = null;
|
XmlReader reader = null;
|
||||||
|
|
||||||
|
string levelPath;
|
||||||
if (contentManager == null)
|
if (contentManager == null)
|
||||||
reader = XmlReader.Create(filePath, settings);
|
levelPath = filePath;
|
||||||
else
|
else
|
||||||
reader = XmlReader.Create(System.IO.Path.Combine(contentManager.RootDirectory, "Levels", filePath + ".xml"), settings);
|
levelPath = System.IO.Path.Combine(contentManager.RootDirectory, "Levels", filePath + ".xml");
|
||||||
|
reader = XmlReader.Create(TitleContainer.OpenStream(levelPath), settings);
|
||||||
|
|
||||||
// STEPS:
|
// STEPS:
|
||||||
// 1. Finds a room object in the XML doc and creates a new RoomObj based off that data.
|
// 1. Finds a room object in the XML doc and creates a new RoomObj based off that data.
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ namespace RogueCastle
|
||||||
}
|
}
|
||||||
else if (!os.Equals("Windows"))
|
else if (!os.Equals("Windows"))
|
||||||
{
|
{
|
||||||
throw new NotSupportedException("Unhandled SDL3 platform!");
|
return SDL.SDL_GetPrefPath("Cellar Door Games", "Rogue Legacy");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ namespace SpriteSystem
|
||||||
settings.IgnoreComments = true;
|
settings.IgnoreComments = true;
|
||||||
settings.IgnoreWhitespace = true;
|
settings.IgnoreWhitespace = true;
|
||||||
Texture2D newTexture2D = content.Load<Texture2D>(spritesheetName);
|
Texture2D newTexture2D = content.Load<Texture2D>(spritesheetName);
|
||||||
XmlReader reader = XmlReader.Create(content.RootDirectory + Path.DirectorySeparatorChar + spritesheetName + ".xml", settings);
|
XmlReader reader = XmlReader.Create(TitleContainer.OpenStream(content.RootDirectory + Path.DirectorySeparatorChar + spritesheetName + ".xml"), settings);
|
||||||
return ParseData(reader, newTexture2D, returnCharDataNames, spritesheetName);
|
return ParseData(reader, newTexture2D, returnCharDataNames, spritesheetName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue