kylestarbucks
Member
it seems that the UMS script is not compatable with the config menu...is there anyway to make them both work...yet not lose any functions.
thank u!
config script
UMS script
thank u!
config script
Code:
#==============================================================================
# ** Configuration Translated
#==============================================================================
# The Sleeping Leonhart
# Version 1.3
# 7.07.06
#==============================================================================
# This script function only whit the SDK
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Configuration', 'The Sleeping Leonhart', 1.3, '7.07.06')
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Configuration') == true
module RPG
module Cache
def self.windowskin(filename, hue)
self.load_bitmap("Graphics/Windowskins/", filename, hue)
end
end
end
class Game_System
attr_reader :map_interpreter
attr_reader :battle_interpreter
attr_accessor :timer
attr_accessor :timer_working
attr_accessor :save_disabled
attr_accessor :menu_disabled
attr_accessor :encounter_disabled
attr_accessor :message_position
attr_accessor :message_frame
attr_accessor :save_count
attr_accessor :magic_number
attr_accessor :bgm_volume
attr_accessor :se_volume
attr_accessor :skin_hue
attr_accessor :skin_index
def initialize
@map_interpreter = Interpreter.new(0, true)
@battle_interpreter = Interpreter.new(0, false)
@timer = 0
@timer_working = false
@save_disabled = false
@menu_disabled = false
@encounter_disabled = false
@message_position = 2
@message_frame = 0
@save_count = 0
@magic_number = 0
@bgm_volume = 100
@se_volume = 100
@skin_hue = 0
@skin_index = 7
end
def bgm_play(bgm)
@playing_bgm = bgm
if bgm != nil and bgm.name != ""
Audio.bgm_play("Audio/BGM/" + bgm.name , bgm.volume * bgm_volume / 100, bgm.pitch)
else
Audio.bgm_stop
end
Graphics.frame_reset
end
def bgs_play(bgs)
@playing_bgs = bgs
if bgs != nil and bgs.name != ""
Audio.bgs_play("Audio/BGS/" + bgs.name, bgs.volume * se_volume / 100, bgs.pitch)
else
Audio.bgs_stop
end
Graphics.frame_reset
end
def me_play(me)
if me != nil and me.name != ""
Audio.me_play("Audio/ME/" + me.name, me.volume * se_volume / 100, me.pitch)
else
Audio.me_stop
end
Graphics.frame_reset
end
def se_play(se)
if se != nil and se.name != ""
Audio.se_play("Audio/SE/" + se.name, se.volume * se_volume / 100, se.pitch)
end
end
end
class Window_Base < Window
def initialize(x, y, width, height)
super()
@windowskin_name = $windowskin_name
self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name, $game_system.skin_hue)
self.x = x
self.y = y
self.width = width
self.height = height
self.z = 100
end
def update
super
if $windowskin_name != @windowskin_name
@windowskin_name = $windowskin_name
self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name, $game_system.skin_hue)
end
end
def draw_slant_bar(x, y, min, max, width = 152, height = 6,
bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
for i in 1..( (min / max) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end
end
class Arrow_Base < Sprite
attr_reader :index
attr_reader :help_window
def initialize(viewport)
super(viewport)
self.bitmap = RPG::Cache.windowskin($game_system.windowskin_name, $game_system.skin_hue)
self.ox = 16
self.oy = 64
self.z = 2500
@blink_count = 0
@index = 0
@help_window = nil
update
end
end
class Window_Command < Window_Selectable
def refresh
self.contents.clear
self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name, $game_system.skin_hue)
for i in 0...@item_max
draw_item(i, normal_color)
end
end
end
class Window_VolumeBGMCorrente < Window_Base
def initialize
super(160, 0, 480, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 20
end
def refresh
self.contents.clear
self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name, $game_system.skin_hue)
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 160, 32, "Music Volume")
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, $game_system.bgm_volume.to_s + "%", 2.9)
draw_slant_bar(160, 45, $game_system.bgm_volume.to_f, 100, 100, 6,
Color.new(200, 200, 200), Color.new(100, 100, 100))
end
end
class Window_VolumeSECorrente < Window_Base
def initialize
super(160, 96, 480, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 20
end
def refresh
self.contents.clear
self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name, $game_system.skin_hue)
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 160, 32, "Sound Effect Volume")
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, $game_system.se_volume.to_s + "%", 2.9)
draw_slant_bar(160, 45, $game_system.se_volume.to_f, 100, 100, 6,
Color.new(200, 200, 200), Color.new(100, 100, 100))
end
end
class Window_ColoreSkinCorrente < Window_Base
def initialize
super(160, 192, 480, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 20
end
def refresh
self.contents.clear
self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name, $game_system.skin_hue)
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 160, 32, "Skin Color")
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, $game_system.skin_hue.to_s, 2.9)
draw_slant_bar(160, 45, $game_system.skin_hue.to_f, 350, 100, 6,
Color.new(200, 200, 200), Color.new(100, 100, 100))
end
end
class Window_TramaSkinCorrente < Window_Base
def initialize
super(160, 288, 480, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 20
end
def refresh
self.contents.clear
self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name, $game_system.skin_hue)
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 160, 32, "Current Skin")
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, $game_system.windowskin_name, 2.9)
end
end
class Scene_Opzioni
def initialize(option_index = 0, skin_index = $game_system.skin_index)
@option_index = option_index
@skin_index = skin_index
end
def main
s1 = "Music Volume"
s2 = "SE Volume"
s3 = "Skin Color"
s4 = "Skin Type"
r1 = "Black"
r2 = "Old"
r3 = "Red"
r4 = "White Ties"
r5 = "Blue"
r6 = "Comic Skin"
r7 = "Army"
r8 = "SLFFVII"
@windowskin_window = Window_Command.new(160, [r1, r2, r3, r4, r5, r6, r7, r8])
@windowskin_window.index = @skin_index
@command_window = Window_Command.new(160, [s1, s2, s3, s4])
@command_window.index = @option_index
@currentsfx_window = Window_VolumeSECorrente.new
@currentbgm_window = Window_VolumeBGMCorrente.new
@currentskin_window = Window_ColoreSkinCorrente.new
@currwindskin_window = Window_TramaSkinCorrente.new
@currentsfx_window.active = false
@currentbgm_window.active = false
@currentskin_window.active = false
@windowskin_window.active = false
@currwindskin_window.active = false
@command_window.x = 640
@windowskin_window.y = 480
@windowskin_window.x = 0
@currentbgm_window.y = 480
@currentsfx_window.y = 576
@currentskin_window.y = 672
@currwindskin_window.y = 600
@currentsfx_window.refresh
@currentbgm_window.refresh
@currentskin_window.refresh
@currwindskin_window.refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@currentbgm_window.dispose
@currentsfx_window.dispose
@currentskin_window.dispose
@windowskin_window.dispose
@currwindskin_window.dispose
end
def update
@windowskin_window.update
@command_window.update
@currentsfx_window.update
@currentbgm_window.update
@currentskin_window.update
@currwindskin_window.update
if @command_window.x > 0
@command_window.x -= 64
end
if @windowskin_window.y > 160
@windowskin_window.y -= 40
end
if @currentbgm_window.y > 0
@currentbgm_window.y -= 96
end
if @currentsfx_window.y > 96
@currentsfx_window.y -= 60
end
if @currentskin_window.y > 192
@currentskin_window.y -= 48
end
if @currwindskin_window.y > 288
@currwindskin_window.y -= 24
end
if @command_window.active
update_command
return
end
if @currentbgm_window.active
update_bgm
return
end
if @currentsfx_window.active
update_sfx
return
end
if @currentskin_window.active
update_skin
return
end
if @windowskin_window.active
update_windowskin
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(4)
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@currentbgm_window.active = true
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@currentsfx_window.active = true
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@currentskin_window.active = true
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@windowskin_window.active = true
end
return
end
end
def update_sfx
if Input.repeat?(Input::LEFT)
if $game_system.se_volume < 1
$game_system.se_play($data_system.decision_se)
$game_system.se_volume = 100
@currentsfx_window.refresh
else
$game_system.se_volume = $game_system.se_volume - 1
$game_system.se_play($data_system.decision_se)
@currentsfx_window.refresh
end
return
end
if Input.repeat?(Input::DOWN)
if $game_system.se_volume < 10
$game_system.se_play($data_system.decision_se)
$game_system.se_volume = 100
@currentsfx_window.refresh
else
$game_system.se_volume = $game_system.se_volume - 10
$game_system.se_play($data_system.decision_se)
@currentsfx_window.refresh
end
return
end
if Input.repeat?(Input::RIGHT)
if $game_system.se_volume > 99
$game_system.se_play($data_system.decision_se)
$game_system.se_volume = 0
@currentsfx_window.refresh
else
$game_system.se_volume = $game_system.se_volume + 1
$game_system.se_play($data_system.decision_se)
@currentsfx_window.refresh
end
return
end
if Input.repeat?(Input::UP)
if $game_system.se_volume > 90
$game_system.se_play($data_system.decision_se)
$game_system.se_volume = 0
@currentsfx_window.refresh
else
$game_system.se_volume = $game_system.se_volume + 10
$game_system.se_play($data_system.decision_se)
@currentsfx_window.refresh
end
return
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@currentsfx_window.active = false
return
end
end
def update_bgm
if Input.repeat?(Input::LEFT)
if $game_system.bgm_volume < 1
$game_system.se_play($data_system.decision_se)
$game_system.bgm_volume = 100
$game_system.bgm_play($game_system.bgm_memorize)
$game_system.se_play($data_system.decision_se)
@currentbgm_window.refresh
else
$game_system.bgm_volume = $game_system.bgm_volume - 1
$game_system.se_play($data_system.decision_se)
@currentbgm_window.refresh
$game_system.bgm_play($game_system.bgm_memorize)
end
return
end
if Input.repeat?(Input::DOWN)
if $game_system.bgm_volume < 10
$game_system.bgm_volume = 100
$game_system.bgm_play($game_system.bgm_memorize)
$game_system.se_play($data_system.decision_se)
@currentbgm_window.refresh
else
$game_system.bgm_volume = $game_system.bgm_volume - 10
$game_system.se_play($data_system.decision_se)
@currentbgm_window.refresh
$game_system.bgm_play($game_system.bgm_memorize)
end
return
end
if Input.repeat?(Input::RIGHT)
if $game_system.bgm_volume > 99
$game_system.bgm_volume = 0
$game_system.bgm_play($game_system.bgm_memorize)
$game_system.se_play($data_system.decision_se)
@currentbgm_window.refresh
else
$game_system.bgm_volume = $game_system.bgm_volume + 1
$game_system.se_play($data_system.decision_se)
@currentbgm_window.refresh
$game_system.bgm_play($game_system.bgm_memorize)
end
return
end
if Input.repeat?(Input::UP)
if $game_system.bgm_volume > 90
$game_system.bgm_volume = 0
$game_system.bgm_play($game_system.bgm_memorize)
$game_system.se_play($data_system.decision_se)
@currentbgm_window.refresh
else
$game_system.bgm_volume = $game_system.bgm_volume + 10
$game_system.se_play($data_system.decision_se)
@currentbgm_window.refresh
$game_system.bgm_play($game_system.bgm_memorize)
end
return
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@currentbgm_window.active = false
return
end
end
def update_skin
if Input.repeat?(Input::LEFT)
if $game_system.skin_hue < 1
$game_system.se_play($data_system.decision_se)
@currentskin_window.refresh
$game_system.skin_hue = 350
recolour
else
$game_system.skin_hue = $game_system.skin_hue - 1
$game_system.se_play($data_system.decision_se)
@currentskin_window.refresh
recolour
end
return
end
if Input.repeat?(Input::DOWN)
if $game_system.skin_hue < 10
$game_system.skin_hue = 350
$game_system.se_play($data_system.decision_se)
@currentskin_window.refresh
recolour
else
$game_system.skin_hue = $game_system.skin_hue - 10
$game_system.se_play($data_system.decision_se)
@currentskin_window.refresh
recolour
end
return
end
if Input.repeat?(Input::RIGHT)
if $game_system.skin_hue > 349
$game_system.skin_hue = 0
$game_system.se_play($data_system.decision_se)
@currentskin_window.refresh
recolour
else
$game_system.skin_hue = $game_system.skin_hue + 1
$game_system.se_play($data_system.decision_se)
@currentskin_window.refresh
recolour
end
return
end
if Input.repeat?(Input::UP)
if $game_system.skin_hue > 340
$game_system.skin_hue = 0
$game_system.se_play($data_system.decision_se)
@currentskin_window.refresh
recolour
else
$game_system.skin_hue = $game_system.skin_hue + 10
$game_system.se_play($data_system.decision_se)
@currentskin_window.refresh
recolour
end
return
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@currentskin_window.active = false
return
end
end
def update_windowskin
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@windowskin_window.active = false
@command_window.active = true
return
end
if Input.trigger?(Input::C)
case @windowskin_window.index
when 0
$game_system.se_play($data_system.decision_se)
$game_system.windowskin_name = "Black"
$game_system.skin_index = 0
recolour
when 1
$game_system.se_play($data_system.decision_se)
$game_system.windowskin_name = "Old"
$game_system.skin_index = 1
recolour
when 2
$game_system.se_play($data_system.decision_se)
$game_system.windowskin_name = "Red"
$game_system.skin_index = 2
recolour
when 3
$game_system.se_play($data_system.decision_se)
$game_system.windowskin_name = "White Ties"
$game_system.skin_index = 3
recolour
when 4
$game_system.se_play($data_system.decision_se)
$game_system.windowskin_name = "Blue"
$game_system.skin_index = 4
recolour
when 5
$game_system.se_play($data_system.decision_se)
$game_system.windowskin_name = "Comic Skin"
$game_system.skin_index = 5
recolour
when 6
$game_system.se_play($data_system.decision_se)
$game_system.windowskin_name = "Army"
$game_system.skin_index = 6
recolour
when 7
$game_system.se_play($data_system.decision_se)
$game_system.windowskin_name = "SLFFVII"
$game_system.skin_index = 7
@windowskin_window.active = true
recolour
end
return
end
end
def recolour
@command_window.refresh
@currentbgm_window.refresh
@currentsfx_window.refresh
@currentskin_window.refresh
@windowskin_window.refresh
@currwindskin_window.refresh
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Code:
# *****************************************************************************
# * Universal Message System
# * v1.21
# * by Ccoa
# *****************************************************************************
# Usage:
=begin
IN MESSAGE CODES
\b - toggle bold on and off
\c[i] - change the text color
\e[i] - place the text box over event i (0 = player, -1 no event)
\face[name] - changes the face graphic to name.png (leave empty [] for no face)
\fl - change face justification to left
\font[name] - change the font to name, leave empty [] to return to the default font
\fr - change face justification to right
\g - display the gold window
\height - height of the message window, works only in normal mode
\i - toggle italics on and off
\ignr - Do not write anything on this line, only process codes, must be the first thing on a line
\jc - justify the window to the center, ignored if using \e
\jl - justify the window to the left, ignored if using \e
\jr - justify the window to the right, ignored if using \e
\m - toggle mode between normal and fit window to text
\n[i] - display the name of actor i
\nm[name] - display the name in the name window, leave empty [] to remove the name window
\oa[i] - display the icon and name of armor i
\oi[i] - display the icon and name of item i
\os[i] - display the icon and name of skill i
\ow[i] - display the icon and name of weapon i
\p[i] - pause for i frames before writing the next character
\pt - toggle pause display on and off
\s - toggle shadowed text
\shk[i] - set window shake to i, higher i is bigger shake, 0 is no shake
\skip - toggle text skip on and off
\t1 - switch to the talk1 comic thingy
\t2 - switch to the talk2 comic thingy
\tc - center the text, must be the first thing on a line
\th - switch to the thought comic thingy
\tl - left justify the text, must be the first thing on a line
\tr - right justify the text, must be the first thing on a line
\v[i] - display variable i
\width - width of the message window, works only in normal mode
\w[i] - wait for i frames after receiving this code, then close the window
\ws[i] - change the write speed to i
\slv[name] - set this window to be slave window name, or show slave window name
\inc - include this window in the last
OUT OF MESSAGE CODES (use in a Script event command)
$game_system.ums_mode = NORMAL_MODE - switch to normal mode
$game_system.ums_mode = FIT_WINDOW_TO_TEXT - switch to fit window mode
$game_system.text_skip = true - turn text skip on
$game_system.text_skip = false
true - turn text skip off (true is necessary)
$game_system.text_mode = WRITE_FASTER - change skip mode to write faster
$game_system.text_mode = WRITE_ALL - change skip mode to write all
$game_system.write_speed = i - change the delay between letters to i frames
$game_system.window_height = i - change the window height to i
$game_system.window_width = i - change the window width to i
$game_system.window_justification = RIGHT - make the window right justified
$game_system.window_justification = LEFT - make the window left justified
$game_system.window_justification = CENTER - make the window center justified
$game_system.face_graphic = "filename" - change the face graphic to filename.png
$game_system.face_graphic = "" - change the face graphic to none
$game_system.face_graphic_justification = LEFT - the face graphic is on the left side
$game_system.face_graphic_justification = RIGHT - the face graphic is on the right side
$game_system.face_graphic_position = TOP - face graphic appears on top of window
$game_system.face_graphic_position = CENTER - face graphic appears centered in window
$game_system.face_graphic_position = BOTTOM - face graphic appears on the bottom of window
$game_system.shadow_text = true - turn text shadowing on
$game_system.shadow_text = false
true - turn text shadowing off (true is necessary)
$game_system.shadow_color = Color.new(red, blue, green, alpha) - change shadow color
$game_system.message_event = what event to put the message over (0 = player, -1 = no event)
$game_system.comic_enabled = false
true - turn off comic thingy
$game_system.comic_enabled = true - turn on comic thingy (only works with message_event not -1)
$game_system.comic_style = TALK1 - use the talk1.png comic thingy
$game_system.comic_style = TALK2 - use the talk2.png comic thingy
$game_system.comic_style = THOUGHT - use the thought.png comic thingy
$game_system.name = "name" - change the text of the name window to name
$game_system.name = "" - remove the name window
$game_system.font = "name" - change the font to name
$game_system.font = "" - return the font to the default
$game_system.text_justification = CENTER - center justify the text
$game_system.text_justification = LEFT - left justify the text
$game_system.text_justification = RIGHT - right justify the text
$game_system.show_pause = true - show pause icon when waiting for user input
$game_system.show_pause = false - don't show pause icon when waiting for user input
$game_system.shake = 0 - turn window shake off
$game_system.shake = i - set shake to i, higher i is bigger shake
$game_system.sound_effect = "" - turn off the letter-by-letter SE
$game_system.sound_effect = "sename" - play the SE sename with each letter written
$game_system.animated_faces = false - do not use animated faces
$game_system.animated_faces = true - use animated faces
$game_system.animation_pause = i - Wait i frames between each animation
$game_system.face_frame_width = i - Each frame on the faceset is i pixels
$game_system.resting_face = "" - Do not use a resting face
$game_system.resting_face = "name" - Use a different animated face named facenamename when done talking
$game_system.resting_animation_pause = i - Wait i frames between resting animations
$game_system.text_mode = ONE_LETTER_AT_A_TIME - write text one letter at a time
$game_system.text_mode = ALL_AT_ONCE - write text all at once
$game_system.font_color = Color.new(R, G, B, A) - permanently change the font color to the RGBA color given here
$game_system.font_color = nil - return the font color permanently to normal_color (white, by default)
$game_system.windowskin = "windowskinname" - change the message box windowskin to windowskin
$game_system.windowskin = "" - change the message box windowskin back to the one in the database
$game_system.name_window = true - show the name window
$game_system.name_window = false - hide the name window (just show the text)
=end
# *****************************************************************************
# CONSTANTS
# *****************************************************************************
# modes
NORMAL_MODE = 0
FIT_WINDOW_TO_TEXT = 1
#text modes
ONE_LETTER_AT_A_TIME = 0
ALL_AT_ONCE = 1
# skip modes
WRITE_FASTER = 0
WRITE_ALL = 1
# justifications
RIGHT = 0
CENTER = 1
LEFT = 2
# positions for extra objects (face graphics, choice box, etc)
ABOVE = 0 # place the object above the top of the message box
CENTER = 1 # center the object vertically inside the message box
BOTTOM = 2 # place the bottom of the object on the bottom of the message box
SIDE = 3 # to the side of the message box (which side depends on justification)
# comic type
TALK1 = 0
TALK2 = 1
THOUGHT = 2
# *****************************************************************************
# Changes to Game_System. This allows any changes made to be saved when the
# game is saved.
# *****************************************************************************
class Game_System
attr_accessor :ums_mode # what mode the UMS is in
attr_accessor :text_skip # whether or not text skip is activated
attr_accessor :skip_mode # write the text faster while C is pressed, or just skip to the end
attr_accessor :write_speed # frame delay between characters
attr_accessor :text_mode # write one letter at a time, or all at once?
attr_accessor :window_height # default height of message window
attr_accessor :window_width # default width of message window
attr_accessor :window_justification # default justification of window
attr_accessor :face_graphic # current face graphic
attr_accessor :face_graphic_justification # justification of face graphic
attr_accessor :face_graphic_position # position of face graphic
attr_accessor :shadowed_text # whether or not to draw a shadow behind the text
attr_accessor :shadow_color # the shadow color
attr_accessor :choice_justification # where the choice window is located
attr_accessor :choice_position # prefered position of choice window
attr_accessor :message_event # what event to center the text over (0 player, -1 to not)
attr_accessor :comic_enabled # using "talk" icons?
attr_accessor :comic_style # what type of comic image to use
attr_accessor :name # the text for the name window
attr_accessor :name_window # should the name window be visible?
attr_accessor :font # the name of the font
attr_accessor :font_color # the name of the (permanent) font color
attr_accessor :text_justification # the justification of the window text
attr_accessor :show_pause # whether or not to show the pause icon
attr_accessor :shake # the amount of shake for the window
attr_accessor :sound_effect # SE to play with each letter
attr_accessor :slave_windows # hash of slave windows
attr_accessor :indy_windows # hash of independent windows
attr_accessor :animated_faces # are the faces animated?
attr_accessor :animation_pause # how long do I wait between animation loops?
attr_accessor :face_frame_width # how many pixels wide is each face frame
attr_accessor :resting_face # postext for waiting face graphic
attr_accessor :resting_animation_pause # how long to wait for resting graphic
attr_accessor :windowskin # what windowskin to use for messages
attr_reader :shortcuts # user-defined shortcuts
alias ums_initialize initialize
def initialize
ums_initialize
@ums_mode = NORMAL_MODE
@skip_mode = WRITE_ALL
@text_skip = true
@write_speed = 2
@text_mode = ONE_LETTER_AT_A_TIME
@window_height = 128
@window_width = 480
@window_justification = CENTER
@face_graphic = ""
@face_graphic_justification = LEFT
@face_graphic_position = CENTER
@shadowed_text = false
@shadow_color = Color.new(0, 0, 0, 100)
@choice_justification = RIGHT
@choice_position = SIDE
@message_event = -1
@comic_enabled = false
@comic_style = TALK1
@name = ""
@name_window = false
@font = ""
@font_color = nil
@text_justification = LEFT
@show_pause = true
@shake = 0
@sound_effect = ""
@slave_windows = {}
@indy_windows = {}
@animated_faces = false
@animation_pause = 80
@face_frame_width = 100
@resting_face = ""
@resting_animation_pause = 80
@windowskin = ""
@used_codes = ['\v', '\n', '\c', '\g', '\skip', '\m', '\height', '\width',
'\jr', '\jc', '\jl', '\face', '\fl', '\fr', '\b', '\i', '\s',
'\e', '\t1', '\t2', '\th', '\nm', '\font', '\p', '\w', '\ws',
'\oa', '\oi', '\os', '\ow', '\tl', '\tr', '\tc', '\ignr',
'\shk', '\slv', '\ind', '\inc']
@shortcuts = {}
end
def add_shortcut(shortcut, code)
text = shortcut.downcase
if !@used_codes.include?(text)
@shortcuts[shortcut] = code
end
end
def open_window(name)
if $game_system.indy_windows.has_key?(name)
$game_system.indy_windows[name].show = true
end
end
def close_window(name)
if $game_system.indy_windows.has_key?(name)
$game_system.indy_windows[name].dispose
$game_system.indy_windows.delete(name)
end
end
end
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
attr_accessor :choices
end
class Scene_Map
alias ums_update update
def update
$game_system.slave_windows.each_value { |window| window.update }
$game_system.indy_windows.each_value { |window| window.update }
ums_update
end
end
class Interpreter
#--------------------------------------------------------------------------
# * Show Text
#--------------------------------------------------------------------------
def command_101
# If other text has been set to message_text
if $game_temp.message_text != nil
# End
return false
end
# Set message end waiting flag and callback
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# Set message text on first line
$game_temp.message_text = @list[@index].parameters[0] + "\n"
line_count = 1
# Loop
loop do
# If next event command text is on the second line or after
if @list[@index + 1].code == 401
# Add the second line or after to message_text
$game_temp.message_text += @list[@index + 1].parameters[0] + "\n"
line_count += 1
# If the next event command is show text
elsif @list[@index + 1].code == 101
# If the text contains the \inc code
if @list[@index + 1].parameters[0].index(/\\[Ii][Nn][Cc]/) != nil
$game_temp.message_text += @list[@index + 1].parameters[0] + "\n"
$game_temp.message_text.sub!(/\\[Ii][Nn][Cc]/) { "" }
else
return true
end
# If event command is not on the second line or after
else
# If next event command is show choices
if @list[@index + 1].code == 102
# If choices fit on screen
#if @list[@index+1].parameters[0].size <= 4 - line_count
# Advance index
@index += 1
# Choices setup
$game_temp.choice_start = line_count
setup_choices(@list[@index].parameters)
#end
# If next event command is input number
elsif @list[@index + 1].code == 103
# If number input window fits on screen
if line_count < 4
# Advance index
@index += 1
# Number input setup
$game_temp.num_input_start = line_count
$game_temp.num_input_variable_id = @list[@index].parameters[0]
$game_temp.num_input_digits_max = @list[@index].parameters[1]
end
end
# Continue
return true
end
# Advance index
@index += 1
end
end
#--------------------------------------------------------------------------
# * Setup Choices
#--------------------------------------------------------------------------
def setup_choices(parameters)
# Set choice item count to choice_max
$game_temp.choice_max = parameters[0].size
# Set choice to message_text
$game_temp.choices = parameters[0]
# Set cancel processing
$game_temp.choice_cancel_type = parameters[1]
# Set callback
current_indent = @list[@index].indent
$game_temp.choice_proc = Proc.new { |n| @branch[current_indent] = n }
end
#--------------------------------------------------------------------------
# * Input Number
#--------------------------------------------------------------------------
def command_103
# If text has been set to message_text
if $game_temp.message_text != nil
# End
return false
end
# Set message end waiting flag and callback
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# Number input setup
$game_temp.message_text = ""
$game_temp.num_input_start = 0
$game_temp.num_input_variable_id = @parameters[0]
$game_temp.num_input_digits_max = @parameters[1]
# Continue
return true
end
#--------------------------------------------------------------------------
# * Script
#--------------------------------------------------------------------------
def command_355
# Set first line to script
script = @list[@index].parameters[0] + "\n"
# Loop
loop do
# If next event command is second line of script or after
if @list[@index + 1].code == 655
# Add second line or after to script
script += @list[@index + 1].parameters[0] + "\n"
# If event command is not second line or after
else
# Abort loop
break
end
# Advance index
@index += 1
end
# Evaluation
result = eval(script)
# Continue
return true
end
end
# *****************************************************************************
# Changes to Window_Message. This is the bulk of the script
# *****************************************************************************
#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
# This message window is used to display text.
#==============================================================================
class Window_Message < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# x-coordinate depends on justification
if $game_system.window_justification == RIGHT
x = 640 - self.width
elsif $game_system.window_justification == LEFT
x = 0
else # center
x = (640 - $game_system.window_width) / 2
end
# y-coordinate depends on height
y = 480 - $game_system.window_height - 16
super(x, y, $game_system.window_width, $game_system.window_height)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.z = 9998
@fade_in = false
@fade_out = false
@contents_showing = false
# face graphic sprite
@face = Sprite.new
@face.opacity = 0
@face.z = self.z + 1
@face_offset = 0
# choice window
@choice_window = Window_Choice.new([])
@choice_window.back_opacity = 160
# comic sprite
@comic = Sprite.new
@comic.opacity = 0
@comic.z = self.z + 1
if $game_system.comic_style == TALK1
@comic.bitmap = RPG::Cache.windowskin("talk1")
elsif $game_system.comic_style == TALK2
@comic.bitmap = RPG::Cache.windowskin("talk2")
else # thought
@comic.bitmap = RPG::Cache.windowskin("thought")
end
# name window
@name_window = Window_Name.new
@name_window.z = self.z + 1
@pause_time = 0
@wait = 0
@show = false
@face_frame = 0
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
terminate_message
$game_temp.message_window_showing = false
if @input_number_window != nil
@input_number_window.dispose
end
@face.dispose
@choice_window.dispose
@comic.dispose
@name_window.dispose
super
end
#--------------------------------------------------------------------------
# * Terminate Message
#--------------------------------------------------------------------------
def terminate_message
@show = false
self.active = false
self.pause = false
self.contents.clear
# Clear showing flag
@contents_showing = false
# Call message callback
if $game_temp.message_proc != nil
$game_temp.message_proc.call
end
# Clear variables related to text, choices, and number input
$game_temp.message_text = nil
$game_temp.message_proc = nil
$game_temp.choice_start = 99
$game_temp.choice_max = 0
$game_temp.choice_cancel_type = 0
$game_temp.choice_proc = nil
$game_temp.num_input_start = 99
$game_temp.num_input_variable_id = 0
$game_temp.num_input_digits_max = 0
# Open gold window
if @gold_window != nil
@gold_window.dispose
@gold_window = nil
end
@choice_window.visible = false
@choice_window.active = false
@comic.opacity = 0
$game_system.slave_windows.each_pair {|name, window|
if window.show == true
window.dispose
$game_system.slave_windows.delete(name)
end
}
@done = false
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if $game_system.font_color.nil?
self.contents.font.color = normal_color
else
self.contents.font.color = $game_system.font_color
end
if $game_system.windowskin != ""
self.windowskin = RPG::Cache.windowskin($game_system.windowskin)
else
self.windowskin = RPG::Cache.windowskin($data_system.windowskin_name)
end
@show = true
@x = @y = 0
# If waiting for a message to be displayed
if $game_temp.message_text != nil
@text = $game_temp.message_text
# replace shortcuts with original code
$game_system.shortcuts.each { |shortcut, code|
@text.gsub!(shortcut, code)
}
# VERY first thing. Check to see if this is being set up as a slave
# or independent window.
if @text.index(/\\[Ss][Ll][Vv]\[(.*?)\]/) != nil
# is this a new slave window, or a request to display it?
if !$game_system.slave_windows.has_key?($1.to_s)
# there is no such slave window yet. Set it up.
@text.gsub!(/\\[Ss][Ll][Vv]\[(.*?)\]/, "")
$game_system.slave_windows[$1.to_s] = Window_Slave.new(@text)
@text = ""
@show = false
terminate_message
return
end
end
if @text.index(/\\[Ii][Nn][Dd]\[(.*?)\]/) != nil
# is this a new independent window, or a request to display it?
if !$game_system.indy_windows.has_key?($1.to_s)
# there is no such slave window yet. Set it up.
@text.gsub!(/\\[Ii][Nn][Dd]\[(.*?)\]/, "")
$game_system.indy_windows[$1.to_s] = Window_Slave.new(@text)
@text = ""
@show = false
terminate_message
return
end
end
# Control text processing
begin
last_text = @text.clone
@text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
end until @text == last_text
@text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
# window mode
if @text.index(/\\[Mm]/) != nil
if $game_system.ums_mode == NORMAL_MODE
$game_system.ums_mode = FIT_WINDOW_TO_TEXT
else
$game_system.ums_mode = NORMAL_MODE
end
@text.gsub!(/\\[Mm]/) { "" }
end
# window height
@text.gsub!(/\\[Hh][Ee][Ii][Gg][Hh][Tt]\[([0-9]+)\]/) do
$game_system.window_height = $1.to_i
""
end
# window width
@text.gsub!(/\\[Ww][Ii][Dd][Tt][Hh]\[([0-9]+)\]/) do
$game_system.window_width = $1.to_i
""
end
# justification
@text.gsub!(/\\[Jj][Rr]/) do
$game_system.window_justification = RIGHT
reset_window
""
end
@text.gsub!(/\\[Jj][Cc]/) do
$game_system.window_justification = CENTER
reset_window
""
end
@text.gsub!(/\\[Jj][Ll]/) do
$game_system.window_justification = LEFT
reset_window
""
end
# face graphics
@text.gsub!(/\\[Ff][Aa][Cc][Ee]\[(.*?)\]/) do
$game_system.face_graphic = $1.to_s
if $1.to_s == ""
@face.opacity = 0
end
""
end
@text.gsub!(/\\[Ff][Ll]/) do
$game_system.face_graphic_justification = LEFT
""
end
@text.gsub!(/\\[Ff][Rr]/) do
$game_system.face_graphic_justification = RIGHT
""
end
# event centering
@text.gsub!(/\\[Ee]\[([0-9]+)\]/) do
$game_system.message_event = $1.to_i
""
end
# comic thingy
@text.gsub!(/\\[Tt]1/) do
$game_system.comic_style = TALK1
@comic.bitmap = RPG::Cache.windowskin("talk1.png")
""
end
@text.gsub!(/\\[Tt]2/) do
$game_system.comic_style = TALK2
@comic.bitmap = RPG::Cache.windowskin("talk2.png")
""
end
@text.gsub!(/\\[Tt][Hh]/) do
$game_system.comic_style = THOUGHT
@comic.bitmap = RPG::Cache.windowskin("thought.png")
""
end
# name window
@text.gsub!(/\\[Nn][Mm]\[(.*?)\]/) do
$game_system.name = $1.to_s
if $1.to_s == ""
@name_window.visible = false
@name_window.dummy_window.visible = false
end
""
end
# toggle pause
@text.gsub!(/\\[Pp][Tt]/) do
$game_system.show_pause = !$game_system.show_pause
""
end
# shaking
@text.gsub!(/\\[Ss][Hh][Kk]\[([0-9]+)\]/) do
$game_system.shake = $1.to_i
""
end
# Change "\\\\" to "\000" for convenience
@text.gsub!(/\\\\/) { "\000" }
# Change "\\C" to "\001" and "\\G" to "\002"
@text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
@text.gsub!(/\\[Gg]/) { "\002" }
# text skip code
@text.gsub!(/\\[Ss][Kk][Ii][Pp]/) { "\003" }
# ignore code
@text.gsub!(/\\[Ii][Gg][Nn][Rr]/) { "\023" }
# slave and indy windows
@text.gsub!(/\\[Ss][Ll][Vv]\[(.*?)\]/) { "\024[#{$1}]" }
@text.gsub!(/\\[Ii][Nn][Dd]\[(.*?)\]/) { "\025[#{$1}]" }
# bold and italics
@text.gsub!(/\\[Bb]/) { "\004" }
@text.gsub!(/\\[Ii]/) { "\005" }
# shadow
@text.gsub!(/\\[Ss]/) { "\006" }
# font
@text.gsub!(/\\[Ff][Oo][Nn][Tt]\[(.*?)\]/) { "\007[#{$1}]" }
# pause and wait
@text.gsub!(/\\[Pp]\[([0-9]+)\]/) { "\010[#{$1}]" }
@text.gsub!(/\\[Ww]\[([0-9]+)\]/) { "\011[#{$1}]" }
# write speed
@text.gsub!(/\\[Ww][Ss]\[([0-9]+)\]/) { "\013[#{$1}]" }
# armor, items, skills, and weapons
@text.gsub!(/\\[Oo][Aa]\[([0-9]+)\]/) {
item = $data_armors[$1.to_i]
"\014[#{$1}]" + " " + item.name
}
@text.gsub!(/\\[Oo][Ii]\[([0-9]+)\]/) {
item = $data_items[$1.to_i]
"\015[#{$1}]" + " " + item.name
}
@text.gsub!(/\\[Oo][Ss]\[([0-9]+)\]/) {
item = $data_skills[$1.to_i]
"\016[#{$1}]" + " " + item.name
}
@text.gsub!(/\\[Oo][Ww]\[([0-9]+)\]/) {
item = $data_weapons[$1.to_i]
"\017[#{$1}]" + " " + item.name
}
# text justification
@text.gsub!(/\\[Tt][Cc]/) { "\020" }
@text.gsub!(/\\[Tt][Ll]/) { "\021" }
@text.gsub!(/\\[Tt][Rr]/) { "\022" }
# Resize the window to fit the contents?
if $game_system.ums_mode == FIT_WINDOW_TO_TEXT
width = 1
text = @text.split("\n")
height = 0
i = 0
for line in text
# don't count this line's width if it has the ignr code
if !line.include?("\023")
width = [width, self.contents.text_size(line).width].max
delta = self.contents.text_size(line).height
height += delta + (6 * i) + 5
if i < 3
i += 1
end
end
end
if $game_system.face_graphic != "" and ($game_system.face_graphic_position == CENTER or $game_system.face_graphic_position == BOTTOM)
width += @face.bitmap.width
if height < @face.bitmap.height
height = @face.bitmap.height - 32
end
end
if height == 0
height = 1
end
self.width = width + 48
self.height = height + 48
self.contents = Bitmap.new(width + 16, height)
if $game_system.font_color.nil?
self.contents.font.color = normal_color
else
self.contents.font.color = $game_system.font_color
end
else
if self.width != $game_system.window_height or self.height != $game_system.window_width
self.width = $game_system.window_width
self.height = $game_system.window_height
self.contents = Bitmap.new(self.width - 32, self.height - 32)
if $game_system.font_color.nil?
self.contents.font.color = normal_color
else
self.contents.font.color = $game_system.font_color
end
end
end
reset_window
get_x_value
@count = Graphics.frame_count
@pause_time = 0
@ignore = false
@ascending = true
@target_x = self.x + $game_system.shake
@done = false
@face_frame = 0
@done = false
end
end
#--------------------------------------------------------------------------
# * Set Window Position and Opacity Level
#--------------------------------------------------------------------------
def reset_window (change_opacity = true)
# x-coordinate depends on justification
if $game_system.message_event == -1
if $game_system.window_justification == RIGHT
self.x = 640 - $game_system.window_width
elsif $game_system.window_justification == LEFT
self.x = 0
else # center
self.x = (640 - self.width) / 2
end
else
if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
# center on player
event_x = $game_player.screen_x
else
# center on the event specified
event_x = $game_map.events[$game_system.message_event].screen_x
end
self.x = event_x - self.width / 2
@comic.x = self.x + (self.width / 2) + 4
end
if $game_temp.in_battle
self.y = 16
else
if $game_system.message_event == -1
case $game_system.message_position
when 0 # up
self.y = 16
when 1 # middle
self.y = (480 - $game_system.window_height) / 2
when 2 # down
self.y = 480 - $game_system.window_height - 24
end
else
if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
# above player
self.y = $game_player.screen_y - self.height - 48
else
# above event specified
self.y = $game_map.events[$game_system.message_event].screen_y - self.height - 48
end
@comic.y = self.y + self.height - 2
@comic.angle = 0
end
end
if self.y < 0 + ($game_system.name == "" ? 0 : 16)
if $game_system.comic_enabled
if $game_system.message_event == 0 or $game_map.events[$game_system.message_event] == nil
self.y = $game_player.screen_y - 16
else
self.y = $game_map.events[$game_system.message_event].screen_y - 16
end
@comic.angle = 180
@comic.y = self.y + 2
@comic.x = self.x + (self.width / 2) - 4
else
self.y = 0 + ($game_system.name == "" ? 0 : 16)
end
elsif self.y > 480 - self.height
self.y = 480 - self.height
end
if self.x < 0
self.x = 0
elsif self.x > 680 - self.width - 48
self.x = 640 - self.width
end
if change_opacity
if $game_system.message_frame == 0 and $game_temp.message_text != ""
self.opacity = 255
else
self.opacity = 0
end
self.back_opacity = 160
end
# face stuff
if $game_system.face_graphic != ""
# the player has chosen to show a face graphic
if @done and $game_system.resting_face != ""
@face.bitmap = RPG::Cache.picture($game_system.face_graphic + $game_system.resting_face)
if @face_frame * $game_system.face_frame_width >= @face.bitmap.width
@face_frame = 0
end
else
@face.bitmap = RPG::Cache.picture($game_system.face_graphic)
end
# picture y-coordinate
if $game_system.face_graphic_position == ABOVE
@face.y = self.y - @face.bitmap.height
@face_offset = 0
elsif $game_system.face_graphic_position == CENTER
delta = (@face.bitmap.height - self.height) / 2
@face.y = self.y - delta
if $game_system.animated_faces
@face_offset = $game_system.face_frame_width + 16
else
@face_offset = @face.bitmap.width + 16
end
elsif $game_system.face_graphic_position == BOTTOM
@face.y = self.y + self.height - @face.bitmap.height
if $game_system.animated_faces
@face_offset = $game_system.face_frame_width + 16
else
@face_offset = @face.bitmap.width + 16
end
else # side
delta = (@face.bitmap.height - self.height) / 2
@face.y = self.y - delta
@face_offset = 0
end
# picture x-coordinate
if $game_system.face_graphic_justification == LEFT
if $game_system.face_graphic_position == SIDE
@face.x = self.x - @face.bitmap.width
else
@face.x = self.x + 10
end
else # right side
if $game_system.animated_faces
offset = @face.bitmap.width - $game_system.face_frame_width
else
offset = 0
end
if $game_system.face_graphic_position == SIDE
@face.x = self.x + self.width + offset
else
@face.x = self.x + self.width - @face.bitmap.width - 10 + offset
@face_offset = 0
end
end
if $game_system.animated_faces
@face.src_rect = Rect.new(@face_frame * $game_system.face_frame_width, 0, $game_system.face_frame_width, @face.bitmap.height)
if @done and $game_system.resting_face != ""
pause = $game_system.resting_animation_pause
else
pause = $game_system.animation_pause
end
if Graphics.frame_count % pause == 0
@animate_face = true
end
if @animate_face
if Graphics.frame_count % 3 == 0
@face_frame += 1
if @face_frame * $game_system.face_frame_width >= @face.bitmap.width
@face_frame = 0
@animate_face = false
end
end
end
end
end
# name window
if $game_system.name != ""
@name_window.x = self.x
@name_window.y = self.y - 36
@name_window.set_name($game_system.name)
end
# If choice
if $game_temp.choice_max > 0
@choice_window.set_choices($game_temp.choices)
# determine x and y coords for choice window
if $game_system.choice_justification == LEFT
@choice_window.x = self.x
else
@choice_window.x = self.x + self.width - @choice_window.width
end
if $game_system.choice_position == ABOVE
# check to make sure there is enough room above the textbox
if self.y < @choice_window.height
# not enough room above, place below
@choice_window.y = self.y + self.height
else
# draw above
@choice_window.y = self.y - @choice_window.height
end
elsif $game_system.choice_position == BOTTOM
# check to make sure there is enough room below the textbox
if (480 - self.y - self.height) < @choice_window.height
# not enough room below, place above
@choice_window.y = self.y - @choice_window.height
else
# draw below
@choice_window.y = self.y + self.height
end
else # side
if $game_system.choice_justification == LEFT
# check to make sure there's room on the left side
if self.y < @choice_window.width
# not enough room on the side, check to make sure there's room below
if (480 - self.y - self.height) < @choice_window.height
# not enough room below, place above
@choice_window.y = self.y - @choice_window.height
else
# draw below
@choice_window.y = self.y + self.height
end
else
# place on the left side
@choice_window.y = self.y
@choice_window.x = self.x - @choice_window.width
end
else # right
# check to make sure there's room on the right side
if (680 - (self.y + self.width)) < @choice_window.width
# not enough room on the side, check to make sure there's room below
if (480 - self.y - self.height) < @choice_window.height
# not enough room below, place above
@choice_window.y = self.y - @choice_window.height
else
# draw below
@choice_window.y = self.y + self.height
end
else
# place on the left side
@choice_window.y = self.y
@choice_window.x = self.x + self.width
end
end
end
end
# If number input
if $game_temp.num_input_variable_id > 0
if @input_number_window == nil
digits_max = $game_temp.num_input_digits_max
number = $game_variables[$game_temp.num_input_variable_id]
@input_number_window = Window_InputNumber.new(digits_max)
@input_number_window.number = number
end
# determine x and y coords for number input window
if $game_system.choice_justification == LEFT
@input_number_window.x = self.x
else
@input_number_window.x = self.x + self.width - @input_number_window.width
end
if $game_system.choice_position == ABOVE
# check to make sure there is enough room above the textbox
if self.y < @input_number_window.height
# not enough room above, place below
@input_number_window.y = self.y + self.height
else
# draw above
@input_number_window.y = self.y - @choice_window.height
end
elsif $game_system.choice_position == BOTTOM
# check to make sure there is enough room below the textbox
if (480 - self.y - self.height) < @input_number_window.height
# not enough room below, place above
@input_number_window.y = self.y - @input_number_window.height
else
# draw below
@input_number_window.y = self.y + self.height
end
else # side
if $game_system.choice_justification == LEFT
# check to make sure there's room on the left side
if self.y < @input_number_window.width
# not enough room on the side, check to make sure there's room below
if (480 - self.y - self.height) < @input_number_window.height
# not enough room below, place above
@input_number_window.y = self.y - @input_number_window.height
else
# draw below
@input_number_window.y = self.y + self.height
end
else
# place on the left side
@input_number_window.y = self.y
@input_number_window.x = self.x - @choice_window.width
end
else # right
# check to make sure there's room on the right side
if (680 - (self.y + self.width)) < @input_number_window.width
# not enough room on the side, check to make sure there's room below
if (480 - self.y - self.height) < @input_number_window.height
# not enough room below, place above
@input_number_window.y = self.y - @input_number_window.height
else
# draw below
@input_number_window.y = self.y + self.height
end
else
# place on the left side
@input_number_window.y = self.y
@input_number_window.x = self.x + self.width
end
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if (@contents_showing and $game_system.message_event != -1 and $game_system.shake == 0) or $game_system.animated_faces
reset_window(false)
end
if $game_system.shake != 0 # shake the window
if @ascending
if @target_x != self.x
self.x += 1
else
@ascending = false
@target_x = self.x - ($game_system.shake * 2)
end
else
if @target_x != self.x
self.x -= 1
else
@ascending = true
@target_x = self.x + ($game_system.shake * 2)
end
end
end
@name_window.update
if @wait > 0
@wait -= 1
if @wait == 0
terminate_message
return
end
end
# If fade in
if @fade_in
if $game_temp.message_text == "&quo