@textadventures/quest-viva-wasmplayer 6.0.0-beta.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/.stamp +0 -0
  2. package/WasmPlayer.runtimeconfig.json +46 -0
  3. package/_framework/Common.wasm +0 -0
  4. package/_framework/Engine.wasm +0 -0
  5. package/_framework/ExtendedNumerics.BigDecimal.wasm +0 -0
  6. package/_framework/Legacy.wasm +0 -0
  7. package/_framework/Microsoft.CSharp.wasm +0 -0
  8. package/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.wasm +0 -0
  9. package/_framework/Microsoft.Extensions.Logging.Abstractions.wasm +0 -0
  10. package/_framework/Microsoft.VisualBasic.Core.wasm +0 -0
  11. package/_framework/Microsoft.VisualBasic.wasm +0 -0
  12. package/_framework/Microsoft.Win32.Primitives.wasm +0 -0
  13. package/_framework/Microsoft.Win32.Registry.wasm +0 -0
  14. package/_framework/NCalc.Async.wasm +0 -0
  15. package/_framework/NCalc.Core.wasm +0 -0
  16. package/_framework/NCalc.Domain.wasm +0 -0
  17. package/_framework/NCalc.Parser.wasm +0 -0
  18. package/_framework/Parlot.wasm +0 -0
  19. package/_framework/PlayerCore.wasm +0 -0
  20. package/_framework/System.AppContext.wasm +0 -0
  21. package/_framework/System.Buffers.wasm +0 -0
  22. package/_framework/System.Collections.Concurrent.wasm +0 -0
  23. package/_framework/System.Collections.Immutable.wasm +0 -0
  24. package/_framework/System.Collections.NonGeneric.wasm +0 -0
  25. package/_framework/System.Collections.Specialized.wasm +0 -0
  26. package/_framework/System.Collections.wasm +0 -0
  27. package/_framework/System.ComponentModel.Annotations.wasm +0 -0
  28. package/_framework/System.ComponentModel.DataAnnotations.wasm +0 -0
  29. package/_framework/System.ComponentModel.EventBasedAsync.wasm +0 -0
  30. package/_framework/System.ComponentModel.Primitives.wasm +0 -0
  31. package/_framework/System.ComponentModel.TypeConverter.wasm +0 -0
  32. package/_framework/System.ComponentModel.wasm +0 -0
  33. package/_framework/System.Configuration.wasm +0 -0
  34. package/_framework/System.Console.wasm +0 -0
  35. package/_framework/System.Core.wasm +0 -0
  36. package/_framework/System.Data.Common.wasm +0 -0
  37. package/_framework/System.Data.DataSetExtensions.wasm +0 -0
  38. package/_framework/System.Data.wasm +0 -0
  39. package/_framework/System.Diagnostics.Contracts.wasm +0 -0
  40. package/_framework/System.Diagnostics.Debug.wasm +0 -0
  41. package/_framework/System.Diagnostics.DiagnosticSource.wasm +0 -0
  42. package/_framework/System.Diagnostics.FileVersionInfo.wasm +0 -0
  43. package/_framework/System.Diagnostics.Process.wasm +0 -0
  44. package/_framework/System.Diagnostics.StackTrace.wasm +0 -0
  45. package/_framework/System.Diagnostics.TextWriterTraceListener.wasm +0 -0
  46. package/_framework/System.Diagnostics.Tools.wasm +0 -0
  47. package/_framework/System.Diagnostics.TraceSource.wasm +0 -0
  48. package/_framework/System.Diagnostics.Tracing.wasm +0 -0
  49. package/_framework/System.Drawing.Primitives.wasm +0 -0
  50. package/_framework/System.Drawing.wasm +0 -0
  51. package/_framework/System.Dynamic.Runtime.wasm +0 -0
  52. package/_framework/System.Formats.Asn1.wasm +0 -0
  53. package/_framework/System.Formats.Tar.wasm +0 -0
  54. package/_framework/System.Globalization.Calendars.wasm +0 -0
  55. package/_framework/System.Globalization.Extensions.wasm +0 -0
  56. package/_framework/System.Globalization.wasm +0 -0
  57. package/_framework/System.IO.Compression.Brotli.wasm +0 -0
  58. package/_framework/System.IO.Compression.FileSystem.wasm +0 -0
  59. package/_framework/System.IO.Compression.ZipFile.wasm +0 -0
  60. package/_framework/System.IO.Compression.wasm +0 -0
  61. package/_framework/System.IO.FileSystem.AccessControl.wasm +0 -0
  62. package/_framework/System.IO.FileSystem.DriveInfo.wasm +0 -0
  63. package/_framework/System.IO.FileSystem.Primitives.wasm +0 -0
  64. package/_framework/System.IO.FileSystem.Watcher.wasm +0 -0
  65. package/_framework/System.IO.FileSystem.wasm +0 -0
  66. package/_framework/System.IO.IsolatedStorage.wasm +0 -0
  67. package/_framework/System.IO.MemoryMappedFiles.wasm +0 -0
  68. package/_framework/System.IO.Pipelines.wasm +0 -0
  69. package/_framework/System.IO.Pipes.AccessControl.wasm +0 -0
  70. package/_framework/System.IO.Pipes.wasm +0 -0
  71. package/_framework/System.IO.UnmanagedMemoryStream.wasm +0 -0
  72. package/_framework/System.IO.wasm +0 -0
  73. package/_framework/System.Linq.AsyncEnumerable.wasm +0 -0
  74. package/_framework/System.Linq.Expressions.wasm +0 -0
  75. package/_framework/System.Linq.Parallel.wasm +0 -0
  76. package/_framework/System.Linq.Queryable.wasm +0 -0
  77. package/_framework/System.Linq.wasm +0 -0
  78. package/_framework/System.Memory.wasm +0 -0
  79. package/_framework/System.Net.Http.Json.wasm +0 -0
  80. package/_framework/System.Net.Http.wasm +0 -0
  81. package/_framework/System.Net.HttpListener.wasm +0 -0
  82. package/_framework/System.Net.Mail.wasm +0 -0
  83. package/_framework/System.Net.NameResolution.wasm +0 -0
  84. package/_framework/System.Net.NetworkInformation.wasm +0 -0
  85. package/_framework/System.Net.Ping.wasm +0 -0
  86. package/_framework/System.Net.Primitives.wasm +0 -0
  87. package/_framework/System.Net.Quic.wasm +0 -0
  88. package/_framework/System.Net.Requests.wasm +0 -0
  89. package/_framework/System.Net.Security.wasm +0 -0
  90. package/_framework/System.Net.ServerSentEvents.wasm +0 -0
  91. package/_framework/System.Net.ServicePoint.wasm +0 -0
  92. package/_framework/System.Net.Sockets.wasm +0 -0
  93. package/_framework/System.Net.WebClient.wasm +0 -0
  94. package/_framework/System.Net.WebHeaderCollection.wasm +0 -0
  95. package/_framework/System.Net.WebProxy.wasm +0 -0
  96. package/_framework/System.Net.WebSockets.Client.wasm +0 -0
  97. package/_framework/System.Net.WebSockets.wasm +0 -0
  98. package/_framework/System.Net.wasm +0 -0
  99. package/_framework/System.Numerics.Vectors.wasm +0 -0
  100. package/_framework/System.Numerics.wasm +0 -0
  101. package/_framework/System.ObjectModel.wasm +0 -0
  102. package/_framework/System.Private.CoreLib.wasm +0 -0
  103. package/_framework/System.Private.DataContractSerialization.wasm +0 -0
  104. package/_framework/System.Private.Uri.wasm +0 -0
  105. package/_framework/System.Private.Xml.Linq.wasm +0 -0
  106. package/_framework/System.Private.Xml.wasm +0 -0
  107. package/_framework/System.Reflection.DispatchProxy.wasm +0 -0
  108. package/_framework/System.Reflection.Emit.ILGeneration.wasm +0 -0
  109. package/_framework/System.Reflection.Emit.Lightweight.wasm +0 -0
  110. package/_framework/System.Reflection.Emit.wasm +0 -0
  111. package/_framework/System.Reflection.Extensions.wasm +0 -0
  112. package/_framework/System.Reflection.Metadata.wasm +0 -0
  113. package/_framework/System.Reflection.Primitives.wasm +0 -0
  114. package/_framework/System.Reflection.TypeExtensions.wasm +0 -0
  115. package/_framework/System.Reflection.wasm +0 -0
  116. package/_framework/System.Resources.Reader.wasm +0 -0
  117. package/_framework/System.Resources.ResourceManager.wasm +0 -0
  118. package/_framework/System.Resources.Writer.wasm +0 -0
  119. package/_framework/System.Runtime.CompilerServices.Unsafe.wasm +0 -0
  120. package/_framework/System.Runtime.CompilerServices.VisualC.wasm +0 -0
  121. package/_framework/System.Runtime.Extensions.wasm +0 -0
  122. package/_framework/System.Runtime.Handles.wasm +0 -0
  123. package/_framework/System.Runtime.InteropServices.JavaScript.wasm +0 -0
  124. package/_framework/System.Runtime.InteropServices.RuntimeInformation.wasm +0 -0
  125. package/_framework/System.Runtime.InteropServices.wasm +0 -0
  126. package/_framework/System.Runtime.Intrinsics.wasm +0 -0
  127. package/_framework/System.Runtime.Loader.wasm +0 -0
  128. package/_framework/System.Runtime.Numerics.wasm +0 -0
  129. package/_framework/System.Runtime.Serialization.Formatters.wasm +0 -0
  130. package/_framework/System.Runtime.Serialization.Json.wasm +0 -0
  131. package/_framework/System.Runtime.Serialization.Primitives.wasm +0 -0
  132. package/_framework/System.Runtime.Serialization.Xml.wasm +0 -0
  133. package/_framework/System.Runtime.Serialization.wasm +0 -0
  134. package/_framework/System.Runtime.wasm +0 -0
  135. package/_framework/System.Security.AccessControl.wasm +0 -0
  136. package/_framework/System.Security.Claims.wasm +0 -0
  137. package/_framework/System.Security.Cryptography.Algorithms.wasm +0 -0
  138. package/_framework/System.Security.Cryptography.Cng.wasm +0 -0
  139. package/_framework/System.Security.Cryptography.Csp.wasm +0 -0
  140. package/_framework/System.Security.Cryptography.Encoding.wasm +0 -0
  141. package/_framework/System.Security.Cryptography.OpenSsl.wasm +0 -0
  142. package/_framework/System.Security.Cryptography.Primitives.wasm +0 -0
  143. package/_framework/System.Security.Cryptography.X509Certificates.wasm +0 -0
  144. package/_framework/System.Security.Cryptography.wasm +0 -0
  145. package/_framework/System.Security.Principal.Windows.wasm +0 -0
  146. package/_framework/System.Security.Principal.wasm +0 -0
  147. package/_framework/System.Security.SecureString.wasm +0 -0
  148. package/_framework/System.Security.wasm +0 -0
  149. package/_framework/System.ServiceModel.Web.wasm +0 -0
  150. package/_framework/System.ServiceProcess.wasm +0 -0
  151. package/_framework/System.Text.Encoding.CodePages.wasm +0 -0
  152. package/_framework/System.Text.Encoding.Extensions.wasm +0 -0
  153. package/_framework/System.Text.Encoding.wasm +0 -0
  154. package/_framework/System.Text.Encodings.Web.wasm +0 -0
  155. package/_framework/System.Text.Json.wasm +0 -0
  156. package/_framework/System.Text.RegularExpressions.wasm +0 -0
  157. package/_framework/System.Threading.AccessControl.wasm +0 -0
  158. package/_framework/System.Threading.Channels.wasm +0 -0
  159. package/_framework/System.Threading.Overlapped.wasm +0 -0
  160. package/_framework/System.Threading.Tasks.Dataflow.wasm +0 -0
  161. package/_framework/System.Threading.Tasks.Extensions.wasm +0 -0
  162. package/_framework/System.Threading.Tasks.Parallel.wasm +0 -0
  163. package/_framework/System.Threading.Tasks.wasm +0 -0
  164. package/_framework/System.Threading.Thread.wasm +0 -0
  165. package/_framework/System.Threading.ThreadPool.wasm +0 -0
  166. package/_framework/System.Threading.Timer.wasm +0 -0
  167. package/_framework/System.Threading.wasm +0 -0
  168. package/_framework/System.Transactions.Local.wasm +0 -0
  169. package/_framework/System.Transactions.wasm +0 -0
  170. package/_framework/System.ValueTuple.wasm +0 -0
  171. package/_framework/System.Web.HttpUtility.wasm +0 -0
  172. package/_framework/System.Web.wasm +0 -0
  173. package/_framework/System.Windows.wasm +0 -0
  174. package/_framework/System.Xml.Linq.wasm +0 -0
  175. package/_framework/System.Xml.ReaderWriter.wasm +0 -0
  176. package/_framework/System.Xml.Serialization.wasm +0 -0
  177. package/_framework/System.Xml.XDocument.wasm +0 -0
  178. package/_framework/System.Xml.XPath.XDocument.wasm +0 -0
  179. package/_framework/System.Xml.XPath.wasm +0 -0
  180. package/_framework/System.Xml.XmlDocument.wasm +0 -0
  181. package/_framework/System.Xml.XmlSerializer.wasm +0 -0
  182. package/_framework/System.Xml.wasm +0 -0
  183. package/_framework/System.wasm +0 -0
  184. package/_framework/WasmPlayer.wasm +0 -0
  185. package/_framework/WindowsBase.wasm +0 -0
  186. package/_framework/dotnet.boot.js +1003 -0
  187. package/_framework/dotnet.js +4 -0
  188. package/_framework/dotnet.native.js +6687 -0
  189. package/_framework/dotnet.native.wasm +0 -0
  190. package/_framework/dotnet.runtime.js +4 -0
  191. package/_framework/icudt_CJK.dat +0 -0
  192. package/_framework/icudt_EFIGS.dat +0 -0
  193. package/_framework/icudt_no_CJK.dat +0 -0
  194. package/_framework/mscorlib.wasm +0 -0
  195. package/_framework/netstandard.wasm +0 -0
  196. package/chrome.css +22 -0
  197. package/favicon.svg +1 -0
  198. package/grid.js +446 -0
  199. package/index.html +214 -0
  200. package/lib/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  201. package/lib/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  202. package/lib/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  203. package/lib/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  204. package/lib/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  205. package/lib/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  206. package/lib/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  207. package/lib/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  208. package/lib/images/ui-icons_217bc0_256x240.png +0 -0
  209. package/lib/images/ui-icons_2e83ff_256x240.png +0 -0
  210. package/lib/images/ui-icons_469bdd_256x240.png +0 -0
  211. package/lib/images/ui-icons_6da8d5_256x240.png +0 -0
  212. package/lib/images/ui-icons_cd0a0a_256x240.png +0 -0
  213. package/lib/images/ui-icons_d8e7f3_256x240.png +0 -0
  214. package/lib/images/ui-icons_f9bd01_256x240.png +0 -0
  215. package/lib/jquery-2.1.1.min.js +4 -0
  216. package/lib/jquery-ui.min.css +7 -0
  217. package/lib/jquery-ui.min.js +13 -0
  218. package/lib/jquery.multi-open-accordion-1.5.3.js +261 -0
  219. package/lib/paper.js +12848 -0
  220. package/logo.svg +1 -0
  221. package/package.json +13 -0
  222. package/player.js +258 -0
  223. package/playercore.css +293 -0
  224. package/playercore.htm +206 -0
  225. package/playercore.js +2639 -0
  226. package/quest-config.js +13 -0
  227. package/wasm-player.js +2024 -0
package/logo.svg ADDED
@@ -0,0 +1 @@
1
+ <svg version="1.1" viewBox="70 290 880 466" fill="none" stroke="none" stroke-linecap="square" stroke-miterlimit="10" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><clipPath id="g33f5cd2a327_0_0.0"><path d="m0 0l1024.0 0l0 1024.0l-1024.0 0l0 -1024.0z" clip-rule="nonzero"/></clipPath><g clip-path="url(#g33f5cd2a327_0_0.0)"><path fill="#000000" fill-opacity="0.0" d="m0 0l1024.0 0l0 1024.0l-1024.0 0z" fill-rule="evenodd"/><path fill="#000000" fill-opacity="0.0" d="m-17.160105 195.79527l1024.0 0l0 632.4094l-1024.0 0z" fill-rule="evenodd"/><path fill="#666666" d="m100.50396 632.07965l210.9375 -86.015625l0 -53.203125l-210.9375 -85.78125l0 63.046875l134.53125 44.296875l14.0625 4.6875l-14.296875 4.6875l-134.29688 45.0l0 63.28125z" fill-rule="nonzero"/><path fill="#6d9eeb" d="m621.75397 530.3609l0 -59.0625q0 -18.046875 -2.578125 -34.5625q-2.578125 -16.53125 -7.734375 -31.0625q-7.03125 -20.625 -19.21875 -37.265625q-12.1875 -16.640625 -28.359375 -28.125q-14.296875 -9.84375 -31.875 -15.234375q-17.578125 -5.390625 -37.734375 -5.390625q-20.15625 0 -37.265625 5.390625q-17.109375 5.390625 -30.9375 15.234375q-15.234375 10.78125 -26.25 26.140625q-11.015625 15.34375 -17.578125 34.328125q-5.625 15.234375 -8.5625 33.171875q-2.921875 17.921875 -2.921875 37.375l0 59.0625q0 16.875 3.046875 32.9375q3.046875 16.046875 8.90625 30.34375q6.5625 16.40625 17.21875 30.703125q10.671875 14.296875 24.96875 24.609375q14.0625 10.078125 31.40625 15.703125q17.34375 5.625 37.96875 5.625q9.140625 0 17.6875 -1.171875q8.5625 -1.171875 16.765625 -3.28125l64.921875 60.0l42.421875 -37.734375l-56.484375 -51.09375q9.140625 -8.671875 16.28125 -19.09375q7.15625 -10.4375 12.3125 -21.921875q6.5625 -14.765625 9.953125 -31.40625q3.40625 -16.640625 3.640625 -34.21875zm-66.796875 -59.53125l0 59.53125q0 9.375 -1.171875 18.640625q-1.171875 9.25 -3.515625 17.921875q-3.28125 11.484375 -9.03125 21.5625q-5.734375 10.078125 -13.9375 16.875q-6.5625 4.921875 -14.765625 7.859375q-8.203125 2.921875 -18.28125 2.921875q-9.84375 0 -17.703125 -2.8125q-7.84375 -2.8125 -13.703125 -7.96875q-8.203125 -6.796875 -13.59375 -17.109375q-5.390625 -10.3125 -8.203125 -22.96875q-1.875 -8.203125 -2.703125 -17.109375q-0.8125 -8.90625 -0.8125 -17.8125l0 -59.53125q0 -10.546875 0.703125 -20.265625q0.703125 -9.734375 2.109375 -18.40625q2.34375 -15.0 7.609375 -27.0625q5.28125 -12.078125 14.1875 -19.8125q6.09375 -5.390625 14.0625 -8.203125q7.96875 -2.8125 18.046875 -2.8125q10.546875 0 19.09375 3.046875q8.5625 3.046875 15.125 8.4375q6.796875 6.328125 12.1875 15.359375q5.390625 9.015625 8.203125 20.03125q3.28125 10.546875 4.6875 23.203125q1.40625 12.65625 1.40625 26.484375z" fill-rule="nonzero"/><path fill="#e06666" d="m749.25397 665.5953l67.03125 0l103.359375 -341.25l-72.65625 0l-58.125 222.65625l-6.328125 23.203125l-5.859375 -22.96875l-57.890625 -222.89062l-72.65625 0l103.125 341.25z" fill-rule="nonzero"/></g></svg>
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@textadventures/quest-viva-wasmplayer",
3
+ "version": "6.0.0-beta.50",
4
+ "private": false,
5
+ "description": "Quest Viva WasmPlayer runtime (browser-WASM text adventure player), published for CDN-linked single-file game exports.",
6
+ "license": "MIT",
7
+ "homepage": "https://questviva.com",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/textadventures/quest.git",
11
+ "directory": "src/WasmPlayer"
12
+ }
13
+ }
package/player.js ADDED
@@ -0,0 +1,258 @@
1
+ var $_GET = {};
2
+ var webPlayer = false;
3
+ var tmrTick = null;
4
+ var tickCount = 0;
5
+ var sendNextGameTickerAfter = 0;
6
+ var canSendCommand = true;
7
+ var outputBufferId;
8
+ var gameSessionLogData;
9
+
10
+ document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
11
+ function decode(s) {
12
+ return decodeURIComponent(s.split("+").join(" "));
13
+ }
14
+
15
+ $_GET[decode(arguments[1])] = decode(arguments[2]);
16
+ });
17
+
18
+ function setOutputBufferId(id) {
19
+ outputBufferId = id;
20
+ setUpSessionLog();
21
+ }
22
+
23
+ function setUpSessionLog() {
24
+ if (outputBufferId && gameSessionLogData) {
25
+ $.post("/GameSession/Init/?userId=" + gameSessionLogData.UserId + "&sessionId=" + gameSessionLogData.SessionId + "&bufferId=" + outputBufferId);
26
+ }
27
+ }
28
+
29
+ var _waitingForSoundToFinish = false;
30
+
31
+ function msgboxSubmit(response) {
32
+ markUnsavedProgress();
33
+ $("#msgbox").dialog("close");
34
+ window.setTimeout(async function () {
35
+ await WebPlayer.uiSetQuestionResponse(response);
36
+ }, 100);
37
+ }
38
+
39
+ var _menuSelection = "";
40
+
41
+ function showMenu(title, options, allowCancel) {
42
+ $("#dialogOptions").empty();
43
+ var firstOption = true;
44
+ $.each(options, function (key, value) {
45
+ // Explicitly mark the first <option> selected - a <select> visually
46
+ // shows its first option as selected by default, but jQuery's .val()
47
+ // returns null (not that option's value) unless one is actually
48
+ // marked with the selected attribute, which broke dialogSelect() for
49
+ // anyone who clicked "Select" without first clicking an option.
50
+ $("#dialogOptions").append(
51
+ $("<option/>").attr("value", key).text(value).prop("selected", firstOption)
52
+ );
53
+ firstOption = false;
54
+ });
55
+
56
+ $("#dialogCaption").html(title);
57
+
58
+ var dialogOptions = {
59
+ modal: true,
60
+ autoOpen: false,
61
+ buttons: [{
62
+ text: "Select",
63
+ click: function () {
64
+ dialogSelect();
65
+ }
66
+ }]
67
+ };
68
+
69
+ if (allowCancel) {
70
+ dialogOptions.buttons = dialogOptions.buttons.concat([{
71
+ text: "Cancel",
72
+ click: function () {
73
+ dialogCancel();
74
+ }
75
+ }]);
76
+ dialogOptions.close = function (event, ui) {
77
+ dialogClose();
78
+ };
79
+ } else {
80
+ dialogOptions.closeOnEscape = false;
81
+ dialogOptions.open = function (event, ui) {
82
+ $(".ui-dialog-titlebar-close").hide();
83
+ }; // suppresses "close" button
84
+ }
85
+
86
+ _menuSelection = "";
87
+ $("#dialog").dialog(dialogOptions);
88
+
89
+ $("#dialog").dialog("open");
90
+ }
91
+
92
+ function dialogSelect() {
93
+ _menuSelection = $("#dialogOptions").val();
94
+ if (_menuSelection.length > 0) {
95
+ markUnsavedProgress();
96
+ $("#dialog").dialog("close");
97
+ window.setTimeout(function () {
98
+ WebPlayer.uiChoice(_menuSelection);
99
+ }, 100);
100
+ }
101
+ }
102
+
103
+ function dialogCancel() {
104
+ $("#dialog").dialog("close");
105
+ }
106
+
107
+ function dialogClose() {
108
+ if (_menuSelection.length == 0) {
109
+ dialogSendCancel();
110
+ }
111
+ }
112
+
113
+ function dialogSendCancel() {
114
+ window.setTimeout(async function () {
115
+ await WebPlayer.uiChoiceCancel();
116
+ }, 100);
117
+ }
118
+
119
+ function sendCommand(text, metadata) {
120
+ if (_pauseMode || _waitingForSoundToFinish || _waitMode || !canSendCommand) return;
121
+ canSendCommand = false;
122
+ markScrollPosition();
123
+ markUnsavedProgress();
124
+
125
+ window.setTimeout(function () {
126
+ WebPlayer.sendCommand(text, getTickCountAndStopTimer(), metadata);
127
+ }, 0);
128
+ }
129
+
130
+ function ASLEvent(event, parameter) {
131
+ markUnsavedProgress();
132
+ window.setTimeout(async function () {
133
+ await WebPlayer.uiSendEvent(event, "" + parameter);
134
+ }, 1);
135
+ return true;
136
+ }
137
+
138
+ function disableMainScrollbar() {
139
+ $("#divOutput").css("overflow", "hidden");
140
+ }
141
+
142
+ var _timerRunning = false;
143
+
144
+ function startTimer() {
145
+ if (_timerRunning) return;
146
+ _timerRunning = true;
147
+ tickCount = 0;
148
+ tmrTick = setInterval(async function () {
149
+ await timerTick();
150
+ }, 1000);
151
+ }
152
+
153
+ function stopTimer() {
154
+ if (!_timerRunning) return;
155
+ _timerRunning = false;
156
+ clearInterval(tmrTick);
157
+ }
158
+
159
+ async function timerTick() {
160
+ tickCount++;
161
+ if (sendNextGameTickerAfter > 0 && tickCount >= sendNextGameTickerAfter) {
162
+ await WebPlayer.uiTick(getTickCountAndStopTimer());
163
+ }
164
+ }
165
+
166
+ function getTickCountAndStopTimer() {
167
+ stopTimer();
168
+ return tickCount;
169
+ }
170
+
171
+ function requestNextTimerTick(seconds) {
172
+ sendNextGameTickerAfter = seconds;
173
+ startTimer();
174
+ }
175
+
176
+ function goUrl(href) {
177
+ window.open(href);
178
+ }
179
+
180
+ function saveGame() {
181
+ setTimeout(async () => {
182
+ await GameSaver.save();
183
+ }, 100);
184
+ }
185
+
186
+ // Initialise() unconditionally re-registers the game's external scripts every
187
+ // time it runs, including on a mid-session restart (Start from the beginning
188
+ // / Load) — but a real <script src> only ever runs once per document, so
189
+ // re-adding the same URL against the *same* live DOM would re-execute the
190
+ // game's setup code against elements it already set up on the previous run
191
+ // (e.g. a custom sidebar pane), producing duplicates. Dedupe by URL so each
192
+ // script tag still only truly executes once per document, same as normal
193
+ // page-load semantics.
194
+ //
195
+ // A restart also wipes and rebuilds the whole player chrome first (see
196
+ // WasmPlayer's swapInPlayerUi() / WebPlayer's resetPlayerUi()), so by the
197
+ // time Initialise() re-registers scripts against that fresh DOM, the
198
+ // "already set up on the previous run" premise above no longer holds — the
199
+ // old elements are gone, and the dedupe would wrongly skip re-running setup
200
+ // code against the new ones, silently dropping anything the script injects
201
+ // (confirmed via a real game's custom sidebar pane vanishing after restart).
202
+ // Both chrome-reset call sites clear the set via clearLoadedExternalScripts()
203
+ // so a restart's re-registration is treated as a genuinely fresh page load.
204
+ var _loadedExternalScripts = new Set();
205
+
206
+ function clearLoadedExternalScripts() {
207
+ _loadedExternalScripts.clear();
208
+ }
209
+
210
+ function addExternalScript(url) {
211
+ if (_loadedExternalScripts.has(url)) return Promise.resolve();
212
+ _loadedExternalScripts.add(url);
213
+
214
+ return new Promise((resolve, reject) => {
215
+ const script = document.createElement("script");
216
+ script.src = url;
217
+ script.onload = () => resolve();
218
+ script.onerror = () => {
219
+ _loadedExternalScripts.delete(url);
220
+ reject(new Error(`Failed to load script: ${url}`));
221
+ };
222
+ document.head.appendChild(script);
223
+ });
224
+ }
225
+
226
+ function WriteToTranscript(data) {
227
+ if (noTranscript) {
228
+ // Do nothing.
229
+ return;
230
+ }
231
+ if (!isLocalStorageAvailable()) {
232
+ console.error("There is no localStorage. Disabling transcript functionality.");
233
+ noTranscript = true;
234
+ savingTranscript = false;
235
+ return;
236
+ }
237
+ var tName = transcriptName || "Transcript";
238
+ if (data.indexOf("___SCRIPTDATA___") > -1) {
239
+ tName = data.split("___SCRIPTDATA___")[0].trim() || tName;
240
+ data = data.split("___SCRIPTDATA___")[1];
241
+ }
242
+ var oldData = localStorage.getItem("questtranscript-" + tName) || "";
243
+ localStorage.setItem("questtranscript-" + tName, oldData + data);
244
+ }
245
+
246
+ // Make sure localStorage is available, hopefully without throwing any errors!
247
+
248
+ /* https://stackoverflow.com/a/16427747 */
249
+ function isLocalStorageAvailable() {
250
+ var test = 'test';
251
+ try {
252
+ localStorage.setItem(test, test);
253
+ localStorage.removeItem(test);
254
+ return true;
255
+ } catch (e) {
256
+ return false;
257
+ }
258
+ }
package/playercore.css ADDED
@@ -0,0 +1,293 @@
1
+ body {
2
+ font-family: Arial, Helvetica, sans-serif;
3
+ overflow-y: scroll;
4
+ background-attachment: fixed;
5
+ /* playercore.js explicitly recomputes and sets scroll position itself on
6
+ every relevant DOM change (new turn, picture frame resizing — see
7
+ scrollToTurnStart()/setPanelHeight() in playercore.js), including
8
+ content inserted above the current scroll position (the sticky
9
+ picture frame growing once its image loads). Chrome's default scroll
10
+ anchoring tries to do the same job automatically to avoid a visual
11
+ jump, but its guess and playercore.js's own (more informed) target
12
+ can disagree — and since anchoring applies *before* playercore.js's
13
+ own correction runs, its adjustment becomes the new "current scroll
14
+ position" that scrollToTurnStart()'s never-scroll-backward guard then
15
+ treats as intentional, silently defeating the real correction.
16
+ Disabling it leaves scroll positioning entirely to our own logic. */
17
+ overflow-anchor: none;
18
+ }
19
+
20
+ html,
21
+ body {
22
+ margin: 0px;
23
+ height: 100%;
24
+ }
25
+
26
+ a.cmdlink {
27
+ text-decoration: underline;
28
+ color: Blue;
29
+ cursor: pointer;
30
+ }
31
+
32
+ a.cmdlink.disabled {
33
+ text-decoration: inherit;
34
+ color: inherit !important;
35
+ cursor: inherit;
36
+ }
37
+
38
+ div#gameBorder {
39
+ max-width: 950px;
40
+ margin-left: auto;
41
+ margin-right: auto;
42
+ border-left: 1px solid silver;
43
+ border-right: 1px solid silver;
44
+ margin-top: 0;
45
+ min-height: 100%;
46
+ }
47
+
48
+ div#gamePanel {
49
+ position: sticky;
50
+ top: 32px;
51
+ padding-top: 2px;
52
+ text-align: center;
53
+ display: none;
54
+ }
55
+
56
+ div#gridPanel {
57
+ position: sticky;
58
+ top: 32px;
59
+ padding: 0;
60
+ overflow: hidden;
61
+ display: none;
62
+ }
63
+
64
+ div#gameContent {
65
+ padding: 30px 20px 0px 20px;
66
+ min-height: 100%;
67
+ }
68
+
69
+ div#gamePanes {
70
+ position: fixed;
71
+ float: right;
72
+ width: 216px;
73
+ top: 24px;
74
+ padding: 2px;
75
+ background: #F9F9FF;
76
+ min-height: 100%;
77
+ display: none;
78
+ left: 50%;
79
+ margin-left: 255px;
80
+ }
81
+
82
+ div#qv-status {
83
+ height: 30px;
84
+ position: fixed;
85
+ top: 0px;
86
+ z-index: 100;
87
+ width: 100%;
88
+ max-width: 948px;
89
+ margin-left: auto;
90
+ margin-right: auto;
91
+ font-size: 14pt;
92
+ padding: 0;
93
+ display: none;
94
+ }
95
+
96
+ div#location {
97
+ display: none;
98
+ padding-left: 4px;
99
+ padding-top: 4px;
100
+ }
101
+
102
+ div#controlButtons {
103
+ float: right;
104
+ }
105
+
106
+ .hiddenbutton {
107
+ display: none;
108
+ }
109
+
110
+ #dialog {
111
+ display: none;
112
+ }
113
+
114
+ #msgbox {
115
+ display: none;
116
+ }
117
+
118
+ .compassbutton {
119
+ margin-right: 0;
120
+ height: 35px;
121
+ width: 35px;
122
+ }
123
+
124
+ #statusVars {
125
+ padding: 4px;
126
+ max-height: 140px;
127
+ }
128
+
129
+ #gamePanesFinished {
130
+ display: none;
131
+ }
132
+
133
+ #cmdSave {
134
+ margin-top: 0px;
135
+ }
136
+
137
+ div#divOutput {
138
+ margin-top: 20px;
139
+ min-height: 100%;
140
+ }
141
+
142
+ div#txtCommandDiv {
143
+ height: 40px;
144
+ display: none;
145
+ }
146
+
147
+ div#txtCommandContainer {
148
+ display: flex;
149
+ flex-direction: row;
150
+ align-items: center;
151
+ }
152
+
153
+ #txtCommand {
154
+ font-size: 20px;
155
+ vertical-align: bottom;
156
+ padding: 6px;
157
+ flex-grow: 1;
158
+ }
159
+
160
+ #txtCommandSpacer {
161
+ height: 10px;
162
+ }
163
+
164
+ div#controlButtons .ui-button {
165
+ font-size: 10px !important;
166
+ }
167
+
168
+ .verbButtons {
169
+ text-align: center;
170
+ }
171
+
172
+ .verbButtons .ui-button {
173
+ font-size: 10px !important;
174
+ margin: 5px;
175
+ }
176
+
177
+ #compassTable .ui-button {
178
+ font-family: Arial, Helvetica, sans-serif;
179
+ font-size: 10px !important;
180
+ border: 2px solid #C5DBEC;
181
+ }
182
+
183
+ #compassTable .ui-button-disabled {
184
+ border: 1px solid #C5DBEC;
185
+ background: inherit;
186
+ }
187
+
188
+ .ui-accordion .ui-accordion-content {
189
+ padding: 0;
190
+ }
191
+
192
+ .ui-accordion-header {
193
+ font-size: 12px;
194
+ margin-top: 10px !important;
195
+ }
196
+
197
+ h3 .ui-icon {
198
+ position: absolute;
199
+ }
200
+
201
+ h3 .accordion-header-text {
202
+ padding-left: 1.8em;
203
+ }
204
+
205
+ #gamePanes .ui-widget {
206
+ font-size: 12px;
207
+ }
208
+
209
+ #endWaitLink {
210
+ font-size: 16px;
211
+ font-weight: bold;
212
+ }
213
+
214
+ .ui-selecting {
215
+ background: #FECA40;
216
+ }
217
+
218
+ .ui-selected {
219
+ background: #F39814;
220
+ color: white;
221
+ }
222
+
223
+ .elementListWrapper {
224
+ max-height: 200px;
225
+ overflow-y: scroll;
226
+ }
227
+
228
+ .elementList {
229
+ list-style-type: none;
230
+ margin: 0;
231
+ padding: 0;
232
+ }
233
+
234
+ .elementList li {
235
+ padding: 3px;
236
+ cursor: default;
237
+ }
238
+
239
+ div#gamePanel img {
240
+ max-width: 100%;
241
+ }
242
+
243
+ div#divOutput img {
244
+ max-width: 100%;
245
+ }
246
+
247
+ div.jjmenu {
248
+ font-size: 12px;
249
+ position: absolute;
250
+ background: #fffef0;
251
+ border-bottom: 2px solid gray;
252
+ border-right: 1px solid gray;
253
+ padding: 0px;
254
+ }
255
+
256
+ div.jj_menu_item {
257
+ color: black;
258
+ border: 1px solid gray;
259
+ border-bottom: none;
260
+ background: white;
261
+ cursor: pointer;
262
+ }
263
+
264
+ div.jj_menu_item span {
265
+ display: block;
266
+ padding: 4px;
267
+ }
268
+
269
+ div.jj_menu_item_hover {
270
+ background: #e4e4e4;
271
+ }
272
+
273
+ #cmdShowPanes {
274
+ display: none;
275
+ }
276
+
277
+ #sidebar {
278
+ display: none;
279
+ position: fixed; /* fixed position to overlay content */
280
+ top: 32px;
281
+ right: 0;
282
+ width: 220px;
283
+ height: 100%;
284
+ /*background: #fff;*/
285
+ z-index: 1000;
286
+ overflow-y: auto;
287
+ /*box-shadow: -2px 0 5px rgba(0,0,0,0.5);*/
288
+ padding: 10px;
289
+ }
290
+
291
+ #cmdShowPanes {
292
+ display: none;
293
+ }