Custom Menu Status - jstreet - 12-23-2005
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
*NOTE*
If you get a Nil implicit conversion error remove the "#" from lines: 232,233,260,261,303,304,328,329,380,381
To implement this code just paste this script right about main
Screenshot
Code: #==============================================================================
# ¡ Scene_Menu
#------------------------------------------------------------------------------
# @ƒƒjƒ…[‰æ–ʂ̈—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# menu_index : ƒRƒ}ƒ“ƒh‚̃J[ƒ\ƒ‹‰ŠúˆÊ’u
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# œ ƒƒCƒ“ˆ—
#--------------------------------------------------------------------------
def main
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðì¬
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Save"
s6 = "End Game"
@command_window = Window_Command.new(140, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
# ƒp[ƒeƒBl”‚ª 0 l‚Ìê‡
if $game_party.actors.size == 0
# ƒAƒCƒeƒ€AƒXƒLƒ‹A‘•”õAƒXƒe[ƒ^ƒX‚𖳌ø‰»
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# ƒZ[ƒu‹ÖŽ~‚Ìê‡
if $game_system.save_disabled
# ƒZ[ƒu‚𖳌ø‚É‚·‚é
@command_window.disable_item(4)
end
# ƒvƒŒƒCŽžŠÔƒEƒBƒ“ƒhƒE‚ðì¬
@playtime_window = Window_PlayTime.new
@playtime_window.x = 410
@playtime_window.y = 416
# •à”ƒEƒBƒ“ƒhƒE‚ðì¬
@steps_window = Window_Steps.new
@steps_window.x = 160
@steps_window.y = 416
# ƒS[ƒ‹ƒhƒEƒBƒ“ƒhƒE‚ðì¬
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðì¬
@status_window = Window_MenuStatus.new
@status_window.x = 135
@status_window.y = 0
@title_window = Window_Title.new
@title_window.x = 0
@title_window.y = 220
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀs
Graphics.transition
# ƒƒCƒ“ƒ‹[ƒv
loop do
# ƒQ[ƒ€‰æ–Ê‚ðXV
Graphics.update
# “ü—Íî•ñ‚ðXV
Input.update
# ƒtƒŒ[ƒ€XV
update
# ‰æ–Ê‚ªØ‚è‘Ö‚í‚Á‚½‚烋[ƒv‚ð’†’f
if $scene != self
break
end
end
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“€”õ
Graphics.freeze
# ƒEƒBƒ“ƒhƒE‚ð‰ð•ú
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
@title_window.dispose
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
# ƒEƒBƒ“ƒhƒE‚ðXV
@command_window.update
@playtime_window.update
@steps_window.update
@gold_window.update
@status_window.update
@title_window.update
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_command ‚ðŒÄ‚Ô
if @command_window.active
update_command
return
end
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_status ‚ðŒÄ‚Ô
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)
#--------------------------------------------------------------------------
def update_command
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒ}ƒbƒv‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Map.new
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒp[ƒeƒBl”‚ª 0 l‚ÅAƒZ[ƒuAƒQ[ƒ€I—¹ˆÈŠO‚̃Rƒ}ƒ“ƒh‚Ìê‡
if $game_party.actors.size == 0 and @command_window.index < 4
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
case @command_window.index
when 0 # ƒAƒCƒeƒ€
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒCƒeƒ€‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Item.new
when 1 # ƒXƒLƒ‹
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # ‘•”õ
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # ƒXƒe[ƒ^ƒX
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # ƒZ[ƒu
# ƒZ[ƒu‹ÖŽ~‚Ìê‡
if $game_system.save_disabled
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒZ[ƒu‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Save.new
when 5 # ƒQ[ƒ€I—¹
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒQ[ƒ€I—¹‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)
#--------------------------------------------------------------------------
def update_status
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
case @command_window.index
when 1 # ƒXƒLƒ‹
# ‚±‚̃AƒNƒ^[‚Ìs“®§ŒÀ‚ª 2 ˆÈã‚Ìê‡
if $game_party.actors[@status_window.index].restriction >= 2
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒLƒ‹‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Skill.new(@status_window.index)
when 2 # ‘•”õ
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ‘•”õ‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Equip.new(@status_window.index)
when 3 # ƒXƒe[ƒ^ƒX
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒX‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
#==============================================================================
# ¡ Window_Gold
#------------------------------------------------------------------------------
# @ƒS[ƒ‹ƒh‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize
super(0, 0, 170, 64)
self.contents = Bitmap.new(width - 32, height - 32)
# self.contents.font.name = $fontface
# self.contents.font.size = $fontsize
refresh
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
#==============================================================================
# ¡ Window_PlayTime
#------------------------------------------------------------------------------
# @ƒƒjƒ…[‰æ–ʂŃvƒŒƒCŽžŠÔ‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize
super(0, 0, 230, 64)
self.contents = Bitmap.new(width - 32, height - 32)
# self.contents.font.name = $fontface
# self.contents.font.size = $fontsize
refresh
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 120, 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(60, 0, 120, 32, text, 2)
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
# ¡ Window_Steps
#------------------------------------------------------------------------------
# @ƒƒjƒ…[‰æ–Ê‚Å•à”‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_Steps < Window_Base
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize
super(0, 0, 260, 64)
self.contents = Bitmap.new(width - 32, height - 32)
# self.contents.font.name = $fontface
# self.contents.font.size = $fontsize
refresh
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Steps")
self.contents.font.color = normal_color
self.contents.draw_text(60, 0, 120, 32, $game_party.steps.to_s, 2)
end
end
#==============================================================================
# ¡ Window_MenuStatus
#------------------------------------------------------------------------------
# @ƒƒjƒ…[‰æ–ʂŃp[ƒeƒBƒƒ“ƒo[‚̃Xƒe[ƒ^ƒX‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_MenuStatus < Window_Selectable
def initialize
super(0, 0, 505, 420)
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
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 90
actor = $game_party.actors[i]
draw_actor_face(actor, x + 200, y + 79)
draw_actor_graphic(actor, x - 50, y + 80)
self.contents.font.size = 18
draw_actor_name(actor, x - 60, y + 4)
self.contents.font.color = system_color
self.contents.draw_text(x - 5, y + 2, 120, 32, '-')
self.contents.font.color = normal_color
draw_actor_class(actor, x + 75, y + 4)
draw_actor_level(actor, x + 5, y + 4)
draw_actor_state(actor, x + 135, y + 4)
draw_actor_exp(actor, x - 35, y + 54)
draw_actor_hp(actor, x - 35, y + 32)
draw_actor_sp(actor, x + 115, y + 32)
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(1, @index * 90 + 33, 26, 48)
end
end
def draw_actor_face(actor, x, y)
face = RPG::Cache.battler(actor.character_name, actor.character_hue)
fw = face.width
fh = 90
src_rect = Rect.new(3, -1, fw, fh)
opacity = 180
self.contents.blt(x - fw / 23, y - fh, face, src_rect, opacity)
end
end
class Window_Title < Window_Base
def initialize
super(0, 0, 138, 200)
self.contents = Bitmap.new (width - 32, height - 32)
# self.contents.font.name = $fontface
# self.contents.font.size = $fontsize
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.font.color = normal_color
$maps = load_data("Data/MapInfos.rxdata")
@map_id = $game_map.map_id
@currmap = $maps[@map_id].name
self.contents.font.size = 24
self.contents.draw_text(4, 0, 120, 32, @currmap)
#In the parenthesis put what you want
self.contents.draw_text(4, 10, 120, 32, "")
self.contents.draw_text(4, 52, 120, 32, "")
self.contents.draw_text(4, 74, 120, 32, "")
self.contents.draw_text(4, 96, 120, 32, "")
self.contents.font.size = 14
self.contents.draw_text(4, 128, 120, 32, "Press [Esc] to Exit")
end
end
|