Advertisement
Guest User

Untitled

a guest
Nov 6th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.87 KB | None | 0 0
  1. class Scene_ConfermaScelte < Scene_MenuBase
  2. def start
  3.  
  4. super
  5.  
  6. @commands = Window_ConfermaScelte.new(10, 300)
  7.  
  8. @commands.set_handler(:line0, method(:do_line0))
  9.  
  10. @commands.set_handler(:line1, method(:do_line1))
  11.  
  12. @commands.set_handler(:line2, method(:close_window))
  13.  
  14. end
  15.  
  16.  
  17.  
  18.  
  19.  
  20. def do_line0
  21.  
  22. @commands.close
  23.  
  24. SceneManager.return
  25.  
  26. SceneManager.return
  27.  
  28. SceneManager.return
  29.  
  30. end
  31.  
  32.  
  33.  
  34. def do_line1
  35.  
  36. @commands.close
  37.  
  38. SceneManager.return
  39.  
  40. SceneManager.return
  41.  
  42. end
  43.  
  44.  
  45.  
  46. def close_window
  47.  
  48. @commands.close
  49.  
  50. SceneManager.return
  51.  
  52. SceneManager.return
  53.  
  54. SceneManager.return
  55.  
  56. end
  57.  
  58. end
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66. class Window_ConfermaScelte < Window_Command
  67.  
  68. def window_width; Graphics.width - 20; end
  69.  
  70.  
  71.  
  72. def window_height; fitting_height(3); end
  73.  
  74.  
  75.  
  76. def make_command_list
  77.  
  78. add_command("OK", :line0)
  79.  
  80. add_command("Annulla", :line1)
  81.  
  82. add_command("Rinuncia", :line2)
  83.  
  84. end
  85.  
  86. end
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102. class Scene_Cambio < Scene_MenuBase
  103.  
  104.  
  105.  
  106. def start
  107.  
  108. super
  109.  
  110. @cambio_window = Window_Cambio.new(@actor)
  111.  
  112. end
  113.  
  114. end
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128. class Window_Cambio < Window_Selectable
  129.  
  130.  
  131.  
  132. def initialize(actor)
  133.  
  134. super(0, 0, Graphics.width, Graphics.height)
  135.  
  136. @actor = actor
  137.  
  138. refresh
  139.  
  140. update
  141.  
  142. activate
  143.  
  144. @scelte = 1
  145.  
  146. scelta1 (line_height * 2)
  147.  
  148. end
  149.  
  150.  
  151.  
  152.  
  153.  
  154. def actor=(actor)
  155.  
  156. return if @actor == actor
  157.  
  158. @actor = actor
  159.  
  160. end
  161.  
  162.  
  163.  
  164.  
  165.  
  166. def refresh
  167.  
  168. contents.clear
  169.  
  170. draw_block1 (line_height * 0)
  171.  
  172. draw_horz_line(line_height * 1)
  173.  
  174. draw_block2 (line_height * 2)
  175.  
  176. draw_horz_line(line_height * 6)
  177.  
  178. draw_block3 (line_height * 7)
  179.  
  180. draw_horz_line(line_height * 11)
  181.  
  182. draw_block4 (line_height * 12)
  183.  
  184. ritorna_normale
  185.  
  186. end
  187.  
  188.  
  189.  
  190.  
  191.  
  192. def update
  193.  
  194. movimenti
  195.  
  196.  
  197.  
  198. end
  199.  
  200.  
  201.  
  202. def scelta1(y)
  203.  
  204. refresh
  205.  
  206. @actor = $game_party.menu_actor_next
  207.  
  208. @actor = $game_party.menu_actor_next
  209.  
  210. @actor = $game_party.menu_actor_next
  211.  
  212. draw_actor_face(@actor, 8, y)
  213.  
  214. @actor = $game_party.menu_actor_prev
  215.  
  216. @actor = $game_party.menu_actor_prev
  217.  
  218. @actor = $game_party.menu_actor_prev
  219.  
  220. end
  221.  
  222.  
  223.  
  224. def scelta2(y)
  225.  
  226. refresh
  227.  
  228. @actor = $game_party.menu_actor_next
  229.  
  230. @actor = $game_party.menu_actor_next
  231.  
  232. @actor = $game_party.menu_actor_next
  233.  
  234. draw_actor_face(@actor, 180, y)
  235.  
  236. @actor = $game_party.menu_actor_prev
  237.  
  238. @actor = $game_party.menu_actor_prev
  239.  
  240. @actor = $game_party.menu_actor_prev
  241.  
  242. end
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254. def movimenti
  255.  
  256. case @scelte
  257.  
  258. when 1
  259.  
  260. scelta1 (line_height * 2)
  261.  
  262. if Input.repeat?(:DOWN)
  263.  
  264. @scelte = 3
  265.  
  266. end
  267.  
  268. if Input.repeat?(:RIGHT)
  269.  
  270. scelta2 (line_height * 2)
  271.  
  272. @scelte = 2
  273.  
  274. end
  275.  
  276. when 2
  277.  
  278. scelta2 (line_height * 2)
  279.  
  280. if Input.repeat?(:LEFT)
  281.  
  282. @scelte = 1
  283.  
  284. end
  285.  
  286. if Input.repeat?(:DOWN)
  287.  
  288. @scelte = 4
  289.  
  290. end
  291.  
  292. when 3
  293.  
  294. scelta1 (line_height * 7)
  295.  
  296. if Input.repeat?(:UP)
  297.  
  298. @scelte = 1
  299.  
  300. end
  301.  
  302. if Input.repeat?(:RIGHT)
  303.  
  304. @scelte = 4
  305.  
  306. end
  307.  
  308. when 4
  309.  
  310. scelta2 (line_height * 7)
  311.  
  312. if Input.repeat?(:LEFT)
  313.  
  314. @scelte = 3
  315.  
  316. end
  317.  
  318. if Input.repeat?(:UP)
  319.  
  320. @scelte = 2
  321.  
  322. end
  323.  
  324. end
  325.  
  326. end
  327.  
  328.  
  329.  
  330. def draw_horz_line(y)
  331.  
  332. line_y = y + line_height / 2 - 1
  333.  
  334. contents.fill_rect(0, line_y, contents_width, 2, line_color)
  335.  
  336. end
  337.  
  338.  
  339.  
  340. def line_color
  341.  
  342. color = normal_color
  343.  
  344. color.alpha = 48
  345.  
  346. color
  347.  
  348. end
  349.  
  350.  
  351.  
  352.  
  353.  
  354. def draw_block1(y)
  355.  
  356. draw_text(x, y + line_height * 0, 180, line_height, "Choose")
  357.  
  358. end
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366. def draw_block2(y)
  367.  
  368. draw_actor_face(@actor, 8, y)
  369.  
  370. end
  371.  
  372.  
  373.  
  374. def draw_block3(y)
  375.  
  376. @actor = $game_party.menu_actor_next
  377.  
  378. draw_actor_face(@actor, 8, y)
  379.  
  380. @actor = $game_party.menu_actor_next
  381.  
  382. draw_actor_face(@actor, 180, y)
  383.  
  384. end
  385.  
  386.  
  387.  
  388.  
  389.  
  390. def ritorna_normale
  391.  
  392. @actor = $game_party.menu_actor_prev
  393.  
  394. @actor = $game_party.menu_actor_prev
  395.  
  396. end
  397.  
  398.  
  399.  
  400. def draw_block4(y)
  401.  
  402. draw_description(x, y)
  403.  
  404. end
  405.  
  406.  
  407.  
  408. def draw_description(x, y)
  409.  
  410. draw_text_ex(x, y, "Change character positions with the \ndirectional arrows and select them with ENTER. \nPress Esc to confirm or cancel ")
  411.  
  412. end
  413.  
  414. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement