#==============================================================================
# ** Enhanced BattleStatus Window
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1.1
# 2007-03-13
# SDK : Version 2.0+, Part I
#------------------------------------------------------------------------------
# * Version History :
#
# Version 1 ---------------------------------------------------- (2007-02-11)
# Version 1.1 ------------------------------------------------- (2007-03-13)
# - Update : Added 'Stretch' Battlestatus Window Option
#------------------------------------------------------------------------------
# * Description :
#
# This script was designed to center the battlestatus window depending on
# the parties size and/or seperate the status window with seperate dummy
# windows.
#------------------------------------------------------------------------------
# * Instructions :
#
# Place The Script Below the SDK and Above Main.
#------------------------------------------------------------------------------
# * Customization :
#
# Default Settings
# - Default_Center_Battlestatus_Window = true or false
# - Default_Seperate_Battlestatus_Window = true or false
# - Default_Stetch_To_Full_Width = true or false
#------------------------------------------------------------------------------
# * Syntax :
#
# Turning Center Justification On / Off
# - $game_system.center_battlestatus = true or false
#
# Turn Seperate Status Windows On / Off
# - $game_system.seperate_battlestatus = true or false
#
# Turn Stretch to full window On / Off
# - $game_system.stretch_battlestatus = true or false
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Enhanced BattleStatus Window', 'SephirothSpawn', 1.1, '2007-03-13')
SDK.check_requirements(2.0)
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.enabled?('Enhanced BattleStatus Window')
#==============================================================================
# ** Game_System
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Defaults
#--------------------------------------------------------------------------
Default_Center_Battlestatus_Window = true
Default_Seperate_Battlestatus_Window = true
Default_Stetch_To_Full_Width = true
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :center_battlestatus
attr_accessor :seperate_battlestatus
attr_accessor :stretch_battlestatus
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_centerseperatebsw_gmsys_init, :initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_centerseperatebsw_gmsys_init
# Set Center / Sep Options
@center_battlestatus = Default_Center_Battlestatus_Window
@seperate_battlestatus = Default_Seperate_Battlestatus_Window
@stretch_battlestatus = Default_Stetch_To_Full_Width
end
end
#==============================================================================
# ** Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_centersperate_windbtlst_init, :initialize
alias_method :seph_centersperate_windbtlst_disp, :dispose
alias_method :seph_centersperate_windbtlst_updt, :update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original Initialization
seph_centersperate_windbtlst_init
# If Center is On
if $game_system.center_battlestatus
width = $game_party.actors.size * 160
self.x, self.width = 320 - width / 2, width
if width - 32 < self.contents.width
self.contents.dispose
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
self.opacity = 0
end
# If Stretch
if $game_system.stretch_battlestatus
self.x, self.width, self.opacity = 0, 640, 255
# If Center
if $game_system.center_battlestatus
self.ox = - (640 - $game_party.actors.size * 160) / 2
end
end
# If Seperate is On
if $game_system.seperate_battlestatus
@seperate_windows = []
for i in 0...$game_party.actors.size
w = Window_Base.new(self.x + i * 160, self.y, 160, 160)
if $game_system.stretch_battlestatus
w.x = (640 - $game_party.actors.size * 160) / 2
w.x += i * 160
end
@seperate_windows << w
end
end
end
#--------------------------------------------------------------------------
# * Object Dispose
#--------------------------------------------------------------------------
def dispose
# Original Dispose
seph_centersperate_windbtlst_disp
# Return if No Seperate Windows
return if @seperate_windows.nil?
# Dispose Seperate Windows
@seperate_windows.each {|x| x.dispose}
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Original Update
seph_centersperate_windbtlst_updt
# Return if No Seperate Windows
return if @seperate_windows.nil?
# Turn Window Opacity Off
self.opacity = 0 unless $game_system.stretch_battlestatus
# Update Seperate Windows
@seperate_windows.each {|x| x.update}
end
end
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias_method :seph_centersperate_gmact_sx, :screen_x
#--------------------------------------------------------------------------
# * Screen X
#--------------------------------------------------------------------------
def screen_x
# If Center On
if $game_system.center_battlestatus
if self.index.nil?
return 0
else
ox = 320 - ($game_party.actors.size * 160 / 2) + self.index * 160 + 80
return ox
end
end
# Return Original Screen X
return seph_centersperate_gmact_sx
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end