Hello @Ted2,
I always use the MOD MENU template.
I want you to tell me.
So far, we have created a MOD menu with only "OffsetSwitch", but we want to create a Damage Multiplier from 1 to 10 times using "SliderSwitch".
I made it as follows, but please let me know if there is not enough description.
IDA
text: 0000000101234567 FMOV S2, # 1.0
(#1.0 = AttackDamage x1, #2.0 = AttackDamage x2, ... , #10.0 = AttackDamage x10)
Tweak.xm
#import "Macros.h"
/**********************************
INSIDE THIS FUNCTION YOU'LL HAVE TO CREATE YOUR SWITCHES!
***********************************/
int(*old_attack_damage)(void *this_);
int attack_damage(void *this_) {
int userAmount = [[switches getValueFromSwitch:@"Attack Damage:"] intValue];
if([switches isSwitchOn:@"Attack Damage:"]) {
return userAmount;
}
return old_attack_damage(this_);
}
void setup() {
//public int attack_damage(); // RVA: 0x101234567 Offset: 0x1234567
HOOK(0x101234567, attack_damage, old_attack_damage);
// Slider Switch - used in hooking!
[switches addSliderSwitch:@"Attack Damage: "
description:@"custom Attack Damage!"
minimumValue:1
maximumValue:10
sliderColor:[UIColor colorWithRed:0.74 green:0.00 blue:0.00 alpha:1.0]];
}
/**********************************************************************************************************
You can customize the menu here
Good site for specific UIColor: https://www.uicolor.xyz/#/rgb-to-ui
NOTE: remove the ";" when you copy your UIColor from there!
Site to find your perfect font for the menu: http://iosfonts.com/ --> view on mac or ios device
See comment next to maxVisibleSwitches!!!!
************************************************************************************************************/
void setupMenu() {
menu = [[Menu alloc] initWithTitle:@"@@APPNAME@@ - Mod Menu"
titleColor:[UIColor whiteColor]
titleFont:@"Copperplate-Bold"
credits:@"This Mod Menu has been made by @@USER@@, do not share this without proper credits or my permission. \n\nEnjoy!"
headerColor:[UIColor colorWithRed:0.74 green:0.00 blue:0.00 alpha:1.0]
switchOffColor:[UIColor darkGrayColor]
switchOnColor:[UIColor colorWithRed:0.00 green:0.68 blue:0.95 alpha:1.0]
switchTitleFont:@"Copperplate-Bold"
switchTitleColor:[UIColor whiteColor]
infoButtonColor:[UIColor colorWithRed:0.74 green:0.00 blue:0.00 alpha:1.0]
maxVisibleSwitches:4 // Less than max -> blank space, more than max -> you can scroll!
menuWidth:250];
//once menu has been initialized, it will run the setup functions. In the setup function, you create your switches!
setup();
}
/*
If the menu button doesn't show up; Change the timer to a bigger amount.
*/
static void didFinishLaunching(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef info) {
timer(5) {
SCLAlertView *alert = [[SCLAlertView alloc] initWithNewWindow];
// Website link, remove it if you don't need it.
[alert addButton: @"Visit Me!" actionBlock: ^(void) {
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: @"@@SITE@@"]];
timer(2) {
setupMenu();
});
}];
[alert addButton: @"Thankyou, understood." actionBlock: ^(void) {
timer(2) {
setupMenu();
});
}];
alert.shouldDismissOnTapOutside = NO;
alert.customViewColor = [UIColor purpleColor];
alert.showAnimationType = SCLAlertViewShowAnimationSlideInFromCenter;
[alert showSuccess: nil
subTitle:@"@@APPNAME@@ - Mod Menu \n\nThis Mod Menu has been made by @@USER@@, do not share this without proper credits or my permission. \n\nEnjoy!"
closeButtonTitle:nil
duration:99999999.0f];
});
}
%ctor {
CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), NULL, &didFinishLaunching, (CFStringRef)UIApplicationDidFinishLaunchingNotification, NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
}
---
I'm sorry for your busy time.
Thank you.