|
|
@ -20,44 +20,62 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
class Futility_Feature extends Feature; |
|
|
|
class Futility_Feature extends Feature; |
|
|
|
|
|
|
|
|
|
|
|
var LoggerAPI.Definition errNoCommandsFeature; |
|
|
|
var private array< class<Command> > allCommandClasses; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var private LoggerAPI.Definition errNoCommandsFeature; |
|
|
|
|
|
|
|
|
|
|
|
protected function OnEnabled() |
|
|
|
protected function OnEnabled() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
local int i; |
|
|
|
local Commands_Feature commandsFeature; |
|
|
|
local Commands_Feature commandsFeature; |
|
|
|
commandsFeature = |
|
|
|
commandsFeature = |
|
|
|
Commands_Feature(class'Commands_Feature'.static.GetInstance()); |
|
|
|
Commands_Feature(class'Commands_Feature'.static.GetEnabledInstance()); |
|
|
|
if (commandsFeature == none) |
|
|
|
if (commandsFeature == none) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_.logger.Auto(errNoCommandsFeature); |
|
|
|
_.logger.Auto(errNoCommandsFeature); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
commandsFeature.RegisterCommand(class'ACommandDosh'); |
|
|
|
for (i = 0; i < allCommandClasses.length; i += 1) { |
|
|
|
commandsFeature.RegisterCommand(class'ACommandNick'); |
|
|
|
commandsFeature.RegisterCommand(allCommandClasses[i]); |
|
|
|
commandsFeature.RegisterCommand(class'ACommandTrader'); |
|
|
|
} |
|
|
|
commandsFeature.RegisterCommand(class'ACommandDB'); |
|
|
|
_.environment.OnFeatureEnabled(self).connect = RegisterAllCommandClasses; |
|
|
|
commandsFeature.RegisterCommand(class'ACommandInventory'); |
|
|
|
|
|
|
|
commandsFeature.RegisterCommand(class'ACommandFeature'); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected function OnDisabled() |
|
|
|
protected function OnDisabled() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
local int i; |
|
|
|
local Commands_Feature commandsFeature; |
|
|
|
local Commands_Feature commandsFeature; |
|
|
|
commandsFeature = |
|
|
|
commandsFeature = |
|
|
|
Commands_Feature(class'Commands_Feature'.static.GetInstance()); |
|
|
|
Commands_Feature(class'Commands_Feature'.static.GetEnabledInstance()); |
|
|
|
if (commandsFeature != none) |
|
|
|
if (commandsFeature == none) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (i = 0; i < allCommandClasses.length; i += 1) { |
|
|
|
|
|
|
|
commandsFeature.RegisterCommand(allCommandClasses[i]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final function RegisterAllCommandClasses(Feature enabledFeature) |
|
|
|
{ |
|
|
|
{ |
|
|
|
commandsFeature.RemoveCommand(class'ACommandDosh'); |
|
|
|
local int i; |
|
|
|
commandsFeature.RemoveCommand(class'ACommandNick'); |
|
|
|
local Commands_Feature commandsFeature; |
|
|
|
commandsFeature.RemoveCommand(class'ACommandTrader'); |
|
|
|
commandsFeature = Commands_Feature(enabledFeature); |
|
|
|
commandsFeature.RemoveCommand(class'ACommandDB'); |
|
|
|
if (commandsFeature == none) { |
|
|
|
commandsFeature.RemoveCommand(class'ACommandInventory'); |
|
|
|
return; |
|
|
|
commandsFeature.RemoveCommand(class'ACommandFeature'); |
|
|
|
} |
|
|
|
|
|
|
|
for (i = 0; i < allCommandClasses.length; i += 1) { |
|
|
|
|
|
|
|
commandsFeature.RegisterCommand(allCommandClasses[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
defaultproperties |
|
|
|
defaultproperties |
|
|
|
{ |
|
|
|
{ |
|
|
|
configClass = class'Futility' |
|
|
|
configClass = class'Futility' |
|
|
|
|
|
|
|
allCommandClasses(0) = class'ACommandDosh' |
|
|
|
|
|
|
|
allCommandClasses(1) = class'ACommandNick' |
|
|
|
|
|
|
|
allCommandClasses(2) = class'ACommandTrader' |
|
|
|
|
|
|
|
allCommandClasses(3) = class'ACommandDB' |
|
|
|
|
|
|
|
allCommandClasses(4) = class'ACommandInventory' |
|
|
|
|
|
|
|
allCommandClasses(5) = class'ACommandFeature' |
|
|
|
errNoCommandsFeature = (l=LOG_Error,m="`Commands_Feature` is not detected, \"Futility\" will not be able to provide its functionality.") |
|
|
|
errNoCommandsFeature = (l=LOG_Error,m="`Commands_Feature` is not detected, \"Futility\" will not be able to provide its functionality.") |
|
|
|
} |
|
|
|
} |