Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Scene_ConfermaScelte < Scene_MenuBase
- def start
- super
- @commands = Window_ConfermaScelte.new(10, 300)
- @commands.set_handler(:line0, method(:do_line0))
- @commands.set_handler(:line1, method(:do_line1))
- @commands.set_handler(:line2, method(:close_window))
- end
- def do_line0
- @commands.close
- SceneManager.return
- SceneManager.return
- SceneManager.return
- end
- def do_line1
- @commands.close
- SceneManager.return
- SceneManager.return
- end
- def close_window
- @commands.close
- SceneManager.return
- SceneManager.return
- SceneManager.return
- end
- end
- class Window_ConfermaScelte < Window_Command
- def window_width; Graphics.width - 20; end
- def window_height; fitting_height(3); end
- def make_command_list
- add_command("OK", :line0)
- add_command("Annulla", :line1)
- add_command("Rinuncia", :line2)
- end
- end
- class Scene_Cambio < Scene_MenuBase
- def start
- super
- @cambio_window = Window_Cambio.new(@actor)
- end
- end
- class Window_Cambio < Window_Selectable
- def initialize(actor)
- super(0, 0, Graphics.width, Graphics.height)
- @actor = actor
- refresh
- update
- activate
- @scelte = 1
- scelta1 (line_height * 2)
- end
- def actor=(actor)
- return if @actor == actor
- @actor = actor
- end
- def refresh
- contents.clear
- draw_block1 (line_height * 0)
- draw_horz_line(line_height * 1)
- draw_block2 (line_height * 2)
- draw_horz_line(line_height * 6)
- draw_block3 (line_height * 7)
- draw_horz_line(line_height * 11)
- draw_block4 (line_height * 12)
- ritorna_normale
- end
- def update
- movimenti
- end
- def scelta1(y)
- refresh
- @actor = $game_party.menu_actor_next
- @actor = $game_party.menu_actor_next
- @actor = $game_party.menu_actor_next
- draw_actor_face(@actor, 8, y)
- @actor = $game_party.menu_actor_prev
- @actor = $game_party.menu_actor_prev
- @actor = $game_party.menu_actor_prev
- end
- def scelta2(y)
- refresh
- @actor = $game_party.menu_actor_next
- @actor = $game_party.menu_actor_next
- @actor = $game_party.menu_actor_next
- draw_actor_face(@actor, 180, y)
- @actor = $game_party.menu_actor_prev
- @actor = $game_party.menu_actor_prev
- @actor = $game_party.menu_actor_prev
- end
- def movimenti
- case @scelte
- when 1
- scelta1 (line_height * 2)
- if Input.repeat?(:DOWN)
- @scelte = 3
- end
- if Input.repeat?(:RIGHT)
- scelta2 (line_height * 2)
- @scelte = 2
- end
- when 2
- scelta2 (line_height * 2)
- if Input.repeat?(:LEFT)
- @scelte = 1
- end
- if Input.repeat?(:DOWN)
- @scelte = 4
- end
- when 3
- scelta1 (line_height * 7)
- if Input.repeat?(:UP)
- @scelte = 1
- end
- if Input.repeat?(:RIGHT)
- @scelte = 4
- end
- when 4
- scelta2 (line_height * 7)
- if Input.repeat?(:LEFT)
- @scelte = 3
- end
- if Input.repeat?(:UP)
- @scelte = 2
- end
- end
- end
- def draw_horz_line(y)
- line_y = y + line_height / 2 - 1
- contents.fill_rect(0, line_y, contents_width, 2, line_color)
- end
- def line_color
- color = normal_color
- color.alpha = 48
- color
- end
- def draw_block1(y)
- draw_text(x, y + line_height * 0, 180, line_height, "Choose")
- end
- def draw_block2(y)
- draw_actor_face(@actor, 8, y)
- end
- def draw_block3(y)
- @actor = $game_party.menu_actor_next
- draw_actor_face(@actor, 8, y)
- @actor = $game_party.menu_actor_next
- draw_actor_face(@actor, 180, y)
- end
- def ritorna_normale
- @actor = $game_party.menu_actor_prev
- @actor = $game_party.menu_actor_prev
- end
- def draw_block4(y)
- draw_description(x, y)
- end
- def draw_description(x, y)
- draw_text_ex(x, y, "Change character positions with the \ndirectional arrows and select them with ENTER. \nPress Esc to confirm or cancel ")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement