#==============================================================================#
# Kingdom Hearts Main Menu #
# This script is a modification of Mog's Sence Menu Itigo V1.5 #
#==============================================================================#
module Config
# Main Menu Graphics Used
MAIN_LAYOUT = "Main Menu" # Main Menu Graphics
MAIN_BACKGROUND = "Main Menu_bg" # Animated background graphic
MAIN_BACKGROUND2 = "Main Menu_bg2" # Only used when main_fx = 3
# It is mainly for a still transparent pic
# Menu
MAIN_FX = 3 # BG FX (0, Animated no bg)
# (1, Still picture)
# (2, Map as bg)
# (3, Animated with bg)
# 3 is for picture with transperency
MAIN_TRAN_TIME = 20 # Transition Time.
MAIN_TRAN_TYPE = "" # Transition Type (Name)
MAIN_MAPNAME = true # If true, shows the map name
# Font Used
MAIN_FONT = "Zeroes 1" # Font used in Main Menu
MAIN_CURSOR = "Indicator" # Cursor graphic
#Background Box
BGBox = "Bg-Box" # Box behind stats
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles the map. It includes scrolling and passable determining
# functions. Refer to "$game_map" for the instance of this class.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :map_id # map id
#--------------------------------------------------------------------------
# * Map Name
#--------------------------------------------------------------------------
def mpname
$mpname = load_data("Data/MapInfos.rxdata")
$mpname[@map_id].name
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw HP from Image
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_kh_hp(actor, x, y)
back = RPG::Cache.picture(Config::MAIN_BAR_HP_bg)
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 66, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture(Config::MAIN_BAR_HP)
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 68, y - ch + 30, meter, src_rect)
end
#--------------------------------------------------------------------------
# * Draw SP from Image
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_kh_mp(actor, x, y)
back = RPG::Cache.picture(Config::MAIN_BAR_SP_bg )
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 66, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture(Config::MAIN_BAR_SP)
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 68, y - ch + 30, meter, src_rect)
end
#--------------------------------------------------------------------------
# * Draw Box Behind Stats
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_bg_box(actor, x, y)
back = RPG::Cache.picture(Config::BGBox )
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 66, y - ch + 30, back, src_rect)
end
#--------------------------------------------------------------------------
# * Draw State
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 80)
text = make_battler_state_text(actor, width, true)
self.contents.font.name = "OCR A Extended"
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text(x, y, width, 32, text, 2)
end
#------------------#
#ACTOR BODY SPRITES#
#------------------#
def draw_actor_art(actor, x, y)
face = RPG::Cache.character("MenuArt/" + actor.character_name,
actor.character_hue)
fw = face.width
fh = face.height
src_rect = Rect.new(0, 0, fw, fh)
self.contents.blt(x - fw / 23, y - fh, face, src_rect)
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 280)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
self.opacity = 0
self.z = 15
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.name = "OCR A Extended"
self.contents.font.size = 14
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = i * 135
y = 150
actor = $game_party.actors[i]
draw_actor_art(actor, x + 20, y)
draw_bg_box(actor, x - 54, y)
draw_actor_level(actor, x + 85, y - 60)
draw_actor_hp(actor, x + 10, y - 40)
draw_actor_sp(actor, x + 10, y - 20)
draw_actor_exp(actor, x - 37, y + 5)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(5, @index * 62, self.width - 32, 50)
end
end
end
#==============================================================================
# ** Window_munny
#------------------------------------------------------------------------------
# This window displays amount of gold.
#==============================================================================
#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
# This window displays play time on the menu screen.
#==============================================================================
#==============================================================================
# ** Window_Map_Name
#------------------------------------------------------------------------------
# This window displays the map name on the menu screen.
#==============================================================================
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
end
@mapname_window.contents_opacity += 15 if Config::MAIN_MAPNAME == true
@playtime_window.contents_opacity += 15
@gold_window.contents_opacity += 15
@playtime_window.contents_opacity += 15
if @status_window.x > 195
@status_window.x -= 10
@status_window.contents_opacity += 10
elsif @status_window.x <= 195
@status_window.x = 195
@status_window.contents_opacity = 255
end
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
case @command_window.index
when 0
@mncom.bitmap = RPG::Cache.picture(Config::MENU_TYPE_1)
when 1
@mncom.bitmap = RPG::Cache.picture(Config::MENU_TYPE_2)
when 2
@mncom.bitmap = RPG::Cache.picture(Config::MENU_TYPE_3)
when 3
@mncom.bitmap = RPG::Cache.picture(Config::MENU_TYPE_4)
when 4
@mncom.bitmap = RPG::Cache.picture(Config::MENU_TYPE_5)
when 5
@mncom.bitmap = RPG::Cache.picture(Config::MENU_TYPE_6)
end
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)
$scene = Scene_Hotkeys.new
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
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_Journal.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
case @status_window.index
when 0
@mnsel.x = 190
@mnsel.y = 195
when 1
@mnsel.x = 323
@mnsel.y = 195
when 2
@mnsel.x = 455
@mnsel.y = 195
when 3
@mnsel.x = 180
@mnsel.y = 320
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
@mnsel.z = 20
@mnsel.x = 1000
@mnsel.y = 1000
@mnop = 100
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum