赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 3849 |
最后登录 | 2015-2-2 |
在线时间 | 47 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 47 小时
- 注册时间
- 2014-7-19
- 帖子
- 25
|
6楼
楼主 |
发表于 2014-9-26 17:45:07
|
只看该作者
VIPArcher 发表于 2014-9-25 23:28
模仿该脚本226到最后的形式自己改一改吧。对新加入的菜单场景模仿这个加一段在下面试试,
未测试 ...
这是第一个:MOG_Adv_Load_Bar- #===============================================================================
- # +++ MOG - Advanced Load Bar (v1.1) +++
- #===============================================================================
- # By Moghunter
- # http://www.atelier-rgss.com
- #===============================================================================
- # Apresenta uma barra de carregar entre as cenas de Save e Load.
- #
- # O propósito deste Script é apresentar alguns artworks de seu jogo
- # enquanto o jogador espera a barra de leitura.
- #
- #===============================================================================
- # Você pode adpatar esse script em alguma outra Scene ou ativar pelo evento.
- # Basta usar este código.
- #
- # SceneManager.call(Scene_Load_Bar)
- #
- #==============================================================================
- # ● Histórico (Version History)
- #==============================================================================
- # v 1.1 - Melhoria no sistema de dispose de imagens.
- #==============================================================================
- module MOG_LOAD_BAR
- # Tempo para fazer load.(Segundos)
- LOAD_DURATION = 3
- # Ativar o sistema ao carregar o jogo.
- ENABLE_LOAD_BAR_FOR_SCENE_LOAD = true
- # Ativar o sistema ao salvar o jogo.
- ENABLE_LOAD_BAR_FOR_SCENE_SAVE = true
- # Definição das imagens que ficarão no plano de fundo.
- LOAD_BACKGROUND_PICTURES = [
- "Background_1",
- "Background_2",
- "Background_3",
- "Background_4",
- "Background_5",
- "Background_6"
- #"Background_7",
- #"Background_8",
- #"Background_9",
- #"Background_10",
- # ...
- ]
- # Ativar ordem aleatória ou sequencial.
- PICTURE_RANDOM_SELECTION = true
- # Posição do geral da Hud.
- LOAD_BAR_POSITION = [30,350]
- # Posição do medidor.
- LOAD_BAR_METER_POSITION = [11,27]
- # Posição do Texto.
- LOAD_BAR_TEXT_POSITION = [ 10, -3]
- # Som ao carregar o arquivo.
- LOAD_SE = "Decision2"
- # Velocidade da animação do medidor.
- LOAD_BAR_FLOW_SPEED = 25
- # Definição da Cena que será ativada após salvar via menu.
- # Caso o save seja feito pelo evento, a cena será o Mapa.
- RETURN_TO_SCENE = Scene_Menu.new(4)
- # Ativar a animação de levitação do texto.
- ENABLE_FLOAT_TEXT_ANIMATION = true
- # Apresentar o sprite do personagem.
- ENABLE_CHARACTER_SPRITE = true
- # Ativar barras laterais.
- ENABLE_STRIPE_SPRITE = true
- # Velocidade das barras laterais.
- STRIPE_SPEED = 1
- end
- #=============================================================================
- # ■ Game_Temp
- #=============================================================================
- class Game_Temp
- attr_accessor :load_bar_pre_index
- attr_accessor :loadbar_type
- attr_accessor :load_pre_bgm
- attr_accessor :load_pre_bgs
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- alias load_bar_initialize initialize
- def initialize
- @load_bar_pre_index = -1
- @loadbar_type = 0
- load_bar_initialize
- end
-
- end
- #=============================================================================
- # ■ Game_System
- #=============================================================================
- class Game_System
- attr_accessor :load_bar_pre_index
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- alias load_bar_initialize initialize
- def initialize
- load_bar_initialize
- @load_bar_pre_index = 0
- end
-
- #--------------------------------------------------------------------------
- # ● BGS Stop
- #--------------------------------------------------------------------------
- def bgs_stop
- Audio.bgs_stop
- end
- end
- #=============================================================================
- # ■ Scene Load Bar
- #=============================================================================
- class Scene_Load_Bar
- include MOG_LOAD_BAR
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def initialize
- execute_dispose
- @bar_type = $game_temp.loadbar_type
- @load_duration_max = 60 * LOAD_DURATION
- @load_duration_max = 60 if @load_duration_max < 60
- @load_duration = 0
- @pictures = LOAD_BACKGROUND_PICTURES
- create_background
- create_layout
- create_load_bar
- create_text
- create_side_strip
- end
-
- #--------------------------------------------------------------------------
- # ● Create Background
- #--------------------------------------------------------------------------
- def create_background
- @background = Sprite.new
- if PICTURE_RANDOM_SELECTION
- $game_system.load_bar_pre_index = rand(@pictures.size)
- no_repeat_picture
- end
- image_name = @pictures[$game_system.load_bar_pre_index]
- image_name = "" if image_name == nil
- @background.bitmap = Cache.picture(image_name)
- $game_temp.load_bar_pre_index = $game_system.load_bar_pre_index
- unless PICTURE_RANDOM_SELECTION
- $game_system.load_bar_pre_index += 1
- $game_system.load_bar_pre_index = 0 if $game_system.load_bar_pre_index > @pictures.size - 1
- end
- end
-
- #--------------------------------------------------------------------------
- # ● No Repeat Picture
- #--------------------------------------------------------------------------
- def no_repeat_picture
- if $game_system.load_bar_pre_index == $game_temp.load_bar_pre_index
- $game_system.load_bar_pre_index += 1
- $game_system.load_bar_pre_index = 0 if $game_system.load_bar_pre_index > @pictures.size - 1
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Create Layout
- #--------------------------------------------------------------------------
- def create_layout
- @hud = Sprite.new
- @hud.bitmap = Cache.system("Load_Bar_Layout")
- @hud.x = LOAD_BAR_POSITION[0]
- @hud.y = LOAD_BAR_POSITION[1]
- @hud.z = 10
- end
-
- #--------------------------------------------------------------------------
- # ● Create Side Strip
- #--------------------------------------------------------------------------
- def create_side_strip
- @stripe1 = Plane.new
- @stripe2 = Plane.new
- if @bar_type == 0
- @stripe1.bitmap = Cache.system("Load_Bar_Stripe1_L")
- @stripe2.bitmap = Cache.system("Load_Bar_Stripe2_L")
- else
- @stripe1.bitmap = Cache.system("Load_Bar_Stripe1_S")
- @stripe2.bitmap = Cache.system("Load_Bar_Stripe2_S")
- end
- @stripe1.z = 1
- @stripe2.z = 1
- @stripe1.visible = ENABLE_STRIPE_SPRITE
- @stripe2.visible = ENABLE_STRIPE_SPRITE
- end
-
- #--------------------------------------------------------------------------
- # ● Create Load Bar
- #--------------------------------------------------------------------------
- def create_load_bar
- @bar_flow = 0
- @bar_image = Cache.system("Load_Bar_Meter")
- @bar_bitmap = Bitmap.new(@bar_image.width,@bar_image.height)
- @bar_range = @bar_image.width / 3
- @bar_width = @bar_range * @load_duration / @load_duration_max
- @bar_height = @bar_image.height
- @bar_width_old = @bar_width
- @bar_src_rect = Rect.new(@bar_flow, 0, @bar_width, @bar_height)
- @bar_bitmap.blt(0,0, @bar_image, @bar_src_rect)
- @bar_sprite = Sprite.new
- @bar_sprite.bitmap = @bar_bitmap
- @bar_sprite.z = 11
- @bar_sprite.x = LOAD_BAR_POSITION[0] + LOAD_BAR_METER_POSITION[0]
- @bar_sprite.y = LOAD_BAR_POSITION[1] + LOAD_BAR_METER_POSITION[1]
- update_bar_flow
- end
-
- #--------------------------------------------------------------------------
- # ● Create Text
- #--------------------------------------------------------------------------
- def create_text
- @text_float_time = 0
- @text_float_y = 0
- @text_image = Cache.system("Load_Bar_Text")
- @text_bitmap = Bitmap.new(@text_image.width,@text_image.height)
- @text_width = @text_image.width
- @text_height = @text_image.height / 2
- @text_src_rect = Rect.new(0, @text_height * @bar_type, @text_width, @text_height)
- @text_bitmap.blt(0,0, @text_image, @text_src_rect)
- @text_sprite = Sprite.new
- @text_sprite.bitmap = @text_bitmap
- @text_fy = LOAD_BAR_POSITION[1] + LOAD_BAR_TEXT_POSITION[1]
- @text_sprite.x = LOAD_BAR_POSITION[0] + LOAD_BAR_TEXT_POSITION[0]
- @text_sprite.y = @text_fy
- @text_sprite.z = 12
- end
-
- #--------------------------------------------------------------------------
- # ● Main
- #--------------------------------------------------------------------------
- def main
- Graphics.transition
- execute_loop
- execute_dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Loop
- #--------------------------------------------------------------------------
- def execute_loop
- loop do
- update
- Graphics.update
- if SceneManager.scene != self
- break
- end
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Dispose
- #--------------------------------------------------------------------------
- def execute_dispose
- return if @hud == nil
- @hud.bitmap.dispose
- @hud.dispose
- @stripe1.bitmap.dispose
- @stripe1.dispose
- @stripe2.bitmap.dispose
- @stripe2.dispose
- @bar_image.dispose
- @bar_bitmap.dispose
- @bar_sprite.bitmap.dispose
- @bar_sprite.dispose
- @background.bitmap.dispose
- @background.dispose
- @text_image.dispose
- @text_bitmap.dispose
- @text_sprite.bitmap.dispose
- @text_sprite.dispose
- Graphics.transition
- Graphics.freeze
- end
-
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- update_bar_flow
- update_bar_duration
- update_float_text
- update_slide_stripe
- end
-
- #--------------------------------------------------------------------------
- # ● Update Slide Stripe
- #--------------------------------------------------------------------------
- def update_slide_stripe
- @stripe1.oy += STRIPE_SPEED
- @stripe2.ox += STRIPE_SPEED
- end
-
- #--------------------------------------------------------------------------
- # ● update_float_text
- #--------------------------------------------------------------------------
- def update_float_text
- return unless ENABLE_FLOAT_TEXT_ANIMATION
- @text_float_time += 1
- case @text_float_time
- when 1..10
- @text_float_y += 1
- when 11..20
- @text_float_y -= 1
- else
- @text_float_y = 0
- @text_float_time = 0
- end
- @text_sprite.y = @text_fy + @text_float_y
- end
-
- #--------------------------------------------------------------------------
- # ● Update Bar Flow
- #--------------------------------------------------------------------------
- def update_bar_flow
- @bar_sprite.bitmap.clear
- @bar_width = @bar_range * @load_duration / @load_duration_max
- @bar_width = @bar_range if @load_duration > @load_duration_max
- @bar_src_rect = Rect.new(@bar_flow, 0,@bar_width, @bar_height)
- @bar_bitmap.blt(0,0, @bar_image, @bar_src_rect)
- @bar_flow += LOAD_BAR_FLOW_SPEED
- if @bar_flow >= @bar_image.width - @bar_range
- @bar_flow = 0
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Update Bar Duration
- #--------------------------------------------------------------------------
- def update_bar_duration
- @load_duration += 1
- if @load_duration == @load_duration_max
- Audio.se_play("Audio/SE/" + LOAD_SE,100,100) rescue nil
- elsif @load_duration == @load_duration_max + 10
- if @bar_type == 0
- SceneManager.return
- $game_system.replay_bgm
- else
- SceneManager.return
- end
- $game_temp.loadbar_type = false
- end
- end
-
- end
- #=============================================================================
- # ■ Scene Save
- #=============================================================================
- class Scene_Save < Scene_File
-
- #--------------------------------------------------------------------------
- # ● On Save Sucess
- #--------------------------------------------------------------------------
- alias mog_advloadbar_on_save_success on_save_success
- def on_save_success
- mog_advloadbar_on_save_success
- $game_temp.loadbar_type = 1
- SceneManager.call(Scene_Load_Bar)
- end
-
- end
- #=============================================================================
- # ■ Scene Load
- #=============================================================================
- class Scene_Load < Scene_File
-
- #--------------------------------------------------------------------------
- # ● On Load Success
- #--------------------------------------------------------------------------
- alias mog_advloadbar_on_load_success on_load_success
- def on_load_success
- mog_advloadbar_on_load_success
- $game_system.save_bgm
- RPG::BGM.stop
- $game_temp.loadbar_type = 0
- SceneManager.call(Scene_Load_Bar)
- end
- end
- $mog_rgss3_advanced_load_bar = true
复制代码 这是第二个MOG_Animated_Title_A- #==============================================================================
- # +++ MOG - Animated Title A (v2.1) +++
- #==============================================================================
- # By Moghunter
- # http://www.atelier-rgss.com/
- #==============================================================================
- # Tela de titulo animado, com logo, imagens aleatórias e outros efeitos visuais.
- #==============================================================================
- #==============================================================================
- # IMAGENS NECESSÁRIAS
- #==============================================================================
- # Serão necessários as seguintes imagens na pasta Graphics/Titles2/
- #
- # Cursor.png
- # Commmand_Name.png (image filename = name of command)
- # Particle.png (Opcional)
- # Logo.jpg (Opcional)
- # Animated.png (Opcional)
- #==============================================================================
- #==============================================================================
- # NOTA 1 - Para definir a imagem de texto basta selecionar no banco de dados
- # a imagem do titulo numero 2 (Segunda camada)
- #==============================================================================
- #==============================================================================
- # NOTA 2 - O nome da imagem de comando é iguál ao nome do comando definido
- # no banco de dados do Rpg Maker.
- #==============================================================================
- #==============================================================================
- # ● Histórico (Version History)
- #==============================================================================
- # v 2.1 - Correção do Bug quando a quantidade de imagens aleatórias é definida
- # com a quantidade menor que 1.
- # v 2.0 - Adição do Sprite Animado. (Opcional)
- # - Adição de cores aleatórias nas partículas.
- # - Adição do multiplas camadas de imagens. (Opcional)
- # - Adição do efeito Wave no texto do titulo.
- # - Opção de definir a velocidade de movimento das partículas.
- # - Opção de ativar ou não o tremor na seleção de comando.
- #
- # v 1.2 - Melhoria no sistema de dispose de imagens.
- #
- # v 1.1 - Opção de pular o logo ao apertar alguma tecla.
- # - Adição de comandos em pictures.
- # - Adição de cursor de comando.
- #==============================================================================
- module MOG_SCENE_TITLE_A
- #--------------------------------------------------------------------------
- # ▼ LOGO ▼
- #--------------------------------------------------------------------------
- # Apresenta um Logo ao começar a tela de titulo.
- # Será necessário ter a imagem LOGO.jpg (png) na pasta Graphics/Title2
- #--------------------------------------------------------------------------
- # Ativar Logo
- LOGO = true
- # Duração do logo.
- LOGO_DURATION = 2 #(Sec)
-
- #--------------------------------------------------------------------------
- # ▼ RANDOM BACKGROUND ▼
- #--------------------------------------------------------------------------
- #Definição das pictures.
- #--------------------------------------------------------------------------
- RANDOM_PICTURES = [
- "Title0", "Title1", "Title2", "Title3"
- #"Title4","Title5","Title6","Title7"
- ]
- #Tempo de duração para ativar a troca de imagens.
- RANDOM_PICTURES_DURATION = 10#(sec)
- #Seleção aleatória.
- RAMDOM_SELECTION = true
- #Velocidade de Scrolling. (Speed X , Speed Y)
- RANDOM_PICTURES_SCROLL_SPEED = [0,0]
-
- #--------------------------------------------------------------------------
- # ▼ MULTIPLE LAYERS ▼
- #--------------------------------------------------------------------------
- # Definição de multiplas camadas. * (não há limíte na quantidade de camadas
- # usadas)
- #--------------------------------------------------------------------------
- # MULTIPLE_LAYERS = [ ["A",B,C,D], ["A",B,C,D], ["A",B,C D], ["A",B,C,D ], ....]
- #
- # A - Nome da imagem.
- # B - Velocidade de scroll na horizontal.
- # C - Velocidade de scroll na vertical.
- # D - Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
- #
- MULTIPLE_LAYERS = [
- ["Layer1",1,0,1],
- ["Layer2",3,0,1],
- ["Layer3",0,0,0]
- # ["Layer4",0,0,0],
- # ["Layer5",0,0,0],
- # ["Layer6",0,0,0]
- ]
-
- #--------------------------------------------------------------------------
- # ▼ PARTICLES ▼
- #--------------------------------------------------------------------------
- # Adiciona partículas animadas na tela do titulo.
- # Será necessário ter a imagem PARTICLE.png na pasta Graphics/Title2
- #--------------------------------------------------------------------------
- # Ativar Partículas.
- PARTICLE = true
- # Ativar Cores Aleatórias.
- PARTICLE_RANDOM_COLOR = true
- # Definição do tipo de blend. (0,1,2)
- PARTICLE_BLEND_TYPE = 1
- #Definição do limite de velocidade das partículas.
- PARTICLE_MOVEMENT_RANGE_X = 3
- PARTICLE_MOVEMENT_RANGE_Y = 3
- PARTICLE_ANGLE_RANGE = 3
-
- #--------------------------------------------------------------------------
- # ▼ WAVE TITLE ▼
- #--------------------------------------------------------------------------
- # Ativa o efeito WAVE no texto do titulo, o Texto do titulo é definido
- # na camada do titulo 2, que pode ser definido através do banco de dados
- #--------------------------------------------------------------------------
- #Ativar o efeito do titulo com efeito WAVE.
- TITLE_WAVE = true
- #Configuração do efeito WAVE
- #
- # TITLE_WAVE_CONFIG = [ AMP, LENGTH , SPEED]
- #
- TITLE_WAVE_CONFIG = [6 , 232 , 360]
-
- #--------------------------------------------------------------------------
- # ▼ ANIMATED_SPRITE ▼ (Opcional)
- #--------------------------------------------------------------------------
- # Adiciona um sprite animado no titulo.
- # A quantidade de frames é proporcional a largura dividido pela altura
- # da imagem, ou seja, não há limite de quantidade de frames e nem de
- # tamanho da imagem.
- # Será necessário ter a imagem ANIMATED.png (Jpg) na pasta Graphics/Title2
- #--------------------------------------------------------------------------
- # Ativar Sprite animado.
- ANIMATED_SPRITE = true
- # Posição do Sprite animado.
- ANIMATED_SPRITE_POSITION = [130,150]
- # Velocidade da animação
- ANIMATED_SPRITE_SPEED = 10
- # Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
- ANIMATED_SPRITE_BLEND_TYPE = 1
- # Definição do zoom,
- ANIMATED_SPRITE_ZOOM = 1.5
-
-
- #--------------------------------------------------------------------------
- # ▼ COMMANDS / SELECTION ▼
- #--------------------------------------------------------------------------
- # Configuração extras da tela de titulo.
- #--------------------------------------------------------------------------
- # Posição do comando.
- COMMANDS_POS = [220 , 280]
- # Ativar o efeito de tremor ao selecionar o comando.
- COMMAND_SHAKE = true
- # Definição da posição do cursor.(Para ajustes)
- CURSOR_POS = [-42,-7]
- # Ativar flash ao mover o comando.
- CURSOR_FLASH_SELECTION = true
- # Definição da posição do flash.
- CURSOR_FLASH_SLECTION_POS = [-180,0]
- # Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
- CURSOR_FLASH_SLECTION_BLEND_TYPE = 1
-
- end
- #==============================================================================
- # ■ Window TitleCommand
- #==============================================================================
- class Window_TitleCommand < Window_Command
- attr_reader :list
- end
- #==============================================================================
- # ■ Particle Title
- #==============================================================================
- class Particle_Title < Sprite
-
- include MOG_SCENE_TITLE_A
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def initialize(viewport = nil)
- super(viewport)
- self.bitmap = Cache.title2("Particle")
- self.tone.set(rand(255),rand(255), rand(255), 255) if PARTICLE_RANDOM_COLOR
- self.blend_type = PARTICLE_BLEND_TYPE
- reset_setting
- end
-
- #--------------------------------------------------------------------------
- # ● Reset Setting
- #--------------------------------------------------------------------------
- def reset_setting
- zoom = (50 + rand(100)) / 100.1
- self.zoom_x = zoom
- self.zoom_y = zoom
- self.x = rand(576) -32
- self.y = rand(448 + self.bitmap.height)
- self.opacity = 0
- self.angle = rand(360)
- @speed_x = [[rand(PARTICLE_MOVEMENT_RANGE_X), PARTICLE_MOVEMENT_RANGE_X].min, 1].max
- @speed_x = 0 if PARTICLE_MOVEMENT_RANGE_X < 1
- @speed_y = [[rand(PARTICLE_MOVEMENT_RANGE_Y), PARTICLE_MOVEMENT_RANGE_Y].min, 1].max
- @speed_y = 0 if PARTICLE_MOVEMENT_RANGE_Y < 1
- @speed_a = [[rand(PARTICLE_ANGLE_RANGE), PARTICLE_ANGLE_RANGE].min, 0].max
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose
- #--------------------------------------------------------------------------
- def dispose
- super
- self.bitmap.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- super
- self.x += @speed_x
- self.y -= @speed_y
- self.angle += @speed_a
- self.opacity += 5
- reset_setting if can_reset_setting?
- end
-
- #--------------------------------------------------------------------------
- # ● Can Reset Setting
- #--------------------------------------------------------------------------
- def can_reset_setting?
- return true if (self.x < -64 or self.x > 600)
- return true if (self.y < -64 or self.y > 500)
- return false
- end
- end
- #==============================================================================
- # ■ Multiple Layers Title
- #==============================================================================
- class Multiple_Layers_Title
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def initialize(name = "", scroll_x = 0, scroll_y = 0, blend = 0, index = 0)
- @layer = Plane.new
- @layer.bitmap = Cache.title1(name.to_s) rescue nil
- @layer.bitmap = Bitmap.new(32,32) if @layer.bitmap == nil
- @layer.z = 10 + index
- @layer.opacity = 0
- @layer.blend_type = blend
- @scroll_speed = [scroll_x, scroll_y]
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose
- #--------------------------------------------------------------------------
- def dispose
- @layer.bitmap.dispose
- @layer.bitmap = nil
- @layer.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- @layer.opacity += 2
- @layer.ox += @scroll_speed[0]
- @layer.oy += @scroll_speed[1]
- end
-
- end
- #==============================================================================
- # ■ Scene Title
- #==============================================================================
- class Scene_Title < Scene_Base
- include MOG_SCENE_TITLE_A
-
- #--------------------------------------------------------------------------
- # ● Start
- #--------------------------------------------------------------------------
- def start
- super
- RPG::BGM.fade(2000)
- @logo_active = LOGO
- SceneManager.clear
- @phase = 1
- @phase_time = -1
- dispose_title_sprites
- create_logo if @logo_active
- create_command_window
- create_commands
- create_background
- create_light
- create_cursor
- create_animated_object
- create_flash_select
- create_multiple_layers
- play_title_music unless @logo_active
- end
-
- #--------------------------------------------------------------------------
- # ● Create Multiple Layers
- #--------------------------------------------------------------------------
- def create_flash_select
- return if !CURSOR_FLASH_SELECTION
- @flash_select = Sprite.new
- @flash_select.bitmap = Cache.title2("Cursor2")
- @flash_select.z = 99
- @flash_select.opacity = 0
- @flash_select.blend_type = CURSOR_FLASH_SLECTION_BLEND_TYPE
- end
-
- #--------------------------------------------------------------------------
- # ● Create Multiple Layers
- #--------------------------------------------------------------------------
- def create_multiple_layers
- @m_layers = []
- index = 0
- for i in MULTIPLE_LAYERS
- @m_layers.push(Multiple_Layers_Title.new(i[0],i[1],i[2],i[3],index))
- index += 1
- end
- end
- #--------------------------------------------------------------------------
- # ● Create_Logo
- #--------------------------------------------------------------------------
- def create_animated_object
- return if !ANIMATED_SPRITE
- @object_index = 0
- @object_animation_speed = 0
- @object = Sprite.new
- @object.z = 98
- @object.opacity = 0
- @object.blend_type = ANIMATED_SPRITE_BLEND_TYPE
- @object.zoom_x = ANIMATED_SPRITE_ZOOM
- @object.zoom_y = ANIMATED_SPRITE_ZOOM
- @object_image = Cache.title2("Animated")
- @object_frame_max = @object_image.width / @object_image.height
- @object_width = @object_image.width / @object_frame_max
- @object.bitmap = Bitmap.new(@object_width,@object_image.height)
- @object.x = ANIMATED_SPRITE_POSITION[0]
- @object.y = ANIMATED_SPRITE_POSITION[1]
- make_object_bitmap
- end
-
- #--------------------------------------------------------------------------
- # ● Create_Logo
- #--------------------------------------------------------------------------
- def create_cursor
- @cursor = Sprite.new
- @cursor.bitmap = Cache.title2("Cursor")
- @cursor.opacity = 0
- @cursor.z = 130
- @cursor_position = [0,0]
- @mx = [0,0,0]
- end
-
- #--------------------------------------------------------------------------
- # ● Create_Logo
- #--------------------------------------------------------------------------
- def create_logo
- @phase = 0
- @logo = Sprite.new
- @logo.bitmap = Cache.title2("Logo")
- @logo.opacity = 0
- @logo_duration = 180 + (LOGO_DURATION * 60)
- @logo.z = 200
- end
-
- #--------------------------------------------------------------------------
- # ● Create Commands
- #--------------------------------------------------------------------------
- def create_commands
- @command_window.visible = false
- @commands_index_old = -1
- @commands = []
- @commands_shake_duration = 0
- index = 0
- for com in @command_window.list
- sprite = Sprite.new
- sprite.bitmap = Cache.title2(com[:name].to_s) rescue nil
- if sprite.bitmap == nil
- sprite.bitmap = Bitmap.new(200,32)
- sprite.bitmap.font.size = 24
- sprite.bitmap.font.bold = true
- sprite.bitmap.font.italic = true
- sprite.bitmap.draw_text(0, 0, 200, 32, com[:name].to_s,1)
- end
- sprite.x = COMMANDS_POS[0] - 100 - (index * 20)
- sprite.y = index * sprite.bitmap.height + COMMANDS_POS[1]
- sprite.z = 100 + index
- sprite.opacity = 0
- index += 1
- @commands.push(sprite)
- end
- @command_max = index
- end
-
- #--------------------------------------------------------------------------
- # ● create_background
- #--------------------------------------------------------------------------
- def create_background
- @rand_title_duration = 120
- @old_back_index = 0
- @sprite1 = Plane.new
- @sprite1.opacity = 0
- @sprite1.z = 1
- if RAMDOM_SELECTION
- execute_random_picture(false)
- else
- execute_random_picture(true)
- end
- @sprite2 = Sprite.new
- @sprite2.bitmap = Cache.title2($data_system.title2_name)
- @sprite2.z = 140
- @sprite2.opacity = 0
- if TITLE_WAVE
- @sprite2.wave_amp = TITLE_WAVE_CONFIG[0]
- @sprite2.wave_length = TITLE_WAVE_CONFIG[1]
- @sprite2.wave_speed = TITLE_WAVE_CONFIG[2]
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Create Light
- #--------------------------------------------------------------------------
- def create_light
- return unless PARTICLE
- @viewport_light = Viewport.new(-32, -32, 576, 448)
- @viewport_light.z = 50
- @light_bitmap =[]
- for i in 0...20
- @light_bitmap.push(Particle_Title.new(@viewport_light))
- end
- end
-
- #--------------------------------------------------------------------------
- # ● dispose Background1
- #--------------------------------------------------------------------------
- def dispose_background1
- @sprite1.bitmap.dispose
- @sprite1.bitmap = nil
- @sprite1.dispose
- @sprite1 = nil
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose Background2
- #--------------------------------------------------------------------------
- def dispose_background2
- if @sprite2.bitmap != nil
- @sprite2.bitmap.dispose
- @sprite2.bitmap = nil
- @sprite2.dispose
- @sprite2 = nil
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose Light
- #--------------------------------------------------------------------------
- def dispose_light
- return unless PARTICLE
- if @light_bitmap != nil
- for i in @light_bitmap
- i.dispose
- end
- @light_bitmap = nil
- end
- @viewport_light.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose Logo
- #--------------------------------------------------------------------------
- def dispose_logo
- return unless @logo_active
- @logo.bitmap.dispose
- @logo.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose Multiple Layers
- #--------------------------------------------------------------------------
- def dispose_multiple_layers
- return if @m_layers == nil
- @m_layers.each {|layer| layer.dispose }
- end
-
- #--------------------------------------------------------------------------
- # ● Terminate
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_title_sprites
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose Title Sprites
- #--------------------------------------------------------------------------
- def dispose_title_sprites
- return if @cursor == nil
- dispose_background1
- dispose_background2
- dispose_light
- dispose_logo
- dispose_multiple_layers
- @cursor.bitmap.dispose
- @cursor.dispose
- @cursor = nil
- if @flash_select != nil
- @flash_select.bitmap.dispose
- @flash_select.dispose
- end
- for com in @commands
- com.bitmap.dispose
- com.dispose
- end
- if ANIMATED_SPRITE
- @object.bitmap.dispose
- @object.dispose
- @object_image.dispose
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- super
- update_logo
- update_initial_animation
- update_command
- update_background
- update_light
- update_object_animation
- update_multiple_layers
- end
-
- #--------------------------------------------------------------------------
- # ● Update Multiple Layers
- #--------------------------------------------------------------------------
- def update_multiple_layers
- return if @m_layers == nil
- @m_layers.each {|layer| layer.update }
- end
-
- #--------------------------------------------------------------------------
- # ● Make Object bitmap
- #--------------------------------------------------------------------------
- def make_object_bitmap
- @object.bitmap.clear
- src_rect_back = Rect.new(@object_width * @object_index, 0,@object_width,@object_image.height)
- @object.bitmap.blt(0,0, @object_image, src_rect_back)
- end
-
- #--------------------------------------------------------------------------
- # ● Update Object Animation
- #--------------------------------------------------------------------------
- def update_object_animation
- return if !ANIMATED_SPRITE
- @object.opacity += 2
- @object_animation_speed += 1
- if @object_animation_speed > ANIMATED_SPRITE_SPEED
- @object_animation_speed = 0
- @object_index += 1
- @object_index = 0 if @object_index >= @object_frame_max
- make_object_bitmap
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Update Cursor Position
- #--------------------------------------------------------------------------
- def update_cursor_position
- @cursor.opacity += 5
- execute_animation_s
- execute_cursor_move(0,@cursor.x,@cursor_position[0] + @mx[1])
- execute_cursor_move(1,@cursor.y,@cursor_position[1])
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Animation S
- #--------------------------------------------------------------------------
- def execute_animation_s
- @mx[2] += 1
- return if @mx[2] < 4
- @mx[2] = 0
- @mx[0] += 1
- case @mx[0]
- when 1..7; @mx[1] += 1
- when 8..14; @mx[1] -= 1
- else
- @mx[0] = 0
- @mx[1] = 0
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Cursor Move
- #--------------------------------------------------------------------------
- def execute_cursor_move(type,cp,np)
- sp = 5 + ((cp - np).abs / 5)
- if cp > np
- cp -= sp
- cp = np if cp < np
- elsif cp < np
- cp += sp
- cp = np if cp > np
- end
- @cursor.x = cp if type == 0
- @cursor.y = cp if type == 1
- end
-
- #--------------------------------------------------------------------------
- # ● Update Logo
- #--------------------------------------------------------------------------
- def update_logo
- return if @phase != 0
- loop do
- break if @logo_duration == 0
- execute_logo
- Graphics.update
- Input.update
- end
- play_title_music
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Logo
- #--------------------------------------------------------------------------
- def execute_logo
- if @logo_duration > 120 and (Input.trigger?(:C) or Input.trigger?(:B))
- @logo_duration = 120
- end
- @logo_duration -= 1
- if @logo_duration > 120
- @logo.opacity += 5
- else
- @logo.opacity -= 5
- end
- if @logo.opacity <= 0
- @logo_duration = 0
- @phase = 1
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Update Background
- #--------------------------------------------------------------------------
- def update_background
- @sprite1.ox += RANDOM_PICTURES_SCROLL_SPEED[0]
- @sprite1.oy += RANDOM_PICTURES_SCROLL_SPEED[1]
- @sprite2.opacity += 2
- @sprite2.update
- return if RANDOM_PICTURES.size < 1
- @rand_title_duration -= 1
- if @rand_title_duration <= 0
- @sprite1.opacity -= 5 unless RANDOM_PICTURES.size < 2
- else
- @sprite1.opacity += 5
- end
- return if @sprite1.opacity != 0
- execute_random_picture
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Random Picture
- #--------------------------------------------------------------------------
- def execute_random_picture(initial = false)
- @rand_title_duration = [[60 * RANDOM_PICTURES_DURATION, 9999].min, 60].max
- if @sprite1.bitmap != nil
- @sprite1.bitmap.dispose
- @sprite1.bitmap = nil
- end
- if RAMDOM_SELECTION
- rand_pic = rand(RANDOM_PICTURES.size)
- if rand_pic == @old_back_index
- rand_pic += 1
- rand_pic = 0 if rand_pic >= RANDOM_PICTURES.size
- end
- @old_back_index = rand_pic
- else
- @old_back_index += 1 unless initial
- @old_back_index = 0 if @old_back_index >= RANDOM_PICTURES.size
- end
- pic = RANDOM_PICTURES[@old_back_index]
- @sprite1.bitmap = Cache.title1(pic) rescue nil
- @sprite1.bitmap = Cache.title1("") if @sprite1.bitmap == nil
- end
-
- #--------------------------------------------------------------------------
- # ● Update Light
- #--------------------------------------------------------------------------
- def update_light
- return unless PARTICLE
- if @light_bitmap != nil
- for i in @light_bitmap
- i.update
- end
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Update Initial Animation
- #--------------------------------------------------------------------------
- def update_initial_animation
- return if @phase != 1
- @phase_time -= 1 if @phase_time > 0
- if @phase_time == 0
- @phase = 2
- @phase_time = 30
- end
- for i in @commands
- index = 0
- if i.x < COMMANDS_POS[0]
- i.x += 5 + (2 * index)
- i.opacity += 10
- if i.x >= COMMANDS_POS[0]
- i.x = COMMANDS_POS[0]
- i.opacity = 255
- if @phase_time < 15 / 2
- @phase_time = 15
- end
- end
- end
- index += 1
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Update Command
- #--------------------------------------------------------------------------
- def update_command
- return if @phase != 2
- update_command_slide
- update_cursor_position
- update_flash_select
- end
-
- #--------------------------------------------------------------------------
- # ● Update Command Slide
- #--------------------------------------------------------------------------
- def update_command_slide
- if @commands_index_old != @command_window.index
- @commands_index_old = @command_window.index
- @commands_shake_duration = 30
- if @flash_select != nil
- @flash_select.opacity = 255
- end
- end
- return if @commands_shake_duration == 0
- @commands_shake_duration -= 1 if @commands_shake_duration > 0
- @commands_shake_duration = 0 if !COMMAND_SHAKE
- for i in @commands
- if (i.z - 100) == @command_window.index
- i.opacity += 10
- @cursor_position = [COMMANDS_POS[0] + CURSOR_POS[0],i.y + CURSOR_POS[1]]
- i.x = COMMANDS_POS[0] + rand(@commands_shake_duration)
- else
- i.opacity -= 7 if i.opacity > 100
- i.x = COMMANDS_POS[0]
- end
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Update Flash Select
- #--------------------------------------------------------------------------
- def update_flash_select
- return if !CURSOR_FLASH_SELECTION
- @flash_select.opacity -= 8
- @flash_select.x = @cursor_position[0] + CURSOR_FLASH_SLECTION_POS[0]
- @flash_select.y = @cursor_position[1] + CURSOR_FLASH_SLECTION_POS[1]
-
- end
-
- end
- $mog_rgss3_animated_title_a = true
复制代码 这是第三个:MOG_Character_Select- #==============================================================================
- # +++ MOG - Scene Character Select V1.1 +++
- #==============================================================================
- # By Moghunter
- # http://www.atelier-rgss.com/
- #==============================================================================
- # Tela de seleção de personagens.
- #==============================================================================
- # 1 - Deverão conter as seguintes imagens na pasta GRAPHICS/SYSTEM.
- #
- # Background
- # Char_Layout01
- # Char_Layout02
- # Char_Status_Layout
- # Number_Char
- #
- # 2 - Imagem de pose. (Opcional)
- # Para ativar a imagem de pose dos personagens, basta ter os arquivos de pose
- # gravados na pasta (GRAPHICS/PICTURES)
- # Você deverá nomear as imagens da seguinte forma.
- #
- # Character + ID_DO_PERSONAGEM
- #
- # Exemplo:
- #
- # Character1.png
- #
- #==============================================================================
- # Para chamar o script use o seguinte comando.
- #
- # SceneManager.call(Scene_Character_Select)
- #
- #==============================================================================
- #==============================================================================
- # ● Histórico (Version History)
- #==============================================================================
- # v 1.1 - Melhoria no sistema de dispose de imagens.
- #==============================================================================
- module MOG_CHARACTER_SELECT_SCREEN
- HIDE_ACTORS_ID = [1]
-
- end
- #==============================================================================
- # ■ Window_Base
- #==============================================================================
- class Window_Base < Window
-
- #--------------------------------------------------------------------------
- # ● draw_picture_number(x,y,value,file_name,align, space, frame_max ,frame_index)
- #--------------------------------------------------------------------------
- # X - Posição na horizontal
- # Y - Posição na vertical
- # VALUE - Valor Numérico
- # FILE_NAME - Nome do arquivo
- # ALIGN - Centralizar 0 - Esquerda 1- Centro 2 - Direita
- # SPACE - Espaço entre os números.
- # FRAME_MAX - Quantidade de quadros(Linhas) que a imagem vai ter.
- # FRAME_INDEX - Definição do quadro a ser utilizado.
- #--------------------------------------------------------------------------
- def draw_picture_number(x,y,value, file_name,align = 0, space = 0, frame_max = 1,frame_index = 0)
- number_image = Cache.system(file_name)
- frame_max = 1 if frame_max < 1
- frame_index = frame_max -1 if frame_index > frame_max -1
- align = 2 if align > 2
- cw = number_image.width / 10
- ch = number_image.height / frame_max
- h = ch * frame_index
- number = value.abs.to_s.split(//)
- case align
- when 0
- plus_x = (-cw + space) * number.size
- when 1
- plus_x = (-cw + space) * number.size
- plus_x /= 2
- when 2
- plus_x = 0
- end
- for r in 0..number.size - 1
- number_abs = number[r].to_i
- number_rect = Rect.new(cw * number_abs, h, cw, ch)
- self.contents.blt(plus_x + x + ((cw - space) * r), y , number_image, number_rect)
- end
- number_image.dispose
- end
- #--------------------------------------------------------------------------
- # ● draw_char_window_status
- #--------------------------------------------------------------------------
- def draw_char_window_status(x,y)
- image = Cache.system("Char_Status_Layout")
- cw = image.width
- ch = image.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(x , y , image, src_rect)
- image.dispose
- end
- end
- #===============================================================================
- # ■ RPG_FileTest
- #===============================================================================
- module RPG_FileTest
-
- #--------------------------------------------------------------------------
- # ● RPG_FileTest.system_exist?
- #--------------------------------------------------------------------------
- def RPG_FileTest.system_exist?(filename)
- return Cache.system(filename) rescue return false
- end
-
- #--------------------------------------------------------------------------
- # ● RPG_FileTest.picture_exist?
- #--------------------------------------------------------------------------
- def RPG_FileTest.picture_exist?(filename)
- return Cache.picture(filename) rescue return false
- end
-
- end
- #==============================================================================
- # ** Window_Character_Status
- #==============================================================================
- class Window_Character_Status < Window_Base
- attr_accessor :index
- #--------------------------------------------------------------------------
- # ● initialize
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 0, 400, 130)
- self.opacity = 0
- actor_id = []
- @index = actor
- for i in 1...$data_actors.size
- actor_id.push($game_actors[i])
- end
- @actor = actor_id[actor -1]
- refresh
- end
- #--------------------------------------------------------------------------
- # ● Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.bold = true
- self.contents.font.italic = true
- draw_char_window_status(0, 6)
- draw_actor_face(@actor, 0, 0)
- draw_actor_name(@actor, 140, -5)
- draw_actor_class(@actor, 60, 70)
- draw_picture_number(155,20,@actor.mhp, "Number_char",1)
- draw_picture_number(145,48,@actor.mmp, "Number_char",1)
- draw_picture_number(228,28,@actor.atk, "Number_char",1)
- draw_picture_number(297,28,@actor.def, "Number_char",1)
- draw_picture_number(207,68,@actor.mat, "Number_char",1)
- draw_picture_number(277,68,@actor.agi, "Number_char",1)
- end
- end
- #==============================================================================
- # ■ Scene Character Select
- #==============================================================================
- class Scene_Character_Select
- include MOG_CHARACTER_SELECT_SCREEN
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def initialize
- setup
- dispose_windows
- create_layout
- create_window_status
- create_char_image
- reset_position(0)
- end
-
- #--------------------------------------------------------------------------
- # ● Setup
- #--------------------------------------------------------------------------
- def setup
- @char_index = 1
- @char_max = $data_actors.size - 1
- @pw_x = 300
- @aw_x = 200
- @nw_x = 100
- end
-
- #--------------------------------------------------------------------------
- # ● Main
- #--------------------------------------------------------------------------
- def main
- Graphics.transition
- execute_loop
- execute_dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Loop
- #--------------------------------------------------------------------------
- def execute_loop
- loop do
- Graphics.update
- Input.update
- update
- if SceneManager.scene != self
- break
- end
- end
- end
-
- #--------------------------------------------------------------------------
- # ● create_background
- #--------------------------------------------------------------------------
- def create_layout
- @background = Plane.new
- @background.bitmap = Cache.system("Background")
- @background.z = 0
- @layout_01 = Sprite.new
- @layout_01.bitmap = Cache.system("Char_Layout01")
- @layout_01.z = 10
- @layout_02 = Sprite.new
- @layout_02.bitmap = Cache.system("Char_Layout02")
- @layout_02.blend_type = 1
- @layout_02.z = 1
- end
-
- #--------------------------------------------------------------------------
- # ● create_window_status
- #--------------------------------------------------------------------------
- def create_window_status
- @window_status = []
- for i in 1...$data_actors.size
- @window_status[i] = Window_Character_Status.new(i)
- @window_status[i].z = 7
- end
- check_active_window
- end
-
- #--------------------------------------------------------------------------
- # ● create_window_status
- #--------------------------------------------------------------------------
- def create_char_image
- @actor_picture = []
- actor_id = []
- for i in 1...$data_actors.size
- actor_id.push($game_actors[i])
- actor = actor_id[i - 1]
- @actor_picture[i] = Sprite.new
- file_name = "Character" + i.to_s
- file_name = "" unless RPG_FileTest.picture_exist?(file_name)
- @actor_picture[i].bitmap = Cache.picture(file_name)
- end
- check_active_picture
- end
- #--------------------------------------------------------------------------
- # ● check_active_window
- #--------------------------------------------------------------------------
- def check_active_window
- for i in 1...$data_actors.size
- @pw = @char_index - 1
- @pw = 1 if @pw > @char_max
- @pw_y = 32
- @pw = @char_max if @pw < 1
- @aw = @char_index
- @aw_y = 160
- @nw = @char_index + 1
- @nw = 1 if @nw > @char_max
- @nw = @char_max if @nw < 1
- @nw_y = 288
- case @window_status[i].index
- when @pw,@aw,@nw
- @window_status[i].visible = true
- else
- @window_status[i].visible = false
- end
- end
- end
-
- #--------------------------------------------------------------------------
- # ● check_active_picture
- #--------------------------------------------------------------------------
- def check_active_picture
- for i in 1...$data_actors.size
- case @window_status[i].index
- when @pw,@aw,@nw
- @actor_picture[i].visible = true
- @actor_picture[@pw].z = 4
- @actor_picture[@aw].z = 6
- @actor_picture[@nw].z = 4
- @actor_picture[@pw].opacity = 120
- @actor_picture[@aw].opacity = 255
- @actor_picture[@nw].opacity = 120
- else
- @actor_picture[i].visible = false
- end
- end
- end
-
- #--------------------------------------------------------------------------
- # ● terminate
- #--------------------------------------------------------------------------
- def execute_dispose
- RPG::BGM.fade(2500)
- Graphics.fadeout(60)
- Graphics.wait(40)
- RPG::BGM.stop
- dispose_windows
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose Windows
- #--------------------------------------------------------------------------
- def dispose_windows
- return if @background == nil
- for i in 1...$data_actors.size
- @window_status[i].dispose
- @actor_picture[i].bitmap.dispose
- @actor_picture[i].dispose
- end
- @background.bitmap.dispose
- @background.dispose
- @background = nil
- @layout_01.bitmap.dispose
- @layout_01.dispose
- @layout_02.bitmap.dispose
- @layout_02.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● update
- #--------------------------------------------------------------------------
- def update
- @background.ox += 1
- update_select
- update_slide_window
- update_slide_image
- end
-
- #--------------------------------------------------------------------------
- # ● update_slide_window
- #--------------------------------------------------------------------------
- def update_slide_window
- @window_status[@aw].x += 1 if @window_status[@aw].x < 0
- @window_status[@nw].x -= 2 if @window_status[@nw].x > -30
- @window_status[@pw].x -= 2 if @window_status[@pw].x > -30
- slide_window_y(@pw,@pw_y)
- slide_window_y(@aw,@aw_y)
- slide_window_y(@nw,@nw_y)
- end
-
- #--------------------------------------------------------------------------
- # ● update_slide_image
- #--------------------------------------------------------------------------
- def update_slide_image
- slide_picture_x(@pw,@pw_x,15)
- slide_picture_x(@aw,@aw_x,5)
- slide_picture_x(@nw,@nw_x,15)
- end
-
- #--------------------------------------------------------------------------
- # ● slide_picture_x
- #--------------------------------------------------------------------------
- def slide_picture_x(i,x_pos,speed)
- if @actor_picture[i].x < x_pos
- @actor_picture[i].x += speed
- @actor_picture[i].x = x_pos if @actor_picture[i].x > x_pos
- end
- if @actor_picture[i].x > x_pos
- @actor_picture[i].x -= speed
- @actor_picture[i].x = x_pos if @actor_picture[i].x < x_pos
- end
- end
-
- #--------------------------------------------------------------------------
- # ● slide_window_y
- #--------------------------------------------------------------------------
- def slide_window_y(i,y_pos)
- if @window_status[i].y < y_pos
- @window_status[i].y += 15
- @window_status[i].y = y_pos if @window_status[i].y > y_pos
- end
- if @window_status[i].y > y_pos
- @window_status[i].y -= 15
- @window_status[i].y = y_pos if @window_status[i].y < y_pos
- end
- end
-
- #--------------------------------------------------------------------------
- # ● reset_position
- #--------------------------------------------------------------------------
- def reset_position(diretion)
- check_active_window
- check_active_picture
- case diretion
- when 0
- @window_status[@pw].y = -64
- @actor_picture[@pw].x = 100
- when 1
- @window_status[@nw].y = 440
- @actor_picture[@nw].x = 400
- end
- end
-
- #--------------------------------------------------------------------------
- # ● update_select
- #--------------------------------------------------------------------------
- def update_select
- if Input.trigger?(Input::DOWN) or Input.trigger?(Input::LEFT)
- Sound.play_cursor
- @char_index += 1
- @char_index = 1 if @char_index > @char_max
- if @char_max < 3
- reset_position(0)
- else
- reset_position(1)
- end
- elsif Input.trigger?(Input::UP) or Input.trigger?(Input::RIGHT)
- Sound.play_cursor
- @char_index -= 1
- @char_index = @char_max if @char_index < 1
- reset_position(0)
- elsif Input.trigger?(Input::C)
- Sound.play_ok
- $game_party.add_actor(@char_index)
- SceneManager.return
- end
- end
- end
- $mog_rgss3_scene_character_select = true
复制代码 这是第四个:MOG_Menu_Cursor- #==============================================================================
- # +++ MOG - Animated Cursor (V1.1) +++
- #==============================================================================
- # By Moghunter
- # http://www.atelier-rgss.com/
- #==============================================================================
- # Adiciona um cursor animado nos menus de comandos.
- #==============================================================================
- # Será necessário ter a imagem
- #
- # Menu_Cursor.png
- #
- # gravado na pasta GRAPHICS/SYSTEM/
- #==============================================================================
- # Ativando a animação do cursor
- #
- # Basta criar uma imagem que tenha a largura com no minimo o dobro de altura da
- # imagem do cursor.
- #
- # EX
- # largura 32 pixel (width) altura 32 pixel = 1 frames de animação.(Sem animação)
- # largura 64 pixel (width) altura 32 pixel = 2 frames de animação.
- # largura 128 pixel (width) altura 32 pixel = 4 frames de animação.
- # largura 256 pixel (width) altura 32 pixel = 8 frames de animação
- # Etc...
- #
- # NOTA
- # Não há limite para quantidade de frames de animação, se não quiser a animação
- # basta criar uma imagem com a altura proporcional a largura da imagem.
- #
- #==============================================================================
- # ● Histórico (Version History)
- #==============================================================================
- # v 1.1 - Correção da posição do cursor na cena de batalha.
- #==============================================================================
- module MOG_MENU_CURSOR
- #Ativar animação do cursor se movimentando para os lados.
- SIDE_ANIMATION = true
- #Definição da posição do cursor. (Ajustes na posição)
- CURSOR_POSITION = [0,0]
- #Definição da velocidade da animação de frames.
- CURSOR_ANIMATION_SPEED = 6
- end
- #==============================================================================
- # ■ Game_System
- #==============================================================================
- class Game_System
-
- attr_accessor :menu_cursor_name
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- alias mog_menu_cursor_initialize initialize
- def initialize
- mog_menu_cursor_initialize
- @menu_cursor_name = "Menu_Cursor"
- end
-
- end
- #==============================================================================
- # ■ Game_Temp
- #==============================================================================
- class Game_Temp
-
- attr_accessor :menu_cursor
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- alias mog_cursor_sprite_initialize initialize
- def initialize
- mog_cursor_sprite_initialize
- @menu_cursor = [false,0,0,0]
- end
-
- end
- #==============================================================================
- # ■ Sprite Cursor
- #==============================================================================
- class Sprite_Cursor < Sprite
-
- include MOG_MENU_CURSOR
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def initialize(viewport = nil , x , y)
- super(viewport)
- @cursor_image = Cache.system($game_system.menu_cursor_name.to_s)
- @frame_max = (@cursor_image.width / @cursor_image.height) rescue 1
- @frame_range = @frame_max > 0 ? (@cursor_image.width / @frame_max) : 1
- @frame = 0
- @ca_speed = CURSOR_ANIMATION_SPEED
- self.bitmap = Bitmap.new(@frame_range,@frame_range)
- self.z = 10000
- self.opacity = 0
- @cw = self.bitmap.width / 2
- @c_p = [-@cw + CURSOR_POSITION[0],CURSOR_POSITION[1]]
- @mx = [0,0,0]
- refresh_animation(true)
- update_move
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose
- #--------------------------------------------------------------------------
- def dispose
- self.bitmap.dispose
- self.bitmap = nil
- @cursor_image.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- if cursor_visible?
- self.visible = true
- update_move
- refresh_animation(false)
- else
- self.visible = false
- end
- end
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def refresh_animation(start = false)
- @ca_speed += 1
- return if @frame_max == 1 and !start
- return if @ca_speed < CURSOR_ANIMATION_SPEED
- @ca_speed = 0
- self.bitmap.clear
- scr_rect = Rect.new(@frame_range * @frame,0,@frame_range,@frame_range)
- self.bitmap.blt(0,0,@cursor_image, scr_rect)
- @frame += 1
- @frame = 0 if @frame >= @frame_max
- end
-
- #--------------------------------------------------------------------------
- # ● Cursor Visible?
- #--------------------------------------------------------------------------
- def cursor_visible?
- px = $game_temp.menu_cursor[2]
- py = $game_temp.menu_cursor[3]
- return false if $game_temp.menu_cursor[1] == 0
- return false if px < 0 or py < 0 or (px == 0 and py == 0)
- return true
- end
-
- #--------------------------------------------------------------------------
- # ● Update Move
- #--------------------------------------------------------------------------
- def update_move
- self.opacity += 25
- @new_pos = [$game_temp.menu_cursor[2],$game_temp.menu_cursor[3]]
- execute_animation_s
- execute_move(0,self.x, @new_pos[0] + @mx[1] + @c_p[0])
- execute_move(1,self.y, @new_pos[1] + @c_p[1])
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Animation S
- #--------------------------------------------------------------------------
- def execute_animation_s
- return if !SIDE_ANIMATION
- @mx[2] += 1
- return if @mx[2] < 4
- @mx[2] = 0
- @mx[0] += 1
- case @mx[0]
- when 1..7; @mx[1] += 1
- when 8..14; @mx[1] -= 1
- else
- @mx[0] = 0
- @mx[1] = 0
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Move
- #--------------------------------------------------------------------------
- def execute_move(type,cp,np)
- sp = 5 + ((cp - np).abs / 5)
- if cp > np
- cp -= sp
- cp = np if cp < np
- elsif cp < np
- cp += sp
- cp = np if cp > np
- end
- self.x = cp if type == 0
- self.y = cp if type == 1
- end
-
- end
- #==============================================================================
- # ■ CURSOR_MENU SPRITE
- #==============================================================================
- module CURSOR_MENU_SPRITE
-
- #--------------------------------------------------------------------------
- # ● Cursor Sprite Enable
- #--------------------------------------------------------------------------
- def cursor_sprite_enable
- return if self.index == nil rescue return
- create_cursor_sprite
- update_cursor_sprite
- update_cusor_position
- if !self.active
- $game_temp.menu_cursor[1] -= 1 if $game_temp.menu_cursor[1] > 0
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Create Cursor Sprite
- #--------------------------------------------------------------------------
- def create_cursor_sprite
- return if @cursor != nil
- return if $game_temp.menu_cursor[0]
- $game_temp.menu_cursor[0] = true
- reset_cursor_position
- @cursor = Sprite_Cursor.new(nil,x,y)
- @cursor_name = $game_system.menu_cursor_name
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose Cursor Sprite
- #--------------------------------------------------------------------------
- def dispose_cursor_sprite
- return if @cursor == nil
- $game_temp.menu_cursor[0] = false
- reset_cursor_position
- @cursor.dispose
- @cursor = nil
- end
- #--------------------------------------------------------------------------
- # ● Reset Cursor Position
- #--------------------------------------------------------------------------
- def reset_cursor_position
- $game_temp.menu_cursor[1] = 0
- $game_temp.menu_cursor[2] = -32
- $game_temp.menu_cursor[3] = -32
- end
-
- #--------------------------------------------------------------------------
- # ● Update Cursor
- #--------------------------------------------------------------------------
- def update_cursor_sprite
- return if @cursor == nil
- @cursor.update
- refresh_cursor_sprite if @cursor_name != $game_system.menu_cursor_name
- end
-
- #--------------------------------------------------------------------------
- # ● Refresh Cursor Sprite
- #--------------------------------------------------------------------------
- def refresh_cursor_sprite
- @cursor_name = $game_system.menu_cursor_name
- dispose_cursor_sprite
- create_cursor_sprite
- end
-
- #--------------------------------------------------------------------------
- # ● Update Cursor Position
- #--------------------------------------------------------------------------
- def update_cusor_position
- return if !can_update_cursor_position?
- x_v = [0,0]
- if SceneManager.scene_is?(Scene_Battle)
- if self.viewport != nil
- x_v = [-self.viewport.ox, self.viewport.rect.y]
- end
- end
- x_e = (self.cursor_rect.x + self.x) - self.ox
- $game_temp.menu_cursor[2] = x_e + x_v[0]
- y_e = (self.cursor_rect.y + self.y + self.cursor_rect.height / 2) - self.oy
- $game_temp.menu_cursor[3] = y_e + x_v[1]
- $game_temp.menu_cursor[1] = 13
- end
-
- #--------------------------------------------------------------------------
- # ● Can Update Cursor
- #--------------------------------------------------------------------------
- def can_update_cursor_position?
- return false if !self.active
- return false if self.index < 0
- return false if !self.visible
- return true
- end
- end
- #==============================================================================
- # ■ Window Base
- #==============================================================================
- class Window_Base < Window
- include CURSOR_MENU_SPRITE
-
- #--------------------------------------------------------------------------
- # ● Dispose
- #--------------------------------------------------------------------------
- alias mog_menu_cursor_base_dispose dispose
- def dispose
- mog_menu_cursor_base_dispose
- dispose_cursor_sprite
- end
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- alias mog_cursor_update update
- def update
- mog_cursor_update
- cursor_sprite_enable
- end
-
- end
- $mog_rgss3_animated_cursor = true
复制代码 这是第五个:MOG_Scene_File_A- #==============================================================================
- # +++ MOG - Scene File A (V1.3) +++
- #==============================================================================
- # By Moghunter
- # http://www.atelier-rgss.com/
- #==============================================================================
- # Tela de salvar e carregar animado versão A.
- #==============================================================================
- # Serão necessários as seguintes imagens na pasta Graphics/System
- #
- # Save_Number.png
- # Save_Background.png
- # Save_Character_Floor.png
- # Save_Layout01.png
- # Save_Layout02.png
- # Save_Window01.png
- # Save_Window02.png
- #
- #==============================================================================
- #
- #==============================================================================
- # ● Histórico (Version History)
- #==============================================================================
- # v 1.3 - Melhor codificação.
- # v 1.1 - Melhoria no sistema de dispose de imagens.
- #==============================================================================
- module MOG_SCENE_FILE
- #Quantidade de slots de saves.
- FILES_MAX = 9
- end
- #==============================================================================
- # ■ Game Temp
- #==============================================================================
- class Game_Temp
- attr_accessor :scene_save
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- alias mog_scene_file_initialize initialize
- def initialize
- mog_scene_file_initialize
- @scene_save = false
- end
-
- end
- #==============================================================================
- # ■ Window_Base
- #==============================================================================
- class Window_Base < Window
-
- #--------------------------------------------------------------------------
- # ● draw_picture_number(x,y,value,file_name,align, space, frame_max ,frame_index)
- #--------------------------------------------------------------------------
- # X - Posição na horizontal
- # Y - Posição na vertical
- # VALUE - Valor Numérico
- # FILE_NAME - Nome do arquivo
- # ALIGN - Centralizar 0 - Esquerda 1- Centro 2 - Direita
- # SPACE - Espaço entre os números.
- # FRAME_MAX - Quantidade de quadros(Linhas) que a imagem vai ter.
- # FRAME_INDEX - Definição do quadro a ser utilizado.
- #--------------------------------------------------------------------------
- def draw_picture_number(x,y,value, file_name,align = 0, space = 0, frame_max = 1,frame_index = 0)
- number_image = Cache.system(file_name)
- frame_max = 1 if frame_max < 1
- frame_index = frame_max -1 if frame_index > frame_max -1
- align = 2 if align > 2
- cw = number_image.width / 10
- ch = number_image.height / frame_max
- h = ch * frame_index
- number = value.abs.to_s.split(//)
- case align
- when 0
- plus_x = (-cw + space) * number.size
- when 1
- plus_x = (-cw + space) * number.size
- plus_x /= 2
- when 2
- plus_x = 0
- end
- for r in 0..number.size - 1
- number_abs = number[r].to_i
- number_rect = Rect.new(cw * number_abs, h, cw, ch)
- self.contents.blt(plus_x + x + ((cw - space) * r), y , number_image, number_rect)
- end
- number_image.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Draw Help Layout
- #--------------------------------------------------------------------------
- def draw_face_save(name,x,y,type)
- if type == 0
- image_name = name + "_0"
- elsif type == 1
- image_name = name + "_1"
- else
- image_name = name + "_2"
- end
- image = Cache.face(image_name)
- cw = image.width
- ch = image.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(x , y , image, src_rect)
- image.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● draw_parameter_layout
- #--------------------------------------------------------------------------
- def draw_parameter_layout(x,y)
- image = Cache.system("Save_Window01")
- cw = image.width
- ch = image.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(x , y , image, src_rect)
- image.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● draw_parameter_layout2
- #--------------------------------------------------------------------------
- def draw_parameter_layout2(x,y,type)
- if type == 0
- image = Cache.system("Save_Window02")
- else
- image = Cache.system("Save_Window03")
- end
- cw = image.width
- ch = image.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(x , y , image, src_rect)
- image.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● draw_character_floor
- #--------------------------------------------------------------------------
- def draw_character_floor(x,y)
- image = Cache.system("Save_Character_Floor")
- cw = image.width
- ch = image.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(x , y , image, src_rect)
- image.dispose
- end
-
- end
-
- #==============================================================================
- # ■ DataManager
- #==============================================================================
- module DataManager
- #--------------------------------------------------------------------------
- # ● Make Save Header
- #--------------------------------------------------------------------------
- def self.make_save_header
- header = {}
- header[:characters] = $game_party.characters_for_savefile
- header[:playtime_s] = $game_system.playtime_s
- header[:playtime] = $game_system.playtime
- header[:map_name] = $game_map.display_name
- header[:members] = $game_party.members
- header
- end
- end
- #==============================================================================
- # ■ Window_SaveFile
- #==============================================================================
- class Window_SaveFile_A < Window_Base
- attr_reader :filename
- attr_reader :file_exist
- attr_reader :time_stamp
- attr_reader :selected
- attr_reader :file_index
-
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def initialize(file_index, filename)
- super(0, 0,720, 140)
- self.opacity = 0
- @file_index = file_index
- @filename = filename
- load_gamedata
- refresh
- @selected = false
- end
-
- #--------------------------------------------------------------------------
- # ● load_gamedata
- #--------------------------------------------------------------------------
- def load_gamedata
- @time_stamp = Time.at(0)
- @file_exist = FileTest.exist?(@filename)
- if @file_exist
- header = DataManager.load_header(@file_index)
- if header == nil
- @file_exist = false
- return
- end
- @characters = header[:characters]
- @total_sec = header[:playtime]
- @mapname = header[:map_name]
- @members = header[:members]
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = normal_color
- xp = 96
- ex = 60
- if @file_exist
- if @total_sec == nil
- draw_parameter_layout2(0,50,0)
- draw_parameter_layout(-10 + xp,0)
- value = @file_index + 1
- draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,0)
- self.contents.draw_text(140, 50, 450, 32, "Error! - Please, dont't use your old Save Files...", 0)
- return
- end
- draw_parameter_layout2(0,50,0)
- draw_parameter_layout(-10 + xp,0)
- value = @file_index + 1
- draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,0)
- draw_party_characters(180 + xp, 75,ex)
- draw_playtime(495, 20, contents.width - 4, 2)
- draw_map_location( 400 + xp,64)
- draw_level(185 + xp,85,ex)
- draw_face_save(40 + xp,0)
- else
- draw_parameter_layout2(0,50,1)
- draw_parameter_layout(-10 + xp,0)
- value = @file_index + 1
- draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,0)
- self.contents.draw_text(260, 50, 120, 32, "No Data", 1)
- end
- end
-
- #--------------------------------------------------------------------------
- # ● draw_face
- #--------------------------------------------------------------------------
- def draw_face_save(x,y)
- draw_actor_face(@members[0], x, y)
- end
-
- #--------------------------------------------------------------------------
- # ● draw_level
- #--------------------------------------------------------------------------
- def draw_level(x,y,ex)
- self.contents.font.color = normal_color
- for i in [email protected]
- break if i > 3
- level = @members[i].level
- draw_picture_number(x + (ex * i) , y ,level, "Save_Number_01",1,0,3,1)
- end
- end
-
- #--------------------------------------------------------------------------
- # ● draw_map_location
- #--------------------------------------------------------------------------
- def draw_map_location(x,y)
- self.contents.font.bold = true
- self.contents.font.name = "Georgia"
- self.contents.font.size = 20
- self.contents.font.italic = true
- self.contents.draw_text(x, y, 125, 32, @mapname.to_s, 0)
- end
- #--------------------------------------------------------------------------
- # ● draw_party_characters
- #--------------------------------------------------------------------------
- def draw_party_characters(x, y,ex)
- for i in [email protected]
- break if i > 3
- name = @characters[i][0]
- index = @characters[i][1]
- draw_character_floor(- 35 + x + i * ex,y - 20)
- draw_character(name, index, x + i * ex, y)
- end
- end
-
- #--------------------------------------------------------------------------
- # ● draw_playtime
- #--------------------------------------------------------------------------
- def draw_playtime(x, y, width, align)
- hour = @total_sec / 60 / 60
- min = @total_sec / 60 % 60
- sec = @total_sec % 60
- time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
- draw_picture_number(x + 18 * 0, y ,0, "Save_Number_01",0,0,3,0) if hour < 10
- draw_picture_number(x + 18 * 1, y ,hour, "Save_Number_01",0,0,3,0)
- draw_picture_number(x + 18 * 3, y ,0, "Save_Number_01",0,0,3,0) if min < 10
- draw_picture_number(x + 18 * 4, y ,min, "Save_Number_01",0,0,3,0)
- draw_picture_number(x + 18 * 6, y ,0, "Save_Number_01",0,0,3,0) if sec < 10
- draw_picture_number(x + 18 * 7, y ,sec , "Save_Number_01",0,0,3,0)
- end
-
- #--------------------------------------------------------------------------
- # ● selected
- #--------------------------------------------------------------------------
- def selected=(selected)
- @selected = selected
- end
- end
- #==============================================================================
- # ■ Scene Save
- #==============================================================================
- class Scene_Save < Scene_File
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def initialize
- $game_temp.scene_save = true
- super
- end
- end
- #==============================================================================
- # ■ Scene Load
- #==============================================================================
- class Scene_Load < Scene_File
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- def initialize
- $game_temp.scene_save = false
- super
- end
- end
- #==============================================================================
- # ■ Scene_File
- #==============================================================================
- class Scene_File
- include MOG_SCENE_FILE
-
-
- #--------------------------------------------------------------------------
- # ● initialize
- #--------------------------------------------------------------------------
- def initialize
- @saving = $game_temp.scene_save
- @file_max = FILES_MAX
- @file_max = 1 if FILES_MAX < 1
- execute_dispose
- create_layout
- create_savefile_windows
- @index = DataManager.last_savefile_index
- @check_prev_index = true
- @savefile_windows[@index].selected = true
- end
-
- #--------------------------------------------------------------------------
- # ● Main
- #--------------------------------------------------------------------------
- def main
- Graphics.transition
- execute_loop
- execute_dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Loop
- #--------------------------------------------------------------------------
- def execute_loop
- loop do
- Graphics.update
- Input.update
- update
- if SceneManager.scene != self
- break
- end
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Create_background
- #--------------------------------------------------------------------------
- def create_layout
- @background = Plane.new
- @background.bitmap = Cache.system("Save_Background")
- @background.z = 0
- @layout_01 = Sprite.new
- @layout_01.bitmap = Cache.system("Save_Layout01")
- @layout_01.z = 1
- @layout_01.blend_type = 1
- image = Cache.system("Save_Layout02")
- @bitmap = Bitmap.new(image.width,image.height)
- cw = image.width
- ch = image.height / 2
- if @saving
- h = 0
- else
- h = ch
- end
- src_rect = Rect.new(0, h, cw, ch)
- @bitmap.blt(0,0, image, src_rect)
- @layout_02 = Sprite.new
- @layout_02.bitmap = @bitmap
- @layout_02.z = 3
- @layout_02.y = 370
- image.dispose
- end
-
- #--------------------------------------------------------------------------
- # ● Execute Dispose
- #--------------------------------------------------------------------------
- def execute_dispose
- return if @background == nil
- Graphics.freeze
- @background.bitmap.dispose
- @background.dispose
- @background = nil
- @layout_01.bitmap.dispose
- @layout_01.dispose
- @layout_02.bitmap.dispose
- @layout_02.dispose
- @bitmap.dispose
- dispose_item_windows
- end
-
- #--------------------------------------------------------------------------
- # ● Frame Update
- #--------------------------------------------------------------------------
- def update
- update_savefile_windows
- update_savefile_selection
- check_start_index
- end
-
- #--------------------------------------------------------------------------
- # ● check_start_index
- #--------------------------------------------------------------------------
- def check_start_index
- return if @check_prev_index == false
- @check_prev_index = false
- check_active_window
- end
-
- #--------------------------------------------------------------------------
- # ● check_active_window
- #--------------------------------------------------------------------------
- def check_active_window
- @index = 0 if @index == nil
- for i in 0...@file_max
- @pw = @index - 1
- @pw = 0 if @pw > @file_max - 1
- @pw = @file_max- 1 if @pw < 0
- @aw = @index
- @nw = @index + 1
- @nw = 0 if @nw > @file_max - 1
- @nw = @file_max - 1 if @nw < 0
- case @savefile_windows[i].file_index
- when @pw,@nw
- @savefile_windows[i].visible = true
- @savefile_windows[i].contents_opacity = 80
- when @aw
- @savefile_windows[i].visible = true
- @savefile_windows[i].contents_opacity = 255
- else
- @savefile_windows[i].visible = false
- end
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Create Save File Window
- #--------------------------------------------------------------------------
- def create_savefile_windows
- @pw_pos = [-160,32]
- @aw_pos = [-96,160]
- @nw_pos = [-32,288]
- @savefile_windows = []
- for i in 0...@file_max
- @savefile_windows[i] = Window_SaveFile_A.new(i, DataManager.make_filename(i))
- @savefile_windows[i].z = 2
- @savefile_windows[i].visible = false
- @savefile_windows[i].x = 400
- end
- check_active_window
- @item_max = @file_max
- end
-
- #--------------------------------------------------------------------------
- # ● Dispose of Save File Window
- #--------------------------------------------------------------------------
- def dispose_item_windows
- for window in @savefile_windows
- window.dispose
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Update Save File Window
- #--------------------------------------------------------------------------
- def update_savefile_windows
- update_slide_window
- for window in @savefile_windows
- window.update
- end
- end
-
- #--------------------------------------------------------------------------
- # ● update_slide_window
- #--------------------------------------------------------------------------
- def update_slide_window
- @background.ox += 1
- slide_window_x(@pw,@pw_pos[0])
- slide_window_x(@aw,@aw_pos[0])
- slide_window_x(@nw,@nw_pos[0])
- slide_window_y(@pw,@pw_pos[1])
- slide_window_y(@aw,@aw_pos[1])
- slide_window_y(@nw,@nw_pos[1])
- end
-
- #--------------------------------------------------------------------------
- # ● slide_window_x
- #--------------------------------------------------------------------------
- def slide_window_x(i,x_pos)
- if @savefile_windows[i].x < x_pos
- @savefile_windows[i].x += 15
- @savefile_windows[i].x = x_pos if @savefile_windows[i].x > x_pos
- end
- if @savefile_windows[i].x > x_pos
- @savefile_windows[i].x -= 15
- @savefile_windows[i].x = x_pos if @savefile_windows[i].x < x_pos
- end
- end
-
- #--------------------------------------------------------------------------
- # ● slide_window_y
- #--------------------------------------------------------------------------
- def slide_window_y(i,y_pos)
- if @savefile_windows[i].y < y_pos
- @savefile_windows[i].y += 15
- @savefile_windows[i].y = y_pos if @savefile_windows[i].y > y_pos
- end
- if @savefile_windows[i].y > y_pos
- @savefile_windows[i].y -= 15
- @savefile_windows[i].y = y_pos if @savefile_windows[i].y < y_pos
- end
- end
-
- #--------------------------------------------------------------------------
- # ● reset_position
- #--------------------------------------------------------------------------
- def reset_position(diretion)
- check_active_window
- case diretion
- when 0
- @savefile_windows[@pw].y = -64
- @savefile_windows[@pw].x = 0
- when 1
- @savefile_windows[@nw].y = 440
- @savefile_windows[@nw].x = 0
- end
- end
-
- #--------------------------------------------------------------------------
- # ● Update Save File Selection
- #--------------------------------------------------------------------------
- def update_savefile_selection
- if Input.trigger?(Input::C)
- on_savefile_ok
- elsif Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- else
- last_index = @index
- if Input.trigger?(Input::DOWN)
- execute_index(1)
- if @file_max > 2
- reset_position(1)
- else
- reset_position(0)
- end
- end
- if Input.trigger?(Input::UP)
- execute_index(-1)
- reset_position(0)
- end
- if @index != last_index
- Sound.play_cursor
- @savefile_windows[last_index].selected = false
- @savefile_windows[@index].selected = true
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● Execute Index
- #--------------------------------------------------------------------------
- def execute_index(value)
- @index += value
- @index = @index >= @file_max ? 0 : @index < 0 ? (@file_max - 1) : @index
- end
-
- end
- $mog_rgss3_scene_file = true
复制代码 最后一个是最开始发的那个 |
|