
There are now five new HUD selectors. The first,
drawSurround:, is the obvious generalisation of drawYellowSurround: and drawGreenSurround: - it draws a surround, and looks at the color attribute to see what colour it should be.The other four allow OXPers a lot more flexibility with their HUDs.
*
drawCustomBar: (bar indicator, number 0..1)*
drawCustomIndicator: ("roll/pitch" style indicator, number -1..1)*
drawCustomLight: ("status light" style indicator, colour specifier)*
drawCustomText: (variable text display, string)Each of these has a "
data_source" attribute which contains the name of a custom HUD data key, and then you use player.ship.setCustomHUDDial(key, value) to set the current value of the dial.The picture above has four
drawCustomBar: dials being fed the four laser temperature values. Here's the hud.plist entry for one of them
Code: Select all
{ // weapon temperature bar
height = 4;
selector = "drawCustomBar:";
width = 60;
x = 0;
y = 40;
color_high = "redColor";
color_medium = "yellowColor";
color_low = "greenColor";
data_source = "local_weaponForward";
viewscreen_only = 1;
},Code: Select all
this.$fcb = addFrameCallback(function() {
if (!player.ship.docked)
{
player.ship.setCustomHUDDial("local_weaponForward",player.ship.laserHeatLevelForward);
player.ship.setCustomHUDDial("local_weaponAft",player.ship.laserHeatLevelAft);
player.ship.setCustomHUDDial("local_weaponPort",player.ship.laserHeatLevelPort);
player.ship.setCustomHUDDial("local_weaponStarboard",player.ship.laserHeatLevelStarboard);
}
});viewscreen_only" boolean attribute which can be applied to any HUD dial or legend. If it's true, it hides the HUD dial if a GUI screen is being displayed, which should again reduce the need for switching HUDs using JS to stop dials outside the traditional HUD region being overlaid on GUI text.


