Jump to content

Mjnooon99

Member
  • Posts

    39
  • Joined

  • Last visited

Everything posted by Mjnooon99

  1. addTextfieldHook(@"Hook name", @"Description of hook", font, address of function that you are hooking, the name of the function you are using for the hook, the name of the function you aren't using for the hook); To get the value from the textfield, you'll have to use one of these methods based on what your hooked function return type is: int val = [[TextfieldHook getTextfieldValueForHook:@"hook name here"] intValue]; float val = [[TextfieldHook getTextfieldValueForHook:@"hook name here"] floatValue]; If I wanted to add a textfield that allowed the user to input their FOV, I would write this line of code: addTextfieldHook(@"FOV Textfield", @"Input the value you want for your FOV.", font, 0xc392da, (void *)_getFovHooked, (void *)getFovOrig); And the hooked functions would look like this: float (*getFovOrig)(void *_this); float _getFovHooked(void *_this){ if([TextfieldHook getTextfieldValueForHook:@"FOV Textfield"] != nil){ //the textfield will be empty on first run, and we don't want to return a nil value return [[TextfieldHook getTextfieldValueForHook:@"FOV Textfield"] floatValue]; } return getFovOrig(_this); } NOTICE! Always add (void *) to the beginning of the last two parameters if you are adding hooks. This is called casting, don't worry about it. Just know that it is needed. Here is what your mod menu will generally look like if you choose green as your theme color and Copperplate-Bold as your font: Credits: - me - @DiDA (for animation ideas!)
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines