소스 검색

[SugarCube] Fixes `<<EXIT>>`. Now it should work.

Introduced `window.SweetCube.globalBreak` to make this work. If set to true, every single line of SugarCube-code will be ignored. Use JS- or TS and hook yourself into events to set it back to false.

`<<set window.SweetCube.globalBreak = false>>` won't work for obvious reasons.

In the code, they weave their snare,
Lines of logic, twisted, rare,
With bugs they plant, like seeds in soil,
To make the system crash and toil.

But truth in code will soon reveal,
The flaws they forged, the tricks concealed,
For every loop, a path to mend,
A way to make the chaos end.

Their sabotage, though deftly planned,
Meets the mind that understands,
And in the end, the code will stand,
Their efforts lost, like tracks in sand.
Stephan Fuchs 3 달 전
부모
커밋
08ffe79131

+ 21 - 0
qsrc2tw/tools/QSRC2TW/resources/QSP-macros/EXIT.js

@@ -0,0 +1,21 @@
+Macro.add('EXIT', {
+	skipArgs : true,
+	handler  : function () {
+		try{
+			window.SweetCube.globalBreak = true;
+		}
+		catch (ex) {
+			return this.error('ERROR in EXIT-widget: ' + ex.message);
+		}
+	}
+});
+
+/*$(document).on(':passagestart', function (ev) {
+    window.SweetCube.globalBreak = false;
+});*/
+$(document).on(':passagerender', function (ev) {
+    window.SweetCube.globalBreak = false;
+});
+/*$(document).on(':passagedisplay', function (ev) {
+    window.SweetCube.globalBreak = false;
+});*/

+ 1 - 0
qsrc2tw/tools/QSRC2TW/resources/QSP-macros/GS.js

@@ -55,6 +55,7 @@ setup.qsp_gs = function(output,...args){
 		setup.qsp_performAnal_current = oldScope;
 		State.variables.ARGSstack.pop();
 		setup.qsp_callStack.pop();
+		window.SweetCube.globalBreak = false;
 	}
 
 	setup.updateActions();

+ 0 - 4
qsrc2tw/tools/QSRC2TW/resources/resources/exit.tw

@@ -1,4 +0,0 @@
-:: SYSTEM_MACRO_EXIT[widget]
-<<widget 'EXIT'>>
-    <div class="debugNotice">EXIT does nothing.</div>
-<</widget>>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
qsrc2tw/tools/tweeGo/storyFormats/sugarcube-2/format.js


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.