You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.2 KiB
61 lines
2.2 KiB
3 years ago
|
/**
|
||
3 years ago
|
* This is the Futility feature, whose main purpose is to register commands
|
||
3 years ago
|
* from its package.
|
||
|
* Copyright 2021 Anton Tarasenko
|
||
|
*------------------------------------------------------------------------------
|
||
3 years ago
|
* This file is part of Futility.
|
||
3 years ago
|
*
|
||
3 years ago
|
* Futility is free software: you can redistribute it and/or modify
|
||
3 years ago
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
3 years ago
|
* Futility is distributed in the hope that it will be useful,
|
||
3 years ago
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
3 years ago
|
* along with Futility. If not, see <https://www.gnu.org/licenses/>.
|
||
3 years ago
|
*/
|
||
3 years ago
|
class Futility_Feature extends Feature;
|
||
3 years ago
|
|
||
|
var LoggerAPI.Definition errNoCommandsFeature;
|
||
|
|
||
|
protected function OnEnabled()
|
||
|
{
|
||
|
local Commands_Feature commandsFeature;
|
||
|
commandsFeature =
|
||
|
Commands_Feature(class'Commands_Feature'.static.GetInstance());
|
||
|
if (commandsFeature == none)
|
||
|
{
|
||
|
_.logger.Auto(errNoCommandsFeature);
|
||
|
return;
|
||
|
}
|
||
|
commandsFeature.RegisterCommand(class'ACommandDosh');
|
||
3 years ago
|
commandsFeature.RegisterCommand(class'ACommandGive');
|
||
3 years ago
|
commandsFeature.RegisterCommand(class'ACommandNick');
|
||
|
commandsFeature.RegisterCommand(class'ACommandTrader');
|
||
|
commandsFeature.RegisterCommand(class'ACommandDB');
|
||
|
}
|
||
|
|
||
|
protected function OnDisabled()
|
||
|
{
|
||
|
local Commands_Feature commandsFeature;
|
||
|
commandsFeature =
|
||
|
Commands_Feature(class'Commands_Feature'.static.GetInstance());
|
||
|
if (commandsFeature != none)
|
||
|
{
|
||
|
commandsFeature.RemoveCommand(class'ACommandDosh');
|
||
3 years ago
|
commandsFeature.RemoveCommand(class'ACommandGive');
|
||
3 years ago
|
commandsFeature.RemoveCommand(class'ACommandNick');
|
||
|
commandsFeature.RemoveCommand(class'ACommandTrader');
|
||
|
commandsFeature.RemoveCommand(class'ACommandDB');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
defaultproperties
|
||
|
{
|
||
3 years ago
|
configClass = class'Futility'
|
||
|
errNoCommandsFeature = (l=LOG_Error,m="`Commands_Feature` is not detected, \"Futility\" will not be able to provide its functionality.")
|
||
3 years ago
|
}
|