Yeah, that's pretty much how the STE's Menu Editor saves everything.
For example:
Code:
{
"Scene_Title": {
"Window_TitleCommand": {
"x": "100",
"y": "500"
}
},
"Scene_Item": {
"Window_ItemCategory": {
"width": "1000"
},
"Window_Help": {
"x": "0",
"y": "100",
"width": "Graphics.boxWidth",
"height": "win.fittingHeight(2)"
}
}
}
And then everything can be simply read doing something like:
Code:
//$dataWindows contains JSON info
var _SceneManager_onSceneStart = SceneManager.onSceneStart;
SceneManager.onSceneStart = function() {
_SceneManager_onSceneStart.apply(this, arguments);
this._scene.setupWindowProperties();
};
Scene_Base.prototype.setupWindowProperties = function() {
//Check if window layer exists and if there is any saved data for this scene.
if(!this._windowLayer || !$dataWindows[this.constructor.name]) return;
var children = this._windowLayer.children;
var sceneInfo = $dataWindows[this.constructor.name];
children.forEach(function(win) {
//Check and make sure window exists and if there's any data saved for it.
if(win && win.constructor && sceneInfo[win.constructor.name]) {
//Apply data, but only if it exists.
var info = sceneInfo[win.constructor.name];
if(info.x) win.x = eval(info.x);
if(info.y) win.y = eval(info.y);
if(info.width) win.width = eval(info.width);
if(info.height) win.height = eval(info.height);
}
});
}
Therefore, when someone's creating their own custom scene, they could simply do this to set up position/size of windows:
Code:
$dataWindows["Scene_Custom"] = {};
$dataWindows["Scene_Custom"]["Window_Custom1"] = {
x: "200",
y: "400"
}
Don't know if this code helps, but please feel free to use it if it'll help make this feature happen. ¯\_(ツ)_/¯