Started by Ryex, May 10, 2009, 09:48:57 pm
module RyexCFG PLUGINS = [] class PlugIn # read/write-able attr_accessor :name, :action, :description def initialize(name = '', desc = '') # @name is the name which will show up in the menu, # @reqs is the Proc that will be called to see if the option should # be activated (optional), # and @action is the proc that will be called when # the option is selected. @name, @action, @description = name, Proc.new, desc end def call p 'this works' @action.call end end end
dect = 'Opens the shop window'RyexCFG::PLUGINS.push(RyexCFG::PlugIn.new('shop', dect) do $Scene = Scene_Shop.new end )
RyexCFG::PLUGINS[0].call
@action.call
$test_var = falsemyProc = Proc.new do print "Wow. Something is screwy in RMXP.\n" $test_var = trueendmyProc.callprint "Wow, something is EXTRA screwy in RMXP.\n" unless $test_var