(3dc4135ce) v0.9.5.1

This commit is contained in:
Regalis
2019-11-21 18:22:25 +01:00
parent b39922a074
commit 5c95c53118
287 changed files with 12655 additions and 5048 deletions
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.Xna.Framework
{
public static class MessageBox
{
[Flags]
public enum Flags : uint
{
Error = 0x00000010,
Warning = 0x00000020,
Information = 0x00000040
}
public static void Show(Flags flags, string title, string message, GameWindow window = null)
{
Sdl.ShowSimpleMessageBox((uint)flags, title, message, window?.Handle ?? IntPtr.Zero);
}
public static void ShowWrapped(Flags flags, string title, string message, int charsPerLine = 60, GameWindow window = null)
{
string[] split = message.Split(' ');
if (split.Length > 0)
{
message = split[0];
string currLine = message;
for (int i = 1; i < split.Length; i++)
{
currLine += " " + split[i];
if (currLine.Length > charsPerLine)
{
currLine = split[i];
message += "\n" + split[i];
}
else
{
message += " " + split[i];
}
}
}
Show(flags, title, message, window);
}
}
}