Blizzy
me = Scripter.new("Noob")
- 492
- Posts
- 20
- Years
- Age 35
- ~The Netherlands~
- Seen Sep 2, 2007
ok, here's a update for people who are using my menu!
instead of switches, it now uses a global variable
(a variable which can be acces everywhere)
it saves 3 switches, what a relief :P
ok, now for the script, just overwrite it with scene menu:
Window_Command
the global variables are:
$menu = 1 (small)
$menu = 2 (medium)
$menu = 3 (full menu)
(instead of $game_switches[1 or 2 or 3] = true)
enjoy...! :P ;)
comments & questions are welcome
you can also pm me or add me to msn if you have any questions. ;)
I want to know who is using my menu...
everybody who is using it, please pm me.
so i could make a list with the names.
(i know it from the folowing people: rm2k3kid, esai, peekimon)
instead of switches, it now uses a global variable
(a variable which can be acces everywhere)
it saves 3 switches, what a relief :P
ok, now for the script, just overwrite it with scene menu:
Code:
#=================================
# Scene_Menu
#------------------------------------------------------------------
#=================================
class Scene_Menu
#-----------------------------------------------------------------
#menu_index
#-----------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
def main
s1 = "Bag"
s2 = " "
s3 = "Save"
s4 = "Options"
s5 = "Exit"
s6 = "Pokemon"
s7 = "Pokedex"
commands = [s1,s2,s3,s4,s5]
y = 100
if $menu == 1
commands = [s1,s2,s3,s4,s5]
y = 100
end
if $menu == 2
commands = [s6, s1, s2, s3, s4, s5]
y = 80
end
if $menu == 3
commands = [s7, s6,s1, s2, s3, s4, s5]
y = 60
end
if $game_system.save_disabled
commands.delete!("Save")
end
@commands = Window_Command.new(160, commands)
@commands.index = @menu_index
@commands.x = 560 - @commands.width / 2
@commands.y = y
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
@spriteset = Spriteset_Map.new
@heroname = Window_Heroname.new
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 0
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@heroname.dispose
@commands.dispose
@playtime_window.dispose
@spriteset.dispose
end
#--------------------------------------------------------------------------
def update
@heroname.update
@commands.update
@playtime_window.update
@spriteset.update
if @commands.active
update_command
return
end
end
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @commands.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @commands.commands[@commands.index]
when "Bag"
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when " "
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
when "Save"
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when "Options"
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
when "Exit"
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
when "Pokemon"
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
when "Pokedex"
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
end # of case
end # of conditional
end # of method
#--------------------------------------------------------------------------
end # of Scene_Menu class definition
class Window_Heroname < Window_Base
def initialize
super(0, 0, 640,480)
self.opacity = 0
self.back_opacity = 0
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 28
self.contents.font.color = text_color(8)
refresh
end
def refresh
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
x = i * 200 + 484
if $menu == 1
y = 132
end
if $menu == 2
y = 144
end
if $menu == 3
y = 156
end
self.contents.draw_text(x, y, 200, 32, actor.name)
end # of for loop
end # of method
end # of class
Window_Command
Code:
#==============================================================================
# ■ Window_Command
#------------------------------------------------------------------------------
# 一般的なコマンド選択を行うウィンドウです。
#==============================================================================
class Window_Command < Window_Selectable
attr_reader :commands
#--------------------------------------------------------------------------
# ● def initialize
#--------------------------------------------------------------------------
def initialize(width, commands)
# コマンドの個数からウィンドウの高さを算出
super(0, 0, width, commands.size * 32 + 32)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ● refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# ● draw item
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
#--------------------------------------------------------------------------
# ● index
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
end
$menu = 1 (small)
$menu = 2 (medium)
$menu = 3 (full menu)
(instead of $game_switches[1 or 2 or 3] = true)
enjoy...! :P ;)
comments & questions are welcome
you can also pm me or add me to msn if you have any questions. ;)
I want to know who is using my menu...
everybody who is using it, please pm me.
so i could make a list with the names.
(i know it from the folowing people: rm2k3kid, esai, peekimon)
Last edited: