|
Spellforce-Spell-framework
|
Custom Campaign selection screen and launch via the vanilla pre-game flow. More...

Classes | |
| struct | SFSF_CampaignDef |
Macros | |
| #define | CAMPAIGN_PANEL_WIDTH 443 |
| #define | CAMPAIGN_NAME_Y 32 |
| #define | CAMPAIGN_NAME_H 48 |
| #define | CAMPAIGN_AUTHOR_Y 88 |
| #define | CAMPAIGN_AUTHOR_H 28 |
| #define | CAMPAIGN_DESC_Y 140 |
| #define | CAMPAIGN_DESC_H 360 |
| #define | CAMPAIGN_PLAY_X 108 |
| #define | CAMPAIGN_PLAY_Y 540 |
| #define | CAMPAIGN_PLAY_W 227 |
| #define | CAMPAIGN_PLAY_H 36 |
| #define | CAMPAIGN_DESC_WRAP 40 |
| #define | CAMPAIGN_ROW_X 108 |
| #define | CAMPAIGN_ROW_Y_START 40 |
| #define | CAMPAIGN_ROW_PITCH 36 |
| #define | CAMPAIGN_ROW_W 227 |
| #define | CAMPAIGN_ROW_H 30 |
| #define | SFSF_MAX_CAMPAIGNS 16 |
| #define | SFSF_CAMPAIGN_TYPE_BASE 3 |
| #define | SFSF_AVATAR_TYPE_BASE 8 |
| #define | SFSF_AVATAR_TYPE_MAX (SFSF_AVATAR_TYPE_BASE + SFSF_MAX_CAMPAIGNS - 1) |
Typedefs | |
| typedef LPCSTR *(__cdecl * | GetDataStorageLocation_ptr) (char **param_1, uint32_t type) |
| typedef void(__thiscall * | prepareTransition_ptr) (CAppMenu *_this, uint32_t param_1, uint32_t param_2) |
| typedef SF_GameInfo *(__thiscall * | initDefaultInfo_ptr) (SF_GameInfo *_this) |
| typedef void(__thiscall * | AC82_Zero_ptr) (AutoClass82 *_this) |
| typedef void(__thiscall * | some_vector_fun_ptr) (void *_this, uint32_t *size) |
| typedef uint32_t(__thiscall * | CMnuBaseFlagGetter_ptr) (CMnuBase *_this) |
| typedef void(__thiscall * | CUtlCallBackInit_ptr) (void *_this, void *param1, void *param2, uint32_t param3) |
| typedef void(__thiscall * | CUiGameZero_ptr) (void *_this) |
| typedef void(__thiscall * | CUiGame_009a1fd0_ptr) (void *_this, uint32_t param1) |
| typedef SF_String *(__thiscall * | AC95_get_figure_name_ptr) (void *AC95, SF_String *name_buffer, uint32_t figure_id) |
| typedef GdAvatarInternal *(__thiscall * | avatarInternalCopy_ptr) (GdAvatarInternal *dest, GdAvatarInternal *src) |
| typedef void(__thiscall * | avatarVectorsCopy_ptr) (void *dest_vectors, void *src_vectors) |
| typedef void(__thiscall * | gameInfoSetAvatarType_ptr) (SF_GameInfo *_this, uint16_t avatar_type) |
| typedef void(__thiscall * | gameInfoSetMapPathFull_ptr) (SF_GameInfo *_this, SF_String *map_path) |
| typedef void(__thiscall * | appMenuEnterCampaignFlow_ptr) (CAppMenu *_this, uint32_t param_1) |
| typedef void(__fastcall * | playCampaignIntro_ptr) (CAppMenu *_this) |
| typedef void(__thiscall * | videoSequenceStop_ptr) (SF_CUiVideoSequence *_this) |
| typedef void(__thiscall * | startGame_ptr) (CAppMenu *_this, SF_GameInfo *game_info, uint32_t param_2, uint32_t param_3, uint32_t param_4, uint32_t coord, SF_String *param_6) |
| typedef SF_String *(__thiscall * | getSavePath_real_ptr) (SF_String *_this, int campaign_type) |
| typedef char **(__cdecl * | getBasePathString_ptr) (void *out_string_obj) |
| typedef uint32_t(__cdecl * | checkFileExists_ptr) (SF_String *name) |
| The engine's file existence check, resolved by initialize_campaign_hooks(). | |
Functions | |
| void | initialize_campaign_hooks () |
| int32_t | register_campaign (const SFSF_CampaignDef *def) |
| int | isDirectoryExists (const char *path) |
| void | checkDirs (CAppSession *_this) |
| SF_String *__thiscall | getSavePath (CAppSession *_this, SF_String *output, uint32_t campaign_type) |
| uint8_t __thiscall | quickLoad_helper (SF_CUiMain *_this) |
| uint32_t __thiscall | getHdrStringID (uint32_t camp_type) |
| void __thiscall | loadQuickSave (CAppMenu *_this, uint32_t unknown) |
| void __thiscall | initFirstMap (SF_GameInfo *_this, uint32_t skip_tutorial, uint8_t skill, uint8_t subskill, uint32_t campaign_id, bool is_shadowblade) |
| Proper map selection code for the future. | |
| void | campaign_hook_on_main_menu (CAppMenu *app_menu) |
| void | stop_intro_video (CAppMenu *app_menu) |
| void | campaign_launch_flow (int32_t campaign_index) |
| void __thiscall | on_campaign_selected (CMnuSmpButton *_this) |
| Left panel row callback. | |
| void __thiscall | on_campaign_play (CMnuSmpButton *_this) |
| Play button callback - launches whatever the list has selected. | |
| void | close_campaign_screen_callback (CMnuSmpButton *button) |
| void __thiscall | show_custom_campaign_screen (CMnuSmpButton *_this) |
| Builds the campaign screen. | |
| void | initialize_preparenewgame_rewrite () |
| uint8_t __thiscall | pn_preload_get_skip_tutorial (CUiMenuPreLoad *_this) |
| SF_String * | build_load_path (CAppMenu *_this, void *preload, SF_String *out) |
| void __thiscall | hooked_prepare_new_game (CAppMenu *_this, CUiMenuPreLoad *preload) |
Custom Campaign selection screen and launch via the vanilla pre-game flow.
FULL reimplementation of CAppMenu::PrepareNewGame - PROTOTYPE.
| #define CAMPAIGN_AUTHOR_H 28 |
Definition at line 691 of file sf_campaign_hook.c.
| #define CAMPAIGN_AUTHOR_Y 88 |
Definition at line 690 of file sf_campaign_hook.c.
| #define CAMPAIGN_DESC_H 360 |
Definition at line 693 of file sf_campaign_hook.c.
| #define CAMPAIGN_DESC_WRAP 40 |
Character width the description wraps at, matching the mod info panel.
Definition at line 700 of file sf_campaign_hook.c.
| #define CAMPAIGN_DESC_Y 140 |
Definition at line 692 of file sf_campaign_hook.c.
| #define CAMPAIGN_NAME_H 48 |
Definition at line 689 of file sf_campaign_hook.c.
| #define CAMPAIGN_NAME_Y 32 |
Definition at line 688 of file sf_campaign_hook.c.
| #define CAMPAIGN_PANEL_WIDTH 443 |
Definition at line 687 of file sf_campaign_hook.c.
| #define CAMPAIGN_PLAY_H 36 |
Definition at line 697 of file sf_campaign_hook.c.
| #define CAMPAIGN_PLAY_W 227 |
Definition at line 696 of file sf_campaign_hook.c.
| #define CAMPAIGN_PLAY_X 108 |
Definition at line 694 of file sf_campaign_hook.c.
| #define CAMPAIGN_PLAY_Y 540 |
Definition at line 695 of file sf_campaign_hook.c.
| #define CAMPAIGN_ROW_H 30 |
Definition at line 708 of file sf_campaign_hook.c.
| #define CAMPAIGN_ROW_PITCH 36 |
Definition at line 706 of file sf_campaign_hook.c.
| #define CAMPAIGN_ROW_W 227 |
Definition at line 707 of file sf_campaign_hook.c.
| #define CAMPAIGN_ROW_X 108 |
Definition at line 704 of file sf_campaign_hook.c.
| #define CAMPAIGN_ROW_Y_START 40 |
Definition at line 705 of file sf_campaign_hook.c.
| #define SFSF_AVATAR_TYPE_BASE 8 |
Custom avatar types run from this value upwards, one per campaign index.
Definition at line 20 of file sf_campaign_hook.h.
| #define SFSF_AVATAR_TYPE_MAX (SFSF_AVATAR_TYPE_BASE + SFSF_MAX_CAMPAIGNS - 1) |
Definition at line 21 of file sf_campaign_hook.h.
| #define SFSF_CAMPAIGN_TYPE_BASE 3 |
Definition at line 17 of file sf_campaign_hook.h.
| #define SFSF_MAX_CAMPAIGNS 16 |
Definition at line 16 of file sf_campaign_hook.h.
| typedef void(__thiscall * AC82_Zero_ptr) (AutoClass82 *_this) |
Definition at line 40 of file sf_campaign_hook.c.
| typedef SF_String *(__thiscall * AC95_get_figure_name_ptr) (void *AC95, SF_String *name_buffer, uint32_t figure_id) |
Definition at line 55 of file sf_campaign_hook.c.
| typedef void(__thiscall * appMenuEnterCampaignFlow_ptr) (CAppMenu *_this, uint32_t param_1) |
Definition at line 53 of file sf_campaign_hook.h.
| typedef GdAvatarInternal *(__thiscall * avatarInternalCopy_ptr) (GdAvatarInternal *dest, GdAvatarInternal *src) |
Definition at line 47 of file sf_campaign_hook.h.
| typedef void(__thiscall * avatarVectorsCopy_ptr) (void *dest_vectors, void *src_vectors) |
Definition at line 50 of file sf_campaign_hook.h.
| typedef uint32_t(__cdecl * checkFileExists_ptr) (SF_String *name) |
The engine's file existence check, resolved by initialize_campaign_hooks().
Paths are taken relative to the game directory, e.g. "map\\mycampaign\\start.map".
Definition at line 70 of file sf_campaign_hook.h.
| typedef uint32_t(__thiscall * CMnuBaseFlagGetter_ptr) (CMnuBase *_this) |
Definition at line 42 of file sf_campaign_hook.c.
| typedef void(__thiscall * CUiGame_009a1fd0_ptr) (void *_this, uint32_t param1) |
Definition at line 45 of file sf_campaign_hook.c.
| typedef void(__thiscall * CUiGameZero_ptr) (void *_this) |
Definition at line 44 of file sf_campaign_hook.c.
| typedef void(__thiscall * CUtlCallBackInit_ptr) (void *_this, void *param1, void *param2, uint32_t param3) |
Definition at line 43 of file sf_campaign_hook.c.
| typedef void(__thiscall * gameInfoSetAvatarType_ptr) (SF_GameInfo *_this, uint16_t avatar_type) |
Definition at line 51 of file sf_campaign_hook.h.
| typedef void(__thiscall * gameInfoSetMapPathFull_ptr) (SF_GameInfo *_this, SF_String *map_path) |
Definition at line 52 of file sf_campaign_hook.h.
| typedef char **(__cdecl * getBasePathString_ptr) (void *out_string_obj) |
Definition at line 63 of file sf_campaign_hook.h.
| typedef LPCSTR *(__cdecl * GetDataStorageLocation_ptr) (char **param_1, uint32_t type) |
Definition at line 37 of file sf_campaign_hook.c.
Definition at line 61 of file sf_campaign_hook.h.
| typedef SF_GameInfo *(__thiscall * initDefaultInfo_ptr) (SF_GameInfo *_this) |
Definition at line 39 of file sf_campaign_hook.c.
| typedef void(__fastcall * playCampaignIntro_ptr) (CAppMenu *_this) |
Definition at line 54 of file sf_campaign_hook.h.
| typedef void(__thiscall * prepareTransition_ptr) (CAppMenu *_this, uint32_t param_1, uint32_t param_2) |
Definition at line 38 of file sf_campaign_hook.c.
| typedef void(__thiscall * some_vector_fun_ptr) (void *_this, uint32_t *size) |
Definition at line 41 of file sf_campaign_hook.c.
| typedef void(__thiscall * startGame_ptr) (CAppMenu *_this, SF_GameInfo *game_info, uint32_t param_2, uint32_t param_3, uint32_t param_4, uint32_t coord, SF_String *param_6) |
Definition at line 56 of file sf_campaign_hook.h.
| typedef void(__thiscall * videoSequenceStop_ptr) (SF_CUiVideoSequence *_this) |
Definition at line 55 of file sf_campaign_hook.h.
Definition at line 134 of file sf_prepare_new_game.c.


| void campaign_hook_on_main_menu | ( | CAppMenu * | app_menu | ) |
| void campaign_launch_flow | ( | int32_t | campaign_index | ) |
Definition at line 755 of file sf_campaign_hook.c.


| void checkDirs | ( | CAppSession * | _this | ) |
| void close_campaign_screen_callback | ( | CMnuSmpButton * | button | ) |
| uint32_t __thiscall getHdrStringID | ( | uint32_t | camp_type | ) |
Definition at line 354 of file sf_campaign_hook.c.
| SF_String *__thiscall getSavePath | ( | CAppSession * | _this, |
| SF_String * | output, | ||
| uint32_t | campaign_type ) |
Definition at line 226 of file sf_campaign_hook.c.


| void __thiscall hooked_prepare_new_game | ( | CAppMenu * | _this, |
| CUiMenuPreLoad * | preload ) |
| void __thiscall initFirstMap | ( | SF_GameInfo * | _this, |
| uint32_t | skip_tutorial, | ||
| uint8_t | skill, | ||
| uint8_t | subskill, | ||
| uint32_t | campaign_id, | ||
| bool | is_shadowblade ) |
Proper map selection code for the future.
| _this | Pointer to the game info structure that holds most of the info we need |
| skip_tutorial | Totu |
| skill | Primary skill for the newly created avatar |
| subskill | Secondary skill for the newly created avatar |
| campaign_id | Campaign ID we're loading. (0 - Order, 1 - Aryn, 2 - Phoenix) |
| is_shadowblade | SotP side flag, used only for the third vanilla campaign |
Definition at line 498 of file sf_campaign_hook.c.


| void initialize_campaign_hooks | ( | ) |
Definition at line 73 of file sf_campaign_hook.c.


|
extern |
Definition at line 64 of file sf_prepare_new_game.c.


| int isDirectoryExists | ( | const char * | path | ) |
| void __thiscall loadQuickSave | ( | CAppMenu * | _this, |
| uint32_t | unknown ) |
| void __thiscall on_campaign_play | ( | CMnuSmpButton * | _this | ) |
Play button callback - launches whatever the list has selected.
Play button callback - launches the campaign currently selected in the list.
Definition at line 817 of file sf_campaign_hook.c.


| void __thiscall on_campaign_selected | ( | CMnuSmpButton * | _this | ) |
Left panel row callback.
Per-campaign list row callback - selects the campaign, does not launch it.
Definition at line 803 of file sf_campaign_hook.c.


| uint8_t __thiscall pn_preload_get_skip_tutorial | ( | CUiMenuPreLoad * | _this | ) |
| uint8_t __thiscall quickLoad_helper | ( | SF_CUiMain * | _this | ) |
| int32_t register_campaign | ( | const SFSF_CampaignDef * | def | ) |
Registers a campaign definition. Returns campaign index or -1.
Definition at line 122 of file sf_campaign_hook.c.

| void __thiscall show_custom_campaign_screen | ( | CMnuSmpButton * | _this | ) |
Builds the campaign screen.
Main-menu button callback - builds and toggles the campaign screen.
Definition at line 840 of file sf_campaign_hook.c.


| void stop_intro_video | ( | CAppMenu * | app_menu | ) |
| AC82_Zero_ptr AC82_Zero |
Definition at line 52 of file sf_campaign_hook.c.
|
extern |
Definition at line 53 of file sf_vanilla_fix_hook.c.
| checkFileExists_ptr checkFileExists |
Definition at line 64 of file sf_campaign_hook.c.
|
extern |
Definition at line 64 of file sf_campaign_hook.c.
| CMnuBaseFlagGetter_ptr CMnuBaseIsVisible |
Definition at line 49 of file sf_campaign_hook.c.
| CreateMenuPreMulti_ptr CreateMenuPreMulti |
Definition at line 56 of file sf_prepare_new_game.c.
| CreateMnuHintExt_ptr CreateMnuHintExt |
Definition at line 55 of file sf_prepare_new_game.c.
| CUiGame_009a1fd0_ptr CUiGame_009a1fd0 |
Definition at line 54 of file sf_campaign_hook.c.
| CUiGameZero_ptr CUiGameZero |
Definition at line 53 of file sf_campaign_hook.c.
| CUtlCallBackInit_ptr CUtlCallBackInit |
Definition at line 61 of file sf_campaign_hook.c.
| int32_t g_active_custom_campaign = -1 |
-1 = vanilla / none active
Definition at line 119 of file sf_campaign_hook.c.
|
extern |
-1 = vanilla / none active
Definition at line 119 of file sf_campaign_hook.c.
| CAppMenu* g_campaign_app_menu = NULL |
Stashed by sf_menu_hook on menu build untested and probably will crash us
Definition at line 120 of file sf_campaign_hook.c.
|
extern |
Stashed by sf_menu_hook on menu build untested and probably will crash us
Definition at line 120 of file sf_campaign_hook.c.
| uint32_t g_campaign_count = 0 |
Definition at line 118 of file sf_campaign_hook.c.
|
extern |
Definition at line 118 of file sf_campaign_hook.c.
| SFSF_CampaignDef g_campaigns[16] |
Definition at line 117 of file sf_campaign_hook.c.
|
extern |
Definition at line 117 of file sf_campaign_hook.c.
| importFromSave_ptr importFromSave |
Definition at line 61 of file sf_prepare_new_game.c.
| initDefaultInfo_ptr initDefaultInfo |
Definition at line 51 of file sf_campaign_hook.c.
| prepareTransition_ptr prepareTransition |
Definition at line 50 of file sf_campaign_hook.c.
| gameInfoSetAvatarType_ptr s_gameinfo_set_avatar_type |
Definition at line 35 of file sf_campaign_hook.c.
|
extern |
Definition at line 35 of file sf_campaign_hook.c.
| getBasePathString_ptr s_get_base_path_string |
Definition at line 34 of file sf_campaign_hook.c.
|
extern |
Definition at line 34 of file sf_campaign_hook.c.
| playCampaignIntro_ptr s_play_campaign_intro |
Definition at line 33 of file sf_campaign_hook.c.
|
extern |
Definition at line 33 of file sf_campaign_hook.c.
| startGame_ptr s_start_game |
Definition at line 32 of file sf_campaign_hook.c.
|
extern |
Definition at line 32 of file sf_campaign_hook.c.
| some_vector_fun_ptr some_vector_dispose |
Definition at line 60 of file sf_campaign_hook.c.
| some_vector_fun_ptr some_vector_init |
Definition at line 59 of file sf_campaign_hook.c.