--- Daodan/src/Daodan_Config.c 2014/07/04 15:42:25 1007 +++ Daodan/src/Daodan_Config.c 2021/10/24 02:50:32 1162 @@ -2,6 +2,7 @@ #include #include +#include "Daodan.h" #include "Daodan_Config.h" #include "Daodan_Patch.h" #include "Patches/Utility.h" @@ -11,8 +12,6 @@ #include "Inifile_Reader.h" -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) - static const char* iniName = "daodan.ini"; static const char* helpFile = "daodan_help.txt"; @@ -47,6 +46,16 @@ ConfigSection_t config[] = { { 0, 0, 0, {0}, {0} } } }, { "gameplay", "Gameplay", { + { "bindablecheats", + "Allows cheats to be bound to keys. Requires 'customactions' and 'cheattable' to be true.", + C_BOOL, + {.intBoolVal = true}, + {.intBoolVal = true} }, + { "characterawareness", + "Makes AI remember the player.", + C_BOOL, + {.intBoolVal = true}, + {.intBoolVal = true} }, { "cheatsenabled", "Enables cheats without having to beat the game first.", C_BOOL, @@ -62,6 +71,11 @@ ConfigSection_t config[] = { C_BOOL, {.intBoolVal = true}, {.intBoolVal = true} }, + { "customactions", + "Allows more actions to be bound through Daodan.", + C_BOOL, + {.intBoolVal = true}, + {.intBoolVal = true} }, { "kickguns", "EXPERIMENTAL! Unfinished, do not use.", C_BOOL, @@ -285,6 +299,9 @@ void DDrConfig_Print() break; case C_CMD: break; + case C_FLOAT: + STARTUPMESSAGE("Option %s.%s = %f (def %f)", config[s].name, co->name, co->value.floatVal, co->defaultValue.floatVal); + break; default: STARTUPMESSAGE("Option %s.%s = %d (def %d)", config[s].name, co->name, co->value.intBoolVal, co->defaultValue.intBoolVal); } @@ -346,6 +363,8 @@ const char* DDrConfig_GetOptionTypeName( switch (type) { case C_INT: return "Int"; + case C_FLOAT: + return "Float"; case C_BOOL: return "Bool"; case C_STRING: @@ -376,6 +395,10 @@ const char* DDrConfig_GetOptionValueStri return (boolV ? "true" : "false"); case C_CMD: return 0; + case C_FLOAT: + val = malloc(50); + sprintf(val, "%f", optVal->floatVal); + return val; default: val = malloc(20); sprintf(val, "%d", boolV); @@ -396,6 +419,8 @@ char DDrConfig_NonDefaultOptionValue(Con return 0; case C_INT: return opt->defaultValue.intBoolVal != opt->value.intBoolVal; + case C_FLOAT: + return opt->defaultValue.floatVal != opt->value.floatVal; } return 0; } @@ -512,6 +537,9 @@ void DDrIniCallback(const char* section, case C_INT: co->value.intBoolVal = strtol(value, NULL, 0); break; + case C_FLOAT: + co->value.floatVal = strtof(value, NULL); + break; case C_BOOL: co->value.intBoolVal = !_stricmp(value, "true"); break;