From cb883a2648188cabfb959b1f23e59e5179206578 Mon Sep 17 00:00:00 2001 From: Jet Date: Sat, 23 Sep 2023 13:40:56 -0700 Subject: [PATCH] Finer controls for mapping --- js/base.js | 2 +- js/components/mapping.js | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/js/base.js b/js/base.js index f0cd2f5..567ad28 100644 --- a/js/base.js +++ b/js/base.js @@ -516,7 +516,7 @@ class TCTData { } getMapCode() { - const viewboxCode = false ? "this.paper.setViewBox(0,0,c,u,false);" : `this.paper.setViewBox(0, 0, ${this.jet_data.mapping_data.x}, ${this.jet_data.mapping_data.y}, false);`; + const viewboxCode = false ? "this.paper.setViewBox(0,0,c,u,false);" : `this.paper.setViewBox(${this.jet_data.mapping_data.dx}, ${this.jet_data.mapping_data.dy}, ${this.jet_data.mapping_data.x}, ${this.jet_data.mapping_data.y}, false);`; return `(function(e,t,n,r,i){function s(e,t,n,r){r=r instanceof Array?r:[];var i={};for(var s=0;sWARNING: If you click this all your states and anything referencing your states will be deleted from your code 2 and replaced from what the tool gets from your SVG. You should only be doing this once when starting to make the mod.

- +

Change the x and y values to change how big the map appears in the preview if the map isn't fitting currently.



+
+
+

+
+
+

NOTE: Each time you exit this tab your preview will disappear if you don't press Load Map From SVG, so make sure to do all your mapping in one fell swoop.


@@ -63,6 +71,8 @@ Vue.component('mapping', { Vue.prototype.$TCT.jet_data.mapping_data.mapSvg = this.mapSvg; Vue.prototype.$TCT.jet_data.mapping_data.x = this.x; Vue.prototype.$TCT.jet_data.mapping_data.y = this.y; + Vue.prototype.$TCT.jet_data.mapping_data.dx = this.dx; + Vue.prototype.$TCT.jet_data.mapping_data.dy = this.dy; Vue.prototype.$TCT.loadMap(); Vue.prototype.$globalData.state = Object.keys(Vue.prototype.$TCT.states)[0]; @@ -113,7 +123,7 @@ Vue.component('mapping', { Vue.component('map-preview', { - props: ['svg', 'x', 'y'], + props: ['svg', 'x', 'y', 'dx', 'dy'], template: `
@@ -135,7 +145,7 @@ Vue.component('map-preview', { }, viewBox: function() { - return `0 0 ${this.x ?? 925} ${this.y ?? 595}` + return `${this.dx ?? 0} ${this.dy ?? 0} ${this.x ?? 925} ${this.y ?? 595}` } }