Skip to content

Instantly share code, notes, and snippets.

@pennyworth12345
Created June 16, 2016 03:24
Show Gist options
  • Save pennyworth12345/0bbec54748377ace03f24ba7a22a2d01 to your computer and use it in GitHub Desktop.
Save pennyworth12345/0bbec54748377ace03f24ba7a22a2d01 to your computer and use it in GitHub Desktop.
//returns all available textures from the TextureSources of the vehicle you are looking at
//getting the type of the vehicle, going to be used for looking at the config
_vehicleType = typeOf cursorTarget;
//returning an array of the TextSources configs
_textureSets = "true" configClasses (configFile >> "CfgVehicles" >> _vehicleType >> "TextureSources");
//creating an empty array to be used later to store the available textures
_availableTextures = [];
//looping through all of the texture sets, a foreach could have been used, but this was faster in comparison
_textureSets apply {
//getting the config name for use in the available textures array
_colorName = configName _x;
//returning the array of textures used by texture set, if no value is found it will return []
_textures = [_x , "textures", []] call BIS_fnc_returnConfigEntry;
//adding the config name and array of textures to the availableTextures array
_availableTextures pushBack [_colorName, _textures];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment