inheritsFrom: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ :\-\/|()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}") |
Lou Montana (talk | contribs) m (Text replacement - "<!-- Note Section [A-Z]+ --> " to "") |
||
Line 54: | Line 54: | ||
<dl class="command_description"> | <dl class="command_description"> | ||
<dd class="notedate">Posted on Apr 2, 2014 - 17:11</dd> | <dd class="notedate">Posted on Apr 2, 2014 - 17:11</dd> | ||
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]<dd class="note"> | <dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]<dd class="note"> | ||
Line 65: | Line 64: | ||
//return: Nothing | //return: Nothing | ||
</code> | </code> | ||
</dl> | </dl> | ||
Revision as of 00:31, 6 April 2021
Description
- Description:
- Description needed
- Groups:
- Config
Syntax
- Syntax:
- Syntax needed
- Parameters:
- config: Config
- Return Value:
- Return value needed
Examples
- Example 1:
_base = inheritsFrom (configFile >> "CfgVehicles" >> "Car");
Result is Config entry for class "LandVehicle"- Example 2:
- Print parent tree of given config class:
fnc_printParents = { disableSerialization; if (!isClass _this) exitWith {hint "Argument is not a config Class"}; private _parents = []; while {!isNull _this} do { _parents pushBack configName _this; _this = inheritsFrom _this; }; reverse _parents; private _tv = findDisplay 46 createDisplay "RscDisplayEmpty" ctrlCreate ["RscTree", -1]; _tv ctrlSetPosition [0,0,1,1]; _tv ctrlSetBackgroundColor [0,0,0,0.5]; _tv ctrlCommit 0; private _path = []; { _tv tvAdd [_path, _x]; _path pushBack 0; } forEach _parents; tvExpandAll _tv; }; // Example: (configFile >> "CfgVehicles" >> typeOf player) call fnc_printParents;
Additional Information
- See also:
- configFileconfig / nameconfigNamecountgetArraygetTextgetNumberisArrayisClassisNumberisTextselectconfigHierarchyisKindOf
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on Apr 2, 2014 - 17:11
- ffur2007slx2_5
-
(A3 1.14)Use BIS_fnc_returnParents if a parents' collection of the given entry is needed.
[(configFile >> "CfgVehicles" >> "Land_Atm_02_F"),true ] call BIS_fnc_returnParents; //return: ["Land_Atm_02_F","House_Small_F","House_F","House","HouseBase","NonStrategic","Building","Static","All"]
Not all entries have parent, and please differ parents from path.inheritsFrom (configFile >> "CfgUIColors" >> "IGUI" >> "Presets" >> "PresetA1" >> "Variables"); //return: Nothing