Those two points in the code are where I would expect that sort of thing to happen. The first one is a calculation, the second is the HUD switch point. I've put some improvements into the code to hopefully mitigate the first one. The second one, though, is tougher. The issue appears to be relating to how Oolite handles bitmaps and images. The more images it has to keep a reference to, the more likely it's going to stutter when retrieving one, and Xenon HUD has a few. I've been meaning to dive into the source to see if there are any obvious bottlenecks when processing images, but I haven't had any luck so far.
This version hopefully makes the Hi-Contrast auto-switching process a bit better (shouldn't flicker as much, better calcs for determining when mode should be switched on). I've also added the speed and space compass distance values to the HUD, which requires the Combat MFD to be installed.
Does something tell the alert condition? I saw in the wiki that part of the crosshairs will go red on red condition, but is there something to make if clear if the alert condition is green or yellow? (apart from the MFD set, of trying to Torus)
- the components of the Space Compass are off-center in relation of each other (in the amber version at least): the backgound, the external circle, the internal circles, the roll/pitch/yall indicators (at zero)
- I find the text in green over the "Weapons systems off/online" too small, but I guess it would "collide" with the comm area to its right if bigger
- when docking, the speed dial moves to the screen border but the numeric speed value doesn't move with it (it stays near the center)
After a lot of fiddling, I think I've been able to stabilise the automatic hi-contrast switching system. So, version 3.8.7 is now the official release, and available via the download manager. Here's a list of all the changes since 3.7:
3.8.7
- Removed joystick sensitivity indicator.
- Improved calculations to determine when to auto-switch to Hi-Contrast mode.
3.8.6 (beta)
- HUD warning elements will now switch off correctly when threat/event is gone.
- Auto-switch anti-flickering time set to 1 second (down from 2 seconds).
- Combat MFD speed value no longer visible on docking HUD.
- Better alignment of space compass elements.
- Added current status text (GREEN, YELLOW, RED) to HUD.
3.8.5 (beta)
- Moved script.js to xenonhud.js (to reduce clutter in Config folder).
- Added code to prevent flickering when in auto-Hi-Contrast mode.
- Improved calculations to determine when to auto-switch to Hi-Contrast mode.
- Added some interfaces for Combat MFD values (speed, distance to space compass target).
3.8.4 (beta)
- Added selected missile name to area under missile display (Oolite 1.89 required).
- Cleaned up warning/indicators around crosshairs.
3.8.3 (beta)
- Fixed issue that was stopping the auto-Hi-Contrast mode from engaging correctly.
- Rearranged the warning indicators around the central HUD, and changed the masslock light into a similar label.
- Re-worked method for adding warning and indicator texts to the HUD.
3.8.2 (beta)
- Better alignment of MFD underlays with MFD frames.
- Further increased the distance at which checking for Hi-Contrast mode begins.
- Attempt to correct issue where MFD underlay was shown even when no MFD was in the slot.
3.8.1 (beta)
- Improved visibility of MFD's when in Hi-Contrast mode.
- Fixed issue with jump fuel required marker disappearing from fuel gauge when in Hi-Contrast mode.
- Reduced font size in comms log and message GUI panels.
- Slightly increased the distance at which checking for Hi-Contrast mode begins.
3.8 (beta)
- Added 2 additional MFD slots, making 9 in total.
- When prime-able equipment is removed (via Library Config), the Hi-Contrast mode will be automatically engaged when glare increases (Oolite 1.89 required).
- Changing the setting for removing the prime-able equipment is now being saved correctly.
- Made Library OXP a requirement for the OXP.
This had me scratching my head earlier... 'til I realised I was looking at Xenon HUD, not Xenon GUI.
That'll teach me not to read posts before I've had my morning caffeine shot!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
13:53:46.545 [script.javaScript.exception.unexpectedType] ReportJSError: oolite.oxp.phkb.XenonHUD.oxz/Scripts/xenonhud.js, line 1225.
13:53:46.563 [script.javaScript.exception.unexpectedType] ReportJSError: ***** JavaScript exception (<unidentified script>): TypeError: s.position is undefined
Also some of these:
13:37:27.054 [script.javaScript.exception.ooliteDefined] ReportJSError: oolite.oxp.phkb.XenonHUD.oxz/Scripts/xenonhud.js, line 1228.
13:37:27.068 [script.javaScript.exception.ooliteDefined] ReportJSError: ***** JavaScript exception (<unidentified script>): Error: Vector3D.subtract: Could not construct vector from parameters (undefined) -- expected Vector, Entity or array of three numbers.