Hello everyone, I'm a beginner of RMMV v1.5.1.
Recently I want to custom a Command Menu, so I inherit the Window_Command class.[^1]
The menu named Window_SlotCommand , it has a dynamic height, which is controlled by a variable named _IModuleSlot . If _IModuleSlot isn't null, the command list's length should be 2, or it should be 1.
So here is the code, or you can see in here, ← DropBox:
As you can see, setIModuleSlot() function is used to control the _IModuleSlot, and every time we show _slotCommandWindow, it will display two kinds of command list alternately.
But strange thing then happened. When I run this code in the new game project, it appeared like this:
photo_left_1 photo_right_1
The left condition is displaying incompletely!
But if I change Window_SlotCommand.prototype.windowHeight return constant value, like 108 or 72, which is the fittingHeight() function had calculated actually and also is logged by console.log() function, displaying is different!
photo_left_2 photo_right_2
This time both condition is displaying completely!
I tried other dynamic height such as 2&3, 3&2(which can exclude the order factor at the window first created), it showed the same phenomenon that the long condition will displaying incompletely if I use calculated value.
SO WHY? It makes no sense that constant value and calculated value results to different display phenomenon! I thought JavaScript maybe do some wrong stuff, but now I think maybe the RGSS Engine doesn't work well with JavaScript, if RGSS Engine is not writen by JavaScript in its foundation.
Any suggestions will be grateful, thanks.
- - -
[^1]: Although Js didn't have a Class concept, I prefer to use Class to describe my question 🙂
Recently I want to custom a Command Menu, so I inherit the Window_Command class.[^1]
The menu named Window_SlotCommand , it has a dynamic height, which is controlled by a variable named _IModuleSlot . If _IModuleSlot isn't null, the command list's length should be 2, or it should be 1.
So here is the code, or you can see in here, ← DropBox:
As you can see, setIModuleSlot() function is used to control the _IModuleSlot, and every time we show _slotCommandWindow, it will display two kinds of command list alternately.
But strange thing then happened. When I run this code in the new game project, it appeared like this:
photo_left_1 photo_right_1
The left condition is displaying incompletely!
But if I change Window_SlotCommand.prototype.windowHeight return constant value, like 108 or 72, which is the fittingHeight() function had calculated actually and also is logged by console.log() function, displaying is different!
photo_left_2 photo_right_2This time both condition is displaying completely!
I tried other dynamic height such as 2&3, 3&2(which can exclude the order factor at the window first created), it showed the same phenomenon that the long condition will displaying incompletely if I use calculated value.
SO WHY? It makes no sense that constant value and calculated value results to different display phenomenon! I thought JavaScript maybe do some wrong stuff, but now I think maybe the RGSS Engine doesn't work well with JavaScript, if RGSS Engine is not writen by JavaScript in its foundation.
Any suggestions will be grateful, thanks.
- - -
[^1]: Although Js didn't have a Class concept, I prefer to use Class to describe my question 🙂