aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/Infobox.cs
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-05-28 12:37:00 -0700
committerGitHub <[email protected]>2017-05-28 12:37:00 -0700
commit771c20cfb3a703e0f1550fdcf9eb07b78298c944 (patch)
tree59cb532e15ebff313fdba2be264d78ec0033f407 /ShiftOS_TheReturn/Infobox.cs
parent496b0cbf8659c99203f48210fd39c572400ae623 (diff)
parentc7ba7d733c756d196f98dd4533289a1ef4db715f (diff)
downloadshiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.gz
shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.bz2
shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.zip
Merge pull request #1 from shiftos-game/master
welp, no longer a dev.
Diffstat (limited to 'ShiftOS_TheReturn/Infobox.cs')
-rw-r--r--ShiftOS_TheReturn/Infobox.cs25
1 files changed, 17 insertions, 8 deletions
diff --git a/ShiftOS_TheReturn/Infobox.cs b/ShiftOS_TheReturn/Infobox.cs
index 3e8fa30..62abcb7 100644
--- a/ShiftOS_TheReturn/Infobox.cs
+++ b/ShiftOS_TheReturn/Infobox.cs
@@ -55,25 +55,34 @@ namespace ShiftOS.Engine
/// </summary>
/// <param name="title">Infobox title</param>
/// <param name="message">Infobox message</param>
- public static void Show(string title, string message)
+ public static void Show(string title, string message, Action callback = null)
{
title = Localization.Parse(title);
message = Localization.Parse(message);
- _infobox.Open(title, message);
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ _infobox.Open(title, message, callback);
+ });
}
-
- public static void PromptText(string title, string message, Action<string> callback)
+
+ public static void PromptText(string title, string message, Action<string> callback, bool isPassword = false)
{
title = Localization.Parse(title);
message = Localization.Parse(message);
- _infobox.PromptText(title, message, callback);
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ _infobox.PromptText(title, message, callback, isPassword);
+ });
}
public static void PromptYesNo(string title, string message, Action<bool> callback)
{
title = Localization.Parse(title);
message = Localization.Parse(message);
- _infobox.PromptYesNo(title, message, callback);
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ _infobox.PromptYesNo(title, message, callback);
+ });
}
/// <summary>
@@ -89,8 +98,8 @@ namespace ShiftOS.Engine
// Infobox Interface
public interface IInfobox
{
- void Open(string title, string msg);
- void PromptText(string title, string message, Action<string> callback);
+ void Open(string title, string msg, Action callback = null);
+ void PromptText(string title, string message, Action<string> callback, bool isPassword);
void PromptYesNo(string title, string message, Action<bool> callback);
}
}