EmuMaster2002
Member
Constance made a very nice menu system in December of '05 that provided probably one of the first examples of a menu designed for two characters. In his(?) credits he lists Acedent Prone, Diego, Dubealex, and SephirothSpawn as inspiration and aid, and it shows. Functionally, it works almost perfectly. Under the hood, however?
Damn, man.
This script is a mess. It has a separate class for each of the two characters' versions of the windows displaying their stats--both of them--as well as "Dummy" windows that show their character sprites and such below or around the text. It contains entire rewrites of the equip and skill menus for no reason that I was able to parse. It has well over 100 instances of "self.contents" after editing. The result is a very attractive menu system, but the process getting there is not.
There also appear to be a few minor bugs with the menu. I had to translate the text back to English from French, and the little "choose a character" text when you go for equipment or skills is neither centered or left-justified, and the selection box for the characters doesn't seem to line up with them at all, especially with long names (for ease-of-use purposes I've been using the names "player" and "mercenary" while in development).
I would like to see this script edited down to be a bit more optimized. To help in the process, I formatted the lines (they were all on the left edge of the line when I found it) and changed around the things I personally wanted changed, including removing the "time played" window to make room for a longer Location box and replaced the "load" option on the menu with a Quest screen.
EDIT: I changed most of the things I wanted myself, after spending a bit more time with it. I also changed the bars for the status to be those used by Paradog's ATB, which my project uses. For the code, I included the def draw_meter thing so that it won't, or shouldn't give errors. Code has been updated to reflect the changes. Still hoping for some help.
I would greatly appreciate it if anyone was willing to do this for me. The code follows:
I suspect it's more than twice as long as it really needs to be, but I could be wrong.
Damn, man.
This script is a mess. It has a separate class for each of the two characters' versions of the windows displaying their stats--both of them--as well as "Dummy" windows that show their character sprites and such below or around the text. It contains entire rewrites of the equip and skill menus for no reason that I was able to parse. It has well over 100 instances of "self.contents" after editing. The result is a very attractive menu system, but the process getting there is not.
There also appear to be a few minor bugs with the menu. I had to translate the text back to English from French, and the little "choose a character" text when you go for equipment or skills is neither centered or left-justified, and the selection box for the characters doesn't seem to line up with them at all, especially with long names (for ease-of-use purposes I've been using the names "player" and "mercenary" while in development).
I would like to see this script edited down to be a bit more optimized. To help in the process, I formatted the lines (they were all on the left edge of the line when I found it) and changed around the things I personally wanted changed, including removing the "time played" window to make room for a longer Location box and replaced the "load" option on the menu with a Quest screen.
EDIT: I changed most of the things I wanted myself, after spending a bit more time with it. I also changed the bars for the status to be those used by Paradog's ATB, which my project uses. For the code, I included the def draw_meter thing so that it won't, or shouldn't give errors. Code has been updated to reflect the changes. Still hoping for some help.
I would greatly appreciate it if anyone was willing to do this for me. The code follows:
Code:
#============================================================
# Custom Menu System
# created by: Constance
# created on: Dec. 26, 2005
# version: 2.1
# credits: Acedent Prone, Diego, Dubealex
# special thanks credits goes to: SephirothSpawn, couldn't have done it without you
# RMXP - Underground - The Underground Gaming Zone
#============================================================
class Window_Base < Window
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
def draw_sprite(x, y, name, hue)
bitmap = RPG::Cache.character(name, hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
def draw_actor_hp(actor, x, y, width = 144)
self.contents.font.name = "Verdana"
self.contents.font.size = 20
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x + 30, y, 48, 32, actor.hp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 30 + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 30 + 60, y, 48, 32, actor.maxhp.to_s)
end
end
def draw_actor_sp(actor, x, y, width = 144)
self.contents.font.name = "Verdana"
self.contents.font.size = 20
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
self.contents.font.color = Color.new(74, 230, 51, 225)
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x + 30, y, 48, 32, actor.sp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 30 + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 30 + 60, y, 48, 32, actor.maxsp.to_s)
end
end
def draw_actor_level3(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, "Lv")
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
end
def draw_actor_hp2(actor, x, y, width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
def draw_actor_sp2(actor, x, y, width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
end
end
def draw_actor_name(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 144, 32, actor.name)
end
def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color )
self.contents.fill_rect(x, y, width, height, Color.new(192, 192, 192, 255))
self.contents.fill_rect(x+1, y+1, width-2, height-2, Color.new(128, 128, 128, 128))
now = now > max ? max : now
percentage = max != 0 ? (width-2) * now / max.to_f : 0
if start_color == end_color
self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color)
else
for i in 1..percentage
r = start_color.red + (end_color.red - start_color.red) / percentage * i
g = start_color.green + (end_color.green - start_color.green) / percentage * i
b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i
a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i
self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a))
end
end
end
end
end
class Window_Selectable2 < Window_Base
attr_reader :index
attr_reader :help_window
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
def index=(index)
@index = index
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
def row_max
return (@item_max + @column_max - 1) / @column_max
end
def top_row
return self.oy / 32
end
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 32
end
def page_row_max
return (self.height - 32) / 32
end
def page_item_max
return page_row_max * @column_max
end
def help_window=(help_window)
@help_window = help_window
if self.active and @help_window != nil
update_help
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, 65, 32)
end
def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::DOWN)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
if Input.repeat?(Input::UP)
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
if Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
if Input.repeat?(Input::LEFT)
if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
self.top_row += self.page_row_max
end
end
if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
self.top_row -= self.page_row_max
end
end
end
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
end
class Window_Command2 < Window_Selectable2
attr_accessor :commands
def initialize(commands)
super(0, 0, 270, 101)
self.contents = Bitmap.new(width - 32, height - 32)
@commands = commands
@width = width
@item_max = 6
@column_max = 3
@commands = commands
self.index = 0
end
end
class Dummy_Window_Command < Window_Base
def initialize
super(0, 0, 270, 101)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 22
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(-35, 0, 124, 32, $data_system.words.item, 1)
self.contents.draw_text(50, 0, 124, 32, $data_system.words.skill, 1)
self.contents.draw_text(145, 0, 124, 32, $data_system.words.equip, 1)
self.contents.draw_text(-35, 35, 124, 32, "Quest", 1)
self.contents.draw_text(50, 35, 124, 32, "Save", 1)
self.contents.draw_text(140, 35, 124, 32, "Quit", 1)
end
end
class Dummy_Window_Command2 < Window_Base
def initialize
super(0, 0, 270, 101)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 22
refresh
end
def refresh
self.contents.clear
bitmap = RPG::Cache.icon("034-Item03")
self.contents.blt(35, 4, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("050-Skill07")
self.contents.blt(115, 4, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("013-Body01")
self.contents.blt(205, 4, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("033-Item02")
self.contents.blt(35, 39, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("037-Item06")
self.contents.blt(115, 39, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("039-Item08")
self.contents.blt(205, 39, bitmap, Rect.new(0, 0, 24, 24))
end
end
class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
class Game_Map
def name
$map_infos[@map_id]
end
end
class Window_Location < Window_Base
def initialize
super(0, 0, 370,101)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 22
refresh
end
def refresh
bitmap = RPG::Cache.icon("032-Item01")
self.contents.blt(315, y + 40, bitmap, Rect.new(0, 0, 24, 24))
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.font.size = 20
self.contents.draw_text(224, 40, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(224-cx, 40, cx, 32, $data_system.words.gold, 2)
lx = contents.text_size("Location:").width
self.contents.draw_text(4, -55, lx, 144, "Location:", 1)
self.contents.font.color = normal_color
self.contents.font.size = 20
self.contents.draw_text(10 + lx, 1, lx + 40, 32, $game_map.name.to_s, 1)
end
end
class Window_GraphicCharacter1 < Window_Base
def initialize
super(0, 0, 200,180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 22
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_sprite(25, 55, actor.character_name, actor.character_hue)
end
end
class Window_GraphicCharacter2 < Window_Base
def initialize
super(0, 0, 200,180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 22
refresh
end
def refresh
self.contents.clear
if $game_party.actors.size < 2
self.contents.draw_text(25, 55, 50, 28, "Empty")
else
actor = $game_party.actors[1]
draw_sprite(25, 55, actor.character_name, actor.character_hue)
end
end
end
class Window_Character1 < Window_Base
def initialize
super(0, 0, 200,180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 22
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_actor_hp(actor, x + 4, y + 55, 144)
draw_meter(actor.hp, actor.maxhp, x + 4, y + 82, 160, 4, Color.new(0, 128, 0, 255), Color.new(0, 255, 0, 255))
draw_actor_sp(actor, x + 4, y + 110, 144)
draw_meter(actor.hp, actor.maxhp, x + 4, y + 137, 160, 4, Color.new(128, 0, 128, 255), Color.new(255, 0, 255, 255))
self.contents.font.size = 20
draw_actor_class(actor, x + 50, y + 1)
self.contents.draw_text(x + 50, y - 62, 144, 170, "_____________________")
self.contents.draw_text(x + 80, y - 30, 144, 144, "Lv:")
draw_actor_level(actor, x + 95, y + 6)
end
end
class Window_Character2 < Window_Base
def initialize
super(0, 0, 200,200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 22
refresh
end
def refresh
self.contents.clear
if $game_party.actors.size < 2
self.contents.draw_text(25, 55, 50, 28, "Empty")
else
actor = $game_party.actors[1]
draw_actor_hp(actor, x + 4, y + 55, 144)
draw_meter(actor.hp, actor.maxhp, x + 4, y + 82, 160, 4, Color.new(0, 128, 0, 255), Color.new(0, 255, 0, 255))
draw_actor_sp(actor, x + 4, y + 110, 144)
draw_meter(actor.hp, actor.maxhp, x + 4, y + 137, 160, 4, Color.new(128, 0, 128, 255), Color.new(255, 0, 255, 255))
self.contents.font.size = 20
draw_actor_class(actor, x + 50, y + 1)
self.contents.draw_text(x + 50, y - 62, 144, 170, "_____________________")
self.contents.draw_text(x + 80, y - 30, 144, 144, "Lv:")
draw_actor_level(actor, x + 95, y + 6)
end
end
end
class Window_Character_Selection2 < Window_Base
def initialize
super(0, 0, 640, 51)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.z = 2000
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
cx = contents.text_size("Select a character").width
self.contents.draw_text(145, -6, cx, 32, "Select a character", 2)
end
end
#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
# This window class contains cursor movement and scroll functions.
#==============================================================================
class Window_Selectable3 < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :index # cursor position
attr_reader :help_window # help window
#--------------------------------------------------------------------------
# * Object Initialization
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
#--------------------------------------------------------------------------
# * Set Cursor Position
# index : new cursor position
#--------------------------------------------------------------------------
def index=(index)
@index = index
# Update Help Text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
#--------------------------------------------------------------------------
# * Get Row Count
#--------------------------------------------------------------------------
def row_max
# Compute rows from number of items and columns
return (@item_max + @column_max - 1) / @column_max
end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
# Divide y-coordinate of window contents transfer origin by 1 row
# height of 32
return self.oy / 32
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
# If row is less than 0, change it to 0
if row < 0
row = 0
end
# If row exceeds row_max - 1, change it to row_max - 1
if row > row_max - 1
row = row_max - 1
end
# Multiply 1 row height by 32 for y-coordinate of window contents
# transfer origin
self.oy = row * 32
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
# Subtract a frame height of 32 from the window height, and divide it by
# 1 row height of 32
return (self.height - 32) / 32
end
#--------------------------------------------------------------------------
# * Get Number of Items Displayable on 1 Page
#--------------------------------------------------------------------------
def page_item_max
# Multiply row count (page_row_max) times column count (@column_max)
return page_row_max * @column_max
end
#--------------------------------------------------------------------------
# * Set Help Window
# help_window : new help window
#--------------------------------------------------------------------------
def help_window=(help_window)
@help_window = help_window
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
end
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
# If cursor position is less than 0
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index / @column_max
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = self.width / @column_max - 32
# Calculate cursor coordinates
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
# Update cursor rectangle
if $game_party.actors.size < 2
self.cursor_rect.set(250 + @index * 140, y, 100, 20)
else
self.cursor_rect.set(160 + @index * 140, y, 150, 20)
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If cursor is movable
if self.active and @item_max > 0 and @index >= 0
# If pressing down on the directional buttons
if Input.repeat?(Input::DOWN)
# If column count is 1 and directional button was pressed down with no
# repeat, or if cursor position is more to the front than
# (item count - column count)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
# Move cursor down
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
# If column count is 1 and directional button was pressed up with no
# repeat, or if cursor position is more to the back than column count
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
# Move cursor up
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
# If the right directional button was pressed
if Input.repeat?(Input::RIGHT)
# If column count is 2 or more, and cursor position is closer to front
# than (item count -1)
if @column_max >= 2 and @index < @item_max - 1
# Move cursor right
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
# If the left directional button was pressed
if Input.repeat?(Input::LEFT)
# If column count is 2 or more, and cursor position is more back than 0
if @column_max >= 2 and @index > 0
# Move cursor left
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
# If R button was pressed
if Input.repeat?(Input::R)
# If bottom row being displayed is more to front than bottom data row
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
# Move cursor 1 page back
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
self.top_row += self.page_row_max
end
end
# If L button was pressed
if Input.repeat?(Input::L)
# If top row being displayed is more to back than 0
if self.top_row > 0
# Move cursor 1 page forward
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
self.top_row -= self.page_row_max
end
end
end
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
end
class Window_StatusCharacter1 < Window_Base
def initialize
super(0, 0, 440,180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 22
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.draw_text(215, -63, 144, 144, "Status: ")
self.contents.draw_text(190, 114, 120, 32, "Experience: ")
actor = @actor
@actor = $game_party.actors[0]
draw_actor_name(@actor, x + 55, y - 7)
draw_actor_state(@actor, 325, -8, 144)
draw_actor_parameter(@actor, 0, 15 + 10, 3)
draw_actor_parameter(@actor, 0, 15 + 40, 4)
draw_actor_parameter(@actor, 0, 15 + 70, 5)
draw_actor_parameter(@actor, 0, 15 + 100, 6)
draw_actor_parameter(@actor, 190, 15 + 10, 0)
draw_actor_parameter(@actor, 190, 15 + 40, 1)
draw_actor_parameter(@actor, 190, 15 + 70, 2)
draw_meter(@actor.str, 999, 0, 52, 168, 4, Color.new(106, 106, 106, 255), Color.new(248, 248, 248, 255))
draw_meter(@actor.dex, 999, 0, 82, 168, 4, Color.new(0, 128, 108, 255), Color.new(0, 255, 232, 255))
draw_meter(@actor.agi, 999, 0, 112, 168, 4, Color.new(128, 128, 0, 255), Color.new(255, 255, 0, 255))
draw_meter(@actor.int, 999, 0, 142, 168, 4, Color.new(108, 0, 132, 255), Color.new(232, 0, 255, 255))
draw_meter(@actor.atk, 600, 190, 52, 168, 4, Color.new(128, 0, 0, 255), Color.new(255, 0, 0, 255))
draw_meter(@actor.pdef, 100, 190, 82, 168, 4, Color.new(0, 0, 128, 255), Color.new(0, 0, 255, 255))
draw_meter(@actor.mdef, 100, 190, 112, 168, 4, Color.new(132, 0, 108, 255), Color.new(255, 0, 232, 255))
draw_meter(@actor.now_exp.to_f, @actor.next_exp, 190, 142, 168, 4, Color.new(108, 132, 0, 255), Color.new(232, 255, 0, 255))
end
end
class Window_StatusCharacter2 < Window_Base
def initialize
super(0, 0, 440,200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Verdana"
self.contents.font.size = 22
refresh
end
def refresh
self.contents.clear
if $game_party.actors.size < 2
self.contents.draw_text(25, 55, 50, 28, "Empty")
else
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.draw_text(215, -63, 144, 144, "Status: ")
self.contents.draw_text(190, 114, 120, 32, "Experience: ")
actor = @actor
@actor = $game_party.actors[1]
draw_actor_name(@actor, x + 55, y - 7)
draw_actor_state(@actor, 325, -8, 144)
draw_actor_parameter(@actor, 0, 15 + 10, 3)
draw_actor_parameter(@actor, 0, 15 + 40, 4)
draw_actor_parameter(@actor, 0, 15 + 70, 5)
draw_actor_parameter(@actor, 0, 15 + 100, 6)
draw_actor_parameter(@actor, 190, 15 + 10, 0)
draw_actor_parameter(@actor, 190, 15 + 40, 1)
draw_actor_parameter(@actor, 190, 15 + 70, 2)
draw_meter(@actor.str, 999, 0, 52, 168, 4, Color.new(106, 106, 106, 255), Color.new(248, 248, 248, 255))
draw_meter(@actor.dex, 999, 0, 82, 168, 4, Color.new(0, 128, 108, 255), Color.new(0, 255, 232, 255))
draw_meter(@actor.agi, 999, 0, 112, 168, 4, Color.new(128, 128, 0, 255), Color.new(255, 255, 0, 255))
draw_meter(@actor.int, 999, 0, 142, 168, 4, Color.new(108, 0, 132, 255), Color.new(232, 0, 255, 255))
draw_meter(@actor.atk, 600, 190, 52, 168, 4, Color.new(128, 0, 0, 255), Color.new(255, 0, 0, 255))
draw_meter(@actor.pdef, 100, 190, 82, 168, 4, Color.new(0, 0, 128, 255), Color.new(0, 0, 255, 255))
draw_meter(@actor.mdef, 100, 190, 112, 168, 4, Color.new(132, 0, 108, 255), Color.new(255, 0, 232, 255))
draw_meter(@actor.now_exp.to_f, @actor.next_exp, 190, 142, 168, 4, Color.new(108, 132, 0, 255), Color.new(232, 255, 0, 255))
end
end
end
class Window_Character_Selection1 < Window_Selectable3
attr_accessor :commands
def initialize(commands)
super(0, 50, 640, 50)
self.contents = Bitmap.new(width - 32, height - 32)
@commands = commands
@width = width
if $game_party.actors.size < 2
@item_max = 1
@column_max = 1
else
@item_max = 2
@column_max =2
end
@commands = 2
self.visible = false
self.active = false
self.index = -1
self.z = 2000
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
if $game_party.actors.size < 2
self.contents.draw_text(180, -6, 144, 32, $game_party.actors[0].name, 2)
else
self.contents.draw_text(120, -6, 144, 32, $game_party.actors[0].name, 2)
self.contents.draw_text(240, -6, 144, 32, $game_party.actors[1].name, 2)
end
end
end
class Window_Graphic1 < Window_Base
def initialize
super(0, 0, 280, 200)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_actor_battler(actor, x + 130, y + 150)
end
end
class Window_Graphic2 < Window_Base
def initialize
super(0, 0, 280, 220)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
if $game_party.actors.size < 2
self.contents.clear
else
actor = $game_party.actors[1]
draw_actor_battler(actor, x + 130, y + 150)
end
end
end
class Window_SkillStatus < Window_Base
def initialize(actor)
super(0, 64, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
def refresh
self.contents.clear
draw_actor_name(@actor, 0, 0)
draw_actor_state(@actor, 150, 0)
draw_actor_hp2(@actor, 270, 0)
draw_actor_sp2(@actor, 440, 0)
end
end
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@update_frame = 0
@window_location = Window_Location.new
@window_location.x =270
@window_character_selection1 = Window_Character_Selection1.new(@commands)
@window_character_selection1.y = 50
@window_character_selection2 = Window_Character_Selection2 .new
@window_character1_graphic = Window_GraphicCharacter1.new
@window_character1_graphic.y =100
@window_character1_graphic.opacity = 0
@window_character1_graphic.back_opacity = 0
@window_character2_graphic = Window_GraphicCharacter2.new
@window_character2_graphic.y =280
@window_character2_graphic.opacity = 0
@window_character2_graphic.back_opacity = 0
@window_character1 = Window_Character1.new
@window_character1.y =100
@window_character2 = Window_Character2.new
@window_character2.y =280
@window_status_character1 = Window_StatusCharacter1.new
@window_status_character1.x =200
@window_status_character1.y =100
@window_status_character2 = Window_StatusCharacter2.new
@window_status_character2.x =200
@window_status_character2.y =280
@graphic1 = Window_Graphic1.new
@graphic1.x = 240
@graphic1.y = 92
@graphic1.z = 501
@graphic1.opacity = 0
@graphic1.back_opacity = 0
@graphic1.contents_opacity = 100
@graphic2 = Window_Graphic2.new
@graphic2.x = 240
@graphic2.y = 272
@graphic2.z = 501
@graphic2.opacity = 0
@graphic2.back_opacity = 0
@graphic2.contents_opacity = 100
@command_window = Window_Command2.new(["Items", "Skills", "Equip", "Quest", "Save", "Quit"])
@command_window.index = @menu_index
@dummy_window = Dummy_Window_Command.new
@dummy_window.z = 500
@dummy_window.opacity = 0
@dummy_window.back_opacity = 0
@dummy_window_icons = Dummy_Window_Command2.new
@dummy_window_icons.opacity = 0
@dummy_window_icons.back_opacity = 0
@dummy_window_icons.contents_opacity = 100
Graphics.transition
loop do
Graphics.update
Input.update
@update_frame += 1
if @update_frame == 5
@update_frame = 0
end
update
if $scene != self
break
end
end
Graphics.freeze
@window_location.dispose
@window_character1.dispose
@window_status_character1.dispose
@window_character2.dispose
@window_status_character2.dispose
@command_window.dispose
@graphic1.dispose
@graphic2.dispose
@dummy_window.dispose
@dummy_window_icons.dispose
@window_character1_graphic.dispose
@window_character2_graphic.dispose
@window_character_selection1.dispose
@window_character_selection2.dispose
end
def update
@command_window.update
@window_character_selection1.update
if @command_window.active
update_command
return
end
if @window_character_selection1.active
update_character
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@window_character_selection1.visible = true
@window_character_selection2.visible = true
@window_character_selection1.active = true
@window_character_selection1.index = 0
@command_window.active = false
when 2
$game_system.se_play($data_system.decision_se)
@window_character_selection1.visible = true
@window_character_selection1.active = true
@window_character_selection2.visible = true
@window_character_selection1.index = 0
@command_window.active = false
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Missionmenu.new
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
def update_character
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@window_character_selection1.visible = false
@window_character_selection1.active = false
@window_character_selection2.visible = false
@window_character_selection1.index = -1
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 1
$game_system.se_play($data_system.decision_se)
case @window_character_selection1.index
when 0
$scene = Scene_Skill.new(@window_character_selection1.index)
when 1
$scene = Scene_Skill.new(@window_character_selection1.index)
end
when 2
$game_system.se_play($data_system.decision_se)
case @window_character_selection1.index
when 0
$scene = Scene_Equip.new(@window_character_selection1.index)
when 1
$scene = Scene_Equip.new(@window_character_selection1.index)
end
end
return
end
end
end