Taijo XMenu
2 participantes
Página 1 de 1
Taijo XMenu
Taijo XMenu
Esse menu é na horizontal, é um pedido de um antigo membro da The maker
Xp
Xp
Screen:
Substitua seu Scene_Menu por isso:
- Código:
#==============================================================================
# Taijo XMenu
#------------------------------------------------------------------------------
# Menu padrão do Rtp com algumas modificações feitas pelo TaijovuNeji
#------------------------------------------------------------------------------
#==============================================================================
class Window_Selectable2 < Window_Base
attr_reader :index # Posição do Cursor
attr_reader :help_window # Janela de Ajuda
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
def index=(index)
@index = index
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
def row_max
return (@item_max + @column_max - 1) / @column_max
end
def top_row
return self.oy / 32
end
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 32
end
def page_row_max
return (self.height - 32) / 32
end
def page_item_max
return page_row_max * @column_max
end
def help_window=(help_window)
@help_window = help_window
if self.active and @help_window != nil
update_help
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, cursor_width, 32)
end
def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::RIGHT)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
if Input.repeat?(Input::LEFT)
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
if Input.repeat?(Input::DOWN)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
if Input.repeat?(Input::UP)
if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
self.top_row += self.page_row_max
end
end
if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
self.top_row -= self.page_row_max
end
end
end
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
end
class Window_MenuBar < Window_Selectable
def initialize(index = 0)
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.index = index
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 22
@item_max = 5
@column_max = 5
@commands = [" Item"," Skill","Equip","Status"," Salve"]
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index, color = normal_color)
self.contents.font.color = color
x = 100 + index * 80 + 140
self.contents.draw_text(x-122, 0, 144, 32, @commands[index])
end
def disable_item(index)
draw_item(index, disabled_color)
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = 70
x = @index % @column_max * 81 + 108
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, cursor_width, 32)
end
end
#==============================================================================
# Window_Gold
#------------------------------------------------------------------------------
# Janela que exibe o dinheiro
#==============================================================================
class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# - Inicialização dos Objetos
#--------------------------------------------------------------------------
def initialize
super(0, 0, 190, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
#--------------------------------------------------------------------------
# - Atualização
#--------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(34, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(154-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
# This window displays play time on the menu screen.
#==============================================================================
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 210, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(2, 0, 135, 32, "Play Time")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(43, 3, 135, 32, text, 2)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
class Window_MenuStatus < Window_Selectable2
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 167)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = (i * 210)+60
y = 0
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 35, y + 70)
draw_actor_name(actor, x-60, y-8)
draw_actor_class(actor, x +35, y-8)
draw_actor_level(actor, x-60, y + 78)
draw_actor_state(actor, x +38, y+78)
draw_actor_exp(actor, x-60, y + 110)
draw_actor_hp(actor, x + 0, y + 22)
draw_actor_sp(actor, x + 0, y + 54)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set((@index * 212)-10, -10,self.width - 435, 156)
end
end
end
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@command_window = Window_MenuBar.new(@menu_index)
@command_window.width = 640
@command_window.height = 65
@command_window.y = 0
@command_window.z = 3
@command_window.index = @menu_index
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
@command_window.disable_item(4)
end
@spriteset = Spriteset_Map.new
@playtime_window = Window_PlayTime.new
@playtime_window.x = 240
@playtime_window.y = 250
@gold_window = Window_Gold.new
@gold_window.x = 450
@gold_window.y = 250
@gold_window.contents.font.size = 15
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = 313
@local_window = Window_Local.new
@local_window.x = 0
@local_window.y = 250
Graphics.transition(30, "Graphics/Transitions/" + "020-Flat01")
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
@local_window.dispose
end
end
def update
@command_window.update
@playtime_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_Save.new
end
return
end
end
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
class Window_Local < Window_Base
def initialize
super(0, 0, 240, 64)
self.contents = Bitmap.new (width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 10
refresh
end
def refresh
self.contents.clear
$maps = load_data("Data/MapInfos.rxdata")
@map_id = $game_map.map_id
@currmap = $maps[@map_id].name
self.contents.font.size = 22
self.contents.font.color = normal_color
self.contents.draw_text(75, 0, 120, 32, @currmap)
self.contents.font.color = system_color
self.contents.draw_text(2, 0, 135, 32, "Mapa:")
end
end
Obs: Esse menu é para somente 3 personagens... se for colocado um 4 ele não vai aparecer no menu.. dah para selecionar ele mas ele fica pra fora do menu
Espero que gostem deste menu .. foi o que me deu mais trabalho pra fazer XD
TaijovuNeji- Novato
- Mensagens : 2
Moedas : 5381
Data de inscrição : 06/09/2009
Re: Taijo XMenu
Nossa, que legaal !
Só achei estranho estar escrito Salve, sendo que Skill está em Inglês ( Habilidades/Magias )
Mas modificando-o fica ótimo ! *---------*'
+ 10 Moedas
Só achei estranho estar escrito Salve, sendo que Skill está em Inglês ( Habilidades/Magias )
Mas modificando-o fica ótimo ! *---------*'
+ 10 Moedas
Re: Taijo XMenu
Oxi eu nem tinha percebido que coloquei o save em portugues XD
Mas que bom que tu gostou ^^
Quando der eu posto o resto dos meus scripts aki ^.^
Mas que bom que tu gostou ^^
Quando der eu posto o resto dos meus scripts aki ^.^
TaijovuNeji- Novato
- Mensagens : 2
Moedas : 5381
Data de inscrição : 06/09/2009
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|