General Question simple vc help

Well the MFd were coded differently. I mean they were a part of a MFD controller. I removed all that and concentrated on this. Once this gets to work Then I will merge it


I might look at that.

No it did not work. Is there some code that writes to the log or something that when I press the mouse it shows where I hit
 
Well the MFd were coded differently. I mean they were a part of a MFD controller. I removed all that and concentrated on this. Once this gets to work Then I will merge it

I don't understand what that means. I hope you didn't just throw away the code. It's still present in an earlier commit, right? How are they "coded differently"? They still have to use the same mechanism of registering an active area and listening to mouse events, even if the MFD code is wrapped in a dedicated class.
 
Sorry Gattis, the command should make KILLROT, but it may not work if the vessel is stationary, try to change the command to PROGRADE ... only for a check

In clbkVCMouseEvent


case AID_NAVMODE: //BREAK
ToggleNavmode(NAVMODE_PROGRADE);
 
I don't understand what that means. I hope you didn't just throw away the code. It's still present in an earlier commit, right? How are they "coded differently"? They still have to use the same mechanism of registering an active area and listening to mouse events, even if the MFD code is wrapped in a dedicated class.

Thanks.

I mean the whole MFds were a dedicated cpp and H.

Well rather than comment out I made a new solution. I was that the callback was different.

In the old code:
Code:
bool ClassicMfd::HandleMouseEvent(int const aid, int const event, VECTOR3 const &p)
{
	switch (aid) {
	case AID_PILOT_MFD_LEFT_BTNS_FN:
		return ProcessMfdFnButton(PILOT_MFD_LEFT, event, p);
	case AID_PILOT_MFD_LEFT_BTNS_SYS:
		return ProcessMfdSysButton(PILOT_MFD_LEFT, event, p);

	case AID_PILOT_MFD_CENTER_BTNS_FN:
		return ProcessMfdFnButton(PILOT_MFD_CENTER, event, p);
	case AID_PILOT_MFD_CENTER_BTNS_SYS:
		return ProcessMfdSysButton(PILOT_MFD_CENTER, event, p);

	case AID_PILOT_MFD_RIGHT_BTNS_FN:
		return ProcessMfdFnButton(PILOT_MFD_RIGHT, event, p);
	case AID_PILOT_MFD_RIGHT_BTNS_SYS:
		return ProcessMfdSysButton(PILOT_MFD_RIGHT, event, p);

	

	}
return false;

I am away from the home pc now but I will try the new change.
 
Last edited:
I mean the whole MFds were a dedicated cpp and H.
Why would that make a difference?
Well rather than comment out I made a new solution. I was that the callback was different.
You should learn to use a revision control system to organise your work. In fact, rather than posting endless code snippets here, some of which work and some which don't, until everybody is utterly confused, why not start a shared project and invite other people to contribute?
I am away from the home pc now but I will try the new change.
Are you saying that you didn't actually test the larger click area?
 
Why would that make a difference?

You should learn to use a revision control system to organise your work. In fact, rather than posting endless code snippets here, some of which work and some which don't, until everybody is utterly confused, why not start a shared project and invite other people to contribute?
Like bitbucket?
I am king of disorganization in Orbiter and life:)
Are you saying that you didn't actually test the larger click area?

Yes I tested the larger area. and nothing.
 
Thanks. I can set up a bitbucket for it.

What he rather means about your "unorganized" development is, that you are not keeping track of what you changed and why you did so.

Recommendation: Start using git locally. You just need a workspace to edit your code. And maybe some place on your HDD or better your external HDD/USB stick to store a remote repository.

https://tortoisegit.org/


This way, you can always track and revert changes without needing the full version control monty. Its actually easy.

github and bitbucket are nice for collaboration and code reviews, but since you can start using git locally without it, you can also start at a smaller scale first and later extend to remote repositories like that.
 
Last edited:
Just try to follow a simple standard process during your testing:

  1. Edit
  2. Stage (Select which files to commit)
  3. Commit (Store in changes in version control with a clear message what changed)
  4. Test
  5. Review
  6. Decide if you keep the changes or revert to an earlier commit.
  7. Repeat.
 
Thanks. Well I will need to get it set up first.
I may just just use a simple mesh also for this.
 
When...I downloaded the mesh and made the code, and it works.

I changed from quadrilateral to spherical:

oapiVCSetAreaClickmode_Spherical (AID_NAVMODE, _V(-0.1264551,1.500134,2.812949), 0.015);


Also in quadrilateral mode (I have redone the coordinates):

oapiVCSetAreaClickmode_Quadrilateral(AID_NAVMODE, _V(-0.1431676 , 1.508765, 2.812929), _V(-0.1431676, 1.492183, 2.83156), _V(-0.1078574, 1.508846, 2.812929), _V(-0.1078574, 1.492224, 2.83156));

The area is that of the first button on the left.
 
Last edited:
Thanks. So how did you calculate the area? I guess maybe one could just have 6 navmode and then when that area is hit then do what ever.

I download GitHub and tortoise. But either my Chrome browser does like it or SLOW internet.

Not sure how to add files in resp and then push.
 
Thanks. So how did you calculate the area?

RDVrZYs.jpg

:lol:

You need to be more precise with the coordinates.

:cheers:
 
Thanks. So I split the button mesh group up into separate buttons
All buttons work:)
Code:
switch (id) {
	case 0: // commander position
		SetCameraOffset(_V(-0.41, 1.6, 2.241));
		SetCameraDefaultDirection(_V(0, 0, 1));
		SetCameraMovement(_V(0, 0, 0.2), 0, 0, _V(-0.3, 0, 0), 75 * RAD, -5 * RAD, _V(0.3, 0, 0), -20 * RAD, -27 * RAD);
		//oapiVCSetNeighbours(-1, 1, -1, 2);



		oapiVCRegisterArea(AID_NAVMODE1, PANEL_REDRAW_NEVER, PANEL_MOUSE_LBDOWN);
		oapiVCRegisterArea(AID_NAVMODE2, PANEL_REDRAW_NEVER, PANEL_MOUSE_LBDOWN);
		oapiVCRegisterArea(AID_NAVMODE3, PANEL_REDRAW_NEVER, PANEL_MOUSE_LBDOWN);
		oapiVCRegisterArea(AID_NAVMODE4, PANEL_REDRAW_NEVER, PANEL_MOUSE_LBDOWN);
		oapiVCRegisterArea(AID_NAVMODE5, PANEL_REDRAW_NEVER, PANEL_MOUSE_LBDOWN);
		oapiVCRegisterArea(AID_NAVMODE6, PANEL_REDRAW_NEVER, PANEL_MOUSE_LBDOWN);
		oapiVCRegisterArea(AID_NAVMODE7, PANEL_REDRAW_NEVER, PANEL_MOUSE_LBDOWN);


	//	oapiVCSetAreaClickmode_Quadrilateral(AID_NAVMODE, _V(-10.1446553, 10.511254, 2.824909), _V(10.1446553, 10.487942, 2.824909), _V(-10.1521383, -10.511254, 2.824909), _V(10.1517904, 10.487942, 2.824909));
		oapiVCSetAreaClickmode_Spherical(AID_NAVMODE1, _V(-0.1264551, 1.500134, 2.812949), 0.015);
	//	oapiVCSetAreaClickmode_Quadrilateral(AID_NAVMODE1, _V(-0.1431676, 1.508765, 2.812929), _V(-0.1431676, 1.492183, 2.83156), _V(-0.1078574, 1.508846, 2.812929), _V(-0.1078574, 1.492224, 2.83156));

		oapiVCSetAreaClickmode_Spherical(AID_NAVMODE2, _V(-.08476054,  1.500178, 2.822194), 0.015);
		oapiVCSetAreaClickmode_Spherical(AID_NAVMODE3, _V(-.04344729,  1.500378, 2.822194), 0.015);
		oapiVCSetAreaClickmode_Spherical(AID_NAVMODE4, _V(0, 1.500178, 2.822194), 0.015);
		oapiVCSetAreaClickmode_Spherical(AID_NAVMODE5, _V(.04249217, 1.500178, 2.822194), 0.015);
		oapiVCSetAreaClickmode_Spherical(AID_NAVMODE6, _V(.08443221, 1.500178, 2.822194), 0.015);
		oapiVCSetAreaClickmode_Spherical(AID_NAVMODE7, _V(.1269527, 1.500178, 2.822194), 0.015);


		//oapiVCSetAreaClickmode_Quadrilateral(AID_NAVMODE2, _V(-.1020503, 1.508989, 2.822194), _V(-.1020503, 1.492167, 2.822194), _V(-0.06673641, 1.508856, 2.822194), _V(-0.0673641,  1.492167, 2.822194));


		//oapiVCSetAreaClickmode_Quadrilateral(AID_NAVMODE3, _V(-0.1431676, 1.508765, 2.812929), _V(-0.1431676, 1.492183, 2.83156), _V(-0.1078574, 1.508846, 2.812929), _V(-0.1078574, 1.492224, 2.83156));
		//oapiVCSetAreaClickmode_Quadrilateral(AID_NAVMODE4, _V(-0.1431676, 1.508765, 2.812929), _V(-0.1431676, 1.492183, 2.83156), _V(-0.1078574, 1.508846, 2.812929), _V(-0.1078574, 1.492224, 2.83156));
		//oapiVCSetAreaClickmode_Quadrilateral(AID_NAVMODE5, _V(-0.1431676, 1.508765, 2.812929), _V(-0.1431676, 1.492183, 2.83156), _V(-0.1078574, 1.508846, 2.812929), _V(-0.1078574, 1.492224, 2.83156));
		//oapiVCSetAreaClickmode_Quadrilateral(AID_NAVMODE6, _V(-0.1431676, 1.508765, 2.812929), _V(-0.1431676, 1.492183, 2.83156), _V(-0.1078574, 1.508846, 2.812929), _V(-0.1078574, 1.492224, 2.83156));

	}



	return true;

}


bool TALON::clbkVCMouseEvent(int id, int event, VECTOR3 &p)
{

	switch (id) {


	case AID_NAVMODE1:
		ToggleNavmode(NAVMODE_KILLROT);
		return true;
	case AID_NAVMODE2:
		ToggleNavmode(NAVMODE_HLEVEL);
		return true;
	case AID_NAVMODE3:
		ToggleNavmode(NAVMODE_PROGRADE);
		return true;
	case AID_NAVMODE4:
		ToggleNavmode(NAVMODE_RETROGRADE);
		return true;
	case AID_NAVMODE5:
		ToggleNavmode(NAVMODE_NORMAL);
		return true;
	case AID_NAVMODE6:
		ToggleNavmode(NAVMODE_ANTINORMAL);
		return true;
	case AID_NAVMODE7:
		ToggleNavmode(NAVMODE_HOLDALT);
		return true;

	}
	return false;
}


Trying to get it to work in the main project.
 
Back
Top