Search Archive

Can I use compass button to switch 2D & 3D?

By Sylfest_S · Apr 15, 2009in Hacks/Mods💬 11 posts👁️ 1,229 views
Posted Apr 15, 2009 · 20:33 UTC#1

Does anyone know how to script the compass button to be the button that switches between 2D and 3D? What I am trying to do is to have a linear compass in 3d, and a circular compass in 2D, and use the button (s) to switch between the two modes. Then of course also remove the other button. Any help would be appreciated.

Posted Apr 15, 2009 · 20:54 UTC#2

it would be a long process bro, tried checking it out and you would have to go through several ui's and change a couple codes to get this done, i'll try to figure it out when i get a chance

Posted Apr 16, 2009 · 15:06 UTC#3

IDT, you've done a lot more than I have with the AVIC stuff, so I don't want to doubt you... But is this more complicated than it initially sounds because you would have to add some code or variable to tell the AVIC which mode it is currently in?

 

Or couldn't you just replace the 2d/3d buttons with the compass background and then move the needle to retain the functionality of the compass?

 

DISCLAIMER: I AM NOT A PROGRAMMER AND I HAVE NOT TESTED THIS CODE. DO *NOT* PUT THIS INTO YOUR AVIC AND COME TO ME WHEN IT DOESN'T WORK!!

 

Replace:


 

With:


 

And then move the needle to lay over the location of the new compass_bg.bmp by changing the x&y on the following row:


 

And then comment out the original location of compass_bg.bmp... Wouldn't this do it? (you could also move the stuff around by changing x&y to wherever you want... the examples above just move the compass to the original location of the 2d/3d buttons)

Posted Apr 16, 2009 · 15:19 UTC#4
IDT, you've done a lot more than I have with the AVIC stuff, so I don't want to doubt you... But is this more complicated than it initially sounds because you would have to add some code or variable to tell the AVIC which mode it is currently in?

 

Or couldn't you just replace the 2d/3d buttons with the compass background and then move the needle to retain the functionality of the compass?

 

DISCLAIMER: I AM NOT A PROGRAMMER AND I HAVE NOT TESTED THIS CODE. DO *NOT* PUT THIS INTO YOUR AVIC AND COME TO ME WHEN IT DOESN'T WORK!!

 

Replace:


 

With:


 

And then move the needle to lay over the location of the new compass_bg.bmp by changing the x&y on the following row:


 

And then comment out the original location of compass_bg.bmp... Wouldn't this do it?

 

he could try that, but it might not work

Posted Apr 16, 2009 · 16:18 UTC#5
he could try that, but it might not work

I know! But I posted the stuff here for you to check out... do you see any problems with it right away? The only thing I can think of right now is that the new location of the compass might be a little too far to the left... The .bmp for the compass is smaller than the 2d/3d buttons, but I just quickly used the x&y coordinates from the 2d/3d buttons to put this out real quick... I can't even remember what my screen LOOKED LIKE with the compass in the original location...

 

What is your opinion on why it might not work?

Posted Apr 18, 2009 · 23:00 UTC#6

I think you're making this too complicated, you can do some really cool stuff with navigatemap.ui give the two compass' different names then just make a .hide and .show in the respective 2d/3d scripts.



Then just change the onrelease for each one, to the original 2d/3d onrelease, and comment out the original button.

Posted Apr 19, 2009 · 01:45 UTC#7

I was actually planning on using two different compasses so having the same icon will not be a problem. Actually, since 2D is North up only, I will probably just make that an icon that doesn't change, and use the linear compass for 3D. Ill give the code a try and I'll let you know what happens.

 

Thanks for your input.

Posted Apr 20, 2009 · 01:05 UTC#8

I tested it out and it works quite well. I followed all your advice and this is what I did.

 

In navigatemap_800_480.ui I combined the 2d\3d & linear compass code to:

 

;<>
<


<

 

and in the navigatemap.ui (I am only posting the code that I changed so please don't replace all the code under the headings)

 


 

When you are on the 3d screen you have the linear compass, and when you press it it changes to 2d mode where you have an icon that looks like a compass (its just an image since 2d is north up only anyway). It works pretty well and I have not run into any problems so far. I will post if I run into any problems.

 

I did notice however, that even though I set the coordinates for the Map confirmation button (usually the 3rd button down) to go into the spot where the 2d\3d button usually is, it still moves it down to where it usually is. I don't know why yet.

 

Thanks for all the input guys and girls.

Posted Apr 20, 2009 · 01:25 UTC#9

 

I did notice however, that even though I set the coordinates for the Map confirmation button (usually the 3rd button down) to go into the spot where the 2d\3d button usually is, it still moves it down to where it usually is. I don't know why yet.

 

 

you have to search for btnNMB_Cursor and btnNMB_Pos in other ui files and change the y values as well

Posted Apr 20, 2009 · 14:58 UTC#10

 

I did notice however, that even though I set the coordinates for the Map confirmation button (usually the 3rd button down) to go into the spot where the 2d\3d button usually is, it still moves it down to where it usually is. I don't know why yet.

 

 

you have to search for btnNMB_Cursor and btnNMB_Pos in other ui files and change the y values as well

 

Thanks. Do you happen to know the other ui files that I need to change. I guess I could always so a search for files containing the words, but if you happen to know what files, that would be even easier.

Posted Apr 20, 2009 · 15:03 UTC#11

 

I did notice however, that even though I set the coordinates for the Map confirmation button (usually the 3rd button down) to go into the spot where the 2d\3d button usually is, it still moves it down to where it usually is. I don't know why yet.

 

 

you have to search for btnNMB_Cursor and btnNMB_Pos in other ui files and change the y values as well

 

Thanks. Do you happen to know the other ui files that I need to change. I guess I could always so a search for files containing the words, but if you happen to know what files, that would be even easier.

 

I believe it's referenced a couple times in the setting.ui file.