Good job. I was doing this through eventing and it was a pain in the ass.
This should make things easier.
This should make things easier.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
QuoteIf you mean point-click-walk, no. This script is more of a tool to develop something else using it than an actually useful standalone script, but it can be used separately.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Ultimate Text/Window Customizer
# Author: ForeverZero
# Version: 1.00
# Date: 2.23.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Explanation:
#
# This system will allow you to change the font type/size at any point in
# the game. The player change the system font (i.e. menus, etc.) seperately
# from the message window used for speech, etc. It will also allow the
# player to just as easily change the windowskin and window opacity.
#
# Instructions:
#
# - Hold [1], press [<] and [>] to change system font, [+] and [-] for size.
# - Hold [2], press [<] and [>] to change message font, [+] and [-] for size.
# - Hold [3], press [<] and [>] to change skin, [+] and [-] for window opacity.
#
# Warnings:
#
# Now, obviously making the text to big/small will cause graphical errors
# and cause text to be cut-off, crammed together, etc., so use this with
# a little common sense.
#
# Requirements:
#
# Need 'Blizzard's Custom Controls', else you will need to edit and create
# your own button configuration, which will require a small bit of know-how
# on scripting.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# BEGIN CONFIGURATION
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
alias zero_norm_color normal_color
def normal_color
zero_norm_color
case $game_system.textshade
when 0 then Color.new(255,255,255,255)
when 1 then Color.new(0,0,0,255)
when 2 then Color.new(255,64,64,255)
when 3 then Color.new(64,255,64,255)
when 4 then Color.new(255,200,0,255)
when 5 then Color.new(128,0,255,255)
when 6 then Color.new(0,0,255,255)
end
end
def skinchanger_check
$game_system.windowskin_name =
case $game_system.skintype
when 0 then "Black" # Must be in Game Folder's Windowskin
when 1 then "Black 2" # file. Exact spelling and case sensitive.
when 2 then "Thorns"
when 3 then "Gold Leaf"
when 4 then "Charcoal"
when 5 then "Curtain"
when 6 then "Parchment"
when 7 then "Curtain 2"
when 8 then "Sand"
when 9 then "Purple"
when 10 then "Black Pearl"
when 11 then "Clover"
when 12 then "Darkness"
when 13 then "Simple Blue"
when 14 then "XP Default"
when 15 then "Black 3"
when 16 then "Fire"
when 17 then "Lufia01"
when 18 then "Lufia02"
when 19 then "Hell Breath"
when 20 then "Simple White"
when 21 then "Green"
end
end
end
TOTAL_SKINS = 22 # Be sure to adjust this to the total number
# of windowskins used, including zero.
#==============================================================================
# ** Game_System
#==============================================================================
class Game_System
attr_accessor :system_font_changer
attr_accessor :system_size_changer
attr_accessor :message_font_changer
attr_accessor :message_size_changer
attr_accessor :window_opacity
attr_accessor :skintype
attr_accessor :textshade
alias zero_ultimate_option_window_init initialize
def initialize
zero_ultimate_option_window_init
@system_font_changer = 0 # Default System Font Type (see below)
@system_size_changer = 15 # Default System Font Size
@message_font_changer = 0 # Default Message Font Type (see below)
@message_size_changer = 24 # Default Message Font Size
@window_opacity = 160 # Default Window Opacity
@skintype = 0 # Default Windowskin (see above)
@textshade = 0
check_for_window_change
end
def check_for_window_change
Font.default_size = @system_size_changer
@message.font_size = @message_size_changer
# System Fonts
# Add or remove as many as needed, just follow the pattern.
Font.default_name = case @system_font_changer
when 0 then "Calibri" # **KEY GLOSSARY**
when 1 then "Comic Sans MS" # [1] = SYSTEM_FONT
when 2 then "Times New Roman" # [2] = MESSAGE_FONT
when 3 then "Candara" # [3] = WINDOW
when 4 then "Arial" # [<] = OPTIONLEFT
when 5 then "Estrangelo Edessa" # [>] = OPTIONRIGHT
when 6 then "Tahoma" # [-] = OPTIONDOWN
when 7 then "Tempus Sans ITC" # [+] = OPTIONUP
when 8 then "Verdana"
when 9 then "Century Gothic"
when 10 then "Corbel"
when 11 then "Kristen ITC"
when 12 then "Segoe Print"
end
@SYSTEM_FONTS = 13 # Be sure to adjust this to the total number
# of system fonts used, including zero.
# Message Fonts
# Add or remove as many as needed, just follow the pattern.
@message.font_name = case @message_font_changer
when 0 then "Segoe Print" # "Komika Slick"?
when 1 then "Nyala" # "Komika Slim"?
when 2 then "Kristen ITC" # "Mistral"?
when 3 then "Tempus Sans ITC" # "French Script MT"?
when 4 then "Andalus"
when 5 then "Calibri"
when 6 then "Narkisim"
when 7 then "Comic Sans MS"
when 8 then "Papyrus"
when 9 then "Maiandra GD"
end
@MESSAGE_FONTS = 10 # Be sure to adjust this to the total number
# of message fonts used, including zero.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# END CONFIGURATION
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
end # End check_for_window_change
alias zero_ultimate_option_window_upd update
def update
zero_ultimate_option_window_upd
# To make 'decision' sound when window is initialized
if Input.trigger?(Input::SYSTEM_FONT) or Input.trigger?(Input::WINDOW) or Input.trigger?(Input::MESSAGE_FONT)
$game_system.se_play($data_system.decision_se)
end
# All the input buttons were keys I assigned in Blizz's Custom Controls
if Input.press?(Input::SYSTEM_FONT)
if Input.trigger?(Input::OPTIONLEFT)
@system_font_changer -= 1
@system_font_changer %= @SYSTEM_FONTS
$game_system.se_play($data_system.cursor_se)
check_for_window_change
elsif Input.trigger?(Input::OPTIONRIGHT)
@system_font_changer += 1
@system_font_changer %= @SYSTEM_FONTS
$game_system.se_play($data_system.cursor_se)
check_for_window_change
elsif Input.trigger?(Input::OPTIONDOWN)
@system_size_changer -= 1
$game_system.se_play($data_system.cursor_se)
check_for_window_change
elsif Input.trigger?(Input::OPTIONUP)
@system_size_changer += 1
$game_system.se_play($data_system.cursor_se)
check_for_window_change
end
end
if Input.press?(Input::MESSAGE_FONT)
if Input.trigger?(Input::OPTIONLEFT)
@message_font_changer -= 1
@message_font_changer %= @MESSAGE_FONTS
$game_system.se_play($data_system.cursor_se)
check_for_window_change
elsif Input.trigger?(Input::OPTIONRIGHT)
@message_font_changer += 1
@message_font_changer %= @MESSAGE_FONTS
$game_system.se_play($data_system.cursor_se)
check_for_window_change
elsif Input.trigger?(Input::OPTIONDOWN)
@message_size_changer -= 1
$game_system.se_play($data_system.cursor_se)
check_for_window_change
elsif Input.trigger?(Input::OPTIONUP)
@message_size_changer += 1
$game_system.se_play($data_system.cursor_se)
check_for_window_change
end
end
if Input.press?(Input::WINDOW)
if Input.trigger?(Input::OPTIONDOWN)
@window_opacity -= 5 # Opacity: 0 - 255 (Loops)
@window_opacity %= 255
$game_system.se_play($data_system.cursor_se)
elsif Input.trigger?(Input::OPTIONUP)
@window_opacity += 5
@window_opacity %= 255
$game_system.se_play($data_system.cursor_se)
elsif Input.trigger?(Input::OPTIONLEFT)
@skintype -= 1
@skintype %= TOTAL_SKINS
$game_system.se_play($data_system.cursor_se)
elsif Input.trigger?(Input::OPTIONRIGHT)
@skintype += 1
@skintype %= TOTAL_SKINS
$game_system.se_play($data_system.cursor_se)
end
end
if Input.press?(Input::FONTCOLOR)
if Input.trigger?(Input::OPTIONDOWN)
@textshade -= 1 # Opacity: 0 - 255 (Loops)
@textshade %= 7
$game_system.se_play($data_system.cursor_se)
elsif Input.trigger?(Input::OPTIONUP)
@textshade += 1
@textshade %= 7
$game_system.se_play($data_system.cursor_se)
end
end
end
end
#==============================================================================
# ** Window_Dummy
#==============================================================================
class Window_Dummy < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 416, 200)
self.opacity = $game_system.window_opacity
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh # Shows message window.
if Input.press?(Input::MESSAGE_FONT) or Input.trigger?(Input::MESSAGE_FONT)
self.contents.clear
self.windowskin = RPG::Cache.windowskin("white-windowskin_speech")
self.contents.font.name = $game_system.message.font_name
self.contents.font.size = $game_system.message.font_size
self.opacity = 255
self.contents.font.color = Color.new(0,0,0)
else
skinchanger_check # Shows system window
self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name)
self.contents.clear
self.contents.font.name = Font.default_name
self.contents.font.size = Font.default_size
self.opacity = $game_system.window_opacity
self.contents.font.color = normal_color
end
abctext = "The quick brown fox jumped over the lazy dog."
numtext = "0 1 2 3 4 5 6 7 8 9"
helptext = "(Use [+], [-], [<], and [>] to customize)"
aw = contents.text_size(abctext).width
nw = contents.text_size(numtext).width
hw = contents.text_size(helptext).width
a = contents.text_size("System Font").width
b = contents.text_size("Message Font").width
c = contents.text_size("System Window Base").width
if Input.press?(Input::SYSTEM_FONT)
self.contents.font.color = system_color
self.contents.draw_text(4, 0, a, 32, "System Font", 2)
self.contents.draw_text(4, 128, hw, 32, helptext, 2)
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, aw, 32, abctext, 2)
self.contents.draw_text(4, 64, nw, 32, numtext, 2)
elsif Input.press?(Input::MESSAGE_FONT)
self.contents.font.color = Color.new(0,64,128)
self.contents.draw_text(4, 0, b, 32, "Message Font", 2)
self.contents.draw_text(4, 128, hw, 32, helptext, 2)
self.contents.font.color = Color.new(0,0,0) # Diff. color for whiteback
self.contents.draw_text(4, 32, aw, 32, abctext, 2)
self.contents.draw_text(4, 64, nw, 32, numtext, 2)
elsif Input.press?(Input::WINDOW)
self.contents.font.color = system_color
self.contents.draw_text(4, 0, c, 32, "System Window Base", 2)
self.contents.draw_text(4, 128, hw, 32, helptext, 2)
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, aw, 32, abctext, 2)
self.contents.draw_text(4, 64, nw, 32, numtext, 2)
end
end
end
#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map
alias dummy_window_main initialize
def initialize
dummy_window_main
@dummy_window = Window_Dummy.new
@dummy_window.x, @dummy_window.y = 112, 140
@dummy_window.visible = false
end
alias dummy_window_upd update
def update
dummy_window_upd
@dummy_window.update
# Make window visible if 1, 2, or 3 button is being held down.
if Input.press?(Input::SYSTEM_FONT) or Input.press?(Input::WINDOW) or Input.press?(Input::MESSAGE_FONT)
@dummy_window.visible = true
else
@dummy_window.visible = false
end
# If window is visible, update
if @dummy_window.visible == true
update_dummy
end
# This is so the window refreshes as soon as the button is pressed.
if Input.trigger?(Input::SYSTEM_FONT) or Input.trigger?(Input::WINDOW) or Input.trigger?(Input::MESSAGE_FONT)
@dummy_window.refresh
end
end
def update_dummy # Refreshes window if any change is applied
if Input.trigger?(Input::OPTIONUP)
@dummy_window.refresh
elsif Input.trigger?(Input::OPTIONDOWN)
@dummy_window.refresh
elsif Input.trigger?(Input::OPTIONLEFT)
@dummy_window.refresh
elsif Input.trigger?(Input::OPTIONRIGHT)
@dummy_window.refresh
end
end
end