赞 2
VIP 0
好人卡 0
积分 8
经验 1035
最后登录 2024-9-14
在线时间 83 小时
Lv2.观梦者
梦石 0
星屑 799
在线时间 83 小时
注册时间 2012-2-26
帖子 62
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
菜单用的steam上的:
| PHLiM2'sMenuModsACE 1.21
其中:
|► WINDOWS
class Game_Map
def name
$map_infos = load_data( "Data/MapInfos.rvdata2" )
for key in $map_infos .keys
$map_infos [ key] = $map_infos [ key] .name
end
$map_infos [ @map_id]
end
end
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# * Get Maximum Number of Battle Members
#--------------------------------------------------------------------------
def max_battle_members
return PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
end
end
#================================================================================#
# ♦ Custom Window Base ♦ #
#================================================================================#
# This section accesses the main Window_Base, and contains some new definitions. #
#================================================================================#
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Gauge
#--------------------------------------------------------------------------
def draw_gauge( x, y, width, rate, color1, color2)
fill_w = ( width * rate) .to_i
gauge_y = y + line_height - 12
border_a = Color.new ( 0 ,0 ,0 )
border_b = Color.new ( 255 ,255 ,255 )
contents.fill_rect ( x, gauge_y, width, PHLiM2::WINDOWS::G_HEIGHT , border_a)
contents.fill_rect ( x+1 , gauge_y+1 , width-2 , PHLiM2::WINDOWS::G_HEIGHT - 2 , border_b)
contents.fill_rect ( x+2 , gauge_y+2 , width-4 , PHLiM2::WINDOWS::G_HEIGHT - 4 , border_a)
contents.fill_rect ( x+3 , gauge_y+3 , width-6 , PHLiM2::WINDOWS::G_HEIGHT - 6 , gauge_back_color)
contents.gradient_fill_rect ( x+3 , gauge_y+3 , fill_w-6 , PHLiM2::WINDOWS::G_HEIGHT - 6 , color1, color2)
end
#--------------------------------------------------------------------------
# * Draw Text with Icon
#--------------------------------------------------------------------------
def draw_text_icon( x, y, width, height, text, icon_id)
reset_font_settings
contents.font .size = 24
text = convert_escape_characters( text)
pos = { :x => x + 32 , :y => y, :new_x => x, :height => calc_line_height( text) }
draw_icon( icon_id, x + 4 , y)
process_character( text.slice !( 0 , 1 ) , text, pos) until text.empty ?
end
#--------------------------------------------------------------------------
# * Draw Name
#--------------------------------------------------------------------------
def draw_actor_name( actor, x, y, width = 112 , alignment = 0 )
change_color( hp_color( actor) )
draw_text( x, y, width, line_height, actor.name , alignment)
end
#--------------------------------------------------------------------------
# * Draw Face Graphic
# enabled : Enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_face( face_name, face_index, x, y, enabled = true ,width=96 ,height=96 )
bitmap = Cache.face ( face_name)
rect = Rect.new ( face_index % 4 * 96 , face_index / 4 * 96 , width, height)
contents.blt ( x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
#--------------------------------------------------------------------------
# * Draw Actor Face Graphic
#--------------------------------------------------------------------------
def draw_actor_face( actor, x, y, enabled = true ,width=96 ,height=96 )
draw_face( actor.face_name , actor.face_index , x, y, enabled,width,height)
end
#--------------------------------------------------------------------------
# * Draw Face Graphic
# enabled : Enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_menuface( face_name, face_index, x, y, enabled = true ,width=96 ,height=96 )
bitmap = Cache.face ( "Full_" +face_name)
rect = Rect.new ( face_index % 4 * 96 , face_index / 4 * PHLiM2::WINDOWS::FACE_HEIGHT , width, height)
contents.blt ( x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
#--------------------------------------------------------------------------
# * Draw Actor Face Graphic
#--------------------------------------------------------------------------
def draw_actor_menuface( actor, x, y, enabled = true ,width=96 ,height=PHLiM2::WINDOWS::FACE_HEIGHT )
draw_menuface( actor.face_name , actor.face_index , x, y, enabled,width,height)
end
end
#--------------------------------------------------------------------------
# * Draw Level Full
#--------------------------------------------------------------------------
def draw_actor_level_full( actor, x, y, width = 96 )
change_color( system_color)
draw_text( x, y, width, line_height, Vocab::level)
change_color( normal_color)
actorlevel = sprintf ( "%02d" ,actor.level )
draw_text( x, y, width, line_height, actorlevel, 2 )
end
class Window_Details < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super ( 0 , 0 , window_width, fitting_height( line_number) )
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
self .opacity = 0
end
refresh
end
def line_number
@line_count = 0
if PHLiM2::MAIN_MENU::SHOW_STEPS
@line_count += 1
end
if PHLiM2::MAIN_MENU::SHOW_GOLD
@line_count += 1
end
if PHLiM2::MAIN_MENU::SHOW_TIME
@line_count += 1
end
return @line_count
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
return 192
else
return 160
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
update
end
#--------------------------------------------------------------------------
# * Get Party Gold
#--------------------------------------------------------------------------
def value
$game_party .gold
end
#--------------------------------------------------------------------------
# Get Currency Unit
#--------------------------------------------------------------------------
def currency_unit
Vocab::currency_unit
end
#--------------------------------------------------------------------------
# * Draw Number (Gold Etc.) with Currency Unit
#--------------------------------------------------------------------------
def draw_currency_value( value, unit, x, y, width)
cx = text_size( unit) .width
if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
draw_text_icon( x, y, width, line_height, value, PHLiM2::MAIN_MENU::GOLD_ICON_ID )
else
change_color( system_color)
draw_text( x+8 , y, width, line_height, unit, 2 )
change_color( normal_color)
draw_text( x+8 , y, width - cx - 2 , line_height, value, 2 )
end
end
#--------------------------------------------------------------------------
# * Update Window
#--------------------------------------------------------------------------
def update
contents.clear
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
for i in 0 ..line_number
draw_text_bg_rect( line_height * i)
end
end
# Show Gold
if PHLiM2::MAIN_MENU::SHOW_GOLD
draw_currency_value( value, currency_unit, 0 , line_height * gold_adjust, contents.width - 8 )
end
if PHLiM2::MAIN_MENU::SHOW_STEPS
@steps = $game_party .steps
if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
draw_text_icon( 0 , line_height * steps_adjust,contents.width - 8 ,line_height, @steps , PHLiM2::MAIN_MENU::STEPS_ICON_ID )
else
contents.font .color = system_color
draw_text( 8 ,line_height * steps_adjust, contents.width - 8 ,line_height, "STEPS" )
contents.font .color = normal_color
draw_text( 0 ,line_height * steps_adjust, contents.width ,line_height, @steps ,2 )
end
end
# Show Time
if PHLiM2::MAIN_MENU::SHOW_TIME
time = Graphics.frame_count / Graphics.frame_rate
msec = Graphics.frame_count % Graphics.frame_rate * 1.6667
sec = time % 60
min = time / 60 % 60
hour = time / 60 / 60
if PHLiM2::MAIN_MENU::BLINK_MARKERS
if msec >= 50
marker = " "
else
marker = ":"
end
else
marker = ":"
end
time_text = sprintf ( "%02d" +marker+"%02d" +marker+"%02d" ,hour,min,sec)
if PHLiM2::MAIN_MENU::SHOW_MS
time_text_ms = sprintf ( "\\ }.%02d\\ {" ,msec)
else
time_text_ms = ""
end
if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
draw_text_icon( 0 , line_height*time_adjust, contents.width , line_height, time_text+time_text_ms, PHLiM2::MAIN_MENU::TIME_ICON_ID )
else
change_color( normal_color)
if PHLiM2::MAIN_MENU::SHOW_MS
draw_text_ex( 64 , line_height*time_adjust, time_text+time_text_ms)
else
draw_text_ex( 86 , line_height*time_adjust, time_text+time_text_ms)
end
end
end
end
#--------------------------------------------------------------------------
# * Line Adjustment
#--------------------------------------------------------------------------
def gold_adjust
if !PHLiM2::MAIN_MENU::SHOW_TIME and !PHLiM2::MAIN_MENU::SHOW_STEPS
return 0
elsif !PHLiM2::MAIN_MENU::SHOW_TIME or !PHLiM2::MAIN_MENU::SHOW_STEPS
return 1
else
return 2
end
end
def steps_adjust
if !PHLiM2::MAIN_MENU::SHOW_TIME and !PHLiM2::MAIN_MENU::SHOW_GOLD
return 0
elsif PHLiM2::MAIN_MENU::SHOW_TIME and PHLiM2::MAIN_MENU::SHOW_GOLD
return 1
elsif !PHLiM2::MAIN_MENU::SHOW_TIME and PHLiM2::MAIN_MENU::SHOW_GOLD
return 0
else
return 1
end
end
def time_adjust
return 0
end
#--------------------------------------------------------------------------
# * Draw_BG_Rect
#--------------------------------------------------------------------------
def draw_text_bg_rect( y)
bg_rect = Rect.new ( 0 ,y + 4 ,contents.width , 16 )
bg_rect_c1 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O1 )
bg_rect_c2 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O2 )
if PHLiM2::MAIN_MENU::MENU_FLIP
contents.gradient_fill_rect ( bg_rect,bg_rect_c2,bg_rect_c1)
else
contents.gradient_fill_rect ( bg_rect,bg_rect_c1,bg_rect_c2)
end
end
end
#================================================================================#
# ♦ Location Window ♦ #
#================================================================================#
class Window_Location < Window_Base
def initialize
super ( 0 , 0 , window_width, fitting_height( 2 ) )
update
end
def window_width
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
Graphics.width - 192
else
Graphics.width - 160
end
end
def update
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
loc_bg_rect = Rect.new ( 0 , 4 , contents.width , line_height * 2 - 8 )
loc_bg_c1 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O1 )
loc_bg_c2 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O2 )
if PHLiM2::MAIN_MENU::MENU_FLIP
contents.gradient_fill_rect ( loc_bg_rect,loc_bg_c1,loc_bg_c2)
else
contents.gradient_fill_rect ( loc_bg_rect,loc_bg_c2,loc_bg_c1)
end
end
case PHLiM2::MAIN_MENU::DISPLAY_MAP_NAME_TYPE
when 0
@map_name = sprintf ( $game_map.name )
when 1
@map_name = sprintf ( $game_map.display_name )
when 2
@map_name = sprintf ( $game_map.name )
@map_name2 =sprintf ( $game_map.display_name )
end
if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
if PHLiM2::MAIN_MENU::DISPLAY_MAP_NAME_TYPE <= 1
draw_text_icon( 4 , line_height * 0.5 ,contents.width ,contents.height ,"\\ }" +@map_name,PHLiM2::MAIN_MENU::LOC_ICON_ID )
else
draw_text_icon( 4 , line_height * 0.5 ,contents.width ,contents.height ,"" ,PHLiM2::MAIN_MENU::LOC_ICON_ID )
draw_text_ex( 36 ,0 ,"\\ }" +@map_name+"\n " +@map_name2)
end
else
if PHLiM2::MAIN_MENU::DISPLAY_MAP_NAME_TYPE <= 1
draw_text_ex( 4 , line_height * 0.5 ,"\\ c[16]LOCATION: \\ }\\ c[0]" +@map_name)
else
draw_text_ex( 4 , line_height * 0.5 ,"\\ c[16]LOCATION: \\ c[0]" )
draw_text_ex( 100 ,0 ,"\\ }" +@map_name+"\n " +@map_name2)
end
end
end
end
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
# This command window appears on the menu screen.
#==============================================================================
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# * Initialize Command Selection Position (Class Method)
#--------------------------------------------------------------------------
def self .init_command_position
@@last_command_symbol = nil
end
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super ( 0 , 0 )
select_last
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
return 192
else
return 160
end
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
item_max
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_main_commands
add_formation_command
add_original_commands
add_save_command
add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Main Commands to List
#--------------------------------------------------------------------------
def add_main_commands
add_command( Vocab::item, :item , main_commands_enabled,PHLiM2::MAIN_MENU::ITEMS_ICON_ID )
add_command( Vocab::skill, :skill , main_commands_enabled,PHLiM2::MAIN_MENU::SKILL_ICON_ID )
add_command( Vocab::equip, :equip , main_commands_enabled,PHLiM2::MAIN_MENU::EQUIP_ICON_ID )
add_command( Vocab::status, :status , main_commands_enabled,PHLiM2::MAIN_MENU::STATS_ICON_ID )
end
#--------------------------------------------------------------------------
# * Add Formation to Command List
#--------------------------------------------------------------------------
def add_formation_command
add_command( Vocab::formation, :formation , formation_enabled,PHLiM2::MAIN_MENU::FORM_ICON_ID )
end
#--------------------------------------------------------------------------
# * For Adding Original Commands
#--------------------------------------------------------------------------
def add_original_commands
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command( Vocab::save, :save , save_enabled,PHLiM2::MAIN_MENU::SAVE_ICON_ID )
end
#--------------------------------------------------------------------------
# * Add Exit Game to Command List
#--------------------------------------------------------------------------
def add_game_end_command
add_command( Vocab::game_end, :game_end ,PHLiM2::MAIN_MENU::QUIT_ICON_ID )
end
#--------------------------------------------------------------------------
# * Get Activation State of Main Commands
#--------------------------------------------------------------------------
def main_commands_enabled
$game_party .exists
end
#--------------------------------------------------------------------------
# * Get Activation State of Formation
#--------------------------------------------------------------------------
def formation_enabled
$game_party .members .size >= 2 && !$game_system.formation_disabled
end
#--------------------------------------------------------------------------
# * Get Activation State of Save
#--------------------------------------------------------------------------
def save_enabled
!$game_system.save_disabled
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
@@last_command_symbol = current_symbol
super
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select_symbol( @@last_command_symbol)
end
#--------------------------------------------------------------------------
# * Add Command
# name : Command name
# symbol : Corresponding symbol
# enabled : Activation state flag
# icon_id : Icon ID of the command
# ext : Arbitrary extended data
#--------------------------------------------------------------------------
def add_command( name, symbol, enabled = true , icon_id = PHLiM2::MAIN_MENU::QUIT_ICON_ID , ext = nil )
@list .push ( { :name=>name, :symbol =>symbol, :enabled =>enabled, :icon_id =>icon_id, :ext =>ext} )
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item( index)
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
draw_command_rect( line_height*index)
end
change_color( normal_color, command_enabled?( index) )
if PHLiM2::MAIN_MENU::SHOW_COMMAND_ICONS
draw_icon( icon_id( index) ,4 ,line_height*index)
draw_text2( 32 , line_height * index, contents.width , line_height, command_name( index) , alignment)
else
draw_text( item_rect_for_text( index) , command_name( index) , alignment)
end
end
def draw_text2( x, y, width,height, text, alignment = 0 )
contents.draw_text ( x,y, width,height, text)
end
def draw_command_rect( y)
com_rect = Rect.new ( 0 ,y+4 ,contents.width ,16 )
com_rect_c1 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O1 )
com_rect_c2 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O2 )
if PHLiM2::MAIN_MENU::MENU_FLIP
contents.gradient_fill_rect ( com_rect,com_rect_c2,com_rect_c1)
else
contents.gradient_fill_rect ( com_rect,com_rect_c1,com_rect_c2)
end
end
#--------------------------------------------------------------------------
# * Get Command Name
#--------------------------------------------------------------------------
def command_name( index)
@list [ index] [ :name ]
end
def icon_id( index)
@list [ index] [ :icon_id ]
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus2 < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pending_index # Pending position (for formation)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize( x, y)
super ( x, y, window_width, window_height)
@pending_index = -1
self .opacity = 0
refresh
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
Graphics.width - 160
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
if PHLiM2::MAIN_MENU::SHOW_LOCATION_WINDOW
Graphics.height - fitting_height( 2 )
else
Graphics.height
end
end
#--------------------------------------------------------------------------
# * Get Number of Columns
#--------------------------------------------------------------------------
def col_max
if PHLiM2::MAIN_MENU::SHOW_ALL_ACTIVE
return PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
else
return 4
end
end
#--------------------------------------------------------------------------
# * Get Number of Rows
#--------------------------------------------------------------------------
def row_max
return 1
end
#--------------------------------------------------------------------------
# * Get Item Spacing
#--------------------------------------------------------------------------
def spacing
return 0
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
if PHLiM2::MAIN_MENU::SHOW_ALL_ACTIVE && PHLiM2::MAIN_MENU::LOCK_ACTIVE && $game_party .members .size >= PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
return PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
else
$game_party .members .size
end
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
( height - standard_padding * 2 )
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item( index)
actor = $game_party .members [ index]
enabled = $game_party .battle_members .include ?( actor)
rect = item_rect( index)
draw_actor_bg( rect.x + 1 ,rect.y + 1 ,rect.width -2 ,actor)
draw_item_background( index,actor)
draw_actor_name_bg( rect.x + 1 ,rect.y + 1 ,rect.width -2 ,actor)
if rect.width >= 96
face_size = 96
else
face_size = rect.width - 8
end
if PHLiM2::WINDOWS::USE_A_HEIGHT
face_size_v = rect.height - PHLiM2::WINDOWS::FACE_HEIGHT / 3
if face_size_v >= PHLiM2::WINDOWS::FACE_HEIGHT
face_size_v = PHLiM2::WINDOWS::FACE_HEIGHT
end
draw_actor_menuface( actor, rect.x + ( rect.width - face_size) / 2 , rect.y + line_height * 3 - 4 , enabled,face_size,face_size_v)
else
draw_actor_face( actor, rect.x + ( rect.width - face_size) / 2 , rect.y + line_height * 3 + 2 , enabled,face_size)
end
contents.font .size = 20
draw_actor_name( actor, rect.x + 1 , rect.y + 1 ,rect.width -2 , 1 )
contents.font .size = Font.default_size
face_height = PHLiM2::WINDOWS::FACE_HEIGHT
draw_actor_icons( actor, rect.x + ( rect.width - face_size) / 2 + 1 , rect.y + line_height * 3 - 4 )
make_font_smaller
draw_actor_level_full( actor, rect.x + ( rect.width - face_size) / 2 + 1 , rect.y + 1 + ( line_height * 1 ) ,face_size)
draw_text( rect.x + 1 , rect.y + 1 + ( line_height * 2 ) - 8 ,rect.width -2 ,line_height,actor.class .name ,1 )
draw_actor_hp( actor, rect.x + ( rect.width - ( face_size+4 ) ) / 2 , rect.height - line_height * 3 , face_size+4 )
draw_actor_mp( actor, rect.x + ( rect.width - ( face_size+4 ) ) / 2 , rect.height - line_height * 2 , face_size+4 )
make_font_bigger
end
#--------------------------------------------------------------------------
# * Draw Background for Actor
#--------------------------------------------------------------------------
def draw_actor_bg( x,y,width,actor)
actbg = Rect.new ( x, y,width,contents.height -2 )
@actbg_c1 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O1 )
@actbg_c2 = hp_color( actor)
contents.gradient_fill_rect ( actbg,@actbg_c1,@actbg_c2,true )
end
#--------------------------------------------------------------------------
# * Draw Background for Name
#--------------------------------------------------------------------------
def draw_actor_name_bg( x,y,width,actor)
actnamebg = Rect.new ( x, y,width,line_height*3 - 8 )
actnamebg_c = @actbg_c1
contents.fill_rect ( actnamebg,actnamebg_c)
end
#--------------------------------------------------------------------------
# * Draw Background for Item
#--------------------------------------------------------------------------
def draw_item_background( index,actor)
if index == @pending_index
contents.gradient_fill_rect ( item_rect( index) .x + 1 ,item_rect( index) .y + 1 ,item_rect( index) .width -2 ,contents.height -2 , pending_color,@actbg_c2,true )
end
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
super
$game_party .menu_actor = $game_party .members [ index]
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select ( $game_party.menu_actor .index || 0 )
end
#--------------------------------------------------------------------------
# * Set Pending Position (for Formation)
#--------------------------------------------------------------------------
def pending_index=( index)
last_pending_index = @pending_index
@pending_index = index
redraw_item( @pending_index)
redraw_item( last_pending_index)
end
def contents_width
item_max * item_width
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
return 1
end
#--------------------------------------------------------------------------
# * Calculate Height of Window Contents
#--------------------------------------------------------------------------
def contents_height
item_height
end
#--------------------------------------------------------------------------
# * Get Leading Digits
#--------------------------------------------------------------------------
def top_col
ox / ( item_width + spacing)
end
#--------------------------------------------------------------------------
# * Set Leading Digits
#--------------------------------------------------------------------------
def top_col=( col)
col = 0 if col < 0
#col = col_max - 1 if col > col_max - 1
self .ox = col * ( item_width + spacing)
end
#--------------------------------------------------------------------------
# * Get Trailing Digits
#--------------------------------------------------------------------------
def bottom_col
top_col + col_max - 1
end
#--------------------------------------------------------------------------
# * Set Trailing Digits
#--------------------------------------------------------------------------
def bottom_col=( col)
self .top_col = col - ( col_max - 1 )
end
#--------------------------------------------------------------------------
# * Scroll Cursor to Position Within Screen
#--------------------------------------------------------------------------
def ensure_cursor_visible
self .top_col = index if index < top_col
self .bottom_col = index if index > bottom_col
end
#--------------------------------------------------------------------------
# * Get Rectangle for Displaying Items
#--------------------------------------------------------------------------
def item_rect( index)
rect = super
rect.x = index * ( item_width + spacing)
rect.y = 0
rect
end
#--------------------------------------------------------------------------
# * Get Alignment
#--------------------------------------------------------------------------
def alignment
return 1
end
#--------------------------------------------------------------------------
# * Move Cursor Down
#--------------------------------------------------------------------------
def cursor_down( wrap = false )
end
#--------------------------------------------------------------------------
# * Move Cursor Up
#--------------------------------------------------------------------------
def cursor_up( wrap = false )
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Down
#--------------------------------------------------------------------------
def cursor_pagedown
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Up
#--------------------------------------------------------------------------
def cursor_pageup
end
end
#==============================================================================
# ** Window_Formation
#------------------------------------------------------------------------------
# This window is the alternative to the formation system for RMVXAce.
#==============================================================================
class Window_FormBG < Window_Base
def initialize( x,y)
super ( x-16 ,y-16 ,Graphics.width + 32 , Graphics.height + 32 )
self .opacity = 0
@bg_opacity = 192
end
def banner( y)
contents.clear
fill_bg
contents.font .color = system_color
contents.font .size = 24
draw_text( 0 ,y,contents.width ,24 ,Vocab::formation,1 )
end
def fill_bg
blackbg = Color.new ( 0 ,0 ,0 ,@bg_opacity)
contents.fill_rect ( 0 ,0 ,contents.width ,contents.height ,blackbg)
end
def clear
contents.clear
end
end
class Window_FormMenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pending_index # Pending position (for formation)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize( x, y)
super ( x, y, window_width, window_height)
@pending_index = -1
refresh
self .openness = 0
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return ( ( 84 + 2 ) * 5 ) + 24
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
if $game_party .members .size >= 7 and $game_party .members .size <= 12
return ( ( 120 + 2 ) * 2 ) + 24
elsif $game_party .members .size >= 13
return ( ( 120 + 2 ) * 3 ) + 24
else
return ( 120 + 2 ) + 24
end
end
def col_max
return 5
end
def spacing
return 0
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
$game_party .members .size
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
if $game_party .members .size >= ( col_max + 1 )
120
else
120
end
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item( index)
actor = $game_party .members [ index]
enabled = $game_party .battle_members .include ?( actor)
rect = item_rect( index)
if index <= ( PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE - 1 )
new_c = Color.new ( 32 ,128 ,196 ,128 )
contents.fill_rect ( rect.x +1 ,rect.y +1 ,84 ,118 ,new_c)
end
draw_item_background( index)
draw_actor_face( actor, rect.x + 1 , rect.y + 1 ,enabled,84 )
make_font_smaller
draw_actor_name( actor, rect.x + 1 , rect.y + ( line_height * 4 ) ,84 ,1 )
make_font_bigger
end
#--------------------------------------------------------------------------
# * Draw Background for Item
#--------------------------------------------------------------------------
def draw_item_background( index)
if index == @pending_index
pending = Color.new ( 255 ,255 ,255 ,128 )
contents.fill_rect ( item_rect( index) .x +1 ,item_rect( index) .y +1 ,84 ,118 , pending) #pending_color)
end
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
super
$game_party .menu_actor = $game_party .members [ index]
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select ( $game_party.menu_actor .index || 0 )
end
#--------------------------------------------------------------------------
# * Set Pending Position (for Formation)
#--------------------------------------------------------------------------
def pending_index=( index)
last_pending_index = @pending_index
@pending_index = index
redraw_item( @pending_index)
redraw_item( last_pending_index)
end
end
class Game_Map
def name
$map_infos = load_data( "Data/MapInfos.rvdata2" )
for key in $map_infos .keys
$map_infos [ key] = $map_infos [ key] .name
end
$map_infos [ @map_id]
end
end
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# * Get Maximum Number of Battle Members
#--------------------------------------------------------------------------
def max_battle_members
return PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
end
end
#================================================================================#
# ♦ Custom Window Base ♦ #
#================================================================================#
# This section accesses the main Window_Base, and contains some new definitions. #
#================================================================================#
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Gauge
#--------------------------------------------------------------------------
def draw_gauge( x, y, width, rate, color1, color2)
fill_w = ( width * rate) .to_i
gauge_y = y + line_height - 12
border_a = Color.new ( 0 ,0 ,0 )
border_b = Color.new ( 255 ,255 ,255 )
contents.fill_rect ( x, gauge_y, width, PHLiM2::WINDOWS::G_HEIGHT , border_a)
contents.fill_rect ( x+1 , gauge_y+1 , width-2 , PHLiM2::WINDOWS::G_HEIGHT - 2 , border_b)
contents.fill_rect ( x+2 , gauge_y+2 , width-4 , PHLiM2::WINDOWS::G_HEIGHT - 4 , border_a)
contents.fill_rect ( x+3 , gauge_y+3 , width-6 , PHLiM2::WINDOWS::G_HEIGHT - 6 , gauge_back_color)
contents.gradient_fill_rect ( x+3 , gauge_y+3 , fill_w-6 , PHLiM2::WINDOWS::G_HEIGHT - 6 , color1, color2)
end
#--------------------------------------------------------------------------
# * Draw Text with Icon
#--------------------------------------------------------------------------
def draw_text_icon( x, y, width, height, text, icon_id)
reset_font_settings
contents.font .size = 24
text = convert_escape_characters( text)
pos = { :x => x + 32 , :y => y, :new_x => x, :height => calc_line_height( text) }
draw_icon( icon_id, x + 4 , y)
process_character( text.slice !( 0 , 1 ) , text, pos) until text.empty ?
end
#--------------------------------------------------------------------------
# * Draw Name
#--------------------------------------------------------------------------
def draw_actor_name( actor, x, y, width = 112 , alignment = 0 )
change_color( hp_color( actor) )
draw_text( x, y, width, line_height, actor.name , alignment)
end
#--------------------------------------------------------------------------
# * Draw Face Graphic
# enabled : Enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_face( face_name, face_index, x, y, enabled = true ,width=96 ,height=96 )
bitmap = Cache.face ( face_name)
rect = Rect.new ( face_index % 4 * 96 , face_index / 4 * 96 , width, height)
contents.blt ( x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
#--------------------------------------------------------------------------
# * Draw Actor Face Graphic
#--------------------------------------------------------------------------
def draw_actor_face( actor, x, y, enabled = true ,width=96 ,height=96 )
draw_face( actor.face_name , actor.face_index , x, y, enabled,width,height)
end
#--------------------------------------------------------------------------
# * Draw Face Graphic
# enabled : Enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_menuface( face_name, face_index, x, y, enabled = true ,width=96 ,height=96 )
bitmap = Cache.face ( "Full_" +face_name)
rect = Rect.new ( face_index % 4 * 96 , face_index / 4 * PHLiM2::WINDOWS::FACE_HEIGHT , width, height)
contents.blt ( x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
#--------------------------------------------------------------------------
# * Draw Actor Face Graphic
#--------------------------------------------------------------------------
def draw_actor_menuface( actor, x, y, enabled = true ,width=96 ,height=PHLiM2::WINDOWS::FACE_HEIGHT )
draw_menuface( actor.face_name , actor.face_index , x, y, enabled,width,height)
end
end
#--------------------------------------------------------------------------
# * Draw Level Full
#--------------------------------------------------------------------------
def draw_actor_level_full( actor, x, y, width = 96 )
change_color( system_color)
draw_text( x, y, width, line_height, Vocab::level)
change_color( normal_color)
actorlevel = sprintf ( "%02d" ,actor.level )
draw_text( x, y, width, line_height, actorlevel, 2 )
end
class Window_Details < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super ( 0 , 0 , window_width, fitting_height( line_number) )
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
self .opacity = 0
end
refresh
end
def line_number
@line_count = 0
if PHLiM2::MAIN_MENU::SHOW_STEPS
@line_count += 1
end
if PHLiM2::MAIN_MENU::SHOW_GOLD
@line_count += 1
end
if PHLiM2::MAIN_MENU::SHOW_TIME
@line_count += 1
end
return @line_count
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
return 192
else
return 160
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
update
end
#--------------------------------------------------------------------------
# * Get Party Gold
#--------------------------------------------------------------------------
def value
$game_party .gold
end
#--------------------------------------------------------------------------
# Get Currency Unit
#--------------------------------------------------------------------------
def currency_unit
Vocab::currency_unit
end
#--------------------------------------------------------------------------
# * Draw Number (Gold Etc.) with Currency Unit
#--------------------------------------------------------------------------
def draw_currency_value( value, unit, x, y, width)
cx = text_size( unit) .width
if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
draw_text_icon( x, y, width, line_height, value, PHLiM2::MAIN_MENU::GOLD_ICON_ID )
else
change_color( system_color)
draw_text( x+8 , y, width, line_height, unit, 2 )
change_color( normal_color)
draw_text( x+8 , y, width - cx - 2 , line_height, value, 2 )
end
end
#--------------------------------------------------------------------------
# * Update Window
#--------------------------------------------------------------------------
def update
contents.clear
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
for i in 0 ..line_number
draw_text_bg_rect( line_height * i)
end
end
# Show Gold
if PHLiM2::MAIN_MENU::SHOW_GOLD
draw_currency_value( value, currency_unit, 0 , line_height * gold_adjust, contents.width - 8 )
end
if PHLiM2::MAIN_MENU::SHOW_STEPS
@steps = $game_party .steps
if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
draw_text_icon( 0 , line_height * steps_adjust,contents.width - 8 ,line_height, @steps , PHLiM2::MAIN_MENU::STEPS_ICON_ID )
else
contents.font .color = system_color
draw_text( 8 ,line_height * steps_adjust, contents.width - 8 ,line_height, "STEPS" )
contents.font .color = normal_color
draw_text( 0 ,line_height * steps_adjust, contents.width ,line_height, @steps ,2 )
end
end
# Show Time
if PHLiM2::MAIN_MENU::SHOW_TIME
time = Graphics.frame_count / Graphics.frame_rate
msec = Graphics.frame_count % Graphics.frame_rate * 1.6667
sec = time % 60
min = time / 60 % 60
hour = time / 60 / 60
if PHLiM2::MAIN_MENU::BLINK_MARKERS
if msec >= 50
marker = " "
else
marker = ":"
end
else
marker = ":"
end
time_text = sprintf ( "%02d" +marker+"%02d" +marker+"%02d" ,hour,min,sec)
if PHLiM2::MAIN_MENU::SHOW_MS
time_text_ms = sprintf ( "\\ }.%02d\\ {" ,msec)
else
time_text_ms = ""
end
if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
draw_text_icon( 0 , line_height*time_adjust, contents.width , line_height, time_text+time_text_ms, PHLiM2::MAIN_MENU::TIME_ICON_ID )
else
change_color( normal_color)
if PHLiM2::MAIN_MENU::SHOW_MS
draw_text_ex( 64 , line_height*time_adjust, time_text+time_text_ms)
else
draw_text_ex( 86 , line_height*time_adjust, time_text+time_text_ms)
end
end
end
end
#--------------------------------------------------------------------------
# * Line Adjustment
#--------------------------------------------------------------------------
def gold_adjust
if !PHLiM2::MAIN_MENU::SHOW_TIME and !PHLiM2::MAIN_MENU::SHOW_STEPS
return 0
elsif !PHLiM2::MAIN_MENU::SHOW_TIME or !PHLiM2::MAIN_MENU::SHOW_STEPS
return 1
else
return 2
end
end
def steps_adjust
if !PHLiM2::MAIN_MENU::SHOW_TIME and !PHLiM2::MAIN_MENU::SHOW_GOLD
return 0
elsif PHLiM2::MAIN_MENU::SHOW_TIME and PHLiM2::MAIN_MENU::SHOW_GOLD
return 1
elsif !PHLiM2::MAIN_MENU::SHOW_TIME and PHLiM2::MAIN_MENU::SHOW_GOLD
return 0
else
return 1
end
end
def time_adjust
return 0
end
#--------------------------------------------------------------------------
# * Draw_BG_Rect
#--------------------------------------------------------------------------
def draw_text_bg_rect( y)
bg_rect = Rect.new ( 0 ,y + 4 ,contents.width , 16 )
bg_rect_c1 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O1 )
bg_rect_c2 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O2 )
if PHLiM2::MAIN_MENU::MENU_FLIP
contents.gradient_fill_rect ( bg_rect,bg_rect_c2,bg_rect_c1)
else
contents.gradient_fill_rect ( bg_rect,bg_rect_c1,bg_rect_c2)
end
end
end
#================================================================================#
# ♦ Location Window ♦ #
#================================================================================#
class Window_Location < Window_Base
def initialize
super ( 0 , 0 , window_width, fitting_height( 2 ) )
update
end
def window_width
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
Graphics.width - 192
else
Graphics.width - 160
end
end
def update
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
loc_bg_rect = Rect.new ( 0 , 4 , contents.width , line_height * 2 - 8 )
loc_bg_c1 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O1 )
loc_bg_c2 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O2 )
if PHLiM2::MAIN_MENU::MENU_FLIP
contents.gradient_fill_rect ( loc_bg_rect,loc_bg_c1,loc_bg_c2)
else
contents.gradient_fill_rect ( loc_bg_rect,loc_bg_c2,loc_bg_c1)
end
end
case PHLiM2::MAIN_MENU::DISPLAY_MAP_NAME_TYPE
when 0
@map_name = sprintf ( $game_map.name )
when 1
@map_name = sprintf ( $game_map.display_name )
when 2
@map_name = sprintf ( $game_map.name )
@map_name2 =sprintf ( $game_map.display_name )
end
if PHLiM2::MAIN_MENU::SHOW_WINDOW_ICONS
if PHLiM2::MAIN_MENU::DISPLAY_MAP_NAME_TYPE <= 1
draw_text_icon( 4 , line_height * 0.5 ,contents.width ,contents.height ,"\\ }" +@map_name,PHLiM2::MAIN_MENU::LOC_ICON_ID )
else
draw_text_icon( 4 , line_height * 0.5 ,contents.width ,contents.height ,"" ,PHLiM2::MAIN_MENU::LOC_ICON_ID )
draw_text_ex( 36 ,0 ,"\\ }" +@map_name+"\n " +@map_name2)
end
else
if PHLiM2::MAIN_MENU::DISPLAY_MAP_NAME_TYPE <= 1
draw_text_ex( 4 , line_height * 0.5 ,"\\ c[16]LOCATION: \\ }\\ c[0]" +@map_name)
else
draw_text_ex( 4 , line_height * 0.5 ,"\\ c[16]LOCATION: \\ c[0]" )
draw_text_ex( 100 ,0 ,"\\ }" +@map_name+"\n " +@map_name2)
end
end
end
end
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
# This command window appears on the menu screen.
#==============================================================================
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# * Initialize Command Selection Position (Class Method)
#--------------------------------------------------------------------------
def self .init_command_position
@@last_command_symbol = nil
end
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super ( 0 , 0 )
select_last
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
return 192
else
return 160
end
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
item_max
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_main_commands
add_formation_command
add_original_commands
add_save_command
add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Main Commands to List
#--------------------------------------------------------------------------
def add_main_commands
add_command( Vocab::item, :item , main_commands_enabled,PHLiM2::MAIN_MENU::ITEMS_ICON_ID )
add_command( Vocab::skill, :skill , main_commands_enabled,PHLiM2::MAIN_MENU::SKILL_ICON_ID )
add_command( Vocab::equip, :equip , main_commands_enabled,PHLiM2::MAIN_MENU::EQUIP_ICON_ID )
add_command( Vocab::status, :status , main_commands_enabled,PHLiM2::MAIN_MENU::STATS_ICON_ID )
end
#--------------------------------------------------------------------------
# * Add Formation to Command List
#--------------------------------------------------------------------------
def add_formation_command
add_command( Vocab::formation, :formation , formation_enabled,PHLiM2::MAIN_MENU::FORM_ICON_ID )
end
#--------------------------------------------------------------------------
# * For Adding Original Commands
#--------------------------------------------------------------------------
def add_original_commands
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command( Vocab::save, :save , save_enabled,PHLiM2::MAIN_MENU::SAVE_ICON_ID )
end
#--------------------------------------------------------------------------
# * Add Exit Game to Command List
#--------------------------------------------------------------------------
def add_game_end_command
add_command( Vocab::game_end, :game_end ,PHLiM2::MAIN_MENU::QUIT_ICON_ID )
end
#--------------------------------------------------------------------------
# * Get Activation State of Main Commands
#--------------------------------------------------------------------------
def main_commands_enabled
$game_party .exists
end
#--------------------------------------------------------------------------
# * Get Activation State of Formation
#--------------------------------------------------------------------------
def formation_enabled
$game_party .members .size >= 2 && !$game_system.formation_disabled
end
#--------------------------------------------------------------------------
# * Get Activation State of Save
#--------------------------------------------------------------------------
def save_enabled
!$game_system.save_disabled
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
@@last_command_symbol = current_symbol
super
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select_symbol( @@last_command_symbol)
end
#--------------------------------------------------------------------------
# * Add Command
# name : Command name
# symbol : Corresponding symbol
# enabled : Activation state flag
# icon_id : Icon ID of the command
# ext : Arbitrary extended data
#--------------------------------------------------------------------------
def add_command( name, symbol, enabled = true , icon_id = PHLiM2::MAIN_MENU::QUIT_ICON_ID , ext = nil )
@list .push ( { :name=>name, :symbol =>symbol, :enabled =>enabled, :icon_id =>icon_id, :ext =>ext} )
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item( index)
if PHLiM2::MAIN_MENU::SHOW_BG_IMAGE or PHLiM2::MAIN_MENU::SHOW_BACKGROUND
draw_command_rect( line_height*index)
end
change_color( normal_color, command_enabled?( index) )
if PHLiM2::MAIN_MENU::SHOW_COMMAND_ICONS
draw_icon( icon_id( index) ,4 ,line_height*index)
draw_text2( 32 , line_height * index, contents.width , line_height, command_name( index) , alignment)
else
draw_text( item_rect_for_text( index) , command_name( index) , alignment)
end
end
def draw_text2( x, y, width,height, text, alignment = 0 )
contents.draw_text ( x,y, width,height, text)
end
def draw_command_rect( y)
com_rect = Rect.new ( 0 ,y+4 ,contents.width ,16 )
com_rect_c1 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O1 )
com_rect_c2 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O2 )
if PHLiM2::MAIN_MENU::MENU_FLIP
contents.gradient_fill_rect ( com_rect,com_rect_c2,com_rect_c1)
else
contents.gradient_fill_rect ( com_rect,com_rect_c1,com_rect_c2)
end
end
#--------------------------------------------------------------------------
# * Get Command Name
#--------------------------------------------------------------------------
def command_name( index)
@list [ index] [ :name ]
end
def icon_id( index)
@list [ index] [ :icon_id ]
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus2 < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pending_index # Pending position (for formation)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize( x, y)
super ( x, y, window_width, window_height)
@pending_index = -1
self .opacity = 0
refresh
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
Graphics.width - 160
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
if PHLiM2::MAIN_MENU::SHOW_LOCATION_WINDOW
Graphics.height - fitting_height( 2 )
else
Graphics.height
end
end
#--------------------------------------------------------------------------
# * Get Number of Columns
#--------------------------------------------------------------------------
def col_max
if PHLiM2::MAIN_MENU::SHOW_ALL_ACTIVE
return PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
else
return 4
end
end
#--------------------------------------------------------------------------
# * Get Number of Rows
#--------------------------------------------------------------------------
def row_max
return 1
end
#--------------------------------------------------------------------------
# * Get Item Spacing
#--------------------------------------------------------------------------
def spacing
return 0
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
if PHLiM2::MAIN_MENU::SHOW_ALL_ACTIVE && PHLiM2::MAIN_MENU::LOCK_ACTIVE && $game_party .members .size >= PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
return PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE
else
$game_party .members .size
end
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
( height - standard_padding * 2 )
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item( index)
actor = $game_party .members [ index]
enabled = $game_party .battle_members .include ?( actor)
rect = item_rect( index)
draw_actor_bg( rect.x + 1 ,rect.y + 1 ,rect.width -2 ,actor)
draw_item_background( index,actor)
draw_actor_name_bg( rect.x + 1 ,rect.y + 1 ,rect.width -2 ,actor)
if rect.width >= 96
face_size = 96
else
face_size = rect.width - 8
end
if PHLiM2::WINDOWS::USE_A_HEIGHT
face_size_v = rect.height - PHLiM2::WINDOWS::FACE_HEIGHT / 3
if face_size_v >= PHLiM2::WINDOWS::FACE_HEIGHT
face_size_v = PHLiM2::WINDOWS::FACE_HEIGHT
end
draw_actor_menuface( actor, rect.x + ( rect.width - face_size) / 2 , rect.y + line_height * 3 - 4 , enabled,face_size,face_size_v)
else
draw_actor_face( actor, rect.x + ( rect.width - face_size) / 2 , rect.y + line_height * 3 + 2 , enabled,face_size)
end
contents.font .size = 20
draw_actor_name( actor, rect.x + 1 , rect.y + 1 ,rect.width -2 , 1 )
contents.font .size = Font.default_size
face_height = PHLiM2::WINDOWS::FACE_HEIGHT
draw_actor_icons( actor, rect.x + ( rect.width - face_size) / 2 + 1 , rect.y + line_height * 3 - 4 )
make_font_smaller
draw_actor_level_full( actor, rect.x + ( rect.width - face_size) / 2 + 1 , rect.y + 1 + ( line_height * 1 ) ,face_size)
draw_text( rect.x + 1 , rect.y + 1 + ( line_height * 2 ) - 8 ,rect.width -2 ,line_height,actor.class .name ,1 )
draw_actor_hp( actor, rect.x + ( rect.width - ( face_size+4 ) ) / 2 , rect.height - line_height * 3 , face_size+4 )
draw_actor_mp( actor, rect.x + ( rect.width - ( face_size+4 ) ) / 2 , rect.height - line_height * 2 , face_size+4 )
make_font_bigger
end
#--------------------------------------------------------------------------
# * Draw Background for Actor
#--------------------------------------------------------------------------
def draw_actor_bg( x,y,width,actor)
actbg = Rect.new ( x, y,width,contents.height -2 )
@actbg_c1 = Color.new ( PHLiM2::WINDOWS::C_SCHEME_R ,PHLiM2::WINDOWS::C_SCHEME_G ,PHLiM2::WINDOWS::C_SCHEME_B ,PHLiM2::WINDOWS::C_SCHEME_O1 )
@actbg_c2 = hp_color( actor)
contents.gradient_fill_rect ( actbg,@actbg_c1,@actbg_c2,true )
end
#--------------------------------------------------------------------------
# * Draw Background for Name
#--------------------------------------------------------------------------
def draw_actor_name_bg( x,y,width,actor)
actnamebg = Rect.new ( x, y,width,line_height*3 - 8 )
actnamebg_c = @actbg_c1
contents.fill_rect ( actnamebg,actnamebg_c)
end
#--------------------------------------------------------------------------
# * Draw Background for Item
#--------------------------------------------------------------------------
def draw_item_background( index,actor)
if index == @pending_index
contents.gradient_fill_rect ( item_rect( index) .x + 1 ,item_rect( index) .y + 1 ,item_rect( index) .width -2 ,contents.height -2 , pending_color,@actbg_c2,true )
end
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
super
$game_party .menu_actor = $game_party .members [ index]
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select ( $game_party.menu_actor .index || 0 )
end
#--------------------------------------------------------------------------
# * Set Pending Position (for Formation)
#--------------------------------------------------------------------------
def pending_index=( index)
last_pending_index = @pending_index
@pending_index = index
redraw_item( @pending_index)
redraw_item( last_pending_index)
end
def contents_width
item_max * item_width
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
return 1
end
#--------------------------------------------------------------------------
# * Calculate Height of Window Contents
#--------------------------------------------------------------------------
def contents_height
item_height
end
#--------------------------------------------------------------------------
# * Get Leading Digits
#--------------------------------------------------------------------------
def top_col
ox / ( item_width + spacing)
end
#--------------------------------------------------------------------------
# * Set Leading Digits
#--------------------------------------------------------------------------
def top_col=( col)
col = 0 if col < 0
#col = col_max - 1 if col > col_max - 1
self .ox = col * ( item_width + spacing)
end
#--------------------------------------------------------------------------
# * Get Trailing Digits
#--------------------------------------------------------------------------
def bottom_col
top_col + col_max - 1
end
#--------------------------------------------------------------------------
# * Set Trailing Digits
#--------------------------------------------------------------------------
def bottom_col=( col)
self .top_col = col - ( col_max - 1 )
end
#--------------------------------------------------------------------------
# * Scroll Cursor to Position Within Screen
#--------------------------------------------------------------------------
def ensure_cursor_visible
self .top_col = index if index < top_col
self .bottom_col = index if index > bottom_col
end
#--------------------------------------------------------------------------
# * Get Rectangle for Displaying Items
#--------------------------------------------------------------------------
def item_rect( index)
rect = super
rect.x = index * ( item_width + spacing)
rect.y = 0
rect
end
#--------------------------------------------------------------------------
# * Get Alignment
#--------------------------------------------------------------------------
def alignment
return 1
end
#--------------------------------------------------------------------------
# * Move Cursor Down
#--------------------------------------------------------------------------
def cursor_down( wrap = false )
end
#--------------------------------------------------------------------------
# * Move Cursor Up
#--------------------------------------------------------------------------
def cursor_up( wrap = false )
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Down
#--------------------------------------------------------------------------
def cursor_pagedown
end
#--------------------------------------------------------------------------
# * Move Cursor One Page Up
#--------------------------------------------------------------------------
def cursor_pageup
end
end
#==============================================================================
# ** Window_Formation
#------------------------------------------------------------------------------
# This window is the alternative to the formation system for RMVXAce.
#==============================================================================
class Window_FormBG < Window_Base
def initialize( x,y)
super ( x-16 ,y-16 ,Graphics.width + 32 , Graphics.height + 32 )
self .opacity = 0
@bg_opacity = 192
end
def banner( y)
contents.clear
fill_bg
contents.font .color = system_color
contents.font .size = 24
draw_text( 0 ,y,contents.width ,24 ,Vocab::formation,1 )
end
def fill_bg
blackbg = Color.new ( 0 ,0 ,0 ,@bg_opacity)
contents.fill_rect ( 0 ,0 ,contents.width ,contents.height ,blackbg)
end
def clear
contents.clear
end
end
class Window_FormMenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pending_index # Pending position (for formation)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize( x, y)
super ( x, y, window_width, window_height)
@pending_index = -1
refresh
self .openness = 0
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return ( ( 84 + 2 ) * 5 ) + 24
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
if $game_party .members .size >= 7 and $game_party .members .size <= 12
return ( ( 120 + 2 ) * 2 ) + 24
elsif $game_party .members .size >= 13
return ( ( 120 + 2 ) * 3 ) + 24
else
return ( 120 + 2 ) + 24
end
end
def col_max
return 5
end
def spacing
return 0
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
$game_party .members .size
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
if $game_party .members .size >= ( col_max + 1 )
120
else
120
end
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item( index)
actor = $game_party .members [ index]
enabled = $game_party .battle_members .include ?( actor)
rect = item_rect( index)
if index <= ( PHLiM2::MAIN_MENU::MAX_PARTY_ACTIVE - 1 )
new_c = Color.new ( 32 ,128 ,196 ,128 )
contents.fill_rect ( rect.x +1 ,rect.y +1 ,84 ,118 ,new_c)
end
draw_item_background( index)
draw_actor_face( actor, rect.x + 1 , rect.y + 1 ,enabled,84 )
make_font_smaller
draw_actor_name( actor, rect.x + 1 , rect.y + ( line_height * 4 ) ,84 ,1 )
make_font_bigger
end
#--------------------------------------------------------------------------
# * Draw Background for Item
#--------------------------------------------------------------------------
def draw_item_background( index)
if index == @pending_index
pending = Color.new ( 255 ,255 ,255 ,128 )
contents.fill_rect ( item_rect( index) .x +1 ,item_rect( index) .y +1 ,84 ,118 , pending) #pending_color)
end
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
super
$game_party .menu_actor = $game_party .members [ index]
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select ( $game_party.menu_actor .index || 0 )
end
#--------------------------------------------------------------------------
# * Set Pending Position (for Formation)
#--------------------------------------------------------------------------
def pending_index=( index)
last_pending_index = @pending_index
@pending_index = index
redraw_item( @pending_index)
redraw_item( last_pending_index)
end
end
这是我用的脸图战斗:
class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# ☆ 绘制角色战斗用肖像图
# enabled : 有效的标志。false 的时候使用半透明效果绘制
#--------------------------------------------------------------------------
def draw_face( face_name, face_index, x, y, enabled = true )
bitmap = Cache.face ( face_name)
rect = Rect.new ( face_index % 4 * 96 , face_index / 4 * 96 + 32 , 96 , 22 )
contents.blt ( x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
#--------------------------------------------------------------------------
# ☆ 绘制基本区域
#--------------------------------------------------------------------------
def draw_basic_area( rect, actor)
draw_actor_face( actor, rect.x , rect.y + 1 )
contents.font .size = 20
draw_actor_name( actor, rect.x + 100 , rect.y , 100 )
contents.font .size = Font.default_size
draw_actor_icons( actor, rect.x + 184 , rect.y , rect.width - 104 )
end
#-------------------
#修改HPMP的位置
#-----------------
def draw_gauge_area_without_tp( rect, actor)
draw_actor_hp( actor, rect.x + 82 , rect.y , 64 )
draw_actor_mp( actor, rect.x + 156 , rect.y , 64 )
end
end
class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# ☆ 绘制角色战斗用肖像图
# enabled : 有效的标志。false 的时候使用半透明效果绘制
#--------------------------------------------------------------------------
def draw_face( face_name, face_index, x, y, enabled = true )
bitmap = Cache.face ( face_name)
rect = Rect.new ( face_index % 4 * 96 , face_index / 4 * 96 + 32 , 96 , 22 )
contents.blt ( x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
#--------------------------------------------------------------------------
# ☆ 绘制基本区域
#--------------------------------------------------------------------------
def draw_basic_area( rect, actor)
draw_actor_face( actor, rect.x , rect.y + 1 )
contents.font .size = 20
draw_actor_name( actor, rect.x + 100 , rect.y , 100 )
contents.font .size = Font.default_size
draw_actor_icons( actor, rect.x + 184 , rect.y , rect.width - 104 )
end
#-------------------
#修改HPMP的位置
#-----------------
def draw_gauge_area_without_tp( rect, actor)
draw_actor_hp( actor, rect.x + 82 , rect.y , 64 )
draw_actor_mp( actor, rect.x + 156 , rect.y , 64 )
end
end
只要进入战斗就提示|► WINDOWS
70行的代码有错误
#--------------------------------------------------------------------------
# * Draw Actor Face Graphic
#--------------------------------------------------------------------------
def draw_actor_face(actor, x, y, enabled = true,width=96,height=96)
draw_face(actor.face_name, actor.face_index, x, y, enabled,width,height)
end
就这一段。
请问有前辈知道怎么办么??