This is copy-pasted from my post in the plugin's release thread. I figured this would be a more appropriate place to post this. Apologies if it isn't. (maybe plugin requests is more fitting?) Anyways...
So I just installed your plugin and I'm loving it! I only have 1 tiny gripe with it though. It concerns the selection cursor thingy, and how it's 1 pixel too narrow. I tinkered w/ the js file and realized it isn't defined by the plugin, but rather rpg_windows.js. Here's what I'm talking about:
Notice how the semi-transparent selection cursor is thinner on the right side. This is because the width is 1 pixel short vs the height (35px vs 36px). Here's the portion of code in rpg_windows.js that controls the sizing of the selection cursor:
If I change "rect.width = this.itemWidth();" -> "rect.width = this.itemWidth() + 1;" this resolves the issue and I get a perfect square of 36x36 pixels. However, this solution makes pretty much every other part of the game that uses the selection cursor look wonky.
So I thought of 2 possible solutions, but need assistance implementing it since my JS skills are limited.
For method #1, I'm thinking we could possibly use something like "Window_ItemList" for the conditional, but that's just a hunch.
I would greatly appreciate it if someone could help implement this fix, using any method you see fit. Thanks!
Edit: This is what I've come up with so far. Of course, it doesn't work, but I'm hoping someone can fix the syntax or find the proper conditional statement for me.
So I just installed your plugin and I'm loving it! I only have 1 tiny gripe with it though. It concerns the selection cursor thingy, and how it's 1 pixel too narrow. I tinkered w/ the js file and realized it isn't defined by the plugin, but rather rpg_windows.js. Here's what I'm talking about:
Notice how the semi-transparent selection cursor is thinner on the right side. This is because the width is 1 pixel short vs the height (35px vs 36px). Here's the portion of code in rpg_windows.js that controls the sizing of the selection cursor:
JavaScript:
Window_Selectable.prototype.itemRect = function(index) {
var rect = new Rectangle();
var maxCols = this.maxCols();
rect.width = this.itemWidth();
rect.height = this.itemHeight();
rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX;
rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY;
return rect;
};
So I thought of 2 possible solutions, but need assistance implementing it since my JS skills are limited.
- Introduce a conditional in rpg_windows.js so that if the selection cursor is being used for the items in the inventory (and not anywhere else, not even the category choices right above it like "Items, Weapon, Armor, etc"), then use "rect.width = this.itemWidth() + 1;", otherwise use "rect.width = this.itemWidth();".
- Add some code in the plugin's js file itself to use a customized selection cursor size. I've seen this done in SomeFire's SkillTreeSystem.js, which I will include the snippet of code for below.
JavaScript:
Skills_Window.prototype.updateCursor = function() {
if (this.isCursorVisible()) {
var rect = this.itemRect(this.index());
if (SkillTreesSystem.skillCursorMargin) {
this.setCursorRect(rect.x + this.spacing() / 2, rect.y + this.spacing() / 2,
rect.width + this.spacing(), rect.height + this.spacing());
} else
this.setCursorRect(rect.x + this.spacing(), rect.y + this.spacing(), rect.width, rect.height);
} else
this.setCursorRect(0, 0, 0, 0);
For method #1, I'm thinking we could possibly use something like "Window_ItemList" for the conditional, but that's just a hunch.
I would greatly appreciate it if someone could help implement this fix, using any method you see fit. Thanks!
Edit: This is what I've come up with so far. Of course, it doesn't work, but I'm hoping someone can fix the syntax or find the proper conditional statement for me.
JavaScript:
Window_Selectable.prototype.itemRect = function(index) {
var rect = new Rectangle();
var maxCols = this.maxCols();
if (this._Window_ItemList) {
rect.width = this.itemWidth() + 1;
rect.height = this.itemHeight();
rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX;
rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY;
return rect;
} else {
rect.width = this.itemWidth();
rect.height = this.itemHeight();
rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX;
rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY;
return rect;
}
};