Hey all,
So I've been mucking around with Yanfly's gold window. My code is atrocious (and also works thanks to some forum posters!), but the end result mostly functions:
The above example: In the bottom left corner I have this window that keeps the player informed about their resource limits.
I just now added this:
The above example: This added info shows up when the player has unspent attribute points. This basically works! But here's the problem:
The above example: when the player first gets an attribute point, it doesn't resize the window. You have to do something to refresh it like open the menu. I have some code that makes sure it refreshes, but this only seems to affect the data therein:
And here's the function that resizes the window but refuses to run until a window refresh:
I feel like the answer is some kind of full refresh of the UI, but I'm ignorant of what command that might be. Any ideas?
So I've been mucking around with Yanfly's gold window. My code is atrocious (and also works thanks to some forum posters!), but the end result mostly functions:
The above example: In the bottom left corner I have this window that keeps the player informed about their resource limits.
I just now added this:
The above example: This added info shows up when the player has unspent attribute points. This basically works! But here's the problem:
The above example: when the player first gets an attribute point, it doesn't resize the window. You have to do something to refresh it like open the menu. I have some code that makes sure it refreshes, but this only seems to affect the data therein:
JavaScript:
Scene_Map.prototype.updateGoldRefresh = function() {
if (this._goldWindowValue === $gameParty.gold() && this._currentchemValue === $gameParty.numItems($dataItems[6]) || this._numattValue === $gameParty.numItems($dataItems[2])) return;
this._goldWindowValue = $gameParty.gold();
this._messageWindow._goldWindow.refresh();
};
JavaScript:
Window_Gold.prototype.windowHeight = function() {
if ($gameParty.numItems($dataItems[2]) > 0) {
return this.fittingHeight(3);}
else {
return this.fittingHeight(2);}
};
But anyway, it works! Thanks to you both!