SHOW:
|
|
- or go back to the newest paste.
| 1 | module Z12 | |
| 2 | ||
| 3 | def self.namebox(faceset, index) | |
| 4 | case faceset | |
| 5 | when "main" | |
| 6 | case index | |
| 7 | when 0; return $game_actors[1].name | |
| 8 | when 1; return $game_actors[2].name | |
| 9 | when 2; return $game_actors[3].name | |
| 10 | when 3; return $game_actors[4].name | |
| 11 | when 4; return "Fixed Name" | |
| 12 | end | |
| 13 | end | |
| 14 | return "" | |
| 15 | end | |
| 16 | ||
| 17 | end | |
| 18 | ||
| 19 | class Scene_Battle < Scene_Base | |
| 20 | ||
| 21 | def create_message_window | |
| 22 | @message_window = Window_Message.new | |
| 23 | @message_name = Window_MessageName.new | |
| 24 | $game_message.set_pop(@message_name) | |
| 25 | end | |
| 26 | ||
| 27 | end | |
| 28 | ||
| 29 | class Scene_Map < Scene_Base | |
| 30 | ||
| 31 | def create_message_window | |
| 32 | @message_window = Window_Message.new | |
| 33 | @message_name = Window_MessageName.new | |
| 34 | $game_message.set_pop(@message_name) | |
| 35 | end | |
| 36 | ||
| 37 | end | |
| 38 | ||
| 39 | class Game_Message | |
| 40 | attr_reader :pop_window | |
| 41 | def face_name=(new_face) | |
| 42 | @pop_window.face_name(new_face) if @face_name != new_face | |
| 43 | @face_name = new_face | |
| 44 | end | |
| 45 | ||
| 46 | def face_index=(new_index) | |
| 47 | @pop_window.face_index(new_index) if @face_index != new_index | |
| 48 | @face_index = new_index | |
| 49 | end | |
| 50 | ||
| 51 | def set_pop(window) | |
| 52 | @pop_window = window | |
| 53 | end | |
| 54 | ||
| 55 | end | |
| 56 | ||
| 57 | class Window_Message < Window_Base | |
| 58 | alias :z12c :close | |
| 59 | def close | |
| 60 | - | super(0, Graphics.height-156, 128, 48) |
| 60 | + | z12c |
| 61 | $game_message.pop_window.close | |
| 62 | end | |
| 63 | ||
| 64 | alias :z12o :open | |
| 65 | def open | |
| 66 | z12o | |
| 67 | $game_message.pop_window.open | |
| 68 | end | |
| 69 | ||
| 70 | end | |
| 71 | ||
| 72 | class Window_MessageName < Window_Base | |
| 73 | ||
| 74 | def initialize | |
| 75 | super(0, Graphics.height-168, 128, 48) | |
| 76 | @face = "" | |
| 77 | @index = 0 | |
| 78 | @text = "" | |
| 79 | @z = 250 | |
| 80 | hide | |
| 81 | end | |
| 82 | ||
| 83 | def face_name(name) | |
| 84 | - | draw_text_ex(0, 0, @text) |
| 84 | + | |
| 85 | refresh | |
| 86 | end | |
| 87 | ||
| 88 | def face_index(index) | |
| 89 | @index = index | |
| 90 | refresh | |
| 91 | end | |
| 92 | ||
| 93 | def refresh | |
| 94 | contents.clear | |
| 95 | @text = Z12.namebox(@face, @index) | |
| 96 | if @text == "" | |
| 97 | hide | |
| 98 | else | |
| 99 | draw_text(0, 0, width-24, 24, @text, 1) | |
| 100 | show | |
| 101 | end | |
| 102 | end | |
| 103 | ||
| 104 | end |