2using System.Collections;
3using System.Collections.Generic;
19 public override string tooltip {
get {
return Macro.
T(
"BTN_SAVE_HELP"); } }
37 private void OnSave(
string path)
39 var txtColor =
inField.textComponent.color;
40 var bgColor =
inField.gameObject.GetComponent<
Image>().color;
42 var fdd = FindObjectOfType<FileDragAndDrop>();
43 fdd.OnFileData(Encoding.UTF8.GetBytes(txtColor.r +
":" + txtColor.g +
":" + txtColor.b +
":" + txtColor.a +
":" + bgColor.r +
":" + bgColor.g +
":" + bgColor.b +
":" + bgColor.a +
":\n" +
inField.text), path.Remove(0, path.LastIndexOf(
"/") + 1) + (path.EndsWith(
".hlp") ?
"" :
".hlp"), TimeStamp());
46 File.WriteAllText(path + (path.EndsWith(
".hlp") ?
"" :
".hlp"), txtColor.r +
":" + txtColor.g +
":" + txtColor.b +
":" + txtColor.a +
":" + bgColor.r +
":" + bgColor.g +
":" + bgColor.b +
":" + bgColor.a +
":\n" +
inField.text);
48 var fdd = FindObjectOfType<FileDragAndDrop>();
49 fdd.OnFiles(
new List<string>(){path + (path.EndsWith(
".hlp") ?
"" :
".hlp")},
new POINT(-1,-1));
51 StartCoroutine(WaitOneReload());
53 IEnumerator WaitOneReload()
59 private string TimeStamp()
61 var now = DateTime.Now;
63 return $
"{now.Year}-{now.Month:D2}-{now.Day:D2}T{now.Hour:D2}:{now.Minute:D2}:{now.Second:D2}.{now.Millisecond:D3}Z";
System.Drawing.Image Image
string filePattern
If isFileBrowser is true, this string my be used to filter file results (see https://msdn....
void AddOnSaveListener(Callback< string > listener)
void SetDirectory(string directory)
static void SetTitle(string title)
static void SetContent(GameObject prefab)
static pb_PrefabBrowser instance
static string T(string key)