Exemplo n.º 1
0
 /**
  * This method is called when the plugin is first initialized. Very early in the loading process.
  */
 public function exp_onInit()
 {
     // Define a version : This is will be displayed to the user in the plugin list.
     $this->setVersion('0.1.0');
     // Get the configuration object. You might as well get it whanever you need it.
     $this->config = Config::getInstance();
 }
Exemplo n.º 2
0
 public function onBeginLoad()
 {
     parent::onBeginLoad();
     $this->setName("eXpansion Acme");
     $this->setDescription("A demo plugin to show dev's how to create plugins");
     $this->setGroups(array('Demo'));
     // Get configuration instance,
     $config = Config::getInstance();
     /* Create a new variable. "who" is the name of the variable in the config class, and the second parameter
      * the name to display in the front.
      */
     $var = new TypeString("who", "Who do we great hello to?", $config);
     // Description of this variable. We use a dummy description.
     $var->setDescription("Dummy description");
     // Default value used to reset the setting.
     $var->setDefaultValue('world');
     // We register the variable to enable configuration in game.
     $this->registerVariable($var);
 }