Add option to disable on-screen haptics
This commit is contained in:
1 parent
a10b052f8f
commit
0426c4ef32
5 files changed
+25
-6
No files matched your search
@@ -146,6 +146,7 @@ void loadPreferences(BOOL reset) {
|
||||
setDefaultValueForPref(envPrefDict, @"hardware_hide", @NO);
|
||||
setDefaultValueForPref(envPrefDict, @"silence_other_audio", @NO);
|
||||
setDefaultValueForPref(envPrefDict, @"silence_with_switch", @NO);
|
||||
setDefaultValueForPref(envPrefDict, @"disable_haptics", @NO);
|
||||
setDefaultValueForPref(prefDict, @"slimmed", @NO);
|
||||
fillDefaultWarningDict();
|
||||
setDefaultValueForPref(prefDict, @"slideable_hotbar", @NO);
|
||||
|
||||
@@ -294,6 +294,11 @@ typedef void(^CreateView)(UITableViewCell *, NSString *, NSDictionary *);
|
||||
@"hasDetail": @YES,
|
||||
@"type": self.typeSwitch,
|
||||
},
|
||||
@{@"key": @"disable_haptics",
|
||||
@"icon": @"wave.3.left",
|
||||
@"hasDetail": @NO,
|
||||
@"type": self.typeSwitch,
|
||||
},
|
||||
@{@"key": @"slideable_hotbar",
|
||||
@"hasDetail": @YES,
|
||||
@"icon": @"slider.horizontal.below.rectangle",
|
||||
|
||||
@@ -652,7 +652,9 @@ BOOL slideableHotbar;
|
||||
|
||||
- (void)surfaceOnClick:(UITapGestureRecognizer *)sender {
|
||||
if (sender.state == UIGestureRecognizerStateBegan || sender.state == UIGestureRecognizerStateEnded){
|
||||
[self.lightHaptic impactOccurred];
|
||||
if(![getPreference(@"disable_haptics") boolValue]) {
|
||||
[self.lightHaptic impactOccurred];
|
||||
}
|
||||
}
|
||||
|
||||
if (!self.shouldTriggerClick) return;
|
||||
@@ -677,7 +679,9 @@ BOOL slideableHotbar;
|
||||
|
||||
- (void)surfaceOnDoubleClick:(UITapGestureRecognizer *)sender {
|
||||
if (sender.state == UIGestureRecognizerStateBegan || sender.state == UIGestureRecognizerStateEnded){
|
||||
[self.lightHaptic impactOccurred];
|
||||
if(![getPreference(@"disable_haptics") boolValue]) {
|
||||
[self.lightHaptic impactOccurred];
|
||||
}
|
||||
}
|
||||
|
||||
if (sender.state == UIGestureRecognizerStateRecognized && isGrabbing) {
|
||||
@@ -723,7 +727,9 @@ BOOL slideableHotbar;
|
||||
-(void)surfaceOnLongpress:(UILongPressGestureRecognizer *)sender
|
||||
{
|
||||
if (sender.state == UIGestureRecognizerStateBegan || sender.state == UIGestureRecognizerStateEnded){
|
||||
[self.mediumHaptic impactOccurred];
|
||||
if(![getPreference(@"disable_haptics") boolValue]) {
|
||||
[self.mediumHaptic impactOccurred];
|
||||
}
|
||||
}
|
||||
|
||||
if (!slideableHotbar) {
|
||||
@@ -759,7 +765,9 @@ BOOL slideableHotbar;
|
||||
|
||||
- (void)surfaceOnTouchesScroll:(UIPanGestureRecognizer *)sender {
|
||||
if (sender.state == UIGestureRecognizerStateBegan || sender.state == UIGestureRecognizerStateEnded){
|
||||
[self.lightHaptic impactOccurred];
|
||||
if(![getPreference(@"disable_haptics") boolValue]) {
|
||||
[self.lightHaptic impactOccurred];
|
||||
}
|
||||
}
|
||||
|
||||
if (isGrabbing) return;
|
||||
@@ -870,7 +878,9 @@ int currentVisibility = 1;
|
||||
|
||||
- (void)executebtn_down:(ControlButton *)sender
|
||||
{
|
||||
[self.lightHaptic impactOccurred];
|
||||
if(![getPreference(@"disable_haptics") boolValue]) {
|
||||
[self.lightHaptic impactOccurred];
|
||||
}
|
||||
|
||||
if (sender.savedBackgroundColor == nil) {
|
||||
[self executebtn:sender withAction:ACTION_DOWN];
|
||||
@@ -920,7 +930,9 @@ int currentVisibility = 1;
|
||||
[self executebtn:sender withAction:ACTION_UP];
|
||||
}
|
||||
|
||||
[self.lightHaptic impactOccurred];
|
||||
if(![getPreference(@"disable_haptics") boolValue]) {
|
||||
[self.lightHaptic impactOccurred];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)executebtn_up_inside:(ControlButton *)sender {
|
||||
|
||||
Binary file not shown.
@@ -192,6 +192,7 @@
|
||||
"preference.detail.gesture_mouse" = "Enables gestures, such as tap to place block, hold to break block, scrolling with 2 fingers";
|
||||
"preference.title.gesture_hotbar" = "Hotbar gestures";
|
||||
"preference.detail.gesture_hotbar" = "Enables gestures, such as touch the hotbar slot, swap items between hand, throw items";
|
||||
"preference.title.disable_haptics" = "Disable on-screen haptics";
|
||||
"preference.title.press_duration" = "Long-press duration (ms)";
|
||||
"preference.detail.press_duration" = "Trigger press duration for destroying blocks and dropping items.";
|
||||
"preference.title.button_scale" = "On-screen button scale (%)";
|
||||
|
||||
Reference in new issue
Block a user