#¸ðÇè Àϱâ # #´Ù¸¸ ´ÜÁö ¹®ÀÚ¸¦ ¹¦È­ ÇÒ »Ó(¸¸Å­)À̹ǷΠÀϱâ ÀÌ¿Ü¿¡µµ »ç¿ëÇÒ ¼ö ÀÖÀ»Áöµµ ¸ð¸¨´Ï´Ù. #»ç¿ëÇÒ ¼ö ÀÖ´Â Á¦¾î ¹®ÀÚ´Â ÀÌÇÏ¿Í °°´Ù. # #\N[n] ID nÂ÷·ÊÀÇ ¿¢ÅÍÀÇ À̸§À» Ç¥½ÃÇÕ´Ï´Ù. #\V[n] º¯¼ö nÂ÷·ÊÀÇ °ªÀ» Ç¥½ÃÇÕ´Ï´Ù. #\C[n] ÆùÆ® Ä®¶ó¸¦ º¯°æÇÕ´Ï´Ù. #\G ÇöÀçÀÇ ¼ÒÁö±ÝÀ» Ç¥½ÃÇÕ´Ï´Ù. #\O[n] ºÒÅõ¸íµµ¸¦ º¯°æÇÕ´Ï´Ù. (0~255) #\H[n] font size¸¦ º¯°æÇÕ´Ï´Ù. (6~32) #\R[º»¹®,·çºñ] ·çºñ ÷ºÎÀÇ ¹®ÀÚ¸¦ Ç¥½ÃÇÕ´Ï´Ù. #\Pic[x,y,ÆÄÀÏ ³×ÀÓ] ÇÈó¿¡ ÀÓÆ÷Æ® µÈ È­»óÀ» Ç¥½ÃÇÕ´Ï´Ù. #\Bat[x,y,ÆÄÀÏ ³×ÀÓ,hue] ¹öƲ·¯¿¡ ÀÓÆ÷Æ® µÈ È­»óÀ» Ç¥½ÃÇÕ´Ï´Ù. #\Cha[x,y,ÆÄÀÏ ³×ÀÓ,hue,¹æÇâ,ÆÐÅÏ] ij¸¯ÅÍ¿¡ ÀÓÆ÷Æ® µÈ È­»óÀ» Ç¥½ÃÇÏ´Â. #¡Ø¹æÇâ ¼ýÀÚ ÆеåÀÇ ¹èÄ¡¿Í °°Àº , ÇÏ2ÁÂ4¿ì6»ó8 # ÆÐÅÏ1~4 # #Àϱ⠳»¿ëÀÇ ¼³Á¤À¸·Î »ç¿ëÇÒ ¶§´Â ¡¸\\n[1]¡¹°ú °°ÀÌ #¡¸\¡¹À» Çϳª ¿©ºÐÀ¸·Î ºÙ¿© ÁÖ¼¼¿ä. # #»ùÇÃÀ» ¿©·¯°¡Áö ¸¸Á® º¸¸é , ¾Ë±â ½±´Ù°í »ý°¢ÇÕ´Ï´Ù. # #2005.4.2 ±â´É Ãß°¡ #ŸÀÌƲµµ º¯¼ö¿¡ ÀÇÇØ º¯°æÇÒ ¼ö ÀÖµµ·Ï(µíÀÌ). #°Å±â¿¡ µû¶ó@titleÀÇ Ãë±ÞÀÌ º¯ÇÕ´Ï´Ù¸¸(ij¸¯ÅÍ ¶óÀΡæij¸¯ÅÍ ¶óÀÎÀÇ ¹è¿­) #Áö±Ý±îÁöÀΠä¿¡¼­µµ »ç¿ëÇÒ ¼ö ÀÖ°Ô µÇ¾î ÀÖ½À´Ï´Ù. (ij¸¯ÅÍ ¶óÀÎÀÇ °æ¿ì´Â ±×´ë·Î µ¹·ÁÁÖ´Â) #ÄÚ¸àÆ®¿Í °°ÀÌ @title[0] = "ŸÀÌƲ" °°Àº ´À³¢°í·Î ¼³Á¤ÇØ ÁÖ¼¼¿ä. #Àϱâ4¹ø°ÀÇ Ç׸ñÀ» Âü°í·Î Çϸé , ¾Ë±â ½±´Ù°í »ý°¢ÇÕ´Ï´Ù. # #2005.4.16 ±â´É Ãß°¡ #ŸÀÌƲ ºÎºÐ¿¡µµ Á¦¾î ¹®ÀÚ¸¦ »ç¿ë °¡´ÉÇÏ°Ô. #ÀϺΠÁ¦¾î ¹®ÀÚ(¿¢Å͸íµî)Àº ÀüÀüºÎÅÍ »ç¿ëÇÒ ¼ö ÀÖ¾ú½À´Ï´Ù¸¸ #¹®ÀÚ»ö º¯°æµîµµ »ç¿ëÇÒ ¼ö ÀÖ°Ô µÇ¾ú½À´Ï´Ù. #´Ù¸¸ , ¾à°£ÀÇ ºÎÀÛ¿ëÀ̶óµçÁöµµ ÀÖ´Ù°í »ý°¢ÇϹǷΠ#¼±ÅýĿ¡ ÇØ µÎ¾ú½À´Ï´Ù. # #2005.4.30 ±â´É Ãß°¡ #ÇÈÃÄ Ç¥½Ã ¿Ü¿¡µµ , ¹öƲ·¯ Ç¥½Ã¿Í ij¸¯ÅÍ Ç¥½Ã¸¦ Ãß°¡Çß½À´Ï´Ù. #ÇÏ´Â ±è¿¡ , ÇöÀçÀÇ ºÒÅõ¸íµµ·Î ÇÈÃĵî À» Ç¥½ÃÇϵµ·Ï(µíÀÌ). #ÇÈÃÄ Ç¥½ÃÀÇ Á÷Àü¿¡\\O[160]¶óµçÁö ÇÏ¸é ºÒÅõ¸íµµ¸¦ Á¶Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. # #2005.4.30 ´õ¿í Ãß°¡ #NO_DATA_VISIBLE ·Î ÃâÇöÇÏ°í ÀÖÁö ¾Ê´Â Ç׸ñÀº ºñÇ¥½Ã(Àµµ·?µíÀÌ) ¼³Á¤ÇÒ ¼ö ÀÖµµ·Ï(µíÀÌ). #Àϱ⠹øÈ£ÀÇ Ç¥±â¸¦ ÇÒ±î ÇÏÁö ¾Ê´Â°¡ ¼±ÅÃÇÒ ¼ö ÀÖµµ·Ï(µíÀÌ). #±×¸®°í ¹Ì¹¦ÇÏ°Ô ¹ö±× ¼öÁ¤. Window_Base#transfer, Window_Base#draw_ex_text (À»)¸¦ Á¶Á¤. class Window_Questdiary_Select < Window_Selectable QUESTDIARY_DATA_MAX = 10 #Àϱ⠵¥ÀÌÅÍÀÇ ÃÖ´ë¼ö TITLE_TEXT_EX = true #ÀϱâÀÇ Å¸ÀÌƲ¿¡µµ Á¦¾î ¹®ÀÚ¸¦ »ç¿ëÇұ #»ç¿ëÇßÀ» °æ¿ì ±ä ŸÀÌƲÀ» Ç¥½Ã ´Ù ÇÒ ¼ö ¾ø´Â °æ¿ì °³¹Ì #(draw_text¸¦ »ç¿ëÇÏÁö ¾Ê±â ¶§¹®¿¡ , ÀÚµ¿ Ãà¼Ò ±â´ÉÀÌ ÀÏÇÏÁö ¾Ê±â ¶§¹®¿¡) NO_DATA_VISIBLE = true #¾ÆÁ÷ ÃâÇöÇÏ°í ÀÖÁö ¾Ê´Â Ç׸ñÀ» Ç¥½ÃÇÏ´ÂÁö ¾î¶²Áö DRAW_ID = true #Àϱ⠹øÈ£¸¦ Ç¥±âÇÏ´ÂÁö ¾î¶²Áö end class Data_Questdiary VISIBLE_JUDGE_MODE = 1 #ÃâÇö ÆÇÁ¤¿¡ ½ºÀ­Ä¡¸¦ »ç¿ëÇÒ±î º¯¼ö¸¦ »ç¿ëÇÒ±î 0:½ºÀ­Ä¡ 1:º¯¼ö #½ºÀ­Ä¡·Î Çϸé(ÀÚ) ,1°³ÀÇ Ç׸ñ¿¡ º¹¼öÀÇ ¸Þ¼¼Áö¸¦ #¼³Á¤ÇÒ ¼ö ¾ø°Ô µË´Ï´Ù. attr_reader :exist attr_reader :title attr_reader :id #-------------------------------------------------------------------------- # ¡Ü ¿ÀºêÁ§Æ® ÃʱâÈ­ #-------------------------------------------------------------------------- def initialize(id) @id = id @title = [] @title[0] = "«¿«¤«È«ëªÊ?ª·" # µðÆúÆ® ŸÀÌƲ(Åë»ó »ç¿ëÇÏÁö ¾Ê´Â) @variable = 0 @variable_max = 1 @comment = [] @exist = false set_data(id) end # ŸÀÌƲ Ãëµæ def title # ¹è¿­ÀÌ ¾Æ´Ï¸é ±×´ë·Î µ¹·ÁÁÖ´Â return @title unless @title.is_a?(Array) # ½ºÀ­Ä¡·Î ÆÇÁ¤À̳ª º¯¼ö ¹øÈ£°¡0Àΰ¡ ŸÀÌƲÀÌ Á¸ÀçÇÏÁö ¾Ê´Â °æ¿ì´Â ¹è¿­ÀÇ ÃÖÃʸ¦ µ¹·ÁÁÖ´Â if VISIBLE_JUDGE_MODE == 0 or @variable == 0 or not @title[$game_variables[@variable]].nil? return @title[0] end # º¯¼ö ¹øÈ£¿¡ ÀÇÇØ µ¹·ÁÁִ ŸÀÌƲÀ» °áÁ¤ÇÏ´Â return @title[$game_variables[@variable]-1] end #-------------------------------------------------------------------------- # ¡Ü Àϱ⠳»¿ëÀÇ ¼³Á¤ #-------------------------------------------------------------------------- def set_data(id) @id = id case @id when 1 # ID @title = "\\c[1]«Æ«¹«ÈªÊªÎªÇª¹«Ã£¡\\c[0]" # ŸÀÌƲ @variable = 0 # ÃâÇö º¯¼ö ¹øÈ£0¶ó¸é »ó½Ã ÃâÇö @comment[0] = <<-EOS # ¿©±â·ÎºÎÅÍ ³»¿ëÀ» ¾²´Â \\r[ªëªÓªÓªÓªÇª¹,ªëªÓ?]ªëªëªëªë? \\h[32]ªÇª±?\\h[22]ªÕªÄ?\\h[12]ªÁªÃª±?\\h[22] \\c[2]ßä?ª¨ªÆª¹ªÈ\\c[0]\\o[128]ª¦ªÃª¹ª¤ª¼\\o[255] \\gª´?ªëªÉ ??1ªÎö·=\\v[1] \\r[ªëªÓ,ªëªÓ?ªÓ?ªÓ?ªÓ?ªÇª¹ªè]ªëªëªëªëªÓ? \\h[32]\\r[ªÇªÃª«ª¤ªëªÓ,ªªªªª­ªÊªÕªêª¬ªÊ]\\h[22]ªéªéªé? \\h[12]\\r[ªÁªÃªµª¤ªëªÓ,ªÁª¤ªµªÊªÕªêª¬ªÊ]\\h[22]ªéªéªêªé? ¡é«Ô«¯«Á«ãøúãƪƪ¹ªÈ \\pic[0,288,«««Ã«È«¤«óñÞÝáñé]\\bat[480,160,001-Fighter01,160]\\cha[360,160,001-Fighter01,160,8,4] EOS # ª³ª³ªÞªÇ @variable_max = @comment.size @exist = true # ðíի髰 trueªËª·ªÈª¤ªÆª¯ªÀªµª¤ when 2 @title[0] = "ªÁªçªÃªÈª·ª¿?Ù¥" @variable = 0 @comment[0] = <<-EOS variableÀ¸·Î ¼³Á¤ÇÑ º¯¼ö ¹øÈ£ÀÇ °ªÀ¸·Î ÃâÇöÇϴ¡¤ÇÏÁö ¾Ê´ÂÀ» ¼³Á¤ °¡´É º¯¼öÀÇ °ªÀÌ0½Ã¿¡´Â ÃâÇöÇÏÁö ¾Ê´Â 1À̻󶧴 °¢°¢ ´ëÀÀÇÑ ¸Þ¼¼Áö°¡ Ç¥½ÃµË´Ï´Ù ÀÌ »ùÇÿ¡¼­´Â º¯¼ö ¹øÈ£10Â÷·ÊÀÇ °ªÀ¸·Î4¹ø°ÀÇ ÀϱⰡ º¯È­ÇÏ´Â °ªÀ»1Àΰ¡2·Î Çϸé(ÀÚ) °¢°¢ ¸Þ¼¼Áö°¡ Ç¥½ÃµË´Ï´Ù EOS @variable_max = @comment.size @exist = true when 3 @title[0] = "°ËÀº »ö" @variable = 0 @comment[0] = <<-EOS 1 ½ºÅ©·Ñ ÇÏ´Â 2 »óÇÏ Å°·Î1Ç྿ À̵¿ 3 Á¿ì Å°·Î ÆäÀÌÁö ´ÜÀ§·Î À̵¿ 4 5 6 7 8 9 10 11 12ÀÌ ¾Õ ½ºÅ©·Ñ¿Í 13¡é 14¡é 15¡é 16¡é 17¡é 18¡é 19¡é 20¡é 21¡é 22¡é 23¡é 24ÀÌ·± ´À³¦ EOS @variable_max = @comment.size @exist = true when 4 @title[0] = "\\n[1]ÀÇ ÇÊ»ì±â¼ú1" @title[1] = "\\n[1]ÀÇ ÇÊ»ì±â¼ú2" @variable = 10 @comment[0] = <<-EOS ³»¿ë ±×1 \\pic[0,240,«¢«ë«·«§«¹?] EOS @comment[1] = <<-EOS ³»¿ë ±×2 \\pic[0,240,õ±«¢«ë«·«§«¹?] EOS @variable_max = @comment.size @exist = true when 5 @title[0] = "ªÆª¹ªÈ" @variable = 0 @comment[0] = <<-EOS ÀÖ¾î¶ó ÀÖ¾î¶ó ¿ÍÀÔ´Ï´Ù. EOS @variable_max = @comment.size @exist = true end end #-------------------------------------------------------------------------- # ¡Ü Àϱ⠳»¿ëÀ» µ¹·ÁÁÖ´Â #-------------------------------------------------------------------------- def show_comment return @comment[0] if VISIBLE_JUDGE_MODE == 0 if @comment.size == 1 return @comment[0] else temp = [[$game_variables[@variable]-1, 0].max, @variable_max-1].min return @comment[temp] end end #-------------------------------------------------------------------------- # ¡Ü Àϱâ ŸÀÌƲ ÃâÇö ÆÇÁ¤ #-------------------------------------------------------------------------- def title_visible? return true if @variable == 0 if VISIBLE_JUDGE_MODE == 0 if $game_switches[@variable] return true else return false end else if $game_variables[@variable] == 0 return false else return true end end end end class Window_Base < Window #-------------------------------------------------------------------------- # ¡Ü ij¸¯ÅÍ ¶óÀÎ º¯È¯ #-------------------------------------------------------------------------- def transfer(str) text = str.clone # ð¤åÙÙþí®?×â begin text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] } end text.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" end # ÆíÀÇ»ó ,"\\\\" À» "\000" ¿¡ º¯È¯ text.gsub!(/\\\\/) { "\000" } # "\\C" ªò "\001" ªË¡¢"\\G" ªò "\002" ªË?üµ text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" } text.gsub!(/\\[Gg]/) { "\002" } # ºÒÅõ¸íµµ text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\200[#{$1}]" } # ¹®ÀÚ »çÀÌÁî text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\201[#{$1}]" } # ·çºñ text.gsub!(/\\[Rr]\[(.+?),(.+?)\]/) { "\202[#{$1},#{$2}]" } # ÇÈÃÄ Ç¥½Ã text.gsub!(/\\[Pp]ic\[([0-9]+),([0-9]+),([^,\]]+)\]/) { "\250[#{$1},#{$2},#{$3}]" } # ¹öƲ·¯ Ç¥½Ã text.gsub!(/\\[Bb]at\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+)\]/) { "\251[#{$1},#{$2},#{$3},#{$4}]" } # ij¸¯ÅÍ ±×·¡ÇÈ Ç¥½Ã text.gsub!(/\\[Cc]ha\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+),([0-9]+),([0-9]+)\]/) { "\252[#{$1},#{$2},#{$3},#{$4},#{$5},#{$6}]" } return text end #-------------------------------------------------------------------------- # ¡Ü º¯È¯ÇÑ Ä³¸¯ÅÍ ¶óÀÎÀ» ¹¦È­ #-------------------------------------------------------------------------- def draw_ex_text(ox, oy, str, align=0) text = str.clone x = 0 y = 0 # c ªË 1 Ùþí®ªòö¢Ôð (Ùþí®ª¬ö¢ÔðªÇª­ªÊª¯ªÊªëªÞªÇ«ë?«×) while ((c = text.slice!(/./m)) != nil) # \\ ªÎíÞùê if c == "\000" # º»·¡ÀÇ ¹®ÀÚ¿¡ µÇµ¹¸®´Â c = "\\" end # \C[n] ÀÇ °æ¿ì if c == "\001" # ¹®ÀÚ»öÀ» º¯°æ text.sub!(/\[([0-9]+)\]/, "") color = $1.to_i if color >= 0 and color <= 7 self.contents.font.color = text_color(color) end # ´ÙÀ½ÀÇ ¹®ÀÚ¿¡ next end # \G ªÎíÞùê if c == "\002" # ¼ÒÁö °ñµå¿¡ º¯È¯ c = $game_party.gold.to_s # ¹®ÀÚ¸¦ ¹¦È­ self.contents.draw_text(ox+4+x, oy+4+ 32 * y, self.contents.text_size(c).width, 32, c) # x ¿¡ ¹¦È­ ÇÑ ¹®ÀÚÀÇ ÆøÀ» °¡»ê x += self.contents.text_size(c).width # ´ÙÀ½ÀÇ ¹®ÀÚ¿¡ next end # \O ÀÇ °æ¿ì if c == "\200" text.sub!(/\[([0-9]+)\]/, "") opacity = $1.to_i temp = self.contents.font.color self.contents.font.color = Color.new(temp.red, temp.green, temp.blue, opacity) # ó­ªÎÙþí®ªØ next end # \H ªÎíÞùê if c == "\201" text.sub!(/\[([0-9]+)\]/, "") self.contents.font.size = [[$1.to_i, 6].max, 32].min # ó­ªÎÙþí®ªØ next end # \R ªÎíÞùê if c == "\202" text.sub!(/\[(.+?),(.+?)\]/, "") x += ruby_set(ox+x,oy+(y*32),$1,$2) # ó­ªÎÙþí®ªØ next end # \Pic ªÎíÞùê if c == "\250" text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+)\]/, "") ope = self.contents.font.color.alpha set_picture($1.to_i, $2.to_i, $3, ope) # ó­ªÎÙþí®ªØ next end # \Bat ªÎíÞùê if c == "\251" text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+)\]/, "") ope = self.contents.font.color.alpha set_battler($1.to_i, $2.to_i, $3, $4.to_i, ope) # ó­ªÎÙþí®ªØ next end # \Cha ªÎíÞùê if c == "\252" text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+),([0-9]+),([0-9]+)\]/, "") ope = self.contents.font.color.alpha set_character($1.to_i, $2.to_i, $3, $4.to_i, $5.to_i, $6.to_i, ope) # ó­ªÎÙþí®ªØ next end # ËÇú¼Ùþí®ªÎíÞùê if c == "\n" # y ªË 1 ªòʥߩ y += 1 x = 0 # ó­ªÎÙþí®ªØ next end # Ùþí®ªòÙÚ? self.contents.draw_text(ox+4+x, 4+oy+ 32 * y, 40, 32, c) # x ªËÙÚ?ª·ª¿Ùþí®ªÎøëªòʥߩ x += self.contents.text_size(c).width end end #-------------------------------------------------------------------------- # ¡Ü «ë«ÓÙÚ? #-------------------------------------------------------------------------- def ruby_set(x,y,str,ruby) text_w = self.contents.text_size(str).width text_h = self.contents.text_size(str).height f_size_back = self.contents.font.size ruby_size = 10 self.contents.font.size = ruby_size ruby_w = self.contents.text_size(ruby).width self.contents.draw_text(4+x, 4+4+y-ruby_size+1, text_w, ruby_size, ruby, 1) self.contents.font.size = f_size_back self.contents.draw_text(4+x, 4+4+y, text_w, text_h, str) return text_w end #-------------------------------------------------------------------------- # ¡Ü «Ô«¯«Á«ã?ÙÚ? #-------------------------------------------------------------------------- def set_picture(x, y, filename, opacity=255) bitmap = RPG::Cache.picture(filename) self.contents.blt(x, y, bitmap, bitmap.rect, opacity) end #-------------------------------------------------------------------------- # ¡Ü «Ð«È«é?ÙÚ? #-------------------------------------------------------------------------- def set_battler(x, y, filename, hue, opacity=255) bitmap =RPG::Cache.battler(filename, hue) self.contents.blt(x, y, bitmap, bitmap.rect, opacity) end #-------------------------------------------------------------------------- # ¡Ü «­«ã«é«¯«¿?ÙÚ? #-------------------------------------------------------------------------- def set_character(x, y, filename, hue, dir, pat, opacity=255) bitmap = RPG::Cache.character(filename, hue) cw = bitmap.width / 4 ch = bitmap.height / 4 cy = ch * (dir / 2 - 1) cx = cw * (pat - 1) src_rect = Rect.new(cx, cy, cw, ch) self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity) end #-------------------------------------------------------------------------- # ¡Ü «Æ«­«¹«ÈªÎú¼?ªòÚ÷ª¹ #-------------------------------------------------------------------------- def text_row(str) text = str.clone num = 0 # c ªË 1 Ùþí®ªòö¢Ôð (Ùþí®ª¬ö¢ÔðªÇª­ªÊª¯ªÊªëªÞªÇ«ë?«×) while ((c = text.slice!(/./m)) != nil) # ËÇú¼Ùþí®ªÎíÞùê if c == "\n" # num ªË 1 ªòʥߩ num += 1 # ó­ªÎÙþí®ªØ next end end return num end end #============================================================================== # ¡á Window_Scroll #------------------------------------------------------------------------------ # ¡¡«¹«¯«í?«ëªÎѦÒöªòò¥ªÄ«¦«£«ó«É«¦«¯«é«¹ªÇª¹¡£ #============================================================================== class Window_Scroll < Window_Base #-------------------------------------------------------------------------- # ¡Ü ÍëËÒ«¤«ó«¹«¿«ó«¹?? #-------------------------------------------------------------------------- attr_reader :index # ««?«½«ëêÈöÇ attr_reader :help_window # «Ø«ë«×«¦«£«ó«É«¦ #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù # x : «¦«£«ó«É«¦ªÎ X ñ¨øö # y : «¦«£«ó«É«¦ªÎ Y ñ¨øö # width : «¦«£«ó«É«¦ªÎøë # height : «¦«£«ó«É«¦ªÎÍÔªµ #-------------------------------------------------------------------------- def initialize(x, y, width, height) super(x, y, width, height) @item_max = 1 @column_max = 1 @index = 0 self.cursor_rect.empty end #-------------------------------------------------------------------------- # ¡Ü ««?«½«ëêÈöǪÎàâïÒ # index : ã檷ª¤««?«½«ëêÈöÇ #-------------------------------------------------------------------------- def index=(index) @index = index # «Ø«ë«×«Æ«­«¹«ÈªòÌÚãæ (update_help ªÏ?ã¯à»ªÇïÒëùªµªìªë) #if self.active and @help_window != nil # update_help #end # ««?«½«ëªÎÏ»û¡ªòÌÚãæ update_cursor_rect end #-------------------------------------------------------------------------- # ¡Ü ú¼?ªÎö¢Ôð #-------------------------------------------------------------------------- def row_max # ú£ÙÍ?ªÈÖª?ª«ªéú¼?ªòß©õó return (@item_max + @column_max - 1) / @column_max end #-------------------------------------------------------------------------- # ¡Ü à»ÔéªÎú¼ªÎö¢Ôð #-------------------------------------------------------------------------- def top_row # «¦«£«ó«É«¦?黪Î?áêêª Y ñ¨øöªò¡¢1 ú¼ªÎÍÔªµ 32 ªÇùܪë return self.oy / 32 end #-------------------------------------------------------------------------- # ¡Ü à»ÔéªÎú¼ªÎàâïÒ # row : à»ÔéªËøúãƪ¹ªëú¼ #-------------------------------------------------------------------------- def top_row=(row) # row ª¬ 0 Ú±?ªÎíÞùêªÏ 0 ªËáóïá if row < 0 row = 0 end # row ª¬ row_max - 1 õ±ªÎíÞùêªÏ row_max - 1 ªËáóïá if row > row_max - 1 row = row_max - 1 end # row ªË 1 ú¼ªÎÍÔªµ 32 ªòÎЪ±¡¢«¦«£«ó«É«¦?黪Î?áêêª Y ñ¨øöªÈª¹ªë self.oy = row * 32 end #-------------------------------------------------------------------------- # ¡Ü 1 «Ú?«¸ªËøúãƪǪ­ªëú¼?ªÎö¢Ôð #-------------------------------------------------------------------------- def page_row_max # «¦«£«ó«É«¦ªÎÍÔªµª«ªé¡¢«Õ«ì?«àªÎÍÔªµ 32 ªòìÚª­¡¢1 ú¼ªÎÍÔªµ 32 ªÇùܪë return 1#(self.height - 32) / 32 end #-------------------------------------------------------------------------- # ¡Ü 1 «Ú?«¸ªËøúãƪǪ­ªëú£ÙÍ?ªÎö¢Ôð #-------------------------------------------------------------------------- def page_item_max # ú¼? page_row_max ªË Öª? @column_max ªòÎЪ±ªë return (self.height - 32) / 32#page_row_max #* @column_max end #-------------------------------------------------------------------------- # ¡Ü «Ø«ë«×«¦«£«ó«É«¦ªÎàâïÒ # help_window : ã檷ª¤«Ø«ë«×«¦«£«ó«É«¦ #-------------------------------------------------------------------------- def help_window=(help_window) @help_window = help_window # «Ø«ë«×«Æ«­«¹«ÈªòÌÚãæ (update_help ªÏ?ã¯à»ªÇïÒëùªµªìªë) if self.active and @help_window != nil update_help end end #-------------------------------------------------------------------------- # ¡Ü ««?«½«ëªÎÏ»û¡ÌÚãæ #-------------------------------------------------------------------------- def update_cursor_rect # ««?«½«ëêÈöǪ¬ 0 Ú±?ªÎíÞùê if @index < 0 self.cursor_rect.empty return end # úÞÎú¼ªòö¢Ôð row = @index #/ @column_max # úÞÎú¼ª¬¡¢øúãƪµªìªÆª¤ªëà»ÔéªÎú¼ªèªêîñªÎíÞùê if row < self.top_row # úÞÎú¼ª¬à»ÔéªËªÊªëªèª¦ªË«¹«¯«í?«ë self.top_row = row end # úÞÎú¼ª¬¡¢øúãƪµªìªÆª¤ªëõÌý­Ú­ªÎú¼ªèªêý­ªíªÎíÞùê if row > self.top_row + (self.page_row_max - 1) # úÞÎú¼ª¬õÌý­Ú­ªËªÊªëªèª¦ªË«¹«¯«í?«ë self.top_row = row - (self.page_row_max - 1) end # ««?«½«ëªÎøëªòͪߩ #cursor_width = self.width / @column_max - 32 # ««?«½«ëªÎñ¨øöªòͪߩ #x = @index % @column_max * (cursor_width + 32) #y = @index / @column_max * 32 - self.oy # ««?«½«ëªÎÏ»û¡ªòÌÚãæ #self.cursor_rect.set(x, y, cursor_width, 32) end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update super # ««?«½«ëªÎì¹ÔѪ¬Ê¦ÒöªÊ?÷¾ªÎíÞùê if self.active and @item_max > 0 and @index >= 0 and self.contents.height / 32 > (self.height - 32) / 32 # Û°ú¾«Ü«¿«óªÎù»ª¬ä㪵ªìª¿íÞùê if Input.repeat?(Input::DOWN) # Öª?ª¬ 1 ª«ªÄ Û°ú¾«Ü«¿«óªÎù»ªÎäãù»?÷¾ª¬«ê«Ô?«ÈªÇªÊª¤íÞùꪫ¡¢ # ªÞª¿ªÏ««?«½«ëêÈöǪ¬(ú£ÙÍ? - Öª?)ªèªêîñªÎíÞùê if (@column_max == 1 and Input.trigger?(Input::DOWN)) or @index < @item_max - @column_max # ««?«½«ëªòù»ªËì¹ÔÑ $game_system.se_play($data_system.cursor_se) @index = (@index + @column_max) % @item_max end end # Û°ú¾«Ü«¿«óªÎß¾ª¬ä㪵ªìª¿íÞùê if Input.repeat?(Input::UP) # Öª?ª¬ 1 ª«ªÄ Û°ú¾«Ü«¿«óªÎß¾ªÎäãù»?÷¾ª¬«ê«Ô?«ÈªÇªÊª¤íÞùꪫ¡¢ # ªÞª¿ªÏ««?«½«ëêÈöǪ¬Öª?ªèªêý­ªíªÎíÞùê if (@column_max == 1 and Input.trigger?(Input::UP)) or @index >= @column_max # ««?«½«ëªòß¾ªËì¹ÔÑ $game_system.se_play($data_system.cursor_se) @index = (@index - @column_max + @item_max) % @item_max end end # Û°ú¾«Ü«¿«óªÎéÓª¬ä㪵ªìª¿íÞùê if Input.repeat?(Input::RIGHT) # øúãƪµªìªÆª¤ªëõÌý­Ú­ªÎú¼ª¬¡¢«Ç?«¿ß¾ªÎõÌý­ªÎú¼ªèªêªâîñªÎíÞùê if self.top_row + (self.page_row_max - 1) < (self.row_max - 1) # ««?«½«ëªò 1 «Ú?«¸ý­ªíªËì¹ÔÑ $game_system.se_play($data_system.cursor_se) @index = [@index + self.page_item_max, @item_max - 1].min self.top_row += self.page_row_max end end # Û°ú¾«Ü«¿«óªÎñ§ª¬ä㪵ªìª¿íÞùê if Input.repeat?(Input::LEFT) # øúãƪµªìªÆª¤ªëà»ÔéªÎú¼ª¬ 0 ªèªêý­ªíªÎíÞùê if self.top_row > 0 # ««?«½«ëªò 1 «Ú?«¸îñªËì¹ÔÑ $game_system.se_play($data_system.cursor_se) @index = [@index - self.page_item_max, 0].max self.top_row -= self.page_row_max end end end # «Ø«ë«×«Æ«­«¹«ÈªòÌÚãæ (update_help ªÏ?ã¯à»ªÇïÒëùªµªìªë) if self.active and @help_window != nil update_help end # ««?«½«ëªÎÏ»û¡ªòÌÚãæ update_cursor_rect end end class Window_Questdiary_Select < Window_Selectable attr_reader :data #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize super(0, 64, 640, 416) @column_max = 2 data_set @item_max = @data.size self.index = 0 refresh end def data_set @data = [] @diary_data = [0] for i in 1..QUESTDIARY_DATA_MAX @diary_data[i] = Data_Questdiary.new(i) next if (!NO_DATA_VISIBLE and !@diary_data[i].title_visible?) @data.push(@diary_data[i]) if @diary_data[i].exist end end #-------------------------------------------------------------------------- # ¡Ü ìíÑÀ«Ç?«¿ö¢Ôð #-------------------------------------------------------------------------- def diary return @data[self.index] end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end #ú£ÙÍ?ª¬ 0 ªÇªÊª±ªìªÐ«Ó«Ã«È«Þ«Ã«×ªòíÂà÷ª·¡¢îïú£ÙͪòÙÚ? return if @item_max == 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end def draw_item(index) item = @data[index] x = 4 + index % 2 * (288 + 32) y = index / 2 * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.font.color = normal_color self.contents.draw_text(x, y, 32, 32, item.id.to_s) if DRAW_ID if item.title_visible? diary_title = transfer(item.title) if TITLE_TEXT_EX draw_ex_text(x+48, y - 4, diary_title, 0) else self.contents.draw_text(x+48, y, 212, 32, diary_title, 0) end else self.contents.draw_text(x+48, y, 212, 32, "£­£­£­£­£­", 0) end end end class Window_Questdiary_Info < Window_Scroll #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize super(0, 64, 640, 416) self.contents = Bitmap.new(width - 32, height - 32) end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh(comment) self.index = 0 self.contents.dispose contents_row = text_row(comment) self.contents = Bitmap.new(width - 32, [contents_row * 32, self.height - 32].max) @item_max = [(contents_row + 1 - (self.height - 32) / 32), 0].max self.contents.font.color = normal_color self.contents.font.size = 22 new_text = transfer(comment) draw_ex_text(0, 0, new_text) end end class Scene_Questdiary #-------------------------------------------------------------------------- # ¡Ü «á«¤«ó?×â #-------------------------------------------------------------------------- def main # «¦«£«ó«É«¦ªòíÂà÷ @title_window = Window_Base.new(0, 0, 640, 64) @title_window.contents = Bitmap.new(640 - 32, 64 - 32) @title_window.contents.draw_text(4, 0, 320, 32, "Ù³?ìíÑÀ", 0) @main_window = Window_Questdiary_Select.new @main_window.active = true # «¤«ó«Õ«©«¦«£«ó«É«¦ªòíÂà÷ (ÜôʦãÊ?Þª«¢«¯«Æ«£«ÖªËàâïÒ) @info_window = Window_Questdiary_Info.new @info_window.z = 110 @info_window.visible = false @info_window.active = false @visible_index = 0 # «È«é«ó«¸«·«ç«ó?ú¼ Graphics.transition # «á«¤«ó«ë?«× loop do # «²?«à?ØüªòÌÚãæ Graphics.update # ìýÕôï×ÜêòÌÚãæ Input.update # «Õ«ì?«àÌÚãæ update # ?Øüª¬ï·ªêôðªïªÃª¿ªé«ë?«×ªòñé? if $scene != self break end end # «È«é«ó«¸«·«ç«óñÞÝá Graphics.freeze # «¦«£«ó«É«¦ªòú°Û¯ @title_window.dispose @main_window.dispose @info_window.dispose end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update # «¦«£«ó«É«¦ªòÌÚãæ @main_window.update @info_window.update if @info_window.active update_info return end # «á«¤«ó«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê: update_target ªòû¼ªÖ if @main_window.active update_main return end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ («á«¤«ó«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê) #-------------------------------------------------------------------------- def update_main # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) if @main_window.diary.title_visible? == false # «Ö«¶? SE ªòæÑñ´ $game_system.se_play($data_system.buzzer_se) return end # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) @main_window.active = false @info_window.active = true @info_window.visible = true @visible_index = @main_window.index @info_window.refresh(@main_window.diary.show_comment) return end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ («¤«ó«Õ«©«¦«£«ó«É«¦ª¬«¢«¯«Æ«£«ÖªÎíÞùê) #-------------------------------------------------------------------------- def update_info # B «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::B) # «­«ã«ó«»«ë SE ªòæÑñ´ $game_system.se_play($data_system.cancel_se) @main_window.active = true @info_window.active = false @info_window.visible = false return end # C «Ü«¿«óª¬ä㪵ªìª¿íÞùê if Input.trigger?(Input::C) return # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) if @comment_on @comment_on = false @comment_window.visible = false else @comment_on = true @comment_window.visible = true end return end if Input.trigger?(Input::L) # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) loop_end = false while loop_end == false if @visible_index != 0 @visible_index -= 1 else @visible_index = @main_window.data.size - 1 end loop_end = true if @main_window.data[@visible_index].title_visible? end diary = @main_window.data[@visible_index] @info_window.refresh(diary.show_comment) return end if Input.trigger?(Input::R) # ̽ïÒ SE ªòæÑñ´ $game_system.se_play($data_system.decision_se) loop_end = false while loop_end == false if @visible_index != @main_window.data.size - 1 @visible_index += 1 else @visible_index = 0 end loop_end = true if @main_window.data[@visible_index].title_visible? end diary = @main_window.data[@visible_index] @info_window.refresh(diary.show_comment) return end end end