Skip to content

Commit 240a2ae

Browse files
Merge pull request #13 from undefined06855/main
fix touch priority with Better Touch Prio, among other things
2 parents 18c49e0 + f4ee763 commit 240a2ae

File tree

7 files changed

+105
-101
lines changed

7 files changed

+105
-101
lines changed

.github/workflows/multi-platform.yml

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,57 @@ name: Build Geode Mod
33
on:
44
workflow_dispatch:
55
push:
6-
branches:
7-
- "**"
6+
branches:
7+
- "**"
88

99
jobs:
1010
build:
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
config:
15-
- name: Windows
16-
os: windows-latest
17-
18-
- name: macOS
19-
os: macos-latest
20-
21-
- name: iOS
22-
os: macos-latest
23-
target: iOS
24-
25-
- name: Android32
26-
os: ubuntu-latest
27-
target: Android32
28-
29-
- name: Android64
30-
os: ubuntu-latest
31-
target: Android64
32-
33-
name: ${{ matrix.config.name }}
34-
runs-on: ${{ matrix.config.os }}
35-
36-
steps:
37-
- uses: actions/checkout@v4
38-
39-
- name: Build the mod
40-
uses: geode-sdk/build-geode-mod@main
41-
with:
42-
bindings: geode-sdk/bindings
43-
bindings-ref: main
44-
combine: true
45-
target: ${{ matrix.config.target }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
config:
15+
- name: Windows
16+
os: windows-latest
17+
18+
- name: macOS
19+
os: macos-latest
20+
21+
- name: iOS
22+
os: macos-latest
23+
target: iOS
24+
25+
- name: Android32
26+
os: ubuntu-latest
27+
target: Android32
28+
29+
- name: Android64
30+
os: ubuntu-latest
31+
target: Android64
32+
33+
name: ${{ matrix.config.name }}
34+
runs-on: ${{ matrix.config.os }}
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Build the mod
40+
uses: geode-sdk/build-geode-mod@main
41+
with:
42+
bindings: geode-sdk/bindings
43+
bindings-ref: main
44+
combine: true
45+
target: ${{ matrix.config.target }}
4646

4747
package:
48-
name: Package builds
49-
runs-on: ubuntu-latest
50-
needs: ['build']
51-
52-
steps:
53-
- uses: geode-sdk/build-geode-mod/combine@main
54-
id: build
55-
56-
- uses: actions/upload-artifact@v4
57-
with:
58-
name: Build Output
59-
path: ${{ steps.build.outputs.build-output }}
48+
name: Package builds
49+
runs-on: ubuntu-latest
50+
needs: ['build']
51+
52+
steps:
53+
- uses: geode-sdk/build-geode-mod/combine@main
54+
id: build
55+
56+
- uses: actions/upload-artifact@v4
57+
with:
58+
name: Build Output
59+
path: ${{ steps.build.outputs.build-output }}

CHANGELOG.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.3.3
2+
- Fixed compatibility with Better Touch Prio
3+
14
# 1.3.2
25
- Updated to Geode 4.7.0
36

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
44
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
55

66
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR IOS)
7-
set(CMAKE_OSX_ARCHITECTURES "arm64")
7+
set(CMAKE_OSX_ARCHITECTURES "arm64")
88
else()
9-
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
9+
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
1010
endif()
1111

12-
project(Zoom VERSION 1.1.0)
12+
project(Zoom VERSION 1.0.0)
1313

1414
add_library(${PROJECT_NAME} SHARED
15-
src/main.cpp
16-
src/utils.cpp
17-
src/desktop.cpp
18-
src/mobile.cpp
19-
src/settings.cpp
15+
src/main.cpp
16+
src/utils.cpp
17+
src/desktop.cpp
18+
src/mobile.cpp
19+
src/settings.cpp
2020
)
2121

2222
if (NOT DEFINED ENV{GEODE_SDK})
23-
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
23+
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
2424
else()
25-
message(STATUS "Found Geode: $ENV{GEODE_SDK}")
25+
message(STATUS "Found Geode: $ENV{GEODE_SDK}")
2626
endif()
2727

2828
add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)

build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ if ($platform -eq "windows") {
1414

1515
$gdpid = $null
1616
while ([string]::IsNullOrEmpty($gdpid)) {
17-
Start-Sleep -Milliseconds 100
18-
$gdpid = adb shell pidof com.geode.launcher
19-
}
17+
Start-Sleep -Milliseconds 100
18+
$gdpid = adb shell pidof com.geode.launcher
19+
}
2020

2121
try {
2222
adb logcat --pid $gdpid

mod.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "4.7.0",
2+
"geode": "4.9.0",
33
"gd": {
44
"win": "2.2074",
55
"android": "2.2074",
@@ -8,7 +8,7 @@
88
},
99
"id": "bobby_shmurner.zoom",
1010
"name": "Zoooom!",
11-
"version": "1.3.2",
11+
"version": "1.3.3",
1212
"developer": "Bobby Shmurner",
1313
"description": "Allows you to zoom while paused!",
1414
"links": {
@@ -20,16 +20,16 @@
2020
"importance": "required"
2121
},
2222
"geode.custom-keybinds": {
23-
"version": ">=v1.10.3",
24-
"importance": "required",
23+
"version": ">=v1.10.3",
24+
"importance": "required",
2525
"platforms": ["win", "mac"]
26-
}
26+
}
2727
},
2828
"resources": {
29-
"sprites": [
30-
"resources/*.png"
31-
]
32-
},
29+
"sprites": [
30+
"resources/*.png"
31+
]
32+
},
3333
"tags": [
3434
"enhancement",
3535
"interface",

src/mobile.cpp

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
using namespace geode::prelude;
1111
AndroidZoomLayer* AndroidZoomLayer::instance = nullptr;
12-
12+
1313
AndroidZoomLayer* AndroidZoomLayer::create(CCNode* sceneLayer) {
1414
if (instance) {
1515
instance = nullptr;
@@ -22,7 +22,7 @@ AndroidZoomLayer* AndroidZoomLayer::create(CCNode* sceneLayer) {
2222
instance = layer;
2323
return layer;
2424
}
25-
25+
2626
delete layer;
2727
return nullptr;
2828
}
@@ -36,8 +36,8 @@ bool AndroidZoomLayer::init(CCNode* sceneLayer) {
3636
return false;
3737
}
3838

39-
if (sceneLayer->getChildByID("AnodroidZoomLayer")) {
40-
geode::log::error("AnodroidZoomLayer already exists in scene!");
39+
if (sceneLayer->getChildByID("AndroidZoomLayer"_spr)) {
40+
geode::log::error("AndroidZoomLayer already exists in scene!");
4141
return false;
4242
}
4343

@@ -63,23 +63,24 @@ bool AndroidZoomLayer::init(CCNode* sceneLayer) {
6363
// https://github.com/TheSillyDoggo/GeodeMenu/blob/17b19215b80a263379a560edfaf63c2a3f17e2f8/src/Client/AndroidUI.cpp#L28
6464

6565
auto backMenu = CCMenu::create();
66-
backMenu->ignoreAnchorPointForPosition(false);
67-
backMenu->setContentSize(ccp(0, 0));
68-
backMenu->setPositionX(0);
69-
backMenu->setPositionY(CCDirector::get()->getWinSize().height);
70-
backMenu->setID("back-menu");
66+
backMenu->ignoreAnchorPointForPosition(false);
67+
backMenu->setContentSize(ccp(0, 0));
68+
backMenu->setPositionX(0);
69+
backMenu->setPositionY(CCDirector::get()->getWinSize().height);
70+
backMenu->setID("back-menu");
7171
this->addChild(backMenu);
7272

73-
auto backSpr = CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
73+
auto backSpr = CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
7474
backSpr->setOpacity(100);
75-
76-
auto backBtn = CCMenuItemSpriteExtra::create(backSpr, this, menu_selector(AndroidZoomLayer::onBackButton));
77-
backBtn->setPosition(ccp(24, -23));
78-
backBtn->setSizeMult(1.15f);
7975

80-
backMenu->addChild(backBtn);
81-
82-
this->setID("AnodroidZoomLayer");
76+
auto backBtn = CCMenuItemSpriteExtra::create(backSpr, this, menu_selector(AndroidZoomLayer::onBackButton));
77+
backBtn->setPosition(ccp(24, -23));
78+
backBtn->setSizeMult(1.15f);
79+
80+
backMenu->addChild(backBtn);
81+
82+
this->setID("AndroidZoomLayer"_spr);
83+
this->setZOrder(11); // One above PauseLayer
8384

8485
CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, -250, true);
8586
this->setTouchEnabled(true);
@@ -133,15 +134,15 @@ void AndroidZoomLayer::ccTouchMoved(CCTouch* pTouch, CCEvent* pEvent) {
133134
CCPoint newAnchor = getAnchorPoint(movingTouch, anchoredTouch);
134135
CCPoint deltaAnchor = ccpSub(newAnchor, m_ZoomAnchor);
135136
m_ZoomAnchor = newAnchor;
136-
137+
137138
// Move the play layer based on the delta of the anchor point
138139
CCPoint pos = m_playLayer->getPosition();
139140
m_playLayer->setPosition(pos.x + deltaAnchor.x, pos.y + deltaAnchor.y);
140-
141+
141142
CCPoint delta = movingTouch->getDelta();
142143
CCPoint touchDisplacement = ccpSub(movingTouch->getLocation(), anchoredTouch->getLocation());
143144
float scaleDelta = touchDisplacement.normalize().dot(delta) / 100.0f;
144-
145+
145146
zoomPlayLayer(m_playLayer, scaleDelta, m_ZoomAnchor);
146147
clampPlayLayerPos(m_playLayer);
147148
}
@@ -173,7 +174,7 @@ CCPoint AndroidZoomLayer::getAnchorPoint(CCTouch* movingTouch, CCTouch* anchored
173174
(movingTouchPos.y + anchoredTouchPos.y) / 2
174175
);
175176
}
176-
177+
177178
class $modify(AndroidZoomPauseLayer, PauseLayer) {
178179
void customSetup() {
179180
PauseLayer::customSetup();
@@ -183,10 +184,10 @@ class $modify(AndroidZoomPauseLayer, PauseLayer) {
183184
auto zoomButtonSprite = CircleButtonSprite::createWithSprite("zoom_button.png"_spr, 1.0f, CircleBaseColor::Green, CircleBaseSize::MediumAlt);
184185
zoomButtonSprite->getTopNode()->setScale(1.0f);
185186
zoomButtonSprite->setScale(0.6f);
186-
187+
187188
auto zoomButton = CCMenuItemSpriteExtra::create(zoomButtonSprite, this, menu_selector(AndroidZoomPauseLayer::onZoomButton));
188189
zoomButton->setID("zoom-button"_spr);
189-
190+
190191
rightButtonMenu->addChild(zoomButton);
191192
rightButtonMenu->updateLayout();
192193
}

src/settings.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ void SettingsManager::init() {
3636
zoomSensitivity = sensitivity;
3737
});
3838

39-
BindManager::get()->registerBindable({
40-
"toggle_menu"_spr,
41-
"Toggle Pause Menu",
42-
"",
43-
{ Keybind::create(KEY_Home, Modifier::None) },
44-
"Zoom",
39+
BindManager::get()->registerBindable({
40+
"toggle_menu"_spr,
41+
"Toggle Pause Menu",
42+
"",
43+
{ Keybind::create(KEY_Home, Modifier::None) },
44+
"Zoom",
4545
false
46-
});
46+
});
4747
#endif // GEODE_IS_DESKTOP
4848
}

0 commit comments

Comments
 (0)