### RECOMMENDED!:
# Pastebin version (regularily updated)
pastebin.com/wvbrcAS9
#
# Version 1.0a:
#
# Basic Non-Combat Menu v1.0a
#-- Fully customizable menu geared toward less battle-oriented games.
#-- By mjshi
#
# Installation: Put above Main, preferably also above other custom scripts.
#
# Future updates:
#- Configure if you want a status menu or not
#- Configure if you want the status to be shown in the menu
#- Configure height and width of windows based on percentages
#- Change the order in which commands appear
#
module NonCombatMenu
#
# **CONFIGURATION**
#
# What should the actual menu show? (true to show, false to hide)
#
SHOW_ITEM = true
SHOW_STATUS_TAB = false
SHOW_SAVE = true
SHOW_LOAD = true
SHOW_CANCEL = false
SHOW_EXIT = true
#
#
# Should the gold window be shown in the item menu?
#
SHOW_GOLD_WINDOW = true
#
# Where should it be shown (to the left? set to false. right? set to true)
GOLD_WINDOW_ALIGN_RIGHT = false
#
# How wide should the window be (in pixels)? 160 is the default.
GOLD_WINDOW_WIDTH = 160
#
#
# How many tabs are you showing? (add up the # of true values below)
#
TABS_SHOWN = 1
#
# What should the item menu show?
SHOW_CONSUMABLES = false # i.e. normal items
SHOW_KEY_ITEMS = true
SHOW_WEAPONS = false
SHOW_ARMORS = false
#
# Where should the item description window be?
# 0 = top
# 1 = between the tabs and the item selection
# 2 = at the bottom
DESCR_PLACEMENT = 0
#
#
end
#
#
# !!! Beware of crashes and errors if you edit beyond this point !!! #
#
#
# Overwrites the old, boring menu to use the cooler-looking Game End menu
class Scene_Map
def call_menu
Sound.play_ok
SceneManager.call(Scene_End)
end
end
# Overwrites how the tabs are shown in the Items Menu
class Window_ItemCategory
# Changes width to allow placement of gold window.
# If gold window doesn't exist, revert to default width.
def window_width
NonCombatMenu::SHOW_GOLD_WINDOW ? Graphics.width - NonCombatMenu::GOLD_WINDOW_WIDTH : Graphics.width
end
# Changes columns to fit tabs shown
def col_max
return NonCombatMenu::TABS_SHOWN
end
# Makes a list of commands that will be shown/hidden depending on config
def make_command_list
NonCombatMenu::SHOW_CONSUMABLES ? add_command(Vocab::item, :item) : nil
NonCombatMenu::SHOW_KEY_ITEMS ? add_command(Vocab::key_item, :key_item) : nil
NonCombatMenu::SHOW_WEAPONS ? add_command(Vocab::weapon, :weapon) : nil
NonCombatMenu::SHOW_ARMORS ? add_command(Vocab::armor, :armor) : nil
end
end
#Makes it so the user can change the gold window width
class Window_Gold
def window_width
return NonCombatMenu::GOLD_WINDOW_WIDTH
end
end
# Adds a gold window to the item menu & determines placement
class Scene_Item
def start
super
create_help_window
# Checks if the gold menu should be shown
NonCombatMenu::SHOW_GOLD_WINDOW ? create_gold_window : nil
create_category_window
create_item_window
end
def create_category_window
@category_window = Window_ItemCategory.new
@category_window.viewport = @viewport
@category_window.help_window = @help_window
# Set Tab Menu's X depending on Gold existing or not
NonCombatMenu::GOLD_WINDOW_ALIGN_RIGHT ? nil : @category_window.x = NonCombatMenu::GOLD_WINDOW_WIDTH
# Set description, tab menu, gold Y
if NonCombatMenu::DESCR_PLACEMENT == 1
@help_window.y = @category_window.height
elsif NonCombatMenu::DESCR_PLACEMENT == 2
@help_window.y = Graphics.height - @help_window.height
else
@gold_window.y = @help_window.height
@category_window.y = @help_window.height
end
@category_window.set_handler(:ok, method(:on_category_ok))
@category_window.set_handler(:cancel, method(:return_scene))
end
def create_item_window
# Changes where the item window is displayed
if NonCombatMenu::DESCR_PLACEMENT == 1
wy = @category_window.y + @category_window.height + @help_window.height
elsif NonCombatMenu::DESCR_PLACEMENT == 2
wy = @category_window.height + @help_window.height
else
wy = @category_window.y + @category_window.height
end
wh = Graphics.height - wy
@item_window = Window_ItemList.new(0, wy, Graphics.width, wh)
NonCombatMenu::DESCR_PLACEMENT == 2 ? @item_window.y = @category_window.height : nil
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@category_window.item_window = @item_window
end
def create_gold_window
@gold_window = Window_Gold.new
# Makes the gold window (if aligned right) be under any new windows
@gold_window.viewport = @viewport
NonCombatMenu::GOLD_WINDOW_ALIGN_RIGHT ? @gold_window.x = Graphics.width - NonCombatMenu::GOLD_WINDOW_WIDTH : nil
end
end
# Strips down the status menu to the very basics
class Window_Status
def initialize(actor)
super((Graphics.width - 300)/2, (Graphics.height - 120)/2, 300, 120)
@actor = actor
refresh
activate
end
def refresh
contents.clear
draw_block2(line_height * 0)
end
def draw_basic_info(x, y)
draw_actor_name(@actor, x, y + line_height * 0.5)
draw_actor_hp(@actor, x, y + line_height * 1.5)
draw_actor_mp(@actor, x, y + line_height * 2.5)
end
end
# Dims the Status window's background as well~
class Scene_Status
def create_background
super
@background_sprite.tone.set(0, 0, 0, 128)
end
end
# Overwrites Scene_End to use Save/Load/Items
class Scene_End
def create_command_window
@command_window = Window_GameEnd.new
@command_window.set_handler(:status, method(:command_status))
@command_window.set_handler(:save, method(:command_save))
# Add a load command
@command_window.set_handler(:load, method(:command_load))
@command_window.set_handler(:item, method(:command_item))
@command_window.set_handler(:shutdown, method(:command_shutdown))
@command_window.set_handler(:cancel, method(:return_scene))
end
def command_status
SceneManager.call(Scene_Status)
end
def command_item
SceneManager.call(Scene_Item)
end
def command_save
SceneManager.call(Scene_Save)
end
# Defines the load command
def command_load
SceneManager.call(Scene_Load)
end
end
# Overwrites Window_End to show tabs depending on configured values
class Window_GameEnd
def make_command_list
# Checks each item, then shows or hides based on configuration
NonCombatMenu::SHOW_ITEM ? add_command(Vocab::item, :item) : nil
NonCombatMenu::SHOW_STATUS_TAB ? add_command(Vocab::status, :status) : nil
NonCombatMenu::SHOW_SAVE ? add_command(Vocab::save, :save) : nil
NonCombatMenu::SHOW_LOAD ? add_command("Load", :load) : nil
NonCombatMenu::SHOW_CANCEL ? add_command(Vocab::cancel, :cancel) : nil
NonCombatMenu::SHOW_EXIT ? add_command(Vocab::shutdown, :shutdown) : nil
end
end