Custom List & Pages Version 1.3
Autor: Aindra
si se usa en algun projecto debes de dar credito
Introducion
este scipt incluye una liste en el menu(o la puede llamr en el mapa si no quieres que aparesca en el menu.) en la lsita se encontara informacion que tu elijas de los personajes de juego. es tu decicicion poner que informacion va ha ir en esta lista
caracteristicas
- Customize the main list and branch list easily
- Set up the lists easily, you can have many selections in one list as you want.
- Main List that can branch off to a secondary list
- Select one on the list will open up a page with detailed information
- You can use the existing templates when setting up your pages.
- The list selections can be operated by a switch. (EX: A player can't see a certain NPC in the NPC list until he meets this person, and the information is unlocked.) NOTE: You can also lock the list selections for whatever reasons. So it works both way.
- v1.1 - Disable the menu access if you don't want it in the menu
- v1.1 - Call the Custom List while on the map
- v1.1 - Call the Custom Page while on the map
- v1.3 - Call the Custom Branch List while on the map
- v1.3 - Limit the Main List Selections (so you can hide other branch lists for event-viewing)
Screenshots
Shop Template
Statistics Template
Book Template
Location Template
NPC Profile Template
v1.3 Demo
Custom List v1.2 Demo
Custom List v1.1 Demo
Custom List v1.0 Demo
Scripts
You have to take all three scripts.
Custom Page & Block
[codebox]
=begin
______________________________________________________________________________
| Custom List & Pages Script ]----[ Author: Aindra ]----[ v1.3 ]----[ 07/17/09 |
|______________________________________________________________________________|
==============================================================================
Custom Page & Customizable Block
==============================================================================
In this script, you can change many settings, add the list objects, and add
different pages. Use the templates if you want to set up your pages quicker.
You'll have to read/customize this whole script (well except parts I clearly
marked to say not touch them) from start to end.
QUICK REFERENCES:
- Call Custom Main List
$scene = Custom_List.new(0, 0, false)
- Call Custom Branch List
$scene = Custom_List.new(list*, index, false, true)
* Can't be 0, that's main list.
- Call Custom Page
$scene = Custom_List.new(list, index, true)
==============================================================================
=end
module AI_L
#===============================================================================
# Customize Lists
#===============================================================================
# All numbers that ends with "1" is the main list.
# All numbers that ends with "2" is the branch list.
#-------------------------------------------------------------------------------
# If you don't want Custom List to appear on the menu, use DISABLE_MENU = true
# Note: If you disable it, you can still call it from the map.
DISABLE_MENU = false
# Change Custom List's menu title
MENU_NAME = "Custom List"
# When you exit Custom List, if it doesn't return to a correct selection in
# menu, you can adjust this number to fix the issue.
MENU_EXIT_INDEX = 4
# Set the font name. Default is Verdana / Arial / Courier New
LIST_FONT_NAME_1 = ["Verdana", "Arial", "Courier New"]
LIST_FONT_NAME_2 = ["Verdana", "Arial", "Courier New"]
# Set the font size. Default is 20.
LIST_FONT_SIZE_1 = 20
LIST_FONT_SIZE_2 = 20
#---
# Do not worry if you make bad mistake with X/Y/W/ROW_H. This script will
# automatically resize them so they won't be cut off by screen's edges.
#---
# If you increase X, the list will move right. It'll go left if you decrease.
X1 = 0
X2 = 0
# If you increase Y, the list will move down. It'll go up if you decrease.
Y1 = 0
Y2 = 56
# W is the list's width. Higher it is, the list will be wider. You can fit
# more text or columns if you do.
W1 = 544 # Max is 544
W2 = 544
# ROW_H is the list's row height. If you want it to have 6 rows, put in 6.
# It can go up to 16 rows. Nothing more.
ROW_H1 = 1 # Max is 16
ROW_H2 = 16
# COLUMNS is the list's columns. You can add or remove columns here.
COLUMNS_1 = 5
COLUMNS_2 = 2
# If COLUMN_SPACE is set to 10, the columns will be 10 pixels apart.
COLUMN_SPACE = 10
# If ROW_RESIZE is set to true, it will resize the window to fit the rows,
# so you won't be looking at empty space of rows. (It won't be resized
# larger than ROW_H value you set. It only works for branch list. Reason is
# the main list is well static so it doesn't really need it.)
ROW_RESIZE = true
# If ROW_CENTER is set to true, it will be centered on Y position.
ROW_CENTER_1 = false
ROW_CENTER_2 = false
# When the selection is locked, it will let the player know. Default is ???
LOCKED_TEXT = "???"
# If you want some branch lists that will never show up in the main list,
# but you can still access it in the events. Specify the max number here.
# When the main list hits the max limit, it will not include any branch
# lists higher than the limit.
MAX_MAIN_SELECTIONS = 5
#===============================================================================
# [ MAIN LIST ] - When the player select a "List" in the menu, he will see this
# list first.
#-------------------------------------------------------------------------------
Custom_List = [[ # <- Do not touch this!
#- - - - - - - - - - -
# You can type in anything you want in the main list. You can add more
# than 5 objects per a list if you want. It can be 20 or whatever.
"NPC Profiles", # Index = 0
"No Branch", # Index = 1
"Locations", # Index = 2
"Recipe Book", # Index = 3
"Journal", # Index = 4 ... etc
"Secrets"
#- - - - - - - - - - -
], # <- Do not touch this!
#===============================================================================
# [ BRANCH LIST ] - When the player select one from the list, it will create
# the second list.
#-------------------------------------------------------------------------------
# If you do not want one, few or all on the list to have branch list, just set
# it to false, and move on. Remember, the list here have to be ordered exactly
# same as above list. If above list starts with "NPC Data", then you will
# have to put the NPC branch list at top first, and work your way down.
#
# Again, you can add or remove the objects from the branch list. It can have
# 30 or whatever. It's really up to you.
#-------------------------------------------------------------------------------
# INDEX: 0 [ NPC Data ]
["Ralph", "Innkeeper", "Empty Slot 1",
"Empty Slot 2", "Empty Slot 3"],
#- - - - - - - - - - - -
# INDEX: 1 [ No Branch ]
false,
#- - - - - - - - - - - -
# INDEX: 2 [ Locations ]
["Big Forest", "Empty Slot 1"],
#- - - - - - - - - - - -
# INDEX: 3 [ Recipe Book ]
["Guide to Cooking", "Sub-Template Example", "Empty Slot 2"],
#- - - - - - - - - - - -
# INDEX: 4 [ Journal ]
["Journal Entry 1", "Journal Entry 2", "Template: Gauges List",
"Template: Shop Data", "Empty Slot 5", "Empty Slot 6",
"Empty Slot 7", "Empty Slot 8"],
#- - - - - - - - - - - -
# INDEX: 5 [ Secrets ]
["Hidden Branch List", "Calls"]
#- - - - - - - - - - - -
] # <- Do not touch
#==============================================================================
# Enable Switches
#------------------------------------------------------------------------------
# If you wish some objects remains locked until the player "encounters" it, you
# can use the switches. It may be little hard to set up, considering the
# possible confusion but try your best! NOTE: You can also turn the switches
# off if you want the player to lose his access to some information in gameplay.
#
# The switch list here is ordered exactly same as the main and branch lists
# are ordered. So you just have to follow the list/index number so it matches
# with the main/branch lists.
#
# Put in "nil" if you don't want it to be locked.
# Put in switch ID if you want it to be locked.
#------------------------------------------------------------------------------
Enable_Switches = [ # <- Do not touch
#- - - - - - - - - - - -
[nil,nil,nil,nil,1], # MAIN LIST
[nil,nil,nil,nil,nil], # This list and next lists are BRANCH LISTS
nil,
[nil,nil,nil,nil],
[nil,nil,nil,nil,nil,nil],
[nil,2,3,3,3,3,3,3],
[nil, nil]
#- - - - - - - - - - - -
]# <- Do not touch
end
#==============================================================================
# Custom Individual Pages
#------------------------------------------------------------------------------
# Do not touch this section unless you know what are you doing
class Custom_Page < Window_Base
def initialize
super(0, 0, 544, 416)
self.back_opacity = 255
end
#==============================================================================
# Connect to the Custom Page
#------------------------------------------------------------------------------
# Do not touch this part
def goto(list, index, branch)
contents.clear
list = index + 1 unless branch
case list
#------------------------------
# If you wish to add more lists here, you can add "when 6" and add whatever
# you named your method page below. Omit (index) if it doesn't have the
# branch list because it is not really needed.
when 1
npc_data(index)
when 2
no_branch
when 3
locations(index)
when 4
recipe_book(index)
when 5
journal(index)
when 6
secrets(index)
#------------------------------
end # <- do not touch
end # <- do not touch
#==============================================================================
# Individual Custom Pages
#-----------------------------------------------------------------------------
# You can create "pages" in this section. If the player selects anything on
# the list, it will bring this page up so s/he can see the detailed information
#
# WARNING: When creating or renaming your page, it is very important
# that name is EXACTLY same as above list.
#
# For an example, if there is "def npc_data(index)" here, then you should
# use same name for "npc_data(index)" under "when n"
#
# For ones that have the branch list, you can use the "index" case to find
# which page in that branch list. It's easier to think of it as the book chapters
# The player chooses, say, the NPC data book, and wish to see Ralph, he skips
# to the 2 chapter with Ralph. Which is index 1 (index starts with 0, not 1)
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# NPC_Data
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def npc_data(index)
case index
#--------------------------------------------------------------------
when 0
# Basic Explaination
# This is conditional branch, it works just like the event conditional
# branch. It'll check if the designated variable's value is same as
# number you set.
if $game_variables[5] == 0
bg_story = ["Ralph is your standard RPG party leader.",
"He is often used in the script demos, and",
"in the basic demo projects."]
elsif $game_variables[5] == 1
bg_story = ["Ralph is an excellent swordsman.",
"He is often known for his amazing ability",
"to take out the strong monsters.",
"But, hey, he's very cliched hero."]
elsif $game_variables[5] == 2
bg_story = ["He is disliked by RPGVX community,",
"because he is anywhere. People tend to get",
"bored of him."]
end
stats = [["STR", "Money", "Won Against:", "Lost Against:", "Example"],
[32, $game_variables[1], $game_variables[2], $game_variables[3], 34]]
misc = ["Likes Spaghetti", "Terrified of Spiders", "Battle Champion"]
aindra_npc_data("Actor1", 0, "Ralph", "Male", "Early Twenties", "Swordsman",
"Ralph's Room in the Guard Tower", bg_story, stats, misc)
#--------------------------------------------------------------------
when 1
bg_story = ["I am just a lowly innkeeper.",
"My inn is Lovely Sunrise, but unfortunately",
"it's destroyed... So I have another inn."]
stats = [["Cooking Skill:", "Money:", "Luck:", "Level:"],
[3, $game_variables[1], $game_variables[2], $game_variables[3]]]
misc = [""]
aindra_npc_data("Actor3", 3, "Kendra", "Female", 21, "Innkeeper",
"Bye Sunrise", bg_story, stats, misc)
self.contents.draw_text(272, 148, 200, WLH, "Friendship")
gauge_rect_bar(272, 179, 200, 7, 50, 100)
self.contents.draw_text(272, 189, 200, WLH, "Evil <---> Good")
gauge_rect_bar(272, 219, 200, 7, 765, 1000)
#--------------------------------------------------------------------
when 2
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
when 3
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
when 4
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
end
end
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# No Branch (it does not have index)
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def no_branch
contents = ["I'm sure you noticed it by now. This page does not have",
"the branch list. It just skips it and get right to this page."]
aindra_book("No Branch", contents)
end
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Locations
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def locations(index)
case index
#--------------------------------------------------------------------
when 0
description = ["The adventurers can be easily be lost in",
'this forest. It has another nickname - "Maze Forest."',
"Beware, the adventurers, it is home to several dangerous",
"carrot-creatures. Enter at your risk."]
enemies = ["Carrots-Creatures", "Vemonous snakes", "Tree's Roots",
"Dr Octo"]
notes = ["Magic Tree", "Aindra", "Unaffected by Evil"]
stat1 = [["Items Found:", "Discovered Secrets:", "T1", "T2"],
[$game_variables[1], $game_variables[2], 1, 2]]
stat2 = [["Example1:", "Example2:", "Example3:", "Example4:"],[1, 2, 3, 4]]
aindra_location_data("PIC_BigForest", description, enemies, notes,
stat1, stat2)
#--------------------------------------------------------------------
when 1
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
end
end
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Recipe Book
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def recipe_book(index)
case index
#--------------------------------------------------------------------
when 0
contents = [
"Welcome to the cook guidebook. I will explain",
"how do you cook. First, you take the pot and",
"put in bunch of carrots. No wait, that's awful.",
"Ok, take said carrots and eat them raw! Or perhaps",
"you want to chop them up? Or grate them?",
"If you do, you can put them in your salad!",
"Isn't that awesome. Perhaps you can make a smoothie",
"using the carrots only! Wait, I think I was supposed",
"teach you how to cook... Oh well."]
aindra_book("Guide to Cooking", contents)
#--------------------------------------------------------------------
when 1
array = [
"Instead of using the templates, you can also use",
"the sub-templates, like this page.",
"",
"You can also use both if you want.",
"You'll understand when you look in the script",
"editor and see this part."]
draw_bg_comment(10, 40, array, 20, true)
#--------------------------------------------------------------------
when 2
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
end
end
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Journal
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def journal(index)
case index
#--------------------------------------------------------------------
when 0
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
when 1
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
when 2
left_titles = ["Cooking Skill", "Evil <---> Good",
"Friendship with Taylor", "Quest Completion",
"Plot Completion", "Special Items Collected"]
right_titles = ["Total Created Weapons", "Number of eaten carrots",
"Given hugs", "Total Winnings", "Total Losings",
"Special Points"]
left_gauges = [[ 30, 50, 252, 90, 100, 1, 32], # Current
[100, 100, 300, 100, 100, 100, 300]] # Max
right_gauges = [[ 55, 1021, 212, 190, 100, 0, 32], # Current
[100, 2002, 340, 300, 200, 4, 200]] # Max
aindra_gauge_bars("Statistics", left_titles, right_titles,
left_gauges, right_gauges)
#--------------------------------------------------------------------
when 3
description = ["You can also create your weapons at here, at a small",
"fee. This store's weapons aren't of a great quality",
"but it's good enough. If you make a friend with the",
"owner, you may get a discount."]
inventory = ["Daggers, Spears, Lances,",
"Swords, Knuckles, Hammers",
"Axes, and few unique weapons."]
open_during = ["Monday-Friday", "Sunrise to Sunset"]
aindra_shop_data("Actor3", 2, "Taylor", "Sharp Weapons Store",
"11th Road, Hidret Town", description, inventory, open_during)
#--------------------------------------------------------------------
when 4
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
when 5
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
when 6
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
when 7
aindra_book("Nothing here.", ["blank text"])
#--------------------------------------------------------------------
end
end
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Secrets
#-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def secrets(index)
case index
when 0
title = "Max Main List Selections"
contents = ["You can set the max selections allowed for the",
"main list. The purpose is to hide other branch",
"lists from the player when he looks around in the",
"main list.",
"",
"You can then use call branch list to bring the",
"hidden branch list up for the player in the event."]
when 1
title = "Calls"
contents = ["You can call a specific page, specific branch list,",
"or whole main list while in the map. You can do it",
"in the event. It's useful if you want to bring",
"a certain page or something to the player's attention."]
end
aindra_book(title, contents)
end
#===============================================================================
end # <- Do not touch!
[/codebox]
Page Templates
[codebox]
=begin
______________________________________________________________________________
| Custom List & Pages Script ]----[ Author: Aindra ]----[ v1.3 ]----[ 07/17/09 |
|______________________________________________________________________________|
===============================================================================
Page Templates
-------------------------------------------------------------------------------
Templates' purpose is to be used in the Custom Page, and help you to set up
your pages quicker. You can do a quick template call and change the values
from the custom page & block script.
The templates are useful in the sense it can be used for more than one page.
You can modify the existing template(s), or add your own template(s) here.
You can remove the existing template(s) if you do not need them.
QUICK REFERENCES
x - 0..512 (min/max) spacing - adjust the space between each line
y - 0..384 (min/max) color = adjust the color to change, well, color
===============================================================================
=end
class Custom_Page < Window_Base
#==============================================================================
# Templates and Sub-Templates - Table of Contents
#------------------------------------------------------------------------------
# 01) - Aindra's "NPC Data"
# 02) - Aindra's "Location Data"
# 03) - Aindra's "Book" (won't scroll)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# aa) - Aindra's "Draw Face with Frame" (Borders + Background)
# ab) - Aindra's "Draw Comment with Dark Background" (simple rect or grident)
# ac) - Aindra's "Draw Picture"
#==============================================================================
#==============================================================================
# Aindra's NPC Data Template
#------------------------------------------------------------------------------
# face : NPC's face's filename e. "Actor1"
# index : NPC's face's index, ranging from 0 to 7. e. 0
# name : NPC's name e. "Ralph"
# gender : NPC's gender e. "Male"
# class : NPC's class e. "Swordsman"
# location : NPC's home/location e. "10th Street"
# bg_story : NPC's history e. [array]
# stats : NPC's stats and values e. [[array],[array]]
# misc : NPC's misc info e. [array]
#------------------------------------------------------------------------------
def aindra_npc_data(face, index, name, gender, age, career, address,
bg_story, stats, misc)
#----------------
spacing = 21
list2 = ["Name:", "Gender:", "Age:", "Career:", "Address:"]
#----------------
draw_face_frame(face, index, 10, 10) # face, index, x, y
draw_bg_comment(10, 280, bg_story, spacing)
draw_list( 10, 142, spacing, 200, stats[0])
draw_list( 10, 142, spacing, 200, stats[1], 2)
draw_list(262, 142, spacing, 466, misc)
draw_list(210, 7, spacing, 466, [name, gender, age, career, address])
self.contents.font.color = system_color
draw_list(120, 7, spacing, 466, list2)
self.contents.draw_text( 10, 258, 466, WLH, "Background")
self.contents.draw_text( 30, 118, 170, WLH, "Stats")
self.contents.draw_text(282, 118, 170, WLH, "List")
self.contents.font.color = normal_color
end
#===============================================================================
# Aindra's Location Data
#------------------------------------------------------------------------------
# picture_file : Graphics/Pictures/picture_name e. "PIC_BigForest"
# description : Location's description e. [array]
# enemies : Enemy Encounters List e. [array]
# people : Notable People List e. [array]
# stat1/stat2 : Variables List e. [[array],[array]]
#------------------------------------------------------------------------------
def aindra_location_data(picture_file, description, enemies, notes, stat1, stat2)
#----------------
spacing = 20
black_color = Color.new(0, 0, 0, 80)
#----------------
self.contents.fill_rect(10, 170, 490, 3, black_color)
self.contents.fill_rect(10, 290, 490, 3, black_color)
draw_picture(256, 33, picture_file, 1)
draw_list( 15, 80, spacing, 458, description)
draw_list( 20, 196, spacing, 466, enemies)
draw_list(262, 196, spacing, 466, notes)
draw_list( 0, 300, spacing, 230, stat1[0])
draw_list( 0, 300, spacing, 230, stat1[1], 2)
draw_list(272, 300, spacing, 230, stat2[0])
draw_list(272, 300, spacing, 230, stat2[1], 2)
self.contents.font.color = system_color
self.contents.draw_text( 15, 176, 466, WLH, "Enemy Encounters")
self.contents.draw_text(257, 176, 466, WLH, "Quick Notes")
self.contents.font.color = normal_color
end
#===============================================================================
# Aindra's Book
#------------------------------------------------------------------------------
# title : Book's Big Title e. "Title"
# contents : Book's Contents e. [array]
#------------------------------------------------------------------------------
def aindra_book(title, contents)
#----------------
spacing = 20
#----------------
draw_list(10, 40, spacing, 478, contents)
self.contents.font.size = 30
self.contents.font.bold = true
self.contents.font.color = system_color
self.contents.draw_text(10, 10, width - 30, WLH + 10, title)
self.contents.font.size, self.contents.font.bold, self.contents.font.color =
Font.default_size, Font.default_bold, normal_color
end
#===============================================================================
# Aindra's Shop Data
#------------------------------------------------------------------------------
# face : Shopkeeper's face's filename, like "Actor1"
# index : Shopkeeper's face's index, ranging from 0 to 7.
# name : Shopkeeper's name
# store_title : Shop's Title
# location : Shop's Location
# description : Shop's information - ![ARRAY]!
# inventory : Shop's inventory --- ![ARRAY]!
#------------------------------------------------------------------------------
def aindra_shop_data(face, index, name, store_title, location, description,
inventory, open_during)
spacing = 20
draw_face_frame(face, index, 10, 10)
draw_bg_comment(10, 280, description, spacing)
draw_list(15, 120 + spacing, spacing, 290, inventory)
draw_list(320, 120 + spacing, spacing, 190, open_during)
self.contents.draw_text(200, 40 + WLH * 0, 300, WLH, name)
self.contents.draw_text(200, 40 + WLH * 1, 300, WLH, location)
self.contents.font.color = system_color
self.contents.draw_text(15, 120, 300, WLH, "Inventory")
self.contents.draw_text(320, 120, 190, WLH, "Open During:")
self.contents.draw_text(10, 258, width, WLH, "Shop Description")
self.contents.draw_text(120, 40 + WLH * 0, width, WLH, "Owner:")
self.contents.draw_text(120, 40 + WLH * 1, width, WLH, "Address:")
self.contents.font.size = 25
self.contents.draw_text(120, 10, 300, WLH, store_title, 1)
self.contents.font.size = Font.default_size
self.contents.font.color = normal_color
end
#===============================================================================
# Gauge List
#------------------------------------------------------------------------------
# titles : Titles for every gauges [array]
# gauges : Gauges, like HP bars [[array],[array]]
# current, max
#------------------------------------------------------------------------------
def aindra_gauge_bars(main_title, left_titles, right_titles,
left_gauges, right_gauges)
spacing = 58
self.contents.font.size = 30
self.contents.font.color = system_color
self.contents.draw_text(10, 5, 492, WLH, main_title, 1)
self.contents.font.size = Font.default_size
self.contents.font.color = normal_color
draw_list(10, 35, spacing, 250, left_titles)
draw_list(270, 35, spacing, 250, right_titles)
for i in 0..left_titles.length
gauge_rect_bar(10, 65 + spacing * i , 230, 7, left_gauges[0]
, left_gauges[1])
end
for i in 0..right_titles.length
gauge_rect_bar(270, 65 + spacing * i , 230, 7, right_gauges[0], right_gauges[1])
end
end
#==============================================================================
# Sub-Templates
# Next method definitions can be used in above templates or your custom pages.
#==============================================================================
# Draw List (I use for ... in lists so often so I thought it'd be neater (and
# easier for you guys) if I just create this sub-templete.
#-------------------------------------------------------------------------------
# spacing = line spacing e. 20
# width = text line's width (text'll be narrow if it hits width) e. 400
# array = Will use array to create the list. [array]
# align = 0: Left-Alignment, 1: Center-Alignment, 2: Right-Alignment
#-------------------------------------------------------------------------------
def draw_list(x, y, spacing, width, array, align = 0)
for i in 0..array.length
self.contents.draw_text(x, y + spacing * i, width, WLH, array, align)
end
end
#==============================================================================
# Draw Face with Dark Background and the White Border
#------------------------------------------------------------------------------
# face = Face Graphic Filename e. "Actor1"
# index = Face index position e. 5
#------------------------------------------------------------------------------
def draw_face_frame(face, index, x, y)
#----------------
border_color = Color.new(255, 255, 255, 255)
background_color = Color.new(0, 0, 0, 200)
#----------------
self.contents.fill_rect(x, y, 102, 102, background_color)
self.contents.fill_rect(x+1, y+1, 100, 100, border_color)
self.contents.fill_rect(x+2, y+2, 98, 98, background_color)
draw_face(face, index, x+3, y+3, 96)
end
#==============================================================================
# Draw Comment with Dark Background
#------------------------------------------------------------------------------
# array = long lines of comments e. [array]
# spacing = line spacing e. 20
# style = true (grident style), false (normal rect style with light border)
# lines = false (by default, it'll resize the background to fit the array lines.
# if you set it to 7 lines, it'll resize the background to fit 7 lines,
# even if the array doesn't have that many lines.
#-------------------------------------------------------------------------------
def draw_bg_comment(x, y, array, spacing, style = false, lines = false)
#----------------
color1 = Color.new(0, 0, 0, 150) # black
color2 = Color.new(55, 140, 48, 150) # green
#----------------
height = array.length * spacing + 8 unless lines
height = lines if lines != false
if style
self.contents.gradient_fill_rect(x, y, 482, height, color1, color2, true)
else
self.contents.fill_rect(x, y, 482, height, color2)
self.contents.fill_rect(x+2, y+2, 478, height - 4, color1)
end
for i in 0..array.length
self.contents.draw_text(x + 5, y + spacing * i, 466, WLH, array)
end
end
#==============================================================================
# Draw Picture - Allows you to draw a picture file.
#------------------------------------------------------------------------------
# picture_file Graphics/Pictures/Filename e. "Forest"
# align = 0 Left-top pixel origin (this is default)
# align = 1 Center origin
# align = 2 Right-top pixel origin
# align = 3 Left-bottom pixel origin
# align = 4 Right-bottom pixel origin
#------------------------------------------------------------------------------
def draw_picture(x, y, picture_file, align = 0)
picture = Cache.picture (picture_file)
rect = Rect.new (0, 0, picture.width, picture.height)
case align
when 1 # center
x = x - rect.width / 2
y = y - rect.height / 2
when 2 # right-top
x = x - rect.width
when 3 # left-bottom
y = y - rect.height
when 4 # right-bottom
x = x - rect.width
y = y - rect.height
end
contents.blt (x, y, picture, rect)
end
#==============================================================================
# Gauge Grident Bar - Sort of like HP bar
#------------------------------------------------------------------------------
# width: gauge's width Positive Integer
# height: gauge's height Positive Integer
# current: current points (Example: 50/150 HP) Integer
# max: max points (50 is current, 150 is max) Integer
#==============================================================================
def gauge_rect_bar(x, y, width, height, current, max)
#----------------
bg = Color.new(11, 29, 41, 255) #dark blue
br1 = Color.new(26, 0, 70, 255) #dark blue/purple
br2 = Color.new(255, 255, 255, 255) #white
gr1 = Color.new(38, 78, 124, 255) #dark green
gr2 = Color.new(56, 142, 61, 255) #green
#----------------
max_width = max.to_f / width.to_f
a = current / max_width
self.contents.fill_rect(x-1, y-2, width + 2, height+4, br2)
self.contents.fill_rect(x-2, y-1, width + 4, height+2, br2)
self.contents.fill_rect(x-1, y-1, width + 2, height+2, br1)
self.contents.fill_rect(x, y, width, height, bg)
self.contents.gradient_fill_rect(x, y, a, height, gr1, gr2)
self.contents.fill_rect(x + a, y, 1, height, br1)
end
end
[/codebox]
Custom List
[codebox]
=begin
______________________________________________________________________________
| Custom List & Pages Script ]----[ Author: Aindra ]----[ v1.3 ]----[ 07/17/09 |
|______________________________________________________________________________|
===============================================================================
Scene / Window Custom List
-------------------------------------------------------------------------------
Please ignore this script unless you know what you are doing.
===============================================================================
=end
class Window_Custom_List < Window_Selectable
$imported = {} if $imported == nil
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(list = 0)
@list = list
create_list
if list == 0 # Main List
@column_max = AI_L::COLUMNS_1
@x = AI_L::X1
@y = AI_L::Y1
@width = AI_L::W1
@height = 48 + AI_L::ROW_H1 * WLH - 16
if AI_L::ROW_CENTER_1
@y = @y - @height / 2
@y = 0 if @y < 0
end
@height -= @y if (@height + @y) > 416
else # Branch List
@column_max = AI_L::COLUMNS_2
@x = AI_L::X2
@y = AI_L::Y2
@width = AI_L::W2
@height = 48 + AI_L::ROW_H2 * WLH - 16
if AI_L::ROW_RESIZE
row = (@item_max + @column_max - 1) / @column_max
@height = 48 + row * WLH - 16 if row < AI_L::ROW_H2
end
if AI_L::ROW_CENTER_2
@y = @y - @height / 2
@y = 0 if @y < 0
end
end
@height -= @y if (@height + @y) > 416
@width -= @x if (@width + @x) > 544
super(@x, @y, @width, @height)
@spacing = AI_L::COLUMN_SPACE
@column_max = AI_L::COLUMNS_1 if list == 0
@column_max = AI_L::COLUMNS_2 if list != 0
self.index = 0
refresh
end
#-------------------------------------------------------------------------------
# * Enable Index? (Lock the selection or not)
#-------------------------------------------------------------------------------
def enable?(index)
id = AI_L::Enable_Switches[@list][index]
if id != nil
return true if $game_switches[id]
else
return true
end
end
#-------------------------------------------------------------------------------
# * List
#-------------------------------------------------------------------------------
def list
return @list
end
#-------------------------------------------------------------------------------
# * Refresh
#-------------------------------------------------------------------------------
def refresh
create_list
create_contents
for i in 0...@item_max
draw_list_name(i)
end
end
#-------------------------------------------------------------------------------
# * Create List
#-------------------------------------------------------------------------------
def create_list
@custom_list = AI_L::Custom_List[@list]
if @list == 0
@item_max = AI_L::MAX_MAIN_SELECTIONS
else
@item_max = @custom_list.length
end
end
#-------------------------------------------------------------------------------
# * Indexed IDs of Every Objects
#-------------------------------------------------------------------------------
def list_id(index)
if enable?(index) == true
@list_id = @custom_list[index]
else
@list_id = AI_L::LOCKED_TEXT
end
end
#-------------------------------------------------------------------------------
# * Draw Item Name
#-------------------------------------------------------------------------------
def draw_item_name(index, x, y, enabled = true)
self.contents.font.color = normal_color
if @list == 0
self.contents.font.name = AI_L::LIST_FONT_NAME_1
self.contents.font.size = AI_L::LIST_FONT_SIZE_1
else
self.contents.font.name = AI_L::LIST_FONT_NAME_2
self.contents.font.size = AI_L::LIST_FONT_SIZE_2
end
self.contents.font.color.alpha = enabled ? 255 : 128
end
#--------------------------------------------------------------------------
# * Draw List Name
#--------------------------------------------------------------------------
def draw_list_name(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
list_id(index)
enabled = enable?(index)
rect.width -= 4
draw_item_name(index, rect.x, rect.y, enabled)
self.contents.draw_text(rect, @list_id)
end
end
#==============================================================================
# ** Custom_List
#==============================================================================
class Custom_List < Scene_Base
def initialize(list = 0, index = 0, exit_mode = nil, branch = false)
@list = list
@index = index
@branch_only = branch
@exit_mode = exit_mode
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
@viewport = Viewport.new(0, 0, 544, 416)
@custom_page_window = Custom_Page.new
@custom_page_window.z = 101
@custom_page_window.viewport = @viewport
@custom_page_window.visible = false
@custom_branch = false
if @exit_mode == true
@custom_page_window.goto(@list, @index, true)
@custom_page_window.visible = true
elsif @exit_mode == false && @branch_only == true
@custom_branch = true
@custom_list_window = Window_Custom_List.new(@list)
else
@custom_list_window = Window_Custom_List.new
@custom_list_window.viewport = @viewport
@custom_list_window.active = true
@custom_list_window.index = @list
end
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@custom_list_window.dispose unless @exit_mode
@viewport.dispose
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
#-------------------------------------
if @exit_mode == true
# Return to Map, from Page
$scene = Scene_Map.new
#-------------------------------------
elsif @exit_mode == false
if @custom_list_window.active == false
@custom_page_window.visible = false
@custom_list_window.visible = true
if @list == 0
# Return to Main List, from Page
$scene = Custom_List.new(@index, 0, false)
else
# Return to Branch List, from Page
@custom_branch = true
@custom_list_window.active = true
@custom_list_window.index = @index
end
elsif @custom_branch
@custom_branch = false
if @branch_only
# Return to Map, from Branch List
$scene = Scene_Map.new
else
# Return to Main List, from Branch List
$scene = Custom_List.new(@list_index, 0, false)
end
else
# Return to Map, from Main List
$scene = Scene_Map.new
end
#-------------------------------------
else
if @custom_list_window.active == false
@custom_page_window.visible = false
@custom_list_window.visible = true
if @list == 0
# Return to Main List, from Page
$scene = Custom_List.new(@index, 0, nil)
else
# Return to Branch List, from Page
@custom_branch = true
@custom_list_window.active = true
@custom_list_window.index = @index
end
elsif @custom_branch
# Return to Main List, from Branch List
@custom_branch = false
$scene = Custom_List.new(@list_index, 0, nil)
else
# Return to Map, from Main List
$scene = Scene_Menu.new(AI_L::MENU_EXIT_INDEX)
end
end
end
#--------------------------------------------------------------------------
# * Update Frame
#--------------------------------------------------------------------------
def update
super
update_menu_background
@custom_list_window.update unless @exit_mode
update_list_selection
end
#--------------------------------------------------------------------------
# * Update Item Selection
#--------------------------------------------------------------------------
def update_list_selection
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
if @exit_mode
# do nothing
else
if @custom_list_window.active &&
@custom_list_window.enable?(@custom_list_window.index)
Sound.play_decision
@custom_list_window.active = false
@index = index2 = @custom_list_window.index
@list = @custom_list_window.list
index2 += 1
if @custom_branch
# Go to the Page, from the Branch List.
@custom_page_window.goto(@list, @index, true)
@custom_page_window.visible = true
@custom_list_window.visible = false
elsif AI_L::Custom_List[index2] != false # Check if it has branch list
# Create the Branch List
@custom_branch = true
@list_index = @index
@custom_list_window = Window_Custom_List.new(index2)
else
# Skip the Branch List. To the Page.
@custom_page_window.goto(@list, @index, false)
@custom_page_window.visible = true
@custom_list_window.visible = false
end
else
if @custom_list_window.visible
Sound.play_buzzer
@index = @list
end
end # end of if - @custom_list_window.active || ..window.enable?(index)
end # end of if - @exit_mode
end # end of if - Input.trigger?(Input::B)
end
end
#=================================================#
# IMPORT - Thanks MrA for help #
#=================================================#
unless AI_L::DISABLE_MENU
$imported = {} if $imported == nil
$imported["Aindra"] = true
#==============================================================================
# ** Vocab
#==============================================================================
module Vocab
def self.aindra
return AI_L::MENU_NAME
end
end
#==============================================================================
# ** Window_Command
#==============================================================================
class Window_Command < Window_Selectable
unless method_defined?add_command)
#--------------------------------------------------------------------------
# * Add Command
# Returns added command position
#--------------------------------------------------------------------------
def add_command(command)
@commands << command
@item_max = @commands.size
item_index = @item_max - 1
refresh_command
draw_item(item_index)
return item_index
end
#--------------------------------------------------------------------------
# * Refresh Command
#--------------------------------------------------------------------------
def refresh_command
buf = self.contents.clone
self.height = [self.height, row_max * WLH + 32].max
create_contents
self.contents.blt(0, 0, buf, buf.rect)
buf.dispose
end
#--------------------------------------------------------------------------
# * Insert Command
#--------------------------------------------------------------------------
def insert_command(index, command)
@commands.insert(index, command)
@item_max = @commands.size
refresh_command
refresh
end
#--------------------------------------------------------------------------
# * Remove Command
#--------------------------------------------------------------------------
def remove_command(command)
@commands.delete(command)
@item_max = @commands.size
refresh
end
end
end
#==============================================================================
# ** Scene_Menu
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
alias aindra_create_command_window :create_command_window
def create_command_window
aindra_create_command_window
return if $imported["CustomMenuCommand"]
@__command_aindra_index =
@command_window.add_command(AI_L::MENU_NAME)
if @command_window.oy > 0
@command_window.oy -= Window_Base::WLH
end
@command_window.index = @menu_index
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
alias aindra_update_command_selection :update_command_selection
def update_command_selection
current_menu_index = @__command_aindra_index
call_aindra_flag = false
if Input.trigger?(Input::C)
case @command_window.index
when @__command_aindra_index
call_aindra_flag = true
end
end
if call_aindra_flag
Sound.play_decision
$scene = Custom_List.new
return
end
aindra_update_command_selection
end
end
end
[/codebox]
Above script will attach "Custom List" at end of the menu list. If you do not like it being under "Game End", you can take this KGC_CustomCommandMenu script, and put it above my scripts. It'll allow you to insert it anywhere you want in the list. NOTE: That script is made by Tomy and translated by MrAnonymous, not me!
[codebox]
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ �ƒ¢â�‚��€�â�‚� Command Menu Customization - KGC_CustomMenuCommand [Aindra Edition�ƒ¢â�‚��€�â�‚� VX �ƒ¢â�‚��€�â�‚�
#_/ �ƒ¢â�‚��€�â�‚�¡ Last Update: 2008/08/28
#_/ �ƒ¢â�‚��€�â�‚� Written by TOMY
#_/ �ƒ¢â�‚��€�â�‚� Translation & Extended Updates by Mr. Anonymous
#_/ �ƒ¢â�‚��€�â�‚� KGC Site:
#_/ �ƒ¢â�‚��€�â�‚� http://ytomy.sakura.ne.jp/
#_/ �ƒ¢â�‚��€�â�‚� Translator's Blog:
#_/ �ƒ¢â�‚��€�â�‚� http://mraprojects.wordpress.com
#_/----------------------------------------------------------------------------
#_/ Installation: This script should be inserted above most custom scripts -
#_/ specifically scripts that add items to the main command menu.
#_/ Insert below KGC_HelpExtension, DrawFormatText, MathReinforce, Win32API,
#_/ LimitBreak, and ScreenCapture.
#_/============================================================================
#_/ This script allows you to customize the order in which items in the main
#_/ command menu are displayed. Also, it extends the ability of easily creating
#_/ additional menu commands and adding them into the command menu, with a
#_/ little scripting skill.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#=============================================================================#
# �ƒ¢�‹�“â�‚�¦ BEGIN Customization �ƒ¢�‹�“â�‚�¦ #
#=============================================================================#
module KGC
module CustomMenuCommand
# �ƒ¢â�‚��€�â�‚� Default Menu Items �ƒ¢â�‚��€�â�‚�
# Each menu item is assigned a number. These can be rearranged to your liking
# in MENU_COMMANDS.
# 0..Items 1..Skills 2..Equipment 3..Status 4..Save 5..Quit
#
# �ƒ¢â�‚��€�â�‚� KGC Menu Items �ƒ¢â�‚��€�â�‚�
# ** If the corresponding scripts are not installed, don't bother with
# using its listed option.
# 10: Party (KGC_LargeParty)
# 11: View AP (KGC_EquipLearnSkill)
# 12: Skill Slots (KGC_SkillCPSystem)
# 13: Difficulty (KGC_BattleDifficulty)
# 14: Level Up (KGC_DistributeParameter)
# 15: Beastiary (KGC_MonsterGuide)
# 16: Outline (KGC_Outline)
# 17: Aindra's Custom List Script
#
# �ƒ¢â�‚��€�â�‚� Extra Menu Items �ƒ¢â�‚��€�â�‚�
# ** [ExMenu_CustomCommand]
# ** These are for future use for scripters.
# 100: Extra Command 1
# 101: Extra Command 2
# 102: Extra Command 3
# (Up to 199 available slots.)
# �ƒ¢â�‚��€�â�‚� Menu Commands Order �ƒ¢â�‚��€�â�‚�
# Arrange your menu commands with the cooresponding number here.
# Example: MENU_COMMANDS = [0, 1, 2, 3, 12, 14, 11, 10, 13, 100, 15, 4, 5]
MENU_COMMANDS = [0, 1, 2, 3, 17, 4, 5]
# �ƒ¢â�‚��€�â�‚� Menu Items Row Maximum �ƒ¢â�‚��€�â�‚�
# Designate the amount of command menu items are in use here.
# If there are more menu commands than is designated below, the menu command
# box effectively becomes a scroll box.
ROW_MAX = 7
end
end
#=============================================================================#
# �ƒ¢�‹�“â�‚�¦ END Customization �ƒ¢�‹�“â�‚�¦ #
#=============================================================================#
#=================================================#
# IMPORT #
#=================================================#
$imported = {} if $imported == nil
$imported["CustomMenuCommand"] = true
#=================================================
module KGC::CustomMenuCommand
# [ExMenu_CustomCommand] definitions
EXMNU_CTCMD_OK = defined?(EXMNU_CTCMD_COMMANDS)
end
#=================================================
#==============================================================================
# �ƒ¢â�‚��€œ�‚¡ KGC::Commands
#==============================================================================
module KGC
module Commands
module_function
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Call Item Scene
#--------------------------------------------------------------------------
def call_item
return if $game_temp.in_battle
$game_temp.next_scene = :menu_item
$game_temp.next_scene_actor_index = 0
$game_temp.menu_command_index = {}
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Call Skill Scene
# actor_index : Actor index in the database
#--------------------------------------------------------------------------
def call_skill(actor_index = 0)
return if $game_temp.in_battle
$game_temp.next_scene = :menu_skill
$game_temp.next_scene_actor_index = actor_index
$game_temp.menu_command_index = {}
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Call Equip Scene
# actor_index : Actor index in the database
#--------------------------------------------------------------------------
def call_equip(actor_index = 0)
return if $game_temp.in_battle
$game_temp.next_scene = :menu_equip
$game_temp.next_scene_actor_index = actor_index
$game_temp.menu_command_index = {}
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Call Status Scene
# actor_index : Actor index in the database
#--------------------------------------------------------------------------
def call_status(actor_index = 0)
return if $game_temp.in_battle
$game_temp.next_scene = :menu_status
$game_temp.next_scene_actor_index = actor_index
$game_temp.menu_command_index = {}
end
end
end
#=================================================
class Game_Interpreter
include KGC::Commands
end
#=================================================
#==============================================================================
# �ƒ¢â�‚��€œ�‚ Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :menu_command_index # Menu Command Index
attr_accessor :next_scene_actor_index # Next Scene (Actor) Index
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Initialization
#--------------------------------------------------------------------------
alias initialize_KGC_CustomMenuCommand initialize
def initialize
initialize_KGC_CustomMenuCommand
@menu_command_index = {}
@next_scene_actor_index = 0
end
end
#=================================================
#==============================================================================
# �ƒ¢â�‚��€œ�‚ Scene_Map
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Update Scene Change
#--------------------------------------------------------------------------
alias update_scene_change_KGC_CustomMenuCommand update_scene_change
def update_scene_change
return if $game_player.moving? # Return if the player is in motion.
case $game_temp.next_scene
when :menu_item
call_menu_item
when :menu_skill
call_menu_skill
when :menu_equip
call_menu_equip
when :menu_status
call_menu_status
else
update_scene_change_KGC_CustomMenuCommand
end
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Call Item Menu
#--------------------------------------------------------------------------
def call_menu_item
$game_temp.next_scene = nil
$scene = Scene_Item.new
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Call Skill Menu
#--------------------------------------------------------------------------
def call_menu_skill
$game_temp.next_scene = nil
$scene = Scene_Skill.new($game_temp.next_scene_actor_index)
$game_temp.next_scene_actor_index = 0
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Call Equip Menu
#--------------------------------------------------------------------------
def call_menu_equip
$game_temp.next_scene = nil
$scene = Scene_Equip.new($game_temp.next_scene_actor_index)
$game_temp.next_scene_actor_index = 0
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Call Status Scene
#--------------------------------------------------------------------------
def call_menu_status
$game_temp.next_scene = nil
$scene = Scene_Status.new($game_temp.next_scene_actor_index)
$game_temp.next_scene_actor_index = 0
end
end
#=================================================
#==============================================================================
# �ƒ¢â�‚��€œ�‚ Scene_Menu
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Create Command Window
#--------------------------------------------------------------------------
def create_command_window
commands = create_command_list
@command_window = Window_Command.new(160, commands)
@command_window.height = [@command_window.height,
KGC::CustomMenuCommand::ROW_MAX * Window_Base::WLH + 32].min
@command_window.index = [@menu_index, commands.size - 1].min
set_command_enabled
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Create Command List
# Defines command list names for command selections.
#--------------------------------------------------------------------------
def create_command_list
commands = []
index_list = {}
@exmenu_command_scene = {}
@disabled_command_index = []
KGC::CustomMenuCommand::MENU_COMMANDS.each_with_index { |c, i|
case c
when 0 # Item
index_list[:item] = commands.size
commands << Vocab.item
when 1 # Skill
index_list[:skill] = commands.size
commands << Vocab.skill
when 2 # Equip
index_list[:equip] = commands.size
commands << Vocab.equip
when 3 # Status
index_list[:status] = commands.size
commands << Vocab.status
when 4 # Save
index_list[:save] = commands.size
commands << Vocab.save
when 5 # Game End
index_list[:game_end] = commands.size
commands << Vocab.game_end
when 10 # Large Party
next unless $imported["LargeParty"]
index_list[artyform] = commands.size
@__command_partyform_index = commands.size
commands << Vocab.partyform
when 11 # AP Viewer
next unless $imported["EquipLearnSkill"]
index_list[:ap_viewer] = commands.size
@__command_ap_viewer_index = commands.size
commands << Vocab.ap_viewer
when 12 # CP Skill System
next unless $imported["SkillCPSystem"]
index_list[:set_battle_skill] = commands.size
@__command_set_battle_skill_index = commands.size
commands << Vocab.set_battle_skill
when 13 # Battle Difficulty
next unless $imported["BattleDifficulty"]
index_list[:set_difficulty] = commands.size
@__command_set_difficulty_index = commands.size
commands << KGC::BattleDifficulty.get[:name]
when 14 # Distribute Parameter
next unless $imported["DistributeParameter"]
index_list[:distribute_parameter] = commands.size
@__command_distribute_parameter_index = commands.size
commands << Vocab.distribute_parameter
when 15 # Enemy Guide
next unless $imported["EnemyGuide"]
index_list[:enemy_guide] = commands.size
@__command_enemy_guide_index = commands.size
commands << Vocab.enemy_guide
when 16 # Outline
next unless $imported["Outline"]
index_list[utline] = commands.size
@__command_outline_index = commands.size
commands << Vocab.outline
when 17 # Aindra's Script
next unless $imported["Aindra"]
index_list[:aindra] = commands.size
@__command_aindra_index = commands.size
commands << Vocab.aindra
when 100..199 # ExMenu_CustomCommand
next unless KGC::CustomMenuCommand::EXMNU_CTCMD_OK # ExMenu Comm enable
excommand = EXMNU_CTCMD_COMMANDS[c - 100] # ExMenu Comm index
unless command_visible?(excommand) || command_inputable?(excommand)
next # Invisible commands
end
index_list[excommand[2]] = commands.size
commands << excommand[2]
@exmenu_command_scene[excommand[2]] = excommand[3]
end
}
$game_temp.menu_command_index = index_list
return commands
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Set Command Enabled
#--------------------------------------------------------------------------
def set_command_enabled
disable_items = []
# If Party Members = 0, disable buttons.
if $game_party.members.size == 0
disable_items.pushitem, :skill, :equip, :status, artyform,
:ap_viewer, :set_battle_skill, :distribute_parameter)
end
# Disable save
if $game_system.save_disabled
disable_items.pushsave)
end
# Disable partyform
if $imported["LargeParty"] && !$game_party.partyform_enable?
disable_items.pushpartyform)
end
# [ExMenu_CustomCommand] disablement
if KGC::CustomMenuCommand::EXMNU_CTCMD_OK
disable_items += get_exmenu_disable_commands
end
# Set up disabled items
disable_items.each { |i|
if $game_temp.menu_command_index.has_key?(i)
index = $game_temp.menu_command_index
@command_window.draw_item(index, false)
@disabled_command_index << index
end
}
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Obtain Disabled [ExMenu_CustomCommand] Commands
#--------------------------------------------------------------------------
def get_exmenu_disable_commands
disable_items = []
$game_temp.menu_command_index.each { |k, v|
next unless k.is_a?(String)
# Assign commands
command = EXMNU_CTCMD_COMMANDS.find { |c| c[2] == k }
next if command == nil
# Disable commands
unless command_inputable?(command)
disable_items.push(k)
end
}
return disable_items
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
index = @command_window.index
unless command_enabled?(index) # Unless Command is enabled, cancel
Sound.play_buzzer
return
end
Sound.play_decision
# [ExMenu_CustomCommand]
excommand = nil
if KGC::CustomMenuCommand::EXMNU_CTCMD_OK
excommand = @command_window.commands[index]
end
# Set up @command_window.index
case index
when $game_temp.menu_command_index[:item] # Item
$scene = Scene_Item.new
when $game_temp.menu_command_index[:skill], # Skill, equip, status
$game_temp.menu_command_index[:equip],
$game_temp.menu_command_index[:status]
start_actor_selection
when $game_temp.menu_command_index[:save] # Save
$scene = Scene_File.new(true, false, false)
when $game_temp.menu_command_index[:game_end] # Game End
$scene = Scene_End.new
when $game_temp.menu_command_index[excommand] # [ExMenu_CustomCommand]
$game_party.last_menu_index = index
$scene = eval("#{@exmenu_command_scene[excommand]}.new")
end
end
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€�â�‚�¹ Command Enabled Flag
# index : command_window index
#--------------------------------------------------------------------------
def command_enabled?(index)
# Save
if $game_system.save_disabled &&
index == $game_temp.menu_command_index[:save]
return false
end
# [ExMenu_CustomCommand]
if KGC::CustomMenuCommand::EXMNU_CTCMD_OK
command = @command_window.commands[index]
if @disabled_command_index.include?($game_temp.menu_command_index[command])
return false
end
end
# Disable commands if party size = 0
if $game_party.members.size == 0 &&
@disabled_command_index.include?(index)
return false
end
return true
end
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Update Actor Selection
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when $game_temp.menu_command_index[:skill] # Skill
$scene = Scene_Skill.new(@status_window.index)
when $game_temp.menu_command_index[:equip] # Equip
$scene = Scene_Equip.new(@status_window.index)
when $game_temp.menu_command_index[:status] # Status
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
#=================================================
#==============================================================================
# �ƒ¢â�‚��€œ�‚ Scene_Item
#==============================================================================
class Scene_Item < Scene_Base
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Return Scene
#--------------------------------------------------------------------------
def return_scene
if $game_temp.menu_command_index.has_key?item)
$scene = Scene_Menu.new($game_temp.menu_command_index[:item])
else
$scene = Scene_Map.new
end
end
end
#=================================================
#==============================================================================
# �ƒ¢â�‚��€œ�‚ Scene_Skill
#==============================================================================
class Scene_Skill < Scene_Base
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Return Scene
#--------------------------------------------------------------------------
def return_scene
if $game_temp.menu_command_index.has_key?skill)
$scene = Scene_Menu.new($game_temp.menu_command_index[:skill])
else
$scene = Scene_Map.new
end
end
end
#=================================================
#==============================================================================
# �ƒ¢â�‚��€œ�‚ Scene_Equip
#==============================================================================
class Scene_Equip < Scene_Base
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Return Scene
#--------------------------------------------------------------------------
def return_scene
if $game_temp.menu_command_index.has_key?equip)
$scene = Scene_Menu.new($game_temp.menu_command_index[:equip])
else
$scene = Scene_Map.new
end
end
end
#=================================================
#==============================================================================
# �ƒ¢â�‚��€œ�‚ Scene_Status
#==============================================================================
class Scene_Status < Scene_Base
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Return Scene
#--------------------------------------------------------------------------
def return_scene
if $game_temp.menu_command_index.has_key?status)
$scene = Scene_Menu.new($game_temp.menu_command_index[:status])
else
$scene = Scene_Map.new
end
end
end
#=================================================
#==============================================================================
# �ƒ¢â�‚��€œ�‚ Scene_File
#==============================================================================
class Scene_File < Scene_Base
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Return Scene
#--------------------------------------------------------------------------
alias return_scene_KGC_CustomMenuCommand return_scene
def return_scene
if @from_title || @from_event
return_scene_KGC_CustomMenuCommand
elsif $game_temp.menu_command_index.has_key?save)
$scene = Scene_Menu.new($game_temp.menu_command_index[:save])
else
$scene = Scene_Map.new
end
end
end
#=================================================
#==============================================================================
# �ƒ¢â�‚��€œ�‚ Scene_End
#==============================================================================
class Scene_End < Scene_Base
#--------------------------------------------------------------------------
# �ƒ¢â�‚��€��‚ Return Scene
#--------------------------------------------------------------------------
def return_scene
if $game_temp.menu_command_index.has_key?game_end)
$scene = Scene_Menu.new($game_temp.menu_command_index[:game_end])
else
$scene = Scene_Map.new
end
end
end
[/codebox]
Creditos
- Aindra
- Tomy / MrAnonymous if you use KGC_CustomMenuCommand script along with my scripts.