Files
fs2open.github.com/code/scripting/global_hooks.h
T
Kiloku 4106176aab Cheat framework allowing for custom cheats, sexp for cheat used and On Cheat lua hook (#4387)
* Add SpawnShipCheat and convert Bravos spawning to it

* Clean-up and add canUseCheat() check

* Move some stuff to parent CustomCheat class

* Add cheat-used SEXP and On Cheat scripting hook

* Add cheat tbls and tbms, fix custom cheat detection, move cheat hooks to global hooks

* Add a default virtual destructor to CustomCheats for its derived classes to use

* Initialize buffers with memset so clang will calm down, also move cheat check a bit to keep old cheats

* Attempt to appease MSVC

* Clean-up and formatting

* Ensure custom cheats fit in the cheat code buffer

* Fix a merge mistake

* Move pre-set cheat to embedded cheats table

* Use appropriate types for stuff_string

* Remove unnecessary copying of the cheat buffer

* Explicit nullchecking

* Avoid copying values for initializing CustomCheat

* move cheat checking function to cheats_table.h, fix a typo

* Clarify OP_USED_CHEAT sexp description

* Remove unnecessary casting

* Use list initalization for Ship Cheats

* Move a few method definitions from the .h to .cpp

* Change buffer to const char*
2022-11-29 01:30:54 +09:00

30 lines
951 B
C++

#include "hook_api.h"
namespace scripting {
namespace hooks {
extern const std::shared_ptr<Hook> OnGameInit;
extern const std::shared_ptr<Hook> OnDebrisCreated;
extern const std::shared_ptr<OverridableHook> OnShipCollision;
extern const std::shared_ptr<Hook> OnShipDeathStarted;
extern const std::shared_ptr<OverridableHook> OnShipDeath;
extern const std::shared_ptr<Hook> OnMissileDeathStarted;
extern const std::shared_ptr<Hook> OnMissileDeath;
extern const std::shared_ptr<Hook> OnAsteroidDeath;
extern const std::shared_ptr<Hook> OnDebrisDeath;
extern const std::shared_ptr<OverridableHook> OnDialogInit;
extern const std::shared_ptr<OverridableHook> OnDialogFrame;
extern const std::shared_ptr<Hook> OnDialogClose;
// deprecated
extern const std::shared_ptr<OverridableHook> OnDeath;
extern std::shared_ptr<scripting::Hook> OnCheat;
}
} // namespace scripting