#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
# This class performs save screen processing.
#==============================================================================
class Scene_Torch
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def main
# Make background transparant
@background = Spriteset_Map.new
# Make ask window
@torchAsk_window = Window_TorchAsk.new
# Make command window
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Torch"
s5 = "Status"
s6 = "Save"
s7 = "End Game"
@commandInTorch_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@commandInTorch_window.y = 480 - @commandInTorch_window.height
@commandInTorch_window.cursor_rect.set(0, 3 * 32, @commandInTorch_window.width - 32, 32)
@commandInTorch_window.active = false
# Make command window
s1 = "Use Torch"
s2 = "Put torch away"
@torch_window = Window_Command.new(192, [s1, s2])
@torch_window.x = 300
@torch_window.y = 320
# Make gold window
@gold_window = Window_Gold.new
@gold_window.x = 640 - @gold_window.width
@gold_window.y = 0
# Make window's opacity less
@commandInTorch_window.back_opacity = 160
@torch_window.back_opacity = 160
@torchAsk_window.back_opacity = 160
@gold_window.back_opacity = 160
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame Update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of window
@torch_window.dispose
@torchAsk_window.dispose
@background.dispose
@commandInTorch_window.dispose
@gold_window.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@torch_window.update
@torchAsk_window.update
@background.update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(3)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @torch_window.index
when 0 # Torch
command_torch
when 1 # Torch Away
command_torch_away
end
return
end
end
#--------------------------------------------------------------------------
# * Process When Choosing [Open Torch] Command
#--------------------------------------------------------------------------
def command_torch
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make torch graphic
@torchPicture = Sprite.new
@torchPicture.bitmap = RPG::Cache.picture("Torch")
end
#--------------------------------------------------------------------------
# * Process When Choosing [Close Torch] Command
#--------------------------------------------------------------------------
def command_torch_away
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Dispose of torch graphic
@torchPicture.bitmap.dispose
@torchPicture.dispose
end
end