Browse Source

Add `Feature` ability to return current config

pull/8/head
Anton Tarasenko 2 years ago
parent
commit
1ada5d2718
  1. 16
      sources/Features/Feature.uc

16
sources/Features/Feature.uc

@ -215,6 +215,22 @@ public static final function Text GetAutoEnabledConfig()
return default.configClass.static.GetAutoEnabledConfig(); return default.configClass.static.GetAutoEnabledConfig();
} }
/**
* Returns name of the currently enabled config for the caller `Feature`.
*
* @return Name of the currently enabled for the caller `Feature`.
* `none` if `Feature` is not currently enabled.
*/
public static final function Text GetCurrentConfig()
{
local Feature myInstance;
myInstance = GetInstance();
if (myInstance == none) return none;
if (myInstance.currentConfigName == none) return none;
return myInstance.currentConfigName.Copy();
}
/** /**
* Checks whether caller `Feature` is currently enabled. * Checks whether caller `Feature` is currently enabled.
* *

Loading…
Cancel
Save