diff --git a/mod.json b/mod.json index d378e1c2..52689b88 100644 --- a/mod.json +++ b/mod.json @@ -29,13 +29,15 @@ "type": "bool", "default": true, "name": "Zoom Towards Cursor", - "description": "When enabled and while holding down the CTRL key, zooming in the editor with the scroll wheel will be zoomed toward the cursor and not the center of the screen" + "description": "When enabled and while holding down the CTRL key, zooming in the editor with the scroll wheel will be zoomed toward the cursor and not the center of the screen", + "platforms": ["windows", "macos"] }, - "better-font-select": { + "pinch-to-zoom": { "type": "bool", "default": true, - "name": "Better Font Select", - "description": "Replaces the old font select screen with a better one with scrolling" + "name": "Pinch to Zoom", + "description": "When enabled, you can use two fingers to zoom", + "platforms": ["android32", "android64"] }, "scale-factor": { "type": "float", @@ -61,6 +63,12 @@ "name": "Scale Build Tabs", "description": "Whether the tabs above the object selection area should be scaled according to the scale factor aswell" }, + "better-font-select": { + "type": "bool", + "default": true, + "name": "New Font Selection Menu", + "description": "Replaces the old font select screen with a better one with scrolling" + }, "new-color-menu": { "type": "bool", "default": true, diff --git a/src/features/PinchToZoom.cpp b/src/features/PinchToZoom.cpp index 1845243a..a8dff5cf 100644 --- a/src/features/PinchToZoom.cpp +++ b/src/features/PinchToZoom.cpp @@ -17,6 +17,9 @@ class $modify(EditorUI) { $override bool ccTouchBegan(CCTouch* touch, CCEvent* event) override { + if (!Mod::get()->getSettingValue("pinch-to-zoom")) { + return EditorUI::ccTouchBegan(touch, event); + } if (m_fields->touches.size() == 1 || EditorUI::ccTouchBegan(touch, event)) { m_fields->touches.insert(touch); return true; @@ -26,6 +29,9 @@ class $modify(EditorUI) { $override void ccTouchMoved(CCTouch* touch, CCEvent* event) override { + if (!Mod::get()->getSettingValue("pinch-to-zoom")) { + return EditorUI::ccTouchMoved(touch, event); + } if (m_fields->touches.size() == 2) { // thanks https://math.stackexchange.com/questions/4408515/calculate-coordinates-after-pinch-to-zoom-gesture!! @@ -76,12 +82,18 @@ class $modify(EditorUI) { $override void ccTouchEnded(CCTouch* touch, CCEvent* event) override { + if (!Mod::get()->getSettingValue("pinch-to-zoom")) { + return EditorUI::ccTouchEnded(touch, event); + } EditorUI::ccTouchEnded(touch, event); m_fields->touches.erase(touch); } $override void ccTouchCancelled(CCTouch* touch, CCEvent* event) override { + if (!Mod::get()->getSettingValue("pinch-to-zoom")) { + return EditorUI::ccTouchCancelled(touch, event); + } EditorUI::ccTouchCancelled(touch, event); m_fields->touches.erase(touch); }