Leon's Options Menu
#1
Leon's Options Menu
by Leon Westbrooke
V 2.5 9
Nov 13, 2006

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.

Ok, here is my options menu.
Code:
#===================================
#  Leon's Option Menu v2.0
#===================================
=begin
DESCRIPTION:
This is an option menu script that gives the user 8 options:
Font
Windowskin
Font Color
Sound test
Music test
Music Volume
Sound Volume
Bars

CREDITS:  
I credit SephirothSpawn for the draw_bars.  I learned from his tutoral, so every time I
use the bar designs, I credit him.  Also, thanks to Jabicho and italianstal1ion for feature ideas.

Features:
8 options (listed above)

INSTRUCTIONS:
You can make them so they have to be unlocked through events.  To add
these through events, use:
For Fonts:
$game_party.font_name.push(["Then name as it will appear in the game", "The font's real name"])

Windowskins:
$game_party.window_skin.push(["As it appears in the game", "True Name"])

Sound Test
$game_party.sound_effect.push(["Name as it appears", "true name", pitch])

Music Test:
$game_party.music.push(["Name as it appears in the game", "True_Name", pitch])

=end

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Game_System
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Game_System
 
  alias leon_gamesystem_optionmenu_initialize initialize
  alias leon_gamesystem_optionmenu_bgmplay bgm_play
  alias leon_gamesystem_optionmenu_bgsplay bgs_play
  alias leon_gamesystem_optionmenu_battlebgy battle_bgm
 
  attr_accessor :music_volume
  attr_accessor :sfx_volume
  attr_accessor :bar_style
  attr_accessor :battle_music
 
  def initialize
    leon_gamesystem_optionmenu_initialize
    @music_volume = 70
    @sfx_volume = 70
    @bar_style = 1
    @battle_music = [["Battle Music", "001-Battle01", 80],
    ["Battle Music 2", "002-Battle02", 80]]
  end
 
  def bgm_play(bgm)
    @playing_bgm = bgm
    if bgm != nil and bgm.name != ""
      Audio.bgm_play("Audio/BGM/" + bgm.name, bgm.volume * @music_volume / 100, bgm.pitch)
    else
      Audio.bgm_stop
    end
    Graphics.frame_reset
  end
 
  def bgs_play(bgs)
    @playing_bgs = bgs
    if bgs != nil and bgs.name != ""
      Audio.bgs_play("Audio/BGS/" + bgs.name, bgs.volume * @sfx_volume / 100, bgs.pitch)
    else
      Audio.bgs_stop
    end
    Graphics.frame_reset
  end
  def me_play(me)
    if me != nil and me.name != ""
      Audio.me_play("Audio/ME/" + me.name, me.volume * @music_volume / 100, me.pitch)
    else
      Audio.me_stop
    end
    Graphics.frame_reset
  end
 
  def se_play(se)
    if se != nil and se.name != ""
      Audio.se_play("Audio/SE/" + se.name, se.volume * @sfx_volume / 100, se.pitch)
    end
  end
 
end

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Game_Party
 
  attr_accessor    :font_name
  attr_accessor    :window_skin
  attr_accessor    :sound_effect
  attr_accessor    :music
  attr_accessor    :red
  attr_accessor    :green
  attr_accessor    :blue
  attr_accessor    :tempred
  attr_accessor    :tempgreen
  attr_accessor    :tempblue
  attr_accessor    :volume
 
  alias leon_gp_option_initialize initialize
 
  def initialize
    leon_gp_option_initialize
    @red = 255
    @green = 255
    @blue = 255
    @tempred = 255
    @tempgreen = 255
    @tempblue = 255
    #[Printed Name, real name], etc
    @font_name = [["Monotype Corsiva", "Monotype Corsiva"]
    ]
    @window_skin = [
    ["Molten Design", "Windoskinda"],
    ["Forest Design", "ForestWindowskin.png"]
    ]
    #[printed name, real name, pitch]
    @sound_effect = [["Test Sound", "004-System04", 80]]
    @music = [["Battle Music", "001-Battle01", 80],
    ["Town Music", "025-Town03", 80]
    ]
    @volume = 50
  end
end

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Window_Base
  alias leon_options_normalcolor normal_color
  alias leon_options_textcolor text_color
 
  def text_color(n)
    case n
    when 0
      return Color.new($game_party.red, $game_party.green, $game_party.blue, 255)
    when 1
      return Color.new(128, 128, 255, 255)
    when 2
      return Color.new(255, 128, 128, 255)
    when 3
      return Color.new(128, 255, 128, 255)
    when 4
      return Color.new(128, 255, 255, 255)
    when 5
      return Color.new(255, 128, 255, 255)
    when 6
      return Color.new(255, 255, 128, 255)
    when 7
      return Color.new(192, 192, 192, 255)
    else
      return normal_color
    end
  end
 
  def normal_color
    if $game_party == nil
      return Color.new(255, 255, 255, 255)
    else
      return Color.new($game_party.red, $game_party.green, $game_party.blue, 255)
    end
  end
 
  def disabled_color
    if $game_party == nil
      return Color.new(255, 255, 255, 128)
    else
      return Color.new($game_party.red, $game_party.green, $game_party.blue, 128)
    end
  end
 
  #--------------------------------------------------------------------
  def draw_bar(x, y, min, max, width = 152, height = 6,
      bar_color = Color.new(60, 130, 60, 255), end_color = Color.new(180, 250, 180, 255))
    if $game_system.bar_style == 1
      for i in 0..height
        self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
      end
      for i in 1..(height - 1)
        r = 100 * (height - i) / height + 0 * i / height
        g = 100 * (height - i) / height + 0 * i / height
        b = 100 * (height - i) / height + 0 * i / height
        a = 255 * (height - i) / height + 255 * i / height
        self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
      end
      for i in 1..( (min.to_f / max.to_f) * width - 1)
        for j in 1..(height - 1)
          r = bar_color.red * (width - i) / width + end_color.red * i / width
          g = bar_color.green * (width - i) / width + end_color.green * i / width
          b = bar_color.blue * (width - i) / width + end_color.blue * i / width
          a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
          self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
        end
      end
    elsif $game_system.bar_style == 2
      self.contents.fill_rect(x, y, width, height, Color.new(50, 50, 50, 255))
      for i in 1..( (min / max) * width -1)
        r = bar_color.red * (width - i) / width + end_color.red * i / width
        g = bar_color.green * (width - i) / width + end_color.green * i / width
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
        self.contents.fill_rect(x + 1 + i, y + 1, 1, height - 2, Color.new(r, g, b, a))
      end
    end
  end
 
  def draw_actor_hp(actor, x, y, width = 144)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
    if width - 32 >= 108
      hp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      hp_x = x + width - 48
      flag = false
    end
    self.contents.font.color = actor.hp == 0 ? knockout_color :
      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
    self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
      draw_bar(x + 20, y + 25, actor.hp, actor.maxhp, 128, 5)
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
      self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
    end
  end
 
  def draw_actor_sp(actor, x, y, width = 144)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
    if width - 32 >= 108
      sp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      sp_x = x + width - 48
      flag = false
    end
    self.contents.font.color = actor.sp == 0 ? knockout_color :
      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
      draw_bar(x + 20, y + 25, actor.sp, actor.maxsp, 128, 5, Color.new(80, 80, 130, 255),
      Color.new(150, 150, 200,255))
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
      self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
    end
  end
  #--------------------------------------------------------------------
 
end
#----------------------------------------------------------------------
#  Window_Optionhelp
#----------------------------------------------------------------------
class Window_Optionhelp < Window_Base
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
  end
 
  def update(option_help)
    self.contents.clear
    self.contents.draw_text(0, 0, 618, 32, option_help)
  end
end

#----------------------------------------------------------------------
#  Window_Optionmenu
#----------------------------------------------------------------------
class Window_Optionmenu < Window_Selectable
  def initialize
    super(0, 64, 180, 320)
    @commands = ["Font", "Window Skin", "Sound Test", "Music Test", "Font Color", "Music Volume",
    "Sound Volume", "Bars", "Battle Music"]
    @item_max = @commands.size
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    self.index = 0
    refresh
  end
 
  def refresh
    self.contents.clear
    for i in 0...@commands.size
      x = 4
      y = i * 32
      self.contents.draw_text(x, y, 148, 32, @commands[i])
    end
  end
 
  def update_cursor_rect
    y = index * 32
    self.cursor_rect.set(0, y, self.width - 32, 32)
  end
 
end

#----------------------------------------------------------------------
#  Window_Optionextend
#----------------------------------------------------------------------
class Window_Optionextend < Window_Selectable
  def initialize(option_index)
    super(180, 64, 150, 64)
    @option_index = option_index
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    self.active = false
    self.visible = false
    self.index = -1
  end
 
  def options
    if @data != nil
      return @data[index]
    end
  end
 
  def options2
    if @data1 != nil
      return @data1[index]
    end
  end
 
  def options3
    if @data2 != nil
      return @data2[index]
    end
  end
 
  def refresh(option_index)
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    @data1 = []
    @data2 = []
    case option_index
    when 0
      self.width = 180
      self.height = $game_party.font_name.size * 32 + 32
      @column_max = 1
      for i in 0...$game_party.font_name.size
        @data.push($game_party.font_name[i][0])
        @data1.push($game_party.font_name[i][1])
      end
    when 1
      self.width = 180
      self.height = $game_party.window_skin.size * 32 + 32
      @column_max = 1
      for i in 0...$game_party.window_skin.size
        @data.push($game_party.window_skin[i][0])
        @data1.push($game_party.window_skin[i][1])
      end
    when 2
      self.width = 460
      self.height = 416
      @column_max = 2
      for i in 0...$game_party.sound_effect.size
        @data.push($game_party.sound_effect[i][0])
        @data1.push($game_party.sound_effect[i][1])
        @data2.push($game_party.sound_effect[i][2])
      end
    when 3
      self.width = 460
      self.height = 416
      @column_max = 2
      for i in 0...$game_party.music.size
        @data.push($game_party.music[i][0])
        @data1.push($game_party.music[i][1])
        @data2.push($game_party.music[i][2])
      end
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      self.contents.font.name = $defaultfonttype
      self.contents.font.size = $defaultfontsize
      for i in 0...@item_max
        draw_item(i, option_index)
      end
    end
  end
 
  def draw_item(index, option_index)
    option = @data[index]
    case option_index
    when 0
      x = 4
      y = index * 32
    when 1
      x = 4
      y = index * 32
    when 2
      x = 4 + (index % 2) * (self.width /  2)
      y = index / 2 * 32
    when 3
      x = 4 + (index % 2) * (self.width /  2)
      y = index / 2 * 32
    end
    self.contents.draw_text(x, y, 140, 32, option)
  end
end

#----------------------------------------------------------------------
#  Window_FontColor
#----------------------------------------------------------------------
class Window_FontColor < Window_Selectable
 
  def initialize
    super(180, 64, 180, 160)
    @item_max = 3
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    self.active = false
    self.visible = false
    self.index = -1
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.font.color = Color.new(200, 0, 0, 255)
    self.contents.draw_text(4, 0, 120, 32, "Red")
    self.contents.font.color = Color.new(0, 200, 0, 255)
    self.contents.draw_text(4, 32, 120, 32, "Green")
    self.contents.font.color = Color.new(0, 0, 200, 255)
    self.contents.draw_text(4, 64, 120, 32, "Blue")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 180 - 37, 32, $game_party.tempred.to_s, 2)
    self.contents.draw_text(4, 32, 180 - 37, 32, $game_party.tempgreen.to_s, 2)
    self.contents.draw_text(4, 64, 180 - 37, 32, $game_party.tempblue.to_s, 2)
    self.contents.font.color = Color.new($game_party.tempred, $game_party.tempgreen,
    $game_party.tempblue, 255)
    self.contents.draw_text(4, 96, 180, 32, "Font Color")
    self.contents.font.color = normal_color
  end
end

#----------------------------------------------------------------------
#  Window_FontInstruct
#----------------------------------------------------------------------
class Window_FontInstruct < Window_Base
  def initialize
    super(360, 64, 220, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    self.visible = false
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.draw_text(0, 0, 240, 32, "Press Right to add 1, ")
    self.contents.draw_text(0, 32, 240, 32, "or hold to add 5.")
    self.contents.draw_text(0, 64, 240, 32, "Press Left to remove 1,")
    self.contents.draw_text(0, 96, 240, 32, "or hold to remove 5.")
  end
end

#----------------------------------------------------------------------
#  Window_Volume
#----------------------------------------------------------------------
class Window_Volume < Window_Base
  def initialize
    super(195, 192, 250, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    self.visible = false
    refresh
  end
 
  def refresh
    self.contents.clear
    draw_bar(20, 10, $game_party.volume, 100, 170, 6, Color.new(250, 200, 10, 255),
    Color.new(252, 45, 7, 255))
    self.contents.draw_text(10, 32, 120, 32, "0")
    self.contents.draw_text(0, 32, 210, 32, "100", 2)
  end
end

#----------------------------------------------------------------------
#  Window_MusicVolume
#----------------------------------------------------------------------
class Window_MusicVolume < Window_Base
  def initialize
    super(195, 187, 250, 95)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    self.visible = false
    refresh
  end
 
  def refresh
    self.contents.clear
    draw_bar(20, 10, $game_system.music_volume, 100, 170, 6, Color.new(250, 200, 10, 255),
    Color.new(252, 45, 7, 255))
    self.contents.draw_text(10, 25, 120, 32, "0")
    self.contents.draw_text(0, 25, 210, 32, "100", 2)
    self.contents.draw_text(50, 25, 170, 32, "Music Volume")
  end
end

#----------------------------------------------------------------------
#  Window_SoundVolume
#----------------------------------------------------------------------
class Window_SoundVolume < Window_Base
  def initialize
    super(195, 187, 250, 95)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    self.visible = false
    refresh
  end
 
  def refresh
    self.contents.clear
    draw_bar(20, 10, $game_system.sfx_volume, 100, 170, 6, Color.new(250, 200, 10, 255),
    Color.new(252, 45, 7, 255))
    self.contents.draw_text(10,25, 120, 32, "0")
    self.contents.draw_text(0, 25, 210, 32, "100", 2)
    self.contents.draw_text(60, 25, 170, 32, "SFX Volume")
  end
end

#----------------------------------------------------------------------
#  Window_BarStyle
#----------------------------------------------------------------------
class Window_BarStyle < Window_Selectable
  def initialize
    super(195, 185, 250, 154)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    @item_max = 2
    self.visible = false
    self.index = -1
    self.active = false
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.draw_text(0, 0, 160, 32, "Slant Bars")
    self.contents.draw_text(0, 60, 160, 32, "Standard Bars")
    x = 10
    y = 45
    height = 6
    width = 195
    min = 75
    max = 100
    bar_color = Color.new(60, 130, 60, 255)
    end_color = Color.new(180, 250, 180, 255)
    for i in 0..height
      self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
    end
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
    end
    for i in 1..( (min.to_f / max.to_f) * width - 1)
      for j in 1..(height - 1)
        r = bar_color.red * (width - i) / width + end_color.red * i / width
        g = bar_color.green * (width - i) / width + end_color.green * i / width
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
        self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
      end
    end
    #-----------------------------------------------------------------------------------------
    y = 105
    self.contents.fill_rect(x, y, width, height, Color.new(50, 50, 50, 255))
    for i in 1..( (min.to_f / max.to_f) * width -1)
      r = bar_color.red * (width - i) / width + end_color.red * i / width
      g = bar_color.green * (width - i) / width + end_color.green * i / width
      b = bar_color.blue * (width - i) / width + end_color.blue * i / width
      a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
      self.contents.fill_rect(x + 1 + i, y + 1, 1, height - 2, Color.new(r, g, b, a))
    end
  end
    
  def update_cursor_rect
    y = 36 + index * 60
    self.cursor_rect.set(0, y, self.width - 32, 25)
  end
end

#----------------------------------------------------------------------
#  Window_BattleMusic
#----------------------------------------------------------------------
class Window_BattleMusic < Window_Selectable
  def initialize
    super(180, 64, 180, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    @item_max = $game_system.battle_music.size
    self.visible = false
    self.active = false
    self.index = -1
    refresh
  end
 
  def refresh
    self.height = $game_system.battle_music.size * 32 + 32
    self.contents = Bitmap.new(width - 32, row_max * 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    for i in 0...$game_system.battle_music.size
      y = i * 32
      self.contents.draw_text(4, y, 150, 32, $game_system.battle_music[i][0])
    end
  end
end

#----------------------------------------------------------------------
#  Scene_Option
#----------------------------------------------------------------------
class Scene_Option
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
 
  def main
    @help_window = Window_Optionhelp.new
    @menu_window = Window_Optionmenu.new
    @option_window = Window_Optionextend.new(@menu_window.index)
    @color_window = Window_FontColor.new
    @fontinstruct_window = Window_FontInstruct.new
    @volume_window = Window_Volume.new
    @musicvolume_window = Window_MusicVolume.new
    @soundvolume_window = Window_SoundVolume.new
    @bar_window = Window_BarStyle.new
    @battlemusic_window = Window_BattleMusic.new
    
    @menu_window.index = @menu_index
    
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    
    @help_window.dispose
    @menu_window.dispose
    @option_window.dispose
    @color_window.dispose
    @fontinstruct_window.dispose
    @volume_window.dispose
    @musicvolume_window.dispose
    @soundvolume_window.dispose
    @bar_window.dispose
    @battlemusic_window.dispose
  end
 
  def update
    @help_window.update("Select an option")
    @menu_window.update
    @option_window.update
    @color_window.update
    @fontinstruct_window.update
    @volume_window.update
    @musicvolume_window.update
    @soundvolume_window.update
    @bar_window.update
    @battlemusic_window.update
    
    if @menu_window.active
      update_menu
      return
    end
    
    if @option_window.active
      update_option
      return
    end
    
    if @color_window.active
      update_color
      return
    end
    
    if @volume_window.visible
      update_volume
      return
    end
    
    if @musicvolume_window.visible
      update_music
      return
    end
    
    if @soundvolume_window.visible
      update_sound
      return
    end
    
    if @bar_window.active
      update_bars
      return
    end
    
    if @battlemusic_window.active
      update_battlemusic
      return
    end
    
  end
 
  def update_menu
    @help_window.update("Select an option")
    if @menu_window.index < 4
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        @option_window.refresh(@menu_window.index)
        @menu_window.active = false
        @option_window.visible = true
        @option_window.active = true
        @option_window.index = 0
      end
    elsif @menu_window.index ==4
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        @color_window.active = true
        @menu_window.active = false
        @color_window.index = 0
        @color_window.visible = true
        @fontinstruct_window.visible = true
      end
    elsif @menu_window.index == 5
      if Input.trigger?(Input::C)
        @help_window.update("Set music volume.")
        $game_system.se_play($data_system.decision_se)
        @menu_window.active = false
        @musicvolume_window.visible = true
      end
    elsif @menu_window.index == 6
      if Input.trigger?(Input::C)
        @help_window.update("Set sound effects volume.")
        $game_system.se_play($data_system.decision_se)
        @menu_window.active = false
        @soundvolume_window.visible = true
      end
    elsif @menu_window.index == 7
      if Input.trigger?(Input::C)
        @help_window.update("Select bars to use.")
        $game_system.se_play($data_system.decision_se)
        @menu_window.active = false
        @bar_window.active = true
        @bar_window.visible = true
        @bar_window.index = 0
      end
    elsif @menu_window.index == 8
      if Input.trigger?(Input::C)
        @help_window.update("Select a battle music to play.")
        $game_system.se_play($data_system.decision_se)
        @battlemusic_window.active = true
        @menu_window.active = false
        @battlemusic_window.visible = true
        @battlemusic_window.index = 0
      end
    end
    
    
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new
    end
  end
 
  def update_option
    case @menu_window.index
    when 0
      @help_window.update("Select a font.")
      if Input.trigger?(Input::C)
        $defaultfonttype = @option_window.options2
        $scene = Scene_Option.new(0)
        $game_system.se_play($data_system.decision_se)
      end
    when 1
      @help_window.update("Select a window skin.")
      if Input.trigger?(Input::C)
        $game_system.windowskin_name = @option_window.options2
        $scene = Scene_Option.new(1)
        $game_system.se_play($data_system.decision_se)
      end
    when 2
      @help_window.update("Select a sound to play.")
      if Input.trigger?(Input::C)
        Audio.se_play("Audio/SE/" + @option_window.options2, 80, $game_party.volume)
      end
    when 3
      @help_window.update("Select a piece of music to play.")
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        Audio.bgm_play("Audio/BGM/" + @option_window.options2,  
        $game_party.volume, @option_window.options3)
        @option_window.active = false
        @volume_window.visible = true
        @help_window.update("Press left and right to adjust the volume of the song.")
      end
    end

    if Input.trigger?(Input::B)
      $game_system.bgm_play($game_system.bgm_memorize)
      @menu_window.active = true
      @option_window.active = false
      @option_window.visible = false
      @option_window.index = -1
    end
  end
 
  def update_color
    @color_window.refresh
    @help_window.update("Change the font color.  Press 'C' to confirm.")
    if Input.trigger?(Input::RIGHT)
      case @color_window.index
      when 0
        if $game_party.tempred < 255
          $game_party.tempred += 1
        end
        return
      when 1
        if $game_party.tempgreen < 255
          $game_party.tempgreen += 1
        end
        return
      when 2
        if $game_party.tempblue < 255
          $game_party.tempblue += 1
        end
        return
      end
    end
    if Input.trigger?(Input::LEFT)
      case @color_window.index
      when 0
        if $game_party.tempred > 0
          $game_party.tempred -= 1
        end
        return
      when 1
        if $game_party.tempgreen > 0
          $game_party.tempgreen -= 1
        end
        return
      when 2
        if $game_party.tempblue > 0
          $game_party.tempblue -= 1
        end
        return
      end
    end
    if Input.repeat?(Input::RIGHT)
      case @color_window.index
      when 0
        if $game_party.tempred < 255
          $game_party.tempred += 5
          if $game_party.tempred > 255
            $game_party.tempred = 255
          end
        end
        return
      when 1
        if $game_party.tempgreen < 255
          $game_party.tempgreen += 5
          if $game_party.tempgreen > 255
            $game_party.tempgreen = 255
          end
        end
        return
      when 2
        if $game_party.tempblue < 255
          $game_party.tempblue += 5
          if $game_party.tempblue > 255
            $game_party.tempblue = 255
          end
        end
        return
      end
    end
    if Input.repeat?(Input::LEFT)
      case @color_window.index
      when 0
        if $game_party.tempred > 0
          $game_party.tempred -= 5
          if $game_party.tempred < 0
            $game_party.tempred = 0
          end
        end
        return
      when 1
        if $game_party.tempgreen > 0
          $game_party.tempgreen -= 5
          if $game_party.tempgreen < 0
            $game_party.tempgreen = 0
          end
        end
        return
      when 2
        if $game_party.tempblue > 0
          $game_party.tempblue -= 5
          if $game_party.tempblue < 0
            $game_party.tempblue = 0
          end
        end
        return
      end
    end
    if Input.trigger?(Input::B)
      $game_party.tempred = $game_party.red
      $game_party.tempgreen = $game_party.green
      $game_party.tempblue = $game_party.blue
      @color_window.index = -1
      @color_window.active = false
      @color_window.visible = false
      @menu_window.active = true
      @fontinstruct_window.visible = false
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      $game_party.red = $game_party.tempred
      $game_party.green = $game_party.tempgreen
      $game_party.blue = $game_party.tempblue
      Font.default_color = Color.new($game_party.tempred, $game_party.tempgreen,
      $game_party.tempblue, 255)
      @color_window.index = -1
      @color_window.active = false
      @color_window.visible = false
      @menu_window.active = true
      @fontinstruct_window.visible = false
      $scene = Scene_Option.new(4)
      return
    end
  end
 
  def update_volume
    @volume_window.refresh
    if Input.trigger?(Input::RIGHT)
      $game_party.volume += 1
      if $game_party.volume > 100
        $game_party.volume = 100
      end
        Audio.bgm_play("Audio/BGM/" + @option_window.options2,  
        $game_party.volume, @option_window.options3)
      return
    end
    
    if Input.trigger?(Input::LEFT)
      $game_party.volume -= 1
      if $game_party.volume < 0
        $game_party.volume = 0
      end
        Audio.bgm_play("Audio/BGM/" + @option_window.options2,  
        $game_party.volume, @option_window.options3)
      return
    end
    if Input.repeat?(Input::RIGHT)
      $game_party.volume += 5
      if $game_party.volume > 100
        $game_party.volume = 100
      end
        Audio.bgm_play("Audio/BGM/" + @option_window.options2,  
        $game_party.volume, @option_window.options3)
      return
    end
    
    if Input.repeat?(Input::LEFT)
      $game_party.volume -= 5
      if $game_party.volume < 0
        $game_party.volume = 0
      end
        Audio.bgm_play("Audio/BGM/" + @option_window.options2,  
        $game_party.volume, @option_window.options3)
      return
    end
    
    if Input.trigger?(Input::B)
      $game_system.bgm_play($game_system.bgm_memorize)
      @option_window.active = true
      @volume_window.visible = false
      return
    end
  end
 
  def update_music
    @musicvolume_window.refresh
    if Input.trigger?(Input::RIGHT)
      $game_system.music_volume += 1
      if $game_system.music_volume > 100
        $game_system.music_volume = 100
      end
      $game_system.bgm_play($game_system.bgm_memorize)
      return
    end
    
    if Input.trigger?(Input::LEFT)
      $game_system.music_volume -= 1
      if $game_system.music_volume < 0
        $game_system.music_volume = 0
      end
      $game_system.bgm_play($game_system.bgm_memorize)
      return
    end
    
    if Input.repeat?(Input::RIGHT)
      $game_system.music_volume += 5
      if $game_system.music_volume > 100
        $game_system.music_volume = 100
      end
      $game_system.bgm_play($game_system.bgm_memorize)
      return
    end
    
    if Input.repeat?(Input::LEFT)
      $game_system.music_volume -= 5
      if $game_system.music_volume < 0
        $game_system.music_volume = 0
      end
      $game_system.bgm_play($game_system.bgm_memorize)
      return
    end
      
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @menu_window.active = true
      @musicvolume_window.visible = false
    end
  end
  #---------------------------------------------------------------------------------------------------------------------
 
  def update_sound
    @soundvolume_window.refresh
    if Input.trigger?(Input::RIGHT)
      $game_system.sfx_volume += 1
      if $game_system.sfx_volume > 100
        $game_system.sfx_volume = 100
      end
      Audio.se_play("Audio/SE/001-System01", 80 * $game_system.sfx_volume / 100)
      $game_system.bgs_play($game_system.bgs_memorize)
      return
    end
 
    if Input.trigger?(Input::LEFT)
      $game_system.sfx_volume -= 1
      if $game_system.sfx_volume < 0
        $game_system.sfx_volume = 0
      end
      Audio.se_play("Audio/SE/001-System01", 80 * $game_system.sfx_volume / 100)
      $game_system.bgs_play($game_system.bgs_memorize)
      return
    end
 
    if Input.repeat?(Input::RIGHT)
      $game_system.sfx_volume += 5
      if $game_system.sfx_volume > 100
        $game_system.sfx_volume = 100
      end
      Audio.se_play("Audio/SE/001-System01", 80 * $game_system.sfx_volume / 100)
      $game_system.bgs_play($game_system.bgs_memorize)
      return
    end
    
    if Input.repeat?(Input::LEFT)
      $game_system.sfx_volume -= 5
      if $game_system.sfx_volume < 0
        $game_system.sfx_volume = 0
      end
      Audio.se_play("Audio/SE/001-System01", 80 * $game_system.sfx_volume / 100)
      $game_system.bgs_play($game_system.bgs_memorize)
      return
    end
    
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @menu_window.active = true
      @soundvolume_window.visible = false
    end
  end
 
  def update_bars
    @bar_window.refresh
    if Input.trigger?(Input::C)
      if @bar_window.index == 0
        $game_system.bar_style = 1
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Option.new
      elsif @bar_window.index == 1
        $game_system.bar_style = 2
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Option.new
      end
    end
    
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @bar_window.visible = false
      @bar_window.active = false
      @bar_window.index = -1
      @menu_window.active = true
    end
  end
 
  def update_battlemusic
    @battlemusic_window.refresh
    if Input.trigger?(Input::C)
      $data_system.battle_bgm.name = $game_system.battle_music[@battlemusic_window.index][1]
      Audio.bgm_play("Audio/BGM/" + $game_system.battle_music[@battlemusic_window.index][1])
      return
    end
    if Input.trigger?(Input::B)
      @battlemusic_window.active = false
      @battlemusic_window.visible = false
      @menu_window.active = true
      @battlemusic_window.index = 0
      $game_system.bgm_play($game_system.bgm_memorize)
    end
  end
end


To call it, use:
Code:
$scene = Scene_Option.new

It has 8 options: Font, Windowkin, Sound test, Music test, Font Color, Music Volume, Sound Volume, and Bars.

Desc of each:
Font: Change font style
Windowskin: Changes windowskin
Sound test: Listen to 'unlocked' sounds.
Music Test: Listen to 'unlocked' music.
Font Color: Changes the normal font color (default, white)*
Music Volume: Changes the game's music and music effect volumes.
Sound Volume: Changes sound effect volumes.
Bars: Lets you choose between 2 styles of bars.
Battle Music: Changes the battle music.

*This script changes the normal_color in Window_Base, and when altered by the player, changes the Font.default color. In essence, this means if you changed the normal_color at the beginning of the game, you need to change:

@red = 255
@green = 255
@blue = 255

to the numbers you want. These are found around lines 117-119 in the script.

You can add these at the beginning in the script, or use the method described in the script's beginning. Also, I will take requests on some new things to add into this. Please, leave me your comments on this script.

NOTE: The options already set in the script are just examples, and you will need to change them so you don't get an error. The only one that will need to be mandatoraly changed is the windowskins. Those aren't in the program's RTP. And the font isnt on some computers. But anyway, here's the script:

Let me know if there are ANY bugs.
Enjoy! :alright:
~Leon
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  MAP MENU Artofmin 0 2,671 12-01-2009, 01:00 PM
Last Post: Artofmin
  FFTA Shop Menu Chrono Cry 0 2,492 04-25-2007, 01:00 PM
Last Post: Chrono Cry
  Cutscene Menu sasuke89 0 2,406 01-02-2007, 01:00 PM
Last Post: sasuke89
  Crystals Menu Leon Blade 0 2,519 12-24-2006, 01:00 PM
Last Post: Leon Blade



Users browsing this thread: 1 Guest(s)