#-----------------------------------------------------------------------------------------------------------------------------------------------
# Menu pour 3 personnages maximum
#-----------------------------------------------------------------------------------------------------------------------------------------------
# Pour
https://rpg-maker-vx.bbactif.com/# De Blodangan
#------------------------------------------------------------------------------------------------------------------------------------------------
# Ce menu est pour maximum 3 personnage, l'image de fond est à placer dans le dossier ...\Graphics\System
# et il faut l'appeler : Fond Menu
#-----------------------------------------------------------------------------------------------------------------------------------------------
#==============================================================================
# Game_Map
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# Nom de la Map
#--------------------------------------------------------------------------
def nom_map
@nom_map = load_data("Data/MapInfos.rvdata")
@nom_map[@map_id].name
end
end
#==============================================================================
# Window_Or_Localisation_Temps_Jeu
#==============================================================================
class Window_Or_Localisation_Temps_Jeu < Window_Base
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 384, 100)
self.back_opacity = 0
refresh
end
#--------------------------------------------------------------------------
# Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
aff_or
aff_temps_de_jeu
aff_localisation
end
#--------------------------------------------------------------------------
# Affiche l'or
#--------------------------------------------------------------------------
def aff_or
self.contents.draw_text(10, -41, 200, 100, "Or :")
draw_currency_value($game_party.gold, 20, -2, 120)
end
#--------------------------------------------------------------------------
# Affiche le temps de jeu
#--------------------------------------------------------------------------
def aff_temps_de_jeu
total_sec = Graphics.frame_count / Graphics.frame_rate
hour = total_sec / 60 / 60
min = total_sec / 60 % 60
time_string = sprintf("%02dH%02dmin.", hour, min)
self.contents.font.color = normal_color
self.contents.draw_text(10, 23, 150, 24, "Temps de jeu :")
self.contents.draw_text(100, 24, 150, 24, time_string, 2)
end
#--------------------------------------------------------------------------
# Affiche la localisation
#--------------------------------------------------------------------------
def aff_localisation
self.contents.font.color = normal_color
self.contents.draw_text(10, -40, 350, 200, "Localisation : #{$game_map.nom_map}")
end
end
#==============================================================================
# Window_MenuStatus
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 384, 316)
refresh
self.back_opacity = 0
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.members.size
for actor in $game_party.members
draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
x = 104
y = actor.index * 96 + WLH / 2
draw_actor_name(actor, x, y)
draw_actor_state(actor, x + 100, y)
draw_actor_hp(actor, x, y + WLH * 1)
draw_actor_mp(actor, x, y + WLH * 2)
end
end
end
#==============================================================================
# Scene_Menu
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# Start
#--------------------------------------------------------------------------
def start
super
create_fond
create_command_window
@or_localisation_temps_jeu_window = Window_Or_Localisation_Temps_Jeu.new(0, 316)
@status_window = Window_MenuStatus.new(0, 0)
end
#--------------------------------------------------------------------------
# Terminate
#--------------------------------------------------------------------------
def terminate
@fond.dispose
@command_window.dispose
@or_localisation_temps_jeu_window .dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def update
super
@fond.update
@command_window.update
@or_localisation_temps_jeu_window.refresh
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# Crée le fond
#--------------------------------------------------------------------------
def create_fond
@fond = Sprite.new
@fond.bitmap = Cache.system("Fond Menu")
end
#--------------------------------------------------------------------------
# Crée Command Window
#--------------------------------------------------------------------------
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.index = @menu_index
@command_window.x = 384
@command_window.y = 0
@command_window.height = 416
@command_window.back_opacity = 0
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(4, false) # Disable save
end
end
end