pros-plan-for-elves/Scripts/_.25.rb

114 lines
No EOL
3.6 KiB
Ruby

=begin
▼ アイテム一覧軽量化 ver. 1.1
RPGツクールVXAce用スクリプト
制作 : 木星ペンギン
URL : http://woodpenguin.blog.fc2.com/
------------------------------------------------------------------------------
概要
□ アイテム一覧などの表示をすばやくします。
------------------------------------------------------------------------------
備考
・ 描写するアイテム等が100以上となる場合に導入すると体感できると思います。
=end
#//////////////////////////////////////////////////////////////////////////////
#
# 設定項目なし
#
#//////////////////////////////////////////////////////////////////////////////
module WdTk
module QuickList
#--------------------------------------------------------------------------
# ● スクリプトを文字列で作成
#--------------------------------------------------------------------------
def self.script_s
"
#------------------------------------------------------------------------
# ● 描写フラグの初期化
#------------------------------------------------------------------------
def clear_draw_flags
@draw_flags = []
end
#------------------------------------------------------------------------
# ● 内容の転送元原点の Y 座標
#------------------------------------------------------------------------
def oy=(oy)
if self.oy != oy
super
draw_all_items
end
end
#------------------------------------------------------------------------
# ● 全項目の描画
#------------------------------------------------------------------------
def draw_all_items
top = top_row * col_max
bottom = [top + page_item_max, item_max].min
(top...bottom).each {|i| draw_item(i) }
end
#------------------------------------------------------------------------
# ● 項目の再描画
#------------------------------------------------------------------------
def redraw_item(index)
@draw_flags[index] = false
super
end
#------------------------------------------------------------------------
# ○ 項目の描画
#------------------------------------------------------------------------
alias _wdtk_qlist_draw_item draw_item
def draw_item(index)
return if @draw_flags[index]
@draw_flags[index] = true
_wdtk_qlist_draw_item(index)
end
#------------------------------------------------------------------------
# ○ リフレッシュ
#------------------------------------------------------------------------
alias _wdtk_qlist_refresh refresh
def refresh
clear_draw_flags
_wdtk_qlist_refresh
end
"
end
end
@material ||= []
@material << :QuickList
def self.include?(sym)
@material.include?(sym)
end
end
#==============================================================================
# ■ Window_MenuStatus
#==============================================================================
class Window_MenuStatus
eval(WdTk::QuickList.script_s)
end
#==============================================================================
# ■ Window_ItemList
#==============================================================================
class Window_ItemList
eval(WdTk::QuickList.script_s)
end
#==============================================================================
# ■ Window_SkillList
#==============================================================================
class Window_SkillList
eval(WdTk::QuickList.script_s)
end