private static void PrintLogMessages() { foreach (TWLogMessage message in TWLog.GetAllLogMessages()) { switch (message.Severity) { case TWSeverity.Error: { PrintLogMessage(MyLog.ERROR, message); break; } case TWSeverity.Warn: { PrintLogMessage(MyLog.WARNING, message); break; } case TWSeverity.Info: { PrintLogMessage(MyLog.INFO, message); break; } default: { PrintLogMessage(MyLog.DEBUG, message); break; } } } }
public override void Validate(MyValidator validator) { validator.AssertError(Controls != null, this, "No controls available"); validator.AssertError(File.Exists(SaveFile), this, "Please specify a correct SaveFile path in world properties."); validator.AssertError(File.Exists(TilesetTable), this, "Please specify a correct TilesetTable path in world properties."); validator.AssertError(RunFile == "" || File.Exists(RunFile), this, "Please enter an existing lua script file in world properties."); validator.AssertError(FoFSize > 0, this, "FoF size has to be positive."); validator.AssertError(FoFResWidth > 0, this, "FoF resolution width has to be positive."); validator.AssertError(FoFResHeight > 0, this, "FoF resolution height has to be positive."); validator.AssertError(FoVSize > 0, this, "FoV size has to be positive."); validator.AssertError(FoVResWidth > 0, this, "FoV resolution width has to be positive."); validator.AssertError(FoVResHeight > 0, this, "FoV resolution height has to be positive."); validator.AssertError(Width > 0, this, "Free view width has to be positive."); validator.AssertError(Height > 0, this, "Free view height has to be positive."); validator.AssertError(ResolutionWidth > 0, this, "Free view resolution width has to be positive."); validator.AssertError(ResolutionHeight > 0, this, "Free view resolution height has to be positive."); validator.AssertError(ToolSize > 0, this, "Tool size has to be positive."); validator.AssertError(ToolResWidth > 0, this, "Tool resolution width has to be positive."); validator.AssertError(ToolResHeight > 0, this, "Tool resolution height has to be positive."); ControlMapper.CheckControlSize(validator, Controls, this); TryToyWorld(); foreach (TWLogMessage message in TWLog.GetAllLogMessages()) { switch (message.Severity) { case TWSeverity.Error: { validator.AssertError(false, this, message.ToString()); break; } case TWSeverity.Warn: { validator.AssertWarning(false, this, message.ToString()); break; } } } }