diff options
author | Hercules.ws <dev@herc.ws> | 2020-06-28 04:20:44 +0200 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2020-06-28 04:20:44 +0200 |
commit | 812e02662acf62fd568cfeae4a29d4602f45833b (patch) | |
tree | 172c68b24bd09ab8895d1d22edc8ca32b4b3d85a | |
parent | 6865e6da70d8d44a9c92c2b922da4444a09f7ac3 (diff) | |
download | hercules-812e02662acf62fd568cfeae4a29d4602f45833b.tar.gz hercules-812e02662acf62fd568cfeae4a29d4602f45833b.tar.bz2 hercules-812e02662acf62fd568cfeae4a29d4602f45833b.tar.xz hercules-812e02662acf62fd568cfeae4a29d4602f45833b.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
4 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index f8f760b48..60c00e8db 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -2674,6 +2674,8 @@ typedef time_t (*HPMHOOK_pre_clif_attendance_getendtime) (void); typedef time_t (*HPMHOOK_post_clif_attendance_getendtime) (time_t retVal___); typedef void (*HPMHOOK_pre_clif_pOpenUIRequest) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pOpenUIRequest) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_open_ui_send) (struct map_session_data **sd, enum zc_ui_types *ui_type); +typedef void (*HPMHOOK_post_clif_open_ui_send) (struct map_session_data *sd, enum zc_ui_types ui_type); typedef void (*HPMHOOK_pre_clif_open_ui) (struct map_session_data **sd, enum cz_ui_types *uiType); typedef void (*HPMHOOK_post_clif_open_ui) (struct map_session_data *sd, enum cz_ui_types uiType); typedef void (*HPMHOOK_pre_clif_pAttendanceRewardRequest) (int *fd, struct map_session_data **sd); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index acd65174c..62d2327da 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2264,6 +2264,8 @@ struct { struct HPMHookPoint *HP_clif_attendance_getendtime_post; struct HPMHookPoint *HP_clif_pOpenUIRequest_pre; struct HPMHookPoint *HP_clif_pOpenUIRequest_post; + struct HPMHookPoint *HP_clif_open_ui_send_pre; + struct HPMHookPoint *HP_clif_open_ui_send_post; struct HPMHookPoint *HP_clif_open_ui_pre; struct HPMHookPoint *HP_clif_open_ui_post; struct HPMHookPoint *HP_clif_pAttendanceRewardRequest_pre; @@ -9301,6 +9303,8 @@ struct { int HP_clif_attendance_getendtime_post; int HP_clif_pOpenUIRequest_pre; int HP_clif_pOpenUIRequest_post; + int HP_clif_open_ui_send_pre; + int HP_clif_open_ui_send_post; int HP_clif_open_ui_pre; int HP_clif_open_ui_post; int HP_clif_pAttendanceRewardRequest_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 4cd13c366..34f968c12 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1156,6 +1156,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->attendance_timediff, HP_clif_attendance_timediff) }, { HP_POP(clif->attendance_getendtime, HP_clif_attendance_getendtime) }, { HP_POP(clif->pOpenUIRequest, HP_clif_pOpenUIRequest) }, + { HP_POP(clif->open_ui_send, HP_clif_open_ui_send) }, { HP_POP(clif->open_ui, HP_clif_open_ui) }, { HP_POP(clif->pAttendanceRewardRequest, HP_clif_pAttendanceRewardRequest) }, { HP_POP(clif->ui_action, HP_clif_ui_action) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 5440d9f2a..8cb425011 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -29508,6 +29508,32 @@ void HP_clif_pOpenUIRequest(int fd, struct map_session_data *sd) { } return; } +void HP_clif_open_ui_send(struct map_session_data *sd, enum zc_ui_types ui_type) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_open_ui_send_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, enum zc_ui_types *ui_type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_open_ui_send_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_open_ui_send_pre[hIndex].func; + preHookFunc(&sd, &ui_type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.open_ui_send(sd, ui_type); + } + if (HPMHooks.count.HP_clif_open_ui_send_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, enum zc_ui_types ui_type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_open_ui_send_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_open_ui_send_post[hIndex].func; + postHookFunc(sd, ui_type); + } + } + return; +} void HP_clif_open_ui(struct map_session_data *sd, enum cz_ui_types uiType) { int hIndex = 0; if (HPMHooks.count.HP_clif_open_ui_pre > 0) { |