class Floating_Location < Window_Base
#--------------------------------------------------------------------------
# The position of the window
# [x,y]
#
# x = 1 => left
# x = 2 => center
# x = 3 => right
#
# y = 1 => top
# y = 2 => center
# y = 3 => bottom
#--------------------------------------------------------------------------
POSITION = [1,1]
def initialize
@map_name = get_name
if @map_name == ""
@size = [32,32]
else
@size = Win_Size.new(@map_name)
end
width = @size[0]
height = @size[1]
case POSITION[0]
when 1
ox = 0
when 2
ox = 640-(width+32)
ox = ox/2
when 3
ox = 640-(width+32)
end
case POSITION[1]
when 1
oy = 0
when 2
oy = 480-(height+32)
oy = oy/2
when 3
oy = 480-(height+32)
end
super(ox, oy, width+32, height+32)
self.contents = Bitmap.new(width, height)
if @map_name == ""
self.visible = false
else
self.opacity = 240
self.back_opacity = 240
self.contents_opacity = 240
end
@frame_wait = Graphics.frame_count + 60
refresh
end
def refresh
self.contents.font.color = Color.new(217,87,0,255)
self.contents.draw_text(0, 0, @size[0], @size[1], @map_name)
end
def update
if @map_name == ""
self.dispose
return
end
if get_name != @map_name
self.dispose
return
end
if @frame_wait <= Graphics.frame_count
if self.opacity > 0
self.opacity -= 20
self.back_opacity -= 20
self.contents_opacity -= 20
else
self.dispose
return
end
end
end
def get_name
data = load_data("Data/MapInfos.rxdata")
data[$game_map.map_id].name
end
end
class Win_Size < Window_Base
def initialize(text)
super(0, 0, 640, 480)
self.contents = Bitmap.new(640 - 32, 480 - 32)
@w = contents.text_size(text).width
@h = contents.text_size(text).height
self.dispose
end
def [](value)
if value == 0
return @w
else
return @h
end
end
end
class Scene_Map
DISABLED_MAP_IDS = [2,3] # Change this to the map IDs of the map you don't want the feature for.
alias :main_orig :main
alias :update_orig :update
alias :transfer_player_orig :transfer_player
def main
@floating_location.dispose unless @floating_location.nil?
unless DISABLED_MAP_IDS.include?($game_map.map_id)
@floating_location = Floating_Location.new
end
main_orig
@floating_location.dispose unless (@floating_location.nil? or
@floating_location.disposed?)
end
def update
@floating_location.update unless (@floating_location.nil? or
@floating_location.disposed?)
update_orig
end
def transfer_player
transfer_player_orig
@floating_location.dispose unless (@floating_location.nil? or
@floating_location.disposed?)
unless DISABLED_MAP_IDS.include?($game_map.map_id)
@floating_location = Floating_Location.new
end
end
end
That should work...