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

Project1

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

[已经解决] 关于选单脚本添加新列表

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
148 小时
注册时间
2013-11-9
帖子
20
跳转到指定楼层
1
发表于 2014-8-10 20:37:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 夜鳴鳥歌 于 2014-8-10 20:47 编辑

现在遇到了个瓶颈...原本用Claimh这位的任务脚本顺利的添加任务窗口到默认菜单了

但现在改用另一个脚本的菜单却一直报错,修改了很久都没法搞好

所以还烦请大触帮忙看一下,到底要怎么做才能将任务窗口添加到这脚本的菜单上,谢谢

RUBY 代码复制
  1. #  Galv's Menu Themes Engine
  2. #------------------------------------------------------------------------------#
  3. #  For: RPGMAKER VX ACE
  4. #  Version 1.6
  5. #------------------------------------------------------------------------------#
  6. #  NOTICE: This script is NOT free for commercial use.
  7. #  Contact Galv via PM at one of the following forums:
  8. #  [url]http://www.rpgmakervxace.net/[/url]
  9. #  [url]http://forums.rpgmakerweb.com/[/url]
  10. #------------------------------------------------------------------------------#
  11.  
  12. #------------------------------------------------------------------------------#
  13. #  2013-06-27 - Version 1.6 - compatibility fix for xp rate
  14. #  2013-06-11 - Version 1.5 - bug fixed with help menu text on incorrect menu
  15. #  2013-06-09 - Version 1.4 - bug missed with last fix... now fixed. I hope.
  16. #  2013-06-08 - Version 1.3 - fixed bug with hidden menu items
  17. #                           - made disabled buttons text transparent
  18. #  2013-04-16 - Version 1.2 - fixed a graphic object bug. Also included
  19. #                           - Killozappit's Cache Back script in the demo to
  20. #                           - help with lag on slower computers.
  21. #  2013-04-15 - Version 1.1 - fixed a bug with using items/skills on actors
  22. #  2013-04-15 - Version 1.0 - release
  23. #------------------------------------------------------------------------------#
  24. #  This script replaces the default menu and thus will not be compatible with
  25. #  other scripts that do the same. The new changes to the menu offer a few
  26. #  things such as:
  27. #  - Image controlled menu scenes (including moving backgrounds)
  28. #  - 'Themes' allow you to customize the look of the menu and change it in game
  29. #  - Other scenes can change with theme (eg. item, equip, custom scenes, etc.)
  30. #  - Customisable menu commands (icons, visibility switches, order, vocab)
  31. #  - Animated (sliding) commands
  32. #  - Help window for selected command
  33. #  - Information bar with gold, current location and play time
  34. #  - Modified actor status to include exp and tp (for actors with preserve tp)
  35. #------------------------------------------------------------------------------#
  36.  
  37. #-------------------------------------------------------------------------------
  38. #  SCRIPT CALL
  39. #-------------------------------------------------------------------------------
  40. #
  41. #  theme("Theme_Name")      # Changes your menu theme to use the specified one.
  42. #
  43. #-------------------------------------------------------------------------------
  44.  
  45. ($imported ||= {})["Galv_Menu_Themes"] = true
  46. module GMENU
  47.     COMMAND_LIST = [ # don't touch
  48.  
  49. #-------------------------------------------------------------------------------
  50. #
  51. #  *  MENU - COMMAND SETUP
  52. #
  53. #-------------------------------------------------------------------------------
  54. #  Below list is your in-game menu commands. This replaces the database vocab
  55. #  names and adds more control over customizing your game menu.
  56. #-------------------------------------------------------------------------------
  57.  
  58. # ["Menu Text", :command_type, :Scene, switch1, switch2, help txt, icon]
  59.   ["Items",     :cmd, :Scene_Item,   0, 0, "View or use items from your inventory.",270],
  60.   ["Skills",    :sel, :Scene_Skill,  0, 0, "View or use character skills.",112],
  61.   ["Equip",     :sel, :Scene_Equip,  0, 0, "Equip your characters with weapons and armor.",170],
  62.   ["Status",    :sel, :Scene_Status, 0, 0, "View status of your characters.",117],
  63.   ["Formation", :sel, :Formation,    0, 0, "Change your character order",121],
  64.   ["Save",      :cmd, :Scene_Save,   0, 0, "Record your game progress.",224],
  65.   ["Game End",  :cmd, :Scene_End,    0, 0, "End or restart the game.",6],
  66.  
  67.   ["Example1",:cmd, 1, 0, 0, "Example command - calls common event 1",278],
  68.   ["Example2",:cmd, 1, 0, 0, "Example command - calls common event 1",278],
  69.  
  70.  
  71.  
  72.   # Here are examples of adding functionality via script. The script code for
  73.   # these examples is in the "Example Script Commands" script in the list.
  74.   #["Gold!",  :cmd, :custom1, 0, 0, "Scripted custom symbol example",280],
  75.   #["Levelup!",  :sel, :custom2, 0, 0, "Scripted custom symbol on actor select example",290],
  76.  
  77. #-------------------------------------------------------------------------------
  78.     ] # don't touch
  79. #-------------------------------------------------------------------------------
  80. #  INSTRUCTIONS
  81. #-------------------------------------------------------------------------------
  82. #  "Menu Text"........ the text used for the menu item
  83. #  :command_type...... :cmd - goes to the scene when menu item accessed.
  84. #                      :sel - select actor before going to the scene.
  85. #  scene.............. name of the scene as a symbol. eg. :Scene_Item  (*)
  86. #                      make this a number instead to call a common event.
  87. #  switch1............ if switch is OFF, item is disabled. 0 to not use
  88. #  switch2............ if switch is OFF, item will not appear. 0 to not use
  89. #  help txt........... text that appears at the top of the menu screen
  90. #  icon............... the icon id to use an icon next to your menu command
  91. #-------------------------------------------------------------------------------
  92. #  (*) Scripters can use a custom symbol here to do other functions by aliasing
  93. #  or overwriting methods found on
  94. #-------------------------------------------------------------------------------
  95.  
  96.  
  97. #-------------------------------------------------------------------------------
  98. #
  99. #  *  MENU SETTINGS
  100. #
  101. #-------------------------------------------------------------------------------
  102.  
  103.  
  104.     SHOW_TP = true    # Show TP if actor has 'preserve tp' feature true or false
  105.  
  106.     ACTORS_SHOWN = 4  # Number of actors visible in the menu before scrolling
  107.  
  108.     DEFAULT_THEME = "Theme_Default"  # The theme your game will use to begin.
  109.  
  110.  
  111. #-------------------------------------------------------------------------------
  112. #  THEME SETUP - DEFAULT THEME
  113. #-------------------------------------------------------------------------------
  114.     module Theme_Default
  115.  
  116.       # Gerenal Options
  117.       FONT = "Arial"             # Font used throughout theme.
  118.       FONT_SIZE = 21             # Font size used throughout theme.
  119.       WINDOW_TONE = [22,52,72,0] # Color tone of scenes that use windowskins
  120.  
  121.       # Background
  122.       BACK1_XY = [1,1]           # X,Y movement for background1 (default stars)
  123.       BACK1_OPACITY = 190        # Background opacity
  124.  
  125.       BACK2_XY = [0,0]           # X,Y movement for background2 (default top bar)
  126.       BACK2_OPACITY = 255        # Background opacity
  127.  
  128.       BACK3_XY = [0,0]       # X,Y movement for background2 (default bottom bar)
  129.       BACK3_OPACITY = 255    # Background opacity
  130.  
  131.       SCENE_BACK_OPACITY = 255  # Background opacity for other scene background
  132.  
  133.       # Command Menu
  134.       MENU_FONT = "Arial"        # Different font used for the menu text
  135.       MENU_FONT_SIZE = 21        # Size of menu text
  136.       MENU_TXT_COLOR = Color.new(255, 255, 255, 255)   # Color of menu text
  137.       MENU_TXT_OUT = Color.new(27, 57, 97, 255)     # Color of menu text outline
  138.       MENU_TXT_XY = [0,-2]      # X,Y offset for text in command menu
  139.       MENU_ICON_XY = [35,1]     # X,Y offset for icons in command menu
  140.       SLIDE_ICON = true         # true or false to slide icon with menu text
  141.       SLIDE_SPEED = 5           # Speed the menu buttons slide in and out
  142.       SLIDE_OFF = -30           # X Position of button when cursor not on it
  143.       SLIDE_ON = 0            # X Position of button when cursor is on it
  144.       MENU_Y_OFFSET = 45        # Distance Y from top of screen
  145.       MENU_WIDTH = 170          # Width reserved for the main menu.
  146.  
  147.       # Help Window
  148.       HELP_XY = [44,2]          # X,Y offset for help text
  149.       HELP_TEXT_COLOR = Color.new(200, 235, 255, 255) # Color of help text
  150.  
  151.       # Game Info Window
  152.       INFO_XY = [0,0]          # X,Y offset for info text
  153.       GAME_INFO_TXT_COLOR = Color.new(200, 235, 255, 255) # Game Info text color
  154.       CURRENCY_ICON = 262       # Icon used instead of currency vocab. 0 = vocab
  155.  
  156.       # Actor Status
  157.       STAT_COLOR = Color.new(167, 223, 248, 255) # Color used for lvl,hp,mp
  158.       GAUGEB_COLOR = Color.new(20, 20, 20, 255) # Color of gauge backs
  159.       HP_COLOR1 = Color.new(74, 197, 61, 255) # Color for hp gauge gradient
  160.       HP_COLOR2 = Color.new(169, 206, 89, 255)# Color for hp gauge gradient
  161.       MP_COLOR1 = Color.new(5, 132, 179, 255) # Color for mp gauge gradient
  162.       MP_COLOR2 = Color.new(40, 197, 255, 255)# Color for mp gauge gradient
  163.       XP_COLOR1 = Color.new(88, 147, 174, 255) # Color for xp gauge gradient
  164.       XP_COLOR2 = Color.new(133, 181, 203, 255)# Color for xp gauge gradient
  165.       TP_COLOR1 = Color.new(255, 166, 12, 255) # Color for tp gauge gradient
  166.       TP_COLOR2 = Color.new(255, 126, 12, 255)# Color for tp gauge gradient
  167.       GAUGE_FONT = "VL Gothic Regular"  # Font used for hp/mp and amounts.
  168.     end
  169.  
  170. #-------------------------------------------------------------------------------
  171. #  CUSTOM THEMES
  172. #-------------------------------------------------------------------------------
  173. #  You can make your own custom menu themes and swap between them during the
  174. #  game or make them available for others to use. Each theme has it's own folder
  175. #  in your project located in /Graphics/GMenu/Theme_Name/
  176. #  For example the default theme is:
  177. #  /Graphics/GMenu/Theme_Default/
  178. #
  179. #  HOW TO MAKE A THEME:
  180. #  1. Make a duplicate of the /Theme_Default/ folder and rename it.
  181. #  2. Modify the graphics how you see fit, using the default as templates
  182. #  3. (Optional) You can use the theme_settings.txt file found in the template
  183. #     folder to create new settings for the theme. Copy the script from the
  184. #     file and paste it a new script position below this menu script. Change
  185. #     "Theme_Default" at the top to the name of your theme's folder.
  186. #  4. If you did that right, now in your game, you can use the script call:
  187. #     theme("Theme_Name")
  188. #     To change your menu theme during the game to any theme you have installed.
  189. #
  190. #  If you do not create your own settings script (step 3) for your custom theme,
  191. #  it will use the settings from Theme_Default.
  192. #-------------------------------------------------------------------------------
  193.  
  194. #-------------------------------------------------------------------------------
  195. #  THEME SETUP - INNER SCENES
  196. #-------------------------------------------------------------------------------
  197. #  Inner scenes (such as item, equip, skills etc) can use the same Background
  198. #  (using BACK1 setting) as well as windowskin used in the current theme.
  199. #  List scenes below that you wish for this to occur.
  200. #-------------------------------------------------------------------------------
  201.     SCENE_THEMES = [ # don't touch
  202. #-------------------------------------------------------------------------------
  203.  
  204.       "Scene_Item",
  205.       "Scene_Skill",
  206.       "Scene_Equip",
  207.       "Scene_Status",
  208.       "Scene_Save",
  209.       "Scene_End",
  210.       "Scene_Party",
  211.       "Scene_System",
  212.       "Scene_Load",
  213.  
  214.       #"Scene_File",
  215.       #"Scene_Load",
  216.       #"Scene_Shop",
  217.       #"Scene_Name",
  218.       #"Scene_Gameover",
  219.       #"Scene_Title",
  220.  
  221. #-------------------------------------------------------------------------------
  222.       ] # don't touch
  223. #-------------------------------------------------------------------------------
  224. #  In addition to this, the script will check the theme folder for any images.
  225. #  with the scene name (above) followed by "_Background" and "_Background2".
  226. #  For example if the following file is found in the theme folder:
  227. #  Scene_Item_Background.png (or jpg)
  228. #  It will use that image INSTEAD of Background.jpg for Background1. It will
  229. #  also look for Scene_Item_Background2.png (or jpg) which will appear above
  230. #  the first background. This background is static and does not move.
  231. #-------------------------------------------------------------------------------
  232.  
  233. #-------------------------------------------------------------------------------
  234. #
  235. #  * END SETTINGS
  236. #
  237. #-------------------------------------------------------------------------------
  238.  
  239. end # GMENU
  240.  
  241.  
  242. module Check_Theme
  243.   def mtheme
  244.     Object.const_get("GMENU").const_get($game_system.menu_theme) rescue
  245.       GMENU::Theme_Default
  246.   end
  247. end # Check_Theme
  248.  
  249.  
  250.     #----------------------#
  251. #---|   GAME_INTERPERTER   |----------------------------------------------------
  252.     #----------------------#
  253.  
  254. class Game_Interpreter
  255.   def theme(name)
  256.     $game_system.menu_theme = name
  257.   end
  258. end # Game_Interpreter
  259.  
  260.  
  261.     #-----------#
  262. #---|   CACHE   |---------------------------------------------------------------
  263.     #-----------#
  264.  
  265. module Cache
  266.   def self.gmenu(filename,theme)
  267.     load_bitmap("Graphics/GMenu/" + theme + "/", filename)
  268.   end
  269. end # Cache
  270.  
  271.  
  272.     #-----------------#
  273. #---|   GAME_SYSTEM   |---------------------------------------------------------
  274.     #-----------------#
  275.  
  276. class Game_System
  277.   attr_accessor :menu_theme
  278.  
  279.   alias gmenu_engine_gs_initialize initialize
  280.   def initialize
  281.     @menu_theme = GMENU::DEFAULT_THEME
  282.     gmenu_engine_gs_initialize
  283.   end
  284. end # Game_System
  285.  
  286.  
  287.     #---------------#
  288. #---|   GAME_TEMP   |-----------------------------------------------------------
  289.     #---------------#
  290.  
  291. class Game_Temp
  292.   attr_accessor :themed_scene
  293.   attr_accessor :menuindexes
  294.  
  295.   alias gmenu_engine_gt_initialize initialize
  296.   def initialize
  297.     @themed_scene = false
  298.     gmenu_engine_gt_initialize
  299.   end
  300. end # Game_Temp
  301.  
  302.  
  303.     #----------------#
  304. #---|   GAME_ACTOR   |----------------------------------------------------------
  305.     #----------------#
  306.  
  307. class Game_Actor < Game_Battler
  308.   def xp_rate
  309.     a = (exp.to_f - current_level_exp.to_f)
  310.     b = (next_level_exp.to_f - current_level_exp.to_f)
  311.     if exp > 0 && b > 0
  312.       return a / b
  313.     else
  314.       return 0
  315.     end
  316.   end
  317. end # Game_Actor < Game_Battler
  318.  
  319.  
  320.     #----------------#
  321. #---|   SCENE_MENU   |----------------------------------------------------------
  322.     #----------------#
  323.  
  324. class Scene_Menu < Scene_MenuBase
  325.   attr_accessor :command_window
  326.   include Check_Theme
  327.  
  328.   # OVERWRITE
  329.   def start
  330.     super
  331.     create_graphics
  332.     create_help_window
  333.     create_new_command_window
  334.     create_gameinfo_window
  335.     create_status_window
  336.   end
  337.  
  338. #---|   CREATE WINDOWS   |
  339.  
  340.   def create_help_window
  341.     @help_window = Window_MenuHelp.new
  342.   end
  343.  
  344.   # OVERWRITE
  345.   def create_status_window
  346.     @status_window = Window_MainMenuStatus.new(@command_window.width,
  347.       @help_window.height,Graphics.height - @help_window.height -
  348.       @gameinfo_window.height)
  349.   end
  350.  
  351.   # OVERWRITE
  352.   def create_new_command_window
  353.     @command_window = Window_MenuCommand.new(0,@help_window.height)
  354.     @command_window.help_window = @help_window
  355.     menu_array = Array.new(GMENU::COMMAND_LIST)
  356.     menu_array.each { |cmd|
  357.       handle = cmd[0].delete(' ').downcase.to_sym
  358.       @command_window.set_handler(handle, method(cmd[1]))
  359.     }
  360.     @command_window.set_handler(:cancel, method(:return_scene))
  361.   end
  362.  
  363.   def create_gameinfo_window
  364.     @gameinfo_window = Window_GameInfo.new
  365.     @gameinfo_window.x = 0
  366.     @gameinfo_window.y = Graphics.height - @gameinfo_window.height
  367.   end
  368.  
  369. #---|   CREATE GRAPHICS   |
  370.  
  371.   def create_graphics
  372.     create_background2
  373.     create_background3
  374.   end
  375.  
  376.   def create_background2
  377.     @background2 = Plane.new
  378.     @background2.bitmap = Cache.gmenu("Background2",$game_system.menu_theme)
  379.     @background2.opacity = mtheme::BACK2_OPACITY
  380.   end
  381.  
  382.   def create_background3
  383.     @background3 = Plane.new
  384.     @background3.bitmap = Cache.gmenu("Background3",$game_system.menu_theme)
  385.     @background3.opacity = mtheme::BACK3_OPACITY
  386.     @background3.oy = -Graphics.height
  387.   end
  388.  
  389. #---|   UPDATING   |
  390.  
  391.   def update
  392.     super
  393.     update_background2
  394.     update_background3
  395.     update_gameinfo
  396.   end
  397.  
  398.   def update_background2
  399.     @background2.ox -= mtheme::BACK2_XY[0]
  400.     @background2.oy -= mtheme::BACK2_XY[1]
  401.   end
  402.   def update_background3
  403.     @background3.ox -= mtheme::BACK3_XY[0]
  404.     @background3.oy -= mtheme::BACK3_XY[1]
  405.   end
  406.   def update_gameinfo
  407.     @gameinfo_window.refresh
  408.   end
  409.  
  410. #---|   FUNCTIONALITY   |
  411.  
  412.   alias gmenu_engine_sm_dispose_background dispose_background
  413.   def dispose_background
  414.     gmenu_engine_sm_dispose_background
  415.     if @background2
  416.       @background2.bitmap.dispose
  417.       @background2.dispose
  418.     end
  419.     if @background3
  420.       @background3.bitmap.dispose
  421.       @background3.dispose
  422.     end
  423.   end
  424.  
  425.   def cmd
  426.     cmd = $game_temp.menuindexes[@command_window.index]
  427.     symbol = GMENU::COMMAND_LIST[cmd][2]
  428.     if GMENU::COMMAND_LIST[cmd][2].is_a?(Integer)
  429.       common_event_command(GMENU::COMMAND_LIST[cmd][2])
  430.     elsif custom_symbol(symbol)
  431.       custom_on_command_ok(symbol)
  432.     else
  433.       SceneManager.call(GMENU::COMMAND_LIST[cmd][2])
  434.     end
  435.   end
  436.  
  437.   def common_event_command(id)
  438.     $game_temp.reserve_common_event(id)
  439.     SceneManager.return
  440.   end
  441.  
  442.   def sel
  443.     command_personal
  444.   end
  445.  
  446.   # OVERWRITE
  447.   def command_personal
  448.     @status_window.select_last
  449.     @status_window.activate
  450.     @status_window.set_handler(:ok,     method(:on_personal_ok))
  451.     @status_window.set_handler(:cancel, method(:on_personal_cancel))
  452.   end
  453.  
  454.   # OVERWRITE
  455.   def on_personal_ok
  456.     cmd = $game_temp.menuindexes[@command_window.index]
  457.     symbol = GMENU::COMMAND_LIST[cmd][2]
  458.     if symbol == :Formation
  459.       on_formation_ok
  460.     elsif custom_symbol(symbol)
  461.       custom_on_personal_ok(symbol)
  462.     else
  463.       SceneManager.call(symbol)
  464.     end
  465.   end
  466.  
  467.   def custom_symbol(symbol)
  468.     # Alias/overwrite this method for custom symbols.
  469.     # Make this method return true if symbol equals your custom symbol.
  470.   end
  471.  
  472.   def custom_on_command_ok(symbol)
  473.     # Alias/overwrite this method for custom symbols. (For 'ok' on command)
  474.     # Add your functionality here including if symbol equals your custom symbol.
  475.   end
  476.  
  477.   def custom_on_personal_ok(symbol)
  478.     # Alias/overwrite this method for custom symbols. (For 'ok' on actor)
  479.     # Add your functionality here including if symbol equals your custom symbol.
  480.   end
  481.  
  482.   def custom_on_personal_cancel(symbol)
  483.     # Alias/overwrite this method for custom symbols. (Cancelling on actor)
  484.     # Add your cancel code here including if symbol equals your custom symbol.
  485.   end
  486.  
  487.   # OVERWRITE
  488.   def on_personal_cancel
  489.     cmd = @command_window.index
  490.     symbol = GMENU::COMMAND_LIST[cmd][2]
  491.     if symbol == :Formation
  492.       on_formation_cancel
  493.     elsif custom_symbol(symbol)
  494.       custom_on_personal_cancel(symbol)
  495.     else
  496.       @status_window.unselect
  497.       @command_window.activate
  498.     end
  499.   end
  500. end # Scene_Menu < Scene_MenuBase
  501.  
  502.  
  503.     #------------------------#
  504. #---|   WINDOW_MENUCOMMAND   |--------------------------------------------------
  505.     #------------------------#
  506.  
  507. class Window_MenuCommand < Window_Command
  508.  
  509.   #OVERWRITE
  510.   def initialize(x,y)
  511.     @menu_buttons = []
  512.     super(x, y)
  513.     select_last
  514.     self.opacity = 0
  515.   end
  516.  
  517.   def draw_item(index)
  518.     @menu_buttons << MenuBtn.new(@viewport,index)
  519.   end
  520.  
  521.   def visible_line_number
  522.     item_max
  523.   end
  524.  
  525.   def window_width
  526.     return mtheme::MENU_WIDTH
  527.   end
  528.  
  529.   def update
  530.     super
  531.     @menu_buttons.each { |btn| btn.update(index) }
  532.   end
  533.  
  534.   def dispose
  535.     @menu_buttons.each { |btn| btn.dispose }
  536.     super
  537.   end
  538.  
  539.   def update_cursor
  540.     if @cursor_all
  541.       cursor_rect.empty
  542.       self.top_row = 0
  543.     elsif @index < 0
  544.       cursor_rect.empty
  545.     else
  546.       ensure_cursor_visible
  547.       cursor_rect.empty
  548.     end
  549.   end
  550.  
  551.   def add_new_main_commands
  552.     $game_temp.menuindexes = []
  553.     menu_array = Array.new(GMENU::COMMAND_LIST)
  554.     menu_array.each_with_index { |cmd,i|
  555.       next if cmd[4] > 0 && !$game_switches[cmd[4]]
  556.       $game_temp.menuindexes << i
  557.       text = cmd[0]
  558.       active = get_active(cmd[2],cmd[3])
  559.       handle = cmd[0].delete(' ').downcase.to_sym
  560.       add_command(text, handle, active)
  561.     }
  562.   end
  563.  
  564.   def get_active(symbol,switch)
  565.     return false if switch > 0 && !$game_switches[switch]
  566.     case symbol
  567.     when :Formation
  568.       formation_enabled
  569.     when :Scene_Save
  570.       save_enabled
  571.     else
  572.       main_commands_enabled
  573.     end
  574.   end
  575.  
  576.   def make_command_list
  577.     add_new_main_commands
  578.   end
  579.  
  580. end # Window_MenuCommand < Window_Command
  581.  
  582.  
  583.     #----------------------#
  584. #---|   WINDOW_MENUSTATUS  |----------------------------------------------------
  585.     #----------------------#
  586.  
  587. class Window_MainMenuStatus < Window_MenuStatus
  588.   include Check_Theme
  589.  
  590.   def initialize(x, y, h = 0)
  591.     [url=home.php?mod=space&uid=291977]@height[/url] = h
  592.     super(x, y)
  593.     self.opacity = 0
  594.   end
  595.  
  596.   def window_width
  597.     Graphics.width - mtheme::MENU_WIDTH
  598.   end
  599.  
  600.   def standard_padding
  601.     return 6
  602.   end
  603.  
  604.   def window_height
  605.     @height
  606.   end
  607.  
  608.   def item_height
  609.     (@height - 12) / GMENU::ACTORS_SHOWN
  610.   end
  611.  
  612.   def draw_item(index)
  613.     actor = $game_party.members[index]
  614.     enabled = $game_party.battle_members.include?(actor)
  615.     rect = item_rect(index)
  616.     draw_item_background(index)
  617.     draw_back_graphics(index,item_height,item_width,enabled)
  618.     draw_gface(actor.face_name,actor.face_index,rect.x + 1,rect.y + 1,
  619.       item_height - 2,enabled)
  620.     draw_gsimple_status(actor, rect.x + 108, rect.y, item_height)
  621.   end
  622. end
  623.  
  624.  
  625.     #--------------------#
  626. #---|   WINDOW_MENUHELP  |------------------------------------------------------
  627.     #--------------------#
  628.  
  629. class Window_MenuHelp < Window_Help
  630.   include Check_Theme
  631.  
  632.   def initialize
  633.     super(1)
  634.     self.opacity = 0
  635.   end
  636.  
  637.   def standard_padding
  638.     return 6
  639.   end
  640.  
  641.   def clear
  642.     ind = $game_temp.menuindexes[SceneManager.scene.command_window.index]
  643.     set_text(GMENU::COMMAND_LIST[ind][5])
  644.   end
  645.  
  646.   def refresh
  647.     contents.clear
  648.     draw_text_ex(mtheme::HELP_XY[0], mtheme::HELP_XY[1], @text)
  649.   end
  650.  
  651.   def draw_text_ex(x, y, text)
  652.     reset_font_settings
  653.     change_color(mtheme::HELP_TEXT_COLOR)
  654.     self.contents.font.name = mtheme::FONT
  655.     self.contents.font.size = mtheme::FONT_SIZE
  656.     text = convert_escape_characters(text)
  657.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  658.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  659.   end
  660. end
  661.  
  662.  
  663.     #---------------------#
  664. #---|   WINDOW_GAMEINFO   |-----------------------------------------------------
  665.     #---------------------#
  666.  
  667. class Window_GameInfo < Window_Base
  668.   include Check_Theme
  669.  
  670.   def initialize
  671.     super(0, 0, Graphics.width, fitting_height(1))
  672.     self.opacity = 0
  673.     refresh
  674.   end
  675.  
  676.   def standard_padding
  677.     return 6
  678.   end
  679.  
  680.   def refresh
  681.     contents.clear
  682.     self.contents.font.name = mtheme::FONT
  683.     self.contents.font.size = mtheme::FONT_SIZE
  684.     draw_gld
  685.     draw_location
  686.     draw_playtime
  687.   end
  688.  
  689.   def draw_gld
  690.     value = $game_party.gold
  691.     if mtheme::CURRENCY_ICON > 0
  692.       i = draw_icon(mtheme::CURRENCY_ICON, contents.width / 4 - 43, -1, true)
  693.       draw_currency_value(value,i,tx+4,ty,contents.width / 4 - 45)
  694.     else
  695.       draw_currency_value(value,Vocab::currency_unit,tx+4,ty,contents.width / 4 - 18)
  696.     end
  697.   end
  698.  
  699.   def tx
  700.     mtheme::INFO_XY[0]
  701.   end
  702.   def ty
  703.     mtheme::INFO_XY[1]
  704.   end
  705.  
  706.   def draw_location
  707.     change_color(mtheme::GAME_INFO_TXT_COLOR)
  708.     draw_text(tx,ty,Graphics.width,line_height,$game_map.display_name,1)
  709.   end
  710.  
  711.   def draw_playtime
  712.     draw_text(tx,ty,Graphics.width - 20,line_height,time_text,2)
  713.   end
  714.  
  715.   def time_text
  716.     sprintf("%02d:%02d:%02d", (Graphics.frame_count / 60**2) / 60,
  717.       Graphics.frame_count / 60**2 % 60,
  718.       Graphics.frame_count / 60 % 60)
  719.   end
  720.  
  721.   def draw_currency_value(value, unit, x, y, width)
  722.     cx = text_size(unit).width
  723.     change_color(mtheme::GAME_INFO_TXT_COLOR)
  724.     draw_text(x, y, width - cx - 2, line_height, value, 2)
  725.     change_color(system_color)
  726.     draw_text(x, y, width, line_height, unit, 2)
  727.   end
  728.  
  729.   def open
  730.     refresh
  731.     super
  732.   end
  733. end
  734.  
  735.  
  736.     #-----------------#
  737. #---|   WINDOW_BASE   |---------------------------------------------------------
  738.     #-----------------#
  739.  
  740. class Window_Base < Window
  741.   include Check_Theme
  742.  
  743.   alias galv_gmenu_engine_wb_initialize initialize
  744.   def initialize(x, y, width, height)
  745.     galv_gmenu_engine_wb_initialize(x, y, width, height)
  746.     if $game_temp.themed_scene
  747.       self.windowskin = Cache.gmenu("Windowskin",$game_system.menu_theme) rescue
  748.         Cache.system("Window")
  749.         set_theme_tone
  750.     end
  751.   end
  752.  
  753.   alias galv_gmenu_engine_wb_system_color system_color
  754.   def system_color
  755.     if $game_temp.themed_scene
  756.       mtheme::STAT_COLOR
  757.     else
  758.       galv_gmenu_engine_wb_system_color
  759.     end
  760.   end
  761.  
  762.   alias galv_gmenu_engine_wb_gauge_back_color gauge_back_color
  763.   def gauge_back_color
  764.     if $game_temp.themed_scene
  765.       mtheme::GAUGEB_COLOR
  766.     else
  767.       galv_gmenu_engine_wb_gauge_back_color
  768.     end
  769.   end
  770.  
  771.   def set_theme_tone
  772.     a,b,c,d = mtheme::WINDOW_TONE
  773.     self.tone.set(a,b,c,d)
  774.   end
  775.  
  776.   alias galv_gmenu_engine_wb_update_tone update_tone
  777.   def update_tone
  778.     if $game_temp.themed_scene
  779.       set_theme_tone
  780.     else
  781.       galv_gmenu_engine_wb_update_tone
  782.     end
  783.   end
  784.  
  785.   def draw_back_graphics(ind,height,width,enabled = true)
  786.     if enabled
  787.       bitmap = Cache.gmenu("ActorBackground",$game_system.menu_theme)
  788.     else
  789.       bitmap = Cache.gmenu("ActorBackgroundDisabled",$game_system.menu_theme)
  790.     end
  791.     rect = Rect.new(1,0,width - 2,bitmap.height + 2)
  792.     y = (rect.y + height) * ind - (bitmap.height - height) - 2
  793.     contents.blt(rect.x, y, bitmap, rect, 255)
  794.     bitmap.dispose
  795.   end
  796.  
  797.   def draw_gsimple_status(actor, x, y, height)
  798.     contents.font.name = mtheme::FONT
  799.     contents.font.size = mtheme::FONT_SIZE
  800.     draw_actor_name(actor, x, y + height - 30)
  801.     draw_glevel(actor, x, y + height - 30 - line_height * 1)
  802.     draw_gicons(actor, x - 108, y + line_height * 2 + 3)
  803.     draw_gclass(actor, x, y + height - 30)
  804.     contents.font.size = 20
  805.     contents.font.name = mtheme::GAUGE_FONT
  806.     w = contents.width - 260
  807.     h = (height - 80) / 2
  808.     draw_ghp(actor, x + 140, y + h / 2 , w)
  809.     draw_gmp(actor, x + 140, y + line_height - 4 + h,w)
  810.     if actor.preserve_tp? && GMENU::SHOW_TP
  811.       draw_gtp(actor, x + 75, y + line_height - 4 + h,40)
  812.     end
  813.     draw_gxp(actor, x + 6, y + height - 23, contents.width - 120)
  814.   end
  815.  
  816.   def draw_gtp(actor, x, y, width = 124)
  817.     draw_gauge(x, y, width, actor.tp_rate,mtheme::TP_COLOR1,mtheme::TP_COLOR1)
  818.     change_color(system_color)
  819.     draw_text(x - 30, y + 7, 30, line_height, Vocab::tp_a,2)
  820.     change_color(tp_color(actor))
  821.     draw_text(x + width - 42, y + 3, 42, line_height, actor.tp.to_i, 2)
  822.   end
  823.  
  824.   def draw_gxp(actor,x,y,width = 124)
  825.     draw_xpgauge(x, y, width, actor.xp_rate, mtheme::XP_COLOR1, mtheme::XP_COLOR2)
  826.   end
  827.  
  828.   def draw_xpgauge(x, y, width, rate, color1, color2)
  829.     fill_w = (width * rate).to_i
  830.     gauge_y = y + line_height - 8
  831.     contents.fill_rect(x, gauge_y, width, 4, gauge_back_color)
  832.     contents.gradient_fill_rect(x, gauge_y, fill_w, 4, color1, color2)
  833.   end
  834.  
  835.   def draw_ghp(actor, x, y, width = 124)
  836.     draw_gauge(x, y, width, actor.hp_rate, mtheme::HP_COLOR1, mtheme::HP_COLOR2)
  837.     change_color(system_color)
  838.     draw_text(x - 30, y + 7, 30, line_height, Vocab::hp_a,2)
  839.     draw_current_and_max_values(x, y + 3, width, actor.hp, actor.mhp,
  840.       hp_color(actor), normal_color)
  841.   end
  842.  
  843.   def draw_gmp(actor, x, y, width = 124)
  844.     draw_gauge(x, y, width, actor.mp_rate, mtheme::MP_COLOR1, mtheme::MP_COLOR2)
  845.     change_color(system_color)
  846.     draw_text(x - 30, y + 7, 30, line_height, Vocab::mp_a,2)
  847.     draw_current_and_max_values(x, y + 3, width, actor.mp, actor.mmp,
  848.       mp_color(actor), normal_color)
  849.   end
  850.  
  851.   def draw_gicons(actor, x, y, width = 96)
  852.     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  853.     icons.each_with_index {|n, i| draw_icon(n, x, y - 16 * i) }
  854.   end
  855.  
  856.   def draw_gface(face_name, face_index, x, y, height, enabled = true)
  857.     bitmap = Cache.face(face_name)
  858.     h = [height,96].min - 1
  859.     y_offset = GMENU::ACTORS_SHOWN > 4 ? 1.25 : 1
  860.     h2 = 96 - h * y_offset
  861.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96 + h2, 96, h)
  862.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  863.     bitmap.dispose
  864.   end
  865.  
  866.   def draw_glevel(actor, x, y)
  867.     wid = Graphics.width - 300
  868.     change_color(system_color)
  869.     draw_text(x, y, wid, line_height, Vocab::level_a + " " + actor.level.to_s, 0)
  870.   end
  871.  
  872.   def draw_gclass(actor, x, y)
  873.     change_color(normal_color)
  874.     draw_text(x, y, Graphics.width - 290, line_height, actor.class.name,2)
  875.   end
  876. end # Window_Base < Window
  877.  
  878.  
  879.     #-----------------#
  880. #---|   SCENEMANAGER  |---------------------------------------------------------
  881.     #-----------------#
  882.  
  883. module SceneManager
  884.   class << self
  885.     alias gmenu_engine_sm_call call
  886.   end
  887.  
  888.   def self.call(scene_class)
  889.     if scene_class.is_a?(Symbol)
  890.       @stack.push(@scene)
  891.       [url=home.php?mod=space&uid=420706]@Scene[/url] = Kernel.const_get(scene_class).new
  892.     else
  893.       gmenu_engine_sm_call(scene_class)
  894.     end
  895.   end
  896.  
  897.   def self.themed_scene
  898.     array = ["Scene_Menu"] + GMENU::SCENE_THEMES
  899.     return true if array.include?(@scene.name)
  900.     return false
  901.   end
  902. end # SceneManager
  903.  
  904.  
  905. class Scene_MenuBase < Scene_Base
  906.   include Check_Theme
  907.  
  908.   alias gmenu_engine_sb_start start
  909.   def start
  910.     gmenu_engine_sb_start
  911.     if SceneManager.themed_scene
  912.       $game_temp.themed_scene = true
  913.       create_theme_backgrounds
  914.     end
  915.   end
  916.  
  917.   def create_theme_backgrounds
  918.     create_background1
  919.     create_themebg2
  920.   end
  921.  
  922.   def create_background1
  923.     @background1 = Plane.new
  924.     @background1.bitmap = Cache.gmenu(name + "_Background",$game_system.menu_theme) rescue
  925.       Cache.gmenu("Background",$game_system.menu_theme)
  926.     @background1.opacity = mtheme::BACK1_OPACITY
  927.     @background1.z = -1
  928.     @background_sprite.z = -2
  929.   end
  930.  
  931.   def create_themebg2
  932.     @themebg2 = Sprite.new
  933.     if !SceneManager.scene_is?(Scene_Menu)
  934.       @themebg2.bitmap = Cache.gmenu(name + "_Background2",$game_system.menu_theme) rescue
  935.       Cache.gmenu("Scene_Generic_Background2",$game_system.menu_theme) rescue
  936.       nil
  937.     end
  938.     @themebg2.opacity = mtheme::SCENE_BACK_OPACITY
  939.     if @themebg2.bitmap
  940.       @themebg2.x = [(Graphics.width - @themebg2.bitmap.width) / 2,0].max
  941.     end
  942.     @themebg2.z = 0
  943.   end
  944.  
  945.   alias gmenu_engine_sb_update update
  946.   def update
  947.     gmenu_engine_sb_update
  948.     if @background1
  949.       @background1.ox -= mtheme::BACK1_XY[0]
  950.       @background1.oy -= mtheme::BACK1_XY[1]
  951.     end
  952.   end
  953.  
  954.   alias gmenu_engine_sb_terminate terminate
  955.   def terminate
  956.     gmenu_engine_sb_terminate
  957.     $game_temp.themed_scene = false
  958.     @background1.dispose if @background1
  959.     @themebg2.dispose if @themebg2
  960.   end
  961.  
  962.   def name
  963.     if self.to_s =~ /#<(.*):/i
  964.       return $1
  965.     else
  966.       return ""
  967.     end
  968.   end
  969. end # Scene_Base
  970.  
  971.  
  972.     #--------------------#
  973. #---|   SPRITE_MENUBTN   |------------------------------------------------------
  974.     #--------------------#
  975.  
  976. class MenuBtn
  977.   include Check_Theme
  978.  
  979.   def initialize(viewport,index)
  980.     @index1 = index
  981.     @index = 0
  982.     create_bitmap
  983.     create_text
  984.     create_icon
  985.   end
  986.  
  987.   def dispose
  988.     @text.dispose
  989.     @icon.dispose
  990.     @btn.dispose
  991.     @text.bitmap.dispose
  992.     @icon.bitmap.dispose
  993.     @btn.bitmap.dispose
  994.   end
  995.  
  996.   def update(index)
  997.     @index = $game_temp.menuindexes[index]
  998.     update_position
  999.   end
  1000.  
  1001.   def menuitem
  1002.     GMENU::COMMAND_LIST[$game_temp.menuindexes[@index1]]
  1003.   end
  1004.  
  1005.   def create_bitmap
  1006.     if SceneManager.scene.command_window
  1007.       cmd_index = SceneManager.scene.command_window.index
  1008.     else
  1009.       cmd_index = 0
  1010.     end
  1011.     @btn = Sprite.new
  1012.     @btn.bitmap = Cache.gmenu("MenuButton",$game_system.menu_theme)
  1013.     @btn.y = mtheme::MENU_Y_OFFSET + @index1 * @btn.bitmap.height
  1014.     @btn.x = @index1 == cmd_index ? mtheme::SLIDE_ON : mtheme::SLIDE_OFF
  1015.     @btn.opacity = @index1 == cmd_index ? 255 : 160
  1016.   end
  1017.  
  1018.   def create_icon
  1019.     @icon = Sprite.new
  1020.     @icon.bitmap = Bitmap.new(800,800)
  1021.     @tempicon = Sprite.new
  1022.     @tempicon.bitmap = Cache.system("Iconset")
  1023.     icon_index = menuitem[6]
  1024.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  1025.     @icon.bitmap.blt(mtheme::MENU_ICON_XY[0], mtheme::MENU_ICON_XY[1],
  1026.       @tempicon.bitmap, rect, 255)
  1027.     @tempicon.bitmap.dispose if @tempicon.bitmap
  1028.     @tempicon.dispose
  1029.     @icon.x = @btn.x if mtheme::SLIDE_ICON
  1030.     @icon.y = @btn.y
  1031.     @icon.z = 100
  1032.   end
  1033.  
  1034.   def create_text
  1035.     @text = Sprite.new
  1036.     @text.bitmap = Bitmap.new(180,35)
  1037.     @text.bitmap.font.name = mtheme::MENU_FONT
  1038.     @text.bitmap.font.color = mtheme::MENU_TXT_COLOR
  1039.     @text.bitmap.font.out_color = mtheme::MENU_TXT_OUT
  1040.     @text.bitmap.font.size = mtheme::MENU_FONT_SIZE
  1041.     text = menuitem[0]
  1042.     @text.bitmap.draw_text(mtheme::MENU_TXT_XY[0],
  1043.       mtheme::MENU_TXT_XY[1],150,35, text,2)
  1044.     @text.x = @btn.x
  1045.     @text.y = @btn.y
  1046.     @text.opacity = 100 if menuitem[3] > 0 && !$game_switches[menuitem[3]]
  1047.   end
  1048.  
  1049.   def update_position
  1050.     if $game_temp.menuindexes[@index1] == @index
  1051.       @btn.opacity = 255
  1052.       return if @btn.x >= mtheme::SLIDE_ON
  1053.       @btn.x += mtheme::SLIDE_SPEED
  1054.       @text.x += mtheme::SLIDE_SPEED
  1055.       @icon.x += mtheme::SLIDE_SPEED if mtheme::SLIDE_ICON
  1056.     else
  1057.       @btn.opacity = 160
  1058.       return if @btn.x <= mtheme::SLIDE_OFF
  1059.       @btn.x -= mtheme::SLIDE_SPEED
  1060.       @text.x -= mtheme::SLIDE_SPEED
  1061.       @icon.x -= mtheme::SLIDE_SPEED if mtheme::SLIDE_ICON
  1062.     end
  1063.   end
  1064. end # Sprite_MenuBtn < Sprite_Base
[/pre]

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

2
发表于 2014-8-10 21:08:04 | 只看该作者
本帖最后由 taroxd 于 2014-8-10 21:12 编辑

应该是在常量 COMMAND_LIST 里面设置的,加在 66 行那个位置

添一行:
  1. ["任务",  :cmd, :Scene_Task,    0, 0, "进入任务界面", 图标ID],
复制代码
其中 Scene_Task 改为任务场景名,图标ID用一个数字代替
总之一切参见脚本注释喽~ 不行的话……我也没办法了

点评

太感谢大触了!我自己搞了个老半天,原来是场景名一直打错...  发表于 2014-8-10 21:27
在你的任务场景中搜索 Scene_ ,搜索到的那个结果通常就是任务场景名  发表于 2014-8-10 21:23
add_command("任务界面", :questlist, true) 指的是这个:questlist吗?还是别的?  发表于 2014-8-10 21:21
不好意思,任务场景名指的是任务系统的呼出栏吗?  发表于 2014-8-10 21:19

评分

参与人数 1梦石 +1 收起 理由
VIPArcher + 1

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-2-23 07:28

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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