Dodoop menu plus

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

Dodoop menu plus

Mensagem  roberto em Ter Mar 16, 2010 3:47 pm

Autor:dodoop.

Versão: 1.0.

Descrisão:Um menu simples e bonito com barras de hp e sp.

Créditos:
dodoop:Eu por ter criado o script e o disponibilizado.
XRXS:Por ter criado o script de barras de hp e sp.

imagem


script:
Spoiler:
#################################################################
#############Nome:Dodoop menu plus###############################
#############Autor:dodoop########################################
#############Versão:1.0##########################################
#################################################################
#Descrisão:Um menu simples e bonito com barras de hp e sp.
#################################################################
#################################################################
#Configuração:###################################################
#################################################################
################################################################
Mapa_fundo = true # true para deixar que o mapa fique como fundo.
Tempo_de_jogo_opa = 0 #Opacidade da janela de tempo de jogo.
Número_passos_opa = 0 #Opacidade da janela de numero de passos.
Janela_Dinheiro_opa = 0 #Opacidade da janela de dinheiro.
Janela_status_opa = 0 #Opacidade da janela de status.
Janela_comando_opa = 0 # Opacidade da janela de comandos.
#################################################################
#################################################################
#Créditos de agradecimentos:Ao site XRXS por ter criado as barras
#de hp e sp que eu dodoop modifiquei.
#################################################################
#==============================================================================
# Scene_Menu
#------------------------------------------------------------------------------
# Esta classe processa a Tela de Menu
#==============================================================================

class Scene_Menu

#--------------------------------------------------------------------------
# Inicialização dos Objetos
#
# menu_index : posição inicial do cursor de comando
#--------------------------------------------------------------------------

def initialize(menu_index = 0)
@menu_index = menu_index
end

#--------------------------------------------------------------------------
# Processamento Principal
#--------------------------------------------------------------------------

def main
if Mapa_fundo
@spriteset = Spriteset_Map.new
end
# Criar janela de comando
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Salvar"
s6 = "Fim de Jogo"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
@command_window.x = 490
@command_window.y = 200
@command_window.opacity = Janela_comando_opa
# Se o número de membros do Grupo de Heróis for 0
if $game_party.actors.size == 0
# Desabilar as janelas de Item, Habilidades, Equipamento e Status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# Se Salvar for Proibido
if $game_system.save_disabled
# Desabilitar Salvar
@command_window.disable_item(4)
end

# Criar janela de Tempo de Jogo
@playtime_window = Window_PlayTime.new
@playtime_window.x = -10
@playtime_window.y = 224
@playtime_window.opacity = Tempo_de_jogo_opa

# Criar janela de Número Passos
@steps_window = Window_Steps.new
@steps_window.x = -10
@steps_window.y = 320
@steps_window.opacity = Número_passos_opa

# Criar janela de Dinheiro
@gold_window = Window_Gold.new
@gold_window.x = -10
@gold_window.y = 416
@gold_window.opacity = Janela_Dinheiro_opa

# Criar janela de Status
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = -10
@status_window.opacity = Janela_status_opa

# Executar transição
Graphics.transition
# Loop principal
loop do
# Atualizar a tela de jogo
Graphics.update
# Atualizar a entrada de informações
Input.update
# Atualizar Frame
update
# Abortar loop se a tela for alterada
if $scene != self
break
end
end
# Preparar para transiçõa
Graphics.freeze
# Exibição das janelas
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
end

#--------------------------------------------------------------------------
# Atualização do Frame
#--------------------------------------------------------------------------

def update
# Atualizar janelas
@command_window.update
@playtime_window.update
@steps_window.update
@gold_window.update
@status_window.update
# Se a janela de comandos estiver ativo: chamar update_command
if @command_window.active
update_command
return
end
# Se a janela de Status estiver ativa: call update_status
if @status_window.active
update_status
return
end
end

#--------------------------------------------------------------------------
# Atualização do Frame (Quando a janela de Comandos estiver Ativa)
#--------------------------------------------------------------------------

def update_command
# Se o botão B for pressionado
if Input.trigger?(Input::B)
# Reproduzir SE de cancelamento
$game_system.se_play($data_system.cancel_se)
# Alternar para a tela do mapa
$scene = Scene_Map.new
return
end
# Se o botão C for pressionado
if Input.trigger?(Input::C)
# Se o comando for outro senão Salvar, Fim de Jogo e o número de Heróis no
# Grupo for 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Reproduzir SE de erro
$game_system.se_play($data_system.buzzer_se)
return
end
# Ramificação por posição do cursor na janela de comandos
case @command_window.index
when 0 # Itens
# Reproduzir SE de OK
$game_system.se_play($data_system.decision_se)
# Alternar para a tela de Itens
$scene = Scene_Item.new
when 1 # Habilidades
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Ativar o status da janela
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # Equipamentos
# Reproduzir SE de OK
$game_system.se_play($data_system.decision_se)
# Ativar o status da janela
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # Status
# Reproduzir SE de OK
$game_system.se_play($data_system.decision_se)
# Ativar o status da janela
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # Salvar
# Se Salvar for proibido
if $game_system.save_disabled
# Reproduzir SE de erro
$game_system.se_play($data_system.buzzer_se)
return
end
# Reproduzir SE de OK
$game_system.se_play($data_system.decision_se)
# Alternar para a tela de save
$scene = Scene_Save.new
when 5 # Fim de Jogo
# Reproduzir SE de OK
$game_system.se_play($data_system.decision_se)
# Alternar para a tela de Fim de Jogo
$scene = Scene_End.new
end
return
end
end

#--------------------------------------------------------------------------
# Atualização do Frame (Quando o status da Janela estiver Ativo)
#--------------------------------------------------------------------------

def update_status
# Se o botão B for pressionado
if Input.trigger?(Input::B)
# Reproduzir SE de cancelamento
$game_system.se_play($data_system.cancel_se)
# Torna a janela de comandos ativa
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# Se o botão C for pressionado
if Input.trigger?(Input::C)
# Ramificação por posição do cursor na janela de comandos
case @command_window.index
when 1 # Habilidades
# Se o limite de ação deste Herói for de 2 ou mais
if $game_party.actors[@status_window.index].restriction >= 2
# Reproduzir SE de erro
$game_system.se_play($data_system.buzzer_se)
return
end
# Reproduzir SE de OK
$game_system.se_play($data_system.decision_se)
# Alternar para a tela de Habilidades
$scene = Scene_Skill.new(@status_window.index)
when 2 # Equipamento
# Reproduzir SE de OK
$game_system.se_play($data_system.decision_se)
# Alternar para a tela de Equipamento
$scene = Scene_Equip.new(@status_window.index)
when 3 # Status
# Reproduzir SE de OK
$game_system.se_play($data_system.decision_se)
# Alternar para a tela de Status
$scene = Scene_Status.new(@status_window.index)
end






return
end
end
end
################################################################

#==============================================================================
# Window_MenuStatus
#------------------------------------------------------------------------------
# Exibe a janela do menu de Status
#==============================================================================

class Window_MenuStatus < Window_Selectable

#--------------------------------------------------------------------------
# Inicialização dos Objetos
#--------------------------------------------------------------------------

def initialize
super(0, 0, 640, 200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
end

#--------------------------------------------------------------------------
# Atualização
#--------------------------------------------------------------------------

def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
#x = 64
#y = i * 116
x = i *155
y = 0
actor = $game_party.actors[i]
draw_actor_hp_dodoop_meter_line(actor, x + 0, y + 40, width = 100, height = 4)
draw_actor_sp_dodoop_meter_line(actor, x + 0, y + 60, width = 100, height = 4)
draw_actor_graphic(actor, x + 40, y + 80)
draw_actor_name(actor, x + 0, y)
draw_actor_hp(actor, x + 0, y + 20)
draw_actor_sp(actor, x + 0, y + 40)
draw_actor_exp(actor, x + 0, y + 60)
draw_actor_level(actor, x, y + 80)
draw_actor_state(actor, x , y + 100)
#draw_actor_graphic(actor, x - 40, y + 80)
#draw_actor_name(actor, x, y)
#draw_actor_class(actor, x + 144, y)
#draw_actor_level(actor, x, y + 32)
#draw_actor_state(actor, x + 90, y + 32)
#draw_actor_exp(actor, x, y + 64)
#draw_actor_hp(actor, x + 236, y + 32)
#draw_actor_sp(actor, x + 236, y + 64)
end
end

#--------------------------------------------------------------------------
# Renovação do Retângulo de Seleção
#--------------------------------------------------------------------------

def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(@index *155, 0, self.height - 50, 150 )
end
end
end


################################################################

module XRXS_BP7
HIDE = false
ALIGN = 0
MAX = 4
end
#________________________________________________________________


class Window_Base < Window
def draw_actor_hp_dodoop_meter_line(actor, x, y, width = 156, height = 4)
w = width * actor.hp / actor.maxhp
color_0 = Color.new( 0, 0, 0, 128)
color_1 = Color.new(255, 0, 0, 192)
color_2 = Color.new(255, 255, 0, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, color_0)
self.contents.draw_line(x, y, x + w, y, color_1, (height/4).floor, color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil, color_0)
self.contents.draw_line(x, y, x + w, y, color_1, (height/4).ceil , color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil, color_0)
self.contents.draw_line(x, y, x + w, y, color_1, (height/4).ceil , color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, color_0)
self.contents.draw_line(x, y, x + w, y, color_1, (height/4).floor, color_2)
end
def draw_actor_sp_dodoop_meter_line(actor, x, y, width = 156, height = 4)
return if actor.maxsp == 0
w = width * actor.sp / actor.maxsp
color_0 = Color.new( 0, 0, 0, 128)
color_1 = Color.new( 0, 0, 255, 192)
color_2 = Color.new( 0, 255, 255, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, color_0)
self.contents.draw_line(x, y, x + w, y, color_1, (height/4).floor, color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , color_0)
self.contents.draw_line(x, y, x + w, y, color_1, (height/4).ceil , color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , color_0)
self.contents.draw_line(x, y, x + w, y, color_1, (height/4).ceil , color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, color_0)
self.contents.draw_line(x, y, x + w, y, color_1, (height/4).floor, color_2)
end
alias xrxs_bp7_draw_actor_name draw_actor_name
def draw_actor_name(actor, x, y)
xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true
end
alias xrxs_bp7_draw_actor_state draw_actor_state
def draw_actor_state(actor, x, y, width = 120)
xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
end
alias xrxs_bp7_draw_actor_hp draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
end
alias xrxs_bp7_draw_actor_sp draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
end
end
class Bitmap
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
distance = (start_x - end_x).abs + (start_y - end_y).abs
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
if width == 1
self.set_pixel(x, y, start_color)
else
self.fill_rect(x, y, width, width, start_color)
end
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
if width == 1
self.set_pixel(x, y, Color.new(r, g, b, a))
else
self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
end
end
end
end
#################################################################

_________________
nos ajude a divulgar esse fórum!!

projetos que sou fã

sou fã de
avatar
roberto
Admin

Mensagens : 75
Pontos : 204
Reputação : 3
Data de inscrição : 03/03/2010

Ver perfil do usuário http://morpgmaker.mo-rpg.com

Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo

- Tópicos similares

 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum