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

Code cleanup / refactoring Goggles #2648

Merged
merged 13 commits into from
Oct 1, 2015
Merged

Code cleanup / refactoring Goggles #2648

merged 13 commits into from
Oct 1, 2015

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Sep 29, 2015

ref: #2144

@commy2 commy2 added kind/enhancement Release Notes: **IMPROVED:** kind/cleanup Release Notes: **CHANGED:** labels Sep 29, 2015
@commy2 commy2 self-assigned this Sep 29, 2015
@commy2 commy2 added this to the 3.4.0 milestone Sep 29, 2015
@commy2
Copy link
Contributor Author

commy2 commented Sep 29, 2015

  • VR glasses
  • if (GVAR(showInThirdPerson)) exitWith { false };


if (!isClass _config) exitWith {false};

getNumber (_config >> "mode") == 1 // return
Copy link
Member

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?

Copy link
Contributor Author

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.

@commy2 commy2 removed the status/WIP label Sep 29, 2015
if (GVAR(showInThirdPerson)) exitWith { false };

(cameraView in ["EXTERNAL", "GROUP"] || {call EFUNC(common,isFeatureCameraActive)})
cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive) // return
Copy link
Member

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?

Copy link
Member

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

Copy link
Contributor Author

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.

@commy2
Copy link
Contributor Author

commy2 commented Sep 30, 2015

After some testing it seems that everything still works as expected. Merge?

commy2 added a commit that referenced this pull request Oct 1, 2015
Code cleanup / refactoring Goggles
@commy2 commy2 merged commit ea01db4 into master Oct 1, 2015
@commy2 commy2 deleted the 340goggles branch October 1, 2015 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Release Notes: **CHANGED:** kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants