8 Commits
Author SHA1 Message Date
Goober5000andClaude Fable 5.1 37b0b6ea82 Standardize isValid across the Lua API by making the types auto-generate it (#7761)
* Automatically generate the isValid() Lua API function for handle types

If an ADE object's stored type has an isValid() member, ade_obj now registers an isValid function for it automatically.  An explicit ADE_FUNC(isValid, ...) declared after the ADE_OBJ replaces the generated one, so types with special semantics (e.g. sound) keep their own.  The 67 hand-written functions that merely delegated to the member are removed, and 26 types that previously exposed no isValid() gain one.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* Add ADE_OBJ_VALIDATOR for index-based Lua handles

Int-index handles (shipclass, weaponclass, team, etc.) can now declare their validity predicate with a single ADE_OBJ_VALIDATOR or ADE_OBJ_VALIDATOR_RANGE line after the ADE_OBJ.  The registered validator drives the generated isValid() function and is also honored by ade_set_args when the mod table asks for nil instead of invalid objects, which previously never applied to these handles.  The 19 hand-written range-check functions are replaced, and loadout_ship, default_primary, default_secondary, and support_rearm_pool_team gain isValid().  Add a validator to HudGauge while we're at it.

Also fully qualify the scripting namespace in LuaConvert.h so its templates can be instantiated from the unit tests.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-09-08 10:50:53 -04:00
Mike Nelson 44952eb2d6 Fix some minor hud config color errors (#6881) 2025-07-30 14:03:34 -04:00
Mike Nelson f1f95717d1 Support Custom Gauges in HUD Config UI (#6670)
* Support coloring custom gauges

* remove NULL
2025-05-14 13:18:03 -04:00
Goober5000 d7796b3767 coverity: use references to avoid unnecessary copies 2025-05-10 01:15:46 -04:00
Mike Nelson 1f7903fb23 add a few hud lua methods (#6692) 2025-05-08 09:33:21 -04:00
Mike Nelson 1a503faa6b Better color preset handling (#6655) 2025-04-06 11:09:43 -04:00
Mike Nelson 60777154be Hud config upgrades (#6581)
* base working version

* localization and minor tweaks

* add retail UI controls

* Add way to hide gauges from Config view

* convert hud config from index matching to id matching

* clang
2025-03-22 22:47:38 -04:00
Mike Nelson 108def6224 Scpui Hud Config API (#5302)
* initial API for hud config elements

* get rendering, highlighting, and selecting working

* Add a way to create color objects

* some cleanup and fixes

* go away we dont need you

* allow arbitrarily scaling the hud config draw

* last few config options and innitial preset handling

* vectorize hud presets and setup handling

* some last minute fixes

* iiiiiiiiiiiiiiiiiiiiiiint

* really

* documentation and address feedback

* completely revert this as well

* more documentation

* document all the things

* comment out unused parameter

* peach emoji retentive

* whatever

* return types

* color
2023-04-16 08:13:06 -04:00