#============================================================================== # ¡à Ä¿½ºÅ͸¶ÀÌÁî Æ÷ÀÎÆ® #============================================================================== module XRXS20 # # Á¦¿ÜÇÏ´Â ¸ÊID (¸ÊÀÇ ¸Ó¸®ÀÇ °Í . À» ȸÇÇÇÏ°í ½ÍÀº °æ¿ì) # EXCLUSIVE_MAPS = [] # # À©µµ¿ì¹üÀ§ # WINDOW_FRAME = true # Ç¥½Ã WINDOW_SKIN = "" # °³º° À©µµ¿ì ½ºÅ²("" : Á¾·¡) WINDOW_WIDTH_FIX = 0 # °¡·ÎÆø °íÁ¤(0:°íÁ¤ÇÏÁö ¾Ê°í ÀÚµ¿) WINDOW_HEIGHT = 24 # ¼¼·ÎÆø # # ÆùÆ® # FONT_NAME = "±¼¸²" FONT_COLOR = Color.new(255, 255, 0, 255) FONT_SIZE = 18 # # [Ç¥½Ã À§Ä¡] (0:Á»ó ,1:¿ì»ó ,2:ÁÂÇÏ ,3:¿ìÇÏ) # POSITION = 1 # # [Ç¥½Ã ½Ã°£] # TIME_FADEIN = 16 # ¿ë¸í TIME_STOP = 64 # Ç¥½Ã Á¤Áö TIME_FADEOUT = 24 # ÆäÀ̵å¾Æ¿ô end #-------------------------------------------------------------------------- # ÅؽºÆ® ¸ðÇü #-------------------------------------------------------------------------- class Window_Map_Name < Window_Base def text_model(text) return "" + text + "" end end # #[±â´É] # ¸Ê¸íÀÇ ¼±µÎ¿¡ ÇǸ®¾îµå ¡¸.¡¹ÀÌ ÀÖÀ¸¸é(ÀÚ) ¸Ê¸íÀ» Ç¥½ÃÇÏÁö ¾Ê½À´Ï´Ù. # #============================================================================== # ¡à XRXS. ¸Ê ³ªÅ丮 ÀÌµæ ±â±¸ #============================================================================== class Game_Map #-------------------------------------------------------------------------- # ¡Û ¸Ê¸íÀ» Ãëµæ #-------------------------------------------------------------------------- def name $data_mapinfos = load_data("Data/MapInfos.rxdata") if $data_mapinfos.nil? $data_mapinfos[@map_id].name end end #============================================================================== # ¡á Game_Temp #============================================================================== class Game_Temp #-------------------------------------------------------------------------- # ¡Ü °ø°³ ÀνºÅϽº º¯¼ö #-------------------------------------------------------------------------- attr_accessor :xrxs20_fade_duration end #============================================================================== # ¡á Game_Map #============================================================================== class Game_Map #-------------------------------------------------------------------------- # ¡Ü °ø°³ ÀνºÅϽº º¯¼ö #-------------------------------------------------------------------------- attr_reader :map_id end #============================================================================== # ¡à Window_Map_Name_Space #============================================================================== class Window_Map_Name_Space < Window_Base #-------------------------------------------------------------------------- # ¡Û ¿ÀºêÁ§Æ® ÃʱâÈ­ #-------------------------------------------------------------------------- def initialize(x, y, w, h) super(x-16, y-16, w+32, h+32) self.opacity = 0 self.visible = false @align = 1 end #-------------------------------------------------------------------------- # ¡Û ¹®ÀÚ¸¦ ¼³Á¤ #-------------------------------------------------------------------------- def set_text(text) # ¹¦È­ÆøÀ» °è»ê if XRXS20::WINDOW_WIDTH_FIX == 0 bitmap = Bitmap.new(1,1) bitmap.font.name = XRXS20::FONT_NAME bitmap.font.size = XRXS20::FONT_SIZE width = bitmap.text_size(text).width + 25 bitmap.dispose else width = XRXS20::WINDOW_WIDTH_FIX end # ÄÁÅÙÃ÷ ¿µ¿ªÀ» ÀÛ¼º if self.contents != nil self.contents.dispose end self.width = width + 32 self.contents = Bitmap.new(width, self.height - 32) self.contents.font.name = XRXS20::FONT_NAME self.contents.font.color = XRXS20::FONT_COLOR self.contents.font.size = XRXS20::FONT_SIZE self.contents.font.bold = true if text.nil? return end # ¹®ÀÚÀÇ ¹¦È­ x = 12 y = 0 width -= 6 height = self.contents.height text_color = self.contents.font.color.dup self.contents.font.color = Color.new( 0, 0, 0, 192) self.contents.draw_text(x+2, y+2, width, height, text, @align) self.contents.font.color = Color.new( 64, 64, 64, 192) self.contents.draw_text(x-1, y-1, width, height, text, @align) self.contents.draw_text(x+1, y-1, width, height, text, @align) self.contents.draw_text(x-1, y+1, width, height, text, @align) self.contents.draw_text(x+1, y+1, width, height, text, @align) self.contents.font.color = text_color self.contents.draw_text(x, y, width, height, text, @align) end end #============================================================================== # ¡à Window_Map_Name #------------------------------------------------------------------------------ # ¡¡¸Ê¸íÀ» Ç¥½ÃÇÏ´Â À©µµ¿ìÀÔ´Ï´Ù. #============================================================================== class Window_Map_Name < Window_Base #-------------------------------------------------------------------------- # ¡Û °ø°³ ÀνºÅϽº º¯¼ö #-------------------------------------------------------------------------- attr_accessor :text #-------------------------------------------------------------------------- # ¡Û ¿ÀºêÁ§Æ® Ãʱâ #-------------------------------------------------------------------------- def initialize y = XRXS20::POSITION >= 2 ? 440 : 8 w = 64 h = XRXS20::WINDOW_HEIGHT super(-w, y, w, h) self.opacity = 0 self.visible = false if XRXS20::WINDOW_SKIN != "" # ½ºÅ²ÀÇ °Ë»ö skin = (RPG::Cache.windowskin(XRXS20::WINDOW_SKIN) rescue nil) # ½ºÅ²ÀÇ ¼³Á¤ (½ºÅ²ÀÌ ¹ß°ßµÇ¾úÀ» °æ¿ì) self.windowskin = skin unless skin.nil? end @space = Window_Map_Name_Space.new(self.x, self.y, self.width, self.height) end #-------------------------------------------------------------------------- # ¡Û ÅؽºÆ® ¼³Á¤ # text : À©µµ¿ì¿¡ Ç¥½ÃÇϴ ij¸¯ÅÍ ¶óÀÎ #-------------------------------------------------------------------------- def set_text(text) if text.nil? or text.empty? or text =~ /^\\./ @showing_time = -1 @text = "" @space.set_text(@text) $game_temp.xrxs20_fade_duration = -1 else # ¼³Á¤ @text = text_model(text) # ¹¦»ç @space.set_text(@text) if XRXS20::WINDOW_WIDTH_FIX == 0 self.width = @space.width - 16 else self.width = XRXS20::WINDOW_WIDTH_FIX end case XRXS20::POSITION % 2 when 0 @x_indent = 4 when 1 @x_indent = 632 - self.width end end self.visible = false @space.visible = false # À§Ä¡ÀÇ °»½Å fade_relocation end #-------------------------------------------------------------------------- # ¡Û ÆäÀÌµå ½Ã°£¿¡ ÀÇÇÑ À§Ä¡ÀÇ °»½Å #-------------------------------------------------------------------------- def fade_relocation # ÆäÀÌµå ½Ã°£ÀÇ ¼³Á¤ if $game_temp.xrxs20_fade_duration.nil? $game_temp.xrxs20_fade_duration = (XRXS20::TIME_FADEIN + XRXS20::TIME_STOP + XRXS20::TIME_FADEOUT) end # # ¿ë¸í # d = $game_temp.xrxs20_fade_duration - (XRXS20::TIME_STOP + XRXS20::TIME_FADEOUT) if d > 0 self.visible = XRXS20::WINDOW_FRAME @space.visible = true amount = ((XRXS20::TIME_FADEIN - d) * 255.0 / XRXS20::TIME_FADEIN).ceil @space.contents_opacity = amount self.opacity = [amount*5/8, 160].min self.x = @x_indent - d @space.x = self.x - 16 $game_temp.xrxs20_fade_duration -= 1 # # Åë»ó Ç¥½Ã # elsif ($game_temp.xrxs20_fade_duration > XRXS20::TIME_FADEOUT) or ($game_temp.xrxs20_fade_duration == 0 and XRXS20::TIME_FADEOUT == 0) self.visible = XRXS20::WINDOW_FRAME @space.visible = true @space.contents_opacity = 255 self.opacity = 160 self.x = @x_indent @space.x = self.x - 16 if $game_temp.xrxs20_fade_duration > 0 $game_temp.xrxs20_fade_duration -= 1 end # # ÆäÀ̵å¾Æ¿ô # elsif $game_temp.xrxs20_fade_duration > 0 self.visible = XRXS20::WINDOW_FRAME @space.visible = true amount = ($game_temp.xrxs20_fade_duration * 255.0 / XRXS20::TIME_FADEOUT).ceil @space.contents_opacity = amount self.opacity = amount * 5/8 self.x = (@x_indent + XRXS20::TIME_FADEOUT) - $game_temp.xrxs20_fade_duration @space.x = self.x - 16 $game_temp.xrxs20_fade_duration -= 1 if $game_temp.xrxs20_fade_duration == 0 self.visible = false @space.visible = false end end end #-------------------------------------------------------------------------- # ¡Û ÇÁ·¹ÀÓ °»½Å [¿À¹ö¶óÀ̵å(override)] #-------------------------------------------------------------------------- def update fade_relocation super end #-------------------------------------------------------------------------- # ¡Û Çعæ [¿À¹ö¶óÀ̵å(override)] #-------------------------------------------------------------------------- def dispose @space.dispose super end #-------------------------------------------------------------------------- # ¡Û °¡½Ã »óÅ [¿À¹ö¶óÀ̵å(override)] #-------------------------------------------------------------------------- def visible=(b) @space.visible = b unless @space.nil? super end end #============================================================================== # ¡á Scene_Map #============================================================================== class Scene_Map #-------------------------------------------------------------------------- # ¡Ü ¸ÞÀΠó¸® #-------------------------------------------------------------------------- alias xrxs20_main main def main # Áö¸í À©µµ¿ì¸¦ ÀÛ¼º @map_name_window = Window_Map_Name.new # Áö¸í À©µµ¿ìÀÇ °»½Å name = XRXS20::EXCLUSIVE_MAPS.include?($game_map.map_id) ? nil : $game_map.name @map_name_window.set_text(name) # µÇµ¹¸®´Â xrxs20_main # Áö¸í À©µµ¿ì¸¦ Çعæ @map_name_window.dispose end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å #-------------------------------------------------------------------------- alias xrxs20_update update def update # Áö¸í À©µµ¿ìÀÇ °»½Å @map_name_window.update # ±Íȯ½ÃÅ°´Â xrxs20_update end #-------------------------------------------------------------------------- # ¡Ü Ç÷¹À̾îÀÇ Àå¼Ò À̵¿ #-------------------------------------------------------------------------- alias xrxs20_transfer_player transfer_player def transfer_player # Áö¸í À©µµ¿ìÀÇ ºÒ°¡½ÃÈ­ @map_name_window.visible = false # ±Íȯ½ÃÅ°´Â xrxs20_transfer_player # ÆäÀÌµå ½Ã°£ÀÇ Å¬¸®¾î $game_temp.xrxs20_fade_duration = nil # Áö¸í À©µµ¿ìÀÇ °»½Å name = XRXS20::EXCLUSIVE_MAPS.include?($game_map.map_id) ? nil : $game_map.name @map_name_window.set_text(name) end end