Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended Vehicle Customization #387

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Conversation

Kexanone
Copy link
Member

@Kexanone Kexanone commented May 21, 2020

When merged this pull request will:

  • Provide zen_garage_fnc_defineCustomTexture as API function for defining custom textures for the garage.
  • Unlock hidden vanilla textures for the garage (see BIF thread).
  • Unlock additional animation sources for the garage (e.g. vehicle doors).
  • Add support for the extended customization to deep copy/paste, custom compositions and SQF exporter.
  • Sort animations and textures in garage in alphabetical order.
  • Fixes Compositions do not retain Object Specific changes made to entities. #444.

@Kexanone Kexanone added the enhancement Improves an existing feature label May 21, 2020
@Kexanone Kexanone mentioned this pull request May 22, 2020
7 tasks
@mharis001 mharis001 added this to the 1.9.0 milestone May 29, 2020
@mharis001
Copy link
Member

I am unsure about showing animations that would normally be hidden. For example, for the Prowler (HMG), you have ones such as "mainMuzzle rot" and "mainMuzzle reload" listed. And ones that are meant to be shown such as "Hide left front door" are hidden.

@mharis001 mharis001 modified the milestones: 1.9.0, 1.10.0 Aug 10, 2020
@Kexanone
Copy link
Member Author

Kexanone commented Jan 7, 2021

I am unsure about showing animations that would normally be hidden. For example, for the Prowler (HMG), you have ones such as "mainMuzzle rot" and "mainMuzzle reload" listed. And ones that are meant to be shown such as "Hide left front door" are hidden.

There are some neat animations like hiding turrets of APCs and door animations. The "hide door" animations disappeared due to a bug fixed in ba3d0a3.

@Kexanone
Copy link
Member Author

Still need to test how adequately the blacklist is for different mod sets.
Do we have some guideline what mods we usually want to check?

@Kexanone Kexanone mentioned this pull request Jan 13, 2021
@mharis001
Copy link
Member

I'd say CUP, RHS, 3CB, and Project OPFOR are the main asset mods.

@Kexanone Kexanone requested a review from mharis001 January 23, 2021 16:57
@Kexanone Kexanone requested a review from neilzar January 23, 2021 16:58
Comment on lines +48 to +56
case "door": {
_vehicle doorPhase _configName;
};
case "user": {
_vehicle animationSourcePhase _configName;
};
default {
_vehicle animationPhase _configName;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_vehicle is not defined in this function. Works currently because its called openGarage function.

Comment on lines +69 to +73
private _textures = if (_variant isEqualType "") then {
getArray (_sourcesConfig >> _variant >> "textures");
} else {
_variant;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No semicolon for return values of code blocks.

@@ -15,3 +15,32 @@ In order to easily apply the same customization to multiple vehicles, all vehicl
- <kbd>BACKSPACE</kbd> : Toggle interface visibility.
- <kbd>LMB</kbd> : Show hidden interface.
- <kbd>RMB</kbd> : Toggle interface (when not panning).

### Register a Texture
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this under frameworks section in a new page.

private _configName = configName _x;
private _displayName = getText (_x >> "displayName");
if (_displayName isEqualTo "") then {
_displayName = (_configName splitString "_") joinString " ";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary parentheses.

Comment on lines +45 to +47
if (_displayName isEqualTo "") then {
_displayName = (_configName splitString "_") joinString " ";
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer a blank lines before and after the if block.

// Some sources will return negative values
if (_phase >= 0) then {
_animations append [_configName, _phase];
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

Comment on lines +23 to +24
private _vehicleType = typeOf _vehicle;
private _vehicleConfig = configFile >> "CfgVehicles" >> _vehicleType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use configOf command.

private _configName = toLower configName _config;
private _source = toLower getText (_config >> "source");

if (_source in WHITELIST_ANIMATION_SOURCES && {BLACKLIST_ANIMATION_INNAMES findIf {_x in _configName} == -1 && {BLACKLIST_ANIMATION_ATTRIBUTES findIf {isClass (_config >> _x)} == -1}}) then {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multi-line:

if (
    _source in // ...
    && {}
    && {}
) then {

[_vehicle, _texture, nil, _mass] call BIS_fnc_initVehicle;
};

nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary when function has return value of "None".

* Public: Yes
*/

params ["_baseVehicleType", "_variantName", "_texture"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this function is public, should do type checking in params.

@mharis001 mharis001 modified the milestones: 1.10.0, 1.11.0 Feb 3, 2021
if (_animation isEqualType []) then {
for "_i" from 0 to (count _animation - 2) step 2 do {
private _configName = _animation select _i;
private _source = getText (configFile >> "CfgVehicles" >> _vehicleType >> "animationSources" >> _configName >> "source");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use configOf

};

if (_texture isEqualType [] && {count _texture < 2 || {(_texture select 1) isEqualType ""}}) then {
[_vehicle, nil, nil, _mass] call BIS_fnc_initVehicle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires targetEvent #558

_vehicle setObjectTextureGlobal [_forEachIndex, _x];
} forEach _texture;
} else {
[_vehicle, _texture, nil, _mass] call BIS_fnc_initVehicle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment above

};

// Add items to animations list
private _ctrlListAnimations = _display displayCtrl IDC_LIST_ANIMATIONS;
{
_x params ["_configName", "_displayName"];

private _isChecked = GVAR(center) animationPhase _configName;
private _source = getText (configFile >> "CfgVehicles" >> _vehicleType >> "animationSources" >> _configName >> "source");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use configOf

@mharis001 mharis001 modified the milestones: 1.11.0, 1.12.0 May 25, 2021
@mharis001 mharis001 modified the milestones: 1.12.0, 1.13.0 Sep 3, 2021
@mharis001 mharis001 modified the milestones: 1.13.0, Backlog Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compositions do not retain Object Specific changes made to entities.
3 participants