Squaddle

Window_Base modified script

Jun 27th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.15 KB | None | 0 0
  1. #==============================================================================
  2. # ** Window_Base
  3. #------------------------------------------------------------------------------
  4. # This is a super class of all windows within the game.
  5. #==============================================================================
  6.  
  7. class Window_Base < Window
  8. #--------------------------------------------------------------------------
  9. # * Object Initialization
  10. #--------------------------------------------------------------------------
  11. def initialize(x, y, width, height)
  12. super
  13. self.windowskin = Cache.system("Window")
  14. update_padding
  15. update_tone
  16. create_contents
  17.  
  18. @opening = @closing = false
  19. end
  20. #--------------------------------------------------------------------------
  21. # * Free
  22. #--------------------------------------------------------------------------
  23. def dispose
  24. contents.dispose unless disposed?
  25. super
  26. end
  27. #--------------------------------------------------------------------------
  28. # * Get Line Height
  29. #--------------------------------------------------------------------------
  30. def line_height
  31. return 24
  32. end
  33. #--------------------------------------------------------------------------
  34. # * Get Standard Padding Size
  35. #--------------------------------------------------------------------------
  36. def standard_padding
  37. return 12
  38. end
  39. #--------------------------------------------------------------------------
  40. # * Update Padding
  41. #--------------------------------------------------------------------------
  42. def update_padding
  43. self.padding = standard_padding
  44. end
  45. #--------------------------------------------------------------------------
  46. # * Calculate Width of Window Contents
  47. #--------------------------------------------------------------------------
  48. def contents_width
  49. width - standard_padding * 2
  50. end
  51. #--------------------------------------------------------------------------
  52. # * Calculate Height of Window Contents
  53. #--------------------------------------------------------------------------
  54. def contents_height
  55. height - standard_padding * 2
  56. end
  57. #--------------------------------------------------------------------------
  58. # * Calculate Height of Window Suited to Specified Number of Lines
  59. #--------------------------------------------------------------------------
  60. def fitting_height(line_number)
  61. line_number * line_height + standard_padding * 2
  62. end
  63. #--------------------------------------------------------------------------
  64. # * Update Tone
  65. #--------------------------------------------------------------------------
  66. def update_tone
  67. self.tone.set($game_system.window_tone)
  68. end
  69. #--------------------------------------------------------------------------
  70. # * Create Window Contents
  71. #--------------------------------------------------------------------------
  72. def create_contents
  73. contents.dispose
  74. if contents_width > 0 && contents_height > 0
  75. self.contents = Bitmap.new(contents_width, contents_height)
  76. else
  77. self.contents = Bitmap.new(1, 1)
  78. end
  79. end
  80.  
  81. #--------------------------------------------------------------------------
  82. # * Frame Update
  83. #--------------------------------------------------------------------------
  84. def update
  85. super
  86. update_tone
  87. update_open if @opening
  88. update_close if @closing
  89. end
  90. #--------------------------------------------------------------------------
  91. # * Update Open Processing
  92. #--------------------------------------------------------------------------
  93. def update_open
  94. self.openness += 48
  95. @opening = false if open?
  96. end
  97. #--------------------------------------------------------------------------
  98. # * Update Close Processing
  99. #--------------------------------------------------------------------------
  100. def update_close
  101. self.openness -= 48
  102. @closing = false if close?
  103. end
  104. #--------------------------------------------------------------------------
  105. # * Open Window
  106. #--------------------------------------------------------------------------
  107. def open
  108. @opening = true unless open?
  109. @closing = false
  110. self
  111. end
  112. #--------------------------------------------------------------------------
  113. # * Close Window
  114. #--------------------------------------------------------------------------
  115. def close
  116. @closing = true unless close?
  117. @opening = false
  118. self
  119. end
  120. #--------------------------------------------------------------------------
  121. # * Show Window
  122. #--------------------------------------------------------------------------
  123. def show
  124. self.visible = true
  125. self
  126. end
  127. #--------------------------------------------------------------------------
  128. # * Hide Window
  129. #--------------------------------------------------------------------------
  130. def hide
  131. self.visible = false
  132. self
  133. end
  134. #--------------------------------------------------------------------------
  135. # * Activate Window
  136. #--------------------------------------------------------------------------
  137. def activate
  138. self.active = true
  139. self
  140. end
  141. #--------------------------------------------------------------------------
  142. # * Deactivate Window
  143. #--------------------------------------------------------------------------
  144. def deactivate
  145. self.active = false
  146. self
  147. end
  148. #--------------------------------------------------------------------------
  149. # * Get Text Color
  150. # n : Text color number (0..31)
  151. #--------------------------------------------------------------------------
  152. def text_color(n)
  153. windowskin.get_pixel(64 + (n % 8) * 8, 96 + (n / 8) * 8)
  154. end
  155. #--------------------------------------------------------------------------
  156. # * Get Text Colors
  157. #--------------------------------------------------------------------------
  158. def normal_color; text_color(0); end; # Normal
  159. def system_color; text_color(16); end; # System
  160. def crisis_color; text_color(17); end; # Crisis
  161. def knockout_color; text_color(18); end; # Knock out
  162. def gauge_back_color; text_color(19); end; # Gauge background
  163. def hp_gauge_color1; text_color(20); end; # HP gauge 1
  164. def hp_gauge_color2; text_color(21); end; # HP gauge 2
  165. def mp_gauge_color1; text_color(22); end; # MP gauge 1
  166. def mp_gauge_color2; text_color(23); end; # MP gauge 2
  167. def mp_cost_color; text_color(23); end; # TP cost
  168. def power_up_color; text_color(24); end; # Equipment power up
  169. def power_down_color; text_color(25); end; # Equipment power down
  170. def tp_gauge_color1; text_color(28); end; # TP gauge 1
  171. def tp_gauge_color2; text_color(29); end; # TP gauge 2
  172. def tp_cost_color; text_color(29); end; # TP cost
  173. #--------------------------------------------------------------------------
  174. # * Get Background Color of Pending Item
  175. #--------------------------------------------------------------------------
  176. def pending_color
  177. windowskin.get_pixel(80, 80)
  178. end
  179. #--------------------------------------------------------------------------
  180. # * Get Alpha Value of Translucent Drawing
  181. #--------------------------------------------------------------------------
  182. def translucent_alpha
  183. return 160
  184. end
  185. #--------------------------------------------------------------------------
  186. # * Change Text Drawing Color
  187. # enabled : Enabled flag. When false, draw semi-transparently.
  188. #--------------------------------------------------------------------------
  189. def change_color(color, enabled = true)
  190. contents.font.color.set(color)
  191. contents.font.color.alpha = translucent_alpha unless enabled
  192. end
  193. #--------------------------------------------------------------------------
  194. # * Draw Text
  195. # args : Same as Bitmap#draw_text.
  196. #--------------------------------------------------------------------------
  197. def draw_text(*args)
  198. contents.draw_text(*args)
  199. end
  200. #--------------------------------------------------------------------------
  201. # * Get Text Size
  202. #--------------------------------------------------------------------------
  203. def text_size(str)
  204. contents.text_size(str)
  205. end
  206. #--------------------------------------------------------------------------
  207. # * Draw Text with Control Characters
  208. #--------------------------------------------------------------------------
  209. def draw_text_ex(x, y, text)
  210. reset_font_settings
  211. text = convert_escape_characters(text)
  212. pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  213. process_character(text.slice!(0, 1), text, pos) until text.empty?
  214. end
  215. #--------------------------------------------------------------------------
  216. # * Reset Font Settings
  217. #--------------------------------------------------------------------------
  218. def reset_font_settings
  219. change_color(normal_color)
  220. contents.font.size = Font.default_size
  221. contents.font.bold = Font.default_bold
  222. contents.font.italic = Font.default_italic
  223. end
  224. #--------------------------------------------------------------------------
  225. # * Preconvert Control Characters
  226. # As a rule, replace only what will be changed into text strings before
  227. # starting actual drawing. The character "\" is replaced with the escape
  228. # character (\e).
  229. #--------------------------------------------------------------------------
  230. def convert_escape_characters(text)
  231. result = text.to_s.clone
  232. result.gsub!(/\\/) { "\e" }
  233. result.gsub!(/\e\e/) { "\\" }
  234. result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  235. result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  236. result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
  237. result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
  238. result.gsub!(/\eG/i) { Vocab::currency_unit }
  239. result
  240. end
  241. #--------------------------------------------------------------------------
  242. # * Get Name of Actor Number n
  243. #--------------------------------------------------------------------------
  244. def actor_name(n)
  245. actor = n >= 1 ? $game_actors[n] : nil
  246. actor ? actor.name : ""
  247. end
  248. #--------------------------------------------------------------------------
  249. # * Get Name of Party Member n
  250. #--------------------------------------------------------------------------
  251. def party_member_name(n)
  252. actor = n >= 1 ? $game_party.members[n - 1] : nil
  253. actor ? actor.name : ""
  254. end
  255. #--------------------------------------------------------------------------
  256. # * Character Processing
  257. # c : Characters
  258. # text : A character string buffer in drawing processing (destructive)
  259. # pos : Draw position {:x, :y, :new_x, :height}
  260. #--------------------------------------------------------------------------
  261. def process_character(c, text, pos)
  262. case c
  263. when "\n" # New line
  264. process_new_line(text, pos)
  265. when "\f" # New page
  266. process_new_page(text, pos)
  267. when "\e" # Control character
  268. process_escape_character(obtain_escape_code(text), text, pos)
  269. else # Normal character
  270. process_normal_character(c, pos)
  271. end
  272. end
  273. #--------------------------------------------------------------------------
  274. # * Normal Character Processing
  275. #--------------------------------------------------------------------------
  276. def process_normal_character(c, pos)
  277. text_width = text_size(c).width
  278. draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
  279. pos[:x] += text_width
  280. end
  281. #--------------------------------------------------------------------------
  282. # * New Line Character Processing
  283. #--------------------------------------------------------------------------
  284. def process_new_line(text, pos)
  285. pos[:x] = pos[:new_x]
  286. pos[:y] += pos[:height]
  287. pos[:height] = calc_line_height(text)
  288. end
  289. #--------------------------------------------------------------------------
  290. # * New Page Character Processing
  291. #--------------------------------------------------------------------------
  292. def process_new_page(text, pos)
  293. end
  294. #--------------------------------------------------------------------------
  295. # * Destructively Get Control Code
  296. #--------------------------------------------------------------------------
  297. def obtain_escape_code(text)
  298. text.slice!(/^[\$\.\|\^!><\{\}\\]|^[A-Z]+/i)
  299. end
  300. #--------------------------------------------------------------------------
  301. # * Destructively Get Control Code Argument
  302. #--------------------------------------------------------------------------
  303. def obtain_escape_param(text)
  304. text.slice!(/^\[\d+\]/)[/\d+/].to_i rescue 0
  305. end
  306. #--------------------------------------------------------------------------
  307. # * Control Character Processing
  308. # code : the core of the control character
  309. # e.g. "C" in the case of the control character \C[1].
  310. #--------------------------------------------------------------------------
  311. def process_escape_character(code, text, pos)
  312. case code.upcase
  313. when 'C'
  314. change_color(text_color(obtain_escape_param(text)))
  315. when 'I'
  316. process_draw_icon(obtain_escape_param(text), pos)
  317. when '{'
  318. make_font_bigger
  319. when '}'
  320. make_font_smaller
  321. end
  322. end
  323. #--------------------------------------------------------------------------
  324. # * Icon Drawing Process by Control Characters
  325. #--------------------------------------------------------------------------
  326. def process_draw_icon(icon_index, pos)
  327. draw_icon(icon_index, pos[:x], pos[:y])
  328. pos[:x] += 24
  329. end
  330. #--------------------------------------------------------------------------
  331. # * Increase Font Size
  332. #--------------------------------------------------------------------------
  333. def make_font_bigger
  334. contents.font.size += 8 if contents.font.size <= 64
  335. end
  336. #--------------------------------------------------------------------------
  337. # * Decrease Font Size
  338. #--------------------------------------------------------------------------
  339. def make_font_smaller
  340. contents.font.size -= 8 if contents.font.size >= 16
  341. end
  342. #--------------------------------------------------------------------------
  343. # * Calculate Line Height
  344. # restore_font_size : Return to original font size after calculating
  345. #--------------------------------------------------------------------------
  346. def calc_line_height(text, restore_font_size = true)
  347. result = [line_height, contents.font.size].max
  348. last_font_size = contents.font.size
  349. text.slice(/^.*$/).scan(/\e[\{\}]/).each do |esc|
  350. make_font_bigger if esc == "\e{"
  351. make_font_smaller if esc == "\e}"
  352. result = [result, contents.font.size].max
  353. end
  354. contents.font.size = last_font_size if restore_font_size
  355. result
  356. end
  357. #--------------------------------------------------------------------------
  358. # * Draw Gauge
  359. # rate : Rate (full at 1.0)
  360. # color1 : Left side gradation
  361. # color2 : Right side gradation
  362. #--------------------------------------------------------------------------
  363. def draw_gauge(x, y, width, rate, color1, color2)
  364. fill_w = (width * rate).to_i
  365. gauge_y = y + line_height - 8
  366. contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
  367. contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  368. end
  369. #--------------------------------------------------------------------------
  370. # * Draw Icon
  371. # enabled : Enabled flag. When false, draw semi-transparently.
  372. #--------------------------------------------------------------------------
  373. def draw_icon(icon_index, x, y, enabled = true)
  374. bitmap = Cache.system("Iconset")
  375. rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  376. contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  377. end
  378. #--------------------------------------------------------------------------
  379. # * Draw Face Graphic
  380. # enabled : Enabled flag. When false, draw semi-transparently.
  381. #--------------------------------------------------------------------------
  382. def draw_face(face_name, face_index, x, y, enabled = true)
  383. bitmap = Cache.face(face_name)
  384. rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
  385. contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  386. bitmap.dispose
  387. end
  388. #--------------------------------------------------------------------------
  389. # * Draw Character Graphic
  390. #--------------------------------------------------------------------------
  391. def draw_character(character_name, character_index, x, y)
  392. return unless character_name
  393. bitmap = Cache.character(character_name)
  394. sign = character_name[/^[\!\$]./]
  395. if sign && sign.include?('$')
  396. cw = bitmap.width / 3
  397. ch = bitmap.height / 4
  398. else
  399. cw = bitmap.width / 12
  400. ch = bitmap.height / 8
  401. end
  402. n = character_index
  403. src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  404. contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  405. end
  406. #--------------------------------------------------------------------------
  407. # * Get HP Text Color
  408. #--------------------------------------------------------------------------
  409. def hp_color(actor)
  410. return knockout_color if actor.hp == 0
  411. return crisis_color if actor.hp < actor.mhp / 4
  412. return normal_color
  413. end
  414. #--------------------------------------------------------------------------
  415. # * Get MP Text Color
  416. #--------------------------------------------------------------------------
  417. def mp_color(actor)
  418. return crisis_color if actor.mp < actor.mmp / 4
  419. return normal_color
  420. end
  421. #--------------------------------------------------------------------------
  422. # * Get TP Text Color
  423. #--------------------------------------------------------------------------
  424. def tp_color(actor)
  425. return normal_color
  426. end
  427. #--------------------------------------------------------------------------
  428. # * Draw Actor Walking Graphic
  429. #--------------------------------------------------------------------------
  430. def draw_actor_graphic(actor, x, y)
  431. draw_character(actor.character_name, actor.character_index, x, y)
  432. end
  433. #--------------------------------------------------------------------------
  434. # * Draw Actor Face Graphic
  435. #--------------------------------------------------------------------------
  436. def draw_actor_face(actor, x, y, enabled = true)
  437. draw_face(actor.face_name, actor.face_index, x, y, enabled)
  438. end
  439. #--------------------------------------------------------------------------
  440. # * Draw Name
  441. #--------------------------------------------------------------------------
  442. def draw_actor_name(actor, x, y, width = 112)
  443. change_color(hp_color(actor))
  444. draw_text(x, y, width, line_height, actor.name)
  445. end
  446. #--------------------------------------------------------------------------
  447. # * Draw Class
  448. #--------------------------------------------------------------------------
  449. def draw_actor_class(actor, x, y, width = 112)
  450. change_color(normal_color)
  451. draw_text(x, y, width, line_height, actor.class.name)
  452. end
  453. #--------------------------------------------------------------------------
  454. # * Draw Nickname
  455. #--------------------------------------------------------------------------
  456. def draw_actor_nickname(actor, x, y, width = 180)
  457. change_color(normal_color)
  458. draw_text(x, y, width, line_height, actor.nickname)
  459. end
  460. #--------------------------------------------------------------------------
  461. # * Draw Level
  462. #--------------------------------------------------------------------------
  463. def draw_actor_level(actor, x, y)
  464. change_color(system_color)
  465. draw_text(x, y, 32, line_height, Vocab::level_a)
  466. change_color(normal_color)
  467. draw_text(x + 32, y, 24, line_height, actor.level, 2)
  468. end
  469. #--------------------------------------------------------------------------
  470. # * Draw State and Buff/Debuff Icons
  471. #--------------------------------------------------------------------------
  472. def draw_actor_icons(actor, x, y, width = 96)
  473. icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  474. icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, y) }
  475. end
  476. #--------------------------------------------------------------------------
  477. # * Draw Current Value/Maximum Value in Fractional Format
  478. # current : Current value
  479. # max : Maximum value
  480. # color1 : Color of current value
  481. # color2 : Color of maximum value
  482. #--------------------------------------------------------------------------
  483. def draw_current_and_max_values(x, y, width, current, max, color1, color2)
  484. change_color(color1)
  485. xr = x + width
  486. if width < 96
  487. draw_text(xr - 40, y, 42, line_height, current, 2)
  488. else
  489. draw_text(xr - 92, y, 42, line_height, current, 2)
  490. change_color(color2)
  491. draw_text(xr - 52, y, 12, line_height, "/", 2)
  492. draw_text(xr - 42, y, 42, line_height, max, 2)
  493. end
  494. end
  495. #--------------------------------------------------------------------------
  496. # * Draw HP
  497. #--------------------------------------------------------------------------
  498. def draw_actor_hp(actor, x, y, width = 124)
  499. draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  500. change_color(system_color)
  501. draw_text(x, y, 30, line_height, Vocab::hp_a)
  502. draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
  503. hp_color(actor), normal_color)
  504. end
  505. #--------------------------------------------------------------------------
  506. # * Draw MP
  507. #--------------------------------------------------------------------------
  508. def draw_actor_mp(actor, x, y, width = 124)
  509. draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  510. change_color(system_color)
  511. draw_text(x, y, 30, line_height, Vocab::mp_a)
  512. draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
  513. mp_color(actor), normal_color)
  514. end
  515. #--------------------------------------------------------------------------
  516. # * Draw TP
  517. #--------------------------------------------------------------------------
  518. def draw_actor_tp(actor, x, y, width = 124)
  519. draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  520. change_color(system_color)
  521. draw_text(x, y, 30, line_height, Vocab::tp_a)
  522. change_color(tp_color(actor))
  523. draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2)
  524. end
  525.  
  526. #--------------------------------------------------------------------------
  527. # * Draw Loyalty
  528. #--------------------------------------------------------------------------
  529.  
  530. def draw_loyalty(actor, x, y, width = 124)
  531. @current_ally = $game_variables[1]
  532. @current_ally_rank = @current_ally + 20
  533.  
  534. change_color(system_color)
  535.  
  536. draw_text(x, y, 105, line_height, "Loyalty -")
  537.  
  538. draw_text(x+1, y, 105, line_height * 3, "Rank -")
  539.  
  540. #draw_current_and_max_values(x, y, width, $game_variables[@current_ally_actor], 100,
  541. #hp_color(actor), normal_color)
  542. end
  543.  
  544. #-----------------------------------------------------
  545. ####draw loyalty rank name
  546. #-------------------------------------------------------
  547. def draw_actor_loyalty_level(actor, x, y, width = 124)
  548. @current_ally = $game_variables[1]
  549. @loyalty_level = $game_variables[@current_ally]
  550.  
  551. @loyalty_1_color = text_color(0)
  552. @loyalty_2_color = text_color(5)
  553. @loyalty_3_color = text_color(4)
  554. @loyalty_4_color = text_color(24)
  555. @loyalty_5_color = text_color(6)
  556.  
  557. #true lub
  558. @loyalty_6_color = text_color(27)
  559.  
  560. #the different levels of loyalty
  561. if (@loyalty_level >= 0) && (@loyalty_level < 5)
  562. @loyalty_rank = "Acquaintance"
  563. change_color(@loyalty_1_color)
  564. end
  565.  
  566. if (@loyalty_level >= 5) && (@loyalty_level < 10)
  567. @loyalty_rank = "Ally"
  568. change_color(@loyalty_2_color)
  569. end
  570.  
  571. if (@loyalty_level >= 10) && (@loyalty_level < 15)
  572. @loyalty_rank = "Companion"
  573. change_color(@loyalty_3_color)
  574. end
  575.  
  576. if (@loyalty_level >= 15) && (@loyalty_level < 20)
  577. @loyalty_rank = "Friend"
  578. change_color(@loyalty_4_color)
  579. end
  580.  
  581. if (@loyalty_level >= 20)
  582. @loyalty_rank = "Max"
  583. change_color(@loyalty_5_color)
  584. end
  585.  
  586.  
  587.  
  588.  
  589. draw_text(x + 80, y, 105, line_height, @loyalty_rank)
  590. end
  591.  
  592.  
  593. #-----------------------------------------------------
  594. ####draw actor rank rame
  595. #------------------------------------------------------
  596. def draw_actor_rank(actor, x, y, width = 124)
  597.  
  598. @current_ally = $game_variables[1]
  599. @current_ally_rank = @current_ally + 20
  600.  
  601. @ally_rank = $game_variables[@current_ally_rank]
  602.  
  603. @rank_1_color = text_color(0)
  604. #@rank_1_color = text_color(25)
  605. @rank_2_color = text_color(20)
  606. @rank_3_color = text_color(21)
  607. @rank_4_color = text_color(6)
  608.  
  609. if (@ally_rank == 0)
  610. @ally_rank_name = "1"
  611. change_color(@rank_1_color)
  612. end
  613. if (@ally_rank == 1)
  614. @ally_rank_name = "2"
  615. change_color(@rank_1_color)
  616. end
  617. if (@ally_rank == 2)
  618. @ally_rank_name = "3"
  619. change_color(@rank_1_color)
  620. end
  621.  
  622. if (@ally_rank == 3)
  623. @ally_rank_name = "Max"
  624. change_color(@rank_4_color)
  625. end
  626.  
  627.  
  628.  
  629. draw_text(x + 80, y, 105, line_height , @ally_rank_name)
  630. #draw_text(x + 80, y, 105, line_height , @ally_rank)
  631. end
  632.  
  633.  
  634. #--------------------------------------------------------------------------
  635. # * Draw Simple Status
  636. #--------------------------------------------------------------------------
  637. def draw_actor_simple_status(actor, x, y)
  638. draw_actor_name(actor, x, y)
  639. draw_actor_level(actor, x, y + line_height * 1)
  640. draw_actor_icons(actor, x, y + line_height * 2)
  641. draw_actor_class(actor, x + 120, y)
  642. draw_actor_hp(actor, x + 120, y + line_height * 1)
  643.  
  644. #I moved this to the ally status, since its an ally thing only.
  645. #draw_actor_mp(actor, x + 120, y + line_height * 2)
  646. end
  647.  
  648. #-------------------------------------------------------------------
  649. # * Draw Ally Status
  650. #--------------------------------------------------------------------
  651. def draw_ally_status(actor, x, y, width = 124)
  652. draw_actor_mp(actor, x + 120, y + line_height * 3)
  653. draw_loyalty(actor, x, y + line_height * 1)
  654. draw_actor_loyalty_level(actor, x, y + line_height * 1)
  655. draw_actor_rank(actor, x, y + line_height * 2)
  656. end
  657.  
  658.  
  659. #--------------------------------------------------------------------------
  660. # * Draw Parameters
  661. #--------------------------------------------------------------------------
  662. def draw_actor_param(actor, x, y, param_id)
  663. change_color(system_color)
  664. draw_text(x, y, 120, line_height, Vocab::param(param_id))
  665. change_color(normal_color)
  666. draw_text(x + 21, y, 36, line_height, actor.param(param_id), 2)
  667. end
  668.  
  669.  
  670. #--------------------------------------------------------------------------
  671. # * Draw Item Name
  672. # enabled : Enabled flag. When false, draw semi-transparently.
  673. #--------------------------------------------------------------------------
  674. def draw_item_name(item, x, y, enabled = true, width = 172)
  675. return unless item
  676. draw_icon(item.icon_index, x, y, enabled)
  677. change_color(normal_color, enabled)
  678. draw_text(x + 24, y, width, line_height, item.name)
  679. end
  680. #--------------------------------------------------------------------------
  681. # * Draw Number (Gold Etc.) with Currency Unit
  682. #--------------------------------------------------------------------------
  683. def draw_currency_value(value, unit, x, y, width)
  684. cx = text_size(unit).width
  685. change_color(normal_color)
  686. draw_text(x, y, width - cx - 2, line_height, value, 2)
  687. change_color(system_color)
  688. draw_text(x, y, width, line_height, unit, 2)
  689. end
  690. #--------------------------------------------------------------------------
  691. # * Get Parameter Change Color
  692. #--------------------------------------------------------------------------
  693. def param_change_color(change)
  694. return power_up_color if change > 0
  695. return power_down_color if change < 0
  696. return normal_color
  697. end
  698.  
  699.  
  700. end
Advertisement
Add Comment
Please, Sign In to add comment