#==============================================================================
# ** Map Name Popup
#------------------------------------------------------------------------------
#
Dargor, 2008
# 11/05/08
# Version 1.5
#------------------------------------------------------------------------------
# VERSION HISTORY:
# - 1.0 (06/03/08), Initial release
# - 1.1 (19/03/08), Added support for areas
# - 1.2 (26/04/08), Added revert exclusion option
# - 1.3 (11/05/08), Script restructuration
# - 1.4 (11/05/08), Added support for enabling/disabling popups
# - 1.5 (11/05/08), Added 'show' functions
#------------------------------------------------------------------------------
# INSTRUCTIONS:
# - Paste this above main
# - Edit the Exclude_Maps array in the Map_Name_Popup module
# - Edit the Exclude_Areas array in the Map_Name_Popup module
#==============================================================================
#==============================================================================
# ** Map Name Popup Configuration
#==============================================================================
module Map_Name_Popup
# These maps will not popup the name window
Exclude_Maps = [1,2]
# These areas will not popup the name window
Exclude_Areas = []
# Revert exclusion
Revert_Exclusion = false
end
#==============================================================================
# ** RPG::Area
#------------------------------------------------------------------------------
# Data class for areas.
#==============================================================================
class RPG::Area
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :show_name
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias dargor_vx_area_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
dargor_vx_area_initialize
@show_name = false
end
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :map_name_disabled
attr_accessor :area_name_disabled
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias dargor_vx_map_name_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
dargor_vx_map_name_initialize
@map_name_disabled = false
@area_name_disabled = false
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles maps. It includes event starting determinants and map
# scrolling functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Area ID
#--------------------------------------------------------------------------
def area_id
for area in $data_areas.values
return area.id if in_area?(area)
end
end
end
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :show_name
#--------------------------------------------------------------------------
# Alias Listing
#--------------------------------------------------------------------------
alias dargor_map_name_window_setup setup
#--------------------------------------------------------------------------
# * Setup
# map_id : map ID
#--------------------------------------------------------------------------
def setup(map_id)
dargor_map_name_window_setup(map_id)
@show_name = true
end
#--------------------------------------------------------------------------
# * Get Map ID
#--------------------------------------------------------------------------
def name
map_infos = load_data("Data/MapInfos.rvdata")
name = map_infos[@map_id].name
name.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
return name
end
end
class Scene_Map < Scene_Base
def show_map_name(forced=false)
$game_map.show_name = true
@spriteset.show_map_name(forced=false)
end
def show_area_name(forced=false)
@spriteset.show_area_name(forced=false)
end
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc. It's used
# within the Scene_Map class.
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# Alias Listing
#--------------------------------------------------------------------------
alias dargor_spriteset_name_window_initialize initialize
alias dargor_spriteset_name_window_update update
alias dargor_spriteset_name_window_dispose dispose
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
create_windows
dargor_spriteset_name_window_initialize
update
end
#--------------------------------------------------------------------------
# * Create Windows
#--------------------------------------------------------------------------
def create_windows
@map_name_window = Window_MapName.new
@area_name_window = Window_MapName.new
end
#--------------------------------------------------------------------------
# * Show Map Name
#--------------------------------------------------------------------------
def show_map_name(forced=false)
unless forced
return if $game_system.map_name_disabled
end
if $game_map.show_name
@map_name_window.show_name($game_map.name, 128)
end
end