设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2177|回复: 3
打印 上一主题 下一主题

[rm脚本]法站上的一个“华丽的菜单”……

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
2 小时
注册时间
2008-5-16
帖子
114
跳转到指定楼层
1
发表于 2008-6-23 03:20:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
这是我在法国网站上找到的一个关于菜单的脚本,真实效果未测,脚本很长,但是回复贴的人说这个菜单很酷。
  1. #==============================================================================#
  2. # ■ Scene_Menu #
  3. #  Replaces the DMS. Made by Squall [email protected] #
  4. #==============================================================================#

  5. class Scene_Menu
  6. def initialize(menu_index = 0, actor_index = 0, equip_index = 0)
  7. @menu_index = menu_index
  8. @actor_index = actor_index
  9. @equip_index = equip_index
  10. @from_skill = false
  11. @from_item = false
  12. @from_command = false
  13. end
  14. def main
  15. @actor = $game_party.actors[@actor_index]

  16. s0 = $data_system.words.item
  17. s1 = $data_system.words.skill
  18. s2 = $data_system.words.equip
  19. s3 = "Equipe"
  20. s4 = "Sauvegarder"
  21. s5 = "Quitter"
  22. @command_window = Window_Command.new(160, [s0, s1, s2, s3, s4, s5])
  23. @command_window.index = @menu_index
  24. @command_window.x = 480

  25. @status_window = Window_MenuStatusMenu.new(@actor)

  26. @equip_window = Window_EquipRightMenu.new(@actor)
  27. @equip_window.index = @equip_index

  28. @skill_window = Window_SkillMenu.new(@actor)

  29. @items_window = Window_ItemMenu.new

  30. @item_window1 = Window_EquipItemMenu.new(@actor, 0)
  31. @item_window2 = Window_EquipItemMenu.new(@actor, 1)
  32. @item_window3 = Window_EquipItemMenu.new(@actor, 2)
  33. @item_window4 = Window_EquipItemMenu.new(@actor, 3)
  34. @item_window5 = Window_EquipItemMenu.new(@actor, 4)

  35. @playtime_window = Window_PlayTime.new
  36. @playtime_window.x = 480
  37. @playtime_window.y = 224

  38. @steps_window = Window_Steps.new
  39. @steps_window.x = 480
  40. @steps_window.y = 320

  41. @gold_window = Window_Gold.new
  42. @gold_window.x = 480
  43. @gold_window.y = 416

  44. @target_window = Window_TargetMenu.new

  45. refresh
  46. Graphics.transition
  47. loop do
  48. Graphics.update
  49. Input.update
  50. update
  51. if $scene != self
  52. break
  53. end
  54. end
  55. Graphics.freeze
  56. @command_window.dispose
  57. @status_window.dispose
  58. @equip_window.dispose
  59. @skill_window.dispose
  60. @items_window.dispose
  61. @item_window1.dispose
  62. @item_window2.dispose
  63. @item_window3.dispose
  64. @item_window4.dispose
  65. @item_window5.dispose
  66. @playtime_window.dispose
  67. @steps_window.dispose
  68. @gold_window.dispose
  69. @target_window.dispose
  70. end
  71. #----------------------------------------------------------------------------#
  72. # ● refresh windows when equipping items #
  73. #----------------------------------------------------------------------------#
  74. def refresh
  75. @item_window1.visible = (@equip_window.index == 0)
  76. @item_window2.visible = (@equip_window.index == 1)
  77. @item_window3.visible = (@equip_window.index == 2)
  78. @item_window4.visible = (@equip_window.index == 3)
  79. @item_window5.visible = (@equip_window.index == 4)
  80. item1 = @equip_window.item
  81. case @equip_window.index
  82. when 0
  83. @item_window = @item_window1
  84. when 1
  85. @item_window = @item_window2
  86. when 2
  87. @item_window = @item_window3
  88. when 3
  89. @item_window = @item_window4
  90. when 4
  91. @item_window = @item_window5
  92. end

  93. if @equip_window.active
  94. @status_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
  95. end
  96. if @item_window.active
  97. item2 = @item_window.item
  98. last_hp = @actor.hp
  99. last_sp = @actor.sp
  100. @actor.equip(@equip_window.index, item2 == nil ? 0 : item2.id)
  101. new_atk = @actor.atk
  102. new_pdef = @actor.pdef
  103. new_mdef = @actor.mdef
  104. new_str = @actor.str
  105. new_dex = @actor.dex
  106. new_agi = @actor.agi
  107. new_int = @actor.int
  108. new_eva = @actor.eva
  109. @actor.equip(@equip_window.index, item1 == nil ? 0 : item1.id)
  110. @actor.hp = last_hp
  111. @actor.sp = last_sp
  112. @status_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int, new_eva)
  113. else
  114. unless @equip_window.active
  115. @item_window.visible = false
  116. end
  117. end
  118. end
  119. def update
  120. @command_window.update
  121. @status_window.update
  122. @equip_window.update
  123. @skill_window.update
  124. @items_window.update
  125. @item_window1.update
  126. @item_window2.update
  127. @item_window3.update
  128. @item_window4.update
  129. @item_window5.update
  130. @playtime_window.update
  131. @steps_window.update
  132. @gold_window.update
  133. @target_window.update

  134. refresh
  135. if @command_window.active
  136. @equip_window.index = -1
  137. update_command
  138. return
  139. end
  140. if @items_window.active
  141. update_items
  142. return
  143. end
  144. if @skill_window.active
  145. update_skill
  146. return
  147. end
  148. if @equip_window.active
  149. update_equip
  150. return
  151. end
  152. if @from_skill == true
  153. if @target_window.active
  154. update_target_skill
  155. return
  156. end
  157. elsif @from_item == true
  158. if @target_window.active
  159. update_target_item
  160. return
  161. end
  162. elsif @from_command == true
  163. if @target_window.active
  164. update_target_party
  165. return
  166. end
  167. end
  168. if @item_window != nil and @item_window.active
  169. update_itemequip
  170. return
  171. end
  172. end
  173. #----------------------------------------------------------------------------#
  174. # ● update the command window #
  175. #----------------------------------------------------------------------------#
  176. def update_command
  177. if Input.trigger?(Input::B)
  178. $game_system.se_play($data_system.cancel_se)
  179. $scene = Scene_Map.new
  180. return
  181. end
  182. if Input.trigger?(Input::RIGHT)
  183. $game_system.se_play($data_system.cursor_se)
  184. @actor_index += 1
  185. @actor_index %= $game_party.actors.size
  186. $scene = Scene_Menu.new(0, @actor_index)
  187. return
  188. end
  189. if Input.trigger?(Input::LEFT)
  190. $game_system.se_play($data_system.cursor_se)
  191. @actor_index += $game_party.actors.size - 1
  192. @actor_index %= $game_party.actors.size
  193. $scene = Scene_Menu.new(0, @actor_index)
  194. return
  195. end
  196. if Input.trigger?(Input::R)
  197. @skill_window.page_up
  198. @skill_window.index = -1
  199. return
  200. end
  201. if Input.trigger?(Input::L)
  202. @skill_window.page_down
  203. @skill_window.index = -1
  204. return
  205. end
  206. if Input.trigger?(Input::C)
  207. case @command_window.index
  208. when 0
  209. $game_system.se_play($data_system.decision_se)
  210. @command_window.active = false
  211. @items_window.visible = true
  212. @items_window.active = true
  213. @items_window.index = 0
  214. when 1
  215. $game_system.se_play($data_system.decision_se)
  216. @command_window.active = false
  217. @skill_window.active = true
  218. @skill_window.index = 0
  219. when 2
  220. $game_system.se_play($data_system.decision_se)
  221. @command_window.active = false
  222. @equip_window.active = true
  223. @equip_window.index = 0
  224. when 3
  225. $game_system.se_play($data_system.decision_se)
  226. @target_window.active = true
  227. @target_window.visible = true
  228. @target_window.index = 0
  229. @command_window.active = false
  230. @from_command = true
  231. when 4
  232. if $game_system.save_disabled
  233. $game_system.se_play($data_system.buzzer_se)
  234. return
  235. end
  236. $game_system.se_play($data_system.decision_se)
  237. $scene = Scene_Save.new
  238. when 5
  239. $game_system.se_play($data_system.decision_se)
  240. $scene = Scene_End.new
  241. end
  242. return
  243. end
  244. end
  245. #----------------------------------------------------------------------------#
  246. # ● update the item window #
  247. #----------------------------------------------------------------------------#
  248. def update_items
  249. if Input.trigger?(Input::B)
  250. $game_system.se_play($data_system.cancel_se)
  251. @command_window.active = true
  252. @items_window.visible = false
  253. @items_window.active = false
  254. @items_window.index = -1
  255. return
  256. end
  257. if Input.trigger?(Input::C)
  258. @item = @items_window.item
  259. unless @item.is_a?(RPG::Item)
  260. $game_system.se_play($data_system.buzzer_se)
  261. return
  262. end
  263. unless $game_party.item_can_use?(@item.id)
  264. $game_system.se_play($data_system.buzzer_se)
  265. return
  266. end
  267. $game_system.se_play($data_system.decision_se)
  268. if @item.scope >= 3
  269. @items_window.active = false
  270. @target_window.visible = true
  271. @target_window.active = true
  272. @from_item = true
  273. if @item.scope == 4 || @item.scope == 6
  274. @target_window.index = -1
  275. else
  276. @target_window.index = 0
  277. end
  278. else
  279. if @item.common_event_id > 0
  280. $game_temp.common_event_id = @item.common_event_id
  281. $game_system.se_play(@item.menu_se)
  282. if @item.consumable
  283. $game_party.lose_item(@item.id, 1)
  284. @items_window.draw_item(@item_window.index)
  285. end
  286. $scene = Scene_Map.new
  287. return
  288. end
  289. end
  290. return
  291. end
  292. end
  293. #----------------------------------------------------------------------------#
  294. # ● update the skill window #
  295. #----------------------------------------------------------------------------#
  296. def update_skill
  297. if Input.trigger?(Input::B)
  298. $game_system.se_play($data_system.cancel_se)
  299. @command_window.active = true
  300. @skill_window.active = false
  301. @skill_window.index = -1
  302. return
  303. end
  304. if Input.trigger?(Input::C)
  305. @skill = @skill_window.skill
  306. if @skill == nil or not @actor.skill_can_use?(@skill.id)
  307. $game_system.se_play($data_system.buzzer_se)
  308. return
  309. end
  310. $game_system.se_play($data_system.decision_se)
  311. if @skill.scope >= 3
  312. @skill_window.active = false
  313. @target_window.visible = true
  314. @target_window.active = true
  315. @from_skill = true
  316. if @skill.scope == 4 || @skill.scope == 6
  317. @target_window.index = -1
  318. elsif @skill.scope == 7
  319. @target_window.index = @actor_index - 10
  320. else
  321. @target_window.index = 0
  322. end
  323. else
  324. if @skill.common_event_id > 0
  325. $game_temp.common_event_id = @skill.common_event_id
  326. $game_system.se_play(@skill.menu_se)
  327. @actor.sp -= @skill.sp_cost
  328. @status_window.refresh
  329. @skill_window.refresh
  330. @target_window.refresh
  331. $scene = Scene_Map.new
  332. return
  333. end
  334. end
  335. return
  336. end
  337. end
  338. def update_equip
  339. if Input.trigger?(Input::B)
  340. $game_system.se_play($data_system.cancel_se)
  341. @command_window.active = true
  342. @item_window.visible = false
  343. @equip_window.active = false
  344. @equip_window.index = -1
  345. return
  346. end

  347. if Input.trigger?(Input::C)
  348. if @actor.equip_fix?(@equip_window.index)
  349. $game_system.se_play($data_system.buzzer_se)
  350. return
  351. end
  352. $game_system.se_play($data_system.decision_se)
  353. @equip_window.active = false
  354. @item_window.active = true
  355. @item_window.index = 0
  356. return
  357. end
  358. end
  359. def update_target_skill
  360. if Input.trigger?(Input::B)
  361. $game_system.se_play($data_system.cancel_se)
  362. @skill_window.active = true
  363. @target_window.active = false
  364. @target_window.visible = false
  365. @from_skill = false
  366. return
  367. end
  368. if Input.trigger?(Input::C)
  369. unless @actor.skill_can_use?(@skill.id)
  370. $game_system.se_play($data_system.buzzer_se)
  371. return
  372. end
  373. if @target_window.index == -1
  374. used = false
  375. for i in $game_party.actors
  376. used |= i.skill_effect(@actor, @skill)
  377. end
  378. end
  379. if @target_window.index <= -2
  380. target = $game_party.actors[@target_window.index + 10]
  381. used = target.skill_effect(@actor, @skill)
  382. end
  383. if @target_window.index >= 0
  384. target = $game_party.actors[@target_window.index]
  385. used = target.skill_effect(@actor, @skill)
  386. end
  387. if used
  388. $game_system.se_play(@skill.menu_se)
  389. @actor.sp -= @skill.sp_cost
  390. @status_window.refresh
  391. @skill_window.refresh
  392. @target_window.refresh
  393. if $game_party.all_dead?
  394. $scene = Scene_Gameover.new
  395. return
  396. end
  397. if @skill.common_event_id > 0
  398. $game_temp.common_event_id = @skill.common_event_id
  399. $scene = Scene_Map.new
  400. return
  401. end
  402. end
  403. unless used
  404. $game_system.se_play($data_system.buzzer_se)
  405. end
  406. return
  407. end
  408. end
  409. #----------------------------------------------------------------------------#
  410. # ● update the item target window #
  411. #----------------------------------------------------------------------------#
  412. def update_target_item
  413. if Input.trigger?(Input::B)
  414. $game_system.se_play($data_system.cancel_se)
  415. @items_window.active = true
  416. @target_window.active = false
  417. @target_window.visible = false
  418. @from_item = false
  419. return
  420. end
  421. if Input.trigger?(Input::C)
  422. if $game_party.item_number(@item.id) == 0
  423. $game_system.se_play($data_system.buzzer_se)
  424. return
  425. end
  426. if @target_window.index == -1
  427. used = false
  428. for i in $game_party.actors
  429. used |= i.item_effect(@item)
  430. end
  431. end
  432. if @target_window.index >= 0
  433. target = $game_party.actors[@target_window.index]
  434. used = target.item_effect(@item)
  435. end
  436. if used
  437. $game_system.se_play(@item.menu_se)
  438. if @item.consumable
  439. $game_party.lose_item(@item.id, 1)
  440. @items_window.draw_item(@items_window.index)
  441. end
  442. @target_window.refresh
  443. if $game_party.all_dead?
  444. $scene = Scene_Gameover.new
  445. return
  446. end
  447. if @item.common_event_id > 0
  448. $game_temp.common_event_id = @item.common_event_id
  449. $scene = Scene_Map.new
  450. return
  451. end
  452. end
  453. unless used
  454. $game_system.se_play($data_system.buzzer_se)
  455. end
  456. return
  457. end
  458. end
  459. #----------------------------------------------------------------------------#
  460. # ● update the party target window #
  461. #----------------------------------------------------------------------------#
  462. def update_target_party
  463. if Input.trigger?(Input::B)
  464. $game_system.se_play($data_system.cancel_se)
  465. @command_window.active = true
  466. @target_window.active = false
  467. @target_window.visible = false
  468. @from_command = false
  469. return
  470. end

  471. if Input.trigger?(Input::C)
  472. $game_system.se_play($data_system.decision_se)
  473. $scene = Scene_Menu.new(3, @target_window.index)
  474. return
  475. end
  476. end
  477. #----------------------------------------------------------------------------#
  478. # ● update the item equip window #
  479. #----------------------------------------------------------------------------#
  480. def update_itemequip
  481. if Input.trigger?(Input::B)
  482. $game_system.se_play($data_system.cancel_se)
  483. @equip_window.active = true
  484. @item_window.active = false
  485. @item_window.visible = false
  486. @item_window.index = -1
  487. return
  488. end
  489. if Input.trigger?(Input::C)
  490. $game_system.se_play($data_system.equip_se)
  491. item = @item_window.item
  492. @actor.equip(@equip_window.index, item == nil ? 0 : item.id)
  493. @equip_window.active = true
  494. @item_window.active = false
  495. @item_window.visible = false
  496. @item_window.index = -1
  497. @equip_window.refresh
  498. @item_window.refresh
  499. return
  500. end
  501. end
  502. end
复制代码

这是其他的Menu菜单。
  1. #==============================================================================
  2. # Made or modified by Squall [email protected]
  3. #==============================================================================
  4. # ■ Window_ItemMenu
  5. #==============================================================================

  6. class Window_ItemMenu < Window_Selectable
  7. #--------------------------------------------------------------------------
  8. # ● object define
  9. #--------------------------------------------------------------------------
  10. def initialize
  11. super(280, 0, 200, 480)
  12. @column_max = 1
  13. refresh
  14. self.z = 200
  15. self.active = false
  16. self.visible = false
  17. self.index = -1
  18. end
  19. #--------------------------------------------------------------------------
  20. # ● items define
  21. #--------------------------------------------------------------------------
  22. def item
  23. return @data[self.index]
  24. end
  25. #--------------------------------------------------------------------------
  26. # ● refresh
  27. #--------------------------------------------------------------------------
  28. def refresh
  29. if self.contents != nil
  30. self.contents.dispose
  31. self.contents = nil
  32. end
  33. @data = []
  34. for i in 1...$data_items.size
  35. if $game_party.item_number(i) > 0
  36. @data.push($data_items[i])
  37. end
  38. end
  39. unless $game_temp.in_battle
  40. for i in 1...$data_weapons.size
  41. if $game_party.weapon_number(i) > 0
  42. @data.push($data_weapons[i])
  43. end
  44. end
  45. for i in 1...$data_armors.size
  46. if $game_party.armor_number(i) > 0
  47. @data.push($data_armors[i])
  48. end
  49. end
  50. end
  51. @item_max = @data.size
  52. if @item_max > 0
  53. self.contents = Bitmap.new(width - 32, row_max * 32)
  54. self.contents.font.name = $fontface
  55. self.contents.font.size = 20
  56. for i in 0...@item_max
  57. draw_item(i)
  58. end
  59. end
  60. end
  61. #--------------------------------------------------------------------------
  62. # ● draw items
  63. #--------------------------------------------------------------------------
  64. def draw_item(index)
  65. item = @data[index]
  66. case item
  67. when RPG::Item
  68. number = $game_party.item_number(item.id)
  69. when RPG::Weapon
  70. number = $game_party.weapon_number(item.id)
  71. when RPG::Armor
  72. number = $game_party.armor_number(item.id)
  73. end
  74. if item.is_a?(RPG::Item) and
  75. $game_party.item_can_use?(item.id)
  76. self.contents.font.color = normal_color
  77. else
  78. self.contents.font.color = disabled_color
  79. end
  80. x = 4
  81. y = index * 32
  82. rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  83. self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  84. bitmap = RPG::Cache.icon(item.icon_name)
  85. opacity = self.contents.font.color == normal_color ? 255 : 128
  86. self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  87. self.contents.draw_text(x + 28, y, 100, 32, item.name, 0)
  88. self.contents.draw_text(x + 128, y, 10, 32, ":", 1)
  89. self.contents.draw_text(x + 138, y, 22, 32, number.to_s, 2)
  90. end
  91. #--------------------------------------------------------------------------
  92. # ● help window set text settings
  93. #--------------------------------------------------------------------------
  94. def update_help
  95. @help_window.set_text(self.item == nil ? "" : self.item.description)
  96. end
  97. end
  98. #==============================================================================
  99. # ■ Window_SkillMenu
  100. #==============================================================================
  101. class Window_SkillMenu < Window_Selectable
  102. #--------------------------------------------------------------------------
  103. # ● initialisation
  104. #--------------------------------------------------------------------------
  105. def initialize(actor)
  106. super(280, 0, 200, 288)
  107. @actor = actor
  108. @column_max = 1
  109. refresh
  110. self.active = false
  111. self.index = -1
  112. end
  113. #--------------------------------------------------------------------------
  114. # ● skill define
  115. #--------------------------------------------------------------------------
  116. def skill
  117. return @data[self.index]
  118. end
  119. #--------------------------------------------------------------------------
  120. # ● refresh
  121. #--------------------------------------------------------------------------
  122. def refresh
  123. if self.contents != nil
  124. self.contents.dispose
  125. self.contents = nil
  126. end
  127. @data = []
  128. for i in [email protected]
  129. skill = $data_skills[@actor.skills[i]]
  130. if skill != nil
  131. @data.push(skill)
  132. end
  133. end
  134. @item_max = @data.size
  135. if @item_max > 0
  136. self.contents = Bitmap.new(width - 32, row_max * 32)
  137. self.contents.font.name = $fontface
  138. self.contents.font.size = 20
  139. for i in 0...@item_max
  140. draw_item(i)
  141. end
  142. end
  143. end
  144. #--------------------------------------------------------------------------
  145. # ● draw skill list
  146. #--------------------------------------------------------------------------
  147. def draw_item(index)
  148. skill = @data[index]
  149. if @actor.skill_can_use?(skill.id)
  150. self.contents.font.color = normal_color
  151. else
  152. self.contents.font.color = disabled_color
  153. end
  154. x = 4
  155. y = index * 32
  156. rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  157. self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  158. bitmap = RPG::Cache.icon(skill.icon_name)
  159. opacity = self.contents.font.color == normal_color ? 255 : 128
  160. self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  161. self.contents.draw_text(x + 28, y, 110, 32, skill.name, 0)
  162. self.contents.draw_text(x + 138, y, 22, 32, skill.sp_cost.to_s, 2)
  163. end
  164. #--------------------------------------------------------------------------
  165. # ● help_window text settings
  166. #--------------------------------------------------------------------------
  167. def update_help
  168. @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  169. end
  170. #--------------------------------------------------------------------------
  171. # ● set up the page_up function
  172. #--------------------------------------------------------------------------
  173. def page_up
  174. if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
  175. $game_system.se_play($data_system.cursor_se)
  176. @index = [@index + self.page_item_max, @item_max - 1].min
  177. self.top_row += self.page_row_max
  178. end
  179. end
  180. #--------------------------------------------------------------------------
  181. # ● set up the page_down function
  182. #--------------------------------------------------------------------------
  183. def page_down
  184. if self.top_row > 0
  185. $game_system.se_play($data_system.cursor_se)
  186. @index = [@index - self.page_item_max, 0].max
  187. self.top_row -= self.page_row_max
  188. end
  189. end
  190. end
  191. #==============================================================================
  192. # ■ Window_TargetMenu
  193. #==============================================================================
  194. class Window_TargetMenu < Window_Selectable
  195. #--------------------------------------------------------------------------
  196. # ● initialize the window
  197. #--------------------------------------------------------------------------
  198. def initialize
  199. super(0, 0, 280, 480)
  200. self.contents = Bitmap.new(width - 32, height - 32)
  201. self.contents.font.name = $fontface
  202. self.contents.font.size = 20
  203. self.z = 200
  204. self.visible = false
  205. self.active = false
  206. @item_max = $game_party.actors.size
  207. refresh
  208. end
  209. #--------------------------------------------------------------------------
  210. # ● refresh
  211. #--------------------------------------------------------------------------
  212. def refresh
  213. self.contents.clear
  214. for i in 0...$game_party.actors.size
  215. x = 4
  216. y = i * 116
  217. actor = $game_party.actors[i]
  218. draw_actor_name(actor, x, y)
  219. draw_actor_class(actor, x + 114, y)
  220. draw_actor_level(actor, x + 8, y + 32)
  221. draw_actor_state(actor, x + 8, y + 64)
  222. draw_actor_hp(actor, x + 114, y + 32)
  223. draw_actor_sp(actor, x + 114, y + 64)
  224. end
  225. end
  226. #--------------------------------------------------------------------------
  227. # ● cursor update
  228. #--------------------------------------------------------------------------
  229. def update_cursor_rect
  230. if @index <= -2
  231. self.cursor_rect.set(0, (@index + 10) * 116, self.width - 32, 96)
  232. elsif @index == -1
  233. self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)
  234. else
  235. self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
  236. end
  237. end
  238. end
  239. #==============================================================================
  240. # ■ Window_MenuStatusMenu
  241. #==============================================================================
  242. class Window_MenuStatusMenu < Window_Base
  243. #--------------------------------------------------------------------------
  244. # ● object define
  245. #--------------------------------------------------------------------------
  246. def initialize(actor)
  247. super(0, 0, 280, 480)
  248. self.contents = Bitmap.new(width - 32, height - 32)
  249. self.contents.font.name = $fontface
  250. self.contents.font.size = 21
  251. @actor = actor
  252. refresh
  253. end
  254. #--------------------------------------------------------------------------
  255. # ● define colors
  256. #--------------------------------------------------------------------------
  257. def plus_color
  258. return Color.new(63, 199, 154)
  259. end
  260. def minus_color
  261. return Color.new(200, 79, 62)
  262. end
  263. #--------------------------------------------------------------------------
  264. # ● define draw method for character's evasion
  265. #--------------------------------------------------------------------------
  266. def draw_actor_eva(actor, x, y)
  267. self.contents.font.color = system_color
  268. self.contents.draw_text(x, y, 120, 32, "Evasion")
  269. self.contents.font.color = normal_color
  270. self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
  271. end
  272. #--------------------------------------------------------------------------
  273. # ● define draw method for character's hp
  274. #--------------------------------------------------------------------------
  275. def draw_actorhp(actor, x, y, width = 144)
  276. if actor.maxhp <= 999
  277. w = 12
  278. else
  279. w = 0
  280. end
  281. self.contents.font.color = system_color
  282. self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
  283. self.contents.font.color = actor.hp == 0 ? knockout_color :
  284. actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  285. self.contents.draw_text(width + w - 50, y, 48, 32, actor.hp.to_s, 2)
  286. self.contents.font.color = normal_color
  287. self.contents.draw_text(width + w, y, 12, 32, "/", 2)
  288. self.contents.draw_text(width, y, 48, 32, actor.maxhp.to_s, 2)
  289. end
  290. #--------------------------------------------------------------------------
  291. # ● define draw method for character's sp
  292. #--------------------------------------------------------------------------
  293. def draw_actorsp(actor, x, y, width = 144)
  294. if actor.maxsp <= 999
  295. w = 12
  296. else
  297. w = 0
  298. end
  299. self.contents.font.color = system_color
  300. self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
  301. self.contents.font.color = actor.sp == 0 ? knockout_color :
  302. actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  303. self.contents.draw_text(width + w - 50, y, 48, 32, actor.sp.to_s, 2)
  304. self.contents.font.color = normal_color
  305. self.contents.draw_text(width + w, y, 12, 32, "/", 2)
  306. self.contents.draw_text(width, y, 48, 32, actor.maxsp.to_s, 2)
  307. end
  308. #--------------------------------------------------------------------------
  309. # ● refresh
  310. #--------------------------------------------------------------------------
  311. def refresh
  312. self.contents.clear
  313. draw_actor_name(@actor, 4, 0)
  314. draw_actor_class(@actor, 124, 0)
  315. draw_actor_graphic(@actor, 230, 50)
  316. draw_actor_level(@actor, 4, 32)
  317. draw_actor_state(@actor, 124, 32)
  318. draw_actorhp(@actor, 4, 64, 114)
  319. draw_actorsp(@actor, 4, 96, 114)
  320. draw_actor_parameter(@actor, 4, 128, 0)
  321. draw_actor_parameter(@actor, 4, 160, 1)
  322. draw_actor_parameter(@actor, 4, 192, 2)
  323. draw_actor_parameter(@actor, 4, 224, 3)
  324. draw_actor_parameter(@actor, 4, 256, 4)
  325. draw_actor_parameter(@actor, 4, 288, 5)
  326. draw_actor_parameter(@actor, 4, 320, 6)
  327. draw_actor_eva(@actor, 4, 352)
  328. self.contents.font.color = system_color
  329. self.contents.draw_text(4, 384, 70, 32, "EXP")
  330. self.contents.draw_text(4, 416, 70, 32, "NEXT")
  331. self.contents.font.color = normal_color
  332. self.contents.draw_text(4 + 70, 384, 84, 32, @actor.exp_s, 2)
  333. self.contents.draw_text(4 + 70, 416, 84, 32, @actor.next_rest_exp_s, 2)
  334. if @new_atk != nil
  335. self.contents.font.color = system_color
  336. self.contents.draw_text(160, 128, 40, 32, "→", 1)
  337. if @actor.atk < @new_atk
  338. self.contents.font.color = plus_color
  339. elsif @actor.atk > @new_atk
  340. self.contents.font.color = minus_color
  341. else
  342. self.contents.font.color = normal_color
  343. end
  344. self.contents.draw_text(200, 128, 36, 32, @new_atk.to_s, 2)
  345. end
  346. if @new_pdef != nil
  347. self.contents.font.color = system_color
  348. self.contents.draw_text(160, 160, 40, 32, "→", 1)
  349. if @actor.pdef < @new_pdef
  350. self.contents.font.color = plus_color
  351. elsif @actor.pdef > @new_pdef
  352. self.contents.font.color = minus_color
  353. else
  354. self.contents.font.color = normal_color
  355. end
  356. self.contents.draw_text(200, 160, 36, 32, @new_pdef.to_s, 2)
  357. end
  358. if @new_mdef != nil
  359. self.contents.font.color = system_color
  360. self.contents.draw_text(160, 192, 40, 32, "→", 1)
  361. if @actor.mdef < @new_mdef
  362. self.contents.font.color = plus_color
  363. elsif @actor.mdef > @new_mdef
  364. self.contents.font.color = minus_color
  365. else
  366. self.contents.font.color = normal_color
  367. end
  368. self.contents.draw_text(200, 192, 36, 32, @new_mdef.to_s, 2)
  369. end
  370. if @new_str != nil
  371. self.contents.font.color = system_color
  372. self.contents.draw_text(160, 224, 40, 32, "→", 1)
  373. if @actor.str < @new_str
  374. self.contents.font.color = plus_color
  375. elsif @actor.str > @new_str
  376. self.contents.font.color = minus_color
  377. else
  378. self.contents.font.color = normal_color
  379. end
  380. self.contents.draw_text(200, 224, 36, 32, @new_str.to_s, 2)
  381. end
  382. if @new_dex != nil
  383. self.contents.font.color = system_color
  384. self.contents.draw_text(160, 256, 40, 32, "→", 1)
  385. if @actor.dex < @new_dex
  386. self.contents.font.color = plus_color
  387. elsif @actor.dex > @new_dex
  388. self.contents.font.color = minus_color
  389. else
  390. self.contents.font.color = normal_color
  391. end
  392. self.contents.draw_text(200, 256, 36, 32, @new_dex.to_s, 2)
  393. end
  394. if @new_agi != nil
  395. self.contents.font.color = system_color
  396. self.contents.draw_text(160, 288, 40, 32, "→", 1)
  397. if @actor.agi < @new_agi
  398. self.contents.font.color = plus_color
  399. elsif @actor.agi > @new_agi
  400. self.contents.font.color = minus_color
  401. else
  402. self.contents.font.color = normal_color
  403. end
  404. self.contents.draw_text(200, 288, 36, 32, @new_agi.to_s, 2)
  405. end
  406. if @new_int != nil
  407. self.contents.font.color = system_color
  408. self.contents.draw_text(160, 320, 40, 32, "→", 1)
  409. if @actor.int < @new_int
  410. self.contents.font.color = plus_color
  411. elsif @actor.int > @new_int
  412. self.contents.font.color = minus_color
  413. else
  414. self.contents.font.color = normal_color
  415. end
  416. self.contents.draw_text(200, 320, 36, 32, @new_int.to_s, 2)
  417. end
  418. if @new_eva != nil
  419. self.contents.font.color = system_color
  420. self.contents.draw_text(160, 352, 40, 32, "→", 1)
  421. if @actor.eva < @new_eva
  422. self.contents.font.color = plus_color
  423. elsif @actor.eva > @new_eva
  424. self.contents.font.color = minus_color
  425. else
  426. self.contents.font.color = normal_color
  427. end
  428. self.contents.draw_text(200, 352, 36, 32, @new_eva.to_s, 2)
  429. end
  430. end
  431. #--------------------------------------------------------------------------
  432. # ● set new parameters when equipping new items
  433. #--------------------------------------------------------------------------
  434. def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int, new_eva)
  435. if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or
  436. @new_agi != new_agi or @new_int != new_int or @new_eva != new_eva
  437. @new_atk = new_atk
  438. @new_pdef = new_pdef
  439. @new_mdef = new_mdef
  440. @new_str = new_str
  441. @new_dex = new_dex
  442. @new_agi = new_agi
  443. @new_int = new_int
  444. @new_eva = new_eva
  445. refresh
  446. end
  447. end
  448. end
  449. #==============================================================================
  450. # ■ Window_EquipRightMenu
  451. #==============================================================================
  452. class Window_EquipRightMenu < Window_Selectable
  453. #--------------------------------------------------------------------------
  454. # ● initialize the window
  455. #--------------------------------------------------------------------------
  456. def initialize(actor)
  457. super(280, 288, 200, 192)
  458. self.contents = Bitmap.new(width - 32, height - 32)
  459. self.contents.font.name = $fontface
  460. self.contents.font.size = 20
  461. @actor = actor
  462. refresh
  463. self.active = false
  464. self.index = -1
  465. end
  466. #--------------------------------------------------------------------------
  467. # ● define the items
  468. #--------------------------------------------------------------------------
  469. def item
  470. return @data[self.index]
  471. end
  472. #--------------------------------------------------------------------------
  473. # ● refresh
  474. #--------------------------------------------------------------------------
  475. def refresh
  476. self.contents.clear
  477. @data = []
  478. @data.push($data_weapons[@actor.weapon_id])
  479. @data.push($data_armors[@actor.armor1_id])
  480. @data.push($data_armors[@actor.armor2_id])
  481. @data.push($data_armors[@actor.armor3_id])
  482. @data.push($data_armors[@actor.armor4_id])
  483. @item_max = @data.size
  484. self.contents.font.color = system_color
  485. draw_item_name(@data[0], 4, 32 * 0)
  486. draw_item_name(@data[1], 4, 32 * 1)
  487. draw_item_name(@data[2], 4, 32 * 2)
  488. draw_item_name(@data[3], 4, 32 * 3)
  489. draw_item_name(@data[4], 4, 32 * 4)
  490. end
  491. #--------------------------------------------------------------------------
  492. # ● help_window text settings
  493. #--------------------------------------------------------------------------
  494. def update_help
  495. @help_window.set_text(self.item == nil ? "" : self.item.description)
  496. end
  497. end

  498. class Window_EquipItemMenu < Window_Selectable
  499. #--------------------------------------------------------------------------
  500. # ● initialize the window
  501. #--------------------------------------------------------------------------
  502. def initialize(actor, equip_type)
  503. super(280, 0, 200, 288)
  504. @actor = actor
  505. @equip_type = equip_type
  506. @column_max = 1
  507. refresh
  508. self.z = 200
  509. self.active = false
  510. self.visible = false
  511. self.index = -1
  512. end
  513. #--------------------------------------------------------------------------
  514. # ● item define
  515. #--------------------------------------------------------------------------
  516. def item
  517. return @data[self.index]
  518. end

  519. def refresh
  520. if self.contents != nil
  521. self.contents.dispose
  522. self.contents = nil
  523. end
  524. @data = []
  525. if @equip_type == 0
  526. weapon_set = $data_classes[@actor.class_id].weapon_set
  527. for i in 1...$data_weapons.size
  528. if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
  529. @data.push($data_weapons[i])
  530. end
  531. end
  532. end
  533. if @equip_type != 0
  534. armor_set = $data_classes[@actor.class_id].armor_set
  535. for i in 1...$data_armors.size
  536. if $game_party.armor_number(i) > 0 and armor_set.include?(i)
  537. if $data_armors[i].kind == @equip_type-1
  538. @data.push($data_armors[i])
  539. end
  540. end
  541. end
  542. end
  543. @data.push(nil)
  544. @item_max = @data.size
  545. self.contents = Bitmap.new(width - 32, (@item_max + 1) * 32)
  546. self.contents.font.name = $fontface
  547. self.contents.font.size = 20
  548. for i in 0...@item_max-1
  549. draw_item(i)
  550. end
  551. self.contents.draw_text(4, (@item_max - 1) * 32, 168, 32, "Enlever")
  552. end
  553. #--------------------------------------------------------------------------
  554. # ● draw the items
  555. #--------------------------------------------------------------------------
  556. def draw_item(index)
  557. item = @data[index]
  558. x = 4
  559. y = index * 32
  560. case item
  561. when RPG::Weapon
  562. number = $game_party.weapon_number(item.id)
  563. when RPG::Armor
  564. number = $game_party.armor_number(item.id)
  565. end
  566. bitmap = RPG::Cache.icon(item.icon_name)
  567. self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  568. self.contents.font.color = normal_color
  569. self.contents.draw_text(x + 28, y, 100, 32, item.name, 0)
  570. self.contents.draw_text(x + 128, y, 10, 32, ":", 1)
  571. self.contents.draw_text(x + 138, y, 22, 32, number.to_s, 2)
  572. end
  573. def update_help
  574. @help_window.set_text(self.item == nil ? "" : self.item.description)
  575. end
  576. end
复制代码


别忘了把之后的插入在菜单的上面哦。{/wx}
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-29
帖子
19
2
发表于 2008-6-29 19:04:18 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
2 小时
注册时间
2008-5-16
帖子
114
3
 楼主| 发表于 2008-7-1 12:29:03 | 只看该作者
这是更新:
  1. #==============================================================================#
  2. # ■ Scene_Menu #
  3. #  Replaces the DMS. Made by Squall [email protected] #
  4. #==============================================================================#

  5. class Scene_Menu
  6. def initialize(menu_index = 0, actor_index = 0, equip_index = 0)
  7. @menu_index = menu_index
  8. @actor_index = actor_index
  9. @equip_index = equip_index
  10. @from_skill = false
  11. @from_item = false
  12. @from_command = false
  13. end
  14. def main
  15. @actor = $game_party.actors[@actor_index]

  16. s0 = $data_system.words.item
  17. s1 = $data_system.words.skill
  18. s2 = $data_system.words.equip
  19. s3 = "状态"
  20. s4 = "存档"
  21. s5 = "退出"
  22. @command_window = Window_Command.new(160, [s0, s1, s2, s3, s4, s5])
  23. @command_window.index = @menu_index
  24. @command_window.x = 480

  25. @status_window = Window_MenuStatusMenu.new(@actor)

  26. @equip_window = Window_EquipRightMenu.new(@actor)
  27. @equip_window.index = @equip_index

  28. @skill_window = Window_SkillMenu.new(@actor)

  29. @items_window = Window_ItemMenu.new

  30. @item_window1 = Window_EquipItemMenu.new(@actor, 0)
  31. @item_window2 = Window_EquipItemMenu.new(@actor, 1)
  32. @item_window3 = Window_EquipItemMenu.new(@actor, 2)
  33. @item_window4 = Window_EquipItemMenu.new(@actor, 3)
  34. @item_window5 = Window_EquipItemMenu.new(@actor, 4)

  35. @playtime_window = Window_PlayTime.new
  36. @playtime_window.x = 480
  37. @playtime_window.y = 224

  38. @steps_window = Window_Steps.new
  39. @steps_window.x = 480
  40. @steps_window.y = 320

  41. @gold_window = Window_Gold.new
  42. @gold_window.x = 480
  43. @gold_window.y = 416

  44. @target_window = Window_TargetMenu.new

  45. refresh
  46. Graphics.transition
  47. loop do
  48. Graphics.update
  49. Input.update
  50. update
  51. if $scene != self
  52. break
  53. end
  54. end
  55. Graphics.freeze
  56. @command_window.dispose
  57. @status_window.dispose
  58. @equip_window.dispose
  59. @skill_window.dispose
  60. @items_window.dispose
  61. @item_window1.dispose
  62. @item_window2.dispose
  63. @item_window3.dispose
  64. @item_window4.dispose
  65. @item_window5.dispose
  66. @playtime_window.dispose
  67. @steps_window.dispose
  68. @gold_window.dispose
  69. @target_window.dispose
  70. end
  71. #----------------------------------------------------------------------------#
  72. # ● refresh windows when equipping items #
  73. #----------------------------------------------------------------------------#
  74. def refresh
  75. @item_window1.visible = (@equip_window.index == 0)
  76. @item_window2.visible = (@equip_window.index == 1)
  77. @item_window3.visible = (@equip_window.index == 2)
  78. @item_window4.visible = (@equip_window.index == 3)
  79. @item_window5.visible = (@equip_window.index == 4)
  80. item1 = @equip_window.item
  81. case @equip_window.index
  82. when 0
  83. @item_window = @item_window1
  84. when 1
  85. @item_window = @item_window2
  86. when 2
  87. @item_window = @item_window3
  88. when 3
  89. @item_window = @item_window4
  90. when 4
  91. @item_window = @item_window5
  92. end

  93. if @equip_window.active
  94. @status_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
  95. end
  96. if @item_window.active
  97. item2 = @item_window.item
  98. last_hp = @actor.hp
  99. last_sp = @actor.sp
  100. @actor.equip(@equip_window.index, item2 == nil ? 0 : item2.id)
  101. new_atk = @actor.atk
  102. new_pdef = @actor.pdef
  103. new_mdef = @actor.mdef
  104. new_str = @actor.str
  105. new_dex = @actor.dex
  106. new_agi = @actor.agi
  107. new_int = @actor.int
  108. new_eva = @actor.eva
  109. @actor.equip(@equip_window.index, item1 == nil ? 0 : item1.id)
  110. @actor.hp = last_hp
  111. @actor.sp = last_sp
  112. @status_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int, new_eva)
  113. else
  114. unless @equip_window.active
  115. @item_window.visible = false
  116. end
  117. end
  118. end
  119. def update
  120. @command_window.update
  121. @status_window.update
  122. @equip_window.update
  123. @skill_window.update
  124. @items_window.update
  125. @item_window1.update
  126. @item_window2.update
  127. @item_window3.update
  128. @item_window4.update
  129. @item_window5.update
  130. @playtime_window.update
  131. @steps_window.update
  132. @gold_window.update
  133. @target_window.update

  134. refresh
  135. if @command_window.active
  136. @equip_window.index = -1
  137. update_command
  138. return
  139. end
  140. if @items_window.active
  141. update_items
  142. return
  143. end
  144. if @skill_window.active
  145. update_skill
  146. return
  147. end
  148. if @equip_window.active
  149. update_equip
  150. return
  151. end
  152. if @from_skill == true
  153. if @target_window.active
  154. update_target_skill
  155. return
  156. end
  157. elsif @from_item == true
  158. if @target_window.active
  159. update_target_item
  160. return
  161. end
  162. elsif @from_command == true
  163. if @target_window.active
  164. update_target_party
  165. return
  166. end
  167. end
  168. if @item_window != nil and @item_window.active
  169. update_itemequip
  170. return
  171. end
  172. end
  173. #----------------------------------------------------------------------------#
  174. # ● update the command window #
  175. #----------------------------------------------------------------------------#
  176. def update_command
  177. if Input.trigger?(Input::B)
  178. $game_system.se_play($data_system.cancel_se)
  179. $scene = Scene_Map.new
  180. return
  181. end
  182. if Input.trigger?(Input::RIGHT)
  183. $game_system.se_play($data_system.cursor_se)
  184. @actor_index += 1
  185. @actor_index %= $game_party.actors.size
  186. $scene = Scene_Menu.new(0, @actor_index)
  187. return
  188. end
  189. if Input.trigger?(Input::LEFT)
  190. $game_system.se_play($data_system.cursor_se)
  191. @actor_index += $game_party.actors.size - 1
  192. @actor_index %= $game_party.actors.size
  193. $scene = Scene_Menu.new(0, @actor_index)
  194. return
  195. end
  196. if Input.trigger?(Input::R)
  197. @skill_window.page_up
  198. @skill_window.index = -1
  199. return
  200. end
  201. if Input.trigger?(Input::L)
  202. @skill_window.page_down
  203. @skill_window.index = -1
  204. return
  205. end
  206. if Input.trigger?(Input::C)
  207. case @command_window.index
  208. when 0
  209. $game_system.se_play($data_system.decision_se)
  210. @command_window.active = false
  211. @items_window.visible = true
  212. @items_window.active = true
  213. @items_window.index = 0
  214. when 1
  215. $game_system.se_play($data_system.decision_se)
  216. @command_window.active = false
  217. @skill_window.active = true
  218. @skill_window.index = 0
  219. when 2
  220. $game_system.se_play($data_system.decision_se)
  221. @command_window.active = false
  222. @equip_window.active = true
  223. @equip_window.index = 0
  224. when 3
  225. $game_system.se_play($data_system.decision_se)
  226. @target_window.active = true
  227. @target_window.visible = true
  228. @target_window.index = 0
  229. @command_window.active = false
  230. @from_command = true
  231. when 4
  232. if $game_system.save_disabled
  233. $game_system.se_play($data_system.buzzer_se)
  234. return
  235. end
  236. $game_system.se_play($data_system.decision_se)
  237. $scene = Scene_Save.new
  238. when 5
  239. $game_system.se_play($data_system.decision_se)
  240. $scene = Scene_End.new
  241. end
  242. return
  243. end
  244. end
  245. #----------------------------------------------------------------------------#
  246. # ● update the item window #
  247. #----------------------------------------------------------------------------#
  248. def update_items
  249. if Input.trigger?(Input::B)
  250. $game_system.se_play($data_system.cancel_se)
  251. @command_window.active = true
  252. @items_window.visible = false
  253. @items_window.active = false
  254. @items_window.index = -1
  255. return
  256. end

  257. if Input.trigger?(Input::C)
  258. @item = @items_window.item
  259. unless @item.is_a?(RPG::Item)
  260. $game_system.se_play($data_system.buzzer_se)
  261. return
  262. end
  263. unless $game_party.item_can_use?(@item.id)
  264. $game_system.se_play($data_system.buzzer_se)
  265. return
  266. end
  267. $game_system.se_play($data_system.decision_se)
  268. if @item.scope >= 3
  269. @items_window.active = false
  270. @target_window.visible = true
  271. @target_window.active = true
  272. @from_item = true
  273. if @item.scope == 4 || @item.scope == 6
  274. @target_window.index = -1
  275. else
  276. @target_window.index = 0
  277. end
  278. else
  279. if @item.common_event_id > 0
  280. $game_temp.common_event_id = @item.common_event_id
  281. $game_system.se_play(@item.menu_se)
  282. if @item.consumable
  283. $game_party.lose_item(@item.id, 1)
  284. @items_window.draw_item(@item_window.index)
  285. end
  286. $scene = Scene_Map.new
  287. return
  288. end
  289. end
  290. return
  291. end
  292. end
  293. #----------------------------------------------------------------------------#
  294. # ● update the skill window #
  295. #----------------------------------------------------------------------------#
  296. def update_skill
  297. if Input.trigger?(Input::B)
  298. $game_system.se_play($data_system.cancel_se)
  299. @command_window.active = true
  300. @skill_window.active = false
  301. @skill_window.index = -1
  302. return
  303. end
  304. if Input.trigger?(Input::C)
  305. @skill = @skill_window.skill
  306. if @skill == nil or not @actor.skill_can_use?(@skill.id)
  307. $game_system.se_play($data_system.buzzer_se)
  308. return
  309. end
  310. $game_system.se_play($data_system.decision_se)
  311. if @skill.scope >= 3
  312. @skill_window.active = false
  313. @target_window.visible = true
  314. @target_window.active = true
  315. @from_skill = true
  316. if @skill.scope == 4 || @skill.scope == 6
  317. @target_window.index = -1
  318. elsif @skill.scope == 7
  319. @target_window.index = @actor_index - 10
  320. else
  321. @target_window.index = 0
  322. end
  323. else
  324. if @skill.common_event_id > 0
  325. $game_temp.common_event_id = @skill.common_event_id
  326. $game_system.se_play(@skill.menu_se)
  327. @actor.sp -= @skill.sp_cost
  328. @status_window.refresh
  329. @skill_window.refresh
  330. @target_window.refresh
  331. $scene = Scene_Map.new
  332. return
  333. end
  334. end
  335. return
  336. end
  337. end
  338. def update_equip
  339. if Input.trigger?(Input::B)
  340. $game_system.se_play($data_system.cancel_se)
  341. @command_window.active = true
  342. @item_window.visible = false
  343. @equip_window.active = false
  344. @equip_window.index = -1
  345. return
  346. end
  347. if Input.trigger?(Input::C)
  348. if @actor.equip_fix?(@equip_window.index)
  349. $game_system.se_play($data_system.buzzer_se)
  350. return
  351. end
  352. $game_system.se_play($data_system.decision_se)
  353. @equip_window.active = false
  354. @item_window.active = true
  355. @item_window.index = 0
  356. return
  357. end
  358. end
  359. def update_target_skill
  360. if Input.trigger?(Input::B)
  361. $game_system.se_play($data_system.cancel_se)
  362. @skill_window.active = true
  363. @target_window.active = false
  364. @target_window.visible = false
  365. @from_skill = false
  366. return
  367. end
  368. if Input.trigger?(Input::C)
  369. unless @actor.skill_can_use?(@skill.id)
  370. $game_system.se_play($data_system.buzzer_se)
  371. return
  372. end
  373. if @target_window.index == -1
  374. used = false
  375. for i in $game_party.actors
  376. used |= i.skill_effect(@actor, @skill)
  377. end
  378. end
  379. if @target_window.index <= -2
  380. target = $game_party.actors[@target_window.index + 10]
  381. used = target.skill_effect(@actor, @skill)
  382. end
  383. if @target_window.index >= 0
  384. target = $game_party.actors[@target_window.index]
  385. used = target.skill_effect(@actor, @skill)
  386. end
  387. if used
  388. $game_system.se_play(@skill.menu_se)
  389. @actor.sp -= @skill.sp_cost
  390. @status_window.refresh
  391. @skill_window.refresh
  392. @target_window.refresh
  393. if $game_party.all_dead?
  394. $scene = Scene_Gameover.new
  395. return
  396. end
  397. if @skill.common_event_id > 0
  398. $game_temp.common_event_id = @skill.common_event_id
  399. $scene = Scene_Map.new
  400. return
  401. end
  402. end
  403. unless used
  404. $game_system.se_play($data_system.buzzer_se)
  405. end
  406. return
  407. end
  408. end
  409. #----------------------------------------------------------------------------#
  410. # ● update the item target window #
  411. #----------------------------------------------------------------------------#
  412. def update_target_item
  413. if Input.trigger?(Input::B)
  414. $game_system.se_play($data_system.cancel_se)
  415. @items_window.active = true
  416. @target_window.active = false
  417. @target_window.visible = false
  418. @from_item = false
  419. return
  420. end
  421. if Input.trigger?(Input::C)
  422. if $game_party.item_number(@item.id) == 0
  423. $game_system.se_play($data_system.buzzer_se)
  424. return
  425. end
  426. if @target_window.index == -1
  427. used = false
  428. for i in $game_party.actors
  429. used |= i.item_effect(@item)
  430. end
  431. end
  432. if @target_window.index >= 0
  433. target = $game_party.actors[@target_window.index]
  434. used = target.item_effect(@item)
  435. end
  436. if used
  437. $game_system.se_play(@item.menu_se)
  438. if @item.consumable
  439. $game_party.lose_item(@item.id, 1)
  440. @items_window.draw_item(@items_window.index)
  441. end
  442. @target_window.refresh
  443. if $game_party.all_dead?
  444. $scene = Scene_Gameover.new
  445. return
  446. end
  447. if @item.common_event_id > 0
  448. $game_temp.common_event_id = @item.common_event_id
  449. $scene = Scene_Map.new
  450. return
  451. end
  452. end
  453. unless used
  454. $game_system.se_play($data_system.buzzer_se)
  455. end
  456. return
  457. end
  458. end
  459. #----------------------------------------------------------------------------#
  460. # ● update the party target window #
  461. #----------------------------------------------------------------------------#
  462. def update_target_party
  463. if Input.trigger?(Input::B)
  464. $game_system.se_play($data_system.cancel_se)
  465. @command_window.active = true
  466. @target_window.active = false
  467. @target_window.visible = false
  468. @from_command = false
  469. return
  470. end

  471. if Input.trigger?(Input::C)
  472. $game_system.se_play($data_system.decision_se)
  473. $scene = Scene_Menu.new(3, @target_window.index)
  474. return
  475. end
  476. end
  477. #----------------------------------------------------------------------------#
  478. # ● update the item equip window #
  479. #----------------------------------------------------------------------------#
  480. def update_itemequip
  481. if Input.trigger?(Input::B)
  482. $game_system.se_play($data_system.cancel_se)
  483. @equip_window.active = true
  484. @item_window.active = false
  485. @item_window.visible = false
  486. @item_window.index = -1
  487. return
  488. end
  489. if Input.trigger?(Input::C)
  490. $game_system.se_play($data_system.equip_se)
  491. item = @item_window.item
  492. @actor.equip(@equip_window.index, item == nil ? 0 : item.id)
  493. @equip_window.active = true
  494. @item_window.active = false
  495. @item_window.visible = false
  496. @item_window.index = -1
  497. @equip_window.refresh
  498. @item_window.refresh
  499. return
  500. end
  501. end
  502. end
  503. #==============================================================================
  504. # Made or modified by Squall [email protected]
  505. #==============================================================================
  506. # ■ Window_ItemMenu
  507. #==============================================================================

  508. class Window_ItemMenu < Window_Selectable
  509. #--------------------------------------------------------------------------
  510. # ● object define
  511. #--------------------------------------------------------------------------
  512. def initialize
  513. super(280, 0, 200, 480)
  514. @column_max = 1
  515. refresh
  516. self.z = 200
  517. self.active = false
  518. self.visible = false
  519. self.index = -1
  520. end
  521. #--------------------------------------------------------------------------
  522. # ● items define
  523. #--------------------------------------------------------------------------
  524. def item
  525. return @data[self.index]
  526. end
  527. #--------------------------------------------------------------------------
  528. # ● refresh
  529. #--------------------------------------------------------------------------
  530.   def refresh
  531.     if self.contents != nil
  532.       self.contents.dispose
  533.       self.contents = nil
  534.     end
  535.     @data = []
  536.     # 添加报务
  537.     for i in 1...$data_items.size
  538.       if $game_party.item_number(i) > 0
  539.         @data.push($data_items[i])
  540.       end
  541.     end
  542.     # 在战斗中以外添加武器、防具
  543.     unless $game_temp.in_battle
  544.       for i in 1...$data_weapons.size
  545.         if $game_party.weapon_number(i) > 0
  546.           @data.push($data_weapons[i])
  547.         end
  548.       end
  549.       for i in 1...$data_armors.size
  550.         if $game_party.armor_number(i) > 0
  551.           @data.push($data_armors[i])
  552.         end
  553.       end
  554.     end
  555.     # 如果项目数不是 0 就生成位图、重新描绘全部项目
  556.     @item_max = @data.size
  557.     if @item_max > 0
  558.       self.contents = Bitmap.new(width - 32, row_max * 32)
  559.       for i in 0...@item_max
  560.         draw_item(i)
  561.       end
  562.     end
  563.   end
  564. #--------------------------------------------------------------------------
  565. # ● draw items
  566. #--------------------------------------------------------------------------
  567. def draw_item(index)
  568.     item = @data[index]
  569.     case item
  570.     when RPG::Item
  571.       number = $game_party.item_number(item.id)
  572.     when RPG::Weapon
  573.       number = $game_party.weapon_number(item.id)
  574.     when RPG::Armor
  575.       number = $game_party.armor_number(item.id)
  576.     end
  577.    if item.is_a?(RPG::Item) and
  578.        $game_party.item_can_use?(item.id)
  579.       self.contents.font.color = normal_color
  580.     else
  581.       self.contents.font.color = disabled_color
  582.     end
  583. x = 4
  584. y = index * 32
  585. rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  586. self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  587. bitmap = RPG::Cache.icon(item.icon_name)
  588. opacity = self.contents.font.color == normal_color ? 255 : 128
  589. self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  590. self.contents.draw_text(x + 28, y, 100, 32, item.name, 0)
  591. self.contents.draw_text(x + 128, y, 10, 32, ":", 1)
  592. self.contents.draw_text(x + 138, y, 22, 32, number.to_s, 2)
  593. end
  594. #--------------------------------------------------------------------------
  595. # ● help window set text settings
  596. #--------------------------------------------------------------------------
  597.   def update_help
  598.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  599.   end
  600. end

  601. #==============================================================================
  602. # ■ Window_SkillMenu
  603. #==============================================================================
  604. class Window_SkillMenu < Window_Selectable
  605. #--------------------------------------------------------------------------
  606. # ● initialisation
  607. #--------------------------------------------------------------------------
  608. def initialize(actor)
  609. super(280, 0, 200, 288)
  610. @actor = actor
  611. @column_max = 1
  612. refresh
  613. self.active = false
  614. self.index = -1
  615. end
  616. #--------------------------------------------------------------------------
  617. # ● skill define
  618. #--------------------------------------------------------------------------
  619. def skill
  620. return @data[self.index]
  621. end
  622. #--------------------------------------------------------------------------
  623. # ● refresh
  624. #--------------------------------------------------------------------------
  625.   def refresh
  626.     if self.contents != nil
  627.       self.contents.dispose
  628.       self.contents = nil
  629.     end
  630.     @data = []
  631.     for i in [email protected]
  632.       skill = $data_skills[@actor.skills[i]]
  633.       if skill != nil
  634.         @data.push(skill)
  635.       end
  636.     end
  637.     # 如果项目数不是 0 就生成位图、重新描绘全部项目
  638.     @item_max = @data.size
  639.     if @item_max > 0
  640.       self.contents = Bitmap.new(width - 32, row_max * 32)
  641.       for i in 0...@item_max
  642.         draw_item(i)
  643.       end
  644.     end
  645.   end
  646.   #--------------------------------------------------------------------------
  647.   # ● 描绘项目
  648.   #     index : 项目编号
  649.   #--------------------------------------------------------------------------
  650.   def draw_item(index)
  651.     skill = @data[index]
  652.     if @actor.skill_can_use?(skill.id)
  653.       self.contents.font.color = normal_color
  654.     else
  655.       self.contents.font.color = disabled_color
  656.     end
  657. x = 4
  658. y = index * 32
  659. rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  660. self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  661. bitmap = RPG::Cache.icon(skill.icon_name)
  662. opacity = self.contents.font.color == normal_color ? 255 : 128
  663. self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  664. self.contents.draw_text(x + 28, y, 110, 32, skill.name, 0)
  665. self.contents.draw_text(x + 138, y, 22, 32, skill.sp_cost.to_s, 2)
  666. end
  667. #--------------------------------------------------------------------------
  668. # ● help_window text settings
  669. #--------------------------------------------------------------------------
  670.   def update_help
  671.     @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  672.   end
  673. end

  674. #==============================================================================
  675. # ■ Window_TargetMenu
  676. #==============================================================================
  677. class Window_TargetMenu < Window_Selectable
  678. #--------------------------------------------------------------------------
  679. # ● initialize the window
  680. #--------------------------------------------------------------------------
  681. def initialize
  682. super(0, 0, 280, 480)
  683. self.contents = Bitmap.new(width - 32, height - 32)

  684. self.contents.font.size = 20
  685. self.z = 200
  686. self.visible = false
  687. self.active = false
  688.     @item_max = $game_party.actors.size
  689. refresh
  690. end
  691. #--------------------------------------------------------------------------
  692. # ● refresh
  693. #--------------------------------------------------------------------------
  694. def refresh
  695.     self.contents.clear
  696.     for i in 0...$game_party.actors.size
  697. x = 4
  698. y = i * 116
  699. actor = $game_party.actors[i]
  700. draw_actor_name(actor, x, y)
  701. draw_actor_class(actor, x + 114, y)
  702. draw_actor_level(actor, x + 8, y + 32)
  703. draw_actor_state(actor, x + 8, y + 64)
  704. draw_actor_hp(actor, x + 114, y + 32)
  705. draw_actor_sp(actor, x + 114, y + 64)
  706. end
  707. end
  708.   #--------------------------------------------------------------------------
  709.   # ● 刷新光标矩形
  710.   #--------------------------------------------------------------------------
  711.   def update_cursor_rect
  712.     # 光标位置 -1 为全选、-2 以下为单独选择 (使用者自身)
  713.     if @index <= -2
  714.       self.cursor_rect.set(0, (@index + 10) * 116, self.width - 32, 96)
  715.     elsif @index == -1
  716.       self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)
  717.     else
  718.       self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
  719.     end
  720.   end
  721. end
  722. #==============================================================================
  723. # ■ Window_MenuStatusMenu
  724. #==============================================================================
  725. class Window_MenuStatusMenu < Window_Base
  726. #--------------------------------------------------------------------------
  727. # ● object define
  728. #--------------------------------------------------------------------------
  729. def initialize(actor)
  730. super(0, 0, 280, 480)
  731.     self.contents = Bitmap.new(width - 32, height - 32)

  732. self.contents.font.size = 21
  733. @actor = actor
  734. refresh
  735. end
  736. #--------------------------------------------------------------------------
  737. # ● define colors
  738. #--------------------------------------------------------------------------
  739. def plus_color
  740. return Color.new(63, 199, 154)
  741. end
  742. def minus_color
  743. return Color.new(200, 79, 62)
  744. end
  745. #--------------------------------------------------------------------------
  746. # ● define draw method for character's evasion
  747. #--------------------------------------------------------------------------
  748. def draw_actor_eva(actor, x, y)
  749. self.contents.font.color = system_color
  750. self.contents.draw_text(x, y, 120, 32, "回避率")
  751. self.contents.font.color = normal_color
  752. self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
  753. end
  754. #--------------------------------------------------------------------------
  755. # ● define draw method for character's hp
  756. #--------------------------------------------------------------------------
  757. def draw_actorhp(actor, x, y, width = 144)
  758. if actor.maxhp <= 999
  759. w = 12
  760. else
  761. w = 0
  762. end
  763. self.contents.font.color = system_color
  764. self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
  765. self.contents.font.color = actor.hp == 0 ? knockout_color :
  766. actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  767. self.contents.draw_text(width + w - 50, y, 48, 32, actor.hp.to_s, 2)
  768. self.contents.font.color = normal_color
  769. self.contents.draw_text(width + w, y, 12, 32, "/", 2)
  770. self.contents.draw_text(width, y, 48, 32, actor.maxhp.to_s, 2)
  771. end
  772. #--------------------------------------------------------------------------
  773. # ● define draw method for character's sp
  774. #--------------------------------------------------------------------------
  775. def draw_actorsp(actor, x, y, width = 144)
  776. if actor.maxsp <= 999
  777. w = 12
  778. else
  779. w = 0
  780. end
  781. self.contents.font.color = system_color
  782. self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
  783. self.contents.font.color = actor.sp == 0 ? knockout_color :
  784. actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  785. self.contents.draw_text(width + w - 50, y, 48, 32, actor.sp.to_s, 2)
  786. self.contents.font.color = normal_color
  787. self.contents.draw_text(width + w, y, 12, 32, "/", 2)
  788. self.contents.draw_text(width, y, 48, 32, actor.maxsp.to_s, 2)
  789. end
  790. #--------------------------------------------------------------------------
  791. # ● refresh
  792. #--------------------------------------------------------------------------
  793. def refresh
  794. self.contents.clear
  795. draw_actor_name(@actor, 4, 0)
  796. draw_actor_class(@actor, 124, 0)
  797. draw_actor_graphic(@actor, 230, 50)
  798. draw_actor_level(@actor, 4, 32)
  799. draw_actor_state(@actor, 124, 32)
  800. draw_actorhp(@actor, 4, 64, 114)
  801. draw_actorsp(@actor, 4, 96, 114)
  802. draw_actor_parameter(@actor, 4, 128, 0)
  803. draw_actor_parameter(@actor, 4, 160, 1)
  804. draw_actor_parameter(@actor, 4, 192, 2)
  805. draw_actor_parameter(@actor, 4, 224, 3)
  806. draw_actor_parameter(@actor, 4, 256, 4)
  807. draw_actor_parameter(@actor, 4, 288, 5)
  808. draw_actor_parameter(@actor, 4, 320, 6)
  809. draw_actor_eva(@actor, 4, 352)
  810. self.contents.font.color = system_color
  811. self.contents.draw_text(4, 384, 70, 32, "EXP")
  812. self.contents.draw_text(4, 416, 70, 32, "NEXT")
  813. self.contents.font.color = normal_color
  814. self.contents.draw_text(4 + 70, 384, 84, 32, @actor.exp_s, 2)
  815. self.contents.draw_text(4 + 70, 416, 84, 32, @actor.next_rest_exp_s, 2)
  816. if @new_atk != nil
  817. self.contents.font.color = system_color
  818. self.contents.draw_text(160, 128, 40, 32, "→", 1)
  819. if @actor.atk < @new_atk
  820. self.contents.font.color = plus_color
  821. elsif @actor.atk > @new_atk
  822. self.contents.font.color = minus_color
  823. else
  824. self.contents.font.color = normal_color
  825. end
  826. self.contents.draw_text(200, 128, 36, 32, @new_atk.to_s, 2)
  827. end
  828. if @new_pdef != nil
  829. self.contents.font.color = system_color
  830. self.contents.draw_text(160, 160, 40, 32, "→", 1)
  831. if @actor.pdef < @new_pdef
  832. self.contents.font.color = plus_color
  833. elsif @actor.pdef > @new_pdef
  834. self.contents.font.color = minus_color
  835. else
  836. self.contents.font.color = normal_color
  837. end
  838. self.contents.draw_text(200, 160, 36, 32, @new_pdef.to_s, 2)
  839. end
  840. if @new_mdef != nil
  841. self.contents.font.color = system_color
  842. self.contents.draw_text(160, 192, 40, 32, "→", 1)
  843. if @actor.mdef < @new_mdef
  844. self.contents.font.color = plus_color
  845. elsif @actor.mdef > @new_mdef
  846. self.contents.font.color = minus_color
  847. else
  848. self.contents.font.color = normal_color
  849. end
  850. self.contents.draw_text(200, 192, 36, 32, @new_mdef.to_s, 2)
  851. end
  852. if @new_str != nil
  853. self.contents.font.color = system_color
  854. self.contents.draw_text(160, 224, 40, 32, "→", 1)
  855. if @actor.str < @new_str
  856. self.contents.font.color = plus_color
  857. elsif @actor.str > @new_str
  858. self.contents.font.color = minus_color
  859. else
  860. self.contents.font.color = normal_color
  861. end
  862. self.contents.draw_text(200, 224, 36, 32, @new_str.to_s, 2)
  863. end
  864. if @new_dex != nil
  865. self.contents.font.color = system_color
  866. self.contents.draw_text(160, 256, 40, 32, "→", 1)
  867. if @actor.dex < @new_dex
  868. self.contents.font.color = plus_color
  869. elsif @actor.dex > @new_dex
  870. self.contents.font.color = minus_color
  871. else
  872. self.contents.font.color = normal_color
  873. end
  874. self.contents.draw_text(200, 256, 36, 32, @new_dex.to_s, 2)
  875. end
  876. if @new_agi != nil
  877. self.contents.font.color = system_color
  878. self.contents.draw_text(160, 288, 40, 32, "→", 1)
  879. if @actor.agi < @new_agi
  880. self.contents.font.color = plus_color
  881. elsif @actor.agi > @new_agi
  882. self.contents.font.color = minus_color
  883. else
  884. self.contents.font.color = normal_color
  885. end
  886. self.contents.draw_text(200, 288, 36, 32, @new_agi.to_s, 2)
  887. end
  888. if @new_int != nil
  889. self.contents.font.color = system_color
  890. self.contents.draw_text(160, 320, 40, 32, "→", 1)
  891. if @actor.int < @new_int
  892. self.contents.font.color = plus_color
  893. elsif @actor.int > @new_int
  894. self.contents.font.color = minus_color
  895. else
  896. self.contents.font.color = normal_color
  897. end
  898. self.contents.draw_text(200, 320, 36, 32, @new_int.to_s, 2)
  899. end
  900. if @new_eva != nil
  901. self.contents.font.color = system_color
  902. self.contents.draw_text(160, 352, 40, 32, "→", 1)
  903. if @actor.eva < @new_eva
  904. self.contents.font.color = plus_color
  905. elsif @actor.eva > @new_eva
  906. self.contents.font.color = minus_color
  907. else
  908. self.contents.font.color = normal_color
  909. end
  910. self.contents.draw_text(200, 352, 36, 32, @new_eva.to_s, 2)
  911. end
  912. end
  913. #--------------------------------------------------------------------------
  914. # ● set new parameters when equipping new items
  915. #--------------------------------------------------------------------------
  916. def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int, new_eva)
  917. if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or
  918. @new_agi != new_agi or @new_int != new_int or @new_eva != new_eva
  919. @new_atk = new_atk
  920. @new_pdef = new_pdef
  921. @new_mdef = new_mdef
  922. @new_str = new_str
  923. @new_dex = new_dex
  924. @new_agi = new_agi
  925. @new_int = new_int
  926. @new_eva = new_eva
  927. refresh
  928. end
  929. end
  930. end
  931. #==============================================================================
  932. # ■ Window_EquipRightMenu
  933. #==============================================================================
  934. class Window_EquipRightMenu < Window_Selectable
  935. #--------------------------------------------------------------------------
  936. # ● initialize the window
  937. #--------------------------------------------------------------------------
  938. def initialize(actor)
  939. super(280, 288, 200, 192)
  940. self.contents = Bitmap.new(width - 32, height - 32)

  941. self.contents.font.size = 20
  942. @actor = actor
  943. refresh
  944. self.active = false
  945. self.index = -1
  946. end
  947. #--------------------------------------------------------------------------
  948. # ● define the items
  949. #--------------------------------------------------------------------------
  950. def item
  951. return @data[self.index]
  952. end
  953. #--------------------------------------------------------------------------
  954. # ● refresh
  955. #--------------------------------------------------------------------------
  956. def refresh
  957. self.contents.clear
  958. @data = []
  959. @data.push($data_weapons[@actor.weapon_id])
  960. @data.push($data_armors[@actor.armor1_id])
  961. @data.push($data_armors[@actor.armor2_id])
  962. @data.push($data_armors[@actor.armor3_id])
  963. @data.push($data_armors[@actor.armor4_id])
  964. @item_max = @data.size
  965. self.contents.font.color = system_color
  966. draw_item_name(@data[0], 4, 32 * 0)
  967. draw_item_name(@data[1], 4, 32 * 1)
  968. draw_item_name(@data[2], 4, 32 * 2)
  969. draw_item_name(@data[3], 4, 32 * 3)
  970. draw_item_name(@data[4], 4, 32 * 4)
  971. end
  972. #--------------------------------------------------------------------------
  973. # ● help_window text settings
  974. #--------------------------------------------------------------------------
  975. def update_help
  976. @help_window.set_text(self.item == nil ? "" : self.item.description)
  977. end
  978. end

  979. class Window_EquipItemMenu < Window_Selectable
  980. #--------------------------------------------------------------------------
  981. # ● initialize the window
  982. #--------------------------------------------------------------------------
  983. def initialize(actor, equip_type)
  984. super(280, 0, 200, 288)
  985. @actor = actor
  986. @equip_type = equip_type
  987. @column_max = 1
  988. refresh
  989. self.z = 200
  990. self.active = false
  991. self.visible = false
  992. self.index = -1
  993. end
  994. #--------------------------------------------------------------------------
  995. # ● item define
  996. #--------------------------------------------------------------------------
  997. def item
  998. return @data[self.index]
  999. end

  1000. def refresh
  1001. if self.contents != nil
  1002. self.contents.dispose
  1003. self.contents = nil
  1004. end
  1005. @data = []
  1006. if @equip_type == 0
  1007. weapon_set = $data_classes[@actor.class_id].weapon_set
  1008. for i in 1...$data_weapons.size
  1009. if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
  1010. @data.push($data_weapons[i])
  1011. end
  1012. end
  1013. end
  1014. if @equip_type != 0
  1015. armor_set = $data_classes[@actor.class_id].armor_set
  1016. for i in 1...$data_armors.size
  1017. if $game_party.armor_number(i) > 0 and armor_set.include?(i)
  1018. if $data_armors[i].kind == @equip_type-1
  1019. @data.push($data_armors[i])
  1020. end
  1021. end
  1022. end
  1023. end
  1024. @data.push(nil)
  1025. @item_max = @data.size
  1026. self.contents = Bitmap.new(width - 32, (@item_max + 1) * 32)

  1027. self.contents.font.size = 20
  1028. for i in 0...@item_max-1
  1029. draw_item(i)
  1030. end
  1031. self.contents.draw_text(4, (@item_max - 1) * 32, 168, 32, "卸下装备")
  1032. end
  1033. #--------------------------------------------------------------------------
  1034. # ● draw the items
  1035. #--------------------------------------------------------------------------
  1036. def draw_item(index)
  1037. item = @data[index]
  1038. x = 4
  1039. y = index * 32
  1040. case item
  1041. when RPG::Weapon
  1042. number = $game_party.weapon_number(item.id)
  1043. when RPG::Armor
  1044. number = $game_party.armor_number(item.id)
  1045. end
  1046. bitmap = RPG::Cache.icon(item.icon_name)
  1047. self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  1048. self.contents.font.color = normal_color
  1049. self.contents.draw_text(x + 28, y, 100, 32, item.name, 0)
  1050. self.contents.draw_text(x + 128, y, 10, 32, ":", 1)
  1051. self.contents.draw_text(x + 138, y, 22, 32, number.to_s, 2)
  1052. end
  1053. def update_help
  1054. @help_window.set_text(self.item == nil ? "" : self.item.description)
  1055. end
  1056. end
复制代码


修正了无数的BUG{/gg}



这是截图,应该没有问题了吧……
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3263
在线时间
3616 小时
注册时间
2006-9-6
帖子
37399

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

4
发表于 2008-7-1 23:11:26 | 只看该作者
这就是华丽的菜单啊……
排版不错。

但是不是华丽,因为法站的一个华丽的菜单那才是真正的华丽……{/hx}
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-29 19:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表