Files
fs2open.github.com/code/scripting/global_hooks.h
T
Mike NelsonandAsteroth 070a8e18fa Adds Props as a new object type (#6836)
* First draft of prop object type

* Add prop editor dialog in FRED

* prop sexps

* lua table prop support

* lab support

* lua mission access to props

* prop collision support

* use std::optional so the object->instance id is always valid

* allow props to block suns

* minor cleanup and remove arbitrary limit. Still limited to 500 objects.

* Sort props by category

* cleanup

* implement collision hooks

* parse prop flags and further ensure props are inited and closed correctly

* Add Cyborg's multi suggestions

* fix missing header

* add props to empty slots if available

* add multi signature

* fix rebase issues and match collisions to the new multithread style

* appease Clang the Conquerer

* save/parse mission prop classes by name

* Clean up comments and finish TODOs

* fix string errors

* clang wants this to be static now

* address feedback

* address feedback

* Use model num from prop info instead

* merge prop and ship collision group sexps together

* fix rebase bug

* address feedback

* fix name shadowing

* ship heavy submodel

* clang

---------

Co-authored-by: Asteroth <[email protected]>
2026-02-16 14:41:34 +01:00

107 lines
5.8 KiB
C++

#include "hook_api.h"
#include "scripting/hook_conditions.h"
namespace scripting {
namespace hooks {
extern const std::shared_ptr<Hook<>> OnGameInit;
extern const std::shared_ptr<Hook<>> OnSplashEnd;
extern const std::shared_ptr<OverridableHook<>> OnIntroAboutToPlay;
extern const std::shared_ptr<OverridableHook<>> OnMovieAboutToPlay;
extern const std::shared_ptr<Hook<>> OnOptionsTabChanged;
extern const std::shared_ptr<Hook<>> OnOptionsMenuClosed;
extern const std::shared_ptr<Hook<>> OnHUDConfigMenuClosed;
extern const std::shared_ptr<Hook<>> OnControlConfigMenuClosed;
//The On State Start hook previously used to pass OldState to the conditions, but no semantically sensible condition read the value, so we pretend it has no local condition
extern const std::shared_ptr<OverridableHook<>> OnStateStart;
extern const std::shared_ptr<Hook<>> OnLoadScreen;
extern const std::shared_ptr<Hook<>> OnLoadComplete;
extern const std::shared_ptr<Hook<>> OnCampaignMissionAccept;
extern const std::shared_ptr<Hook<>> OnBriefStage;
extern const std::shared_ptr<Hook<>> OnMissionStart;
extern const std::shared_ptr<Hook<>> OnGameplayStart;
extern const std::shared_ptr<Hook<ControlActionConditions>> OnAction;
extern const std::shared_ptr<Hook<ControlActionConditions>> OnActionStopped;
extern const std::shared_ptr<OverridableHook<KeyPressConditions>> OnKeyPressed;
extern const std::shared_ptr<Hook<KeyPressConditions>> OnKeyReleased;
extern const std::shared_ptr<Hook<>> OnMouseMoved;
extern const std::shared_ptr<Hook<>> OnMousePressed;
extern const std::shared_ptr<Hook<>> OnMouseReleased;
extern const std::shared_ptr<Hook<ShipSourceConditions>> OnAfterburnerStart;
extern const std::shared_ptr<Hook<ShipSourceConditions>> OnAfterburnerEnd;
extern const std::shared_ptr<Hook<ShipSourceConditions>> OnWaypointsDone;
extern const std::shared_ptr<Hook<ShipSourceConditions>> OnGoalsCleared;
extern const std::shared_ptr<Hook<ShipSourceConditions>> OnDebrisCreated;
extern const std::shared_ptr<Hook<>> OnAsteroidCreated;
extern const std::shared_ptr<OverridableHook<CollisionConditions>> OnShipCollision;
extern const std::shared_ptr<OverridableHook<CollisionConditions>> OnPropCollision;
extern const std::shared_ptr<OverridableHook<CollisionConditions>> OnWeaponCollision;
extern const std::shared_ptr<OverridableHook<CollisionConditions>> OnBeamCollision;
extern const std::shared_ptr<OverridableHook<CollisionConditions>> OnDebrisCollision;
extern const std::shared_ptr<OverridableHook<CollisionConditions>> OnAsteroidCollision;
extern const std::shared_ptr<Hook<ShipArriveConditions>> OnShipArrive;
extern const std::shared_ptr<Hook<WeaponCreatedConditions>> OnWeaponCreated;
extern const std::shared_ptr<Hook<ShipDeathConditions>> OnShipDeathStarted;
extern const std::shared_ptr<OverridableHook<ShipDeathConditions>> OnShipDeath;
extern const std::shared_ptr<Hook<WeaponDeathConditions>> OnMissileDeathStarted;
extern const std::shared_ptr<Hook<WeaponDeathConditions>> OnMissileDeath;
extern const std::shared_ptr<Hook<>> OnBeamDeath;
extern const std::shared_ptr<Hook<>> OnAsteroidDeath;
extern const std::shared_ptr<Hook<>> OnDebrisDeath;
extern const std::shared_ptr<Hook<SubsystemDeathConditions>> OnSubsystemDestroyed;
extern const std::shared_ptr<Hook<ShipDepartConditions>> OnShipDepart;
extern const std::shared_ptr<Hook<WeaponDeathConditions>> OnWeaponDelete;
extern const std::shared_ptr<Hook<WeaponEquippedConditions>> OnWeaponEquipped;
extern const std::shared_ptr<Hook<WeaponUsedConditions>> OnWeaponFired;
extern const std::shared_ptr<Hook<WeaponUsedConditions>> OnPrimaryFired;
extern const std::shared_ptr<Hook<WeaponUsedConditions>> OnSecondaryFired;
extern const std::shared_ptr<Hook<WeaponSelectedConditions>> OnWeaponSelected;
extern const std::shared_ptr<Hook<WeaponDeselectedConditions>> OnWeaponDeselected;
extern const std::shared_ptr<Hook<WeaponUsedConditions>> OnTurretFired;
extern const std::shared_ptr<Hook<WeaponUsedConditions>> OnBeamWarmup;
extern const std::shared_ptr<Hook<WeaponUsedConditions>> OnBeamFired;
extern const std::shared_ptr<Hook<WeaponUsedConditions>> OnBeamWarmdown;
extern const std::shared_ptr<OverridableHook<>> OnHudCommMenuOpened;
extern const std::shared_ptr<OverridableHook<>> OnHudCommMenuClosed;
extern const std::shared_ptr<OverridableHook<CommOrderConditions>> OnHudCommOrderIssued;
extern const std::shared_ptr<OverridableHook<ObjectDrawConditions>> OnHudDraw;
extern const std::shared_ptr<OverridableHook<ObjectDrawConditions>> OnObjectRender;
extern const std::shared_ptr<Hook<>> OnSimulation;
extern const std::shared_ptr<OverridableHook<>> OnDialogInit;
extern const std::shared_ptr<OverridableHook<>> OnDialogFrame;
extern const std::shared_ptr<Hook<>> OnDialogClose;
extern const std::shared_ptr<Hook<>> OnCheat;
extern const std::shared_ptr<OverridableHook<>> OnMissionGoalStatusChanged;
extern const std::shared_ptr<Hook<>> OnMissionAboutToEndHook;
extern const std::shared_ptr<OverridableHook<>> OnMissionEndHook;
extern const std::shared_ptr<Hook<>> OnStateAboutToEndHook;
extern const std::shared_ptr<OverridableHook<>> OnStateEndHook;
extern const std::shared_ptr<Hook<>> OnCameraSetUpHook;
// FRED Hooks
extern const std::shared_ptr<Hook<>> FredOnMissionLoad;
extern const std::shared_ptr<Hook<>> FredOnMissionSpecsSave;
// deprecated
extern const std::shared_ptr<OverridableHook<>> OnSplashScreen;
extern const std::shared_ptr<OverridableHook<ObjectDeathConditions>> OnDeath;
}
} // namespace scripting