Add custom mouse mode frms

This commit is contained in:
Alexander Batalov 2022-08-12 14:19:16 +03:00
parent d86a887cf9
commit a55feb9301
2 changed files with 24 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#include "object.h" #include "object.h"
#include "proto.h" #include "proto.h"
#include "proto_instance.h" #include "proto_instance.h"
#include "sfall_config.h"
#include "skill.h" #include "skill.h"
#include "skilldex.h" #include "skilldex.h"
#include "text_font.h" #include "text_font.h"
@ -314,6 +315,8 @@ static int gameMouseHandleScrolling(int x, int y, int cursor);
static int objectIsDoor(Object* object); static int objectIsDoor(Object* object);
static bool gameMouseClickOnInterfaceBar(); static bool gameMouseClickOnInterfaceBar();
static void customMouseModeFrmsInit();
// 0x44B2B0 // 0x44B2B0
int gameMouseInit() int gameMouseInit()
{ {
@ -330,6 +333,9 @@ int gameMouseInit()
gameMouseSetCursor(MOUSE_CURSOR_ARROW); gameMouseSetCursor(MOUSE_CURSOR_ARROW);
// SFALL
customMouseModeFrmsInit();
return 0; return 0;
} }
@ -2409,3 +2415,14 @@ int objectIsDoor(Object* object)
return proto->scenery.type == SCENERY_TYPE_DOOR; return proto->scenery.type == SCENERY_TYPE_DOOR;
} }
static void customMouseModeFrmsInit()
{
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_FIRST_AID_FRM_KEY, &(gGameMouseModeFrmIds[GAME_MOUSE_MODE_USE_FIRST_AID]));
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_DOCTOR_FRM_KEY, &(gGameMouseModeFrmIds[GAME_MOUSE_MODE_USE_DOCTOR]));
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_LOCKPICK_FRM_KEY, &(gGameMouseModeFrmIds[GAME_MOUSE_MODE_USE_LOCKPICK]));
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_STEAL_FRM_KEY, &(gGameMouseModeFrmIds[GAME_MOUSE_MODE_USE_STEAL]));
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_TRAPS_FRM_KEY, &(gGameMouseModeFrmIds[GAME_MOUSE_MODE_USE_TRAPS]));
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_SCIENCE_FRM_KEY, &(gGameMouseModeFrmIds[GAME_MOUSE_MODE_USE_SCIENCE]));
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_USE_REPAIR_FRM_KEY, &(gGameMouseModeFrmIds[GAME_MOUSE_MODE_USE_REPAIR]));
}

View File

@ -45,6 +45,13 @@
#define SFALL_CONFIG_DAMAGE_MOD_FORMULA_KEY "DamageFormula" #define SFALL_CONFIG_DAMAGE_MOD_FORMULA_KEY "DamageFormula"
#define SFALL_CONFIG_BONUS_HTH_DAMAGE_FIX_KEY "BonusHtHDamageFix" #define SFALL_CONFIG_BONUS_HTH_DAMAGE_FIX_KEY "BonusHtHDamageFix"
#define SFALL_CONFIG_DISPLAY_BONUS_DAMAGE_KEY "DisplayBonusDamage" #define SFALL_CONFIG_DISPLAY_BONUS_DAMAGE_KEY "DisplayBonusDamage"
#define SFALL_CONFIG_USE_LOCKPICK_FRM_KEY "Lockpick"
#define SFALL_CONFIG_USE_STEAL_FRM_KEY "Steal"
#define SFALL_CONFIG_USE_TRAPS_FRM_KEY "Traps"
#define SFALL_CONFIG_USE_FIRST_AID_FRM_KEY "FirstAid"
#define SFALL_CONFIG_USE_DOCTOR_FRM_KEY "Doctor"
#define SFALL_CONFIG_USE_SCIENCE_FRM_KEY "Science"
#define SFALL_CONFIG_USE_REPAIR_FRM_KEY "Repair"
#define SFALL_CONFIG_BURST_MOD_DEFAULT_CENTER_MULTIPLIER 1 #define SFALL_CONFIG_BURST_MOD_DEFAULT_CENTER_MULTIPLIER 1
#define SFALL_CONFIG_BURST_MOD_DEFAULT_CENTER_DIVISOR 3 #define SFALL_CONFIG_BURST_MOD_DEFAULT_CENTER_DIVISOR 3