1 GLMenu v1.0 22/5/2012, 22:33
The Lucas Wugades
Membro Honorário III
GLMenu v1.0
Introdução
Um menu diferente, para deixar seu jogo mais bonito.
Como usar
Basta copiar o Script e inserir acima de Main.
Código__________________________________________________________
Créditos
Script Base : RMVX
Criador : Glucas
Algumas idéias: lb_guilerme
Introdução
Um menu diferente, para deixar seu jogo mais bonito.
Como usar
Basta copiar o Script e inserir acima de Main.
Código__________________________________________________________
- Código:
#==============================================================================
# GLMenu v1.0
#------------------------------------------------------------------------------
# Script Base : RMVX
# Criador : Glucas
# Algumas idéias: lb_guilerme
#------------------------------------------------------------------------------
# Descrição:
# Um Script de Menu diferente, para deixar seu jogo com uma aparência melhor.
# Feito por Glucas, da JogosRPG
#------------------------------------------------------------------------------
# Data: 20/03/08
# Versão: 1.0.0
#------------------------------------------------------------------------------
# Log:
# - 20/03/08: Script criado.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# menu_index : コマンドのカーソル初期位置
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 305)
@status_window = Window_MenuStatus.new(67, 0)
@window_playtime = Window_PlayTime.new(336,360)
@window_steps = Window_Steps.new(370,306)
@window_map = Window_Map.new(0, 360)
end
#--------------------------------------------------------------------------
# ● 終了処理
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
@window_playtime.dispose
@window_steps.dispose
@window_map.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
@window_playtime.update
@window_steps.update
@window_map.update
if @command_window.active
update_command_selection
elsif @status_window.active
if Input.repeat?(Input::DOWN)
@status_window.draw_actor
end
if Input.repeat?(Input::UP)
@status_window.draw_actor
end
update_actor_selection
end
end
#--------------------------------------------------------------------------
# ● コマンドウィンドウの作成
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.x = 190
@command_window.y = 145
@command_window.index = @menu_index
if $game_party.members.size == 0 # パーティ人数が 0 人の場合
@command_window.draw_item(0, false) # アイテムを無効化
end
if $game_system.save_disabled # セーブ禁止の場合
@command_window.draw_item(4, false) # セーブを無効化
end
end
#--------------------------------------------------------------------------
# ● コマンド選択の更新
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # アイテム
$scene = Scene_Item.new
when 1,2,3 # スキル、装備、ステータス
start_actor_selection
when 4 # セーブ
$scene = Scene_File.new(true, false, false)
when 5 # ゲーム終了
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# ● アクター選択の開始
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# ● アクター選択の終了
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# ● アクター選択の更新
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = 0
@status_window.index = 0
Sound.play_decision
case @command_window.index
when 1 # スキル
$scene = Scene_Skill.new(@status_window.index)
when 2 # 装備
$scene = Scene_Equip.new(@status_window.index)
when 3 # ステータス
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
#--------------------------------------------------------------------------
# ● PlayTime
#--------------------------------------------------------------------------
class Window_PlayTime < Window_Base
def initialize(x, y)
super(x, y, 205, WLH + 32)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 22, "Tempo:")
@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(50, 0, 120, 22, text, 2)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#--------------------------------------------------------------------------
# ● Steps
#--------------------------------------------------------------------------
class Window_Steps < Window_Base
def initialize(x, y)
super(x, y, 171, 53)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 22, "Passos: ")
self.contents.font.color = normal_color
self.contents.draw_text(18, 0, 120, 22, $game_party.steps.to_s, 2)
end
end
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
# メニュー画面でパーティメンバーのステータスを表示するウィンドウです。
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# x : ウィンドウの X 座標
# y : ウィンドウの Y 座標
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 412, 122)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.members.size
draw_actor
end
def draw_actor
self.contents.clear
if (self.index < 0)
actor = 0
else
actor = self.index
end
actor = $game_party.members[actor]
draw_actor_face(actor, 2, 2, 86)
x = 115
y = 5
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 138, y)
draw_actor_level(actor, x, y + WLH * 1)
draw_actor_state(actor, x, y + WLH * 2)
draw_actor_hp(actor, x + 138, y + WLH * 1)
draw_actor_mp(actor, x + 138, y + WLH * 2)
draw_actor_graphic(actor, x - 30, y + WLH * 2 + 35)
draw_actor_exp(actor, x, y + WLH * 2, 70)
end
#--------------------------------------------------------------------------
# ● カーソルの更新
#--------------------------------------------------------------------------
def update_cursor
if @index < 0
self.cursor_rect.empty
elsif @index < @item_max
self.cursor_rect.set(0, 0, contents.width, 90)
elsif @index >= 100
self.cursor_rect.set(0, (@index - 100) * 96, contents.width, 96)
else
self.cursor_rect.set(0, 0, contents.width, @item_max * 96)
end
end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# メニュー画面でパーティメンバーのステータスを表示するウィンドウです。
#==============================================================================
class Window_Base < Window
def draw_actor_exp(actor, x, y, t)
s1 = actor.exp_s
s2 = actor.next_rest_exp_s + s1
text = s1.to_s + "/" + s2.to_s
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, "Exp")
self.contents.font.color = normal_color
self.contents.draw_text(x + 38, y, t, WLH, text, 2)
end
end
#==============================================================================
# ■ Window_Gold
#------------------------------------------------------------------------------
# ゴールドを表示するウィンドウです。
#==============================================================================
<p>class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# x : ウィンドウの X 座標
# y : ウィンドウの Y 座標
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 171, WLH + 32)
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_currency_value($game_party.gold, 4, 0, 131)
end
end
#==============================================================================
# ■ Window_Map
#------------------------------------------------------------------------------
# ゴールドを表示するウィンドウです。
#==============================================================================
class Game_Map
def name
$map_infos[@map_id]
end
end
class Scene_Title
$map_infos = load_data("Data/MapInfos.rvdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
class Window_Map < Window_Base
def initialize(x, y)
super(x, y, 205, WLH + 32)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 25, "Mapa: ")
self.contents.font.color = normal_color
self.contents.draw_text(70, 0, 286, 25, $game_map.name.to_s)
end
end
Créditos
Script Base : RMVX
Criador : Glucas
Algumas idéias: lb_guilerme