MZ Number Input Menu Cursor Fix

Hey Folks!

Currently using Visustella MZ's Menu Cursor plugin in order to use an old-school style pointer for my menu.

1778731823383.png


This works really well for almost all of the menus except for the Number Input!

1778731866467.png


According to the patch notes in on the Visustella site, there used to be an option to adjust the offset for the cursor in the number input window, but for some reason they disabled it and now the value is hardcoded? Since they obscure their plugin code I can't seem to modify the plugin to fix this.

Ideally I'd like a plugin that does two things:
1. Offsets the cursor in just the Number Input window only by some arbitrary amount.
2. Changes the height of the Number Input window (the empty space is there because I have touch screen buttons turned off, but the window doesn't resize for some reason?)

Any and all help would be greatly appreciated!
I think the setting they used to have was for just some extra padding. If you want to offset it only in number input try adding this as a plugin (change the offset value and also the sign to minus if you need):

const _myEdit1_SpriteMenuCursor_setParentWindow = Sprite_MenuCursor.prototype.setParentWindow;

Sprite_MenuCursor.prototype.setParentWindow = function(window) {
_myEdit1_SpriteMenuCursor_setParentWindow.call(this, window);
if (window instanceof Window_NumberInput)
this._settings.offsetX += 25;
};

For the window height it depends on your options setting in base code. But here I commented out the lines and you can make it return just a number. So put this in the same plugin:

Window_NumberInput.prototype.windowHeight = function() {
// if (ConfigManager.touchUI) {
// return this.fittingHeight(1) + this.buttonSpacing() + 48;
// } else {
// return this.fittingHeight(1);
// }
return 50;
};
I think the setting they used to have was for just some extra padding. If you want to offset it only in number input try adding this as a plugin (change the offset value and also the sign to minus if you need):

const _myEdit1_SpriteMenuCursor_setParentWindow = Sprite_MenuCursor.prototype.setParentWindow;

Sprite_MenuCursor.prototype.setParentWindow = function(window) {
_myEdit1_SpriteMenuCursor_setParentWindow.call(this, window);
if (window instanceof Window_NumberInput)
this._settings.offsetX += 25;
};

For the window height it depends on your options setting in base code. But here I commented out the lines and you can make it return just a number. So put this in the same plugin:

Window_NumberInput.prototype.windowHeight = function() {
// if (ConfigManager.touchUI) {
// return this.fittingHeight(1) + this.buttonSpacing() + 48;
// } else {
// return this.fittingHeight(1);
// }
return 50;
};

This works almost perfectly. The only issue is that for some reason the offset value used in the top portion of code is applying to every instance of the cursor, and not just the number input window.
Yeah, seems like it's reading it from some common settings object. So delete that from the plugin. Then I guess the only way is to edit the position update method.

Start playtest and go to console by pressing F8. Go to the console tab and write
Sprite_MenuCursor.prototype.updatePosition
and press enter. Then click on the function and it will take you to sources tab. Click pretty print. Then copy paste the method. I will post what it's like for me below in spoilers, but if you have different plugin version you need to fetch your own.
That spot where it says offsetX (at least in my version) I added this line below (change 25 to what you want):
this['x'] += this._parentWindow instanceof Window_NumberInput ? 25 : 0,
see that you have that comma at the end and the previous line should also have that comma. I don't know what they do, it's something about chaining, but I imitated how the rest was written.

So add it to the plugin with the edit. Seemed to work for me, but I only tested it quickly.

Spoiler
Sprite_MenuCursor[_0x169659(0x27e)][_0x169659(0x226) + _0x169659(0x2fc)] = function() {
const _0x2942b7 = _0x169659
, _0x23e7e2 = {
'mDtkC': _0x2942b7(0x25c),
'UvDzA': _0x2942b7(0x20d),
'opjVH': function(_0x112e7a, _0xf69196) {
return _0x112e7a + _0xf69196;
},
'AuGOu': function(_0x5e8406, _0x2fa27c) {
return _0x5e8406 / _0x2fa27c;
},
'PPDuS': _0x2942b7(0x2e2),
'fkonu': function(_0x5c0579, _0x1dfebf) {
return _0x5c0579 + _0x1dfebf;
},
'demxh': _0x2942b7(0x1df),
'ihaup': _0x2942b7(0x249),
'YntAB': function(_0x118cf6, _0x261125) {
return _0x118cf6 / _0x261125;
},
'ZtCGm': _0x2942b7(0x240),
'JEkQy': function(_0x2f95cd, _0x4eb107) {
return _0x2f95cd + _0x4eb107;
},
'BIiXZ': function(_0x4e9efe, _0xa5750e) {
return _0x4e9efe - _0xa5750e;
}
};
if (!this[_0x2942b7(0x227)])
return;
if (!this[_0x2942b7(0x1fc) + _0x2942b7(0x29c)])
return;
const _0x135595 = this['_parentWin' + _0x2942b7(0x29c)][_0x2942b7(0x273) + _0x2942b7(0x2a8)];
if (!_0x135595) {
this[_0x2942b7(0x285)] = -0x475 * -0x1 + 0x1 * 0x846 + -0xcbb;
return;
}
const _0xab8209 = _0x135595[_0x2942b7(0x290)]
, _0x5956fb = _0x135595[_0x2942b7(0x27d)]
, _0x452bb3 = this[_0x2942b7(0x1fc) + _0x2942b7(0x29c)][_0x2942b7(0x224) + 'a']
, _0xd9454e = this['_parentWin' + _0x2942b7(0x29c)]['_padding'];
switch (this[_0x2942b7(0x22e)][_0x2942b7(0x2dd)]) {
case _0x23e7e2[_0x2942b7(0x1dd)]:
this['x'] = _0x135595['x'];
break;
case _0x23e7e2['UvDzA']:
this['x'] = _0x23e7e2[_0x2942b7(0x27b)](_0x135595['x'], Math[_0x2942b7(0x235)](_0x23e7e2[_0x2942b7(0x2d7)](_0xab8209, 0x18cd + 0x2091 + -0x395c)));
break;
case _0x23e7e2['PPDuS']:
this['x'] = _0x23e7e2['fkonu'](_0x135595['x'], _0xab8209);
break;
}
switch (this[_0x2942b7(0x22e)][_0x2942b7(0x25d)]) {
case _0x23e7e2['demxh']:
this['y'] = _0x135595['y'];
break;
case _0x23e7e2[_0x2942b7(0x219)]:
this['y'] = _0x23e7e2[_0x2942b7(0x1c9)](_0x135595['y'], Math[_0x2942b7(0x235)](_0x23e7e2[_0x2942b7(0x2ce)](_0x5956fb, 0x1 * -0x1269 + -0x3 * 0xc7a + 0x11 * 0x349)));
break;
case _0x23e7e2[_0x2942b7(0x214)]:
this['y'] = _0x23e7e2[_0x2942b7(0x2c3)](_0x135595['y'], _0x5956fb);
break;
}
this['x'] += _0x452bb3['x'],
this['y'] += _0x452bb3['y'],
this['x'] += this[_0x2942b7(0x22e)]['offsetX'],
this['x'] += this._parentWindow instanceof Window_NumberInput ? 25 : 0,
this['y'] += this[_0x2942b7(0x22e)]['offsetY'],
this['x'] = this['x'][_0x2942b7(0x207)](_0xd9454e, _0x23e7e2[_0x2942b7(0x1fb)](this['_parentWin' + _0x2942b7(0x29c)]['width'], _0xd9454e)),
this['y'] = this['y'][_0x2942b7(0x207)](_0xd9454e, _0x23e7e2[_0x2942b7(0x1fb)](this[_0x2942b7(0x1fc) + 'dow'][_0x2942b7(0x27d)], _0xd9454e));
}
Yeah, seems like it's reading it from some common settings object. So delete that from the plugin. Then I guess the only way is to edit the position update method.

Start playtest and go to console by pressing F8. Go to the console tab and write
Sprite_MenuCursor.prototype.updatePosition
and press enter. Then click on the function and it will take you to sources tab. Click pretty print. Then copy paste the method. I will post what it's like for me below in spoilers, but if you have different plugin version you need to fetch your own.
That spot where it says offsetX (at least in my version) I added this line below (change 25 to what you want):
this['x'] += this._parentWindow instanceof Window_NumberInput ? 25 : 0,
see that you have that comma at the end and the previous line should also have that comma. I don't know what they do, it's something about chaining, but I imitated how the rest was written.

So add it to the plugin with the edit. Seemed to work for me, but I only tested it quickly.

Spoiler
Sprite_MenuCursor[_0x169659(0x27e)][_0x169659(0x226) + _0x169659(0x2fc)] = function() {
const _0x2942b7 = _0x169659
, _0x23e7e2 = {
'mDtkC': _0x2942b7(0x25c),
'UvDzA': _0x2942b7(0x20d),
'opjVH': function(_0x112e7a, _0xf69196) {
return _0x112e7a + _0xf69196;
},
'AuGOu': function(_0x5e8406, _0x2fa27c) {
return _0x5e8406 / _0x2fa27c;
},
'PPDuS': _0x2942b7(0x2e2),
'fkonu': function(_0x5c0579, _0x1dfebf) {
return _0x5c0579 + _0x1dfebf;
},
'demxh': _0x2942b7(0x1df),
'ihaup': _0x2942b7(0x249),
'YntAB': function(_0x118cf6, _0x261125) {
return _0x118cf6 / _0x261125;
},
'ZtCGm': _0x2942b7(0x240),
'JEkQy': function(_0x2f95cd, _0x4eb107) {
return _0x2f95cd + _0x4eb107;
},
'BIiXZ': function(_0x4e9efe, _0xa5750e) {
return _0x4e9efe - _0xa5750e;
}
};
if (!this[_0x2942b7(0x227)])
return;
if (!this[_0x2942b7(0x1fc) + _0x2942b7(0x29c)])
return;
const _0x135595 = this['_parentWin' + _0x2942b7(0x29c)][_0x2942b7(0x273) + _0x2942b7(0x2a8)];
if (!_0x135595) {
this[_0x2942b7(0x285)] = -0x475 * -0x1 + 0x1 * 0x846 + -0xcbb;
return;
}
const _0xab8209 = _0x135595[_0x2942b7(0x290)]
, _0x5956fb = _0x135595[_0x2942b7(0x27d)]
, _0x452bb3 = this[_0x2942b7(0x1fc) + _0x2942b7(0x29c)][_0x2942b7(0x224) + 'a']
, _0xd9454e = this['_parentWin' + _0x2942b7(0x29c)]['_padding'];
switch (this[_0x2942b7(0x22e)][_0x2942b7(0x2dd)]) {
case _0x23e7e2[_0x2942b7(0x1dd)]:
this['x'] = _0x135595['x'];
break;
case _0x23e7e2['UvDzA']:
this['x'] = _0x23e7e2[_0x2942b7(0x27b)](_0x135595['x'], Math[_0x2942b7(0x235)](_0x23e7e2[_0x2942b7(0x2d7)](_0xab8209, 0x18cd + 0x2091 + -0x395c)));
break;
case _0x23e7e2['PPDuS']:
this['x'] = _0x23e7e2['fkonu'](_0x135595['x'], _0xab8209);
break;
}
switch (this[_0x2942b7(0x22e)][_0x2942b7(0x25d)]) {
case _0x23e7e2['demxh']:
this['y'] = _0x135595['y'];
break;
case _0x23e7e2[_0x2942b7(0x219)]:
this['y'] = _0x23e7e2[_0x2942b7(0x1c9)](_0x135595['y'], Math[_0x2942b7(0x235)](_0x23e7e2[_0x2942b7(0x2ce)](_0x5956fb, 0x1 * -0x1269 + -0x3 * 0xc7a + 0x11 * 0x349)));
break;
case _0x23e7e2[_0x2942b7(0x214)]:
this['y'] = _0x23e7e2[_0x2942b7(0x2c3)](_0x135595['y'], _0x5956fb);
break;
}
this['x'] += _0x452bb3['x'],
this['y'] += _0x452bb3['y'],
this['x'] += this[_0x2942b7(0x22e)]['offsetX'],
this['x'] += this._parentWindow instanceof Window_NumberInput ? 25 : 0,
this['y'] += this[_0x2942b7(0x22e)]['offsetY'],
this['x'] = this['x'][_0x2942b7(0x207)](_0xd9454e, _0x23e7e2[_0x2942b7(0x1fb)](this['_parentWin' + _0x2942b7(0x29c)]['width'], _0xd9454e)),
this['y'] = this['y'][_0x2942b7(0x207)](_0xd9454e, _0x23e7e2[_0x2942b7(0x1fb)](this[_0x2942b7(0x1fc) + 'dow'][_0x2942b7(0x27d)], _0xd9454e));
}

I have no idea how this works, but it does! Perfectly executed, thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/number-input-menu-cursor-fix.183603/