--- Daodan/src/Patches/Cheater.c 2014/04/07 10:33:27 994 +++ Daodan/src/Patches/Cheater.c 2015/03/23 23:29:19 1017 @@ -9,6 +9,8 @@ #include "../Daodan.h" #include "../Daodan_Config.h" #include "Cheater.h" +#include "Input.h" +#include "Utility.h" union MSVC_EVIL_FLOAT_HACK { @@ -252,8 +254,7 @@ uint8_t ONICALL DDrCheater(uint32_t chea } case cheat_elderrune: { - ConfigOption_t* co = DDrConfig_GetOptOfType("patch.bsl", C_BOOL); - if (co->value.intBoolVal) + if (DDrConfig_GetOptOfType("modding.d_regen", C_BOOL)->value.intBoolVal) { int* Regeneration = &ONgGameState->PlayerCharacter->RegenHax; if(*Regeneration) @@ -293,4 +294,22 @@ void __stdcall FallingFrames(void* Ebp) if (inc_fallingframes) ++*((unsigned int*)((char*)Ebp + 0xf6)); } - + + +static void BindableCheatCallback (CustomActionCallbackArgument cheatnum) { + uint8_t res = DDrCheater (cheatnum); + if (res) + COrMessage_Print(DDr_CheatTable[cheatnum].message_on, 0, 240); + else + COrMessage_Print(DDr_CheatTable[cheatnum].message_off, 0, 240); +} + +void InitBindableCheats() { + oniCheatCode* cur; + for (cur = DDr_CheatTable; cur->name != 0; cur++) { +// char* val = malloc(20); +// sprintf(val, "cheat_%s", cur->name); + Input_RegisterCustomAction (cur->name, EVENT_KEYPRESS, 0, BindableCheatCallback, cur->func); + } +} +