mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 04:53:29 +01:00
added a None TextInputWrapper
This commit is contained in:
parent
0adb444c69
commit
be2498e583
2 changed files with 15 additions and 4 deletions
|
@ -15,9 +15,9 @@ namespace MLEM.Misc {
|
|||
throw new InvalidOperationException(
|
||||
"The TextInputWrapper was not initialized yet. Please do so before running your game like so:\n" +
|
||||
"DesktopGL: TextInputWrapper.Current = new TextInputWrapper.DesktopGl<TextInputEventArgs>((w, c) => w.TextInput += c);\n" +
|
||||
"Mobile and Consoles: TextInputWrapper.Current = new TextInputWrapper.Mobile();\n" +
|
||||
"Other Systems: TextInputWrapper.Current = new TextInputWrapper.Primitive();\n" +
|
||||
"Note that the primitive wrapper needs to have its Update() method called.");
|
||||
"Mobile and consoles: TextInputWrapper.Current = new TextInputWrapper.Mobile();\n" +
|
||||
"Other systems: TextInputWrapper.Current = new TextInputWrapper.Primitive(); (also call Update() every game tick for this one)\n" +
|
||||
"No text input: TextInputWrapper.Current = new TextInputWrapper.None();");
|
||||
return current;
|
||||
}
|
||||
set => current = value;
|
||||
|
@ -66,6 +66,17 @@ namespace MLEM.Misc {
|
|||
|
||||
}
|
||||
|
||||
public class None : TextInputWrapper {
|
||||
|
||||
public override bool RequiresOnScreenKeyboard() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddListener(GameWindow window, TextInputCallback callback) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class Primitive : TextInputWrapper {
|
||||
|
||||
private TextInputCallback callback;
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Sandbox {
|
|||
internal static class Program {
|
||||
|
||||
private static void Main() {
|
||||
TextInputWrapper.Current = new TextInputWrapper.DesktopGl<TextInputEventArgs>((w, c) => w.TextInput += c);
|
||||
//TextInputWrapper.Current = new TextInputWrapper.DesktopGl<TextInputEventArgs>((w, c) => w.TextInput += c);
|
||||
using (var game = new GameImpl())
|
||||
game.Run();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue