#=begin
class Window_CMSCommand < Window_Command
alias initialize_cmsmod_alias initialize
def initialize(index, continue)
initialize_cmsmod_alias(index, continue)
self.disable_item(1)
end
end
class Window_CMSChooseItem < Window_Selectable
def initialize
@background = 'CMSHelp'
super(0, -576, 640, 64)
@commands = ['Items', 'Sort', 'Equipment', 'Quest Items']
@item_max = @column_max = @commands.size
self.contents = Bitmap.new(width - 32, 32)
refresh
self.active, self.z, self.index = true, 2900, 0
end
def draw_item(i, color)
self.contents.font.color = color
self.contents.fill_rect(160*i, 0, 128, 32, Color.new(0, 0, 0, 0))
self.contents.draw_text(160*i, 0, 128, 32, @commands[i], 1)
end
end
class Window_EquipmentItem < Window_CMSItem
alias initialize_cmsmod_alias initialize
def initialize(actor)
initialize_cmsmod_alias(actor)
self.x, self.y = 256, -512
self.active = self.visible = false
end
def draw_item(i)
self.contents.font.color = normal_color
case @data[i]
when RPG::Weapon then number = $game_party.weapon_number(@data[i].id)
when RPG::Armor then number = $game_party.armor_number(@data[i].id)
end
self.contents.fill_rect(4, i*32, 352, 32, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(@data[i].icon_name)
self.contents.blt(4, 4 + i*32, bitmap, Rect.new(0, 0, 24, 24))
self.contents.draw_text(32, i*32, 212, 32, @data[i].name, 0)
self.contents.draw_text(308, i*32, 16, 32, ':', 1)
self.contents.draw_text(324, i*32, 24, 32, number.to_s, 2)
end
end
class Scene_Menu
def del_items
@items_window1.dispose
@items_window1 = nil
@items_window2.dispose
@items_window2 = nil
@item_choose_window.dispose
@item_choose_window = nil
@equip_window.dispose
@equip_window = nil
end
def move_da_items(win = @item_choose_window)
y_plus = [@item_choose_window, @items_window1, @items_window2,
@equip_window, @help_window]
move_windows([[], [], y_plus, []], 0, 64, win, false)
end
def update
@status_windows.each {|win| win.update(@actor_index)}
@target_windows.each {|win| win.update(@target_index)}
@info_window.update
unless @status_windows[0].x < 0 || @status_windows[0].dir != 0 ||
@target_windows[0] != nil && @target_windows[0].dir != 0
@command_window.update
[@help_window, @item_choose_window, @sort_window,
@skill_window, @left_window, @right_window, @playerstatus_window,
@options_window, @end_window].each {|win| win.update if win != nil}
end
move_da_main if @status_windows[0].x < 0
move_da_selection if @status_windows[0].dir != 0
move_da_targeting if @target_windows[0] != nil && @target_windows[0].dir != 0
move_da_status if @playerstatus_window != nil && @playerstatus_window.y > 0
move_da_equip if @left_window != nil && @left_window.x > 0
move_da_skill if @skill_window != nil && @skill_window.x < 256
move_da_target if @target_windows[0] != nil && @target_windows[0].x < 0
move_da_items if @item_choose_window != nil && @item_choose_window.y < 0
move_da_sort if @sort_window != nil && @sort_window.y < 64
move_da_options if @options_window != nil && @options_window.y > 0
move_da_end if @end_window != nil && @end_window.y > 336
if @moved
@moved = false
return
end
if @command_window.active
update_command
elsif @status_windows[0].active
update_status
elsif @item_choose_window != nil
if @item_choose_window.active
items_refresh
update_items_choose
elsif @sort_window != nil && @sort_window.active
update_sort
elsif @items_window1 != nil && @items_window1.active
@items_window1.update
update_item
elsif @equip_window != nil && @equip_window.active
@equip_window.update
update_item_equipment
elsif @items_window2 != nil && @items_window2.active
@items_window2.update
update_item
elsif @target_windows[0] != nil && @target_windows[0].active
update_item_target
end
elsif @skill_window != nil && @skill_window.active
update_skill
elsif @target_windows[0] != nil && @target_windows[0].active
update_skill_target
elsif @right_window != nil
if @right_window.active
update_right_equip
elsif @item_window != nil && @item_window.active
@item_window.update
update_eitem
end
elsif @playerstatus_window != nil && @playerstatus_window.active
update_playerstatus
elsif @options_window != nil && @options_window.active
update_options
elsif @end_window != nil
update_end
end
end
alias update_command_cmsmod_alias update_command
def update_command
if Input.trigger?(Input::C) && @command_window.index == 0
if $game_party.actors.size == 0
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if BlizzCFG::CUSTOM_ITEM_SCENE
@scene = Scene_Item.new
else
@item_choose_window = Window_CMSChooseItem.new
@items_window1 = Window_NormalItem.new
@items_window2 = Window_QuestItem.new
@equip_window = Window_EquipmentItem.new(@actor)
@equip_window.index = -1
@items_window1.help_window = @items_window2.help_window = @help_window
@items_window1.help_window = @items_window2.help_window =
@equip_window.help_window = @help_window
@command_window.active = false
@help_window.x, @help_window.y = 0, -576
@help_window.set_text('')
@help_window.visible = false
items_refresh
end
elsif Input.trigger?(Input::C) && @command_window.index == 1
$game_system.se_play($data_system.buzzer_se)
else
update_command_cmsmod_alias
end
end
alias update_items_choose_cmsmod_alias update_items_choose
def update_items_choose
if Input.trigger?(Input::C) && @item_choose_window.index == 2
items_refresh
@item_choose_window.active = false
$game_system.se_play($data_system.decision_se)
@equip_window.active = @help_window.visible = true
@equip_window.index = 0
elsif Input.trigger?(Input::C) && @item_choose_window.index == 3
items_refresh
@item_choose_window.active = false
$game_system.se_play($data_system.decision_se)
@items_window2.active = @help_window.visible = true
@items_window2.index = 0
else
update_items_choose_cmsmod_alias
end
end
def items_refresh
index = @item_choose_window.index
@items_window1.visible = [0, 1].include?(index)
@equip_window.visible = (index == 2)
@items_window2.visible = (index == 3)
end
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@item_choose_window.active = true
@help_window.set_text('')
@items_window1.active = @items_window2.active = @help_window.visible = false
@items_window1.index = @items_window2.index = -1
elsif Input.trigger?(Input::C)
win = (@item_choose_window.index == 0 ? @items_window1 : @items_window2)
@item = win.data
unless @item.is_a?(RPG::Item) && $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_party.actors.each_index {|i|
@target_windows.push(Window_CMSTarget.new($game_party.actors[i]))}
@target_index = 0
$game_system.se_play($data_system.decision_se)
if @item.scope.between?(3, 6)
win.active = false
@target_windows.each {|win| win.active = true}
if [4, 6].include?(@item.scope)
@target_windows.each {|win| win.index = -2}
else
@target_windows[@target_index].index = 0
end
elsif @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
win.draw_item(win.index)
end
(@status_windows + @target_windows).each {|win| win.refresh}
@scene = Scene_Map.new
elsif @skill.scope == 7
$game_system.se_play($data_system.buzzer_se)
end
end
end
alias update_item_cmsmod_later update_item
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@item_choose_window.active = true
@help_window.set_text('')
@equip_window.active = @items_window1.active = @items_window2.active =
@help_window.visible = false
@equip_window.index = @items_window1.index = @items_window2.index = -1
else
update_item_cmsmod_later
end
end
def update_item_equipment
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@item_choose_window.active = true
@help_window.set_text('')
@equip_window.active = @items_window1.active = @items_window2.active =
@help_window.visible = false
@equip_window.index = @items_window1.index = @items_window2.index = -1
end
end
end