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

Click away from sheet to re-enable controls (re-instate functionality from v0.3.1) #39

Closed
Saborknight opened this issue Feb 3, 2018 · 7 comments
Assignees
Milestone

Comments

@Saborknight
Copy link
Owner

Description:
Bring back the old functionality, where by clicking away from the currently interactive sheet re-enables controls. This is useful during an emergency, even though tapping the ESC key does work, there's no harm in re-implementing this.

@Saborknight Saborknight added this to the v1.0 milestone Feb 3, 2018
@Saborknight Saborknight changed the title Click away from sheet to re-enable controls (re-instate functionality from v0.3.1 Click away from sheet to re-enable controls (re-instate functionality from v0.3.1) Feb 3, 2018
@pixlcrashr
Copy link
Collaborator

So you mean that active sheets can moved to the background while clicking outside the sheet itself?

@Saborknight
Copy link
Owner Author

Exactly. It seems to me to be an intuitive action. Having said that, I have been playing with 9 Liners mod for years now.. xD

@pixlcrashr
Copy link
Collaborator

Should be no problem.

@pixlcrashr pixlcrashr self-assigned this Feb 3, 2018
@pixlcrashr
Copy link
Collaborator

The following would be the best way to implement it, I guess:
So, we have a simple dialog display:

class DialogDisplay {
  idd = 9999;
  onMouseButtonUp = "_this call fnc_mouseButtonUp;";

  class Controls {
    class SheetImage {
        idc = 1;
        x = .5;
        y = .5;
        w = .5;
        w = .5;
    };
  };
};

And parallel to the class the function fnc_mouseButtonUp:

fnc_mouseButtonUp = {
	params [
		_display,
		_button,
		_xPos, //I do not know if this coord is the exact 2D mouse position
		_yPos //I do not know if this coord is the exact 2D mouse position
	];

	private _pos = ctrlPosition ((findDisplay 9999) displayCtrl 1);

	if (
		_xPos <= (_pos select 0) + (_pos select 2) &&
		_xPos >= (_pos select 0) &&
		_yPos <= (_pos select 0) + (_pos select 3) &&
		_yPos >= (_pos select 1)
	) exitWith {
		closeDialog 0;
		true;
	};

	false;
};

This should be closing the dialog every time the user clicks out of the bounds of a sheet.

@Saborknight
Copy link
Owner Author

Thanks for this. How come you've made the control half the size of the safearea?
Also, I've found that displays onMouseDown kept giving a false mouse position. I would assume the same to happen onMouseUp. But we can find the real mouse position with this: getMousePosition, which I have found works very precisely.

@Saborknight
Copy link
Owner Author

My bad, didn't realise you were intending for that control to be demonstrative only

@Saborknight
Copy link
Owner Author

Saborknight commented Nov 23, 2018

Done in c5aee1c.
Note: There is no tooltip to tell the user what to do, but left click enables controls and right click closes the sheet entirely. This happens regardless of what the setting nln_dialogToDisplay_enable is set to.

A note of this will be included in the author announcement and all other materials with descriptions of the mod (as per #47 ).

Saborknight added a commit that referenced this issue Feb 15, 2019
What
=================
Basically re-implemented the controls in 0.3.1, except instead of click
and dbl click for the two different interactions we now have left and
right clicks.

Issue ID: #39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants