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

Project1

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

[已经解决] 求助一個外國光標腳本問題

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
240 小时
注册时间
2015-3-4
帖子
27
跳转到指定楼层
1
发表于 2015-5-12 22:37:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
你們好
我找到一個腳本能在菜單里的選項前加上一個ICON*圖一紅圈,就是白色三角形. 但是在事件里制作的選項沒有出現*圖二紅圈
可不可以幫我看看腳本,那麼出了問題?
或者有沒有別的方法呢?
謝謝





RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Menu Cursor v1.00
  4. # -- Last Updated: 2012.01.16
  5. # -- Level: Easy
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-MenuCursor"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.01.16 - Started Script and Finished.
  17. #
  18. #==============================================================================
  19. # ▼ Introduction
  20. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21. # This script creates visible menu cursors for your game. Whenever a window is
  22. # selectable and active, the menu cursor will appear for it. Menu cursors catch
  23. # the player's attention better and helps the player figure out quickly which
  24. # window became the active window. Also included with this script is the
  25. # ability to disable the highlighted selection bar since the window menu cursor
  26. # can replace it.
  27. #
  28. #==============================================================================
  29. # ▼ Instructions
  30. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  31. # To install this script, open up your script editor and copy/paste this script
  32. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  33. #
  34. # Make sure you have a cursor image within your project's Graphics\System\
  35. # folder. By default, the cursor's filename should be MenuCursor.
  36. #
  37. #==============================================================================
  38. # ▼ Compatibility
  39. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  40. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  41. # it will run with RPG Maker VX without adjusting.
  42. #
  43. #==============================================================================
  44.  
  45. module YEA
  46.   module MENU_CURSOR
  47.  
  48.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  49.     # - General Settings -
  50.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  51.     # Adjust the general settings here for the menu cursor, such as the
  52.     # filename used for the menu cursor, the x position buffer and the y
  53.     # position buffer for the cursor.
  54.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  55.     FILENAME = "MenuCursor"     # Filename used for cursor in Graphics\System\
  56.     BUFFER_X = 10               # X position buffer for icon.
  57.     BUFFER_Y = 16               # Y position buffer for icon.
  58.  
  59.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  60.     # - Remove Highlighted Selection Bar -
  61.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  62.     # Normally, when an entry is selected, that entry is highlighted. You can
  63.     # opt to turn this effect off.
  64.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  65.     REMOVE_HIGHLIGHTED_SELECTION_BAR = false
  66.  
  67.   end # MENU_CURSOR
  68. end # YEA
  69.  
  70. #==============================================================================
  71. # ▼ Editting anything past this point may potentially result in causing
  72. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  73. # halitosis so edit at your own risk.
  74. #==============================================================================
  75.  
  76. #==============================================================================
  77. # ■ Sprite_MenuCursor
  78. #==============================================================================
  79.  
  80. class Sprite_MenuCursor < Sprite_Base
  81.  
  82.   #--------------------------------------------------------------------------
  83.   # initialize
  84.   #--------------------------------------------------------------------------
  85.   def initialize(window)
  86.     super(window.viewport)
  87.     @window = window
  88.     create_bitmap
  89.   end
  90.  
  91.   #--------------------------------------------------------------------------
  92.   # create_bitmap
  93.   #--------------------------------------------------------------------------
  94.   def create_bitmap
  95.     self.bitmap = Cache.system(YEA::MENU_CURSOR::FILENAME)
  96.     self.z = @window.z + 201
  97.     self.opacity = 0
  98.   end
  99.  
  100.   #--------------------------------------------------------------------------
  101.   # update
  102.   #--------------------------------------------------------------------------
  103.   def update
  104.     super
  105.     update_visibility
  106.     update_position
  107.   end
  108.  
  109.   #--------------------------------------------------------------------------
  110.   # update_visibility
  111.   #--------------------------------------------------------------------------
  112.   def update_visibility
  113.     self.visible = visible_case
  114.     self.opacity += opacity_rate
  115.   end
  116.  
  117.   #--------------------------------------------------------------------------
  118.   # visible_case
  119.   #--------------------------------------------------------------------------
  120.   def visible_case
  121.     return @window.visible
  122.   end
  123.  
  124.   #--------------------------------------------------------------------------
  125.   # opacity_rate
  126.   #--------------------------------------------------------------------------
  127.   def opacity_rate
  128.     rate = 16
  129.     return -rate unless @window.active
  130.     return rate
  131.   end
  132.  
  133.   #--------------------------------------------------------------------------
  134.   # update_position
  135.   #--------------------------------------------------------------------------
  136.   def update_position
  137.     rect = @window.cursor_rect
  138.     self.x = @window.x + rect.x - @window.ox + YEA::MENU_CURSOR::BUFFER_X
  139.     self.y = @window.y + rect.y - @window.oy + YEA::MENU_CURSOR::BUFFER_Y
  140.   end
  141.  
  142. end # Sprite_MenuCursor
  143.  
  144. #==============================================================================
  145. # ■ Window
  146. #==============================================================================
  147.  
  148. class Window
  149.  
  150.   #--------------------------------------------------------------------------
  151.   # alias method: windowskin=
  152.   #--------------------------------------------------------------------------
  153.   alias window_windowskin_change_cursor windowskin=
  154.   def windowskin=(skin)
  155.     if YEA::MENU_CURSOR::REMOVE_HIGHLIGHTED_SELECTION_BAR
  156.       skin = skin.dup
  157.       skin.clear_rect(64, 64, 32, 32)
  158.     end
  159.     window_windowskin_change_cursor(skin)
  160.   end
  161.  
  162. end # Window
  163.  
  164. #==============================================================================
  165. # ■ Scene_Base
  166. #==============================================================================
  167.  
  168. class Scene_Base
  169.  
  170.   #--------------------------------------------------------------------------
  171.   # alias method: post_start
  172.   #--------------------------------------------------------------------------
  173.   alias scene_base_post_start_cursor post_start
  174.   def post_start
  175.     create_menu_cursors
  176.     scene_base_post_start_cursor
  177.   end
  178.  
  179.   #--------------------------------------------------------------------------
  180.   # new method: create_menu_cursors
  181.   #--------------------------------------------------------------------------
  182.   def create_menu_cursors
  183.     @menu_cursors = []
  184.     instance_variables.each do |varname|
  185.       ivar = instance_variable_get(varname)
  186.       create_cursor_sprite(ivar) if ivar.is_a?(Window_Selectable)
  187.     end
  188.   end
  189.  
  190.   #--------------------------------------------------------------------------
  191.   # new method: create_cursor_sprite
  192.   #--------------------------------------------------------------------------
  193.   def create_cursor_sprite(window)
  194.     @menu_cursors.push(Sprite_MenuCursor.new(window))
  195.   end
  196.  
  197.   #--------------------------------------------------------------------------
  198.   # alias method: pre_terminate
  199.   #--------------------------------------------------------------------------
  200.   alias scene_base_pre_terminate_cursor pre_terminate
  201.   def pre_terminate
  202.     dispose_menu_cursors
  203.     scene_base_pre_terminate_cursor
  204.   end
  205.  
  206.   #--------------------------------------------------------------------------
  207.   # new method: dispose_menu_cursors
  208.   #--------------------------------------------------------------------------
  209.   def dispose_menu_cursors
  210.     @menu_cursors.each { |cursor| cursor.dispose }
  211.   end
  212.  
  213.   #--------------------------------------------------------------------------
  214.   # alias method: update_basic
  215.   #--------------------------------------------------------------------------
  216.   alias scene_base_update_basic_cursor update_basic
  217.   def update_basic
  218.     scene_base_update_basic_cursor
  219.     update_menu_cursors
  220.   end
  221.  
  222.   #--------------------------------------------------------------------------
  223.   # new method: update_menu_cursors
  224.   #--------------------------------------------------------------------------
  225.   def update_menu_cursors
  226.     @menu_cursors.each { |cursor| cursor.update }
  227.   end
  228.  
  229. end # Scene_Base
  230.  
  231. #==============================================================================
  232. #
  233. # ▼ End of File
  234. #
  235. #==============================================================================

点评

问题解决了可以自行点击帖子下方的 标记已解决  发表于 2015-5-12 23:15

Lv4.逐梦者 (版主)

无限の剣制

梦石
0
星屑
10074
在线时间
5020 小时
注册时间
2013-2-28
帖子
5030

开拓者贵宾

2
发表于 2015-5-12 23:00:29 | 只看该作者
加入这段补丁试试
  1. # VIPArcher 不负责任的修改
  2. class Scene_Map < Scene_Base
  3.   alias vip20150512_create_menu_cursors create_menu_cursors
  4.   def create_menu_cursors
  5.     vip20150512_create_menu_cursors
  6.     window = @message_window.instance_variable_get(:@choice_window)
  7.     create_cursor_sprite(window)
  8.   end
  9. end
复制代码
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 04:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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