OK ive tried...heres my progress so far...
#==============================================================================
# Game_System
#==============================================================================
class Game_System
attr_accessor :bgm_volume
attr_accessor :sfx_volume
attr_accessor :bar_style
attr_accessor :cam
attr_reader :bar_opacity
attr_reader :fontname
attr_reader :fontsize
alias init_storm_cms_later initialize
def initialize
init_storm_cms_later
init_fix
end
def init_fix
@bgm_volume = 100
@sfx_volume = 100
@bar_style = 0
@cam = 0
@bar_opacity = 256
self.fontname = "Arial"
self.fontsize = 24
end
def fontname=(name)
$defaultfonttype = $fontface = @fontname = name
end
def fontsize=(size)
$defaultfontsize = $fontsize = @fontsize = size
end
def bar_opacity=(alpha)
alpha = 256 if alpha > 256
alpha = 0 if alpha < 0
@bar_opacity = alpha
end
def get_cam
$game_variables[CAM_Variable] = @cam
return # if an event calls this method the "return" is HIGHLY neccesary!
end
def bgm_play(bgm)
@playing_bgm = bgm
vol = correction(@bgm_volume)
if bgm != nil and bgm.name != ""
Audio.bgm_play("Audio/BGM/" + bgm.name , bgm.volume * vol / 100, bgm.pitch)
else
Audio.bgm_stop
end
Graphics.frame_reset
end
def bgs_play(bgs)
@playing_bgs = bgs
vol = correction(@sfx_volume)
if bgs != nil and bgs.name != ""
Audio.bgs_play("Audio/BGS/" + bgs.name, bgs.volume * vol / 100, bgs.pitch)
else
Audio.bgs_stop
end
Graphics.frame_reset
end
def me_play(me)
vol = correction(@bgm_volume)
if me != nil and me.name != ""
Audio.me_play("Audio/ME/" + me.name, me.volume * vol / 100, me.pitch)
else
Audio.me_stop
end
Graphics.frame_reset
end
def se_play(se)
vol = correction(@sfx_volume)
if se != nil and se.name != ""
Audio.se_play("Audio/SE/" + se.name, se.volume * vol / 100, se.pitch)
end
end
def correction(volume)
case volume
when 100 then return 100
when 95 then return 97
when 90 then return 95
when 85 then return 92
when 80 then return 90
when 75 then return 87
when 70 then return 85
when 65 then return 82
when 60 then return 80
when 55 then return 77
when 50 then return 75
when 45 then return 72
when 40 then return 70
when 35 then return 65
when 30 then return 60
when 25 then return 55
when 20 then return 50
when 15 then return 40
when 10 then return 35
when 5 then return 25
when 0 then return 0
else
return 0
end
end
end
#==============================================================================
# Scene_Title
#==============================================================================
class Scene_Title
alias main_storm_cms_later main
def main
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
main_storm_cms_later
end
end
#==============================================================================
# Game_Map
#==============================================================================
class Game_Map
def name
return $map_infos[@map_id]
end
end
#==============================================================================
# Bitmap
#==============================================================================
class Bitmap
alias init_font_override_later initialize
def initialize(w, h = nil)
if w.is_a?(Numeric) and h.is_a?(Numeric)
init_font_override_later(w, h)
else
init_font_override_later(w)
end
if $game_system.fontname != nil and not $scene.is_a?(Scene_Title)
self.font.name = $game_system.fontname
self.font.size = $game_system.fontsize
else
self.font.name = "Arial"
self.font.size = 24
end
end
#==============================================================================
# Window_Options
#==============================================================================
class Window_Options < Window_Selectable
attr_accessor :current_font
attr_reader :skin_name
attr_reader :font_name
attr_reader :windowskin
def initialize
super(0, 0, 640, 480)
# @sprites.push(Sprite.new)
# @sprites[0].bitmap = RPG::Cache.picture("Menu/Menu_back")
# set_sprites
@index = index
get_options
get_skin_and_font
self.contents = Bitmap.new(width - 32, height - 32)
self.z += 10
@item_max = @commands.size
refresh
end
def get_options
@commands = []
@commands.push("BGM Volume")
@commands.push("SFX Volume")
@commands.push("Battle BGM")
@commands.push("Battle Cam")
@commands.push("Bar style")
@commands.push("Bar opacity")
@commands.push("Font")
@commands.push("Windowskin")
@windowskin = $game_system.windowskin_name
$game_system.windowskin_name = "Menu"
$game_system.windowskin_name = @windowskin
end
def refresh
self.contents.font.name = $game_system.fontname
if $game_system.fontname == "Papyrus"
self.contents.font.size = 28
else
self.contents.font.size = 22
end
self.contents.clear
x = 288
y = 4
draw_volume(x, y)
draw_volume(x, y + 36, true)
draw_battle_bgm(x, y + 72)
draw_battle_cam(x, y + 108)
draw_style(x, y + 144)
draw_opacity(x, y + 180)
draw_font(x, y + 216)
draw_skin(x, y + 252)
for i in 0...@item_max
rect = Rect.new(24, 16 + 36 * i, 192, 32)
self.contents.font.color = normal_color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[i])
end
end
def draw_volume(x, y, mode = false, width = 224)
self.contents.font.color = normal_color
self.contents.draw_text(x - 32, y + 13, 32, 32, "<<")
self.contents.draw_text(x + width + 25, y + 13, 32, 32, ">>")
if mode
volume = $game_system.sfx_volume.to_f
else
volume = $game_system.bgm_volume.to_f
end
vol = volume.to_f / 100
color1 = Color.new(20, 40, 80, 192)
color2 = Color.new(60, 120, 240, 192)
color3 = Color.new(0, 0, 80, 192)
old = $game_system.bar_opacity
$game_system.bar_opacity = 255
self.contents.gradient_bar(x, y, width, color1, color2, color3, vol)
$game_system.bar_opacity = old
return
end
def draw_style(x, y, width = 224)
self.contents.font.color = normal_color
self.contents.draw_text(x - 32, y + 13, 32, 32, "<<")
self.contents.draw_text(x + width + 25, y + 13, 32, 32, ">>")
color1 = Color.new(80, 0, 0, 192)
color2 = Color.new(240, 0, 0, 192)
color3 = Color.new(80, 0, 0, 192)
self.contents.gradient_bar(x + 32, y, width - 64, color1, color2, color3, 1)
return
end
def draw_battle_bgm(x, y, width = 224)
self.contents.font.color = normal_color
self.contents.draw_text(x - 32, y + 13, 32, 32, "<<")
self.contents.draw_text(x + width + 25, y + 13, 32, 32, ">>")
case $game_variables[BGM_Variable]
when 0
bgm = "BGM 1"
when 1
bgm = "BGM 2"
when 2
bgm = "BGM 3"
when 3
bgm = "BGM 4"
end
case $game_switches[BGM_Lock]
when true
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(x+1, y + 13+1, 224, 32, bgm, 1)
self.contents.font.color = disabled_color
when false
self.contents.font.color = normal_color
end
self.contents.draw_text(x, y + 13, 224, 32, bgm, 1)
return
end
def draw_battle_cam(x, y, width = 224)
self.contents.font.color = normal_color
self.contents.font.color = disabled_color if not CAM_AVAILABLE
self.contents.draw_text(x - 32, y + 13, 32, 32, "<<")
self.contents.draw_text(x + width + 25, y + 13, 32, 32, ">>")
if CAM_AVAILABLE
cam = "OFF"
cam = "ON" if $game_variables[CAM_Variable] == 0
else
cam = "not available"
end
self.contents.draw_text(x, y + 13, 224, 32, cam, 1)
return
end
def draw_opacity(x, y, width = 224)
self.contents.font.color = normal_color
self.contents.draw_text(x - 32, y + 13, 32, 32, "<<")
self.contents.draw_text(x + width + 25, y + 13, 32, 32, ">>")
case $game_system.bar_opacity
when 0
alpha = "No bar"
when 64
alpha = "Light"
when 128
alpha = "Medium"
when 192
alpha = "Hard"
when 256
alpha = "Full"
end
self.contents.draw_text(x, y + 13, 224, 32, alpha, 1)
return
end
def draw_font(x, y, width = 224)
self.contents.font.color = normal_color
self.contents.draw_text(x - 32, y + 13, 32, 32, "<<")
self.contents.draw_text(x + width + 25, y + 13, 32, 32, ">>")
case @current_font
when 0
@font_name = "Arial"
when 1
@font_name = "Future"
when 2
@font_name = "Comic Sans MS"
when 3
@font_name = "Brush Script"
when 4
@font_name = "Papyrus"
when 5
@font_name = "Tahoma"
when 6
@font_name = "Times New Roman"
end
self.contents.font.name = @font_name
if self.contents.font.name == "Papyrus"
self.contents.font.size = 28
else
self.contents.font.size = 22
end
self.contents.draw_text(x, y + 13, 224, 32, @font_name, 1)
self.contents.font.name = $game_system.fontname
if $game_system.fontname == "Papyrus"
self.contents.font.size = 28
else
self.contents.font.size = 22
end
return
end
def draw_skin(x, y, width = 224)
self.contents.font.color = normal_color
self.contents.draw_text(x - 32, y + 13, 32, 32, "<<")
self.contents.draw_text(x + width + 25, y + 13, 32, 32, ">>")
case @current_skin
when 0
@skin_name = "Original"
when 1
@skin_name = "Heavy Gold"
when 2
@skin_name = "Hell Breath"
when 3
@skin_name = "Liquid Water"
when 4
@skin_name = "Violent Violet"
when 5
@skin_name = "Ice Cool"
when 6
@skin_name = "Fatal Venom"
when 7
@skin_name = "Perfect Chaos"
end
self.contents.draw_text(x, y + 13, 224, 32, @skin_name, 1)
if $game_system.fontname == "Papyrus"
self.contents.font.size = 28
else
self.contents.font.size = 22
end
if @current_skin.is_a?(Numeric)
bitmap = RPG::Cache.icon("CMS/" + "windowskin" + @current_skin.to_s)
self.contents.blt(x + 48, y + 48, bitmap, Rect.new(0, 0, 128, 128))
end
return
end
def current_skin
return @current_skin.nil? ? 0 : @current_skin
end
def current_skin=(val)
if @current_skin.is_a?(Numeric)
@current_skin = val
else
@current_skin = 0
end
end
def get_skin_and_font
@font_name = $game_system.fontname
case @font_name
when "Arial"
@current_font = 0
when "Future"
@current_font = 1
when "Comic Sans MS"
@current_font = 2
when "Brush Script"
@current_font = 3
when "Papyrus"
@current_font = 4
when "Tahoma"
@current_font = 5
when "Times New Roman"
@current_font = 6
end
@skin_name = $scene.windowskin
case @skin_name
when "Original"
@current_skin = 0
when "Heavy Gold"
@current_skin = 1
when "Hell Breath"
@current_skin = 2
when "Liquid Water"
@current_skin = 3
when "Violent Violet"
@current_skin = 4
when "Ice Cool"
@current_skin = 5
when "Fatal Venom"
@current_skin = 6
when "Perfect Chaos"
@current_skin = 7
end
end
def update_cursor_rect
if self.active == false
self.cursor_rect.empty
end
if self.index >= 0 and self.active
self.cursor_rect.set(16, @index * 36 + 16, 128, 32)
elsif self.index >= -1 and self.active
self.cursor_rect.set(16, 36, 128, 32)
end
end
def make_options
@options_window = Window_Options.new
@options_window.x = 0
@options_window.y = 512
@options_window.z = 2999
end
def del_options
@options_window.dispose
@options_window = nil
end
end
end
# cant find where this goes -_-'
# @options_window != nil and @options_window.active
#update_options
I know I'm probably missing some things...and I can find no way to call it via event or anything....