Last active
December 1, 2015 05:21
-
-
Save nakosung/756aed5399da66ed40d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const THE_URL = "https://gist.githubusercontent.com/nakosung/ee76a5f41a59627f22cf/raw" | |
let actor = null | |
function write(something) { | |
if (actor == null) { | |
actor = new TextRenderActor(GWorld, { X: 800, Z: 100 }, { Yaw: 180 }) | |
actor.TextRender.SetHorizontalAlignment('EHTA_Center') | |
} | |
actor.TextRender.K2_SetText(something) | |
} | |
function load(url) { | |
write("loading " + url) | |
return new Promise((resolve, reject) => { | |
var req = new JavascriptHttpRequest() | |
req.SetVerb("GET") | |
req.SetURL(url) | |
req.OnComplete.Add(function (success) { | |
if (success) { | |
let result = eval(req.GetContentAsString()) | |
write("loading " + url + ":done") | |
try { | |
resolve(result) | |
write("done!!!") | |
} catch (e) { | |
write(String(e)) | |
} | |
} else { | |
write("loading " + url + ":fail") | |
reject() | |
} | |
}) | |
req.ProcessRequest() | |
}) | |
} | |
load("https://gist.githubusercontent.com/nakosung/447be3145bbf2d8c1f9d/raw/") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment