ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Patches/Cheater.c
(Generate patch)

Comparing Daodan/src/Patches/Cheater.c (file contents):
Revision 994 by alloc, Mon Apr 7 10:33:27 2014 UTC vs.
Revision 1163 by rossy, Sun Oct 24 02:50:48 2021 UTC

# Line 9 | Line 9
9   #include "../Daodan.h"
10   #include "../Daodan_Config.h"
11   #include "Cheater.h"
12 + #include "Input.h"
13 + #include "Utility.h"
14  
15   union MSVC_EVIL_FLOAT_HACK
16   {
# Line 252 | Line 254 | uint8_t ONICALL DDrCheater(uint32_t chea
254                  }
255                  case cheat_elderrune:
256                  {
257 <                        ConfigOption_t* co = DDrConfig_GetOptOfType("patch.bsl", C_BOOL);
256 <                        if (co->value.intBoolVal)
257 >                        if (DDrConfig_GetOptOfType("modding.d_regen", C_BOOL)->value.intBoolVal)
258                          {
259                                  int* Regeneration = &ONgGameState->PlayerCharacter->RegenHax;
260                                  if(*Regeneration)
# Line 293 | Line 294 | void __stdcall FallingFrames(void* Ebp)
294          if (inc_fallingframes)
295                  ++*((unsigned int*)((char*)Ebp + 0xf6));
296   }
297 <
297 >
298 >
299 > static void BindableCheatCallback (intptr_t cheatnum) {
300 >        uint8_t res = DDrCheater (cheatnum);
301 >        if (res)
302 >                COrMessage_Print(DDr_CheatTable[cheatnum].message_on, 0, 240);
303 >        else
304 >                COrMessage_Print(DDr_CheatTable[cheatnum].message_off, 0, 240);
305 > }
306 >
307 > void InitBindableCheats() {
308 >        oniCheatCode* cur;
309 >        for (cur = DDr_CheatTable; cur->name != 0; cur++) {
310 >                DDrInput_RegisterCustomAction(cur->name, DDcEventType_KeyPress,
311 >                                              BindableCheatCallback, cur->func);
312 >        }
313 > }
314 >

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)