1
Question ajout d'un sous menu le Mer 21 Sep - 4:03
Bonjour Tous le monde
Pour un projet d'un amis, j'ai modifier un menu selon c'est exigence mais il y a une modification que je n'arrive pas à faire.
D'abords, un screen du menu et un screen du résultat souhaité:
Existant:

Résultat souhaité:

Par contre je voudrais que la fenêtre avec Status, fiche et annuler apparaisse seulement quand on sélectionne la commande Personnage. Hors, je n'arrive pas a conserver les autre fenêtre quand j'appel le script du second menu. Voilà se que ça donne:

Si quelqu'un peut résoudre mon problème, ça serait parfait.
Voici le script du menu du jeu:
Voici aussi le script du sous-menu:
Merci d'avance
Pour un projet d'un amis, j'ai modifier un menu selon c'est exigence mais il y a une modification que je n'arrive pas à faire.
D'abords, un screen du menu et un screen du résultat souhaité:
Existant:

Résultat souhaité:

Par contre je voudrais que la fenêtre avec Status, fiche et annuler apparaisse seulement quand on sélectionne la commande Personnage. Hors, je n'arrive pas a conserver les autre fenêtre quand j'appel le script du second menu. Voilà se que ça donne:

Si quelqu'un peut résoudre mon problème, ça serait parfait.
Voici le script du menu du jeu:
- Code:
#==============================================================================
# ** Universal Customizable Menu
#==============================================================================
# The Sleeping Leonhart
# Version 1.6
# 23.10.07
#==============================================================================
# With this script you can customize your main menu.
# Feature:
# * Possibility to create a Menu with pictures(when the picture is active the opacity of the window is automatically setted to 0, picture must be placed in Pictures/Menu)
# * Windows animation In and Out
# * Enable disable the windows animation
# * Setup the windows position, opacity and animation direction
# * You can hide a window
# * You can show the map in background
# * 3 different status window
# * You can set the command horizzontally or vertically
# * You can show the face of hero instead the character (The face go in Characters/Face and name the picture like the character)
# * You can add/remove command
# * You can show the icons in command window (the icons must have the same name of the command)
# * Game Progress Window (To change the game progress: $game_system.progress += value)
# * Killed Monster Window
# * You can resize some windows
# * You can change the font size for some windows
# * You can add an icon for some windows
# * You can play a BGM during the visualization of the menu
# * You can choose the windowskin for each window
#==============================================================================
# Configuration
#==============================================================================
BG_MAP = false #make the map visible on the background
BG_PICTURE = "FinalTitle" #the name of the background picture
STATUS_PICTURE = "" #the name of the status picture
STEP_PICTURE = "" #the name of the steps picture
LOCATION_PICTURE = "" #the name of the location picture
GOLD_PICTURE = "" #the name of the gold picture
TIME_PICTURE = "" #the name of the steps picture
PROGRESS_PICTURE = "" #the name of the progress picture
KILLED_PICTURE = "" #the name of the killed monster picture
COMMAND_PICTURE = "" #the name of the command picture
COMMAND_ITEM = "Inventaire" #the name of the command item
COMMAND_SKILL = "Pouvoirs" #the name of the command skill
COMMAND_EQUIP = "Equipement" #the name of the command equipment
COMMAND_STATUS = "Personnage" #the name of the command status
COMMAND_QUEST = "Quêtes" #the name of the command save
COMMAND_EXIT = "Système" #the name of the command exit
GOLD_ICON = "" #the name of the gold icon
STEP_ICON = "" #the name of the step icon
TIME_ICON = "" #the name of the time icon
PROGRESS_ICON = "" #the name of the progress icon
KILLED_ICON = "" #the name of the killed monster icon
ANIMATION = true #enable the window animation
ICON = false #enable the icon in the command window
#Syntax: MENU_BGM = [name of the bgm, volume, pitch]
MENU_BGM = ["007-Boss03", 75, 100] #Change the music played during the menu
#===============================================================================
# Window Setup
#===============================================================================
# COMMAND_WINDOW Syntax: [Type of command Window, x, y, opacity, animation, windowskin]
# LOCATION_WINDOW, STEP_WINDOW, GOLD_WINDOW, TIME_WINDOW Syntax: [Visible?, x, y, opacity, animation, width, windowskin]
# STATUS_WINDOW Syntax: [Type of status Window, x, y, opacity, graphic, animation, windowskin]
#-------------------------------------------------------------------------------
# Type of command Window = Set the Command Window in "Horizzontal" or "Vertical"
# Visible? = set to true if the window is visible
# x = Set the x position of the window
# y = Set the y position of the window
# opacity = Set the opacity of the window
# animation = Set the anmation side. "Down", "Up", "Left" or "Right"
# Type of status Window = Choose the type of the status window
# graphic = choose if show the face or the charcter in the status menu
# width = set the width of the window
# windowskin = name of the windoskin for that window
#==============================================================================
COMMAND_WINDOW = ["Horizzontal", 0, 40, 255, "Right", "Windnew"]
STEP_WINDOW = [true, 450, 410, 255, "Up", 150, 50, 24, "Windnew"] #Point d'expérience
GOLD_WINDOW = [true, 40, 410, 255, "Left", 200, 50, 24, "Windnew"] #Argent
TIME_WINDOW = [false, 0, 96, 255, "Up", 160+96, 96, 24, "Windnew"] #Temps de jeu
PROGRESS_WINDOW = [false, 245, 370, 255, "Up", 150, 100, 20, "Windnew"] #Progression
KILLED_WINDOW = [true, 160, 0, 255, "Up", 320, 48, 24, "Windnew"] #Titre du jeu
STATUS_WINDOW = [1, 128, 180, 255, "Face", "Down", "Windnew"]
LOCATION_WINDOW = [true, 160, 124, 255, "Left", 320, 100, 24, "Windnew"] #Localisation
COMMAND_SETUP = [COMMAND_STATUS, COMMAND_ITEM, COMMAND_EQUIP, COMMAND_SKILL, COMMAND_QUEST, COMMAND_EXIT]
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
class Window_Base < Window
def draw_actor_face(actor, x, y)
bitmap = RPG::Cache.character("Face/"+actor.character_name, actor.character_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
end
def draw_actor_battler_trunc(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0+cw/8, 0, 80, ch)
self.contents.blt(x, y, bitmap, src_rect)
end
def draw_actor_exps(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 28, 32, "Exp")
self.contents.font.color = normal_color
if actor.now_exp != 0
text = (actor.now_exp.to_f / actor.next_exp.to_f)*100.00
text = text.round
else
text = 0
end
self.contents.draw_text(x + 40, y, 84, 32, text.to_s+"%")
end
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 88, y, 36, 32, parameter_value.to_s, 2)
end
end
class Window_Selectable < Window_Base
def command(index = self.index)
return @commands[index]
end
def commands=(commands)
return if @commands == commands
@commands = commands
item_max = @item_max
@item_max = @commands.size
@column_max = @item_max
unless item_max == @item_max
unless self.contents.nil?
self.contents.dispose
self.contents = nil
end
self.contents = Bitmap.new(@item_max * (width - 32), height - 32)
end
refresh
end
end
class Window_MenuCommandVert < Window_Selectable
def initialize
super(0, 0, 160, COMMAND_SETUP.size * 32 + 32)
@item_max = COMMAND_SETUP.size
@commands = COMMAND_SETUP
self.contents = Bitmap.new(width - 32, @item_max * 32)
if COMMAND_PICTURE != ""
@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("Menu/" + COMMAND_PICTURE)
@picture.x = 480
@picture.y = 640
@picture.bitmap.hue_change($game_system.skin_hue.to_i)
self.opacity = 0
else
self.opacity = COMMAND_WINDOW[3]
end
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
alias tslums_menucmdv_update update
def update
if COMMAND_PICTURE != ""
@picture.x = self.x
@picture.y = self.y
end
tslums_menucmdv_update
end
def draw_item(index, color)
self.contents.font.color = color
if ICON
rect = Rect.new(24, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(18, 0, 0, 0))
bitmap = RPG::Cache.icon(COMMAND_SETUP[index])
self.contents.blt(0, 32*index, bitmap, Rect.new(0, 0, 24, 24))
else
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
end
self.contents.draw_text(rect, @commands[index])
end
def disable_item(index)
draw_item(index, disabled_color)
end
end
class Window_MenuCommandHoriz < Window_Selectable
def initialize
if COMMAND_SETUP.size > 7
super(COMMAND_WINDOW[1], COMMAND_WINDOW[2], 640, 60)
else
super(COMMAND_WINDOW[1], COMMAND_WINDOW[2], 640, 60)
end
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = COMMAND_SETUP.size
if COMMAND_SETUP.size > 7
@column_max = 7
@row_max = 1
else
@column_max = COMMAND_SETUP.size
@row_max = 1
end
@commands = COMMAND_SETUP
@c_spacing = (640 - 32)
if COMMAND_PICTURE != ""
@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("Menu/" + COMMAND_PICTURE)
@picture.x = 480
@picture.y = 640
@picture.bitmap.hue_change($game_system.skin_hue.to_i)
self.opacity = 0
else
self.opacity = COMMAND_WINDOW[3]
end
refresh
self.index = 0
end
alias tslums_menucmd_update update
def update
if COMMAND_PICTURE != ""
@picture.x = self.x
@picture.y = self.y
end
tslums_menucmd_update
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, system_color)
end
end
def draw_item(index, color)
cursor_width = self.width / @column_max - 32
x = 4 + index % @column_max * (cursor_width + 32)
y = index / @column_max * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if ICON
bitmap = RPG::Cache.icon(COMMAND_SETUP[index])
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.draw_text(16+x, y, cursor_width, 32, @commands[index], 0)
else
self.contents.draw_text(x, y, cursor_width, 32, @commands[index], 0)
end
end
def disable_item(index)
draw_item(index, disabled_color)
end
end
class Window_Steps < Window_Base
def initialize
super(STEP_WINDOW[1], STEP_WINDOW[2], STEP_WINDOW[5], STEP_WINDOW[6])
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = STEP_WINDOW[7]
if STEP_PICTURE != ""
@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("Menu/" + STEP_PICTURE)
@picture.x = 640
@picture.y = 480
@picture.bitmap.hue_change($game_system.skin_hue.to_i)
self.opacity = 0
else
self.opacity = STEP_WINDOW[3]
end
refresh
if STEP_ICON != ""
bitmap = RPG::Cache.icon(STEP_ICON)
self.contents.blt(0, STEP_WINDOW[7] + 4, bitmap, Rect.new(0, 0, 24, 24))
end
end
alias tslums_step_update update
def update
if STEP_PICTURE != ""
@picture.x = self.x
@picture.y = self.y
end
tslums_step_update
end
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(-70, -40, 255, 96, $game_variables[1].to_s, 1)
self.contents.font.color = system_color
self.contents.draw_text(-30, -40, 255, 96, "XP", 1)
end
end
class Game_Map
def name
$map_infos[@map_id]
end
end
class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
class Window_Location < Window_Base
def initialize
super(LOCATION_WINDOW[1], LOCATION_WINDOW[2], LOCATION_WINDOW[5], LOCATION_WINDOW[6])
self.contents = Bitmap.new(width - 52, height - 32)
self.contents.font.size = LOCATION_WINDOW[7]
if LOCATION_PICTURE != ""
@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("Menu/" + LOCATION_PICTURE)
@picture.x = 640
@picture.y = 480
@picture.bitmap.hue_change($game_system.skin_hue.to_i)
self.opacity = 0
else
self.opacity = LOCATION_WINDOW[3]
end
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.font.color = normal_color
self.contents.draw_text(-20, 0, 320, 32, $game_map.name, 1)
end
alias tslums_loc_update update
def update
if LOCATION_PICTURE != ""
@picture.x = self.x
@picture.y = self.y
end
tslums_loc_update
end
end
class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(40, 410, 150, 50)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(-20, -40, 120-cx-2, 96, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(100, -40, cx, 96, "G")
# self.contents.draw_text(0, -40, cx, 96, $data_system.words.gold, 1)
end
end
class Window_PlayTime
def initialize
super(TIME_WINDOW[1], TIME_WINDOW[2], TIME_WINDOW[5], TIME_WINDOW[6])
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = TIME_WINDOW[7]
if TIME_PICTURE != ""
@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("Menu/" + TIME_PICTURE)
@picture.x = 480
@picture.y = 640
@picture.bitmap.hue_change($game_system.skin_hue)
self.opacity = 0
else
self.opacity = TIME_WINDOW[3]
end
refresh
if TIME_ICON != ""
bitmap = RPG::Cache.icon(TIME_ICON)
self.contents.blt(0, TIME_WINDOW[7] + 4, bitmap, Rect.new(0, 0, 24, 24))
end
end
alias tslums_time_update update
def update
if TIME_PICTURE != ""
@picture.x = self.x
@picture.y = self.y
end
tslums_time_update
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, TIME_WINDOW[5]-40, 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(4, TIME_WINDOW[7], TIME_WINDOW[5]-40, 32, text, 2)
end
end
class Window_MenuStatus < Window_Selectable
def initialize
super(STATUS_WINDOW[1], STATUS_WINDOW[2], 400, 205)
self.contents = Bitmap.new(width - 32, height - 32)
if STATUS_PICTURE != ""
@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("Menu/" + STATUS_PICTURE)
@picture.x = 640
@picture.y = 480
self.opacity = 0
else
self.opacity = STATUS_WINDOW[3]
end
refresh
self.active = false
self.index = -1
end
alias tslums_stat_update update
def update
if STATUS_PICTURE != ""
@picture.x = self.x
@picture.y = self.y
end
tslums_stat_update
end
def refresh
self.contents.clear
@item_max = 1#$game_party.actors.size
for i in 0...1#$game_party.actors.size
x = 64
y = i * 98
actor = $game_party.actors[i]
if STATUS_WINDOW[4] == "Character"
draw_actor_graphic(actor, x - 40, y + 80)
elsif STATUS_WINDOW[4] == "Face"
draw_actor_face(actor, x+20, y + 120)
end
draw_actor_name(actor, x, y-5)
draw_actor_class(actor, x + 140, y-5)
# draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 140, y + 80)
# draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 140, y + 30)
draw_actor_sp(actor, x + 140, y + 55)
self.contents.draw_text(110, 150, 30, 24, $game_variables[2].to_s) #progression du jeu
self.contents.draw_text(270, 150, 30, 24, $game_variables[3].to_s) #progression du chapitre
self.contents.font.color = system_color
self.contents.draw_text(-15, 105, 400, 24, "___________________", 1)
self.contents.draw_text(-15, 130, 400, 24, "Progression", 1)
self.contents.draw_text(50, 150, 100, 24, " Jeu:")
self.contents.draw_text(135, 150, 20, 24, "%")
self.contents.draw_text(200, 150, 100, 24, "Chap:")
self.contents.draw_text(295, 150, 160, 24, "%")
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 98, self.width - 32, 96)
end
end
end
class Window_MenuStatus2 < Window_Selectable
def initialize
super(STATUS_WINDOW[1], STATUS_WINDOW[2], 384,200)
self.contents = Bitmap.new(width - 32, height - 32)
if STATUS_PICTURE != ""
@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("Menu/" + STATUS_PICTURE)
@picture.x = 640
@picture.y = 480
self.opacity = 0
else
self.opacity = STATUS_WINDOW[3]
end
refresh
self.active = false
self.index = -1
end
alias tslums_stat2_update update
def update
if STATUS_PICTURE != ""
@picture.x = self.x
@picture.y = self.y
end
tslums_stat2_update
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 98
actor = $game_party.actors[i]
if STATUS_WINDOW[4] == "Character"
draw_actor_graphic(actor, x - 40, y + 80)
elsif STATUS_WINDOW[4] == "Face"
draw_actor_face(actor, x-10, y + 80)
end
self.contents.font.size = 18
draw_actor_name(actor, x, y)
draw_actor_hp(actor, x + 92, y)
draw_actor_sp(actor, x + 236, y)
draw_actor_state(actor, x, y + 18)
draw_actor_level(actor, x, y + 36)
draw_actor_exps(actor, x, y + 54)
draw_actor_parameter(actor, x + 92, y + 18, 0)
draw_actor_parameter(actor, x + 92, y + 36, 1)
draw_actor_parameter(actor, x + 92, y + 54, 2)
draw_actor_parameter(actor, x + 236, y + 18, 3)
draw_actor_parameter(actor, x + 236, y + 36, 4)
draw_actor_parameter(actor, x + 236, y + 54, 5)
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 98, self.width - 32, 96)
end
end
end
class Window_MenuStatus3 < Window_Selectable
def initialize
super(STATUS_WINDOW[1], STATUS_WINDOW[2], 384, 200)
if STATUS_PICTURE != ""
@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("Menu/" + STATUS_PICTURE)
@picture.x = 640
@picture.y = 480
self.opacity = 0
else
self.opacity = STATUS_WINDOW[3]
end
@column_max = 1
refresh
self.index = -1
end
alias tslums_stat2_update update
def update
if STATUS_PICTURE != ""
@picture.x = self.x
@picture.y = self.y
end
if self.index == -1
self.oy = 0
else
self.oy = self.index*416
end
tslums_stat2_update
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@item_max = $game_party.actors.size
if @item_max > 0
self.contents = Bitmap.new(448, 416*@item_max)
for i in 0...@item_max
y = i * 416
actor = $game_party.actors[i]
if STATUS_WINDOW[4] == "Character"
draw_actor_graphic(actor, x - 40, y + 80)
elsif STATUS_WINDOW[4] == "Face"
draw_actor_face(actor, x-80, y+80)
end
draw_actor_name(actor, 4, y + 0)
draw_actor_class(actor, 4 + 144, y + 0)
draw_actor_level(actor, 0, y + 32)
draw_actor_state(actor, 0, y + 64)
draw_actor_hp(actor, 0 + 144, y + 32, 172)
draw_actor_sp(actor, 0 + 144, y + 64, 172)
draw_actor_parameter(actor, 0, y + 160, 0)
draw_actor_parameter(actor, 0, y + 192, 1)
draw_actor_parameter(actor, 0, y + 224, 2)
draw_actor_parameter(actor, 0, y + 256, 3)
draw_actor_parameter(actor, 0, y + 288, 4)
draw_actor_parameter(actor, 0, y + 320, 5)
draw_actor_parameter(actor, 0, y + 352, 6)
self.contents.font.color = system_color
self.contents.draw_text(0, y + 96, 80, 32, "EXP")
self.contents.draw_text(144, y + 96, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(0 + 60, y + 96, 84, 32, actor.exp_s, 2)
self.contents.draw_text(144 + 60, y + 96, 84, 32, actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(192, y + 160, 96, 32, "Equipment")
draw_item_name($data_weapons[actor.weapon_id], 192 + 16, y + 208)
draw_item_name($data_armors[actor.armor1_id], 192 + 16, y + 256)
draw_item_name($data_armors[actor.armor2_id], 192 + 16, y + 304)
draw_item_name($data_armors[actor.armor3_id], 192 + 16, y + 352)
draw_item_name($data_armors[actor.armor4_id], 192 + 16, y + 400)
end
end
end
def update_cursor_rect
self.cursor_rect.empty
end
end
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
if BG_MAP == true
@spritesetmap = Spriteset_Map.new
@window_SousMenu = Scene_SousMenu.new(@commands)
end
if BG_PICTURE != ""
@bg = Sprite.new
@bg.bitmap = RPG::Cache.picture("Menu/" + BG_PICTURE)
end
if COMMAND_WINDOW[0] == "Vertical"
@command_window = Window_MenuCommandVert.new
elsif COMMAND_WINDOW[0] == "Horizzontal"
@command_window = Window_MenuCommandHoriz.new
end
@command_window.index = @menu_index
if $game_party.actors.size == 0
for i in 0..COMMAND_SETUP.size
@command_window.disable_item(i)
end
end
$game_system.bgm_memorize
Audio.bgm_play("Audio/BGM/" + MENU_BGM[0], MENU_BGM[1], MENU_BGM[2]) if MENU_BGM[0] != ""
@location_window = Window_Location .new
@playtime_window = Window_PlayTime.new
@steps_window = Window_Steps.new
@gold_window = Window_Gold.new
@progress_window = Window_Progress.new
@killed_window = Window_Killed.new
case STATUS_WINDOW[0]
when 2
@status_window = Window_MenuStatus2.new
when 3
@status_window = Window_MenuStatus3.new
else
@status_window = Window_MenuStatus.new
end
@playtime_window.visible = TIME_WINDOW[0]
@location_window.visible = LOCATION_WINDOW[0]
@gold_window.visible = GOLD_WINDOW[0]
@steps_window.visible = STEP_WINDOW[0]
@progress_window.visible = PROGRESS_WINDOW[0]
@killed_window.visible = KILLED_WINDOW[0]
@command_window.windowskin = RPG::Cache.windowskin(COMMAND_WINDOW[5])
@playtime_window.windowskin = RPG::Cache.windowskin(TIME_WINDOW[8])
@location_window.windowskin = RPG::Cache.windowskin(LOCATION_WINDOW[8])
@gold_window.windowskin = RPG::Cache.windowskin(GOLD_WINDOW[8])
@steps_window.windowskin = RPG::Cache.windowskin(STEP_WINDOW[8])
@progress_window.windowskin = RPG::Cache.windowskin(PROGRESS_WINDOW[8])
@killed_window.windowskin = RPG::Cache.windowskin(KILLED_WINDOW[8])
@status_window.windowskin = RPG::Cache.windowskin(STATUS_WINDOW[6])
if ANIMATION == true
case COMMAND_WINDOW[4]
when "Up"
@command_window.y = 480 + COMMAND_WINDOW[2]
when "Down"
@command_window.y = -COMMAND_WINDOW[2]
when "Left"
@command_window.x = 640 + COMMAND_WINDOW[1]
when "Right"
@command_window.x = -COMMAND_WINDOW[1].to_f
end
case TIME_WINDOW[4]
when "Up"
@playtime_window.y = 480 + TIME_WINDOW[2]
when "Down"
@playtime_window.y = -480 - TIME_WINDOW[2]
when "Left"
@playtime_window.x = 640 + TIME_WINDOW[1]
when "Right"
@playtime_window.x = -640 - TIME_WINDOW[1]
end
case LOCATION_WINDOW[4]
when "Up"
@location_window.y = 480 + LOCATION_WINDOW[2]
when "Down"
@location_window.y = -LOCATION_WINDOW[2]
when "Left"
@location_window.x = 640 + LOCATION_WINDOW[1]
when "Right"
@location_window.x = -LOCATION_WINDOW[1].to_f
end
case STEP_WINDOW[4]
when "Up"
@steps_window.y = 480 + STEP_WINDOW[2]
when "Down"
@steps_window.y = -480 - STEP_WINDOW[2]
when "Left"
@steps_window.x = 640 + STEP_WINDOW[1]
when "Right"
@steps_window.x = -640 - STEP_WINDOW[1]
end
case GOLD_WINDOW[4]
when "Up"
@gold_window.y = 480 + GOLD_WINDOW[2]
when "Down"
@gold_window.y = -480 - GOLD_WINDOW[2]
when "Left"
@gold_window.x = 640 + GOLD_WINDOW[1]
when "Right"
@gold_window.x = -640 - GOLD_WINDOW[1]
end
case STATUS_WINDOW[5]
when "Up"
@status_window.y = 480 + STATUS_WINDOW[2]
when "Down"
@status_window.y = -480 - STATUS_WINDOW[2]
when "Left"
@status_window.x = 640 + STATUS_WINDOW[1]
when "Right"
@status_window.x = -640 - STATUS_WINDOW[1]
end
case PROGRESS_WINDOW[4]
when "Up"
@progress_window.y = 480 + PROGRESS_WINDOW[2]
when "Down"
@progress_window.y = -480 - PROGRESS_WINDOW[2]
when "Left"
@progress_window.x = 640 + PROGRESS_WINDOW[1]
when "Right"
@progress_window.x = -640 - PROGRESS_WINDOW[1]
end
case KILLED_WINDOW[4]
when "Up"
@killed_window.y = 480 + KILLED_WINDOW[2]
when "Down"
@killed_window.y = -480 - KILLED_WINDOW[2]
when "Left"
@killed_window.x = 640 + KILLED_WINDOW[1]
when "Right"
@killed_window.x = -640 - KILLED_WINDOW[1]
end
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
dispose
end
def dispose
if BG_MAP == true
@spritesetmap.dispose
end
@command_window.dispose
if BG_PICTURE != ""
@bg.dispose
end
@location_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
@progress_window.dispose
@killed_window.dispose
end
def delay(seconds)
for i in 0...(seconds * 1)
sleep 0.01
Graphics.update
end
end
def update
windows_update
if ANIMATION == true
animate_window
end
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
def windows_update
@command_window.update
@location_window.update
@playtime_window.update
@steps_window.update
@gold_window.update
@status_window.update
@progress_window.update
@killed_window.update
end
def animate_window
case COMMAND_WINDOW[4]
when "Up"
if @command_window.y > COMMAND_WINDOW[2]
@command_window.y -= ((480 + COMMAND_WINDOW[2]) / 10).to_f
end
if @command_window.y < COMMAND_WINDOW[2]
@command_window.y = COMMAND_WINDOW[2]
end
when "Down"
if @command_window.y < COMMAND_WINDOW[2]
@command_window.y += (COMMAND_WINDOW[2] / 10).to_f
end
if @command_window.y > COMMAND_WINDOW[2]
@command_window.y = COMMAND_WINDOW[2]
end
when "Left"
if @command_window.x > COMMAND_WINDOW[1]
@command_window.x -= ((640 + COMMAND_WINDOW[1]) / 10).to_f
end
if @command_window.x < COMMAND_WINDOW[1]
@command_window.x = COMMAND_WINDOW[1]
end
when "Right"
if @command_window.x < COMMAND_WINDOW[1]
@command_window.x += (COMMAND_WINDOW[1] / 10).to_f
end
if @command_window.x > COMMAND_WINDOW[1]
@command_window.x= COMMAND_WINDOW[1]
end
end
case TIME_WINDOW[4]
when "Up"
if @playtime_window.y > TIME_WINDOW[2]
@playtime_window.y -= ((480 + TIME_WINDOW[2]) / 10).to_f
end
if @playtime_window.y < TIME_WINDOW[2]
@playtime_window.y = TIME_WINDOW[2]
end
when "Down"
if @playtime_window.y < TIME_WINDOW[2]
@playtime_window.y += ((480 + TIME_WINDOW[2]) / 10).to_f
end
if @playtime_window.y > TIME_WINDOW[2]
@playtime_window.y = TIME_WINDOW[2]
end
when "Left"
if @playtime_window.x > TIME_WINDOW[1]
@playtime_window.x -= ((640 + TIME_WINDOW[1]) / 10).to_f
end
if @playtime_window.x < TIME_WINDOW[1]
@playtime_window.x = TIME_WINDOW[1]
end
when "Right"
if @playtime_window.x < TIME_WINDOW[1]
@playtime_window.x += ((640 + TIME_WINDOW[1]) / 10).to_f
end
if @playtime_window.x > TIME_WINDOW[1]
@playtime_window.x = TIME_WINDOW[1]
end
end
case LOCATION_WINDOW[4]
when "Up"
if @location_window.y > LOCATION_WINDOW[2]
@location_window.y -= ((480 + LOCATION_WINDOW[2]) / 10).to_f
end
if @location_window.y < LOCATION_WINDOW[2]
@location_window.y = LOCATION_WINDOW[2]
end
when "Down"
if @location_window.y < LOCATION_WINDOW[2]
@location_window.y += (LOCATION_WINDOW[2] / 10).to_f
end
if @location_window.y > LOCATION_WINDOW[2]
@location_window.y = LOCATION_WINDOW[2]
end
when "Left"
if @location_window.x > LOCATION_WINDOW[1]
@location_window.x -= ((640 + LOCATION_WINDOW[1]) / 10).to_f
end
if @location_window.x < LOCATION_WINDOW[1]
@location_window.x = LOCATION_WINDOW[1]
end
when "Right"
if @location_window.x < LOCATION_WINDOW[1]
@location_window.x += (LOCATION_WINDOW[1] / 10).to_f
end
if @location_window.x > LOCATION_WINDOW[1]
@location_window.x= LOCATION_WINDOW[1]
end
end
case STEP_WINDOW[4]
when "Up"
if @steps_window.y > STEP_WINDOW[2]
@steps_window.y -= ((480 + STEP_WINDOW[2]) / 10).to_f
end
if @steps_window.y < STEP_WINDOW[2]
@steps_window.y = STEP_WINDOW[2]
end
when "Down"
if @steps_window.y < STEP_WINDOW[2]
@steps_window.y += ((480 + STEP_WINDOW[2]) / 10).to_f
end
if @steps_window.y > STEP_WINDOW[2]
@steps_window.y = STEP_WINDOW[2]
end
when "Left"
if @steps_window.x > STEP_WINDOW[1]
@steps_window.x -= ((640 + GOLD_WINDOW[1]) / 10).to_f
end
if @steps_window.x < STEP_WINDOW[1]
@steps_window.x = STEP_WINDOW[1]
end
when "Right"
if @steps_window.x < STEP_WINDOW[1]
@steps_window.x += ((640 + STEP_WINDOW[1]) / 10).to_f
end
if @steps_window.x > STEP_WINDOW[1]
@steps_window.x = STEP_WINDOW[1]
end
end
case GOLD_WINDOW[4]
when "Up"
if @gold_window.y > GOLD_WINDOW[2]
@gold_window.y -= ((480 + GOLD_WINDOW[2]) / 10).to_f
end
if @gold_window.y < GOLD_WINDOW[2]
@gold_window.y = GOLD_WINDOW[2]
end
when "Down"
if @gold_window.y < GOLD_WINDOW[2]
@gold_window.y += ((480 + GOLD_WINDOW[2]) / 10).to_f
end
if @gold_window.y > GOLD_WINDOW[2]
@gold_window.y = GOLD_WINDOW[2]
end
when "Left"
if @gold_window.x > GOLD_WINDOW[1]
@gold_window.x -= ((640 + GOLD_WINDOW[1]) / 10).to_f
end
if @gold_window.x < GOLD_WINDOW[1]
@gold_window.x = GOLD_WINDOW[1]
end
when "Right"
if @gold_window.x < GOLD_WINDOW[1]
@gold_window.x += ((640 + GOLD_WINDOW[1]) / 10).to_f
end
if @gold_window.x > GOLD_WINDOW[1]
@gold_window.x = GOLD_WINDOW[1]
end
end
case STATUS_WINDOW[5]
when "Up"
if @status_window.y > STATUS_WINDOW[2]
@status_window.y -= ((480 + STATUS_WINDOW[2]) / 10).to_f
end
if @status_window.y < STATUS_WINDOW[2]
@status_window.y = STATUS_WINDOW[2]
end
when "Down"
if @status_window.y < STATUS_WINDOW[2]
@status_window.y += ((480 + STATUS_WINDOW[2]) / 10).to_f
end
if @status_window.y > STATUS_WINDOW[2]
@status_window.y = STATUS_WINDOW[2]
end
when "Left"
if @status_window.x > STATUS_WINDOW[1]
@status_window.x -= ((640 + STATUS_WINDOW[1]) / 10).to_f
end
if @status_window.x < STATUS_WINDOW[1]
@status_window.x = STATUS_WINDOW[1]
end
when "Right"
if @status_window.x < STATUS_WINDOW[1]
@status_window.x += ((640 + STATUS_WINDOW[1]) / 10).to_f
end
if @status_window.x > STATUS_WINDOW[1]
@status_window.x = STATUS_WINDOW[1]
end
end
case PROGRESS_WINDOW[4]
when "Up"
if @progress_window.y > PROGRESS_WINDOW[2]
@progress_window.y -= ((480 + PROGRESS_WINDOW[2]) / 10).to_f
end
if @progress_window.y < PROGRESS_WINDOW[2]
@progress_window.y = PROGRESS_WINDOW[2]
end
when "Down"
if @progress_window.y < PROGRESS_WINDOW[2]
@progress_window.y += ((480 + PROGRESS_WINDOW[2]) / 10).to_f
end
if @progress_window.y > PROGRESS_WINDOW[2]
@progress_window.y = PROGRESS_WINDOW[2]
end
when "Left"
if @progress_window.x > PROGRESS_WINDOW[1]
@progress_window.x -= ((640 + PROGRESS_WINDOW[1]) / 10).to_f
end
if @progress_window.x < PROGRESS_WINDOW[1]
@progress_window.x = PROGRESS_WINDOW[1]
end
when "Right"
if @progress_window.x < PROGRESS_WINDOW[1]
@progress_window.x += ((640 + PROGRESS_WINDOW[1]) / 10).to_f
end
if @progress_window.x > PROGRESS_WINDOW[1]
@progress_window.x = PROGRESS_WINDOW[1]
end
end
case KILLED_WINDOW[4]
when "Up"
if @killed_window.y > KILLED_WINDOW[2]
@killed_window.y -= ((480 + KILLED_WINDOW[2]) / 10).to_f
end
if @killed_window.y < KILLED_WINDOW[2]
@killed_window.y = KILLED_WINDOW[2]
end
when "Down"
if @killed_window.y < KILLED_WINDOW[2]
@killed_window.y += ((480 + KILLED_WINDOW[2]) / 10).to_f
end
if @killed_window.y > KILLED_WINDOW[2]
@killed_window.y = KILLED_WINDOW[2]
end
when "Left"
if @killed_window.x > KILLED_WINDOW[1]
@killed_window.x -= ((640 + KILLED_WINDOW[1]) / 10).to_f
end
if @killed_window.x < KILLED_WINDOW[1]
@killed_window.x = KILLED_WINDOW[1]
end
when "Right"
if @killed_window.x < KILLED_WINDOW[1]
@killed_window.x += ((640 + KILLED_WINDOW[1]) / 10).to_f
end
if @killed_window.x > KILLED_WINDOW[1]
@killed_window.x = KILLED_WINDOW[1]
end
end
end
def delete_window
i=0
loop do
windows_update
case COMMAND_WINDOW[4]
when "Up"
if @command_window.y < 480 + COMMAND_WINDOW[2]
@command_window.y += ((480 + COMMAND_WINDOW[2]) / 10).to_f
end
when "Down"
if @command_window.y > -480 - COMMAND_WINDOW[2]
@command_window.y -= ((480 + COMMAND_WINDOW[2]) / 10).to_f
end
when "Left"
if @command_window.x < 640 + COMMAND_WINDOW[1]
@command_window.x += ((640 + COMMAND_WINDOW[1]) / 10).to_f
end
when "Right"
if @command_window.x > -640 - COMMAND_WINDOW[1]
@command_window.x -= ((640 + COMMAND_WINDOW[1]) / 10).to_f
end
end
case LOCATION_WINDOW[4]
when "Up"
if @location_window.y < 480 + LOCATION_WINDOW[2]
@location_window.y += ((480 + LOCATION_WINDOW[2]) / 10).to_f
end
when "Down"
if @location_window.y > -480 - LOCATION_WINDOW[2]
@location_window.y -= ((480 + LOCATION_WINDOW[2]) / 10).to_f
end
when "Left"
if @location_window.x < 640 + LOCATION_WINDOW[1]
@location_window.x += ((640 + LOCATION_WINDOW[1]) / 10).to_f
end
when "Right"
if @location_window.x > -640 - LOCATION_WINDOW[1]
@location_window.x -= ((640 + LOCATION_WINDOW[1]) / 10).to_f
end
end
case TIME_WINDOW[4]
when "Up"
if @playtime_window.y < 480 + TIME_WINDOW[2]
@playtime_window.y += ((480 + TIME_WINDOW[2]) / 10).to_f
end
when "Down"
if @playtime_window.y > -480 - TIME_WINDOW[2]
@playtime_window.y -= ((480 + TIME_WINDOW[2]) / 10).to_f
end
when "Left"
if @playtime_window.x < 640 + TIME_WINDOW[1]
@playtime_window.x += ((640 + TIME_WINDOW[1]) / 10).to_f
end
when "Right"
if @playtime_window.x > -640 - TIME_WINDOW[1]
@playtime_window.x -= ((640 + TIME_WINDOW[1]) / 10).to_f
end
end
case STEP_WINDOW[4]
when "Up"
if @steps_window.y < 480 + STEP_WINDOW[2]
@steps_window.y += ((480 + STEP_WINDOW[2]) / 10).to_f
end
when "Down"
if @steps_window.y > -480 - STEP_WINDOW[2]
@steps_window.y -= ((480 + STEP_WINDOW[2]) / 10).to_f
end
when "Left"
if @steps_window.x < 640 + STEP_WINDOW[1]
@steps_window.x += ((640 + STEP_WINDOW[1]) / 10).to_f
end
when "Right"
if @steps_window.x > -640 - STEP_WINDOW[1]
@steps_window.x -= ((640 + STEP_WINDOW[1]) / 10).to_f
end
end
case GOLD_WINDOW[4]
when "Up"
if @gold_window.y < 480 + GOLD_WINDOW[2]
@gold_window.y += ((480 + GOLD_WINDOW[2]) / 10).to_f
end
when "Down"
if @gold_window.y > -480 - GOLD_WINDOW[2]
@gold_window.y -= ((480 + GOLD_WINDOW[2]) / 10).to_f
end
when "Left"
if @gold_window.x < 640 + GOLD_WINDOW[1]
@gold_window.x += ((640 + GOLD_WINDOW[1]) / 10).to_f
end
when "Right"
if @gold_window.x > -640 - GOLD_WINDOW[1]
@gold_window.x -= ((640 + GOLD_WINDOW[1]) / 10).to_f
end
end
case STATUS_WINDOW[5]
when "Up"
if @status_window.y < 480 + STATUS_WINDOW[2]
@status_window.y += ((480 + STATUS_WINDOW[2]) / 10).to_f
end
when "Down"
if @status_window.y > -480 - STATUS_WINDOW[2]
@status_window.y -= ((480 + STATUS_WINDOW[2]) / 10).to_f
end
when "Left"
if @status_window.x < 640 + STATUS_WINDOW[1]
@status_window.x += ((640 + STATUS_WINDOW[1]) / 10).to_f
end
when "Right"
if @status_window.x > -640 - STATUS_WINDOW[1]
@status_window.x -= ((640 + STATUS_WINDOW[1]) / 10).to_f
end
end
case PROGRESS_WINDOW[4]
when "Up"
if @progress_window.y < 480 + PROGRESS_WINDOW[2]
@progress_window.y += ((480 + PROGRESS_WINDOW[2]) / 10).to_f
end
when "Down"
if @progress_window.y > -480 - PROGRESS_WINDOW[2]
@progress_window.y -= ((480 + PROGRESS_WINDOW[2]) / 10).to_f
end
when "Left"
if @progress_window.x < 640 + PROGRESS_WINDOW[1]
@progress_window.x += ((640 + PROGRESS_WINDOW[1]) / 10).to_f
end
when "Right"
if @progress_window.x > -640 - PROGRESS_WINDOW[1]
@progress_window.x -= ((640 + PROGRESS_WINDOW[1]) / 10).to_f
end
end
case KILLED_WINDOW[4]
when "Up"
if @killed_window.y < 480 + KILLED_WINDOW[2]
@killed_window.y += ((480 + KILLED_WINDOW[2]) / 10).to_f
end
when "Down"
if @killed_window.y > -480 - KILLED_WINDOW[2]
@killed_window.y -= ((480 + KILLED_WINDOW[2]) / 10).to_f
end
when "Left"
if @killed_window.x < 640 + KILLED_WINDOW[1]
@killed_window.x += ((640 + KILLED_WINDOW[1]) / 10).to_f
end
when "Right"
if @killed_window.x > -640 - KILLED_WINDOW[1]
@killed_window.x -= ((640 + KILLED_WINDOW[1]) / 10).to_f
end
end
delay(1)
i += 1
if i == 10
break
end
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
delete_window if ANIMATION
$game_system.bgm_restore
$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.command
when COMMAND_ITEM
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
$vientdumenu = 1
when COMMAND_SKILL
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new
when COMMAND_EQUIP
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new
when COMMAND_STATUS
$game_system.se_play($data_system.decision_se)
$scene = Scene_SousMenu.new
when COMMAND_QUEST
$game_system.se_play($data_system.decision_se)
$scene = Scene_MissionMenu.new
$vientdumenu = 1
when COMMAND_EXIT
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.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.command
when COMMAND_SKILL
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 COMMAND_EQUIP
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when COMMAND_STATUS
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
class Window_Base < Window
def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
if type == "horizontal"
width = length
height = thick
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
elsif type == "vertical"
width = thick
height = length
self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))
h = height * e1 / e2
for i in 0..width
r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width
g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width
b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width
a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width
self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a))
end
end
end
end
class Game_System
alias squall_leonhart_game_system_initialize initialize
attr_accessor :skin_hue
attr_accessor :progress
attr_accessor :killed_monster
def initialize
@skin_hue = 0
@progress = 0.00
@killed_monster = 0
squall_leonhart_game_system_initialize
end
end
class Window_Progress < Window_Base
def initialize
super(245, 370, 160, 100)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
refresh
@show_map = false
end
def refresh
self.contents.clear
self.contents.draw_text(80, 25, 30, 20, $game_variables[2].to_s) #progression du jeu
self.contents.draw_text(80, 50, 30, 20, $game_variables[3].to_s) #progression du chapitre
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 150, 20, "Progression")
self.contents.draw_text(0, 25, 100, 20, "Jeu:")
self.contents.draw_text(100, 25, 20, 20, "%")
self.contents.draw_text(0, 50, 100, 20, "Chap:")
self.contents.draw_text(100, 50, 160, 20, "%")
end
end
=begin
def initialize
super(PROGRESS_WINDOW[1], PROGRESS_WINDOW[2], PROGRESS_WINDOW[5], PROGRESS_WINDOW[6])
self.contents = Bitmap.new(width - 24, height - 24)
self.contents.font.size = PROGRESS_WINDOW[7]
if PROGRESS_PICTURE != ""
@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("Menu/" + PROGRESS_PICTURE)
@picture.x = 640
@picture.y = 480
@picture.bitmap.hue_change($game_system.skin_hue)
self.opacity = 0
else
self.opacity = PROGRESS_WINDOW[3]
end
update
end
def update
self.contents.clear
if PROGRESS_PICTURE != ""
@picture.x = self.x
@picture.y = self.y
end
if PROGRESS_ICON != ""
bitmap = RPG::Cache.icon(PROGRESS_ICON)
self.contents.blt(0, 4, bitmap, Rect.new(0, 0, 24, 24))
end
self.contents.font.color = normal_color
@largezzatesto = self.contents.text_size("Progression").width
self.contents.draw_text(80 - (@largezzatesto/2)- 16, -8, @largezzatesto, 32, "Progression")
if $game_system.progress >= 100
self.contents.font.color = crisis_color
draw_normal_barz(80-((128/2)+15), PROGRESS_WINDOW[7], "horizontal", 126, 6, $game_system.progress, 100, Color.new(0, 255, 255, 255), Color.new(0, 125, 125, 255))
else
self.contents.font.color = normal_color
draw_normal_barz(80-((128/2)+15), PROGRESS_WINDOW[7], "horizontal", 126, 6, $game_system.progress, 100, Color.new(255, 0, 0, 255), Color.new(125, 0, 0, 255))
end
@largezzatesto2 = self.contents.text_size("#{$game_system.progress.to_f} %").width
self.contents.draw_text(80 - (@largezzatesto2/2) - 16, PROGRESS_WINDOW[7] - 16, 128, 32, "#{$game_system.progress.to_f} %")
end
end
=end
class Game_Enemy
alias tsl_ums_enemy_add_state add_state
def add_state(*args)
tsl_ums_enemy_add_state(*args)
$game_system.killed_monster += 1 if dead?
end
end
class Window_Killed < Window_Base
def initialize
super(KILLED_WINDOW[1], KILLED_WINDOW[2], KILLED_WINDOW[5], KILLED_WINDOW[6])
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = KILLED_WINDOW[7]
if KILLED_PICTURE != ""
@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("Menu/" + KILLED_PICTURE)
@picture.x = 640
@picture.y = 480
@picture.bitmap.hue_change($game_system.skin_hue)
self.opacity = 0
else
self.opacity = KILLED_WINDOW[3]
end
update
end
def update
self.contents.clear
if KILLED_PICTURE != ""
@picture.x = self.x
@picture.y = self.y
end
if KILLED_ICON != ""
bitmap = RPG::Cache.icon(KILLED_ICON)
self.contents.blt(0, KILLED_WINDOW[7] + 4, bitmap, Rect.new(0, 0, 24, 24))
end
self.contents.font.color = system_color
# self.contents.draw_text(25, 0, 320, 32, "The Secrets of the Flame")
# self.contents.font.color = normal_color
# self.contents.draw_text(5, 0, 320, 45, "______________________________________________")
# self.contents.font.color = system_color
self.contents.draw_text(25, -40, 295, 96, "The Secret of Inspiration")
end
end
Voici aussi le script du sous-menu:
- Code:
#==============================================================================
# ** Scene_SousMenu
#------------------------------------------------------------------------------
# This class performs game end screen processing.
#==============================================================================
class Scene_SousMenu
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
s1 = "Status"
s2 = "Fiche"
s3 = "Annuler"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.x = 100 - @command_window.width / 2
@command_window.y = 160 - @command_window.height / 2
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame Update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of window
@command_window.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window.update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(0)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # save
$game_system.se_play($data_system.decision_se)
@Window_SousMenu.visible = true
$scene = Scene_Status.new
when 1 # to title
@Window_SousMenu.visible = true
$scene = Scene_Charactor.new
when 2 # to title
@Window_SousMenu.visible = true
command_cancel
end
return
end
end
def command_cancel
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to menu screen
$scene = Scene_Menu.new(0)
end
end
Merci d'avance
















