Advertisement
nio_kasgami

Luna Engine CP command Fix - "Common-Event"

Jul 27th, 2015
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 9.37 KB | None | 0 0
  1. ##-----------------------------------------------------------------------------
  2. ## Luna Engine - Camp Menu Command Config v1.0
  3. ## Created by Neon Black - 12.30.2014
  4. ##
  5. ## CONFIG HALF
  6. ##   - Requires the core half v1.0+ below it to work.
  7. ##
  8. ## This script is the first half of a 2 part script that allows the user to
  9. ## modify the commands of the camp menu command window.  To use this script
  10. ## place the script anywhere below "▼ Materials" and above "▼ Main Process".
  11. ## When using the Luna Engine Menu script, both pieces must go BELOW the Luna
  12. ## Engine.
  13. ##
  14. ##  ▼ Materials
  15. ##   Yami's Luna Menu
  16. ##   CP's Luna Camp Menu Config
  17. ##   CP's Luna Camp Menu Core
  18. ##
  19. ##  ▼ Main Process
  20. ##-----------------------------------------------------------------------------
  21.  
  22.  
  23. module CPLuna
  24.   module CampMenu
  25.    
  26.     COMMAND_WINDOW ={
  27.      
  28.       ## All indented functions from :x to :col_max require :use_cp_settings to
  29.       ## be set to true.  These options are added to give a little more control
  30.       ## to the default window that basic Luna Engine only allows via lunatic.
  31.       :use_cp_settings => true,
  32.         :x          => 0,
  33.         :y          => 0,
  34.         :z          => 200,
  35.         :width      => 160,
  36.         :min_height => 48,
  37.         :max_height => 480,
  38.        
  39.         :item_height      => 24,
  40.         :standard_padding => 12,
  41.         :col_max          => 1,
  42.        
  43.       ## The following are the font and text related settings.
  44.       :font_name   => "VL Gothic",
  45.       :font_size   => 24,
  46.       :font_bold   => false,
  47.       :font_italic => false,
  48.       :font_align  => 0,
  49.       :font_color  => [255, 255, 255],
  50.       :font_outer  => [0,   0,   0],
  51.      
  52.      
  53.       ## Below is an array containing all the commands to appear in the command
  54.       ## window.  The first 9 settings on each are required, but the font
  55.       ## commands are not required.  A detail of each setting follows.
  56.      
  57.       ##    :push       => This command is the option's priority in the menu.
  58.       ##                   Lower numbers will appear higher in the list.
  59.       ##                   Numbers may be skipped and do not need to be in
  60.       ##                   order.
  61.       ##    :name       => The name of the option to appear in the menu.
  62.       ##                   This may be a "String" object or one of a few
  63.       ##                   :symbol objects.  :symbol objects relate to the
  64.       ##                   default system names from the database.  They are:
  65.       ##                   :item, :skill, :equip, :status, :formation, :save
  66.       ##                   :continue, and :game_end.
  67.       ##    :icon       => The icon ID for the option.  Use nil if you want
  68.       ##                   no icon to be displayed and no indent and 0 if you
  69.       ##                   want no icon and a 24 pixel indent.
  70.       ##    :type       => The type of function pressing the command will have.
  71.       ##                   0 relates to the default use based on a symbol
  72.       ##                   listed above (see :name).
  73.       ##                   1 will perform a method in Scene_Menu when clicked.
  74.       ##                   2 will go to the a scene when clicked.
  75.       ##                   For values 1 and 2 use a symbol with the same name
  76.       ##                   as the method or scene you want to call, for
  77.       ##                   example, :Scene_Foo or :some_method.
  78.       ##    :actor_sel  => Determines if an actor is selected before performing
  79.       ##                   the designated action from :type.  :type will be
  80.       ##                   called as soon as an actor is picked.
  81.       ##    :nabl_type  => Determines the conditions to have the option enabled
  82.       ##                   when the menu is opened.
  83.       ##                   0 will cause the option to always be enabled.
  84.       ##                   1 will cause the option to be enabled only when the
  85.       ##                   party size is larger than :nabl_sym.
  86.       ##                   2 will cause the option to be enabled only when
  87.       ##                   the switch number listed in :nabl_sym is turned on.
  88.       ##                   3 will cause the option to be enabled if the string
  89.       ##                   in :nabl_sym evaluates true.
  90.       ##                   If any other value is used, the option will never
  91.       ##                   enable.
  92.       ##    :nabl_sym   => Must be either a number or a string based on the
  93.       ##                   setting of :nabl_type.  If :nabl_type is set to 3,
  94.       ##                   it will require a string to test.
  95.       ##    :appear     => This setting determines if the option shows in the
  96.       ##                   menu and/or the requirements to cause it to appear.
  97.       ##                   This may be set to true if you always want the
  98.       ##                   command to appear or it may be set to a string to
  99.       ##                   evaluate.  If it evaluates to a true value it will
  100.       ##                   show up, while it will not appear in the menu if it
  101.       ##                   evaluates false.  If anything but a "String" or true
  102.       ##                   is used, an error will be raised.
  103.       :commands =>[
  104.         {   :push       => 1,
  105.             :name       => :item,
  106.             :icon       => 261,
  107.             :type       => 0,  ## 0 - default command, 1 - method, 2 - scene
  108.             :type_sym   => :item,
  109.             :actor_sel  => false,
  110.             :nabl_type  => 0,  ## 0 - always, 1 - party, 2 - switch, 3 - script
  111.             :nabl_sym   => nil,
  112.             :appear     => true,
  113.             ## Font related tags may be used with each command, for example,
  114.             ## we will modify the properties of the Item command.
  115.             :font_name   => "Open Sans",
  116.             :font_size   => 22,
  117.             :font_bold   => true,
  118.             :font_italic => true,
  119.             :font_align  => 2,
  120.             :font_color  => [255, 255, 0],
  121.             :font_outer  => [0,   0,   255],
  122.         },
  123.         {   :push       => 2,
  124.             :name       => :skill,
  125.             :icon       => 143,
  126.             :type       => 0,
  127.             :type_sym   => :skill,
  128.             :actor_sel  => true,
  129.             :nabl_type  => 1,
  130.             :nabl_sym   => 1,
  131.             :appear     => true,
  132.         },
  133.         {   :push       => 3,
  134.             :name       => :equip,
  135.             :icon       => 115,
  136.             :type       => 0,
  137.             :type_sym   => :equip,
  138.             :actor_sel  => true,
  139.             :nabl_type  => 1,
  140.             :nabl_sym   => 1,
  141.             :appear     => true,
  142.         },
  143.         {   :push       => 4,
  144.             :name       => :status,
  145.             :icon       => 121,
  146.             :type       => 0,
  147.             :type_sym   => :status,
  148.             :actor_sel  => true,
  149.             :nabl_type  => 1,
  150.             :nabl_sym   => 1,
  151.             :appear     => true,
  152.         },
  153.         {   :push       => 5,
  154.             :name       => :formation,
  155.             :icon       => 12,
  156.             :type       => 0,
  157.             :type_sym   => :formation,
  158.             :actor_sel  => false,
  159.             :nabl_type  => 1,
  160.             :nabl_sym   => 2,
  161.             :appear     => true,
  162.         },
  163.         {   :push       => 6,
  164.             :name       => :save,
  165.             :icon       => 286,
  166.             :type       => 0,
  167.             :type_sym   => :save,
  168.             :actor_sel  => false,
  169.             :nabl_type  => 3,
  170.             :nabl_sym   => "save_enabled",
  171.             :appear     => true,
  172.         },
  173.         {   :push       => 7,
  174.             :name       => :continue,
  175.             :icon       => 117,
  176.             :type       => 0,
  177.             :type_sym   => :continue,
  178.             :actor_sel  => false,
  179.             :nabl_type  => 0,
  180.             :nabl_sym   => nil,
  181.             :appear     => true,
  182.         },
  183.         {   :push       => 8,
  184.             :name       => :game_end,
  185.             :icon       => 280,
  186.             :type       => 0,
  187.             :type_sym   => :game_end,
  188.             :actor_sel  => false,
  189.             :nabl_type  => 0,
  190.             :nabl_sym   => nil,
  191.             :appear     => true,
  192.         },
  193.         {   :push       => 9,
  194.             :name       => "Back",
  195.             :icon       => 495,
  196.             :type       => 1,
  197.             :type_sym   => :return_scene,
  198.             :actor_sel  => false,
  199.             :nabl_type  => 0,
  200.             :nabl_sym   => nil,
  201.             :appear     => true,
  202.         },
  203.         {   :push       => 0,
  204.             :name       => "common_event",
  205.             :icon       => 368,
  206.             :type       => 1,
  207.             :type_sym   => :call_common_event,
  208.             :actor_sel  => false,
  209.             :nabl_type  => 0,
  210.             :nabl_nabl_sym  => nil,
  211.             :appear     => "$TEST",
  212.         },
  213.       ],
  214.      
  215.      
  216.      
  217.     }## Command Window
  218.   end
  219. end
  220. #==============================================================================
  221. # ■ Scene_Menu
  222. #==============================================================================
  223. class Scene_Menu < Scene_MenuBase
  224.  
  225. #----------------------------------------------------------------------------
  226. # ○ new method: call_common_event
  227. #----------------------------------------------------------------------------
  228.   def call_common_event
  229.     @id = $game_variable[1]
  230.     $game_temp.reserve_common_event(id)
  231.     return_scene
  232.   end
  233.  
  234. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement