Project1

标题: VA怎么让状态菜单显示在地图上 [打印本页]

作者: 妙风    时间: 2012-8-7 23:49
标题: VA怎么让状态菜单显示在地图上
有事请教,怎么能让菜单,状态显示在地图上?
作者: devilg    时间: 2012-8-8 11:10
把scene_menu中的window_menu_status移植到scene_map里就可以实现,不过那个menu_status的宽度有半个屏幕那么宽。
做简单的修改就可以把宽度缩短一点。
作者: 丿梁丶小柒    时间: 2012-8-8 13:38


效果如上.  还很乱  如果自己会弄的话就自己修改一下界面的UI   
如果不会可以加QQ:1308715179
不过  先给分
  1. #===============================================================================
  2. #
  3. # Yanfly Engine Melody - Main Menu Melody
  4. # Last Date Updated: 2010.06.13
  5. # Level: Normal, Hard, Lunatic
  6. #
  7. # This script allows for menu item reordering along with importing in custom
  8. # script scenes with ease so that there becomes little need to change the base
  9. # menu script in order to add in a few items. This is a YEM version of the
  10. # popular KGC Custom Menu Command. No credits will be taken on part of my own
  11. # behalf for the work KGC did. All I merely did was use it to extend the
  12. # capabilities of adding in common events, imported commands, and beefed up
  13. # engine efficiency.
  14. #
  15. #===============================================================================
  16. # Updates
  17. # -----------------------------------------------------------------------------
  18. # o 2010.06.13 - Bugfix regarding imported commands and common events.
  19. # o 2010.05.15 - Conversion to Yanfly Engine Melody.
  20. #===============================================================================
  21. # Instructions
  22. # -----------------------------------------------------------------------------
  23. # To install this script, open up your script editor and copy/paste this script
  24. # to an open slot below ▼ Materials but above ▼ Main. Considering the special
  25. # nature of this script, it is highly recommended that you place this script
  26. # above all non-core scripts. Remember to save.
  27. #
  28. # Scroll down and edit the module as you see fitting for your game.
  29. #
  30. # -----------------------------------------------------------------------------
  31. # Debug Shortcuts - Only during $TEST and $BTEST mode
  32. # -----------------------------------------------------------------------------
  33. # During testplay mode, pressing F5 while the main menu is active will fill
  34. # all party members' HP and MP to full.
  35. #===============================================================================

  36. $imported = {} if $imported == nil
  37. $imported["MainMenuMelody"] = true

  38. module YEM
  39.   module MENU
  40.    
  41.     #===========================================================================
  42.     # Section I. Menu Commands
  43.     # -------------------------------------------------------------------------
  44.     # Adjust the following hash to modify which commands will appear where. Use
  45.     # the following table to input in the commands as you see fit.
  46.     #
  47.     #   :items ............Default Item Menu
  48.     #   :skill ............Default Skill Menu
  49.     #   :equip ............Default Equip menu
  50.     #   :status ...........Default Status Menu
  51.     #   :save .............Default Save Menu
  52.     #   :system ...........Default Game End Menu
  53.     #
  54.     # For those that have imported KGC scripts.
  55.     #
  56.     #   :kgc_largeparty ...Requires KGC's Large Party
  57.     #   :kgc_apviewer .....Requires KGC's Equip Learn Skill
  58.     #   :kgc_skillcp ......Requires KGC's Skill CP System
  59.     #   :kgc_difficulty ...Requires KGC's Battle Difficulty
  60.     #   :kgc_distribute ...Requires KGC's Distribute Parameter
  61.     #   :kgc_enemyguide ...Requires KGC's Enemy Guide
  62.     #   :kgc_outline ......Requires KGC's Outline
  63.     #
  64.     # For those who are still attached to the YERD scripts.
  65.     #
  66.     #   :yerd_classchange .Requires YERD Subclass Selection System
  67.     #   :yerd_learnskill ..Requires YERD Subclass Selection System
  68.     #   :yerd_equipslots ..Requires YERD Equip Skill Slots
  69.     #   :yerd_bestiary ....Requires YERD Bestiary + Scanned Enemy
  70.     #===========================================================================
  71.     MENU_COMMANDS =[ # Follow the instructions above.
  72.       :items,          # Default Item Menu
  73.       :status,         # Default Status Menu
  74.       :skill,          # Default Skill Menu
  75.       :equip,          # Default Equip menu
  76.       :jnsd,
  77.       :gwjd,
  78.       :rw,
  79.       :system,         # Default Game End Menu
  80.     ] # Do not remove this.
  81.    
  82.     # This will determine whether or not your menu uses icons.
  83.     USE_ICONS = true
  84.    
  85.     # If you're using icons, adjust the following hash to bind the right icons
  86.     # to the right command.
  87.     MENU_ICONS ={ # If an icon is not present, it will use the unused icon.

  88.       :items  => 896,
  89.       :skill  => 858,
  90.       :equip  => 776,
  91.       :status => 889,
  92.       :system => 1526,
  93.       :jnsd=>10,
  94.       :gwjd=>651,
  95.       :rw=> 526,
  96.     } # Do not remove this.
  97.    
  98.     # This is the maximum number of rows to be displayed before the command
  99.     # box will be cut off.
  100.     MAX_ROWS = 10
  101.    
  102.     # Set the alignment for the text in your menu. By default, alignment is 0.
  103.     #   0..Left Align, 1..Center Align, 2..Right Align
  104.     ALIGN = 0
  105.    
  106.     # Setting this to true will cause the menu to shift to the right side of
  107.     # the screen while moving the party status window over to the left side.
  108.     MENU_RIGHT_SIDE = true
  109.    
  110.     # If this is set to true, the menu will not obscure the map until actor
  111.     # selection is required. Events on the map will be frozen in place.
  112.     ON_SCREEN_MENU = true
  113.    
  114.     #===========================================================================
  115.     # Section II.A. Custom Menu Command - Lunatic Mode - Common Events
  116.     # -------------------------------------------------------------------------
  117.     # For those who would like to launch command events from the main menu,
  118.     # modify this hash here to fit your liking. Then, add in the newly added
  119.     # method to the MENU_COMMANDS array above.
  120.     #
  121.     #   HideSw - This is the hide switch. Set to nil to not use a switch.
  122.     #   DisbSw - This is the disable switch. Set to nil to not use a switch.
  123.     #   Debug? - This item will only appear if it's $TEST mode.
  124.     #   CEvent - This is the common event that will launch.
  125.     #   Icon   - This is the icon used if the option is given.
  126.     #   Title  - This is the text that will appear.
  127.     #===========================================================================
  128.     COMMON_EVENTS ={ # Follow the instructions above.
  129.       # Method => [HideSw, DisbSw, Debug?, CEvent, Icon, Title Name]
  130.       :event1  => [   nil,    nil,   true,     11,  101, "Debug"],
  131.       :event2  => [   nil,    nil,  false,     12,  117, "Camp"],
  132.     } # Do not remove this.
  133.       
  134.     #===========================================================================
  135.     # Section II.B. Custom Menu Command - Lunatic Mode - Imported Commands
  136.     # -------------------------------------------------------------------------
  137.     # The following is what KGC originally was going to have in his script but
  138.     # was actually missing it in his publicized script. This will regain
  139.     # functionality and also lift the "limit" of only 100 extra commands. The
  140.     # following will explain how to set up the individual options.
  141.     #
  142.     #   HideSw - Switch used to hide the command. Set to nil if not used.
  143.     #   DisbSw - Switch used to disable the command. Set to nil if not used.
  144.     #   Actor? - Does this select an actor. Set to true if it does.
  145.     #     Icon - Determines what icon will be used for this item.
  146.     #    Title - The title text that appears for the event.
  147.     #    Scene - The scene used to launch the respective scene.
  148.     #
  149.     # Note that this does not automatically detect what will and will not
  150.     # disable the command ingame. You must understand and create a work
  151.     # around with them (if they do disable the commands) with switches.
  152.     # After binding your imported commands, go back to MENU_COMMANDS and
  153.     # insert the proper command ID at the proper location.
  154.     #===========================================================================
  155.     IMPORTED_COMMANDS ={ # Follow the instructions above.
  156.     # Method  => [HideSw, DisbSw, Actor?, Icon, Title Name, Scene Name.new]
  157.      :quests  => [     8,      9,  false,   99,   "Quests", "Scene_Quest"],
  158.      :faction => [    10,     11,  false,  100, "Factions", "Scene_Factions"],
  159.      :row     => [   nil,    nil,  false,  101,     "Rows", "Scene_Row"],
  160.      :record  => [   nil,    nil,  false,  102,  "Records", "Scene_Record"],
  161.      :craft   => [   nil,    nil,  false,  103, "Crafting", "Scene_Crafting"],
  162.     } # Do not remove this.
  163.    
  164.     #===========================================================================
  165.     # Section III.A. Multi Variable Window
  166.     # -------------------------------------------------------------------------
  167.     # Imported straight from Scene Menu ReDux, this alters the gold window at
  168.     # the bottom to display variables, time, steps, etc. This window appears
  169.     # at the bottom of the screen.
  170.     #===========================================================================
  171.     USE_MULTI_VARIABLE_WINDOW = true
  172.    
  173.     # Variables will be shown in this order. Use 0 to show gold. Adjust the
  174.     # following information as seen necessary.
  175.     VARIABLES_SHOWN = [-5, -1, -2, 0]
  176.     VARIABLES_ICONS = true
  177.     VARIABLES_HASH  ={ # Note that value zero must exist.
  178.     # VarID => [Icon, Text]
  179.           -5 => [ 915, "Map"],
  180.           -2 => [ 1323, "Steps"],
  181.           -1 => [ 1964, "Time"],
  182.            0 => [ 109, "Gold"],
  183.            1 => [ 0, "Jewels"],
  184.     }# Do not remove this.
  185.    
  186.   end # MENU
  187. end # YEM

  188. #===============================================================================
  189. # Editting anything past this point may potentially result in causing computer
  190. # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
  191. # Therefore, edit at your own risk.
  192. #===============================================================================

  193. #===============================================================================
  194. # Scene_Menu
  195. #===============================================================================

  196. class Scene_Menu < Scene_Base
  197.   
  198.   #--------------------------------------------------------------------------
  199.   # new method: create_command_list
  200.   #--------------------------------------------------------------------------
  201.   def create_command_list
  202.     vocab = []
  203.     commands = []
  204.     icons = []
  205.     index_list = {}
  206.     YEM::MENU::MENU_COMMANDS.each_with_index { |c,i|
  207.       case c
  208.       when :items
  209.         index_list[:items] = commands.size
  210.         vocab.push("物品管理")
  211.         
  212.       when :skill # Skills
  213.         index_list[:skill] = commands.size
  214.         vocab.push("魔法技能")
  215.         
  216.       when :equip # Equip
  217.         index_list[:equip] = commands.size
  218.         vocab.push(Vocab.equip)
  219.         
  220.       when :status # Status
  221.         index_list[:status] = commands.size
  222.         vocab.push(Vocab.status)
  223.       
  224.       when :jnsd
  225.         index_list[:jnsd] = commands.size
  226.         vocab.push("技能设置")
  227.         
  228.       when :gwjd
  229.         index_list[:gwjd] = commands.size
  230.         vocab.push("冒险经历")
  231.         
  232.       when :rw
  233.         index_list[:rw] = commands.size
  234.         vocab.push("任务笔记")
  235.         

  236.       when :system # System
  237.         index_list[:system] = commands.size
  238.         vocab.push("系统配置")
  239.         
  240.       #----- KGC Imported Scripts -----
  241.         
  242.       when :kgc_largeparty # KGC's Large Party
  243.         next unless $imported["LargeParty"]
  244.         index_list[:partyform] = commands.size
  245.         @__command_partyform_index = commands.size
  246.         vocab.push(Vocab.partyform)
  247.         
  248.       when :kgc_apviewer # KGC's AP Viewer
  249.         next unless $imported["EquipLearnSkill"]
  250.         index_list[:ap_viewer] = commands.size
  251.         @__command_ap_viewer_index = commands.size
  252.         vocab.push(Vocab.ap_viewer)
  253.         
  254.       when :kgc_skillcp # KGC's CP Skill System
  255.         next unless $imported["SkillCPSystem"]
  256.         index_list[:set_battle_skill] = commands.size
  257.         @__command_set_battle_skill_index = commands.size
  258.         vocab.push(Vocab.set_battle_skill)
  259.         
  260.       when :kgc_difficulty # KGC's Battle Difficulty
  261.         next unless $imported["BattleDifficulty"]
  262.         index_list[:set_difficulty] = commands.size
  263.         @__command_set_difficulty_index = commands.size
  264.         vocab.push(KGC::BattleDifficulty.get[:name])
  265.         
  266.       when :kgc_distribute # KGC's Distribute Parameter
  267.         next unless $imported["DistributeParameter"]
  268.         index_list[:distribute_parameter] = commands.size
  269.         @__command_distribute_parameter_index = commands.size
  270.         vocab.push(Vocab.distribute_parameter)
  271.         
  272.       when :kgc_enemyguide # KGC's Enemy Guide
  273.         next unless $imported["EnemyGuide"]
  274.         index_list[:enemy_guide] = commands.size
  275.         @__command_enemy_guide_index = commands.size
  276.         vocab.push(Vocab.enemy_guide)
  277.         
  278.       when :kgc_outline # KGC's Outline
  279.         next unless $imported["Outline"]
  280.         index_list[:outline] = commands.size
  281.         @__command_outline_index = commands.size
  282.         vocab.push(Vocab.outline)
  283.         
  284.       #----- YERD Imported Scripts -----
  285.         
  286.       when :yerd_classchange # Yanfly Subclass Class Change
  287.         next unless $imported["SubclassSelectionSystem"]
  288.         next unless YE::SUBCLASS::MENU_CLASS_CHANGE_OPTION
  289.         next unless $game_switches[YE::SUBCLASS::ENABLE_CLASS_CHANGE_SWITCH]
  290.         index_list[:classchange] = commands.size
  291.         @command_class_change = commands.size
  292.         vocab.push(YE::SUBCLASS::MENU_CLASS_CHANGE_TITLE)

  293.       when :yerd_learnskill # Yanfly Subclass Learn Skill
  294.         next unless $imported["SubclassSelectionSystem"]
  295.         next unless YE::SUBCLASS::USE_JP_SYSTEM and
  296.         YE::SUBCLASS::LEARN_SKILL_OPTION
  297.         next unless $game_switches[YE::SUBCLASS::ENABLE_LEARN_SKILLS_SWITCH]
  298.         index_list[:learnskill] = commands.size
  299.         @command_learn_skill = commands.size
  300.         vocab.push(YE::SUBCLASS::LEARN_SKILL_TITLE)
  301.         
  302.       when :yerd_equipslots # Yanfly Equip Skill System
  303.         next unless $imported["EquipSkillSlots"]
  304.         next unless $game_switches[YE::EQUIPSKILL::ENABLE_SLOTS_SWITCH]
  305.         index_list[:equipskill] = commands.size
  306.         @command_equip_skill = commands.size
  307.         vocab.push(YE::EQUIPSKILL::MENU_TITLE)
  308.         
  309.       when :yerd_bestiary  # Yanfly Bestiary
  310.         next unless $imported["DisplayScannedEnemy"]
  311.         next unless $game_switches[YE::MENU::MONSTER::BESTIARY_SWITCH]
  312.         index_list[:bestiary] = commands.size
  313.         @command_bestiary = commands.size
  314.         vocab.push(YE::MENU::MONSTER::BESTIARY_TITLE)
  315.         
  316.       else # ---- Custom Commands ----
  317.         if YEM::MENU::COMMON_EVENTS.include?(c)
  318.           common_event = YEM::MENU::COMMON_EVENTS[c]
  319.           next if !$TEST and common_event[2]
  320.           next if common_event[0] != nil and $game_switches[common_event[0]]
  321.           index_list[c] = commands.size
  322.           vocab.push(common_event[5])
  323.         elsif YEM::MENU::IMPORTED_COMMANDS.include?(c)
  324.           command_array = YEM::MENU::IMPORTED_COMMANDS[c]
  325.           next if command_array[0] != nil and $game_switches[command_array[0]]
  326.           index_list[c] = commands.size
  327.           vocab.push(command_array[4])
  328.         else; next
  329.         end
  330.         
  331.       end
  332.       commands.push(c)
  333.       icons.push(menu_icon(c))
  334.     } # YEM::MENU::MENU_COMMANDS.each_with_index
  335.     $game_temp.menu_command_index = index_list
  336.     @menu_array = [vocab, commands, icons]
  337.   end
  338.   
  339.   #--------------------------------------------------------------------------
  340.   # new method: menu_icon
  341.   #--------------------------------------------------------------------------
  342.   def menu_icon(command)
  343.     if YEM::MENU::MENU_ICONS.include?(command)
  344.       return YEM::MENU::MENU_ICONS[command]
  345.     elsif YEM::MENU::COMMON_EVENTS.include?(command)
  346.       return YEM::MENU::COMMON_EVENTS[command][4]
  347.     elsif YEM::MENU::IMPORTED_COMMANDS.include?(command)
  348.       return YEM::MENU::IMPORTED_COMMANDS[command][3]
  349.     else
  350.       return YEM::MENU::MENU_ICONS[:unused]
  351.     end
  352.   end
  353.   
  354.   #--------------------------------------------------------------------------
  355.   # overwrite method: create_command_window
  356.   #--------------------------------------------------------------------------
  357.   def create_command_window
  358.     create_command_list
  359.     @command_window = Window_MenuCommand.new(@menu_array)
  360.     @command_window.height = [@command_window.height,
  361.       YEM::MENU::MAX_ROWS * 24 + 32].min
  362.     @command_window.index = [@menu_index, @menu_array[0].size - 1].min
  363.   end
  364.   
  365.   #--------------------------------------------------------------------------
  366.   # overwrite method: update_command_selection
  367.   #--------------------------------------------------------------------------
  368.   def update_command_selection
  369.     if Input.trigger?(Input::B)
  370.       check_debug_enable
  371.       Sound.play_cancel
  372.       $scene = Scene_Map.new
  373.     elsif $TEST and Input.trigger?(Input::F5) # Debug Refresh Party
  374.       Sound.play_recovery
  375.       for member in $game_party.members
  376.         member.hp += member.maxhp
  377.         member.mp += member.maxmp
  378.       end
  379.       @status_window.refresh
  380.     elsif Input.trigger?(Input::C)
  381.       command = @command_window.method
  382.       case command

  383.       when :items # Item Command scene = MQ0_SceneOutline.new
  384.         Sound.play_decision
  385.         $scene = Scene_Item.new
  386.         
  387.       when :gwjd
  388.         $scene = Scene_MonsterDictionary.new
  389.         
  390.       when :rw
  391.         $scene = MQ0_SceneOutline.new
  392.         
  393.       when :jnsd,:skill, :equip, :status  # Skill, Equip, and Status Commands
  394.         Sound.play_decision
  395.         start_actor_selection


  396.       when :system # System Command
  397.         Sound.play_decision
  398.         $scene = Scene_End.new
  399.       else # Custom Commands
  400.         if YEM::MENU::COMMON_EVENTS.include?(command)
  401.           array = YEM::MENU::COMMON_EVENTS[command]
  402.           if array[1] != nil and $game_switches[array[1]]
  403.             Sound.play_buzzer
  404.           else
  405.             Sound.play_decision
  406.             $game_temp.common_event_id = array[3]
  407.             $scene = Scene_Map.new
  408.           end
  409.         elsif YEM::MENU::IMPORTED_COMMANDS.include?(command)
  410.           array = YEM::MENU::IMPORTED_COMMANDS[command]
  411.           if array[1] != nil and $game_switches[array[1]]
  412.             Sound.play_buzzer
  413.           else
  414.             Sound.play_decision
  415.             if array[2]
  416.               start_actor_selection
  417.             else
  418.               $scene = eval(array[5] + ".new")
  419.             end
  420.           end
  421.         end
  422.         
  423.       end # if case check
  424.     end # end if
  425.   end # end update_command_selection
  426.   
  427.   #--------------------------------------------------------------------------
  428.   # overwrite method: update_actor_selection
  429.   #--------------------------------------------------------------------------
  430.   def update_actor_selection
  431.     if Input.trigger?(Input::B)
  432.       Sound.play_cancel
  433.       end_actor_selection
  434.       @status_window.close if YEM::MENU::ON_SCREEN_MENU
  435.     elsif $TEST and Input.trigger?(Input::F5) # Debug Refresh Party
  436.       Sound.play_recovery
  437.       for member in $game_party.members
  438.         member.hp += member.maxhp
  439.         member.mp += member.maxmp
  440.       end
  441.       @status_window.refresh
  442.     elsif Input.trigger?(Input::C)
  443.       $game_party.last_actor_index = @status_window.index
  444.       Sound.play_decision
  445.       command = @command_window.method
  446.       case command
  447.       when :skill # Skill Command
  448.         $scene = Scene_Skill.new(@status_window.index)
  449.       when :equip # Equip Command
  450.         $scene = Scene_Equip.new(@status_window.index)
  451.       when :status # Status Command
  452.         $scene = Scene_Status.new(@status_window.index)
  453.       when :jnsd
  454.         $scene = Scene_SetBattleSkill.new(@status_window.index)
  455.       else # Custom Commands
  456.         if YEM::MENU::IMPORTED_COMMANDS.include?(command)
  457.           array = YEM::MENU::IMPORTED_COMMANDS[command]
  458.           $scene = eval(array[5] + ".new(@status_window.index)")
  459.         end
  460.       end
  461.       
  462.     end
  463.   end
  464.   
  465.   #--------------------------------------------------------------------------
  466.   # overwrite method: start
  467.   #--------------------------------------------------------------------------
  468.   def start
  469.     super
  470.     create_menu_background
  471.     create_command_window
  472.     if YEM::MENU::USE_MULTI_VARIABLE_WINDOW
  473.       @gold_window = Window_MultiVariableWindow.new
  474.     else
  475.       @gold_window = Window_Gold.new(0, 360)
  476.     end
  477.     @status_window = Window_MenuStatus.new(160, 0)
  478.     @right_side = YEM::MENU::MENU_RIGHT_SIDE
  479.     if YEM::MENU::ON_SCREEN_MENU
  480.       @gold_window.y = @command_window.height
  481.       @status_window.openness = 0
  482.       @right_side = true if $game_player.screen_x <= 176
  483.       @right_side = false if $game_player.screen_x >= 368
  484.       $game_temp.on_screen_menu = false
  485.     end
  486.     if @right_side
  487.       @status_window.x = 0
  488.       @command_window.x = 480
  489.       @gold_window.x = 480
  490.     end
  491.   end
  492.   
  493.   #--------------------------------------------------------------------------
  494.   # alias method: start_actor_selection
  495.   #--------------------------------------------------------------------------
  496.   alias start_actor_selection_mmz start_actor_selection unless $@
  497.   def start_actor_selection
  498.     if YEM::MENU::ON_SCREEN_MENU
  499.       @status_window.open
  500.     end
  501.     start_actor_selection_mmz
  502.   end
  503.   
  504.   #--------------------------------------------------------------------------
  505.   # new method: create_menu_background
  506.   #--------------------------------------------------------------------------
  507.   if YEM::MENU::ON_SCREEN_MENU
  508.   def create_menu_background
  509.     @menuback_sprite = Spriteset_Map.new
  510.   end
  511.   end
  512.   
  513. end # Scene_Menu

  514. #==============================================================================
  515. # Imported from KGC's Custom Menu Command
  516. # to improve compatibility amongst KGC scripts
  517. #==============================================================================
  518. $imported["CustomMenuCommand"] = true
  519. class Game_Temp
  520.   attr_accessor :menu_command_index
  521.   attr_accessor :next_scene_actor_index
  522.   attr_accessor :on_screen_menu
  523.   
  524.   alias initialize_KGC_CustomMenuCommand initialize unless $@
  525.   def initialize
  526.     initialize_KGC_CustomMenuCommand
  527.     @menu_command_index = {}
  528.     @next_scene_actor_index = 0
  529.   end
  530. end

  531. module KGC
  532. module Commands
  533.   module_function
  534.   def call_item
  535.     return if $game_temp.in_battle
  536.     $game_temp.next_scene = :menu_item
  537.     $game_temp.next_scene_actor_index = 0
  538.     $game_temp.menu_command_index = {}
  539.   end
  540.   def call_skill(actor_index = 0)
  541.     return if $game_temp.in_battle
  542.     $game_temp.next_scene = :menu_skill
  543.     $game_temp.next_scene_actor_index = actor_index
  544.     $game_temp.menu_command_index = {}
  545.   end
  546.   def call_equip(actor_index = 0)
  547.     return if $game_temp.in_battle
  548.     $game_temp.next_scene = :menu_equip
  549.     $game_temp.next_scene_actor_index = actor_index
  550.     $game_temp.menu_command_index = {}
  551.   end
  552.   def call_status(actor_index = 0)
  553.     return if $game_temp.in_battle
  554.     $game_temp.next_scene = :menu_status
  555.     $game_temp.next_scene_actor_index = actor_index
  556.     $game_temp.menu_command_index = {}
  557.   end
  558. end
  559. end

  560. class Game_Interpreter
  561.   include KGC::Commands
  562. end

  563. class Scene_Map < Scene_Base
  564.   alias update_scene_change_KGC_CustomMenuCommand update_scene_change unless $@
  565.   def update_scene_change
  566.     return if $game_player.moving?
  567.     case $game_temp.next_scene
  568.     when :menu_item
  569.       call_menu_item
  570.     when :menu_skill
  571.       call_menu_skill
  572.     when :menu_equip
  573.       call_menu_equip
  574.     when :menu_status
  575.       call_menu_status
  576.     else
  577.       update_scene_change_KGC_CustomMenuCommand
  578.     end
  579.   end
  580.   alias call_menu_mmz call_menu unless $@
  581.   def call_menu
  582.     $game_temp.on_screen_menu = true if YEM::MENU::ON_SCREEN_MENU
  583.     call_menu_mmz
  584.   end
  585.   def call_menu_item
  586.     $game_temp.next_scene = nil
  587.     $scene = Scene_Item.new
  588.   end
  589.   def call_menu_skill
  590.     $game_temp.next_scene = nil
  591.     $scene = Scene_Skill.new($game_temp.next_scene_actor_index)
  592.     $game_temp.next_scene_actor_index = 0
  593.   end
  594.   def call_menu_equip
  595.     $game_temp.next_scene = nil
  596.     $scene = Scene_Equip.new($game_temp.next_scene_actor_index)
  597.     $game_temp.next_scene_actor_index = 0
  598.   end
  599.   def call_menu_status
  600.     $game_temp.next_scene = nil
  601.     $scene = Scene_Status.new($game_temp.next_scene_actor_index)
  602.     $game_temp.next_scene_actor_index = 0
  603.   end
  604. end

  605. class Scene_Menu < Scene_Base
  606.   def check_debug_enable
  607.     return unless Input.press?(Input::F5)
  608.     return unless Input.press?(Input::F9)
  609.     $TEST = true
  610.   end
  611. end

  612. class Scene_Item < Scene_Base
  613.   def return_scene
  614.     if $game_temp.menu_command_index.has_key?(:items)
  615.       $scene = Scene_Menu.new($game_temp.menu_command_index[:items])
  616.     else
  617.       $scene = Scene_Map.new
  618.     end
  619.   end
  620. end

  621. class Scene_Skill < Scene_Base
  622.   def return_scene
  623.     if $game_temp.menu_command_index.has_key?(:skill)
  624.       $scene = Scene_Menu.new($game_temp.menu_command_index[:skill])
  625.     else
  626.       $scene = Scene_Map.new
  627.     end
  628.   end
  629. end

  630. class Scene_Equip < Scene_Base
  631.   def return_scene
  632.     if $game_temp.menu_command_index.has_key?(:equip)
  633.       $scene = Scene_Menu.new($game_temp.menu_command_index[:equip])
  634.     else
  635.       $scene = Scene_Map.new
  636.     end
  637.   end
  638. end

  639. class Scene_Status < Scene_Base
  640.   def return_scene
  641.     if $game_temp.menu_command_index.has_key?(:status)
  642.       $scene = Scene_Menu.new($game_temp.menu_command_index[:status])
  643.     else
  644.       $scene = Scene_Map.new
  645.     end
  646.   end
  647. end

  648. class Scene_File < Scene_Base
  649.   alias return_scene_KGC_CustomMenuCommand return_scene unless $@
  650.   def return_scene
  651.     if @from_title || @from_event
  652.       return_scene_KGC_CustomMenuCommand
  653.     elsif $game_temp.menu_command_index.has_key?(:save)
  654.       $scene = Scene_Menu.new($game_temp.menu_command_index[:save])
  655.     else
  656.       $scene = Scene_Map.new
  657.     end
  658.   end
  659. end

  660. class Scene_End < Scene_Base
  661.   def return_scene
  662.     if $game_temp.menu_command_index.has_key?(:system)
  663.       $scene = Scene_Menu.new($game_temp.menu_command_index[:system])
  664.     else
  665.       $scene = Scene_Map.new
  666.     end
  667.   end
  668. end

  669. #===============================================================================
  670. # Game_Map
  671. #===============================================================================

  672. class Game_Map
  673.   
  674.   #--------------------------------------------------------------------------
  675.   # map name
  676.   #--------------------------------------------------------------------------
  677.   unless method_defined?(:map_name)
  678.   def map_name
  679.     data = load_data("Data/MapInfos.rvdata")
  680.     text = data[@map_id].name.gsub(/\[.*\]/) { "" }
  681.     return text
  682.   end
  683.   end
  684.   
  685. end # Game_Map

  686. #===============================================================================
  687. # Game_Actor
  688. #===============================================================================

  689. class Game_Actor < Game_Battler
  690.   
  691.   #--------------------------------------------------------------------------
  692.   # new method: now_exp
  693.   #--------------------------------------------------------------------------
  694.   def now_exp
  695.     return @exp - @exp_list[@level]
  696.   end
  697.   
  698.   #--------------------------------------------------------------------------
  699.   # new method: next_exp
  700.   #--------------------------------------------------------------------------
  701.   def next_exp
  702.     return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  703.   end
  704.   
  705. end # Game_Actor

  706. #===============================================================================
  707. # Window_MultiVariableWindow
  708. #===============================================================================

  709. class Window_MultiVariableWindow < Window_Selectable
  710.   
  711.   #--------------------------------------------------------------------------
  712.   # initialize
  713.   #--------------------------------------------------------------------------
  714.   def initialize
  715.     dh = 32 + 24 * YEM::MENU::VARIABLES_SHOWN.size
  716.     dy = Graphics.height - dh
  717.     super(0, dy, 160, dh)
  718.     refresh
  719.   end
  720.   
  721.   #--------------------------------------------------------------------------
  722.   # refresh
  723.   #--------------------------------------------------------------------------
  724.   def refresh
  725.     @data = []
  726.     for i in YEM::MENU::VARIABLES_SHOWN
  727.       next unless YEM::MENU::VARIABLES_HASH.include?(i)
  728.       @time_index = @data.size if i == -1
  729.       @data.push(i)
  730.     end
  731.     @item_max = @data.size
  732.     create_contents
  733.     for i in 0...@item_max
  734.       draw_item(i)
  735.     end
  736.   end
  737.   
  738.   #--------------------------------------------------------------------------
  739.   # draw_item
  740.   #--------------------------------------------------------------------------
  741.   def draw_item(index)
  742.     rect = item_rect(index)
  743.     sw = self.width - 32
  744.     dy = WLH * index
  745.     self.contents.clear_rect(rect)
  746.     i = @data[index]
  747.     case i
  748.     when -5 # Draw Map Name
  749.       self.contents.draw_text(0, dy, sw, WLH, $game_map.map_name, 1)
  750.       
  751.     when -2 # Draw Steps
  752.       if YEM::MENU::VARIABLES_ICONS
  753.         text = $game_party.steps
  754.         self.contents.draw_text(0, dy, sw-24, WLH, text, 2)
  755.         draw_icon(YEM::MENU::VARIABLES_HASH[-2][0], sw-24, dy)
  756.       else
  757.         text = YEM::MENU::VARIABLES_HASH[-2][1]
  758.         value = $game_party.steps
  759.         cx = contents.text_size(text).width
  760.         self.contents.font.color = normal_color
  761.         self.contents.draw_text(0, dy, sw-cx-2, WLH, value, 2)
  762.         self.contents.font.color = system_color
  763.         self.contents.draw_text(0, dy, sw, WLH, text, 2)
  764.       end
  765.       
  766.     when -1 # Draw Time
  767.       if YEM::MENU::VARIABLES_ICONS
  768.         text = game_time
  769.         self.contents.draw_text(0, dy, sw-24, WLH, text, 2)
  770.         draw_icon(YEM::MENU::VARIABLES_HASH[-1][0], sw-24, dy)
  771.       else
  772.         self.contents.font.color = normal_color
  773.         text = game_time
  774.         self.contents.draw_text(0, dy, sw, WLH, text, 1)
  775.       end
  776.       
  777.     when 0 # Draw Gold
  778.       if YEM::MENU::VARIABLES_ICONS
  779.         text = $game_party.gold
  780.         self.contents.draw_text(0, dy, sw-24, WLH, text, 2)
  781.         draw_icon(YEM::MENU::VARIABLES_HASH[0][0], sw-24, dy)
  782.       else
  783.         draw_currency_value($game_party.gold, 4, dy, 120)
  784.       end
  785.       
  786.     else # Draw Variables
  787.       if YEM::MENU::VARIABLES_ICONS
  788.         text = $game_variables[i]
  789.         self.contents.draw_text(0, dy, sw-24, WLH, text, 2)
  790.         draw_icon(YEM::MENU::VARIABLES_HASH[i][0], sw-24, dy)
  791.       else
  792.         text = YEM::MENU::VARIABLES_HASH[i][1]
  793.         value = $game_variables[i]
  794.         cx = contents.text_size(text).width
  795.         self.contents.font.color = normal_color
  796.         self.contents.draw_text(0, dy, sw-cx-2, WLH, value, 2)
  797.         self.contents.font.color = system_color
  798.         self.contents.draw_text(0, dy, sw, WLH, text, 2)
  799.       end
  800.     end
  801.   end
  802.   
  803.   #--------------------------------------------------------------------------
  804.   # game_time
  805.   #--------------------------------------------------------------------------
  806.   def game_time
  807.     gametime = Graphics.frame_count / Graphics.frame_rate
  808.     hours = gametime / 3600
  809.     minutes = gametime / 60 % 60
  810.     seconds = gametime % 60
  811.     result = sprintf("%d:%02d:%02d", hours, minutes, seconds)
  812.     return result
  813.   end
  814.   
  815.   #--------------------------------------------------------------------------
  816.   # update
  817.   #--------------------------------------------------------------------------
  818.   if YEM::MENU::VARIABLES_SHOWN.include?(-1)
  819.   def update
  820.     if game_time != (Graphics.frame_count / Graphics.frame_rate)
  821.       draw_item(@time_index)
  822.     end
  823.     super
  824.   end
  825.   end
  826.   
  827. end # Window_MultiVariableWindow

  828. #===============================================================================
  829. # Window_MenuCommand
  830. #===============================================================================

  831. class Window_MenuCommand < Window_Command
  832.   
  833.   #--------------------------------------------------------------------------
  834.   # initialize
  835.   #--------------------------------------------------------------------------
  836.   def initialize(array)
  837.     @data = array[1]
  838.     @icons = array[2]
  839.     super(160, array[0])
  840.   end
  841.   
  842.   #--------------------------------------------------------------------------
  843.   # refresh
  844.   #--------------------------------------------------------------------------
  845.   def refresh
  846.     create_contents
  847.     for i in 0...@item_max
  848.       draw_item(i)
  849.     end
  850.   end
  851.   
  852.   #--------------------------------------------------------------------------
  853.   # method
  854.   #--------------------------------------------------------------------------
  855.   def method; return @data[self.index]; end
  856.    
  857.   #--------------------------------------------------------------------------
  858.   # draw_item
  859.   #--------------------------------------------------------------------------
  860.   def draw_item(index, enabled = true)
  861.     rect = item_rect(index)
  862.     rect.x += 4
  863.     rect.width -= 8
  864.     self.contents.clear_rect(rect)
  865.     self.contents.font.color = normal_color
  866.     #---
  867.     text = @commands[index]
  868.     icon = @icons[index]
  869.     case @data[index]
  870.     when :items, :skill, :equip, :status, :kgc_apviewer, :kgc_skillcp,
  871.       :kgc_distribute, :yerd_classchange, :yerd_learnskill, :yerd_equipslots
  872.       enabled = ($game_party.members.size == 0 ? false : true)
  873.     when :save
  874.       enabled = !$game_system.save_disabled
  875.     when :kgc_largeparty
  876.       enabled = ($game_party.members.size == 0 ? false : true)
  877.       enabled = false if !$game_party.partyform_enable?
  878.     else
  879.       if YEM::MENU::COMMON_EVENTS.include?(@data[index])
  880.         if YEM::MENU::COMMON_EVENTS[@data[index]][1] != nil
  881.           switch_id = YEM::MENU::COMMON_EVENTS[@data[index]][1]
  882.           enabled = !$game_switches[switch_id]
  883.         end
  884.       elsif YEM::MENU::IMPORTED_COMMANDS.include?(@data[index])
  885.         if YEM::MENU::IMPORTED_COMMANDS[@data[index]][1] != nil
  886.           switch_id = YEM::MENU::IMPORTED_COMMANDS[@data[index]][1]
  887.           enabled = !$game_switches[switch_id]
  888.         end
  889.       end
  890.     end
  891.     #---
  892.     self.contents.font.color.alpha = enabled ? 255 : 128
  893.     dx = rect.x; dy = rect.y; dw = rect.width
  894.     if YEM::MENU::USE_ICONS and icon.is_a?(Integer)
  895.       draw_icon(icon, 0, dy, enabled)
  896.       dx += 20; dw -= 20
  897.     end
  898.     self.contents.draw_text(dx, dy, dw, WLH, text, YEM::MENU::ALIGN)
  899.   end
  900.   
  901. end # Window_MenuCommand

  902. #===============================================================================
  903. #
  904. # END OF FILE
  905. #
  906. #===============================================================================
复制代码

作者: 妙风    时间: 2012-8-9 11:53
丿梁丶小柒 发表于 2012-8-8 13:38
效果如上.  还很乱  如果自己会弄的话就自己修改一下界面的UI   
如果不会可以加QQ:1308715179
不过  先 ...



显示脚本错误...
作者: 妙风    时间: 2012-8-9 20:02
妙风 发表于 2012-8-9 11:53
显示脚本错误...

#===============================================================================

# Scene_Menu

#===============================================================================


class Scene_Menu < Scene_Base #这个~~~

  





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1