pigu_6

SabaKan| Galge Conversation System

Nov 24th, 2012
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.62 KB | None | 0 0
  1. #==============================================================================
  2. # ■ Galge Conversation System
  3. # @version 0.7 12/02/15 RGSS3
  4. # @author Saba Kan
  5. # @translator kirinelf (Made a small edit to picture IDs)
  6. #------------------------------------------------------------------------------
  7. #  
  8. #==============================================================================
  9. module Saba
  10. module Gal
  11. # --------------------Config---------------------
  12.  
  13. # Fine tuning of actor graphic positioning.
  14. # {Actor ID=>pixels shifted} E.g. {1=>-4} (Actor ID 1's graphic shifted 4
  15. # pixels to the left/up)
  16. OFFSET_X = {1=>0, 2=>-30, 3=>-30, 6=>-40, 7=>-45, 8=>-40}
  17. OFFSET_Y = {1=>0, 2=>10, 3=>40, 4=>10, 7=>-15, 8=>5}
  18.  
  19. # This only applies to OFFSET_X above, for displaying character graphics on
  20. # the left.
  21. # 座標に -1 をかける場合 true に設定します。
  22. # If the coordinates above have '-1', set to true. <= ?
  23. MIRROR_LEFT_OFFSET_X = false
  24.  
  25. # Speech balloon graphic coordinates.
  26. BALLOON_LEFT_X = 210 # X Coordinate when it appears on the left.
  27. BALLOON_RIGHT_X = 300 # X Coordinate when it appears on the right.
  28. BALLOON_Y = 254 # Y Coordinate
  29.  
  30. # Name window width. Default of 114 is for a name 4 characters long.
  31. NAME_WINDOW_WIDTH = 114
  32.  
  33. # For skipping text. A is Shift on the keyboard.
  34. SKIP_BUTTON = Input::A
  35.  
  36. # This switch ID disables skipping of the text.
  37. SKIP_DISABLE_SWITCH = 131
  38.  
  39. # This switch changes the message display mode.
  40. MESSAGE_MODE_SWITCH = 132
  41.  
  42. # This switch ID toggles display of the name.
  43. DISPLAY_NAME_SWITCH = 133
  44.  
  45. # This switch toggles display of speech balloon graphics.
  46. DISPLAY_BALLOON_SWITCH = 134
  47.  
  48. # This switch clears all speech balloon graphics.
  49. CLEAR_BALLOON_SWITCH = 135
  50.  
  51. # This switch toggles playing of message sound effects.
  52. PLAY_MESSAGE_SE_SWITCH = 136
  53.  
  54. # Variable to determine speech balloon color.
  55. # ※Will be automatically entered into the variable.
  56. BALLOON_VARIABLE = 131
  57.  
  58. # Variable to determine speech balloon location.
  59. # ※Will be automatically entered into the variable.
  60. BALLOON_POSITION_VARIABLE = 132
  61.  
  62. # If you want character graphics displayed on the right to be mirrored,
  63. # set to 'true'.
  64. MIRROR_LEFT = false
  65.  
  66. # If you want character graphics displayed on the left to be mirrored,
  67. # set to 'true'.
  68. MIRROR_RIGHT = false
  69.  
  70. # This setting changes the base picture ID of the potraits. Generally
  71. # speaking, the lower this is the better. However, some people might use
  72. # a lot of pictures, and it's a hassle to remember which IDs the script uses.
  73. # This setting allows you to define the base picture ID of the potraits.
  74. # Potraits on the right will have this ID, and potraits on the left will have
  75. # this ID + 2. For example, the default setting has the picture IDs of 10
  76. # and 12.
  77. BASE_PICTURE_ID = 10
  78.  
  79. # If you don't want different characters to have different windowskins,
  80. # set to 'true'.
  81. # Window1.png and Balloon1.png will be used if 'true'.
  82. USE_SINGLE_WINDOW_SKIN = false
  83.  
  84. # Tone overlay of characters in conversation.
  85. # Red, Green, Blue, Gray
  86. # Active Character
  87. ACTIVE_TONE = Tone.new(0, 0, 0, 0)
  88. # Inactive Character (0, 0, 0, 0) <= No change.
  89. INACTIVE_TONE = Tone.new(-104, -104, -104, 0)
  90.  
  91. # Frames to wait after tone change during character switching.
  92. TONE_CHANGE_DURATION = 17
  93.  
  94. # Event Command "Show Balloon Icon" Icon Positioning
  95. OFFSET_EVENT_BALLOON_X = {1=>0, 2=>0, 3=>-30, 6=>-40, 7=>-45, 8=>-40}
  96. OFFSET_EVENT_BALLOON_Y = {1=>0, 2=>10, 3=>40, 4=>10, 7=>-15, 8=>5}
  97. end
  98. end
  99.  
  100. #=========================================================================
  101. # Do not edit anything under this line unless you know what you're doing!
  102. #=========================================================================
  103.  
  104. $imported = {} if $imported == nil
  105. $imported["GalGameTalkSystem"] = true
  106.  
  107.  
  108. # ピクチャ表示用
  109. class Game_Interpreter
  110.  
  111. def pic(name, index, position)
  112. actor_id = name["actor".length..-1].to_i
  113. $game_variables[Saba::Gal::BALLOON_POSITION_VARIABLE] = position
  114. x = picture_base_x(position) + offset_x(position, actor_id)
  115. y = picture_base_y(position) + offset_y(actor_id)
  116. $game_variables[Saba::Gal::BALLOON_VARIABLE] = actor_id
  117. picture = screen.pictures[position + Saba::Gal::BASE_PICTURE_ID]
  118.  
  119. name = name + "_" + (index + 1).to_s
  120. @actor1_position = nil if @actor1_position == position
  121. if Saba::Gal::MIRROR_LEFT && position == 1
  122. picture.mirror_pic = true
  123. elsif Saba::Gal::MIRROR_RIGHT && position == 2
  124. picture.mirror_pic = true
  125. else
  126. picture.mirror_pic = false
  127. end
  128. picture.show(name, 0, x, y, 100, 100, 255, 0)
  129. if @actor_id != actor_id
  130. picture.start_tone_change(Saba::Gal::INACTIVE_TONE, 0)
  131.  
  132. deactivate_other_pictures(position)
  133. activate(picture, position, actor_id)
  134. end
  135. @actor_id = actor_id
  136. end
  137. #--------------------------------------------------------------------------
  138. # ● ピクチャのオフセット位置のx座標取得
  139. #--------------------------------------------------------------------------
  140. def offset_x(position, actor_id)
  141. n = Saba::Gal::OFFSET_X[actor_id]
  142.  
  143. return 0 if n == nil
  144. if position == 1 && Saba::Gal::MIRROR_LEFT_OFFSET_X
  145. return -n
  146. else
  147. return n
  148. end
  149. end
  150. #--------------------------------------------------------------------------
  151. # ● ピクチャのオフセット位置のy座標取得
  152. #--------------------------------------------------------------------------
  153. def offset_y(actor_id)
  154. n = Saba::Gal::OFFSET_Y[actor_id]
  155. return 0 if n == nil
  156. return n
  157. end
  158. #--------------------------------------------------------------------------
  159. # ● イベントバルーンのオフセット位置のx座標取得
  160. #--------------------------------------------------------------------------
  161. def offset_event_balloon_x(position, actor_id)
  162. n = Saba::Gal::OFFSET_EVENT_BALLOON_X[actor_id]
  163. return 0 if n == nil
  164. if position == 1 && Saba::Gal::MIRROR_LEFT_OFFSET_X
  165. return -n
  166. else
  167. return n
  168. end
  169. end
  170. #--------------------------------------------------------------------------
  171. # ● イベントバルーンのオフセット位置のy座標取得
  172. #--------------------------------------------------------------------------
  173. def offset_event_balloon_y(actor_id)
  174. n = Saba::Gal::OFFSET_EVENT_BALLOON_Y[actor_id]
  175. return 0 if n == nil
  176. return n
  177. end
  178. #--------------------------------------------------------------------------
  179. # ● 指定のピクチャを明るく
  180. #--------------------------------------------------------------------------
  181. def activate(picture, position, actor_id)
  182. if Input.press?(Saba::Gal::SKIP_BUTTON)
  183. picture.start_tone_change(Saba::Gal::ACTIVE_TONE, 1)
  184. else
  185. picture.start_tone_change(Saba::Gal::ACTIVE_TONE, 25)
  186. end
  187. $game_temp.pic_actors[position] = actor_id
  188. end
  189. #--------------------------------------------------------------------------
  190. # ● 指定のピクチャ以外を暗く
  191. #--------------------------------------------------------------------------
  192. def deactivate_other_pictures(position)
  193. screen.pictures.size.times do |index|
  194. next if screen.pictures[index].number == 1
  195. next if index == position + 10
  196. deactivate(screen.pictures[index])
  197. end
  198. end
  199. #--------------------------------------------------------------------------
  200. # ● 指定のピクチャを暗く
  201. #--------------------------------------------------------------------------
  202. def deactivate(picture)
  203. unless Input.press?(Saba::Gal::SKIP_BUTTON)
  204. picture.start_tone_change(Saba::Gal::INACTIVE_TONE, 25)
  205. end
  206. end
  207. def picture_base_x(position)
  208. case position
  209. when 2
  210. return 25
  211. when 0
  212. return Graphics.width - 244
  213. when 3
  214. return 200
  215. end
  216. end
  217. def picture_base_y(position)
  218. return 30
  219. end
  220. def act(position)
  221. $game_variables[Saba::Gal::BALLOON_VARIABLE] = $game_temp.pic_actors[position]
  222. if position < 3
  223. $game_variables[Saba::Gal::BALLOON_POSITION_VARIABLE] = position
  224. end
  225. picture = screen.pictures[position + 10]
  226. deactivate_other_pictures(position)
  227. if Input.press?(Saba::Gal::SKIP_BUTTON)
  228. picture.start_tone_change(Saba::Gal::ACTIVE_TONE, 1)
  229. @wait_count = 0
  230. else
  231. picture.start_tone_change(Saba::Gal::ACTIVE_TONE, Saba::Gal::TONE_CHANGE_DURATION)
  232. @wait_count = 0
  233. end
  234. end
  235. def dis(position)
  236. picture = screen.pictures[position + 10]
  237. picture.erase
  238. end
  239. end
  240.  
  241. class Scene_Map
  242. #--------------------------------------------------------------------------
  243. # ● メッセージウィンドウの作成
  244. #--------------------------------------------------------------------------
  245. alias saba_gal_create_message_window create_message_window
  246. def create_message_window
  247. saba_gal_create_message_window
  248. create_gal_window
  249. end
  250. #--------------------------------------------------------------------------
  251. # ● フレーム更新
  252. #--------------------------------------------------------------------------
  253. alias saba_gal_update update
  254. def update
  255. create_gal_window
  256. update_gal_event_balloon
  257. saba_gal_update
  258. end
  259. #--------------------------------------------------------------------------
  260. # ● ギャルゲーウィンドウ作成
  261. # ギャルゲーモードの時、ウィンドウを切り替えます。
  262. #--------------------------------------------------------------------------
  263. def create_gal_window
  264. if $game_switches[Saba::Gal::MESSAGE_MODE_SWITCH]
  265. if ! @message_window.is_a?(Window_MessageGal)
  266. # ギャルゲーウィンドウにする
  267. @message_window.dispose
  268. @message_window = Window_MessageGal.new
  269. end
  270. else
  271. if @message_window.is_a?(Window_MessageGal)
  272. # 通常ウィンドウに戻す
  273. @message_window.dispose
  274. @message_window = Window_Message.new
  275. end
  276. end
  277. end
  278. def on_a
  279. p 11
  280. end
  281. #--------------------------------------------------------------------------
  282. # ● ギャルゲーウィンドウのフキダシアイコン作成
  283. #--------------------------------------------------------------------------
  284. def create_gal_event_balloon(character)
  285. dispose_gal_event_balloon
  286. @saba_balloon_sprite = Sprite_Character.new(@viewport, character)
  287. end
  288. #--------------------------------------------------------------------------
  289. # ● ギャルゲーウィンドウのフキダシアイコン破棄
  290. #--------------------------------------------------------------------------
  291. def dispose_gal_event_balloon
  292. if @saba_balloon_sprite
  293. @saba_balloon_sprite.dispose
  294. @saba_balloon_sprite = nil
  295. end
  296. end
  297. #--------------------------------------------------------------------------
  298. # ● ギャルゲーウィンドウのフキダシアイコン更新
  299. #--------------------------------------------------------------------------
  300. def update_gal_event_balloon
  301. if @saba_balloon_sprite
  302. if @saba_balloon_sprite.character.balloon_id == 0 || Input.press?(Saba::Gal::SKIP_BUTTON)
  303. dispose_gal_event_balloon
  304. else
  305. @saba_balloon_sprite.update
  306. end
  307. end
  308. end
  309. #--------------------------------------------------------------------------
  310. # ● スプライトセットの解放
  311. #--------------------------------------------------------------------------
  312. alias saba_gal_dispose_spriteset dispose_spriteset
  313. def dispose_spriteset
  314. saba_gal_dispose_spriteset
  315. dispose_gal_event_balloon
  316. end
  317. end
  318.  
  319.  
  320. class Window_MessageGal < Window_Message
  321. #--------------------------------------------------------------------------
  322. # ● オブジェクト初期化
  323. #--------------------------------------------------------------------------
  324. def initialize
  325. super
  326. self.x = 10
  327. create_baloon_sprite
  328. $game_temp.window_number = -1
  329. update_balloon
  330. end
  331. #--------------------------------------------------------------------------
  332. # ● ウィンドウ幅の取得
  333. #--------------------------------------------------------------------------
  334. def window_width
  335. Graphics.width - 20
  336. end
  337. #--------------------------------------------------------------------------
  338. # ● 表示行数の取得
  339. #--------------------------------------------------------------------------
  340. def visible_line_number
  341. return 3
  342. end
  343. #--------------------------------------------------------------------------
  344. # ● 改ページが必要か判定
  345. #--------------------------------------------------------------------------
  346. def need_new_page?(text, pos)
  347. pos[:y] > contents.height && !text.empty?
  348. end
  349. #--------------------------------------------------------------------------
  350. # ● 通常文字の処理
  351. #--------------------------------------------------------------------------
  352. def process_normal_character(c, pos)
  353. if Input.press?(Saba::Gal::SKIP_BUTTON) && skip_enabled?
  354. @pause_skip = true
  355. end
  356. text_width = text_size(c).width
  357. if display_name? && (pos[:y] == 0)
  358. @name_sprite.bitmap.draw_text(pos[:x], 26, text_width * 2, pos[:height], c)
  359. pos[:x] += text_width
  360. return
  361. end
  362. if display_name?
  363. draw_text(pos[:x], pos[:y] - pos[:height], text_width * 2, pos[:height], c)
  364. else
  365. draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
  366. end
  367. pos[:x] += text_width
  368. unless Input.press?(Saba::Gal::SKIP_BUTTON) && skip_enabled?
  369. wait_for_one_character
  370. end
  371. end
  372. #--------------------------------------------------------------------------
  373. # ● 制御文字によるアイコン描画の処理
  374. #--------------------------------------------------------------------------
  375. def process_draw_icon(icon_index, pos)
  376. if display_name?
  377. draw_icon(icon_index, pos[:x], pos[:y] - pos[:height])
  378. else
  379. draw_icon(icon_index, pos[:x], pos[:y])
  380. end
  381. pos[:x] += 24
  382. end
  383. #--------------------------------------------------------------------------
  384. # ● 全ウィンドウの作成
  385. #--------------------------------------------------------------------------
  386. def create_all_windows
  387. super
  388. @name_window = Window_Base.new(20, Graphics.height - 126, Saba::Gal::NAME_WINDOW_WIDTH, 37)
  389. @name_window.z = 480
  390. @name_window.visible = false
  391.  
  392. @name_sprite = Sprite_Base.new(nil)
  393. @name_sprite.z = 500
  394. @name_sprite.x = 30
  395. @name_sprite.y = Graphics.height - 146
  396. @name_sprite.bitmap = Bitmap.new(230, 300)
  397. end
  398. #--------------------------------------------------------------------------
  399. # ● フキダシスプライトを生成します。
  400. #--------------------------------------------------------------------------
  401. def create_baloon_sprite
  402. @balloon_sprite = Sprite_Base.new
  403. @balloon_sprite.z = 500
  404. @balloon_sprite.y = Graphics.height - 384
  405. @balloon_sprite.bitmap = Bitmap.new(400, 300)
  406. @balloon_sprite.visible = false
  407. end
  408. #--------------------------------------------------------------------------
  409. # ● 全ウィンドウの解放
  410. #--------------------------------------------------------------------------
  411. def dispose_all_windows
  412. super
  413. @name_window.dispose
  414. @name_sprite.bitmap.dispose
  415. @name_sprite.dispose
  416. @balloon_sprite.dispose
  417. end
  418. #--------------------------------------------------------------------------
  419. # ● ウィンドウの更新
  420. #--------------------------------------------------------------------------
  421. def update
  422. super
  423. update_name_visibility
  424. update_balloon_visibility
  425. update_balloon
  426. update_opacity
  427. end
  428. #--------------------------------------------------------------------------
  429. # ● 不透明度の更新
  430. #--------------------------------------------------------------------------
  431. def update_opacity
  432. if @background != 0
  433. self.opacity = 0
  434. return
  435. end
  436. return if self.opacity == 255
  437. self.opacity += 9
  438. end
  439. #--------------------------------------------------------------------------
  440. # ● 入力待ち処理
  441. #--------------------------------------------------------------------------
  442. def input_pause
  443. self.pause = true
  444. wait(10)
  445. Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C) || (Input.press?(Saba::Gal::SKIP_BUTTON) && skip_enabled?)
  446. if self.visible == false
  447. self.visible = true
  448. Sound.play_cursor
  449. input_pause
  450. return
  451. end
  452. Input.update
  453. self.pause = false
  454. end
  455. #--------------------------------------------------------------------------
  456. # ● ウィンドウを開き、完全に開くまで待つ
  457. #--------------------------------------------------------------------------
  458. def open_and_wait
  459. open
  460. update_picture
  461. until open?
  462. update_balloon
  463. Fiber.yield
  464. end
  465. end
  466. #--------------------------------------------------------------------------
  467. # ● ウィンドウを閉じ、完全に閉じるまで待つ
  468. #--------------------------------------------------------------------------
  469. def close_and_wait
  470. close
  471. @name_window.visible = false
  472. @name_sprite.visible = false
  473.  
  474. until all_close?
  475. Fiber.yield
  476. end
  477. end
  478. #--------------------------------------------------------------------------
  479. # ● 改ページ処理
  480. #--------------------------------------------------------------------------
  481. def new_page(text, pos)
  482. @name_sprite.bitmap.clear
  483. contents.clear
  484. reset_font_settings
  485. pos[:x] = new_line_x
  486. pos[:y] = 0
  487. pos[:new_x] = new_line_x
  488. pos[:height] = calc_line_height(text)
  489. clear_flags
  490. end
  491. #--------------------------------------------------------------------------
  492. # ● 立ち絵の更新
  493. #--------------------------------------------------------------------------
  494. def update_picture
  495. return if $game_message.face_name.empty?
  496. $game_map.interpreter.pic($game_message.face_name, $game_message.face_index, $game_message.position)
  497. end
  498. #--------------------------------------------------------------------------
  499. # ● ウィンドウ位置の更新
  500. #--------------------------------------------------------------------------
  501. def update_placement
  502. @position = 2
  503. self.y = @position * (Graphics.height - height) / 2
  504. @gold_window.y = y > 0 ? 0 : Graphics.height - @gold_window.height
  505. end
  506. #--------------------------------------------------------------------------
  507. # ● 背景と位置の変更判定
  508. #--------------------------------------------------------------------------
  509. def settings_changed?
  510. @background != $game_message.background
  511. end
  512. #--------------------------------------------------------------------------
  513. # ● 改行位置の取得
  514. #--------------------------------------------------------------------------
  515. def new_line_x
  516. return 0
  517. end
  518. #--------------------------------------------------------------------------
  519. # ● 次の語を表示すべきかどうかを判定します。
  520. #--------------------------------------------------------------------------
  521. def show_next_message?
  522. if skip_enabled?
  523. return Input.trigger?(Input::C) || Input.trigger?(Input::B) || Input.trigger?(Saba::Gal::SKIP_BUTTON)
  524. else
  525. return Input.trigger?(Input::C) || Input.trigger?(Input::B)
  526. end
  527. end
  528. #--------------------------------------------------------------------------
  529. # ● メッセージスキップが有効かどうかを判定します。
  530. #--------------------------------------------------------------------------
  531. def skip_enabled?
  532. return $game_switches[Saba::Gal::SKIP_DISABLE_SWITCH] != true
  533. end
  534. #--------------------------------------------------------------------------
  535. # ● スイッチに従って、名前ウィンドウの表示を切り替えます。
  536. #--------------------------------------------------------------------------
  537. def update_name_visibility
  538. if @closing || close? || ! self.visible
  539. @name_window.visible = false
  540. @name_sprite.visible = false
  541. return
  542. end
  543. if $game_switches[Saba::Gal::DISPLAY_NAME_SWITCH] != true
  544. @name_window.visible = false
  545. @name_sprite.visible = false
  546. else
  547. @name_window.visible = true
  548. @name_sprite.visible = true
  549. end
  550. end
  551. #--------------------------------------------------------------------------
  552. # ● ふきだしの表示を切り替えます。
  553. #--------------------------------------------------------------------------
  554. def update_balloon_visibility
  555. if self.openness < 255
  556. @balloon_sprite.visible = false
  557. return
  558. end
  559. if @balloon_sprite.visible != $game_switches[Saba::Gal::DISPLAY_BALLOON_SWITCH]
  560. @balloon_sprite.visible = $game_switches[Saba::Gal::DISPLAY_BALLOON_SWITCH]
  561. update_balloon
  562. end
  563. end
  564. #--------------------------------------------------------------------------
  565. # ● 名前を表示すべきかどうかを判定します。
  566. #--------------------------------------------------------------------------
  567. def display_name?
  568. return $game_switches[Saba::Gal::DISPLAY_NAME_SWITCH] == true
  569. end
  570. #--------------------------------------------------------------------------
  571. # ● フキダシをまっさらにします。
  572. #--------------------------------------------------------------------------
  573. def clear_balloon
  574. @balloon_sprite.bitmap.clear_rect(100, 254, 300, 100)
  575. end
  576. #--------------------------------------------------------------------------
  577. # ● ウィンドウの色が変わったかどうかを判定します。
  578. #--------------------------------------------------------------------------
  579. def window_color_changed?
  580. if $game_temp.window_number != $game_variables[Saba::Gal::BALLOON_VARIABLE] || $game_switches[Saba::Gal::CLEAR_BALLOON_SWITCH]
  581. $game_temp.window_number = $game_variables[Saba::Gal::BALLOON_VARIABLE]
  582. return true
  583. end
  584. return false
  585. end
  586. #--------------------------------------------------------------------------
  587. # ● フキダシを更新します。
  588. #--------------------------------------------------------------------------
  589. def update_balloon
  590. return unless window_color_changed?
  591. clear_balloon
  592. if Saba::Gal::USE_SINGLE_WINDOW_SKIN
  593. self.windowskin = Cache.system("Window1")
  594. else
  595. self.windowskin = Cache.system("Window" + $game_temp.window_number.to_s)
  596. if openness == 255
  597. self.opacity = 140 unless $game_switches[Saba::Gal::CLEAR_BALLOON_SWITCH]
  598. end
  599. end
  600. $game_switches[Saba::Gal::CLEAR_BALLOON_SWITCH] = false
  601. if $game_temp.window_number != nil && $game_temp.window_number > 0
  602. if Saba::Gal::USE_SINGLE_WINDOW_SKIN
  603. balloon = Cache.system("Balloon1")
  604. else
  605. balloon = Cache.system("Balloon" + $game_temp.window_number.to_s)
  606. end
  607. w = balloon.width / 2
  608. h = balloon.height
  609. if $game_variables[Saba::Gal::BALLOON_POSITION_VARIABLE] == 2
  610. @balloon_sprite.bitmap.blt(Saba::Gal::BALLOON_LEFT_X, Saba::Gal::BALLOON_Y, balloon, Rect.new(w, 0, w, h))
  611. else
  612. @balloon_sprite.bitmap.blt(Saba::Gal::BALLOON_RIGHT_X, Saba::Gal::BALLOON_Y, balloon, Rect.new(0, 0, w, h))
  613. end
  614. end
  615. end
  616.  
  617. end
  618.  
  619.  
  620. class Game_Picture
  621. attr_accessor:mirror_pic
  622. alias saba_gal_initialze initialize
  623. def initialize(number)
  624. saba_gal_initialze(number)
  625. @mirror_pic = false
  626. end
  627. end
  628.  
  629. class Sprite_Picture < Sprite
  630. alias saba_gal_update update
  631. def update
  632. saba_gal_update
  633. if @picture_name != ""
  634. self.mirror = @picture.mirror_pic
  635. end
  636. end
  637. end
  638.  
  639. class Game_Pictures
  640. def size
  641. return @data.size
  642. end
  643. end
  644.  
  645. class Game_Temp
  646. attr_accessor :window_number
  647. attr_accessor :pic_actors
  648. alias saba_pic_initialize initialize
  649. def initialize
  650. saba_pic_initialize
  651. @pic_actors = []
  652. end
  653. end
  654.  
  655. class Game_Interpreter
  656. #--------------------------------------------------------------------------
  657. # ● フキダシアイコンの表示
  658. #--------------------------------------------------------------------------
  659. alias saba_gal_command_213 command_213
  660. def command_213
  661. unless message_mode?
  662. saba_gal_command_213
  663. return
  664. end
  665. command = @list[@index + 1]
  666. if command == nil || command.code != 101
  667. p "イベントコマンドのフキダシアイコンの表示 の後にメッセージイベントを入れてください"
  668. return
  669. end
  670.  
  671. return if Input.press?(Saba::Gal::SKIP_BUTTON)
  672. params = command.parameters
  673. name = params[0]
  674. actor_id = name["actor".length..-1].to_i
  675. position = params[3]
  676. x = (picture_base_x(position) + offset_event_balloon_x(position, actor_id) + 80) / 32.0 + $game_map.display_x
  677. y = (picture_base_y(position) + offset_event_balloon_y(actor_id)) / 32.0 + $game_map.display_y
  678. balloon_char = Game_Character.new
  679. balloon_char.moveto(x, y)
  680. balloon_char.balloon_id = @params[1]
  681. SceneManager.scene.create_gal_event_balloon(balloon_char)
  682. end
  683. #--------------------------------------------------------------------------
  684. # ● 会話モードかどうかを判定します。
  685. #--------------------------------------------------------------------------
  686. def message_mode?
  687. return $game_switches[Saba::Gal::MESSAGE_MODE_SWITCH] == true
  688. end
  689. end
Advertisement
Add Comment
Please, Sign In to add comment