Scripting features involving the new HUD specification are planned. The plan would be to perhaps have the Custom gauge HUD object type have a Script: field which a user can define a Lua function or source file that will provide additional logic for a more dynamic user-defined gauge with access to the HudGauge class methods so the script writer won't have to worry about the various transformations that FS2 does (TrackIR, afterburner shakes, screen position)
In any case, would it really bother anyone if we change the behavior of On HUD Draw to not disable the HUD? If someone really wants to completely replace the HUD with this new HUD spec, they can just set Load Retail Configuration to No in hud_gauges.tbl and not define any gauges.
i kinda think it should still use the existing overrides and toggles. one way to toggle the hud is to use hu.HUDDrawn, this allows you to turn the hud on and off say, if youre using a camera view. unfortunately it doesnt give you control over when the hud is rendered, and i assume it runs immediately after scene render. the other is with the +override: tag in the scripting.tbl. i think if the existing features remain functional that should be satisfactory, and should allow for complete hud replacement.
So, should we create a new hook then? Something called With HUD Draw?
Custom gauges already have a "Gauge Type" field. If you want to hypothetically replace the weapons gauge, you'd define a Custom gauge in hud_gauges.tbl with Gauge Type: WEAPONS_GAUGE and Script: hud_new_weapons.lua or something like that.
That's the best I can think of a scripting interface that plays nice with the new HUD spec.
id make available an array of hud gauges available to scripting (much how ships or weapons would work). you could iterate through gauges, or pull one up by name, and each one would have all the relevant parameters associated with that gauge, size, position, etc, including the ability to turn it on or off, render it, and so on. this could be used in the embedded script, or in your usual scripting files. it would be the most convenient and familiar way to go about it.