aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/Scripting.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-02-18 11:19:54 -0500
committerMichael <[email protected]>2017-02-18 11:19:54 -0500
commit30dbf1ecb94ecbc84cb71eba9936ee050d040b64 (patch)
tree1cce38219b3d713ace86132ca5ffa0250ec73679 /ShiftOS_TheReturn/Scripting.cs
parent9b8d5861a954610713ae66a53d2ac067991d9b68 (diff)
downloadshiftos_thereturn-30dbf1ecb94ecbc84cb71eba9936ee050d040b64.tar.gz
shiftos_thereturn-30dbf1ecb94ecbc84cb71eba9936ee050d040b64.tar.bz2
shiftos_thereturn-30dbf1ecb94ecbc84cb71eba9936ee050d040b64.zip
Fix bug with client-side for update_your_cp
Diffstat (limited to 'ShiftOS_TheReturn/Scripting.cs')
-rw-r--r--ShiftOS_TheReturn/Scripting.cs77
1 files changed, 77 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/Scripting.cs b/ShiftOS_TheReturn/Scripting.cs
index c934fc6..9feb203 100644
--- a/ShiftOS_TheReturn/Scripting.cs
+++ b/ShiftOS_TheReturn/Scripting.cs
@@ -250,6 +250,83 @@ end");
}
}
}
+
+ [Exposed("infobox")]
+ public class InfoboxFunctions
+ {
+ public void show(string title, string message)
+ {
+ Infobox.Show(title, message);
+ }
+
+ public void question(string title, string message, Action<bool> callback)
+ {
+ Infobox.PromptYesNo(title, message, callback);
+ }
+
+ public void input(string title, string message, Action<string> callback)
+ {
+ Infobox.PromptText(title, message, callback);
+ }
+ }
+
+ [Exposed("fileskimmer")]
+ public class FileSkimmerFunctions
+ {
+ public void openFile(string extensions, Action<string> callback)
+ {
+ FileSkimmerBackend.GetFile(extensions.Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries), FileOpenerStyle.Open, callback);
+ }
+
+ public void saveFile(string extensions, Action<string> callback)
+ {
+ FileSkimmerBackend.GetFile(extensions.Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries), FileOpenerStyle.Save, callback);
+ }
+ }
+
+ [Exposed("fs")]
+ public class ShiftFSFunctions
+ {
+ public string readAllText(string path)
+ {
+ return Utils.ReadAllText(path);
+ }
+
+ public byte[] readAllBytes(string path)
+ {
+ return Utils.ReadAllBytes(path);
+ }
+
+ public void writeAllText(string path, string contents)
+ {
+ Utils.WriteAllText(path, contents);
+ }
+
+ public void writeAllBytes(string path, byte[] contents)
+ {
+ Utils.WriteAllBytes(path, contents);
+ }
+
+ public bool fileExists(string path)
+ {
+ return Utils.FileExists(path);
+ }
+
+ public bool directoryExists(string path)
+ {
+ return Utils.DirectoryExists(path);
+ }
+
+ public void delete(string path)
+ {
+ Utils.Delete(path);
+ }
+
+ public void createDirectory(string path)
+ {
+ Utils.CreateDirectory(path);
+ }
+ }
public class ExposedAttribute : Attribute