summaryrefslogtreecommitdiffstats
path: root/tools/worldbuilder/code/scripts/wb_coinsplines.mel
diff options
context:
space:
mode:
authorSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
committerSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
commiteb4b3404aa00220d659e532151dab13d642c17a3 (patch)
tree7e1107c4995489a26c4007e41b53ea8d00ab2134 /tools/worldbuilder/code/scripts/wb_coinsplines.mel
downloadThe-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.gz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.bz2
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.lz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.xz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.zst
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.zip
Diffstat (limited to 'tools/worldbuilder/code/scripts/wb_coinsplines.mel')
-rw-r--r--tools/worldbuilder/code/scripts/wb_coinsplines.mel53
1 files changed, 53 insertions, 0 deletions
diff --git a/tools/worldbuilder/code/scripts/wb_coinsplines.mel b/tools/worldbuilder/code/scripts/wb_coinsplines.mel
new file mode 100644
index 0000000..750eb3e
--- /dev/null
+++ b/tools/worldbuilder/code/scripts/wb_coinsplines.mel
@@ -0,0 +1,53 @@
+global int $gCoinSplineCompleteCB = -1;
+
+global proc wb_MCB_CreateCoinPath()
+{
+ global int $gCoinSplineCompleteCB;
+
+ if ( !`contextInfo -exists CoinSplineCtx` )
+ {
+ curveCVCtx -degree 3 -me true -un true CoinSplineCtx;
+ print "create\n";
+ }
+ else
+ {
+ string $currentCtx = `currentCtx`;
+
+ if ( $currentCtx == "CoinSplineCtx" )
+ {
+ print "complete\n";
+ ctxCompletion;
+
+ wb_CB_CoinSplineComplete();
+ }
+ }
+
+ print "select\n";
+ setToolTo CoinSplineCtx;
+
+ $gCoinSplineCompleteCB = `scriptJob -ro 1 -p "WorldBuilder" -e "ToolChanged" wb_CB_CoinSplineComplete`;
+}
+
+global proc wb_CB_CoinSplineComplete()
+{
+ print "complete callback\n";
+ WB_CoinSplineComplete();
+}
+
+global proc wb_CoinSplinesCleanup()
+{
+ print "clean\n";
+ global int $gCoinSplineCompleteCB;
+
+ if ( $gCoinSplineCompleteCB != -1 )
+ {
+ scriptJob -k $gCoinSplineCompleteCB;
+ print "kill job\n";
+ }
+
+ if ( `contextInfo -exists CoinSplineCtx` )
+ {
+ print "delete ui\n";
+ deleteUI -tc CoinSplineCtx;
+ }
+}