Two short lines of text is asinine. I need a larger window to display skill descriptions in both the menu and during a battle.
Any help would be greatly appreciated!
Any help would be greatly appreciated!
Window_Help.prototype.initialize = function(numLines) {
if (SceneManager.isSceneBattle()){
/* This will create a window description the same as in Warcraft 3 */
/* while you are in battle Assuming that game resolution is set to 1280x720 */
var leftPos = 760;
var UpperPos = 188;
var WinXSize = 520;
var WinYSize = 220;
Window_Base.prototype.initialize.call(this, LeftPos, UpperPos, WinXSize, WinYSize);
this._text = '';
}
else
{
/* default window */
var leftPos = 0;
var UpperPos = 0;
var WinXSize = Graphics.boxWidth;
var WinYSize = this.fittingHeight(numLines || 2);
Window_Base.prototype.initialize.call(this, 0, 0, width, height);
this._text = '';
}
};
Wrong, it is a big difference as it is a different language from that of Ace which uses Ruby. Therefore it will not work.
class Scene_Item < Scene_ItemBase
alias description_extension_start start
def start
description_extension_start
create_description_window
end
def create_description_window
@description_window = Window_Item_Description.new
@description_window.z = 300
@description_window.back_opacity = 255
@description_window.hide
end
def unexpand
@description_window.hide
@item_window.activate
end
alias description_extension_create_item_window create_item_window
def create_item_window
description_extension_create_item_window
@item_window.set_handler(:expand, method(:on_item_expand))
end
def on_item_cancel
if @description_window.visible
@description_window.hide
@item_window.activate
else
@item_window.unselect
@category_window.activate
end
end
def on_item_expand
if @description_window.visible
@description_window.hide
@item_window.activate
else
@description_window.show
@description_window.get_description(@item_window.item)
end
end
end
class Window_Item_Description < Window_Base
def initialize
super(0,0,Graphics.width,200) # <==== change window position and size
end
def get_description(item)
contents.clear
return unless item
text = item.note.scan(/<\s*description\s*:\s*([^>]+)>/)
if text[0]
draw_text_ex( 0 , 0 , text[0][0])
else
draw_text_ex( 0 , 0 ,item.description)
end
end
end
class Window_ItemList < Window_Selectable
def process_handling
return unless open? && active
return process_ok if ok_enabled? && Input.trigger?(:C)
return process_cancel if cancel_enabled? && Input.trigger?(:B)
return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)
return process_pageup if handle?(:pageup) && Input.trigger?(:L)
return process_description if Input.trigger?(:Z) #<===== change which button to press to show window
end
def process_description
call_handler(:expand)
end
end
It is quite easy to achieve actually. I would do it myself, but I am very busy lately and I am afraid that a long time will pass before I have time to do it.
Original thread: https://forums.rpgmakerweb.com/threads/longer-skill-description-in-menu-and-in-battle.114011/