From 26f7e0a200471465498221b320f0418a3eb5f5f1 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Sun, 14 Jan 2018 17:34:36 +0100 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- src/plugins/HPMHooking/HPMHooking.Defs.inc | 2 ++ .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 26 ++++++++++++++++++++++ 4 files changed, 33 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 02a0082d3..db578e59f 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1188,6 +1188,8 @@ typedef void (*HPMHOOK_pre_clif_progressbar) (struct map_session_data **sd, unsi typedef void (*HPMHOOK_post_clif_progressbar) (struct map_session_data *sd, unsigned int color, unsigned int second); typedef void (*HPMHOOK_pre_clif_progressbar_abort) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_progressbar_abort) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_progressbar_unit) (struct block_list **bl, uint32 *color, uint32 *time); +typedef void (*HPMHOOK_post_clif_progressbar_unit) (struct block_list *bl, uint32 color, uint32 time); typedef void (*HPMHOOK_pre_clif_showdigit) (struct map_session_data **sd, unsigned char *type, int *value); typedef void (*HPMHOOK_post_clif_showdigit) (struct map_session_data *sd, unsigned char type, int value); typedef int (*HPMHOOK_pre_clif_elementalconverter_list) (struct map_session_data **sd); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 7a482a669..f057b34d8 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -824,6 +824,8 @@ struct { struct HPMHookPoint *HP_clif_progressbar_post; struct HPMHookPoint *HP_clif_progressbar_abort_pre; struct HPMHookPoint *HP_clif_progressbar_abort_post; + struct HPMHookPoint *HP_clif_progressbar_unit_pre; + struct HPMHookPoint *HP_clif_progressbar_unit_post; struct HPMHookPoint *HP_clif_showdigit_pre; struct HPMHookPoint *HP_clif_showdigit_post; struct HPMHookPoint *HP_clif_elementalconverter_list_pre; @@ -7031,6 +7033,8 @@ struct { int HP_clif_progressbar_post; int HP_clif_progressbar_abort_pre; int HP_clif_progressbar_abort_post; + int HP_clif_progressbar_unit_pre; + int HP_clif_progressbar_unit_post; int HP_clif_showdigit_pre; int HP_clif_showdigit_post; int HP_clif_elementalconverter_list_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 3ba6a3f5b..6a27f3d94 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -434,6 +434,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->font, HP_clif_font) }, { HP_POP(clif->progressbar, HP_clif_progressbar) }, { HP_POP(clif->progressbar_abort, HP_clif_progressbar_abort) }, + { HP_POP(clif->progressbar_unit, HP_clif_progressbar_unit) }, { HP_POP(clif->showdigit, HP_clif_showdigit) }, { HP_POP(clif->elementalconverter_list, HP_clif_elementalconverter_list) }, { HP_POP(clif->spellbook_list, HP_clif_spellbook_list) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 402e57256..5b0ae00a7 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -10706,6 +10706,32 @@ void HP_clif_progressbar_abort(struct map_session_data *sd) { } return; } +void HP_clif_progressbar_unit(struct block_list *bl, uint32 color, uint32 time) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_progressbar_unit_pre > 0) { + void (*preHookFunc) (struct block_list **bl, uint32 *color, uint32 *time); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_unit_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_progressbar_unit_pre[hIndex].func; + preHookFunc(&bl, &color, &time); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.progressbar_unit(bl, color, time); + } + if (HPMHooks.count.HP_clif_progressbar_unit_post > 0) { + void (*postHookFunc) (struct block_list *bl, uint32 color, uint32 time); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_unit_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_progressbar_unit_post[hIndex].func; + postHookFunc(bl, color, time); + } + } + return; +} void HP_clif_showdigit(struct map_session_data *sd, unsigned char type, int value) { int hIndex = 0; if (HPMHooks.count.HP_clif_showdigit_pre > 0) { -- cgit v1.2.3-70-g09d2