Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Floating_Location < Window_Base
- def initialize
- @map_name = get_name
- @size = Win_Size.new(@map_name)
- width = @size[0]
- height = @size[1]
- super(0, 0, width+32, height+32)
- self.contents = Bitmap.new(width, height)
- self.opacity = 240#Box line opacity
- self.back_opacity = 240#Back box opacity
- self.contents_opacity = 240
- @frame_wait = Graphics.frame_count + 80#Duration
- refresh
- end
- def refresh
- if get_name == "noname"
- self.dispose
- return
- end
- self.contents.font.color = Color.new(255,255,255,255)#RGB Colour of text
- self.contents.draw_text(0, 0, @size[0]+32, @size[1], @map_name)
- end
- def update
- if get_name != @map_name
- self.dispose
- return
- end
- if @frame_wait <= Graphics.frame_count
- if self.opacity > 0
- self.opacity -= 20#Duration
- self.back_opacity -= 20#Duration
- self.contents_opacity -= 20#Duration
- 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
- alias :main_orig :main
- alias :update_orig :update
- alias :transfer_player_orig :transfer_player
- def main
- @floating_location.dispose unless @floating_location.nil?
- @floating_location = Floating_Location.new
- main_orig
- @floating_location.dispose unless (@floating_location.disposed? or
- @floating_location.nil?)
- end
- def update
- @floating_location.update unless (@floating_location.disposed? or
- @floating_location.nil?)
- update_orig
- end
- def transfer_player
- transfer_player_orig
- @floating_location.dispose unless (@floating_location.disposed? or
- @floating_location.nil?)
- @floating_location = Floating_Location.new
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement