refactor: Cleanup develhook logic

> refactor hooks::devel to work better with hooks::wmisc
> minor naming consistency changes
This commit is contained in:
[ ]
2025-12-17 00:00:40 +09:00
parent 7f63b77ab3
commit 56e8e7456b
6 changed files with 253 additions and 205 deletions
+14 -9
View File
@@ -1,20 +1,25 @@
#pragma once
#include <cstdint>
#include "util/utils.h"
namespace hooks::devel
{
//_INFO: order matters, low level routines first (if you want them active during later routines)
enum devel_routine : uint32_t
//_INFO: use attach()/entry_main() to run task before game::attach()/game::entry_main()
class Routine
{
avs_fs_detour = 0,
sndb_test,
thum_test,
devel_routine_last
private:
unsigned int hash_;
public:
[[nodiscard]] inline unsigned int constexpr hash() const { return hash_; }
virtual void attach() {}
virtual void entry_main() {}
explicit Routine(const char *name) : hash_(to_hash(name)) {}
virtual ~Routine() = default;
};
typedef uint32_t devel_routine_t;
bool active_routine(devel_routine_t val);
void bind_routine(devel_routine_t val, void (*cb)());
Routine *active_routine(const char *name);
void bind_routine(Routine *routine);
void attach();
void entry_main();
}