Frum Roll Posted February 13, 2009 Report Share Posted February 13, 2009 Hello, I'm trying to find a better way of hiding the destination miles left/eta/mph box in the lower left hand corner when there isn't a route present. For most of you the current solution seems to be keeping the original box off screen and then setting up your own in the corner with pre inputted variables. It's a clever solution, but I'd like to be able to keep the ability to change those variables from the navigation menu. I currently have this working, however it isn't perfected. I have added the following code to the navigatemap_800_480.ui file. This by itself caused the graphics to disappear but not the data, I was still seeing 0's even though there wasn't a trip planned. Then I found a post by Stephanie in the blue boxes thread about scripts in the common folder overwriting data in the 800_480 folder so I took a look and found this in navigatemap.ui It seemed to be the code for removing the numbers during fullscreencockpit mode, so I tried changing it to this. And it worked as I expected, only problem is I disabled it from turning off during the fullscreencockpit mode, does anyone know how to implement an or statement such as. Quote Link to post Share on other sites
skicrave Posted February 13, 2009 Report Share Posted February 13, 2009 It's not as elegant, but just run the code twice: Quote Link to post Share on other sites
skicrave Posted February 13, 2009 Report Share Posted February 13, 2009 So after posting my reply I actual read your post and realized that's not going to do what you want. You definitely need an or operator to accomplish that. Perhaps our friendly neighborhood coder Boris will be able to chime in with the correct syntax? Quote Link to post Share on other sites
Frum Roll Posted February 13, 2009 Author Report Share Posted February 13, 2009 So after posting my reply I actual read your post and realized that's not going to do what you want. You definitely need an or operator to accomplish that. Perhaps our friendly neighborhood coder Boris will be able to chime in with the correct syntax? Thanks for trying, I actually tried that once as well. Loaded it up found out it didn't work and then realized that the second else run was turning the numbers back on. Quote Link to post Share on other sites
skicrave Posted February 13, 2009 Report Share Posted February 13, 2009 Exactly. I haven't seen the or operator anywhere else in the code, but I would bet it's used somewhere. Many languages use the pipes (|, it's above the enter key on your keyboard) as the or operator (either a single or double), so maybe give that a try. Quote Link to post Share on other sites
BorisM Posted February 13, 2009 Report Share Posted February 13, 2009 & - And | - Or ! - Not. So you could either bypass a script and od a visiblemodel = '!vValidRoute&!vFullScreenCockpit' or do something similar in the script. Quote Link to post Share on other sites
Frum Roll Posted February 13, 2009 Author Report Share Posted February 13, 2009 & - And| - Or ! - Not. So you could either bypass a script and od a visiblemodel = '!vValidRoute&!vFullScreenCockpit' or do something similar in the script. Thanks for the update, I'm pretty sure I understand what you're saying and I'll give it a go. However if | is or any idea why this didn't work though. I tried it and it hung on startup, same with || as skicrave suggested. Quote Link to post Share on other sites
BorisM Posted February 13, 2009 Report Share Posted February 13, 2009 Because this does not make a correct expression for the FFUI script language. Try runif !vvalidroute&vFullScreenCockpit Quote Link to post Share on other sites
Frum Roll Posted February 13, 2009 Author Report Share Posted February 13, 2009 Because this does not make a correct expression for the FFUI script language. Try runif !vvalidroute&vFullScreenCockpit I'll try it when I get home, but considering I want it to do it when either is true, not necessarily both should I try runif !vvalidrout|vFullScreenCockpit? Quote Link to post Share on other sites
BorisM Posted February 13, 2009 Report Share Posted February 13, 2009 I'll try it when I get home, but considering I want it to do it when either is true, not necessarily both should I try runif !vvalidrout|vFullScreenCockpit? !vValidRoute|vFullScreenCockpit = (not ValidRoute) OR (FullScreen Cockpit) so this will be true if eithr you have no valid route or full screen cockpit is turned on. Or both. Yes, this is probably what you want. Quote Link to post Share on other sites
Frum Roll Posted February 14, 2009 Author Report Share Posted February 14, 2009 No luck yet. I tried and it hung up on startup, same as before. Quote Link to post Share on other sites
Frum Roll Posted February 14, 2009 Author Report Share Posted February 14, 2009 Well I finally came up with a solution, although I do wish I could get the or statement to work. This change to navigatemap.ui combined with the changes to navigatemap_800_480.ui in my first post will disable the box in the lower left when no route is present. Quote Link to post Share on other sites
BorisM Posted February 14, 2009 Report Share Posted February 14, 2009 No luck yet. I tried and it hung up on startup, same as before. Aha... searching through more skin code,it looks like you only do expressions in models,but not in runif conditions. So something like this might work instead (makes for a bit cleaner code) vTmp.boolmodel "!vValidRoute|vFullScreenCockpit" ;; Track route and cockpit values vtmp.dropmodel ;; But we don't need to keep tracking them, so drop model after we got the current value runif vtmp 0 sc_HideMyScreenElementsOrSomething Quote Link to post Share on other sites
Frum Roll Posted February 16, 2009 Author Report Share Posted February 16, 2009 Aha... searching through more skin code,it looks like you only do expressions in models,but not in runif conditions. So something like this might work instead (makes for a bit cleaner code) vTmp.boolmodel "!vValidRoute|vFullScreenCockpit" ;; Track route and cockpit values vtmp.dropmodel ;; But we don't need to keep tracking them, so drop model after we got the current value runif vtmp 0 sc_HideMyScreenElementsOrSomething Interesting, I may have to try and implement that, although I'm pretty happy with functionality at the moment. After testing today I found one small hiccup that I need to fix, the 0's come back after a route ends on it's own. For example I had a route up to get to work, when I arrived at my destination the images turned off but the 0's stayed on the screen until i hit the menu, then the map button. I just need to find a way to rerun the script if you reach a destination. Quote Link to post Share on other sites
Frum Roll Posted February 16, 2009 Author Report Share Posted February 16, 2009 Just thought I'd give people an update, I've got this mod working 100% now. I've done quite a bit of testing and can't find any situations where it doesn't work as designed. I thought I'd give a rundown of all the changes if anyone wants to implement it into there data.zip. First I edited navigatemap_800_480.ui As you can see I added the navigation.distance_to_manuver.valid variable to the visiblemodel, for the above text and sprites. Next I edited navigatemap.ui I created a new script called sc_frhideri. It's pretty straight forward, I also tacked on the GPS y value to move the icon up or down depending on whether the route info box is present. Depending on where your GPS icon is you may or may not want to use that last bit of code. Next I had to call the script. I did this in a couple of places, twice in navigatemap.ui As you can see I once again added my gps y values to sc_FullScreen. I also called for the script sc_frhideri once more in advmenu.ai With these modifications to your data.zip file the route info box will disappear from the screen unless a route is present, and you still maintain the ability to change what can be seen in the box via the navigation settings menu. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.