Jump to content
AVIC411.com

Trying some more coding, 2D/3D visiblemodel variable.


Recommended Posts

Hello, after figuring out my first bit of code I've decided to give it another go. This time my goal is to delete the compass from 2D mode, it hardly seems necessary considering the always north orientation of the map. Does anyone know of a variable that indicates whether we're in 2D or 3D mode? I also intend to use it to shift all the boxes on that side of the screen up one when in 2d mode.

 

EDIT: I found the 2d/3d nav buttons, but there only visiblemodel is "!ui.vFullScreenCockpit" I was expecting to find an additional one that stated only to show the 3d one in 2d mode and vice versa. Does anyone know how the system knows to show the 2d button in 3d mode and the 3d button in 2d mode?

 

EDIT 2: Looks like I found it, this was inside a script, but I'm not sure how it helps me. Maybe I'll look at trying to turn the compass into a button?


Link to post
Share on other sites
Hello, after figuring out my first bit of code I've decided to give it another go. This time my goal is to delete the compass from 2D mode, it hardly seems necessary considering the always north orientation of the map. Does anyone know of a variable that indicates whether we're in 2D or 3D mode? I also intend to use it to shift all the boxes on that side of the screen up one when in 2d mode.

 

EDIT: I found the 2d/3d nav buttons, but there only visiblemodel is "!ui.vFullScreenCockpit" I was expecting to find an additional one that stated only to show the 3d one in 2d mode and vice versa. Does anyone know how the system knows to show the 2d button in 3d mode and the 3d button in 2d mode?

 

EDIT 2: Looks like I found it, this was inside a script, but I'm not sure how it helps me. Maybe I'll look at trying to turn the compass into a button?


 

There are map.VIEW2D3D system value and map.mapmode

 

The later is easier to use as a model, as it seems to use boolean values for 3D/2D while the former is set as L"3D" or L"2D".

Link to post
Share on other sites

Any other advice? Here's what I've currently tried.




 




 

I don't really understand when the ui. is required so I tried it both ways, both versions ran but neither one removed the compass in either 2d or 3d mode. Could you please explain the ui. prefix it seems it's necessary for the vfullscreen visiblemodel variable, even though it isn't used in scripts and things.

 

EDIT: Just to make sure my theory was correct I changed the visible model to navigation.has_route and that worked, so it should be a matter of finding the right prefix. I tried other. and that was a no go, I'm about to try navigation. and see what happens.

 

EDIT 2: Still no luck with navigation. If anyone has any ideas I'd appreciate it.

Link to post
Share on other sites

Well I never did get that to work, but I think I've come up with a better solution although I haven't gotten it to work either and could use some help with the details. First I edited navigatemap.ui


Then I edited scripts_800_480.ui




I had hoped this would move the compass off the screen in the 2D map and put it back in the 3D map, but so far my unit just hangs during startup. The thing I especially like about doing it this way is if I can get it to work I can add the rest of the 720 buttons, and just change their y values depending on whether I'm in 2D or 3D.

Link to post
Share on other sites

Just a quick update, I did find a solution. Instead of making my own scripts I incorporated the commands into ones that already existed. I made these changes to navigatemap.ui to move the rest of the buttons it should be a simple matter of finding the names and changing y values.

 


Link to post
Share on other sites

Well I got it all working like I wanted, was actually fairly easy once I found a solid way to approach the problem. I simply made the following changes to navigatemap.ui along with editing the y value of the 3d button in navigatemap_800_480.ui to 80.


Of course some of the buttons had the generic name xxx so I made my own(fr_compass1, fr_navmute, etc.) I also took this knowledge, combined with my previous code(making the route info box disappear when no route valid) to move my gps icon depending on whether I have a valid route. That required adding a small bit of code to the end of the runif, else_runif, else_run strings also in navigatemap.ui


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...