Hi there! I'm not sure if this is difficult or not and I haven't found another alternative yet, but I would like for this script to be converted to work for RMVX ACE.
Shanghai's On Map Item Menu -
Thank you in advance.
Shanghai's On Map Item Menu -
Code:
#=============================================================================
#
# Shanghai Simple Script - On-Map Item Menu
# Last Date Updated: 2010.06.20
# Level: Normal
#
# This script allows the player to access the on-map item menu by pressing the
# A button on the keyboard. The items that show up on the on-map item menu are
# only items that will begin common events.
#=============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials but above ▼ Main. Remember to save.
#=============================================================================
$imported = {} if $imported == nil
$imported["On-MapItemMenu"] = true
#=============================================================================
# ** Window_Map_Item
#=============================================================================
class Window_Map_Item < Window_Item
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0,30, 640, 450)
@column_max = 2
self.openness = 0
self.index = 0
self.active = false
refresh
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Whether or not to include in item list
# item : item
#--------------------------------------------------------------------------
def include?(item)
return false if item == nil
if $game_temp.in_battle
return false unless item.is_a?(RPG::Item)
end
return true
end
#--------------------------------------------------------------------------
# * Whether or not to display in enabled state
# item : item
#--------------------------------------------------------------------------
def enable?(item)
return $game_party.item_can_use?(item)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.index = 0 unless @starting
@starting = true
@data = []
for item in $game_party.items
next unless include?(item)
@data.push(item)
if item.is_a?(RPG::Item) and item.id == $game_party.last_item_id
self.index = @data.size - 1
end
end
@data.push(nil) if include?(nil)
@item_max = @data.size
self.index = [[self.index, @item_max-1].min, 0].max
self.height = [[424, @item_max*12+44].min, 56].max # 104
self.y = 56 # changed from: self.y = Graphics.height-self.height
create_contents
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
if item != nil
number = $game_party.item_number(item)
enabled = enable?(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, enabled)
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
#--------------------------------------------------------------------------
# * Update Help Text
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(item == nil ? "" : item.description)
end
end
#=============================================================================
# ** Scene_Map
#=============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
alias start_sss_on_map_item_menu start unless $@
def start
start_sss_on_map_item_menu
@on_map_help_window = Window_Help.new
@on_map_item_window = Window_Map_Item.new
@on_map_item_window.help_window = @on_map_help_window
@on_map_help_window.opacity = 255 # changed from 0
@on_map_help_window.openness = 0
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
alias terminate_sss_on_map_item_menu terminate unless $@
def terminate
unless @on_map_item_window.nil?
@on_map_item_window.dispose
@on_map_item_window = nil
@on_map_help_window.dispose
@on_map_help_window = nil
end
terminate_sss_on_map_item_menu
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias update_on_map_item_menu update unless $@
def update
update_on_map_item_menu
if not $game_message.visible and not $game_map.interpreter.running?
map_item_window if Input.trigger?(Input::X)
end
end
#--------------------------------------------------------------------------
# * Update Map Item Window
#--------------------------------------------------------------------------
def map_item_window
disabled = true
for item in $game_party.items
disabled = false # put above 'next' to show 1 item window
next unless item.is_a?(RPG::Item)
break
end
if disabled
# ADDED begin
Sound.play_buzzer
@on_map_help_window.open
@on_map_help_window.contents.draw_text(0, 0, 505, 23, 'NO ITEMS', 1)
# text to show in help window when 0 items
loop do # loop nedded so that help window opens gradually
update_basic
@on_map_help_window.update
if Input.trigger?(Input:: or Input.trigger?(Input::X)
Sound.play_cancel
break
end
end
@on_map_help_window.close
loop do # loop nedded so that help window closes gradually
break if @on_map_help_window.openness < 1
update_basic
@on_map_help_window.update
end
# ADDED end
return
end
if $imported["LocationName"]
hidden_location_name = $game_system.hide_location_name
$game_system.hide_location_name = true
end
Sound.play_decision
@on_map_item_window.refresh
@on_map_item_window.open
@on_map_help_window.open
@on_map_item_window.active = true
loop do
update_basic
@on_map_help_window.update
@on_map_item_window.update
if Input.trigger?(Input::C)
Sound.play_decision
item = @on_map_item_window.item
$game_party.consume_item(item)
break
elsif Input.trigger?(Input::
Sound.play_cancel
break
end
end
@on_map_item_window.close
@on_map_help_window.close
loop do
# condition changed to both to solve timing problem on closing windows
break if (@on_map_help_window.openness < 1) && (@on_map_item_window.openness < 1)
# condition changed to both to solve timing problem on closing windows
update_basic
@on_map_help_window.update
@on_map_item_window.update
end
if $imported["LocationName"]
$game_system.hide_location_name = hidden_location_name
end
end
end
#=============================================================================
#
# END OF FILE
#
#=============================================================================

