-
Notifications
You must be signed in to change notification settings - Fork 738
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
Code cleanup / refactoring Goggles #2648
Conversation
|
|
||
if (!isClass _config) exitWith {false}; | ||
|
||
getNumber (_config >> "mode") == 1 // return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what does the "mode"
property represent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode = 1;
is a config entry that changes the behaviour of glasses.
Usually glasses are hidden on the unit if it gets into the water even though they are equipped in that slot.
That is reversed when mode
is set to 1. The glasses are only shown when in water. This is used for diving goggles in vanilla.
if (GVAR(showInThirdPerson)) exitWith { false }; | ||
|
||
(cameraView in ["EXTERNAL", "GROUP"] || {call EFUNC(common,isFeatureCameraActive)}) | ||
cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive) // return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the call
required here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah wait, I see, it's automatically lazy evaluation because the function is code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implemenation of lazy evaluation is nothing more than the addition of the alternative syntax of &&
and ||
which is BOOL && CODE
etc.
After some testing it seems that everything still works as expected. Merge? |
Code cleanup / refactoring Goggles
ref: #2144