Replace ConfigParser with SDK-provided MyIni
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
using Sandbox.ModAPI.Ingame;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using VRage.Game.ModAPI.Ingame.Utilities;
|
||||
|
||||
namespace IngameScript
|
||||
{
|
||||
@ -24,14 +25,14 @@ namespace IngameScript
|
||||
|
||||
private const int DefaultMaxLines = 10;
|
||||
|
||||
public Console(MyGridProgram program)
|
||||
public Console(MyGridProgram program, MyIni ini)
|
||||
{
|
||||
_program = program;
|
||||
_buffer = new List<string>();
|
||||
|
||||
// Check the PB's custom data for a maxlines directive.
|
||||
ConfigParser config = new ConfigParser(_program.Me);
|
||||
_maxLines = config.GetValue("ConsoleMaxLines", DefaultMaxLines);
|
||||
ini.TryParse(program.Me.CustomData);
|
||||
_maxLines = ini.Get("console", "maxLines").ToInt32(DefaultMaxLines);
|
||||
}
|
||||
|
||||
public PrefixedConsole CreatePrefixedConsole(string prefix)
|
||||
|
Reference in New Issue
Block a user